diff --git "a/pydantic__pydantic-5386/docstore.json" "b/pydantic__pydantic-5386/docstore.json" new file mode 100644--- /dev/null +++ "b/pydantic__pydantic-5386/docstore.json" @@ -0,0 +1 @@ +{"docstore/metadata": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/changes/make_history.py__usr_bin_env_python3_": {"doc_hash": "f6b1baa0d221fcfc1f5289bf8cbd5efd5ff93a105443690190960b2c0e9feec0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_from_dataclasses_import_d_": {"doc_hash": "81190ed615571097176392308517eede858d9928d01a806c6dbbee80363344d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_json_on_files.return.files": {"doc_hash": "37a08382790c2997a14df13114b3b48f3c86c802e1f640e31452c12275aee21f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_on_page_markdown_on_page_markdown.if_md_add_version_mark.else_.return.markdown": {"doc_hash": "b150bd5e39f2ddf6a630d56b5127e7141cc9f80d6fb69544cd9a4ed6dcaa433d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_changelog_MAX_MINOR_VERSION.11": {"doc_hash": "e72557ed29242277948461c597804eb051f59c6e09551a0e087118300cce2bfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_upgrade_python_upgrade_python.return.re_sub_r_py_n_": {"doc_hash": "4b4050e245dd854f5c529407aeac679c97ac32f71b628f52925e6caeb82a0b61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py__upgrade_code_insert_json_output.return.re_sub_r_n_": {"doc_hash": "52a1ec2a30a623682f49813b4398f7c5ab4cce5ffe20ab94c6b6c38c8e7c3b80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_remove_code_fence_attributes_remove_code_fence_attributes.return.re_sub_r_py_": {"doc_hash": "1eb946003371015e36c4cbe7d2ae9e7f4ce6a1be3f053d8cf8b267a8caf7e70c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_version__generate_table_heading.return._generate_table_row_col_n": {"doc_hash": "ee2798ff51ba685cd18eef9125e302d1a599a9af335c7b98fc0d6e6f802c3785"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_schema_mappings_build_schema_mappings.return.re_sub_r_schema_mappi": {"doc_hash": "97a1e11f31c4cae11b0af09a98c2fe71a3935a9e9b9a4247cb1c504129f39175"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_conversion_table_": {"doc_hash": "ddbb9992dec8db3566de481cb825db473f34d412c00c1092795b036278d02a87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py_from_pydantic_core_import_": {"doc_hash": "6db1c8c84377fde3523eef9d051e06d1226ec6fca6fc17bce635e26ee1ff478c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py____CSS3_Colors_as_name_h": {"doc_hash": "435dbbe5005947c33f5e1ab699155f1058c0de77998be276a47bdd21bbd8fcc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__color_regexes_None_5": {"doc_hash": "fd775bd9bfe72a30bc010a1238cd3b72888b76187d80a34e46a3431bb40d8854"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_6__registered_2.pass": {"doc_hash": "e2aecfad025befa455d37be0ee78a5c0a9a22bd199ab220c821cb0e433b8f8f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__registered_3_resolves.return.inner": {"doc_hash": "28bf417927a826162c8a0b3368fcaa0ee9379657c65063ef524acf04c2993efe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__Type_to_strategy_resolv_resolve_json.return.st_builds_": {"doc_hash": "b2b16072390a189cb529d60802f421ca865aa87b43841ca78252d756ea07ca20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__resolves_pydantic_Cons_resolve_conbytes.return.st_from_regex_pattern_enc": {"doc_hash": "b143742ddec6542a10dff6be2ea5bdf98992d86b50ddc958c1e1e705153491ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_42_resolve_condecimal.return.s": {"doc_hash": "71b5c05d03060a68fee42f2a4f8c0e4a0d38bca2decedbf1a4448af26854e6c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_43_resolve_confloat.return.st_integers_min_value_ma": {"doc_hash": "ccaaf131497b9185e5b46dc22eb3fc9aa504ec97d44e46c2a47d8f15efb2ffb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_44_resolve_conint.return.st_integers_min_value_ma": {"doc_hash": "af9cb93aebebd1cfe6b46405e9297b37bd39c99be059a958d234e33e37bf4e6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_45_resolve_condate.return.st_dates_min_value_max_v": {"doc_hash": "992136b7afb8fa108d14dc05e2d6dcf98c648e05dff84ec7c3e571ada0f87bf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_46_": {"doc_hash": "6ad4d2ee36185548383d5e78a7b6fdde814bb9565212628eb0a75c055e6a976e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_from___future___import_an_CoreMetadata.pydantic_js_prefer_positional_arguments": {"doc_hash": "bed2df58470055b2c05dea6b88f2d52de4a81b5448ebb97887ac441722068682"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_UpdateCoreSchemaCallable_CoreMetadataHandler.__init__.if_metadata_is_None_.elif_not_isinstance_metad.raise_TypeError_f_CoreSch": {"doc_hash": "728e34e955e9caabb4876be1134ec59f0f9967b4537c28990213cbe6ce1713ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.metadata_CoreMetadataHandler.get_js_cs_override.return.js_cs_override": {"doc_hash": "4c28fc6310ca372d98aab94754f6251dbe740fa57f96d9ce49593d7fbbcc6a5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.compose_js_modify_functions_CoreMetadataHandler.compose_js_modify_functions.self_metadata_pydantic_j": {"doc_hash": "3b0bbd5e4529238d9f55be4d6dc9952307394f14855e132ce221ff378cc75e1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.apply_js_modify_function_CoreMetadataHandler.apply_js_modify_function.return.modified_schema": {"doc_hash": "1f6411a9d961b4c71732f7a9948220560ec71a29555ae6ac017dcbd326268937"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_build_metadata_dict_build_metadata_dict.return.metadata": {"doc_hash": "48d190b1ac634d7a669ad013c976c95f2cfdee5bd633ed942790eb2704480540"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_compose_js_modify_functions_": {"doc_hash": "4e30946378b99d8bb9b94bf6e31844f85d7c5f0a22f3061e52bd23f797c9f893"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__TODO_Should_we_move_Wa_is_list_like_schema_with_items_schema.return.schema_type_in_list_": {"doc_hash": "82e88703441aa22e9b8c5e7b7778ccfdb6d4a389f02276aa0e5afc0d926f883a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_get_type_ref_get_type_ref.return.type_ref": {"doc_hash": "d5b157ebcdafd07392e66912969322c81d16f1483bba2b677c770dffe7330ce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_consolidate_refs_consolidate_refs.return.schema": {"doc_hash": "1204f3cf8e332913fc69f8fb70124ce280f83e99c43da383f08e748de3e94238"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_collect_definitions_collect_definitions.return.valid_definitions": {"doc_hash": "b09b703cf8b23abcb22da0850db854a0cc975f56a1f29ac0885d933e434542e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_remove_unnecessary_invalid_definitions_remove_unnecessary_invalid_definitions.return.WalkAndApply__remove_inva": {"doc_hash": "540b1c7131e31930fb654b15d024dcd49acfba9afadb996eb48d033f50258165"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_define_expected_missing_refs_collect_invalid_schemas.return.invalid_schemas": {"doc_hash": "1f5eeda69b7476aa017b7b2ee09f03bb218a57e5da6548cd9cfb6babd2973c2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply_WalkAndApply._handle_other_schemas.return.schema": {"doc_hash": "d4ddf758aa8cc37a850955dee2ca63e9b3513b84d9101c6432a87100e8055450"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_definitions_schema_WalkAndApply.handle_definitions_schema.return.new_schema": {"doc_hash": "6db6e5e7c150c3371de22d4d72bb2852fdb703898a3ba4e0980690b54ac25aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_list_schema_WalkAndApply.handle_lax_or_strict_schema.return.schema": {"doc_hash": "f746ab3cf038de1de6c57829ae3952060a453c3d4764e5f4542577219e1f91dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_typed_dict_schema_WalkAndApply.handle_typed_dict_schema.return.schema": {"doc_hash": "7dae8666f0b08385b77b77d174f5b5c2a949d1d2722590929211506e535f747c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_arguments_schema_": {"doc_hash": "bfe8b8f3d9f228190c366bfc7e93fdb1162070f5a1a2db35dcc164781ec19948"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py___if_typing_TYPE_CHECKING_.PydanticDataclass.__pydantic_config__": {"doc_hash": "35c2b58b000b6454adc00603d6a115d865ab22edcab6f60ed7c85f1869d9a2ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_prepare_dataclass_prepare_dataclass.return.True": {"doc_hash": "5bb014e637c84c24c63a31d635ea8031706f1b13403d636b88698a4c9af344c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_is_builtin_dataclass_": {"doc_hash": "ea90a35bd553e92375144ee2eb958f5e0eba33e6e4a0d14f98f2c89a36420066"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py___FIELD_SERIALIZER_TAG.__field_serializer_": {"doc_hash": "ce0d31d986a1091febfae3a9213d9899a5c756c2ee331554d7967cd947a4b314"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ValidatorDecoratorInfo_ValidatorDecoratorInfo.__init__.self.check_fields.check_fields": {"doc_hash": "ff32e78a654727e7ff31fed7d9435dda62ef67b7dbf4b847fa9b161bc50dce3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldValidatorDecoratorInfo_RootValidatorDecoratorInfo.__init__.self.mode.mode": {"doc_hash": "d919c28a37e9c015d76ce4f12f681fab584cdf651c0c7ba185087c95eae96362"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldSerializerDecoratorInfo_FieldSerializerDecoratorInfo.__init__.self.type.type": {"doc_hash": "c24ec5f42a1a5348c4df846b7e7f487e90239678c15a6806eda57fb08558ad6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelSerializerDecoratorInfo_DecoratedType._Union_classmethod_Return": {"doc_hash": "cd345e53f9a9ad4427523118786914203c6f71fb148251e00ee52949d703c272"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_PydanticDecoratorMarker_PydanticDecoratorMarker.__get___2.return.self_wrapped___get___obj_": {"doc_hash": "a2bf43fd96fc8486c3a4f9297c60065fb898a03aae865228ec81b17432b0df93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfoType_Decorator.__init__.self.info.info": {"doc_hash": "3dae4a48440cfbb4202e7ba8a5b96fbe1463669533983369fe8b06125c8ed323"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_AnyDecorator_DecoratorInfos.__init__.self.model_serializer._": {"doc_hash": "1d01270e43458a6f904b5d852683b29b19026770ca352a1f4f76551199a08f3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_gather_decorator_functions_gather_decorator_functions.return.res": {"doc_hash": "a124114a6db48a9bcd60e247cc3aa14ea2d51f88cbcfcba06413f4e45b549188"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py__FUNCS_prepare_serializer_decorator.return.function": {"doc_hash": "baca7231b13649924b37e2198900b18d85dc3b3c6600ffc146d900112fb594f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_unwrap_unbound_methods_ensure_classmethod_based_on_signature.return.function": {"doc_hash": "b2107540a393bf1cdae761890512319b789d2cb51b9fa5911809ddb2f56fcf9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_check_for_duplicate_validator_check_for_duplicate_validator.if_not_allow_reuse_and_no._FUNCS_add_ref_": {"doc_hash": "035a0f26071540fe210be587bc5742561d9abcd7336752715340b29b6f4ab19b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_in_ipython_V1_VALIDATOR_VALID_SIGNATURES._": {"doc_hash": "674612ba50833af55d07e9749e32ab58f08ef1339c169a2510c8ade73421119b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_v1_field_validator_make_generic_v1_field_validator.raise_TypeError_": {"doc_hash": "f684e9bfe0343beea10fefa26cdc5270448bc76e7074f7a188f35bf7e0b46abb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_v2_field_validator_make_generic_v2_field_validator_11.return.val2": {"doc_hash": "95e1197017751e0d64b8b3a1bfd69db2907646e64ad84408bc1e75f1c724791e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_RootValidatorValues_V2CoreAfterRootValidator.__call__._": {"doc_hash": "275818ab85f6575b119d94678d22692a717c737d8af3955d6d6e0ab0b0eddf43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_v1_generic_root_validator_make_v1_generic_root_validator.return._wrapper2": {"doc_hash": "6ac5302aa48f6c253666c04bf4d4ff7baab41e6061d094cf73ee781da33912cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_GenericPlainSerializerFunctionWithoutInfo__VALID_SERIALIZER_SIGNATURES._": {"doc_hash": "f76aae8c95a96b557e9e12594875d0f12aa317566077f340c9a0f8bb98ddadda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_field_serializer_make_generic_field_serializer.if_mode_plain_.else_.return.func": {"doc_hash": "95cd59401443271e78f77e7373d23546fbd03d6686bf185942ca8749da9d66b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_model_serializer_": {"doc_hash": "a770786bdaff715b606e6edcfa54335429358453165668497813e4613f1aab54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_from___future___import_an_apply_discriminator.return._ApplyInferredDiscriminat": {"doc_hash": "7ebed6ea14c823ef2704cebe4979d66260e53a8c4bc39d2762e5d9151cb1610e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator__ApplyInferredDiscriminator._": {"doc_hash": "850ee848a92edb549e9037b2016597c00f40f265afe4aa2043bc47bf936237ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator.__init____ApplyInferredDiscriminator.__init__.self._used.False": {"doc_hash": "b0f6aaedba9b6b9471d0439002743daaca35bb3bad4760bf8f2973646d092bad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator.apply__ApplyInferredDiscriminator.apply.return.schema": {"doc_hash": "c62d115fa87942174806f299d373c7aff28993b5700f5cbc77cb37d11e0c6793"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._apply_to_root__ApplyInferredDiscriminator._apply_to_root.return.core_schema_tagged_union_": {"doc_hash": "ce8052567bf936be9886d1663a590d23b8148d5b977f02dafb225cd857c7f2d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._handle_choice__ApplyInferredDiscriminator._handle_choice.if_choice_type_non.else_.self__set_unique_choice_f": {"doc_hash": "5ef0372ec4c94447a14fde3fcc38e0a822a6a0728101baafdec1889b2a62e122"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._is_discriminator_shared__ApplyInferredDiscriminator._is_discriminator_shared.return.inner_discriminator_se": {"doc_hash": "fbc44dd6c722f757c6d6af2f490f2494e00e1c90dbdcbd8d6e6dcefce51e3996"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_choice.if_choice_type_def.else_.raise_TypeError_": {"doc_hash": "59d5e1fc7049981b1da48634ca1b7ca953d43721bb86db2e11bfb186989af33f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice.return.self__infer_discriminator": {"doc_hash": "92fc31d40e4a5057b450658000aaa4c34e0645c78a93ad6f1600d10977d0e301"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice.return.self__infer_discriminator": {"doc_hash": "564d74af4c7142ff9fa27274475ac052d8dcf7f58e491f5153f8b55d93b1599f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_field__ApplyInferredDiscriminator._infer_discriminator_values_for_field.return.self__infer_discriminator": {"doc_hash": "8ca83406f2e88527319544fe98f278b216a3845ee648b80665a964561b812623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema__ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema.if_schema_type_lit.else_.raise_PydanticUserError_f": {"doc_hash": "9ddfdde39ee69a54a3b428ddc5a2c30494a28cde34c187443f90f2ff388579d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._set_unique_choice_for_values_": {"doc_hash": "4f1fe43e7f5009f75535050bc9f1ec4812870b7f8a82a63390ae07f157c94974"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py___if_TYPE_CHECKING_.FieldInfo": {"doc_hash": "e4eda52824dca23214cdc88cde13f4a0d267bbed589cc332e6d0c8f7268a9ea3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_get_type_hints_infer_globalns_get_type_hints_infer_globalns.return.get_type_hints_obj_globa": {"doc_hash": "c3cbe3df53ad45356b9e588ca16ad5ee189e32c6651b7e5671cfd16f0e7e34c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__UndefinedType_SchemaRef.__init__.self.__pydantic_core_schema__.schema": {"doc_hash": "c5ce70e9071e3316e93a49cb345fd8a268e1c2911c5d28cb087a063ff3937e35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_CustomValidator_DC_KW_ONLY.getattr_dataclasses_KW_": {"doc_hash": "9974fe1c49e955d640085a35fafcf04fc0bcbaffc221f01f15efacd60c10a608"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_fields_collect_fields.class_vars.set_": {"doc_hash": "24c6a343fb1d6711cf15439bf6879709f51f2113a1c47afbd4a3f2229e67e16c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_fields.for_ann_name_ann_type_in_": {"doc_hash": "aa71e7586a7f8a439a6526ee03ce8bbc897713aca7caaa90628175d3c291823e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_from___future___import_an_PydanticRecursiveRef.__call__._": {"doc_hash": "99d3d99b8f43eb1fdd981e4918888d052b6e814199d33ec9a6a5f3d2478808b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_PydanticForwardRef_PydanticForwardRef.replace_types.return.replace_self_deferred_ac": {"doc_hash": "40090b00b3323237201b08c1d4c070b5b2cc3a4a8c9e1562711bf783fd15af84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_PydanticForwardRef.resolve_model_": {"doc_hash": "1107cf194837cddc83ed990c9890c20727d5da66679a564452de535dc2f52d63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py___check_validator_fields_against_field_name.return.False": {"doc_hash": "1ff179fa7f68635f6a2ad3d41df9080bcab1179a738d8592c21953f5aa32f0a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_check_decorator_fields_exist_filter_field_decorator_info_by_field.return._dec_for_dec_in_validator": {"doc_hash": "4d15a52d2825594e6d484dc4fa4e0aff7d1e6ef8ef48d1c3f1b80212058442b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_each_item_validators_apply_each_item_validators.return.schema": {"doc_hash": "be9787c9b1f6826e069ad3f93f0fcf0b628e106a23fc3e4d286ace94099a6181"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_dataclass_schema_dataclass_schema.return.apply_model_serializers_d": {"doc_hash": "742fc38e3988a8b1f84914c8ff11f40dd06d17575fc786d9fff9b8532fec4177"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_generate_config_generate_config.return.core_config": {"doc_hash": "b6120b5cf5eff64b68aa607985518ce88fb375600a03f8acef33d95dccd14a55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema_GenerateSchema.arbitrary_types.return.self__arbitrary_types_sta": {"doc_hash": "114f679f747e742fee8c1464027c16e69c9a08d49ac171bc3ed9bd8984f81aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_schema_GenerateSchema.generate_schema.return.schema": {"doc_hash": "f0f4f7afa3fe317d7e1995ebcc78b76788419d1221d8add75c3d36bb0d71e32a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.model_schema_GenerateSchema.model_schema.return.apply_model_serializers_m": {"doc_hash": "b096e43dd22e071bf19179ce4073743ff198b7907dd3f026154a32695d5d96c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_from_property_GenerateSchema._generate_schema_from_property.return.None": {"doc_hash": "6effde3e5c8e49041a07b867df093d6411701e800156ba0be3abd9b01488a0ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_GenerateSchema._generate_schema.try_.except_TypeError_obj_.pass": {"doc_hash": "0ecfec3ace95be5fc0782608ac38e0b78a36ec5c80bac2bd6b9555ae7ab2f5d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema.if_obj_is_Any_or_obj_is_o_GenerateSchema._generate_schema.None_7.return.from_property": {"doc_hash": "6368f8d360aa7bdbfea9585639576207073f7d085297ea26b7148b4c8dacff12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema.if__typing_extra_origin_i_GenerateSchema._generate_schema.if__typing_extra_origin_i.else_.if_self_arbitrary_types_a.else_.raise_PydanticSchemaGener": {"doc_hash": "6e2e625a4d0237b3819ea374b17e1dfa544453e9f58b30094273e293e6d04d93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_td_field_schema_GenerateSchema.generate_td_field_schema.return.core_schema_typed_dict_fi": {"doc_hash": "a6fca6b84c19a83d3ccb304e9149e395a285b3195ca0a2ec2a100322cb0b7a07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_dc_field_schema_GenerateSchema.generate_dc_field_schema.return.core_schema_dataclass_fie": {"doc_hash": "a50cb517248dcb3c562c17793ff895f8a145585e2c38b126d0a0c03099e3c58c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._common_field_schema_GenerateSchema._common_field_schema.return._common_field_": {"doc_hash": "819df5e1c3ee918ee9db59c90aaf1351aad0d55582ebc877f014c34eff9ba20d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._union_schema_GenerateSchema._union_schema.return.s": {"doc_hash": "9ac806b9211d96225774ed1484a9ed82e99897db8a50eee907813b54a4d2fb31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._annotated_schema_GenerateSchema._literal_schema.return.core_schema_literal_schem": {"doc_hash": "845ebb41ff6da7583e4566961aeab3032cac9706b01ce39b5c7b18173282cac3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._typed_dict_schema_GenerateSchema._typed_dict_schema.return.core_schema_typed_dict_sc": {"doc_hash": "43f049ec3b13b07baff88fbbbbfdaf6c79de509876450a7b864ec3ad840452e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._namedtuple_schema_GenerateSchema._namedtuple_schema.return.core_schema_call_schema_a": {"doc_hash": "a77fc1ca0e43d29dc8369a85017900499032cbb312755ce705c8c7429a83330f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_parameter_schema_GenerateSchema._generate_parameter_schema.return.parameter_schema": {"doc_hash": "d954fcacb8908ddf1da911ed3378f0b71c360afb2449524288b66f855ed923d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generic_collection_schema_GenerateSchema._generic_collection_schema.if_origin_parent_type_.else_.return.core_schema_general_after": {"doc_hash": "fd2cb63292990114e950d59b78fee36b35054e5ae4f3e5cff82c8a480fcabd10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._tuple_schema_GenerateSchema._tuple_schema.if_not_params_.else_.return.core_schema_tuple_positio": {"doc_hash": "3e716b02e3cca7a6e239874895d7b321139581dfb9d1cca201019458763c0052"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dict_schema_GenerateSchema._dict_subclass_schema.return.core_schema_general_wrap_": {"doc_hash": "dbd9efcaaef32ac874673ed3fb203b55e06658bcb4003b4783f8b01d758100fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._counter_schema_GenerateSchema._counter_schema.return.core_schema_general_after": {"doc_hash": "662dd2775c393b41c7c6117dec7ec9a6f32e393b93311a26a276a50f221856fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._mapping_schema_GenerateSchema._type_schema.return.core_schema_custom_error_": {"doc_hash": "fc83c127fa1766b6ae6e3592947532aab2ddf7e8a9caffdb192a888a64f694a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._subclass_schema_GenerateSchema._subclass_schema.if_type_param_Any_.else_.return.core_schema_is_subclass_s": {"doc_hash": "b96370857817e1ebe25105f58c171d7278f4eb0123b330a01968cf759b49b4d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._sequence_schema_GenerateSchema._iterable_schema.return.core_schema_generator_sch": {"doc_hash": "ec6aff62a056ecfed30c607cda233676e1c365b00347bdfc1023ab5c0f4c439f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._pattern_schema_GenerateSchema._pattern_schema.if_param_str_.else_.raise_PydanticSchemaGener": {"doc_hash": "8a609d9b4cd4caff31a9fc4b211a71f99037e02f1787da801eeb39f3e35d686c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._std_types_schema_GenerateSchema._std_types_schema.return.None": {"doc_hash": "2c970b3d4f1241bd71225be7354cc0802926cd00f52fa9d64922f375088ff535"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dataclass_schema_GenerateSchema._unsubstituted_typevar_schema.if_typevar___bound___.else_.return.core_schema_AnySchema_typ": {"doc_hash": "230a3e3718480e6a8201bc5f616647f4b00a3ff1eb6d854177b1e83edda2d487"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__VALIDATOR_F_MATCH__VALIDATOR_F_MATCH._": {"doc_hash": "deb72018ef9f5141d90c4228cd01b86c7a3bbaee71fd3da34a43e79c36ea7171"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_validators_apply_validators.return.schema": {"doc_hash": "96bbd514d00bcdb032bd2d0f7949d91851bbd64b96b2913c7cbcbe854bde2b1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__validators_require_validate_default__validators_require_validate_default.return.False": {"doc_hash": "4590bf2fdc6499cb64002f14b21e49aed4e0ea7c27bb27baa56c16df923f8084"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_field_serializers_apply_field_serializers.return.schema": {"doc_hash": "7e7ebe682da7d08a9a43e926e9b884ca17d5265ba5bbb0ac8abc6981f99331cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_model_serializers_apply_model_serializers.return.schema": {"doc_hash": "104a2d8d04c21fc566e3e6d79b08e38d60aca883c199d966c9972a836a31da25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_annotations_apply_annotations.return.schema": {"doc_hash": "9cb099fc3f6580a099847719903782ee6db0f5db70de00204345fe78d356a834"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_single_annotation_apply_single_annotation.return.schema": {"doc_hash": "5ea6ab76298b40d92b67e47909e1c821adfdc3a0176680a1110dfd7c435c3ee9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_wrap_default_get_first_arg.try_.except_IndexError_.return.Any": {"doc_hash": "697b979f90363cfc3c7780d4bcd756fbaf25e70ed2346108eb7cec689c02840e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__get_pydantic_modify_json_schema__CommonField.metadata": {"doc_hash": "90ea8640c5ed01caad6f33f6d0bc66ec3c63672c1e997a36e4ac7c9efa3fbd95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__common_field_": {"doc_hash": "1c47da9424d81fcdceca297a87519c7c9cc66d5aef631d926329a168d86ac181"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_from___future___import_an_None_3.else_.GenericTypesCache.WeakValueDictionary": {"doc_hash": "6469786ae0b833173231cb92b0957ba10a8f2618d1af87aae7fbc1cc98a0ccdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_None_4__GENERIC_TYPES_CACHE.GenericTypesCache_": {"doc_hash": "06f9fdb2a3ed86d5b801ca5e466d4e969ae515d6181a325e3decab6a2aeb5163"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_create_generic_submodel_create_generic_submodel.return.created_model": {"doc_hash": "95a12f64d29a20676bc3b8d0d64157cabf61fd74fd30e39301af658403948ecb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__get_caller_frame_info_DictValues._values___class__": {"doc_hash": "404a1c0e7556d5d4c49372d88244d76313052d47354d5201c68b8e6c06e2098e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_iter_contained_typevars_get_origin.return.typing_extensions_get_ori": {"doc_hash": "d09c208f799c44faa841a9b2a3d794e964ab593fc33d0247661e34eca6c3781f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_replace_types_replace_types.return.type_map_get_type__type_": {"doc_hash": "75373e321cc37997cf6800c765da71ed4c81f834d40ce61a147da456d4de6023"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_check_parameters_count__generic_recursion_cache.ContextVar__generic_recu": {"doc_hash": "5af486329f521e1777f9e2c7ba2e0ba073891d2e4ebebfe073abdd8c4ba19f17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_generic_recursion_self_type_recursively_defined_type_refs._don_t_allow_modificatio": {"doc_hash": "15af0ddf28a9f6ef1281323134da6b7c509180837b926ba7e46939f676aa5211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_cached_generic_type_early_get_cached_generic_type_early.return._GENERIC_TYPES_CACHE_get_": {"doc_hash": "874b515e011b1098de6ac1b3bf43524ee3e588074265edd35ea75272f86c8d3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_cached_generic_type_late_get_cached_generic_type_late.return.cached": {"doc_hash": "6af1a3d3f87008181ec1c51b1abb792f5bcf65aba44e8934f5b0d0fadb973d73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_set_cached_generic_type_set_cached_generic_type.if_origin_and_args_._GENERIC_TYPES_CACHE__lat": {"doc_hash": "ff77dbdd3c1cf9e64eeefe74b3d6947473a5238f578ed0a3d1f13cec559da587"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__union_orderings_key__union_orderings_key.if_isinstance_typevar_val.else_.return._": {"doc_hash": "7695d43673e2afa4f1f56d9f95e56b0ffa191366c06a8c37e125c42c8848b7e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__early_cache_key__early_cache_key.return.cls_typevar_values__uni": {"doc_hash": "61802698855d0019170dee395aeace49e114f76820845d9d6a3ba49a8919ebd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__late_cache_key_": {"doc_hash": "b1277da7387ef2d5e6bef6e2ea54713b23aa21113de6ad1ee767193b2f4925e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py___init_private_attributes.for_name_private_attr_in.if_default_is_not_Undefin.object_setattr_self__nam": {"doc_hash": "5bef8f9352723c5046aad14141a4ab68503282a0ab7f10b3592f8b20e837c670"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace_inspect_namespace.return.private_attributes": {"doc_hash": "3eb965b8d78fa0a1f26a4d1c5c91f8b817a203dda0f01a237438eae6264f1d1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_single_underscore_set_model_fields.cls___class_vars___update": {"doc_hash": "d28ac9c1150bda4845fc5bec35f57531074245b31717a89bd7787ea2e4595049"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_complete_model_class_complete_model_class.return.True": {"doc_hash": "37d9b0aad50314f13ff3ad9e47d630498dea5e646fbaa20b4cfe2d4ca06e935c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_generate_model_signature_generate_model_signature.return.Signature_parameters_list": {"doc_hash": "748c0f77b82c0132c628034519b3f5058907cc34211d437d21e375aa0b8541a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_MockValidator_MockValidator.__getattr__.raise_PydanticUserError_s": {"doc_hash": "efafbff8c5f110d546c3ffe2a1a8597f5bb6aa4a4f1da86bf43d2d84ceb84900"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_apply_alias_generator_": {"doc_hash": "e6b39785c97e990034e758ca471190e433665a8d4142c4ea673858bf1e0967ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py___PlainRepr.__repr__.return.str_self_": {"doc_hash": "f99687235b69f91f6f410aa89731c006c2dcce28f2b22b6109bb60353ea9324a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_Representation_Representation.__repr_args__.return._a_v_for_a_v_in_attrs": {"doc_hash": "4c7ff26f96ba46a0732d8ca505a489de1180b563422c7cf7cb45d6b0193ab63e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_Representation.__repr_name___Representation.__rich_repr__.for_name_field_repr_in_s.if_name_is_None_.else_.yield_name_field_repr": {"doc_hash": "2a6972b42e6bd3961ad70490efaf4267374546edd2a3d65bafdb97c71d198696"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_display_as_type_": {"doc_hash": "79a7018d6ac78aa1663fab412daf014713a2db4798cd9061737d1c0e461d2117"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_serializers.py_from___future___import_an_": {"doc_hash": "ed80198150cb0e90689cd0e7533640999da56357771863dbaf50fb0425db3f7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py___timedelta_schema.return.core_schema_TimedeltaSche": {"doc_hash": "959bc558373e3109b7d4c9ef7861b33c5c05e6a037bbbb39dfc7f1371bfad7c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_enum_schema_enum_schema.return.core_schema_lax_or_strict": {"doc_hash": "8bc58cbf2e0cb08fb1ee5c67478fcc5d741a72477a4a3dd55d30ead657150d1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_decimal_schema_decimal_schema.return.core_schema_lax_or_strict": {"doc_hash": "bd807c697e073c8f4d69bb62d31c5e14d3c8b3788047975fedacb9b19838b3c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_uuid_schema_uuid_schema.return.core_schema_lax_or_strict": {"doc_hash": "edc737568e0acc3d3a82e145ff101d9d886a4a4c50e49699bab02369f2962046"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_path_schema_path_schema.return.core_schema_lax_or_strict": {"doc_hash": "7b631f1ac51a440757e9292018088fa5f541079e836597f93bf7c3301546f304"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__deque_ser_schema__deque_any_schema.return.core_schema_lax_or_strict": {"doc_hash": "1b7067cac11e6d324897dad4d4e52078e02b09f206b4911f9204474c3dca7643"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_deque_schema_deque_schema.if_arg_typing_Any_.else_.return.core_schema_lax_or_strict": {"doc_hash": "d365cadb05360c0af9ef08338c9b98bd9aab5478dbdc1b717b9519eac1355348"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__ordered_dict_any_schema_ordered_dict_schema.if_keys_arg_typing_Any.else_.return.core_schema_lax_or_strict": {"doc_hash": "3d43a2acbd5fff34d8ad6101807ad25aa1313da9f1af0ad67bcc9c207406f15f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_make_strict_ip_schema_ip_v4_address_schema.return.core_schema_lax_or_strict": {"doc_hash": "38daa339da86a0c5b9c2c96edb3c113dd4cd526e50127fecc56f7cb9407bb005"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v4_interface_schema_ip_v4_interface_schema.return.core_schema_lax_or_strict": {"doc_hash": "cc7d0e64aa9566c4d2bc27a0cb54af255fc9c6c08700dfb2f2b18b4488d0cdd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v4_network_schema_ip_v4_network_schema.return.core_schema_lax_or_strict": {"doc_hash": "f778465a4707aca63e1bed254505d76886bc69bf8f2486a5cbc2a7c360a94c58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_address_schema_ip_v6_address_schema.return.core_schema_lax_or_strict": {"doc_hash": "a6f690c4e24bbf3fdd2ce234e651988a96b132ac185f12ebba559f161641d804"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_interface_schema_ip_v6_interface_schema.return.core_schema_lax_or_strict": {"doc_hash": "5cf31fbdd5848d107ee4669d99e8add4ef14ea6251a6583f9b0be0ba4a810ba6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_network_schema_": {"doc_hash": "3b150da808a75df5c4c889eaaa02a4ef433bb2927c201c12e844cfa75d2defb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py____since_mypy_doesn_t_allo": {"doc_hash": "44bdc8c29eda9fd431811562b787bbcdf0a20930c95e165789f744fbf3fd9ff4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_4_literal_values.return.get_args_type__": {"doc_hash": "9dc9186c7000299955598c6dea2ed810c33a22384bd5545ed946c29ebb808421"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_all_literal_values_all_literal_values.return.list_x_for_value_in_value": {"doc_hash": "7eb119c7e7242e0c136ac695e23c26127a6ad7b7a300b10011c98df586061e78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_annotated_is_finalvar.return._check_finalvar_ann_type_": {"doc_hash": "69895dab87c4d0737aa4c923ef46c8637084c258c26e453c16020715789d516a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_parent_frame_namespace_parent_frame_namespace.if_frame_f_back_is_None_.else_.return.frame_f_locals": {"doc_hash": "a8a73484d4512be4c190047e80be8a8c08aabe41ae2e64d75783b9cb5a7c9cce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_add_module_globals_add_module_globals.return.globalns_or_": {"doc_hash": "d66842358fec8753ac1fa936e6431b8cb7671a82e6511b847aeadc5d0ec2b14a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_get_cls_type_hints_lenient_get_cls_type_hints_lenient.return.hints": {"doc_hash": "be20e0980cb609c08f8cbda3e50b9fe2ac20719bcc405c5f0cbe6555d9e0f1fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_5_None_5._noqa_F811": {"doc_hash": "659a59168aa9875266a906ce48e86f69c46f576040afaf042656b2400ab73263"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_if_sys_version_info_3_if_sys_version_info_3.else_.get_type_hints.return.hints_if_include_extras_e": {"doc_hash": "fedc4547eb241d456230674c3967a0319431ca4eb8a5ff18d86d29b3a2e4ddc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_7_": {"doc_hash": "790ee8c967157919757fe426d5896f4861b01eba6404979719b035289330a83f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py___lenient_issubclass.try_.except_TypeError_._pragma_no_cover": {"doc_hash": "20108b612ba3c2acc130db71cb4ff1dc535e9c2827cff3bed0ae18ed55791450"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_is_basemodel_is_basemodel.return.lenient_issubclass_cls_B": {"doc_hash": "6b6146a8ec093a39d470fb903720c4281dc19bf680b4594fd6915444d9f4dc40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_is_valid_identifier_T.TypeVar_T_": {"doc_hash": "7e06f2c86d0e379176b2bb9051cb4f70d82cc6954152b7126b691a9ade72336a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_unique_list_unique_list.return.result": {"doc_hash": "eaae4dcde627683ac7c7a1d81917a8d31015d4d39904eea1f2b6e5680047a88b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems_ValueItems.for_element.return.item_if_not_self_is_true_": {"doc_hash": "30582e8c3cb637cf5da40532e7417c60b1abf0bea54d82ddd261744b3b0bf091"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems._normalize_indexes_ValueItems._normalize_indexes.return.normalized_items": {"doc_hash": "9e56ff6e135186cc2e5b7831d0aae22e4223b6a74b00fc6dc06176a01244e2a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems.merge_ValueItems.merge.return.merged": {"doc_hash": "29d643db45b30a253129baa0e663cbeb00fbccab3235d8698cc6c12569552de5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems._coerce_items_ValueItems.__repr_args__.return._None_self__items_": {"doc_hash": "a1eb7a93e98b17dba5061ab2fb5bf6c24ef453dd565cb3d18692e79304be1a7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_None_1_Obj.TypeVar_Obj_": {"doc_hash": "4d4cdd1e3b119ce247029d6a6b0e886fc51c8c965ddd757ee8e29ea2af4f7991"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_smart_deepcopy_smart_deepcopy._slowest_way_when_we_act": {"doc_hash": "37fb9e4da69d3d4aeb1afdff263b68034531c8b1e7d7acb7584122cab99e00e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__EMPTY_": {"doc_hash": "2907a79f704f3d4ad3184101770cffc1c4ed45001c70ac592fa5869b7888d597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py____fields": {"doc_hash": "37f4949e10f558a3360538fade67a14bb66813340e9fcb24bf856b7d0e48eb75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_mapping_validator_construct_counter.return.typing_Counter___input_va": {"doc_hash": "901b154fa76c544545c4f778c7a4c8e186495b1cb27ed973548a3739877f848f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_sequence_validator_sequence_validator.if_value_type_list_.else_._type_ignore_call_arg_": {"doc_hash": "51a89cff2a3eaadb9e8b056b95d72f6bf4c61b8a615645c0d5bfd45e2843e707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_import_string__import_string_logic.None_1.except_AttributeError_as_.raise_ImportError_f_Modul": {"doc_hash": "05168e235443548fbefb9b106bda4556f9731aac4bab3f2ed4cd6026cbafcf1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator_DecimalValidator.__init__.self.strict.False": {"doc_hash": "83f563a2302c023d44d811f32f39f36594841dfcf875976bea715d2c58e4234c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator.json_schema_override_schema_DecimalValidator.__pydantic_update_schema__.if_self_check_digits_and_.raise_ValueError_allow_i": {"doc_hash": "164c82745948066f9b0ba6fecd2ff530b95fa3910c26c721dff7336078c02b8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator.__call___DecimalValidator.__repr__.return.f_DecimalValidator_s_": {"doc_hash": "9f908dfe9e7427c7ade0d7ade171ab71323145e0c8362a387dcfa7d201461ec9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_uuid_validator_uuid_validator.try_.except_ValueError_.raise_PydanticCustomError": {"doc_hash": "01f4438a0bab1649f6eb4120a375efa79102dbd4ff14fa34599ae32cda071f10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_path_validator_pattern_either_validator.if_isinstance___input_val.else_.raise_PydanticCustomError": {"doc_hash": "ef1b4c33184cef0d69e535aef4a9619dc503a01753f9a6548396c32bde9377e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_str_validator_pattern_str_validator.if_isinstance___input_val.else_.raise_PydanticCustomError": {"doc_hash": "7ba745c375e10e2da9b18b1eaf815f5fc0d80918bd402f8cddb113297c7624c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_bytes_validator_pattern_bytes_validator.if_isinstance___input_val.else_.raise_PydanticCustomError": {"doc_hash": "a8a678f9345a0948c5ebaa1be9803ef09b2ca6743dc887b707f8f35e6c2d216d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_PatternType_ip_v6_address_validator.try_.except_ValueError_.raise_PydanticCustomError": {"doc_hash": "2e26376eacee34be107efd83bb08ae9fbc1c2d1bfe479a371b33feb6762349ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v4_network_validator_ip_v4_network_validator.try_.except_ValueError_.raise_PydanticCustomError": {"doc_hash": "264caa39d4126512d4e14ea89e5811ecf6c1593974b336b9800d0e27b4e75394"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v6_network_validator_ip_v6_network_validator.try_.except_ValueError_.raise_PydanticCustomError": {"doc_hash": "004abd6d6ff2545e00ea035053e251495447b785ec8ae1741e34150a7806ffa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v4_interface_validator_": {"doc_hash": "2dc21baf2b37da249ff44e007b6a11e4e1337de1479fe7c9d445dde1ee62e6f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_from___future___import_an_if_TYPE_CHECKING_.IncEx.Union_Set_int_Set_str_": {"doc_hash": "3cb785cbf6ee2d68624d48ddf3181f9b43da53d1f5ff5dad9cb9f4bb2fc4b365"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py__get_schema__get_schema.return.gen_generate_schema_type_": {"doc_hash": "01c393984b99e4fdab04934329e6da5b85d67c537233ac2c8a039a20201f6c3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py__TODO_merge_replace_t__translate_config._type_ignore_misc_": {"doc_hash": "ac346061a78efc916d2a3bc4efe9f841313ab278679d7875e5ea19203061db1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType_AnalyzedType.validate_json.return.self_validator_validate_j": {"doc_hash": "7cb42edd5ecd39716100805c5a89708f9eb2a40b6323b6f5cc2a12a53f811a96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.dump_python_AnalyzedType.dump_python.return.self_serializer_to_python": {"doc_hash": "3abe4fe7c7faee54fe05c12ef260710e1e7f8b98e02063f189eed7e504d478dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.dump_json_AnalyzedType.json_schema.return.schema_generator_instance": {"doc_hash": "ff0cff6365cb5518ea6faa580b3d930831592c63ac3f89c351e6573055c842cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.json_schemas_": {"doc_hash": "033d40a33c555243337c7467800298519196263b05989b2a787de7f55179632d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py___HslColorTuple.Union_Tuple_float_float_": {"doc_hash": "0e2b693f11c3fd83af99bab411bd911160bd3d8c1ab6e8ccd820dcaaca359074"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_RGBA_RGBA.__getitem__.return.self__tuple_item_": {"doc_hash": "4f23a5ec6c56488763f7e7189a07b1ad241c333e5a28562a1565f56a3d7760d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py__these_are_not_compiled__rads.2_math_pi": {"doc_hash": "699efa585523f9fec336660ee60d5d0da1e191aef47c62c04c9bd37becc3928a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color_Color.as_named.if_self__rgba_alpha_is_No.else_.return.self_as_hex_": {"doc_hash": "a96e76b3931eba9f390b147e3b8933588d0159c5a84c96573dd849a73f6bea04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hex_Color.as_hex.return._as_hex": {"doc_hash": "7bc199bc148d905bd0bddba1adcbe98fdeaae1a87923309f290c8d67ae809937"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_rgb_Color.as_rgb.if_self__rgba_alpha_is_No.else_.return._": {"doc_hash": "4c95b94654b557e2878e568dc2f99529d4d07e72550722e5b82fbf5e5ead4013"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_rgb_tuple_Color.as_rgb_tuple.if_alpha_is_None_.else_.return.r_g_b": {"doc_hash": "7cbdd13e9cf8de7e811df083f2f3ca591490242fd8431e1abd0a380554245207"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hsl_Color.as_hsl.if_self__rgba_alpha_is_No.else_.return.f_hsl_h_360_0_0f_s_": {"doc_hash": "fb0ee2a311030e77a992e9586484ea62e3fbd4e5a6f23ff5fb5a0889667c8eda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hsl_tuple_Color.as_hsl_tuple.if_alpha_.else_.return.h_s_l": {"doc_hash": "8d0c9b61e0640389acab4cb9de16841c0e2789a9daa61ef4c496a4b3916dc14f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color._alpha_float_Color.__hash__.return.hash_self_as_rgb_tuple_": {"doc_hash": "d4859878f11e468dd11b65b1582cb0b6c1bc293f8ada2194cdb588515f81def5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_tuple_parse_tuple.if_len_value_3_.else_.raise_PydanticCustomError": {"doc_hash": "214a2f7ac98d89e2dd67c218d4d9c6fbe5038ac0f4f27d870b8aa6f86ab2196a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_str_parse_str.raise_PydanticCustomError": {"doc_hash": "ca95b4e7428be66644f94b6b5b4076bfd4c38ce4e591eb2f727ecca3171e5367"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_ints_to_rgba_parse_color_value.if_0_color_max_val_.else_.raise_PydanticCustomError": {"doc_hash": "4853479c07047dd110c85e8c54395977b3f99b9cb34ca24d272eac51488f1181"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_float_alpha_parse_float_alpha.if__utils_almost_equal_fl.else_.raise_PydanticCustomError": {"doc_hash": "7027be3bbd97b8ce8f650efc477b2beb31a416bf36ce8b47b9fde22572ce4cf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_hsl_": {"doc_hash": "e75806484dae390dff8e7424270e8cacdc79a551e4b752e6cc4e49ab7e504c06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_from___future___import_an_Extra.forbid._forbid_": {"doc_hash": "8243e6e93019fb54bd806d5f59e75f6dc5009d3def3a681319ba07787e6cb392"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__ConfigDict__ConfigDict.validate_default": {"doc_hash": "fe8c58b10a251db734d8f5fe0f95848e856831a1b84bdba6ea4077a4e7d6b246"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_config_keys_ConfigMetaclass.__getattr__.try_.except_KeyError_as_exc_.raise_AttributeError_f_ty": {"doc_hash": "684a77f56111245e6767c2239c77d6b62c262b5d2ce958427a9fd98b1aa0a7c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_BaseConfig_BaseConfig.__init_subclass__.return.super___init_subclass__": {"doc_hash": "2db018326b127b26b545be08195be077c23e6979096fdad82d4360dd06a5ceb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_get_config_get_config._type_ignore": {"doc_hash": "4abc8e03ef55f4b61f82244cded3ea9f984636e1d47d40923eb247974ab4cd98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_build_config_": {"doc_hash": "a2783407525aa0640cbcebba71ed3ce0c70893e740b1131a5795ed20dc9b8d22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py___if_sys_version_info_3.else_.dataclass_1._": {"doc_hash": "c0a8559c6012d806f12a1b28d551d3d692f69c35bcaae187fc75e87de6988f13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass_": {"doc_hash": "cc525d09c9b442d76f9955504197c7cf8a5e3af2e4619e5d2fedcbbd4c75bcf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py___validate_arguments_1._": {"doc_hash": "40c39390b51e3b7cc21a286b41d6566a766ed523a85d91b363ac2c713b9f7ad6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_": {"doc_hash": "f3029a89884189ac7838a4ead49abdfa8e566844ab59ff4daa6cb7924bca6927"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_": {"doc_hash": "941705541380d8403c520238796b31c6f5376626fdcf58a0b769a33ad268aad4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values": {"doc_hash": "b2ff366e8be831e0c7b4eceb82c22b7b684224c9b938c0eb3b30a3e7f0bcf9a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.execute_ValidatedFunction.execute.if_self_v_args_name_in_d_.else_.return.self_raw_function_d_": {"doc_hash": "87d9fdc07ffa86617eb7095f05805bc89e84c7b38563259b0df7cca7fe7a8781"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.create_model_": {"doc_hash": "743a182249701e2578ce39ad5732c13c96ec187b5309669358c8a5a35e2800cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py____V1ValidatorType.TypeVar__V1ValidatorType": {"doc_hash": "eaa750d0f78214212abedbb8a0462a528e17ada2b874437cd719d20b2eaa3de3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py__V2BeforeAfterOrPlainValidatorType__V1RootValidatorFunctionType.TypeVar_": {"doc_hash": "867f3f5dc53ee0606d4391ef78228d359d9083663d7faf5db9b020891f8461b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_validator_validator.mode._before_if_pre_is_True_e": {"doc_hash": "df382b4b9c5728f8a4de2e70f81b21f2a00bd4e3ead6ea8c6ffac19fb53f16b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_validator.dec_validator._type_ignore_return_val": {"doc_hash": "00d52bbc2b5fbd49da77c249ad25879850619e6a331069fef346495328b75c77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_validator_field_validator_2._": {"doc_hash": "f756f405e1a84233d898abe81def78213dc20f9c8b9802e1693a1730b53d748a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_validator_3_field_validator_3.if_isinstance_fields_0_.elif_not_all_isinstance_f.raise_TypeError_": {"doc_hash": "dda7669a8e1b13e08917510bb6d68f91b15473663f5e2ca6e3eeba0774e1a77c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_validator_3.dec_field_validator_3.return.dec": {"doc_hash": "956586ff09bdf4844b64d012edabfd13493c36287700a8df28e3cf25639457ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_root_validator_root_validator_6._": {"doc_hash": "cb6b8252bc737e4ab1b64792d82ad327ba1b2c3984166b9902b13340e826f5ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_root_validator_7_root_validator_7.wrap.partial__decorators_make_": {"doc_hash": "ad3a7e188c0867b6c8173e2fd4614605f2b90f790d569e2776201cf620de86e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_root_validator_7.dec_root_validator_7.return.dec": {"doc_hash": "3f282a5bcbcb9db52e1bca13a267eaf783e3b501b13d9a31d6262111b4e5ae00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py__PlainSerializationFunction__WrapSerializeMethodType.TypeVar__WrapSerializeMe": {"doc_hash": "01171984def84733da99ffa74657fcbdc6975244a97d3108088361fc6918c305"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_field_serializer._": {"doc_hash": "7376fa3cd8e5f31f833a8c25b7d7a1dbbb4b3e6a09f5e311c3b7bf0505d12c6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_9_field_serializer_9._": {"doc_hash": "3063c00eef6d538a7042683ac8bb2800b3e32ba23e2331fa5b24b0e27e10c3c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_10_field_serializer_10._": {"doc_hash": "94c62161ebb1e308fe0643c43cd2cadf4b708bca5c082bcc8a1697166e27f7c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_11_field_serializer_11._": {"doc_hash": "7ef1223234c61071ad8d4284f52939e66bb2ca4a642fbb513f81238eeb2efcbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_11.dec_field_serializer_11.return.dec": {"doc_hash": "0c98d04be79c28d6020dde1c53cd0afdf599a8450f2062c7d7e6db129a50cb9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_model_serializer_model_serializer._": {"doc_hash": "9fedaae0c42cad9ba4a1f2f30b21b0631460581b517fd80829fd451f7f0c41bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_model_serializer.dec_": {"doc_hash": "31b31b1bd6cea25e3491e6abc431a265b8dad1850d1cd44c6166d1c1c30cc3ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py_from___future___import_an__object_setattr._model_construction_objec": {"doc_hash": "88e062b7f43f57f7e36f16dd07136dc1dc17327df457d22edc590acb14625f30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__iter__iter.for_field_key_v_in_self_.yield_dict_key_v": {"doc_hash": "275c84b61e8fc5562fdf5bca1665ad5454f013d20ce324a056a82ce6bd73042d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__copy_and_set_values__copy_and_set_values.return.m": {"doc_hash": "54f14f6c7f347d687d9e3255c7a5549065c392b9cc0ca7a7a889c3379539ba6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__get_value__get_value.if_isinstance_v_dict_.else_.return.v": {"doc_hash": "79cfc66c552ea9cd311a55dbd352bedcd84e8fe99cff2d64a8fa4676e439c76e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__calculate_keys_": {"doc_hash": "ac742bf9c8fa750eaa05fe3fb52c89dab2ca47997f24425dcd926a0e7a7b45a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_datetime_isoformat.return.o_isoformat_": {"doc_hash": "b060446aa1941c4c03e1055981bc39e147cfe78028064bae39e83498fa6061ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_decimal_encoder_decimal_encoder.if_isinstance_exponent_i.else_.return.float_dec_value_": {"doc_hash": "4a244e9afe268d0dc00545ad6c13947a4aaf4e935cb3bed968744002a4145f1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_ENCODERS_BY_TYPE_ENCODERS_BY_TYPE._": {"doc_hash": "dc236cc5a235ac89f102b7488b347f135423428804cf67b1b0dac88d5c71f135"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_pydantic_encoder_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.raise_TypeError_f_Object_": {"doc_hash": "70b90b6fab4aa4e71efba4eb8de55f2a77f9313733ef89739f070b839d4f8889"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_custom_pydantic_encoder_": {"doc_hash": "8f947f37cd9d1739cc5a5cc45dfe99c3871c6bfff36765811575529dc9cb7a26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_from___future___import_an_load_str_bytes.if_proto_Protocol_json.else_.raise_TypeError_f_Unknown": {"doc_hash": "5512ee9f9f7a1329694e7b4ca84d080c5197a332da8ab59081e26678357733e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_load_file_": {"doc_hash": "531ca747c4f898979008746d4cfb38d8716dc1eefeb5b6f0f4c0a5a6ec0df5e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_from___future___import_an_PydanticUserError.pass": {"doc_hash": "3453fdd4eb96c5767db849426dfd4b0d2cd276149d1d081cde0d87dd89d6e44e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticUndefinedAnnotation_": {"doc_hash": "376cd9314982e3531362a4da09f42fa547f4891d2abfa8c556ac14f50ff961a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_from___future___import_an_FieldInfo.__init__.self.validate_default.kwargs_get_validate_defa": {"doc_hash": "d0fed61cb6042f6a342b45c2602ca83747d347b45b7fc135213668ee67675adf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_field_FieldInfo.from_field.return.cls_default_default_kw": {"doc_hash": "9487482eeea499013df2e9b7a38cb38df76d3c7f6d33da6e3e37eef55517e106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_annotation_FieldInfo.from_annotation.return.cls_annotation_annotation": {"doc_hash": "5106829a2afd9efbb4c9a317b3d98b09d21bb98bf7ed510b558d29b611d7f707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_annotated_attribute_FieldInfo.from_annotated_attribute.if_isinstance_default_cl.else_.return.cls_annotation_annotation": {"doc_hash": "32dc160361d0562ed4bbe721e20ca6bc3f9f2f24b6e1908ad16652bb84c3c8a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_dataclass_field_FieldInfo.from_dataclass_field.return.field": {"doc_hash": "5b2874c7021d529b937b1ffd9edb2fa694d4befea271fd8104a0371c8a051246"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._extract_metadata_FieldInfo._find_field_info_arg.return.next_a_for_a_in_args_if_": {"doc_hash": "2f1f6af2551c4331f64bbdab034d89c0d4d3070a5798538dbd1ce2bdd5dfdfe8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._collect_metadata_FieldInfo._collect_metadata.return.metadata": {"doc_hash": "391042d2a98ba88558bad1f545bd28fb3d97565d3169433dc1126f2cf602d84f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.get_default_FieldInfo.rebuild_annotation.if_not_self_metadata_.else_.return.typing_extensions__Annota": {"doc_hash": "a265851c271f5fe0a86a15dae120f39adb5ef80817949741646349bab3c62262"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.__repr_args___FieldInfo.__repr_args__.for_s_in_self___slots___.if_s_default_factory_.else_.if_value_is_not_None_and_.yield_s_value": {"doc_hash": "75be750e7095595f4bc2103931c4205ac02eb7f5f3e42bfd903059e5179ae775"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field_Field._": {"doc_hash": "799dce024a19c43518925e0d59cd8393e8357cf30a86bf1653ab6c26ef728066"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field.return_Field.return.FieldInfo_from_field_": {"doc_hash": "f7cfa6f3db001b62543d82d91d4eb24f6e16edfbeca0377a03e75dc12838d6cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_ModelPrivateAttr_ModelPrivateAttr.__eq__.return.isinstance_other_self___": {"doc_hash": "e71da393588163ba80f44fca0745285d7dc55bb5992a34c51d52c1efd6534ebf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_PrivateAttr_": {"doc_hash": "34e99b1d48c328cb804563e99c76125b3685ab08f891f4d064404b408d1a9f89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_from___future___import_an_JsonRef.NewType_JsonRef_str_": {"doc_hash": "685e9aeb7e6b3d724b34d0f11f52acc8049e482025db2f503a4e0a06980854c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema_GenerateJsonSchema.__init__.self._used.False": {"doc_hash": "ee6c614bf1b4bbc1fef7d1bba8eab8f163a00b5b1dfcd95aea3ff95bfd78afc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.build_schema_type_to_method_GenerateJsonSchema.build_schema_type_to_method.return.mapping": {"doc_hash": "9bac0513997e9a522c6bf1bed7d39755e7a51620bbaa519ce2dd4c502d3a95fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_definitions_GenerateJsonSchema.generate_definitions.return.self_definitions": {"doc_hash": "87b95b135ef873784721f3106fb71281b32ebd3fdeb6982850f5ccc6eb204fbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_GenerateJsonSchema.generate.return.json_schema": {"doc_hash": "4f5db6c2f613a9267d862b7bd7ee049b59c91be3492d79a468a09497a5473fd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_inner_GenerateJsonSchema.generate_inner.return.json_schema": {"doc_hash": "34aed61f4f7c8c9a7aaf00be6914299df0b10a6cf44427c066b8b471b331e9e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._Schema_generation_m_GenerateJsonSchema.callable_schema.return.self_handle_invalid_for_j": {"doc_hash": "508c8fad3b3f75d259920c674fb97600536c64af7405b239bf9a0648347ed0d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.list_schema_GenerateJsonSchema.tuple_positional_schema.return.json_schema": {"doc_hash": "36138b09193164899eeaa7e3d371c01ccb5e4bd941b7c9d9889bc457923a1e1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.tuple_variable_schema_GenerateJsonSchema.generator_schema.return.json_schema": {"doc_hash": "d67463ca2805b1628375f8442147464e9baa3672e595eaf331ddeed70995ce46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.dict_schema_GenerateJsonSchema.dict_schema.return.json_schema": {"doc_hash": "29090d51680e43ba4a6bb104a3926ac6ce6a874d02194b633742e91f73a9e006"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._function_schema_GenerateJsonSchema.function_wrap_schema.return.self__function_schema_sch": {"doc_hash": "15a8adaa86a910775e2d5210740503f5fba18cb5b4b9025476756fc8f605c975"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.default_schema_GenerateJsonSchema.default_schema.if_ref_in_json_schema_.else_.return.json_schema": {"doc_hash": "6e559414cb9bbe701835ffd7bfe687b86b471500280bc582e86dd3c211e46cdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.nullable_schema_GenerateJsonSchema.union_schema.return.self_get_flattened_anyof_": {"doc_hash": "e0adac7f2211f1538e343293a0d732791cdf577245f00d872e87c04ac23aa4fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.tagged_union_schema_GenerateJsonSchema.tagged_union_schema.return.json_schema": {"doc_hash": "ca32a3941b2125345426a9cfc6b704110e57697af431dde845d33f784e65fa1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._extract_discriminator_GenerateJsonSchema._extract_discriminator.return.openapi_discriminator": {"doc_hash": "c36a47446e1f7384f5f2f8665e474dcf6582e0b124b7ef42ee9881705671cc0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.chain_schema_GenerateJsonSchema.typed_dict_schema.return.self__named_required_fiel": {"doc_hash": "1f34ce4de17015a719d75dae679d2eefc3d83671a841b49b0e136ce0bef54630"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._named_required_fields_schema_GenerateJsonSchema._named_required_fields_schema.return.json_schema": {"doc_hash": "5b4c0303398ba3e634c3deb1ef627a979c4df31d80d6a932a06425e34458b58f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.typed_dict_field_schema_GenerateJsonSchema.model_schema.return.json_schema": {"doc_hash": "951014049b3fb9f5710d658b325ebdfa4edde9eb055d4c4e3560087999656156"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._update_class_schema_GenerateJsonSchema.dataclass_args_schema.return.self__named_required_fiel": {"doc_hash": "cfc76263bfc405d29f182ebad946d73eb1e59f9a4f2a4fda05928c3643b7118e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.dataclass_schema_GenerateJsonSchema.dataclass_schema.return.json_schema": {"doc_hash": "820e4910d1d01b827fb42dc5f99176d6e2eeb1773e8d9a8779fa14bf05760d3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.arguments_schema_GenerateJsonSchema.arguments_schema.return._": {"doc_hash": "50d2a359cc99517dddc1b2f90443d1a2e2b0918b55c1bde7c52051f57ef6f196"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.kw_arguments_schema_GenerateJsonSchema.kw_arguments_schema.return.json_schema": {"doc_hash": "3d91bfdb9d7b792bdfe4dd5d0d02a9612f0b9d56487f2d4154ffe21a21e3d411"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.p_arguments_schema_GenerateJsonSchema.p_arguments_schema.return.json_schema": {"doc_hash": "1c7baee64c88cf70bdb09c2abf297a97626fdecffad964f31a53679e9d335c78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_argument_name_GenerateJsonSchema.custom_error_schema.return.self_generate_inner_schem": {"doc_hash": "8bdb65e32ffe76231468103a4edd8168d382ceb3c8022295b1c5005b19ec3694"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.json_schema_GenerateJsonSchema.json_schema.return._type_string_forma": {"doc_hash": "eda353097543ca83c75fe26515e93d2933738e73459656efa41c4bb6d4296622"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.url_schema_GenerateJsonSchema.get_title_from_name.return.name_title_replace___": {"doc_hash": "e9fe59e09aad28099664d318e8a3894f02557790cbac356f3a6c24bda215c4c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.field_title_should_be_set_GenerateJsonSchema.normalize_name.return.re_sub_r_a_zA_Z0_9___": {"doc_hash": "4eea96ed402a917972d1772c9e9e13bfaaecae42d25f24d92d0d945c1bada1d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_defs_ref_GenerateJsonSchema.get_defs_ref._should_never_get_here_i": {"doc_hash": "998cbf7bf35fd057002d5ece89e96cfa8a05f700fbacdd09044626714a49d4cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.resolve_collisions_GenerateJsonSchema.resolve_collisions.return.json_schema": {"doc_hash": "8cbef9c446b2d1bb136e8e63cc01e91649b54e5ef96f2c6911919a9aa7d597d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.change_defs_ref_GenerateJsonSchema.change_defs_ref.self_core_to_json_refs_co": {"doc_hash": "ea62d2b8ad22dac6a80ed218efb1c391907aff50386ba90b7b166dcacf37615d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.change_defs_ref.walk_replace_json_schema_ref_GenerateJsonSchema.change_defs_ref.return.walk_replace_json_schema_": {"doc_hash": "193e351cff4a7ec6182f6f331b21957c62b4e0f8abc342a2cf16d63c8eac2f74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_cache_defs_ref_schema_GenerateJsonSchema.get_cache_defs_ref_schema.return.defs_ref_ref_json_schema": {"doc_hash": "2d00aefb610979b9c861d4b6821fd27b3a0f4d6c6e94d4cd3bbec435107c431f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.handle_ref_overrides_GenerateJsonSchema.handle_ref_overrides.return.json_schema": {"doc_hash": "85514af97b89c673fa9231c97342c0ff0e587f08763879e546de889e1d268211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_schema_from_definitions_GenerateJsonSchema.update_with_validations.for_core_key_json_schema.if_core_key_in_core_schem._type_ignore_literal_re": {"doc_hash": "32ed49a0c19f52379757331fd55ef96bceb35b915378115a1d449f543092f98d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.ValidationsMapping_GenerateJsonSchema.ValidationsMapping.date._": {"doc_hash": "251a453107209c40ac74f7d280052f48b8c19a44ee66128589c5a4c6588ebf7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_flattened_anyof_GenerateJsonSchema.get_json_ref_counts.return.json_refs": {"doc_hash": "2ebf7d971931884863ee5e601ba55dd7282119602e294e27cdd292237eb78631"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.handle_invalid_for_json_schema_GenerateJsonSchema.emit_warning.if_message_is_not_None_.warnings_warn_message_Py": {"doc_hash": "294f20a2cb9e6a914dc5b60354680beb720240d93d005317c52b48f4b76c16f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.render_warning_message_GenerateJsonSchema.render_warning_message.return.f_detail_kind_": {"doc_hash": "46958dc1193fdada2b3e3a78ee720e929259937f2bbb4c6bba27f8280a450052"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__Start_JSON_Schema_models_json_schema.return.json_schema": {"doc_hash": "c8a25169f10b502ff8ea7d576a7fcacd5a0cdaad5390055f30032ad8701463cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__TODO_Consider_removing_model_json_schema.return.json_schema": {"doc_hash": "c55b5d7b4025304017a4ce32ea734511c0d46a6502dc41f39756ec00a2d15655"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__End_JSON_Schema_G_": {"doc_hash": "4e513120864337fdc03863966bfbeb843834bc1fb6113c529262ac3663f65346"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py____base_class_defined.False": {"doc_hash": "b5d2d2752c55c7e84c0ddf7b928b34c8064d4b1323cc4d0fa384cfe8b81efd58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_ModelMetaclass_ModelMetaclass.__instancecheck__.return.hasattr_instance___pyda": {"doc_hash": "880a7cb6c0c0f29cdbe59ceb0cb0d805a715643c004692370c2acbeebf47e139"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel_BaseModel.model_validate.return.cls___pydantic_validator_": {"doc_hash": "3c5c65516095f081fb21b30884cf1f94676b7a0bd5c8b0a5874d182705b01d6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_validate_json_BaseModel.None_1.model_post_init.pass": {"doc_hash": "c9ba5ad74194ac7bfb131cc19b6a53b7507eae70ef98b997c2b6f479fb8286f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__setattr___BaseModel.__setattr__.if_name_startswith___.else_.self___fields_set___add_n": {"doc_hash": "016ba7c1f47815aebadd5823ea51d2eea60c2398a473f544ae6f12c6faf5631b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__getstate___BaseModel.__setstate__.for_name_value_in_state_._object_setattr_self_nam": {"doc_hash": "75d13e5213b0fa45371e8cdd1dd6323d195ccddcb03625612019808560ec766e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_dump_BaseModel.model_dump.return.self___pydantic_serialize": {"doc_hash": "3b5135bc34c0656ca64e7adc3ff56d6ceb6c69261cd4ac01262c3c66a595c122"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_dump_json_BaseModel.model_dump_json.return.self___pydantic_serialize": {"doc_hash": "08e7b57be1966d8f9daeae5725279065c0e9a9c7a7fb8fe0da7dd3dced81c409"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_construct_BaseModel.model_construct.return.m": {"doc_hash": "b15a299683b5f0f7d44bac7f37736921c098918a347183a116081c53d82beacf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_json_schema_BaseModel.model_json_schema.return.model_json_schema_cls_by": {"doc_hash": "1609ad8d43f174085d5e95ba0648a77f189b42652337e56e9ae6707b71b8fe6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_modify_json_schema_BaseModel.model_modify_json_schema.return._metadata_json_schem": {"doc_hash": "e3fcce4f0d8fbae9831b7ebf9a0b01431a240cf6e30d25fa41dc5f02a383c495"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_rebuild_BaseModel.model_rebuild.if_not_force_and_cls___py.else_.return._model_construction_compl": {"doc_hash": "38d31fe0f52ce7c2673405f6439139f2f46756d80c5c50e55536906568b78b46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__iter___BaseModel.__eq__.return.True": {"doc_hash": "558f38fbb6e36aab556ac6dc3b40f3a233ac2dafa668f2ba5157d144e67a9385"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_copy_BaseModel.__copy__.return.m": {"doc_hash": "7ee29d88ec7d1c49ffd2f530135db60a6d0f24f16f33df99075c9b351e4d2bc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__deepcopy___BaseModel.__repr_args__.return._": {"doc_hash": "9e4fac14182b4f98c10ba842ed5dd765df23b46bdd0bdcc1742a9aba0cc5a24c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__class_getitem___BaseModel.__class_getitem__.return.submodel": {"doc_hash": "150f3b352912e41573960f7593d1115cb0d4e285815f8002192c7da7b6ad4f29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_parametrized_name_BaseModel.model_parametrized_name.return.f_cls___name___params_": {"doc_hash": "ded2587239e14247fb7cc515c1d171bd9447f94a41c09100dfcf8babdea14af3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._Deprecated_method_BaseModel.dict.return.self_model_dump_": {"doc_hash": "45b1908e3d5e8e704bc412f370a1c576b522778158d2e3b9bfaf4b7f8d421ae1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.json_BaseModel.parse_obj.return.cls_model_validate_obj_": {"doc_hash": "127e4ca60ad1e41d118721621dcd35f87a370019c8bf32f6b288af0160402055"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.parse_raw_BaseModel.parse_raw.return.cls_model_validate_obj_": {"doc_hash": "56c11c575cb9d5df8599040edfce446d44085f344d410f0101ba2b24d8dbd000"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.parse_file_BaseModel.parse_file.return.cls_parse_obj_obj_": {"doc_hash": "a8323f5cbeafca1e5f72864b77d8fbff57a67ddb58e4c3abb0e3496fcd8dcc43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.from_orm_BaseModel.construct.return.cls_model_construct__fiel": {"doc_hash": "0ac9297f133c313e34e3e784ee510bfdd7f0c994e2fb923e1458d56ca5c407da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.copy_BaseModel.copy.return._deprecated_copy_internal": {"doc_hash": "8655972865bc85ddd5389564b92eb1e21334ad810b1bf10de44b6a13b1a405f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_BaseModel.schema_json.return.json_dumps_": {"doc_hash": "f1613fb376342bfbcea5dea4a84b08d74f528af6ceb50a179c919f8417c63773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.validate_BaseModel._calculate_keys.return._deprecated_copy_internal": {"doc_hash": "ff5fff7df36ba22d0bc8b677d425be5d3855278e5f3ce4359e5bbe2df0bea4bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__base_class_defined_3_create_model_1._": {"doc_hash": "182a7e0ae6029e6fd542724885cad940fcbf28896903630f57b92c2770430cc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_2_create_model_2.return.meta___model_name_resolv": {"doc_hash": "ef4dfe783d9a6aae5741d252424eac0bc98eeb559fd58c7aa39be1fc3c708b57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__collect_bases_data_": {"doc_hash": "edf920a11cb7c90b5a31fb88316745bc8a76f02d294fc013f3242d66dfa3310e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_from___future___import_an_plugin.return.PydanticPlugin": {"doc_hash": "6ab109ab2e820130c3f7aecfa3cc56509367113b9318ac218a11a9b76be29bd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin_PydanticPlugin._pydantic_model_class_maker_callback.transformer_transform_": {"doc_hash": "65b6c8c93cca42d6c52fd2de409f70ed3e27fd5264438f081283b69e1391fe69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin._pydantic_model_metaclass_marker_callback_PydanticPlugin._pydantic_model_metaclass_marker_callback.if_getattr_info_metaclass.info_metaclass.type.dataclass_transform_spec.None": {"doc_hash": "32783e885cda9af93295b13cdcfd596c1f0f7d4fa036ec7f970aa0d574ce3d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin._pydantic_field_callback_PydanticPlugin._pydantic_field_callback.return.default_any_type": {"doc_hash": "2ce0014b0a5bac4a3daab8e4705747ce218e4dd39f90bcde1aafe33a6dd4df18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPluginConfig_PydanticPluginConfig.to_data.return._key_getattr_self_key_": {"doc_hash": "9c72e84f4062b3b714dbfe68d002cbf8fcb159be2878d7f1ea921bcbbc4db86b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_from_attributes_callback_from_attributes_callback.return.ctx_default_return_type": {"doc_hash": "d11001b4a373236c9312e87529afa679f40998ab7adf851987c6f1dd239109f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer_PydanticModelTransformer.transform.info_metadata_METADATA_KE": {"doc_hash": "ebe2b20fce88b155019ad07d89abf7a8ca288f39126271d0be95106cfccebbbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.adjust_validator_signatures_PydanticModelTransformer.adjust_validator_signatures.for_name_sym_in_self__ct.if_isinstance_sym_node_D.if_.sym.node.func.is_class.True": {"doc_hash": "429b70a8a701dfd7adf9bd6c7bb944314fb77df131292ed5bba01bc84850d0ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_config_PydanticModelTransformer.collect_config.return.config": {"doc_hash": "c23334837a6c106900a5d96eeacbbc7db0a4a2056920ecb2ca055f3f8aed6a02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_fields_PydanticModelTransformer.collect_fields.return.all_fields": {"doc_hash": "c496e2349ee7eaaca1353517e833eb23649b3069d8c5538190579b481df57dde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_from_stmt_PydanticModelTransformer.collect_field_from_stmt.return.PydanticModelField_": {"doc_hash": "ef6173e995b64b1d4b39dc17ea3576c386caab5efa120f66f754cc593af8a4f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.if___init___not_in_ctx_.add_method_ctx___init__": {"doc_hash": "d47f7a5157f6d44b9cce5c1fb5db5c5401f23ea1b6e968dac3001bd22e5f343b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_model_construct_method_PydanticModelTransformer.add_model_construct_method.add_method_": {"doc_hash": "9cf06c5d8b70d52271f1111f530832eecc6aabbf625baf75c9cfdf4ce630194f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.set_frozen_PydanticModelTransformer.set_frozen.for_field_in_fields_.if_sym_node_is_not_None_.else_.info_names_get_name_var_": {"doc_hash": "20d7a1ca87bea240023887377eeb28a6b06b8a6d6792fb327a6049b493dd320e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_config_update_PydanticModelTransformer.get_config_update.return.None": {"doc_hash": "8da12be68ebd5892e539acad723b5148cd686f966f97b0559b9e335e94a111e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_is_required_PydanticModelTransformer.get_is_required.return.isinstance_expr_Ellipsis": {"doc_hash": "874ccd80da4369c3f64b5dd7938b40e7de8919b7357460c5f0c0a5fa886a1298"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_alias_info_PydanticModelTransformer.get_alias_info.return.None_False": {"doc_hash": "9e046aaa32a03d7d788b7dd4e4e0f127699e4a15c1ab4061d4b1ab8aaee6d8a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_field_arguments_PydanticModelTransformer.get_field_arguments.return.arguments": {"doc_hash": "a064d9be7685adb48604515542fc8e8c0a8d44d97b02576c52bda6d21c75fa4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.should_init_forbid_extra_PydanticModelTransformer.is_dynamic_alias_present.return.False": {"doc_hash": "51dab1f31633918fd235cdd76c2609a765a2ab2224d92db19bfc2fddcfc89704"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField_PydanticModelField.to_var.return.Var_name_info_self_name_": {"doc_hash": "501f60a528c45ac786db331a9538cb7703387d8827b3088a5e9b7ba9f6b8d33d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_argument_PydanticModelField.deserialize.return.cls_data_": {"doc_hash": "668b7b4a99b5dc05b537ec5c80bb3032af9b77a1bd38226e25a5f0bd3bc166de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_ModelConfigData_ModelConfigData.setdefault.if_getattr_self_key_is_.setattr_self_key_value_": {"doc_hash": "e37c5e5077fd0d8f7cd2ffd0cafd2c5643c6c7f593b1fe0761051b33529ab02e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_ERROR_ORM_error_required_dynamic_aliases.api_fail_Required_dynami": {"doc_hash": "08930b3a01ebf8874feaeeca689954e677decbd4f0e2a5231558647afc7200af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_error_unexpected_behavior_error_default_and_default_factory_specified.api_fail_Field_default_a": {"doc_hash": "c4943d406fbb49c9658d3e8c375c38c233d9273c9bbb90cceb2dce22c9c87c06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_add_method_add_method.info_defn_defs_body_appen": {"doc_hash": "b09c1a6e352039ed7054eb683ebca0244df89afee98770af96dad7ded6c5c51b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_get_fullname_get_name.return.fn": {"doc_hash": "9bb7a4f15ed53889bc6e131f2098adacdf5ef4a48bec93c7fa63dc644606e561"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_parse_toml_": {"doc_hash": "3b217ae4d2c399ccb1776344c8b69f653a2d696cddd2cce2639ce5ffd144bc51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_from___future___import_an_KafkaDsn.Annotated_Url_UrlConstra": {"doc_hash": "2390822cf0774fc8c619100286369a0c925a696dc126474d4a7c3c16058b2eeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_MySQLDsn_None_1.else_.EmailStr.validate.return.validate_email___input_va": {"doc_hash": "5df4b5b825e083d3814e06d5bcc0730c82be373c3de71b7332ab5af13b317439"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NameEmail_NameEmail.__str__.return.f_self_name_self_emai": {"doc_hash": "fccea09454e84cd7e3f050c737e24a565060b13b546b007e0db795b7bd79b471"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyAddress_IPvAnyAddress._validate._type_ignore_return_val": {"doc_hash": "1504411e77ce20412ab3b9e7704fa9e0f276577b20f1584c6f6aa7b993d246da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyInterface_IPvAnyInterface._validate._type_ignore_return_val": {"doc_hash": "77361696868e98202acffe9655356a5f520a16991f99be284616d55ebde8d1f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork_IPvAnyNetwork.__new__.None_1.except_ValueError_.raise_PydanticCustomError": {"doc_hash": "1178af46c026208f2ab180ab9f683f6383018f593fbb58a827a84ba42e208509"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork.__pydantic_modify_json_schema___pretty_email_regex.re_compile_r_w_": {"doc_hash": "54e6f5256914a9224aaaaf41535d58360698cc1ff7f8e3d51b92d63fdeaf40da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_validate_email_": {"doc_hash": "3a47b952c69b286b17015335ee750bddc9a76432642013d56c688b2a72021bd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_from___future___import_an_parse_obj_as.return.AnalyzedType_type__valid": {"doc_hash": "f12c0fc6c7503bdbeb135c8a05dfaa8d88f1f61b79b2bb65217c8e12db0ca76e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_schema_of_schema_of.return.res": {"doc_hash": "943e63bd60d850f5357244c2d1b1047801b802fe9c0cd9fc944221aab2d07a7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_schema_json_of_": {"doc_hash": "bdde956bcd114b4f2b70a765eb65b231ff3371fb951203ee4205f7fc8334b8c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_from___future___import_an_StrictBool.Annotated_bool_Strict_": {"doc_hash": "4f5af4f73109b5a79994538a3366e70679ff6908f915903b8c73114a3d9d8459"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_1_conint.return.Annotated_type_ignor": {"doc_hash": "2c83ac71390c20395dc7f05e2180970adaa8b64de53a4e604af0156f390df7f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveInt_AllowInfNan.allow_inf_nan.True": {"doc_hash": "0d192a0d1e42a8c7418348a845aa87e35df2d8a0b246e18bd93007b01f56e728"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_confloat_confloat.return.Annotated_type_ignor": {"doc_hash": "f71ee840195a4e363a16858a5c7bf00262d389cdc927be105167dd1776a56a22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveFloat_StrictBytes.Annotated_bytes_Strict_": {"doc_hash": "6779599636153da9a627b4389b1c72080850fbae22cbefa55c6266cfba07d019"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_4_constr.return.Annotated_type_ignor": {"doc_hash": "5293957cb642195d70c30f83c108da65f3783fd577c012b8e8071745a1a9fd53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StrictStr_if_TYPE_CHECKING_.else_.ImportString.__repr__.return._ImportString_": {"doc_hash": "8de5f34a616c19caa9369638f6b3be5db4f9f88776253aa644d839bd88cfbd27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_7_condecimal.return.Annotated_type_ignor": {"doc_hash": "2585fa39f2336dcad83efc767bb058243698fe9c2c41749075b74eee037a9e68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_8_UuidVersion.validate.return.value": {"doc_hash": "c870487eff80c4d5aa4871c35620c6443e028eda1ba9255311cf04f7fbdb26ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_UUID1_PathType.__get_pydantic_core_schema__.return.core_schema_general_after": {"doc_hash": "7421e4bda4a2979dd5107e6288d3cab504bb2c5925a8678b32b06d9c59a0844d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PathType.validate_file_PathType.validate_new.if_path_exists_.else_.return.path": {"doc_hash": "9a9a596ace9228cc107d0fbab9ac91a29360592d13cc5e45cc4bd4d4b68b04cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_FilePath_SecretType.TypeVar_SecretType_str": {"doc_hash": "6645b615e2ce80aa39570552bbe5259ec2df76ba70d6b2c3b4b5ec4ab4ed4240"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretField_SecretField.__get_pydantic_core_schema__.return.core_schema_general_after": {"doc_hash": "712244fb6ae8530ac9ccf87b955d38c556f6e9006a7b91bbcfb8833b7a2ef9fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretField._serialize_SecretField.__repr__.return.f_self___class_____name_": {"doc_hash": "6489bf90cb279c8577a56ff1b16beefc07172645bca28b655214e5d357d91f7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_secret_display_SecretFieldValidator.__init__.self.error_prefix._string_if_field_type_is": {"doc_hash": "8b21d8c280df54d08f6842b9c7fc938f13e8bd06d8f4dacd47bdca468fa7b666"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretFieldValidator.__call___SecretFieldValidator.__pydantic_update_schema__.self__update_attrs_constr": {"doc_hash": "c25e17854c0cc304147ce5de3858eed5ee2223f503fab26c8aae8c42cef4728a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretStr_PaymentCardBrand.__str__.return.self_value": {"doc_hash": "5f8c531c6e6a6257e4963e5d44040469d495de0f60fcb5f8c6522322fb8de9ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber_PaymentCardNumber.validate_digits.if_not_card_number_isdigi.raise_PydanticCustomError": {"doc_hash": "ad428bb2a9b60bde75e9570239971afbb450e0792d39dd9a509698e7f7ff41c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber.validate_luhn_check_digit_PaymentCardNumber.validate_luhn_check_digit.return.card_number": {"doc_hash": "0d5a7139f1227a7e917687b34b7ceb2817343f080cb756d62786ced0aaa24f50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber.validate_brand_PaymentCardNumber.validate_brand.return.brand": {"doc_hash": "08a99b3988e8b7f747c6cb9f494ff90f2010b20ef979a093cf4364df35b51085"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_13_byte_string_re.re_compile_r_s_d_": {"doc_hash": "3a63b464e15cb94a9466ed8f6fced0e87782631946c3b00485d639b42525f507"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize_ByteSize.validate.return.cls_int_float_scalar_u": {"doc_hash": "3475574e3d014181ccf9615e7995b1d1f8025a86b59afcafa9b4f3afc9d9e642"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.human_readable_ByteSize.to.return.self_unit_div": {"doc_hash": "dbb31ee4b82f8b71e9e863f69cb7d468536a46e43dc0eb815b0a0499ab853dea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_14_": {"doc_hash": "c92dd88664657743c6e5af6ac92390a05a1be2bc7d86197552eb4fc936c572fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py___all___": {"doc_hash": "7e5d7123a02c167ed85805ab491c93546adfc3ec47af8e85af14a8313975150c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_importlib__create_module_file.return.name_str_path_": {"doc_hash": "f7c7658e42f58f8f3c0c3567bcbe177420bbd939ab6a791b5ddfcb9d09c1fbc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_create_module_": {"doc_hash": "251f806da142f834db90b91ce1799704c8047627bff972fae4bfd47155761843"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/custom_constructor.py__": {"doc_hash": "5b6ba43379140eb32ee35b619ed24b0cd9ea73cc19e805dd7a668e25af46f1e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/dataclass_no_any.py__": {"doc_hash": "b7d66b36f6146bfaa1867b40e171f8702742b920e8d93477ec22725d6d5f4320"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail1.py___": {"doc_hash": "f2173f2338bea04b8c6c6ec8f0da86c8558c0a42b0d63fc6bdc60146bacc3d2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail2.py__": {"doc_hash": "48fa4b8c2a678eb367e16e48e6baf3be781c932ed6a6064c0f4f51b78e0b2242"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail3.py__": {"doc_hash": "6368f64e45f4a1a767c6831cec046d7920ec864831f8e001048e8efcde2456df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail4.py_from_typing_import_Any_": {"doc_hash": "84c6983c6379d61282d9f5a760ccbc1f77c749cd97c7b274efb0d7f08f5b9e4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail_defaults.py__": {"doc_hash": "2319cc241ae359387f3e3396da93e7ffe2e87e869d93cf42d21159b4f401b3b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_default_factory.py___": {"doc_hash": "194204f24945a545ed445b6199da3b17bdcc95a17d89adb4bfee54549d515c9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_from_typing_import_Generi_DynamicAliasModel.z": {"doc_hash": "178fcde748d7f0c123b417929796356d896d3dfa2c3903c28e8ecd7310bb8729"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_DynamicAliasModel_y_y__": {"doc_hash": "1406f1a1e844858284df4502f58e4625a40decdcc0ef7960173521b7db1d5c3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_from_typing_import_Any_G_DynamicAliasModel_y_y_": {"doc_hash": "8192ba01b115abc4bdff13a4337a224a3486d94695234d2c42288dc515faac7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_DynamicAliasModel2_": {"doc_hash": "39038296e4aba97e74d5332569518c98f5cf5c679cb52bb446bca3cd7ebb3523"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success.py_from_typing_import_ClassV_KwargsFrozenModel.x": {"doc_hash": "31cfe73dbde8fa5d6e526d2264670c7673992e5df2e730eb83b026e2a89815d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success.py_KwargsNotFrozenModel_": {"doc_hash": "05cf5a43486b7acc6d984b217988895925607feec86f86977419106bf61b44db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel_model_vali": {"doc_hash": "7e56d32bd3fe9037afb6e38cbab4e2ff6143d1369679a8044ce8bf456741182e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_KwargsFrozenModel_": {"doc_hash": "05ab0519aa866dd84590e1086348c8a5bbd5f4cf83574cc73f03d67f15504c72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py___Flags.__str__.return.f_flag_self_strict_bool_": {"doc_hash": "9ac6eb5cd8e0647aff47da1e6f184c303fd19ede9a843f28f5bf378dde53cd1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_Model_Model.pre_root_check.return.values": {"doc_hash": "abd03f07fba24b19c9daa7ff186b6a4a0856efdde0cda88a1b1ae9407187156c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_": {"doc_hash": "0a06e39c873326ccd60bcfb2d070f64ee19969e1dad943e43f30129d93303292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_": {"doc_hash": "6aec6f92570d8cb3bb7ad2b34e5eb622d19ba761535dcf6ec0da44e50e85a0d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_validated_": {"doc_hash": "a80abc117fe7192c921458df1426cf00d72335f049e389f4a9364a9ec0b38cd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_importlib_os_chdir_Path___file___p": {"doc_hash": "7eb369c66477c7d9271787a130dafe11e86f5850f54c3f8aafdba8c35678e892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_cases_cases._": {"doc_hash": "0ea81273f0810af033ebdcd958cd28e2ad17f17c69748831577bcf82b81e2576"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_build_executable_modules_executable_modules.build_executable_modules_": {"doc_hash": "20c93cee62d1fec7c4944c4c8a77092c4e41046cdbc75bd9cbf8f8ca191737f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_mypy_results_test_mypy_results.assert_actual_out_expe": {"doc_hash": "ee9d6b37bee1f0766fc563b1611f6fcdf088c10171e226e14560f038ec7e790e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_bad_toml_config_test_bad_toml_config.assert_str_e_value_C": {"doc_hash": "c1d2c30e49d464c039076738c30ef5465ce1bba019f84093aa135da1ef58f74a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_success_cases_run_test_explicit_reexports.for_name_export_all_in_.for_export_in_export_all_.assert_export_in_root_all": {"doc_hash": "6d1487adb0e5b159e2b8e6b113b8c3f3c1b04b28de95367d0fa119fd75fb816c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_explicit_reexports_exist_": {"doc_hash": "b304d1ecabfadf54de7989631747341e2840426f2acdb8c4377f57b3d47e8765"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/pyright/pyright_example.py___": {"doc_hash": "55512a201c18aac801e92c9bc39dd7e79042b6f00a93c86035e30483fe9cba95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_abc.py_abc_": {"doc_hash": "87c5e157e895170cf0cf27ef998ea2b93331b170e3735ec47da2064eabe846bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_from_contextlib_import_nu_test_alias_generator.assert_v_model_dump_by_al": {"doc_hash": "ed29b2fb379713e0e155145da6f8f71c05d11ceacf7e9fb1c518725e82eb953c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_wrong_type_error_test_basic_alias.assert_repr_Model_model_f": {"doc_hash": "4982cf498de5e42c213d9fcd45a492bf23d8b34414ae1e59979815bea813110c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_error_test_alias_error.assert_exc_info_value_err": {"doc_hash": "b69cc3515c85d8cf152167ee90c74266e8d60f9739e9f959931df4927453dcb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_error_loc_by_alias_test_annotation_config.assert_Model_foobar_123_": {"doc_hash": "cdcf568ff8da7dac8f723f288c441968eb40443d37a55ba7317b5ffa32d07694"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_pop_by_field_name_test_pop_by_field_name.assert_exc_info_value_err": {"doc_hash": "ad1481da8f2a5b1e35961076adeeecbaa778ce4f26b3fe5f59f8db520f23bd21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_override_behavior_test_alias_override_behavior.None_5": {"doc_hash": "8e5c44b91b246bbae7a52431b74931c6dd9d4c8fd190a269a19cf4cf70cc3dcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_parent_test_alias_generator_on_parent.None_4": {"doc_hash": "6180076d1bcc44e1a6ec85ac96f511d5a44bf63413398c5a4a8931417433b8f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_on_child_test_low_priority_alias.None_1": {"doc_hash": "842faf63a9e419eb6713e8a91fc8f9f47a9fb7d8fc51cb577fadd480b42694fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_empty_string_alias_": {"doc_hash": "ee68c250abe4eadc25ca5196cba6631b9458e153a8d4ce1960c23ccaab086fef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_sys_test_annotated.assert_repr_M_model_field": {"doc_hash": "0dcc56580ff612121f3c2a1c009d9ac902a0121faefca0115bf614fce0b180ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_model_exceptions_test_annotated_model_exceptions.with_exc_handler_.M.x.value": {"doc_hash": "ef5bf308a71385a938ddec1b175a0bb2dc5ecb166f6ade6e200fc6fa19cb772e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_allows_unknown_test_annotated_instance_exceptions.with_empty_init_ctx_.assert_M_x_5": {"doc_hash": "e75808c1dfbada001850a7eadfdaa42e119d7f45795989892f0bdb680ab75764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_field_reuse_test_config_field_info.assert_Foo_model_json_sch": {"doc_hash": "c1c27bad7b90d01dfb6fc705cfa286c30bccf6f4971f9c8a9d62db73100ccf5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_alias_": {"doc_hash": "65213cc72c15dda5ee199e74b7a27b30dc5f9caf4dcbaa3ee9397fe4715183cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_assert_in_validators.py___": {"doc_hash": "b482be77a4de115fa3d5fef1a3c93a2bef418ec1aaf252187381e18837b66c47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_callable.py_sys_": {"doc_hash": "07fc31a752638e85aefad0316430c9594d05c4f997daf4dccb8847f13019e83f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_from_datetime_import_date_test_color_success.assert_c_original_ra": {"doc_hash": "a457f59f90d15b6428635d0be8dcad168a0ad2c48d0a3a3c133210a843a1faf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_color_fail_test_color_fail.assert_exc_info_value_typ": {"doc_hash": "a74afc02c96d63dd7deba318b01902f92609ad267d0c7c26e3cffb20650a49d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_model_validation_test_as_rgb.None_2": {"doc_hash": "6f8ace3a3795517718770b0ebadd61777e53de0a3fe903ecb253551af60b9285"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_rgb_tuple_test_as_rgb_tuple.None_7": {"doc_hash": "107a8d4107c7aaa59c886d9091f62ec55c67e3b3b2853069acfc4ae771bb9bdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hsl_test_as_hsl.assert_Color_hsl_260_43": {"doc_hash": "2b11ba1d65ccc2c388fb9af954b8435fa7f1b395c85810cf25f80613546991d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hsl_tuple_test_as_hsl_tuple.assert_hsla_3_0_5": {"doc_hash": "a86e20ede5e9c6daa8d7cecdf3dd6772e3a1bb2485dfb3c4e09c35430f716fad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hex_test_as_hex.None_5": {"doc_hash": "350a4d789b940a4312a0dc0d172913f2fa271a8d0d65efc47377a3866c87cd1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_named_test_as_named.assert_Color_1_2_3_0_": {"doc_hash": "b26c8b679ad2f1b6a68384db77ea459a78368b031001880dc9ff598ad98266d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_str_repr_": {"doc_hash": "27fd0c21e166ed406e0cfe7f3193551495791f161d093e21cc610152ec704ce0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_re_model_with_strict_config.return.ModelWithStrictConfig": {"doc_hash": "557e700a1e33ac5aa807792d11985ba2d1f90454c64f896020cfe0798169f6c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py__equals_test_config_dict_missing_keys.with_pytest_raises_KeyErr.ConfigDict_missing_pro": {"doc_hash": "c9795836abad24de8936ee4dc239f152aecdf50b5f52085e630a80e20390afa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig_TestsBaseConfig.test_base_config_properly_converted_to_dict.for_k_v_in_expected_item.assert_MyModel_model_conf": {"doc_hash": "898a98a5e5f837b00b6c41d24af862051a41baa15cfd9367e4019792bdc2fbc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_custom_init_signature_TestsBaseConfig.test_base_config_custom_init_signature.assert__equals_str_sig_": {"doc_hash": "9f8cddd052e1627680c16ef395cf35eb99ef6ed2bd2bc43af28f7a488a515b5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_custom_init_signature_with_no_var_kw_TestsBaseConfig.test_base_config_extra_allow_conflict_custom_signature.assert__equals_str_signat": {"doc_hash": "d24d4fcf34c0610872f03ab8c951589ac20a6da73be7c807ff4133d7208ed973"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field.None_4": {"doc_hash": "2a075629911317f6c2b207711fa9a60ea6fe08f58eced670f2816155736ee8b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled_TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled.assert_all_v_model_dump_": {"doc_hash": "a755923af069bb1ec587fbf52663a45f73e565c01d724f99f0b6f4dfe2e5f819"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_finite_float_config_TestsBaseConfig.test_finite_float_config.assert_exc_info_value_err": {"doc_hash": "2facc7e25254e2bd5846b3663209e82c8e3b7ecd97c5bb8419c4b49fd36dd2bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_str_strip_whitespace_TestsBaseConfig.test_str_strip_whitespace.assert_m_str_check_res": {"doc_hash": "51a0c6da1d5c73d10eced363cf7697108d99e4f16d79d41c1ba5e0495fff7525"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_str_to_upper_TestsBaseConfig.test_namedtuple_arbitrary_type.with_pytest_raises_Pydant.ModelNoArbitraryTypes.x": {"doc_hash": "7b745e36637293f62c3ac65d15d1bbafc28943c434e2011ce4ad38c814d2e7c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_populate_by_name_config_TestsBaseConfig.test_populate_by_name_config.with_expectation_.assert_f_bar__expected": {"doc_hash": "222db6adbc9ad57e2a1f4e35370222fe4c989373b8f93c4860ace7c84474ada8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_immutable_copy_with_frozen_TestsBaseConfig.test_config_class_attributes_are_deprecated.None_3.assert_Config_validate_": {"doc_hash": "670dbf61d84b2a6f943757ce22a0c5032834ad14453efdd74e01dbb27ecbc183"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_config_class_missing_attributes_TestsBaseConfig.test_config_class_missing_attributes.None_3.Config_missing_attribut": {"doc_hash": "5cb2ea59b67a929816aa179855c94e6e646d35a37a071247fd77c7fa72b9259a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_key_deprecation_test_config_key_deprecation.None_3.my_function.pass": {"doc_hash": "1ff2f42d7e93d9dd748d4570b0fda6ce762ce86603e0b2c482218aa4b56bf9cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_invalid_extra_": {"doc_hash": "228ef6d09b7a575a89ce83007093632dd3bce22646ec6014da7f8ae9222f3b69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_pickle_test_large_any_str.assert_m_b_content_str": {"doc_hash": "77e84e8d218b0eabe0586c5895f53647a07dfb5edf1286c2e00e31db7540f02e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_deprecated_copy_deprecated_copy.with_pytest_warns_.return.m_copy_include_include_e": {"doc_hash": "c734618a97ea4c8b1c16736a3ff5efa2851ca31ac399136b1a398668e3b79a3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_copy_method_model_two_fixture.return.ModelTwo": {"doc_hash": "8178f28e1f1e53374d96b363f2e0c5be029709a0389c9053ab0c6cffac7d15ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_deep_copy_test_deep_copy.assert_m__foo__is_not_m2_": {"doc_hash": "3f682379d5f61b0cfe43538dffcac3a2ff217ccbcfffdd8026f49843c684bfcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_exclude_test_copy_exclude.assert_m_m2": {"doc_hash": "e28a20d68efd7a05932daf7eb5e58110706d941c08408f4515715b90de9b5b40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_include_test_copy_include_exclude.assert_set_m2_model_dump_": {"doc_hash": "aa67e50be2aabcf7a639aa45d962de00e0431f7a0d2f82cf184f0184b5b5edee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_exclude_test_copy_advanced_exclude.None_3": {"doc_hash": "8139656e166f0f0723fa48f2e77389bf7fca66cc46d85b06157ad3eaafec0b61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_include_test_copy_advanced_include.None_3": {"doc_hash": "10f00037abc6c6d0b70efbb4453c60d4da368da48d00b387fb01c2d1fa7f2669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_include_exclude_test_copy_advanced_include_exclude.assert_m2_model_dump_": {"doc_hash": "0e9b9c04be3faea26bebfcb2e95479983377dbfdb05036b8abf0bc02b6ca7f11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_test_copy_update.assert_m_m2": {"doc_hash": "5ea58099134890a196576545b8f2bc4157518f0f27f7c61e5e28527ccf45792c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_unset_test_copy_set_fields.None_1": {"doc_hash": "8b4b542532dd09084d5161effb86257dbf4d54b0f5471dcd9cc1d0ea052e1770"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_simple_pickle_test_simple_pickle.assert_m_model_fields_": {"doc_hash": "8379937bdf3f9cfb16055d4eb202278fbf246a53ea77e3e7bc80392f54107754"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_recursive_pickle_test_recursive_pickle.assert_m__foo__m2__foo": {"doc_hash": "0c0686da3e85a8ffba335195d41767ed36e5480911faf21d563f816fa2f613d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_pickle_undefined_test_pickle_undefined.assert_not_hasattr_m3__": {"doc_hash": "bcdb4f3054c2867fc2a43d525410d86c9db248d53d315b77de2c755b78fd97e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_undefined_test_pickle_fields_set.assert_m2_model_dump_excl": {"doc_hash": "0f45d6ccce073dadc73abfb78410c28407421f9e07d0eda77c97ed94ed906d28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_exclude_test_copy_update_exclude.with_pytest_warns_.None_1": {"doc_hash": "6b67382a4825da4f89f12632ed2f541a3b8ba5b7b73bc261f90d9182ee9b79e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_shallow_copy_modify_test_shallow_copy_modify.assert_y_deep_deep_thing": {"doc_hash": "376e12dc0948aaeb653d28c8d56b9a2d27b0c52a7ecef2293d09b7971767b701"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_construct_default_factory_": {"doc_hash": "cdeb665582ff172bcc9723a013fc6d5d7e3f82d8e057ae7d390beb46f25c6814"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_from_typing_import_Option_test_create_model.assert_model___module___": {"doc_hash": "4d4477d43b4f9c41f12105a701b204d636057f788d1850d5c597d4de63b4f57c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_usage_test_create_model_pickle.module.assert_m2_is_not_m": {"doc_hash": "d981187da49f07e723dcd4f433f8e5e2e992dcd4a76677885ae10b795d0bacbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_invalid_name_test_config_and_base.with_pytest_raises_errors.create_model_FooModel_": {"doc_hash": "328295da3145d3c0adf6dce6fc74a6e55aeee92aa4c73a8c14749b9fd424e4e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_test_inheritance.assert_m_model_dump_": {"doc_hash": "28139638abc391b3cc7042a8c4facd1c99257b868d1e3f30a3287262da0dffeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_custom_config_test_custom_config_extras.with_pytest_raises_Valida.model_bar_654_": {"doc_hash": "03a3b4eb01862cd1bace586e5a2a64079597642326cb97f2c72ddf48e58ca9dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_test_inheritance_validators.with_pytest_raises_Valida.model_a_something_else_": {"doc_hash": "09cd375ce0286ee573318b3b9f7a6d85c89a114619d76c6e901389145ba7dfe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_always_test_inheritance_validators_always.None_1.model_a_something_else_": {"doc_hash": "bd2415cab954b2bd35cb4cfbcb3d6697573a4973e3cec9d75bbc0ab180da12a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_all_test_inheritance_validators_all.assert_model_a_2_b_6_mo": {"doc_hash": "5b143ffa82d904106ff3a4b16139ae9d0144cd74fda7f1cfd339f06e5cc75691"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_funky_name_test_funky_name.assert_exc_info_value_err": {"doc_hash": "997110d39773e45eccf101f379c7152ee06707cacf0d1ccfc3be5a767ba7cd66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_repeat_base_usage_test_repeat_base_usage.assert_model3_model_field": {"doc_hash": "9b5175f42c6575116696be9868c00ac1fc61cf5879ddf694f5ef17b094752e94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_dynamic_and_static_test_config_field_info_create_model.assert_m2_model_json_sche": {"doc_hash": "f95ca939a1e4e63ffad1c1e37529c0729b62a901e279f1a07c61230eb6e86cf4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_set_name_test_set_name.if_base_is_object_.assert_a__some_func_2": {"doc_hash": "d5a4df77530b58e64c361d5615d72bc9ee792144789b603116666027787dc927"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_with_slots_": {"doc_hash": "b6afc81c181ba85d9b8802cbedc13dbf95bd668e1529ffc6a0cf1ba3926e5089"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_dataclasses_test_model_name.None_1": {"doc_hash": "1a28afa5341ab473a0abc77611734363136db64c13b11f43af2a13f566ef428b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_value_error_test_value_error.assert_exc_info_value_err": {"doc_hash": "7b38334dbdae2bb2fdfdac67698107c4a9da25910905480643af6e71aef115cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_frozen_test_validate_assignment.assert_d_a_7": {"doc_hash": "2411982bb3a9052ffdafdc683318bd79cacb200fa66aa4806089d64e5505f55a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_error_test_validate_assignment_error.assert_exc_info_value_err": {"doc_hash": "a8de57a2a334bfc937d479b81ff892e26d8419f34c1c9ee8314bfd952ba7d489"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_not_validate_assignment_test_validate_assignment_value_change.assert_d_a_6": {"doc_hash": "a4ef02d12a98dce077d993ba725b7683d8f599678a1b522d4bd1911eb6d12d6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_extra_unknown_field_assigned_allowed_test_validate_assignment_extra_unknown_field_assigned_allowed.assert_d_extra_field_1": {"doc_hash": "b809daf370a714380f3be95c15de87b189006670f866acd8ae1ec892e61c0f73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_extra_unknown_field_assigned_errors_test_validate_assignment_extra_unknown_field_assigned_errors.assert_exc_info_value_err": {"doc_hash": "a6b4b7623f50a92f7285fdb7954920aa62f43c585b410bc86e8739959c93580e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_test_post_init_validation.assert_PydanticDC_a_2_": {"doc_hash": "34e54ec117dfa57575d36ca9baa355189d77a104d7ac772d83cc201eaa38db60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_convert_vanilla_dc_test_convert_vanilla_dc.assert_py_dc_b_hello_": {"doc_hash": "479952eeb7e95c7415b3ddb142aa2b21713455da61e4a0f31d5a989a3469a1c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_std_dataclass_with_parent_test_std_dataclass_with_parent.None_2": {"doc_hash": "1d00092a01f0e21277c5efd546406e5ca40eba8c570ed5738b71e93f8d2cfd35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_inheritance_chain_test_post_init_inheritance_chain.assert_post_init_called": {"doc_hash": "b528ef3de41d46dcc0e060af9b3ff9f0932d54785c2d98770823d25374203925"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_post_parse_test_post_init_assignment.assert_c_c_0_300000000": {"doc_hash": "4dcf99e984e1116019e3f76def3ab54fdcca4c333d26ff1cd3527cca9d467723"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_test_inheritance.None_3": {"doc_hash": "2ff6cb6f3d0e2540ba240100a08693565dfc437eb5d43580cb1463083017cb52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_long_string_error_test_validate_long_string_error.assert_exc_info_value_err": {"doc_hash": "4dddc2dc747a85a937a5250b10c29053121984e36713ac5db152e08963e348c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_long_string_error_test_no_validate_assignment_long_string_error.assert_d_a_xxxx_": {"doc_hash": "afa1d6276d96379ae92ddb36de49a7af965fc8907c25a6d9005e2bc1a18cad6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_dataclass_test_nested_dataclass.None_5": {"doc_hash": "371d3d4cfd0285db061617b34c464cf1ac76c038059cc5e09d69999d2e7ffec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_arbitrary_types_allowed_test_arbitrary_types_allowed.assert_exc_info_value_err": {"doc_hash": "41d2ce75abc39f3680c95c2f7d220c64491fd855eda657cfc9d57111fbeb2477"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_dataclass_model_test_fields.None_4": {"doc_hash": "76017d3d20669e492a2835fa77f0fe1602bbb8a3ae1f47380262d21c1c52696e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_factory_field_test_default_factory_field.assert_fields_other_de": {"doc_hash": "922b08afcd8d86c138f19107b4c3ea01e54dc446bf4ba575885cad6c6d928096"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_factory_singleton_field_test_schema.User.height.pydantic_Field_None_titl": {"doc_hash": "c792cc7dc25b5c46c83623bbf9915e55f292e5d0d55234edac02b41db31198a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_schema.User_id_123__test_schema.assert_model_json_schema_": {"doc_hash": "b11a292cf40275fc1352bc3c7b29af1b272b0d001c786f775be6d1b633a31344"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_schema_test_nested_schema.assert_model_json_schema_": {"doc_hash": "9e79c009e8c672d470f3b37128f304c2173f7ff79c92f0685cef791a7a031be6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_intvar_3_7_test_initvar.with_pytest_raises_Attrib.tiv_y": {"doc_hash": "187b1c9af13af5891a07a6faf709f9063882c10427ca6f85d406ad89504fbf5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_derived_field_from_initvar_test_derived_field_from_initvar.with_pytest_raises_Valida.DerivedWithInitVar_Not_A": {"doc_hash": "9a791eb64a0d2d5b79f0a37b114f9d7c8a8c26d6db05759353f3332007453e1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_initvars_post_init_test_initvars_post_init.assert_p_path_Path_h": {"doc_hash": "576f211569bc9c1889a7038357b897f44c99d9926333cca2533c8d2fa3e30d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_classvar_test_inheritance_post_init.assert_post_init_called": {"doc_hash": "09ac0bac3507d999c420e23e9f596dd524ca569ea602646a4b3b502c6f2d65be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_hashable_required_test_hashable_optional.MyDataclass_v_None_": {"doc_hash": "9c267de5d744d2d78c8d888daf2a0d94992a0dc6fd5bcbfe26d9aa0e99714316"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_test_override_builtin_dataclass.assert_e_value_errors_": {"doc_hash": "e0a9d2eadfdee27d9343f037ae24ffe961d751e378a2ec69fb3506bc5e9f5db8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_2_test_override_builtin_dataclass_2.assert_f_seen_count_7": {"doc_hash": "00cdda0b492d24ad6c15862bfb8e8ffd887e250ad335cb519113d384a66841b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_nested_test_override_builtin_dataclass_nested.assert_foo_file_meta_seen": {"doc_hash": "413b1267f809037bb0baa0756cd23f6f9ad5d4e467b7e096a041c2fa0bff65d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_nested_schema_test_override_builtin_dataclass_nested_schema.assert_model_json_schema_": {"doc_hash": "e5a5ae92fa33fc07f4bfeb1d1d8a0fe7b527b0c1f837969ab7027c0c1b62ff70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inherit_builtin_dataclass_test_forward_stdlib_dataclass_params.with_pytest_raises_datacl.e.item.name._pika2_": {"doc_hash": "85ac084aec1eb7832b4d34afd1fa14b94ca1c644c7da9b367376815562db7612"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_callable_field_test_pydantic_callable_field.None_1": {"doc_hash": "51a7a687c40792bbfbd7cc6051396eb690d03251fb557ae034676eeeaa83ae7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pickle_overridden_builtin_dataclass_test_pickle_overridden_builtin_dataclass.with_pytest_raises_Valida.restored_obj.value._value_of_a_wrong_type_": {"doc_hash": "f01430916ae939a9180a8a03b60d7e33fc80846a81ebcf8dfed1bb7267147477"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_gen_2162_dataclasses_gen_2162_dataclasses.yield_foo_PydanticBaz_c_": {"doc_hash": "4eb6edd141a8b449a668195c5c3390068a198c0fb36b7c06be6b79ba00580b3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2162_test_issue_2424.assert_ValidatedThing_x_": {"doc_hash": "8aedc46f04d2d752c1dbf6024e6e8db0cfb707952d20049103eeeb1940b20bac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2541_test_issue_2541.with_pytest_raises_datacl.e.item.infos.id.2": {"doc_hash": "e1bd11fc316da0e4f227b559e320791cd9ea9bc4cc6db19635f9027ae0cabbc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_complex_nested_vanilla_dataclass_test_complex_nested_vanilla_dataclass.assert_M_model_json_schem": {"doc_hash": "a3f1ef3d7297dcf328b584025428f85eb0f6418d13b9a0753420bf9f68c38de7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2594_test_issue_3011.assert_c_thing_thing_a_": {"doc_hash": "690ddf7d8d04cbf826dc17dc2ead68b21c1f0c4418176088ff81049b7784a340"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_3162_test_issue_3162.assert_Users_model_json_s": {"doc_hash": "cbc880d9be47c53e199ed4f537f81a7ee5459c3e09bac84fc8dd63228d6481d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_discriminated_union_basemodel_instance_value_test_discriminated_union_basemodel_instance_value.assert_model_json_schema_": {"doc_hash": "3d8788653cf5ed51f3094d7d181f17fc99cd239233bd0a674e50af95f52cfa96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_after_validation_test_post_init_after_validation.assert_Model_model_valida": {"doc_hash": "8420a7fe281c9f0492f39f53ca7282da51bf85cda6e49cda3e3ad9a21c8dd463"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_keeps_custom_properties_test_keeps_custom_properties.for_cls_in_clases_to_test.assert_instance_a_test": {"doc_hash": "e83c554617c977df10d7a38ada48ab0ba5f82f6d5e48f9a4e1da3e1ded867508"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_ignore_extra_test_allow_extra.assert_foo___dict___": {"doc_hash": "8d12882cdc3506769cd82b5c4fbdf0537be3ca37af73bbd3b4a63e07cb838947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_allow_extra_subclass_test_allow_extra_subclass.assert_bar___dict___": {"doc_hash": "969710f393439c38c1ac4546e77e4b864fbfe5e1184511d1161affbe9380590c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_forbid_extra_test_validator.assert_d_b_5_0": {"doc_hash": "73d84e3951a31f9aa834858a1978e43acfa70741b64ae8415c576f4821159621"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_parent_post_init_test_parent_post_init._1_3_2_8": {"doc_hash": "0811f4e368f5dd9d0fb781708080e646c5286897f8ea473d7e9f945b7f797ea8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_subclass_post_init_order_test_subclass_post_init_inheritance._1_3_3": {"doc_hash": "cca149dda11b1e34640614447e01181471c40d7548f091a953270a211457e5ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_config_as_type_deprecated_test_validator_info_field_name_data_before.assert_Model_a_b_your_foo": {"doc_hash": "a51b30982da586ba89a9a902403d1669c82330135646561bb74c430ecf880b0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_replace_test_inheritance_replace.Parent.parent_val_after.return.v": {"doc_hash": "510124da86901bc4fb6213e177ec8189ed7d4709decf045be8a171aaf910d18d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_replace.Child_test_inheritance_replace.assert_Child_a_a_e": {"doc_hash": "a16e0da8a8c4bdba8f208130d787078ef9c42972ff6b6c065672596faea8dbb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclasses_inheritance_default_value_is_not_deleted_test_dataclasses_inheritance_default_value_is_not_deleted.None_3": {"doc_hash": "b4d5f6f9fcaf2c9909c233c118a1f662f808e3353faff403d58d9ca1eee3028f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_config_validate_default_": {"doc_hash": "b4369595d6b33c8e56c8a720cd962c44aeb4b522238b2f66fd498594745367eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_re_test_date_parsing.if_isinstance_result_Err.else_.assert_DateModel_d_value_": {"doc_hash": "9dbd8759322f6833623952dffc3cdca9da61db721cd40cb1420c08ae49a712b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_time_model_fixture_datetime_model_fixture.return.DatetimeModel": {"doc_hash": "f53b3d31810708719a79e67a399ce458208bb4cf394d0c064bb2c1ac3cadbc5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_datetime_parsing_test_datetime_parsing.if_isinstance_result_Err.else_.assert_DatetimeModel_dt_v": {"doc_hash": "4a01c79bc8e07d6869932528846a5cac6d6990fe0e42eaf48ebbde89da9865e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_aware_datetime_validation_success_timedelta_model_fixture.return.TimedeltaModel": {"doc_hash": "f289a82a296a3aa14103254a179f90e1ec30f6ad48498235dd1e1ee182be7485"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_parse_python_format_test_parse_python_format._assert_TimedeltaModel_d": {"doc_hash": "670687eacc3dab76698cb686385db61d57cf73a50694445689aeb2503beb5327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_parse_durations_test_parse_durations.if_isinstance_result_Err.else_.assert_TimedeltaModel_d_v": {"doc_hash": "b2fa9c6647577f3cd4bbc8c11f4a7e5cbcda1be3bbcd0565e7243eb08141358e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_model_type_errors_test_model_type_errors.assert_error_msg_er": {"doc_hash": "1ca941bdf022b23431d2e9ce7d56723e7981f6a8ee16c6c7009dd6f9a9445f23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_unicode_decode_error_test_nan.assert_exc_info_value_err": {"doc_hash": "cca044cbfe5d2db5cfcc330875b5db4d96a7419e2dd60ec9f771ce48bb709f91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_date_constraints_test_date_constraints.with_pytest_raises_Valida.Model_a_error_value_": {"doc_hash": "4e613026f7305dfae06c83fedbd7f16745db5878807ad2e8a5e77facbafe7c89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_past_date_validation_success_test_past_date_validation_fails.assert_exc_info_value_err": {"doc_hash": "b85e566e9d23130ee5f38a0feb3d287efbacc2c3d9c051ce28e425a7672f468e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_future_date_validation_success_": {"doc_hash": "cbf7a381787bdbb5c46801a789d28d1640e7614bb0f707cfcd36cc60035b567b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_asyncio_skip_pre_38.pytest_mark_skipif_sys_ve": {"doc_hash": "fd15ca595aeb3b47c7bb62bbff06094843eb8aeebfb1105076acc7f64edfc44c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_args_test_args.None_5.foo_1_2_a_3_b_4_": {"doc_hash": "97ce17d1087e0e490582e28206fe943464dd8e919a5e6cd42dc7dfea49d00a88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_wrap_test_wrap.assert_repr_inspect_signa": {"doc_hash": "391116d7d83f88b05aebe84121809917be0733ba84ccd1b77c94bdca6ae3984a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_kwargs_test_untyped.assert_foo_1_x_2_c": {"doc_hash": "3b2e74bb3cc2b08c8b34edddcec01f1ef97ecd9d229389f10fde6fcc859d522f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_var_args_kwargs_test_var_args_kwargs.None_7": {"doc_hash": "c65c8bee68c2f92b53df5e1e769e0f0d272f07fe3a35d998dcde20d47422aabf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_field_can_provide_factory_test_annotated_field_can_provide_factory.assert_foo2_1_100": {"doc_hash": "52434621c6afeded81cceee9e1eab174607e11f7785c15fe54e2a94b5575ae0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_positional_only_test_positional_only.None_1.module_foo_a_1_b_2_": {"doc_hash": "1e31d87ecbd1e5cdd32483837dfb4637662d213bc82f70d9d1917b0a4b99e917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_args_name_test_args_name.None_2.foo_1_2_3_": {"doc_hash": "586ce5fdfb3d89a30b1d7bb34c1c209917f01f676e3363fe55cfa58118c30aa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_v_args_test_v_args.None_3.foo4.pass": {"doc_hash": "6318f07a04506be7e404c3d575808f0b5b47933424f425371f7be94b2c4b007d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_async_test_async.assert_exc_info_value_err": {"doc_hash": "5b1ba6a8a40f21732469474adac927478da1b359058c4c90cabc01b14da5e4f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err": {"doc_hash": "75cace7c6c8136497d09dafb50586f77d8be3b87e06aba79fd3174b85d853f88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_item_method_test_item_method.assert_exc_info_value_err": {"doc_hash": "1b89a1879016f7faafeadc876f4fd85384b2c53e3808831ffdc1c20bbbb9fe8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_class_method_test_class_method.assert_exc_info_value_err": {"doc_hash": "518a2fab30b0dfb9e7201dce6a1bd2c7b742b8993c5f9c493497955f7731f3f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_config_title_test_config_fields.with_pytest_raises_Pydant.foo.return.f_a_b_": {"doc_hash": "5626e689b2bfddce402d2d41a809ac8cec88364fb94ba21b4e9688d063377882"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_config_arbitrary_types_allowed_test_validate.stub_assert_not_called_": {"doc_hash": "34f350913b55b800881c14199f19d4d6e045af6d6599719c8abd92c0b9db697b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_annotated_use_of_alias_test_annotated_use_of_alias.assert_exc_info_value_err": {"doc_hash": "f838e491351d07ccc7d3585c7be0fb7abeb98d09c575fa3e96fb037c6008ab2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_use_of_alias_test_validate_all.assert_foo_0_datetime": {"doc_hash": "540eb1474ecff2c2f5f4033cbe6bce68d0ef2b311f7ef70ef1ee03aad2438936"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_validate_all_positional_test_validate_all_positional.assert_module_foo_0_d": {"doc_hash": "8447dd15f6bd91a0575c0e495b36a6b208c8247d65ebeec0d3318d0c72e33f35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_validate_extra_": {"doc_hash": "28a40ced7edc0f305fbaf9a75447f47d402cd4c62aa068478e6cd04be34adf00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_platform_deprecated_from_orm.with_pytest_warns_.return.model_type_from_orm_obj_": {"doc_hash": "d39bce870bcae074e04004ef50ca136ae3b7968178f09a6937583c227e1493df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_getdict_test_getdict.assert_repr_gd_Gette": {"doc_hash": "c92f710c29fe64e4effcb49416926635688a2a7efa0df0dff2a1ff2a93e217c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root_test_from_attributes_root.PokemonList.model_config.ConfigDict_from_attribute": {"doc_hash": "ab9d813370e2e8b43a0baa0f7ab7585923ccc9f59328487c12713e59e70c1113"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root.pika_test_from_attributes_root.assert_pokemons_root_": {"doc_hash": "8ca97623f29189d0d20b1597e3c280def791acb25c85b0ef05d01e99df97c374"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root.PokemonDict_test_from_attributes_root.None_1": {"doc_hash": "8ae0ff58fbbb7a4223001de5e58bb11a3c5de351bd5f1d12b80b7c73bd8a7202"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_test_from_attributes.assert_anna_model_model_d": {"doc_hash": "1045b4961ed01ea150fbbd6289cd914f66e9edbaff551be931f621509b3374c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_not_from_attributes_test_object_with_getattr.with_pytest_raises_Valida.deprecated_from_orm_Model": {"doc_hash": "9cf83e8d5c94e83c171329605aeaebc4d58f1d79813c1c31de4135035742f549"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_properties_test_extra_forbid.assert_model_model_dump_": {"doc_hash": "27f32e953bc166eb9c83e1d3565f18af18f967165c435da048aa3d18df90f57b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_root_validator_test_root_validator.assert_validator_value_": {"doc_hash": "adf08d9597f0360e406785845870ca0800c3656fc0e96ec49c4a15ee7c14beda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_custom_getter_dict_test_custom_getter_dict.assert_model_model_dump_": {"doc_hash": "5e72ed0f09d5cd93f60610395deb0f5cbae1b3e32515d127efedd97ab782258b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_recursive_parsing_test_recursive_parsing.None_1": {"doc_hash": "deaf153130b14721739d56db42666a1206be67f076133b0e01ff2e64b149007e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_nested_orm_test_parse_raw_pass.assert_model_model_dump_": {"doc_hash": "f15e9cafa9cd30a7dcfee66829629396a4e65107192ae01ac9e4b2f8a5048248"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_parse_raw_pass_fail_": {"doc_hash": "e780a864df1d0ee2c528961b93d68b8c53157ab170d094a2d5a74aee4ac2f25f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_re_test_discriminated_union_literal_discriminator.with_pytest_raises_Pydant.Model.number": {"doc_hash": "1bac427fd26c6776df6d4e6312cd0ec04c44d7d686d5ce6ca853709b7340a6d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_root_same_discriminator_test_discriminated_union_root_same_discriminator.assert_exc_info_value_err": {"doc_hash": "676dd2f20d3094f1de2deaadacc034acecfe604d9b076de88299da284b2fcc8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_validation_test_discriminated_union_validation.None_4.Model_model_validate_pe": {"doc_hash": "9e4393700ce23f98d565e1d6236230cebf02fec1fa635f2d2c6dae1c0398e315"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_validation.None_6_test_discriminated_union_validation.None_7": {"doc_hash": "8976bdaeff32c555316a734770bca86c02126fc5f527e5fe9fad320bc4fc03aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_annotated_union_test_discriminated_annotated_union.None_4.Model_model_validate_pe": {"doc_hash": "9ca1c65402a00339e43f42e6c0cfd6de7516fcdc20d36cd108dded3084f8bf45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_annotated_union.None_5_test_discriminated_union_basemodel_instance_value.assert_isinstance_t_Top_": {"doc_hash": "4d3da6937ce3e8ef8c6349103f05352e8988826b06794b3a419c810d283822f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_basemodel_instance_value_with_alias_test_discriminated_union_basemodel_instance_value_with_alias.assert_Top_sub_B_literal_": {"doc_hash": "144cc2e6dbcf80cf55d3ab2d19cf54151f496a6cb5fd4aadc16d1d81294f9b4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_int_test_discriminated_union_int.assert_exc_info_value_err": {"doc_hash": "24658dfc9704ac800f95a01f6947d183042d6b7b8c9afdb1c7356590acd62dd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_FooIntEnum_if_sys_version_info_3.ENUM_TEST_CASES_append_S": {"doc_hash": "da2b4b38c780485aba3ff7bf873521a0654caf0e81cde19fd7c949990b33bfb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_enum_test_discriminated_union_enum.assert_exc_info_value_err": {"doc_hash": "0d36f797a1fbd1cf4036c0243921d8387facfdf61f8a812845125ea0aa50ea86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_alias_different_test_alias_same.assert_Model_pet_": {"doc_hash": "bea99ce57431e6c6052bae6993c295c2bec67cceb92519cec485225f0544d54f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_test_nested.assert_isinstance_Model_": {"doc_hash": "15219d1296e08011d0df782ed351632961713775ae0640435f6d46800fff1742"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_generic_test_generic.assert_Container_str_mod": {"doc_hash": "2c5d9683064df2d8b4c90a5edf5a9099f1c590bdc23023aff762c30f054ff224"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_optional_union_test_optional_union.None_5": {"doc_hash": "d5a2485df832b9a0e35f3e6e7787b2ee92fcf9ecfe85c084293fdf25a6348c5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_optional_union_with_defaults_test_optional_union_with_defaults.None_5": {"doc_hash": "1e17e58dc52ffa89dab9bfcb300c2fc0cc114188beaa09b374624aaff86112e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_aliases_matching_is_not_sufficient_test_aliases_matching_is_not_sufficient.with_pytest_raises_Pydant.TaggedParent.tagged.Field_discriminator_kind": {"doc_hash": "bd66a55968a2b4af3affb6c5df30ae63b6c48d031a9aff664035efc2c1c224bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_optional_unions_test_nested_optional_unions.None_1": {"doc_hash": "8285a58c26ddaae80bd759860a4289cd8da205b3a5ab489f6b402bcf1b246ea9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminated_union_test_nested_discriminated_union.assert_exc_info_value_err": {"doc_hash": "bbc23a3ae46eccd8caeffaa8adbc98c159920b842a06d6c99ecc8cf0a10a2be4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_unions_of_optionals_test_unions_of_optionals.None_2": {"doc_hash": "6dcfa24b9aa8b387e0bd9c8b43d49e9eeb04b0947b8943b58969bccccf97a207"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_discriminator_literals_test_union_discriminator_literals.assert_exc_info_value_err": {"doc_hash": "65f9b7ad04fc229b155e59e6fa96a58a87df3af0d955093364dfb721fe8e1426"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_none_schema_test_none_schema.assert_exc_info_value_err": {"doc_hash": "b0b8f14bc2ac7857b167c9749ed3b92cac779b50040fdfd34f2bceba9ad9c440"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_unwrapping_test_nested_unwrapping.assert_exc_info_value_err": {"doc_hash": "0ad1ad6c0ef6c93c5abd7adcfa1e9abff88ea4c8091b6816bedb1eaa6d64ba7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_distinct_choices_test_invalid_discriminated_union_type.with_pytest_raises_.Model.pet.Field_discriminator_pet_": {"doc_hash": "7b47e65c07b3fc9b533f020c848f88c6ec26c81a0529d427152ba9855e5ba0af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_single_item_union_error_test_invalid_alias.with_pytest_raises_TypeEr.apply_discriminator_schem": {"doc_hash": "f2c80de67854fccf240cfa054aef54f819b18e02005e93b1238849918ce3d406"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_discriminator_type_test_missing_discriminator_field.with_pytest_raises_TypeEr.apply_discriminator_core_": {"doc_hash": "9784413b3d56cada2b77b04de5c526582d8cab883e748892955af46152ebe28f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_discriminator_value_test_invalid_discriminator_value.None_1.apply_discriminator_core_": {"doc_hash": "560ec48355d602fd157357247662a544d76e8dc2067217bf2a6b34822dffaded"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_wrap_function_schema_test_wrap_function_schema.assert_apply_discriminato": {"doc_hash": "e5d582aaa3ab5ca722022caa2ea54348a9275f56d3f979e1ec857e65044bfe78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_plain_function_schema_is_invalid_test_invalid_str_choice_discriminator_values.with_pytest_raises_.apply_discriminator_schem": {"doc_hash": "de8c2dced55fb6d527fa19855a2ba3aca2aeb708af4d5868c506bc3b451558db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_lax_or_strict_definitions_test_lax_or_strict_definitions.assert_discriminated_sche": {"doc_hash": "c1319722ca50761c6117b41388e285205803a25347877b8517b592b824c63144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_wrapped_nullable_union_": {"doc_hash": "c0747219b7b76c13423e80ef7fffcc125884a45b921d175b32415bf1479060a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_from___future___import_an_skip_docs_tests.None_3.except_ImportError_.return._ansi2html_not_installed_": {"doc_hash": "9f57b0ca2e0af814d2f014d0c5e9180a37e9b415c1a3d30c7d41dca96c740ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_GroupModuleGlobals_skip_reason.skip_docs_tests_": {"doc_hash": "9e8aed27825561193a08bfdc7db2d6cd997573d51815198f2b97de3d1d9d49f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_examples_test_docs_examples.try_.else_.group_globals_set_group_n": {"doc_hash": "0beebe896330739ca542a0e00ecca546b53abfa41417a666ee8623fce6898ecf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_devtools_example_": {"doc_hash": "50697c67c05565152bd769d6d4224abac4efc46fbcd0b1ac548436209e203461"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_importlib.util_from_pydantic_fields_impo": {"doc_hash": "1082c504a1106371b949b88b31b89cb8551c3edc10ffbce23b216effd9d53ca6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_str_bytes_test_str_bytes_none.assert_m_v_is_None": {"doc_hash": "d9c586a500a36762f890f6158320c06b090047194c64d2d0ff420ab95f77653d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_union_int_str_test_union_int_any.assert_m_v_is_None": {"doc_hash": "8e4d84a4a38d23a68ea91956d66fd3cf7b330d7e616ce1461b32d779ae34c4f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_list_test_typed_list.None_2": {"doc_hash": "612cd6defa0a52a951106e603d81dbb07bc4ca8b7368670a57a88652b98962cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_set_test_typed_set.assert_exc_info_value_err": {"doc_hash": "6463b2c372c206cf5dd8df9dbc124bb30193fe3d13cbbd13176387376935391f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_dict_test_none_list.assert_Model_model_json_s": {"doc_hash": "7bdd833e766f1f1be4f330103fa07a330a4896f68576500adc48b5582e7b98f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_dict_test_typed_dict.assert_Model_v_value_v_": {"doc_hash": "14be23adb317b9ab7a9c9ad5f4cdba1779420b970d646ae0c67eb5fbcb0fa079"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_dict_error_test_typed_dict_error.assert_exc_info_value_err": {"doc_hash": "f0fdcedc20353732cdb316c04e0ee517190a7accd4d004780d4818f6470bc09b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_key_error_test_tuple.assert_m_v_1_2_2_Tr": {"doc_hash": "2a2a206dd0d8c88c4e49370f48f305b4f343a5018827c013c0e51080917ba860"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_more_test_tuple_more.assert_m_model_dump_": {"doc_hash": "ab636f2a550e313c72a7e456e89015d2bf3449c59d99ac7b289b266a1a67cb80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_pep585_generic_types_test_pep585_generic_types.None_15": {"doc_hash": "1a8247c7f2191ddeda69b572d1349639fab3683e574e61a535196337070f8269"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_length_error_test_tuple_invalid.assert_exc_info_value_err": {"doc_hash": "b3ab0873b5d2e5b622a38296a186d610333a9426f370ee461ba5e1d10befc20b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_value_error_test_tuple_value_error.assert_exc_info_value_err": {"doc_hash": "dc123f8f8d74bee2699cc91bc1cca822a39326f1206a83731a0b55f83d2beed4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_list_test_recursive_list.assert_exc_info_value_err": {"doc_hash": "3ba7cac9a06baeae3634f671a83d8bbc0865517caad3f2937a936af5332a71c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_list_error_test_list_unions.assert_exc_info_value_err": {"doc_hash": "e26d72a56b38933eb6c9fb97f8ab2e7ef45f20b63b41586bee102700ab2a770e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_lists_test_any_dict.assert_Model_v_2_1_2_": {"doc_hash": "7a43f1dff6b117ada93401bdd4f703d66918e4861c9a18727b7f628fbc8510db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_success_values_include_test_success_values_include.None_3": {"doc_hash": "eb785ba3641762ab74e50989c983983f27d8212119890528fe227209b608bd1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_include_exclude_unset_test_include_exclude_unset.None_8": {"doc_hash": "1a8806969615230c268ed8a8533bb7d7953713363c022f4882f640a502bfe896"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_include_exclude_defaults_test_include_exclude_defaults.None_16": {"doc_hash": "c00ece7b993c593d719941a392c88fd385df518df5284a03cf796b14a36772f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_test_advanced_exclude.None_1": {"doc_hash": "466e31b92a95297c9114a74dd876fc009f09992aea3d5a5e04bd7945e723f0b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_by_alias_test_advanced_exclude_by_alias.None_1": {"doc_hash": "f63b473f5b4f8cac4e346057fb7a679ae993a024506a91cc25821c87bba17d28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_value_include_test_advanced_value_include.None_2": {"doc_hash": "b4b77277f0bc71194fce7a2837b606432a7b2a44e6c264881b3d1cfa6f57a153"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_value_exclude_include_test_advanced_value_exclude_include.None_2": {"doc_hash": "571badce925b1d5c6996fa96cbc33b6bb586a1589d29bd76926b14d1036943bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_nested_lists_test_advanced_exclude_nested_lists.assert_m_model_dump_exclu": {"doc_hash": "a3e8d64c57f527e6790387708e0822a30040d9d098e142b9287130db4cb4891c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_include_nested_lists_test_advanced_include_nested_lists.assert_m_model_dump_inclu": {"doc_hash": "12d9e4047773a563cadd93c6a0af7b09afa2f5952260e47dcbc05fbbcd26a054"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_ignore_extra_test_field_set_ignore_extra.assert_m2_model_dump_excl": {"doc_hash": "d77aeba687ebbb23f7caf7714445761f5604018c3457f466524379a74d91e585"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_allow_extra_test_field_set_allow_extra.assert_m2_model_dump_excl": {"doc_hash": "f4c647ef701b601b88b7750b66d8ed4f206cdb9a43a77cd84754feb6381fee1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_field_name_test_values_order.assert_list_m_a_": {"doc_hash": "781915fa00095d6f09deb631a891a6188b270c05a2fce80a0a73f797612e6a3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_inheritance_test_inheritance.assert_Bar3_model_dump_": {"doc_hash": "19bb83bff68a29e9603c30460e131425eda35a7d339f9b5040193470bcc131eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_inheritance_subclass_default_test_inheritance_subclass_default.None_1": {"doc_hash": "857cf9eebabac130d7f7ad77e03199fbb2cbfb9c18b758165b5d59e2cbf9ee81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_type_test_valid_string_types.assert_Model_v_value_v_": {"doc_hash": "69851bf628082aea42387326e9af0f28ca287f5b9d26f9e5d78b4aaf9965397b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_string_types_test_inheritance_config.assert_repr_m2_Child": {"doc_hash": "8b8e6f59162f6e10c190fe9a59ff00c2818cc07b655c183b1a1aa9fc60e92ab7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_partial_inheritance_config_test_partial_inheritance_config.None_1": {"doc_hash": "fef3753f06090d7a4151ffda087d5b53c444f3ce5a794dcaf88e1c48fe2f209b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_annotation_inheritance_test_annotation_inheritance.with_pytest_raises_.D.integer._G_": {"doc_hash": "fd78a49e8d2f8a58ecc7b68189797f748cb5c5b475ed8b734baf9c21ea488cb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_string_none_test_optional_required.assert_exc_info_value_err": {"doc_hash": "bc1522bab4fba69c4759a5a630e0774934c541358d4055681d583097586ba1a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_validator_test_invalid_validator.with_pytest_raises_errors.InvalidValidatorModel.x._": {"doc_hash": "f6b95573360f3f0f4c87d0898e48cc56b8bffe0fdf2d637193cbd0f45a3c11ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_unable_to_infer_test_unable_to_infer.with_pytest_raises_.InvalidDefinitionModel.x.None": {"doc_hash": "36ccf0c285cd9cc0d02251cfae505d987a705de9507b4e994562741ebb0ff57d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_errors_test_multiple_errors.assert_Model_a_None_a_is": {"doc_hash": "1baa5ec7d6437a43d9f55ca2e53378649ab54310ca07f7eca6c3be96f2e09886"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_validate_default_test_illegal_extra_value.with_pytest_raises_ValueE.Model.foo": {"doc_hash": "9b9ef873221fc345b05c630e3c03069dde0cc117d72ff7953fe0c2db0b9c9c21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_inheritance_config_test_multiple_inheritance_config.None_15": {"doc_hash": "7a986b50db61b822f7fe381624725c26c8aebb1725b5b145efa60ee0c4cc9d2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_submodel_different_type_test_submodel_different_type.None_1.Spam_c_Bar_b_123_": {"doc_hash": "716884be047233acf6c41b21ea62d6b0af06b715eca94bd42e9bb9696e00f1c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_self_test_self_recursive.assert_m_model_dump_": {"doc_hash": "0d69d5cbeadaa587fc9e981c6e11bf7628ec54fa9075ec5df37988da6fa6f22c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_nested_init_test_nested_init.assert_m_nest_modified_nu": {"doc_hash": "2f23f9ce730186d191f9eaa5ac957be65f113cf5e8ee6285f919c290e63fa1d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_init_inspection_test_type_on_annotation.assert_Model_model_fields": {"doc_hash": "0a35647beb6d9f7ef00013d606c27f545c2447431b2e1328aaedd2db086371e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_assign_type_test_assign_type.assert_exc_info_value_err": {"doc_hash": "8b7a99459b3ce18ef257dd13156f8f5b0ca22af7a6e361fd4f93b6c6bb6c3521"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_optional_subfields_test_optional_subfields.assert_Model_a_12_a_1": {"doc_hash": "0a2016490e1d6468a51a2a7f4b9eb7745c97b0f611cdcbfedd5b61ca47c6a864"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_validated_optional_subfields_test_validated_optional_subfields.assert_Model_a_12_a_1": {"doc_hash": "fee8fc8de2efc692e5f6a5dd5c9a1ba78b4ee618950f80c7315f2cfddc65d715"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_optional_field_constraints_test_optional_field_constraints.assert_exc_info_value_err": {"doc_hash": "55eaa7c7b2f548bb8a71d70146801299cf479825e946f3f8edc9800f84aec890"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_str_shape_DisplayGen.__get_validators__.yield_validator": {"doc_hash": "cab4fc7838e7081d38443879e18e3d580a5da3c920868d68eba126c9f3ad5d2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_type_display_test_field_type_display.assert_re_search_fr_ann": {"doc_hash": "fb880dc4ba46142deb0491e33952935cd0cae5b5d704e2b1fd2dc57a33d8b706"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_any_none_test_type_var_any.assert_MyModel_foo_123_f": {"doc_hash": "cf2e57562bdfd5521fa5ca024b5fcbd7af73c3d85357d5144f5c903902fb5dbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_var_constraint_test_type_var_constraint.assert_MyModel_foo_123_f": {"doc_hash": "dce45576d5971cf10fb7d13df13f28503336c53d5910db2516996dead5ac7d16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_var_bound_test_type_var_bound.assert_MyModel_foo_123_f": {"doc_hash": "b9b46976bf7c15f9d087dd3420b8cbbc0797b1caacb553935b7c24e5fd3428d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_bare_test_dict_any.assert_m_foo_x_a_": {"doc_hash": "15009e57cb2f5b11cd9f2832cd8b990e161c613dcc2099e70a5124ab7f1de6c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_modify_fields_test_exclude_none.assert_m_model_dump_json_": {"doc_hash": "7a7d73097d7712879b0dd07715bd913c74e9e6f73f49aae4a04770d9a248fcf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_exclude_none_recursive_test_exclude_none_recursive.None_5": {"doc_hash": "34cfc91e675e767abd724de0ac3978fb9416f93a7702510ae98ae592f61062ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_exclude_none_with_extra_test_exclude_none_with_extra.None_3": {"doc_hash": "0cffaaaca4c61244e749be609770391911fb2196b147c1d97f2352691d5f6e3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_str_method_inheritance_test_repr_method_inheritance.assert_repr_Bar_7_": {"doc_hash": "e2ea18f65aea5fc9103da108cb7f057e527de1a112b6d31f09fa2194c5b2e567"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_optional_validator_test_optional_validator.assert_val_calls_None": {"doc_hash": "a8d874187e02372c9e7b898fc16073389774c7c1889c58cb1d0d22f1c4c29a1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_required_optional_test_required_optional.None_5": {"doc_hash": "a382d19c23c426069948a243792b46ee0fad9b90b81e54a0df54d626113d49af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_required_any_test_required_any.assert_Model_optional1_o": {"doc_hash": "818bcbf1a3a28108da81b2262a71bdfa12253685bbf92dc41c14d8ac2ae6ed47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.return.core_schema_general_after": {"doc_hash": "1bdbd34c21805cfdb0e7b4569aa78e1b1907817ee2d2994f7bdc222e836c4cb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators.Model_test_custom_generic_validators.assert_m_gen2_t2_2": {"doc_hash": "f7ece881f535ac6b254063c4e70c71995d9e1f42902d0893e7d13b4471ceca17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_arbitrary_allowed_test_custom_generic_arbitrary_allowed.assert_m_gen_t2_is_True": {"doc_hash": "5283680e808fa7934281e86cfe00ce523e5f5eec749bac68870e61a3096684c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_disallowed_test_custom_generic_disallowed.with_pytest_raises_TypeEr.Model.gen": {"doc_hash": "e05100e5a2b36eaba7ff2f6159f5c9f7f840a442ee6acf69582b48e307f6b8a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_required_test_hashable_required.None_1": {"doc_hash": "5eb0097cb777e542d83513d97370996655052f134abfb952796e6fb0ccff1fe2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_optional_test_default_factory_called_once.assert_exc_info_value_err": {"doc_hash": "0a8508094989d6a6056d377fbcbeb54389e04cd8588898548d10d6db0a473847"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_default_factory_validator_child_test_default_factory_validator_child.assert_Child_foo_a_b": {"doc_hash": "a5450b2b5cae5e30a455c6f42133ea7e501b19c5d89f9212eab660bc587c2d51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_resolve_annotations_module_missing_test_iter_coverage.with_pytest_warns_.assert_list_MyModel__it": {"doc_hash": "ab9c90c30eaa4a14d746f3b8af77e654abeba59d0efd39fcb9d328a36db52ff0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_frozen_config_and_field_test_frozen_config_and_field.assert_b_model_dump_": {"doc_hash": "c8db22739e25082c664cb77835b3ec00192780627c518ddc9ef1ad729f21cf62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_arbitrary_types_allowed_custom_eq_test_bytes_subclass.assert_m_my_bytes___class": {"doc_hash": "e76d547eba6e556437e6f06ab8ec6555798210e5b1671af1c43bffdc099fd5fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_int_subclass_test_model_issubclass.assert_not_issubclass_Cus": {"doc_hash": "3052d042cc98a512d312f9e70b13ea0cd48e6204ef51f67d014dc26086dfeb43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_long_int_test_long_int.None_3.Model_x_1_10_7_": {"doc_hash": "21dd9a2834fcdc59d988d0c3a528fcef0bc545d6a54034807dcd21e2e69b3574"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_parent_field_with_default_": {"doc_hash": "97297c9b44e1db0559440df3e6e252f6630bd676cc53cc5cf4f74ca02ec6f834"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py____ErrorKey.pass": {"doc_hash": "4c229586251ca8267a7987a3de24dea661f819035d006430aab63a00c43bffa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_FastAPIGenerateJsonSchema_FastAPIGenerateJsonSchema._": {"doc_hash": "770170657b6ca2063da29f505866b2a36bd612ee43040dc91d10b5563a591459"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_FastAPIGenerateJsonSchema.handle_invalid_for_json_schema_FastAPIGenerateJsonSchema.handle_invalid_for_json_schema.if_CoreMetadataHandler_sc.else_.return.__ErrorKey_error_erro": {"doc_hash": "183898490e7ddb44cb8dc9f240dbdb786cb1c0d60c61fdfc69c68b3ca2341f36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_ErrorDetails_collect_errors.return.errors": {"doc_hash": "0c933cafe2d1eeef714d6a74275c454b0a6862eef1e1f8a267b344b95daa80d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_test_inheritance_detection_test_inheritance_detection.assert_": {"doc_hash": "d80f14819287a4a5394cc1176700218a93a8128de37c79602cb39313f2189aa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_test_collect_errors_": {"doc_hash": "a69e0a7769ecfd3eb131dba18100ac099f71f72193e98e10e21838f37f8cb4e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_dataclasses_test_postponed_annotations_auto_model_rebuild.assert_module_Model_model": {"doc_hash": "79227bda48dbf1c61ce481dcad9afbaf21d541a4261987ea0184a296cd80d609"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_auto_update_no_model_test_forward_ref_auto_update_no_model.assert_f_model_dump_": {"doc_hash": "eae7b4881e89fc6cd749498b3a49fb49818ed83c720859b221a54156045581cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_one_of_fields_not_defined_test_basic_forward_ref.assert_module_Bar_b_a_": {"doc_hash": "be059c551f2fdda35f4df9a150deaedc8fe476aeae49f9d71a6c412a31e73bad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_module_test_self_forward_ref_module.assert_module_Foo_b_a_": {"doc_hash": "77483b54d4cd5ecaef6cea8b85a6a9b9ff571e5bb515d4c534be1b1079d91d9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_collection_test_self_forward_ref_collection.None_6": {"doc_hash": "cbe5a026b3da90833aa092d91d66327bc2e04e47a7db2ed4c4119381d7e3384e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_local_test_self_forward_ref_local.assert_Foo_b_a_321_": {"doc_hash": "c86bc2447009f8d8d3b672b5679e59697c4cc0c342fb04e086a76e425067ec5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_dataclass_test_forward_ref_dataclass.assert_dataclasses_asdict": {"doc_hash": "2ecb1d4f251eedd0081cfea44d17b857247575c91d5e2151e49d39208db528ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_sub_types_test_forward_ref_sub_types.assert_isinstance_node_ri": {"doc_hash": "214d70e2f4fc0594a72ab60549cf54fef0c432ed2b47f8b69a82e75ef15c1551"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_nested_sub_types_test_forward_ref_nested_sub_types.assert_isinstance_node_ri": {"doc_hash": "16965d6cd34387d60422be37bdacb5ff102da53a69981ef584621b3f92e6f47c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_reference_json_schema_test_self_reference_json_schema.assert_Account_model_json": {"doc_hash": "e043d984d8d4d647bec9407d3ac99a81386c8e4817cce914a88c5a5a4e84dafa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_reference_json_schema_with_future_annotations_test_self_reference_json_schema_with_future_annotations.assert_Account_model_json": {"doc_hash": "28be27e00300f0a8166a7f2b2e23039950120d36d2f9fbe1156f861882b1b80f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_circular_reference_json_schema_test_circular_reference_json_schema.assert_Account_model_json": {"doc_hash": "01be5af5f66938de500814e2aa16092296cab48630162e60bfe4462e0152cbdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_circular_reference_json_schema_with_future_annotations_test_circular_reference_json_schema_with_future_annotations.assert_Account_model_json": {"doc_hash": "679b4907615ce7fd4ae57f3ae5ba5f8c752ca601307612fbc7215dee7bf2168a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_with_field_test_forward_ref_optional.assert_isinstance_Filter_": {"doc_hash": "a7a09513cdb15f694e3cf18b9f1139232a12e569bde4f685f21d4514b6b8527d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_with_create_model_test_forward_ref_with_create_model.module.assert_instance_sub_model": {"doc_hash": "5076df35b220c0a7d73ab0fe453e6c9407153afa6cb45b9dee5d8dc06de0fed7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_resolve_forward_ref_dataclass_test_nested_forward_ref.assert_obj_model_dump_": {"doc_hash": "04fc31f21d445302f29a706b2542f3e2012c11cca68581698590b79a01b1364f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_discriminated_union_forward_ref_test_discriminated_union_forward_ref.assert_module_Pet_model_j": {"doc_hash": "76445129e44082e2bf22cf55af9192a637d237227ecc393cf181d2696bd573c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_class_var_as_string_test_json_encoder_str.assert_m_model_dump_json_": {"doc_hash": "624db9d443016bb8d653d408eebf82df32bf9a0f29193b010e0a1d0842105b73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_json_encoder_forward_ref_test_json_encoder_forward_ref.assert_m_model_dump_json_": {"doc_hash": "f877752568b4c0e2e7fba7579490d664b99cf9f27f523376e5ebfb0a148ed53f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_skip_pep585_test_pep585_self_referencing_generics.assert_obj_names_Self": {"doc_hash": "76e23db07a218fd3fba23e31daa29badc776ba106ca3b3d3c360adb0f896b47b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_pep585_recursive_generics_test_pep585_recursive_generics.assert_h_model_dump_": {"doc_hash": "0ab68716dc1d82ef24a6c8b847f05a03238c09303d7fb04898a1893e09a8ab2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_class_var_forward_ref_test_recursive_model.assert_f_y___fields_set__": {"doc_hash": "c3a1f2cab59c225ad32b9b2ac39622a38228570f1ea0414a802d0357d51ea448"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_force_rebuild_test_rebuild_subclass_of_built_model.assert_FutureReferencingM": {"doc_hash": "03979ad7db3aa6723b0c592fbdc9f201d2313fe83ebb64f4cfbfd7661211a979"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_nested_annotation_test_nested_more_annotation.assert_bar_model___pydant": {"doc_hash": "5cc2197d97f3699c85d5aa6e2d65d52dbc5acdf9e8e1154df0ae138886191860"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_nested_annotation_priority_test_nested_annotation_priority.with_pytest_raises_Valida.bar_model_b_1_": {"doc_hash": "c65caffaf2254f33888a12fe5d565b0c8bac65013737c7b165bc8152732daa10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_nested_model_rebuild_test_nested_model_rebuild.assert_bar_model_b_a_": {"doc_hash": "58b5f1c7c6164819c288683b3fc762624e979ef65acdcdb12f58dad0214abe1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_pytest_raises_undefined_types_warning_pytest_raises_undefined_types_warning.return.pytest_raises_": {"doc_hash": "e666c18f5d3d167ba994b473aa500c3f694e1b38713aeef4eb7e6f21ca8a64ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py__NOTE_the_undefined__test_undefined_types_warning_1a_raised_by_default_2b_forward_ref.with_pytest_raises_undefi.module.Foobar.a": {"doc_hash": "0e99b0e2b3c68d1ce621915720d36914f9e88286e640b561e1b34259f8f5510b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations_test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations.assert_module_Foobar___py": {"doc_hash": "cec566906981c78c51d1b4e6c1c4d954797467495ccd5b7434fcb089797011ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref.assert_module_Foobar___py": {"doc_hash": "a16e72c7ab489b582adc52543cea807f4d14959273c4c04bd8ff5fd478fd8f11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_raised_by_usage_": {"doc_hash": "393e1d1d74472d01e9fe2f8906fb446d0b278fd6faef7808057389641ef75ed8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_gc_test_double_parameterize_error.assert_str_exc_info_value": {"doc_hash": "41673fc24be243da1b2aeec27ae6ae7b583e86a8544bfce659153c8aa6786ba6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_value_validation_test_value_validation.Response.validate_sum.return.values": {"doc_hash": "49e5f66379c0eceb2ef2031f7f47cf59a0e7b63d3d606c54c3082b1d9b73931d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_value_validation.assert_Response_Dict_int__test_value_validation.None_3": {"doc_hash": "dcf9c9c4b030a23606f62b689e19878c470b8485d5f115830ba063478fb80e0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_methods_are_inherited_test_subclass_can_be_genericized.Result_T_": {"doc_hash": "bcc7a153440654b6ca188074975ad186fe9fe983cf5372e05d45357a000162a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parameter_count_test_parameter_count.assert_error_message_ends": {"doc_hash": "90b0d9a84592b210939bda21de849942da660ec68f551d8e08cd80fe828ff1c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_cover_cache_test_cover_cache.del_models": {"doc_hash": "ba89dca3b3ecf38e4aba9846e49d46fc5b278dc3da48a03dbb0f4f2c7894afe5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_cache_keys_are_hashable_test_cache_keys_are_hashable.del_models": {"doc_hash": "f8c9c2446ed44eabddfedcf8b979605a8dad5d2fcea9a81de9ee4e2af73ac5b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_caches_get_cleaned_up_test_caches_get_cleaned_up.None_1": {"doc_hash": "6ea17d029bcf7b8d5016af1fb1f709780d7e2ed3b1bba4e9e1e571534c6fde87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_caches_get_cleaned_up_with_aliased_parametrized_bases_test_caches_get_cleaned_up_with_aliased_parametrized_bases.assert_len__GENERIC_TYPES": {"doc_hash": "423a48b30b39101033183f58b2ce739c26f71f501818ab9ee5c9a837cc1225db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generics_work_with_many_parametrized_base_models_test_generics_work_with_many_parametrized_base_models.del_generics": {"doc_hash": "9bced87397fba9b34e3e996b785f611878036be34255bb19c88f7921fcaf467b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_config_test_enum_generic.Model_MyEnum_enum_2_": {"doc_hash": "3d5f1922ea306c0a1bd64f2139e9e610f18cfe1173464ad3391f0654b30b2404"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_test_generic.Result.validate_positive_number.return.v": {"doc_hash": "ab436d6cd024ac4b025204b3c2733aee0e01e44630e9d9b47caaeec45812ac7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic.Error_test_generic.None_5": {"doc_hash": "4323fd6dd02c1d7a50bd369c434a044836b6c783910efb826abd7cf877ad771d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_alongside_concrete_generics_test_child_schema.assert_schema_": {"doc_hash": "75a04a134a436fa09b070b54a331be3fa25b86191efe8a29aa2fa6bc2459a3ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_custom_generic_naming_test_custom_generic_naming.assert_repr_MyModel_str_": {"doc_hash": "74213d737ee30b47183191be28ac715873af73c96ba59506530507d2b1215fe5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_nested_test_nested.None_7": {"doc_hash": "8009a9cbdc827cdc8a031cacea1e6b76d0f9c572a9857af2522178eaa9c3a0ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_test_partial_specification.assert_exc_info_value_err": {"doc_hash": "0837f499ee24533184b86ce1249fb0746392873f46235bdc381e1515ffb7e4d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_with_inner_typevar_test_partial_specification_name.assert_concrete_model___n": {"doc_hash": "d709c041466d6a822554f0636d5e3d96c618bba66a270a9d8bb90014cb3df980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_instantiation_test_partial_specification_instantiation.assert_exc_info_value_err": {"doc_hash": "1c97ca7b47c0cb671f5dde61e6d7b4e92a8a49aab0807e3273efa654d9c880a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_instantiation_bounded_test_partial_specification_instantiation_bounded.None_1": {"doc_hash": "86ab7dac13a5b15380708fd3dedd9b2a19d08ef2f0542da181d808b88d14cd01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_typevar_parametrization_test_typevar_parametrization.assert_exc_info_value_err": {"doc_hash": "52047b18b1ee18d8793989aaf76b3f059548cc6eebc463cb4a7eb115dc33dfdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_multiple_specification_test_multiple_specification.assert_exc_info_value_err": {"doc_hash": "dfe2df73c0bf327db2b69e8f1b1bf2b381850c8d891a9c0fc314623c826cfa9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_subclass_of_concrete_generic_test_generic_subclass_of_concrete_generic.ConcreteSub_data_2_extra": {"doc_hash": "6818bb97ef8bff4acd024a19f2e0d373f6026fbd20b0b0944cba99020670134f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_pickle_test_generic_model_pickle.module.assert_loaded_original": {"doc_hash": "caff14f35d2968527dd9aaa0b6feac2135e4e8a56733f0bf9ea0f6c3325f8fd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_from_function_pickle_fail_test_generic_model_from_function_pickle_fail.module.with_pytest_raises_pickle.pickle_dumps_original_": {"doc_hash": "d906d13ac056b94b2455a32d47d4bb5f83bbc9dfc436e3358e792f68a1215087"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_redefined_without_cache_fail_test_generic_model_redefined_without_cache_fail.module.None_5": {"doc_hash": "741504a439b30b060795a45f001cea62927ceb65934e54f0425336c501e4d223"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_caching_detect_order_of_union_args_basic_test_generic_model_caching_detect_order_of_union_args_basic.module.assert_type_float_or_int_": {"doc_hash": "0f88a37afeb5f5e56941cb3c9cb9f992690a38e9f61d079608344e6b66c587fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_caching_detect_order_of_union_args_nested_test_generic_model_caching_detect_order_of_union_args_nested.module.assert_type_float_or_int_": {"doc_hash": "22a0b0a55681fc0611e3d8b5b1422be8a73d5898fd0244cffe2f7bac9ffd7d2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_get_caller_frame_info_test_get_caller_frame_info_when_sys_getframe_undefined.try_.finally_just_to_make_.sys._getframe.getframe": {"doc_hash": "c663935bfd9848312c728525b42e01053ceba817c979607ab203b4b720929d3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_iter_contained_typevars_test_nested_identity_parameterization.assert_Model_T2_is_not_M": {"doc_hash": "05440ab67be091bf998b39644fab284a431eac001dc049aabb5737e805f7a161"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_test_replace_types.None_1.assert_replace_types_str_": {"doc_hash": "742162de287856f0b5c74c76568735a49ef13c6d524cf8d9de9678284c61a442"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field_test_replace_types_with_user_defined_generic_type_field.CustomTuple.pass": {"doc_hash": "4457abf560b16c0cecff7103212e57e0081247eca798d24d0244d8715e1e375d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.Model_test_replace_types_with_user_defined_generic_type_field.Model.tuple_field": {"doc_hash": "ffdaf0964beb43a495ad6501ebabe28451cf26bf5526213b08441ae991682d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.assert_replace_types_Mode_test_replace_types_with_user_defined_generic_type_field.assert_m_model_dump_": {"doc_hash": "89a130bd81d8e5d87ad4d03f4ec0b7800df85226c1851bfb101cf81e7e20926f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_identity_on_unchanged_test_deep_generic._i_e_inner_model_is_co": {"doc_hash": "50ce568b7a48356bf526417352f944c9446bf88462b8d3fa6711f4694def9cdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_inner_typevar_test_deep_generic_with_inner_typevar.assert_InnerModel_int_a_": {"doc_hash": "1a9c5cf5bf4eb12339ea0d63f91f530d6730fbbb16305acb76f6dedead7a3949"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_referenced_generic_test_deep_generic_with_referenced_generic.assert_InnerModel_int_a_": {"doc_hash": "4bbd6ad57482307dd33d67ed3c1dbf937feffbb148a844c87e6cfa9dad91d92d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_referenced_inner_generic_test_deep_generic_with_referenced_inner_generic.assert_InnerModel_int_mo": {"doc_hash": "24f1d6e0cf2c461f9471c2b5ca4d7f5aef35dbb815d58e8b533579bf416bfb09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_multiple_typevars_test_deep_generic_with_multiple_typevars.None_2": {"doc_hash": "512e09a6c6f503e885ccc856ca3700666b36a8398cf7e912c2e4618b7b910982"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_multiple_inheritance_test_deep_generic_with_multiple_inheritance.None_4": {"doc_hash": "599a024f86efed9905070a2795e85259f525beb5f83d6dccfeb4ced3581234e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_referenced_generic_type_1_test_generic_with_partial_callable.assert_not_Model_str_int": {"doc_hash": "51693e32fb18129bae3ac3cc2cbdf41111851ca15fb63244b47fda79b5aa315c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_test_generic_recursive_models.None_2": {"doc_hash": "528589e9a92d4bbcda92fcb8ba45894ad32e99b3953f26588093e86459353114"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_separate_parameters_test_generic_recursive_models_separate_parameters.assert_result_model_dump_": {"doc_hash": "234ed7c98a3ca43a9030eb6ebf8a59033e541367b75e4ad0f33a22b62522b0c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_repeated_separate_parameters_test_generic_recursive_models_repeated_separate_parameters.module.Model1_model_rebuild_": {"doc_hash": "fb691318d055d0ea0284efa6aad16b3a0e61e5593c0390cc4c310ac734aea365"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_repeated_separate_parameters.Model1_test_generic_recursive_models_repeated_separate_parameters.assert_result_model_dump_": {"doc_hash": "90921e7528c07ab241cee98914c44b357b193ce01e8558357ca5f742c70e7281"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_triple_test_generic_recursive_models_triple.module.A1_model_rebuild_": {"doc_hash": "81b549d41acba763111226d9990ce5b10087e35de56ce5a100b14f807ef74671"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_triple.A1_test_generic_recursive_models_triple.A1_int_model_validate_": {"doc_hash": "16591f8e405f50810b071ace4d9b3b7235d0fedffc2f5839cd09dd405294f36b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_with_a_concrete_parameter_test_generic_recursive_models_with_a_concrete_parameter.assert_collect_invalid_sc": {"doc_hash": "5b2bb1679cac8e8b0aab3e4f65d7ceeaa07533dc24ea007c4b33f64352b9c065"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_complicated_test_generic_recursive_models_complicated.assert_collect_invalid_sc": {"doc_hash": "03287b4df776143ed194eae77d35cdc32ded7dd3ae1d17385f48b7d9a187eb0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_in_container_test_generic_recursive_models_in_container.assert_type_instance_foob": {"doc_hash": "7f2bb78c224d2c52f8c622e9906681af59722dbcd67de469c3846123baeaae01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_schema_is_valid_test_generic_literal.assert_m_model_dump_": {"doc_hash": "ac06225e24495428fdf6839eaff10aeffd7a871279a6c521ba71ed6f06d090ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_enums_test_generic_enums.assert_set_Model_model_js": {"doc_hash": "88830981f005c6c1ad9eef88ec57eb07dc7df40f57a9c5078b2ec00bdf0b71f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_user_defined_generic_field_test_multi_inheritance_generic_binding.assert_not_issubclass_B_f": {"doc_hash": "e6cdb8a0529c424ef39625eee3b06ad6c48f73aaf7039a5a691319f0dc512d20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parent_field_parametrization_test_parent_field_parametrization.assert_exc_info_value_err": {"doc_hash": "fa0b57001fd0ae3ec83d55c0eaeee161eac1a36245bcc299af096b4076ddfa55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_multi_inheritance_generic_defaults_test_multi_inheritance_generic_defaults.assert_C_a_1_c_mode": {"doc_hash": "2211603ba9c22b741b6756b4978ca78f66fb2796651863620de148014daa8fbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parse_generic_json_memray_limit_memory.if_memray_in_sys_argv.else_.return.pytest_mark_skip_reason_": {"doc_hash": "5cab36bb235e64281fa684a526d88581a7b16cee39cb9b35b0718365fb315818"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generics_memory_use_test_generics_memory_use.for_t1_t2_t3_in_total_._.pass": {"doc_hash": "f95a4dea2d0e1fcf8b4def93406caf8e7dee5d0c2bcc35da9a97bfed3502a164"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_as_parameter_to_generic_type_alias_ensure_contextvar_gets_reset.assert_not_recursively_de": {"doc_hash": "e9d57577b713dea10a6ae00520083f68ed35a465c2b059dab5da38d016496fa5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursion_contextvar_test_generic_recursion_contextvar.None_1": {"doc_hash": "19102a593764fafd8f0c88f600d1839fae1eda0a8f4f513266090ccca54203be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_limited_dict_test_limited_dict.None_10": {"doc_hash": "e55483d7023781ef4e6e8f4eeb46e67bdaeb391957411f4b2c8995613d314136"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_construct_generic_model_with_validation_test_construct_generic_model_with_validation.assert_exc_info_value_err": {"doc_hash": "9d107d68d02b191caaae1f32d7e160d7ba7cd79e98d5c75f848e6ed01447da89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_construct_other_generic_model_with_validation_": {"doc_hash": "5da1b9f29c4e76afda7563334f2aaec94bda8e80a09df070cdc833b764dcb365"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_typing_gen_models.JsonModel.json_pydantic_model": {"doc_hash": "00b95f8fc5c38da375ae7f29077827bb73d9ccc83292b0001ecd2a93bb6c178d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_gen_models.ConstrainedNumbersModel_gen_models.ConstrainedNumbersModel.condecimaleplc": {"doc_hash": "8d495d2d43143eab9410ab7bdb7814d5f41b5dd8c355efa8884cbdc687b03fb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_gen_models.ConstrainedDateModel_gen_models.try_.else_.yield_EmailsModel": {"doc_hash": "7148ca34f3c7aacb59f29b7ae7b0bcc89d3787d5826cbbfbf2f46669f8fbacd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_test_can_construct_models_with_all_fields_": {"doc_hash": "6e72e495b842c000d23ef9f88d1a7993ee1b861184320ab0ba30bbda99380cca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_json_MyModel.c._d_": {"doc_hash": "9fdfd71b9de24566944998cfa05722fb4fa80cf627f492915b15454c3fd3f1fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_serialization_test_json_serialization.assert_serializer_to_json": {"doc_hash": "f23c68fdcd7297b7f4dd8040fe061fa0ba3eab354c763514b96143fa353bd82f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_serialization_email_test_path_encoding.assert_json_dumps_model_": {"doc_hash": "3992c19808c37f76327532fd355928a17c02c6fb5a48d8af313316abc41bea1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_model_encoding_test_model_encoding.None_2": {"doc_hash": "a94a3e584382d7ffc7dc049addb531c23cbcc81ad1bb5803a9fa526e51b99529"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_subclass_encoding_test_subclass_encoding.assert_m_model_dump_json_": {"doc_hash": "27b4a96f33a43476fbc2380cb17c011e72c12bd0dfa1e90640dfc119685f3bca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_subclass_custom_encoding_test_subclass_custom_encoding.assert_m_model_dump_json_": {"doc_hash": "e19c82f798774af6f7233236154d5816145eddc142ab0469476384bb2e36ac14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_invalid_model_test_iso_timedelta.assert_output_timedelt": {"doc_hash": "53a6186fb584a6fe6282fc44ad70157da29a883ce8f20f72052b0220f39c3041"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_encoder_test_custom_encoder.assert_Model_x_123_y_5_": {"doc_hash": "acac2f8fb8f37a87c4cbb1180def60567cea3aa20642dc615fdfda4f470d8885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_iso_timedelta_simple_test_con_decimal_encode.assert_Obj_model_validate": {"doc_hash": "cafd665e383d2c76541f2caece681918740227d758110d28c378c8dcb3859e1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoder_simple_inheritance_test_json_encoder_simple_inheritance.assert_Child_model_dump": {"doc_hash": "ded8009240b42683049661f568820fe9d20e22aa54c14636fea2297d33172737"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoder_inheritance_override_test_encode_pydantic_dataclass.assert_json_dumps_f_defa": {"doc_hash": "0029e60eb5e897497d45a290ee8a99a99ac1ed5b56f927ec8b95e8fcaa291fd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_nested_encode_models_test_json_nested_encode_models.User.serialize_user.return.v_SSN": {"doc_hash": "a24b0a8ff05439d7100a3df91d144fa52761152da01b4e9f9441f6dc91377838"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_nested_encode_models.User_model_rebuild__test_json_nested_encode_models.None_2": {"doc_hash": "e5b005cd15c7402a9eb056494987af1570c7569db62e658ae23577c74491560f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_encode_fallback_basemodel_": {"doc_hash": "230f93ebe5a7dd88143d7ff4b64a1a32953429012af2120db6f22327306b6cd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_json_T.TypeVar_T_": {"doc_hash": "628318992878d68a2931cf29b3ca3ab2e0fdfdaeb133b5971a62c6729acacb75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_by_alias_test_by_alias.None_2": {"doc_hash": "48514ef6122d8e39f312335ae980be2730d7cec89393284731fe127d6dc993d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ref_template_test_ref_template.assert_defs_KeyLimePi": {"doc_hash": "ff48a81036f07575676e521cda1ec4c733c128541436873e44bd7a82d7f7fdc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_by_alias_generator_test_by_alias_generator.None_1": {"doc_hash": "5df378989b0f855c238b77eeb4ea5039c36002adc8cbb6388fe1af9d51a9eada"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_sub_model_test_sub_model.assert_Bar_model_json_sch": {"doc_hash": "2acfab7da399c4342be9e4ca6d75aaf161f48219e83c148ffce55eb4ab8704f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_class_test_schema_class.assert_Model_model_json_s": {"doc_hash": "4e3383a1cd1214120c582dfe80cfb0992028894a7ef775a2ee459955f1600b69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_repr_test_schema_class_by_alias.None_1": {"doc_hash": "9f2bc996b49c9c072edff83b572280fc318d51fd6e59ca213e73fcc7581c2d67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_choices_test_choices.assert_Model_model_json_s": {"doc_hash": "4b35f7048f7c23e92d94b1b44cf663d63c78550ef5e9ae2a2ac4176e2b31c5c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_modify_schema_test_enum_modify_schema.assert_Model_model_json_s": {"doc_hash": "b939c7d5efee75df5f34898f31baa230e0c8956057890fdb7c5e6851aab7504f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_schema_custom_field_test_enum_schema_custom_field.assert_Model_model_json_s": {"doc_hash": "63ba2dd09be878b52c8af852bada7a7752040fa9b16181b6bd6779f438552ce2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_and_model_have_same_behaviour_test_enum_and_model_have_same_behaviour.assert_Foo_model_json_sch": {"doc_hash": "f8d294cfb889fe9cde7fb9a535d9409947c6a9fde8f3247938afb7bf7c02a019"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_includes_extra_without_other_params_test_enum_includes_extra_without_other_params.assert_Foo_model_json_sch": {"doc_hash": "18efdeaa6eb65d08e7aa3ab845cb21b790038824b3a4b6b307c4da79e2ed8ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_enum_schema_extras_test_list_enum_schema_extras.assert_Model_model_json_s": {"doc_hash": "0ebb11d0065275aadf8c7d4f09197b5d76c89f41de71059c6610d36f55c2a9f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_schema_cleandoc_test_enum_schema_cleandoc.assert_Model_model_json_s": {"doc_hash": "1e0fac4df5cf40bf60ace0b639a39243d4f0bdfc1dd885ec6f3c3b748d81c45b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_test_json_schema.assert_json_loads_schema_": {"doc_hash": "e0bbf9b44a33ab25d13919f87c84e834a3da651ebbe7b43db0269ca8c57d82a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_sub_model_test_list_sub_model.assert_Bar_model_json_sch": {"doc_hash": "ea175e1116b6710691bf5daa0c404093edb38c158e2304321bd4818b68f71c1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_test_any.assert_Model_model_json_s": {"doc_hash": "18720027bc6164eae34858c8aac5b2d302c5467d0d637a9fb87cbad97f714018"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_set_test_set.assert_Model_model_json_s": {"doc_hash": "57f97e28eda97ee7b173b3d7537a5fb87a2e98170aafcfe8fe55d37f79a98ce5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_tuple_test_tuple.assert_Model_model_json_s": {"doc_hash": "6aa146b231753682e8c140c45622090cb2047f8faa9626cba226ff86e38c2fb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deque_Foo.a": {"doc_hash": "b929264aeb5b2fc9398ff90dc94648feae7585bcbdef741e7b622d53e9cb3746"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_union_dict_test_list_union_dict.assert_Model_model_json_s": {"doc_hash": "22b0b72b4dd60c595bc77282e53e926d89f412de48fd73cbf4e2cdca499f3f19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_date_types_test_date_types.assert_Model_model_json_s": {"doc_hash": "08406b4f61250a9ad20d2288f9ad775790806ceec5c25c63d68e4a229e3c5e6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_date_constrained_types_test_date_constrained_types.assert_Model_model_json_s": {"doc_hash": "6521997d0e5c228772d4845a2e588349a72d65a4206b6ae0ec22cf710bfa7395"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_str_basic_types_test_str_basic_types.assert_Model_model_json_s": {"doc_hash": "15551bf6fa53f7f22bbe419c50067536546a7aab42c2d3e52ab1b172a0d2ea7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_pattern_test_pattern.assert_Model_model_json_s": {"doc_hash": "8827842d13c0da1a31282bfb81eaf8c1af05ea5a6e5de72be98330844a2e6765"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_str_constrained_types_test_str_constrained_types.assert_model_schema_ba": {"doc_hash": "380d3cfdece3f4dd4abdf49af6dd9cd31218975dea9511ae005833ad4b54398c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_str_types_test_special_str_types.assert_Model_model_json_s": {"doc_hash": "ee596dd6e1fbafdb6e9d087df9139ffc5b8140430541f324cb28ea3770357f84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_email_str_types_test_email_str_types.assert_Model_model_json_s": {"doc_hash": "dfeb3a50e9ae444d1dd9443e0949ec1210fd921df25d8b0ed64d9262d458da25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_secret_types_test_secret_types.assert_Model_model_json_s": {"doc_hash": "56e42b51e9da021f85cc837b65c76ef1433e98d5d7a33e99c63930574110a138"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_int_types_test_special_int_types.assert_Model_model_json_s": {"doc_hash": "e84865a60199e68b68dcd0474d4b9e3fbd4dfc8b2d6bec59cbc61dc1182fe5c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_float_types_test_special_float_types.assert_Model_model_json_s": {"doc_hash": "3cae73ee87c3468eeece0f7131b9a3c34a76a895922dd94e627fc3beaaa68628"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_uuid_types_test_uuid_types.assert_Model_model_json_s": {"doc_hash": "194530ee0d9d84e1c24e242ed9ddd7dac3465e44989565076aaf19879de1d3e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_path_types_test_path_types.assert_Model_model_json_s": {"doc_hash": "8c14ddf2a6fea4cbae7cc4e36bce9b18d4333958c40ff2423e6ecd9ef095cbc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_type_test_json_type.assert_Model_model_json_s": {"doc_hash": "d9847619a3be6c7bcdf5d2dfb80e11cf40e700e3b133c27da3bf2d017b0c4341"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ipv4address_type_test_ipv6network_type.assert_model_schema_": {"doc_hash": "c0cbbefaf1669e80e7bc62894b5ea169a12b6e6c0d79cca08fa1162a4ae9415f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ipvanynetwork_type_test_callable_type.with_pytest_raises_Pydant.assert_callback_not_in_": {"doc_hash": "75d488fc62e697e59b0b0d6afc89270187bdd87625b83c223366555ff895b235"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_type_with_fallback_test_callable_type_with_fallback.assert_model_schema_prop": {"doc_hash": "5aae279b4b16a70ed221425144e0708356b9da7c5f96aa594f91a1999c1ebf26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_non_serializable_default_test_non_serializable_default.assert_model_schema_get_": {"doc_hash": "648685bab27eab402310ddd80890d0a513340c102fed0e0257c62b1b05c34aea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_fallback_with_non_serializable_default_test_error_non_supported_types.with_pytest_raises_Pydant.Model_model_json_schema_": {"doc_hash": "dc17b8b3a87798d17ef23a18d96099dd52a3be359c7876f875ba935ab018a343"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_overrides_test_schema_overrides.assert_model_schema_": {"doc_hash": "21419635bd1e905830d37c53daeabf5fce5db1d9e087f511d5005f09f047a6c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_overrides_w_union_test_schema_overrides_w_union.assert_Spam_model_json_sc": {"doc_hash": "b862ae402487aad31b147bd181c6199adba20c6633bc1c45eb814a11d6c8e785"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_from_models_test_schema_from_models.assert_model_schema_": {"doc_hash": "0f53297337999e25a31740c06d47ee44c8cd9f62cbd50da7a3e4e28342d14587"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_refs_test_schema_with_refs.assert_model_schema_": {"doc_hash": "65b8368b390e7bb93bd4f4b633e664440489b7ce5d6709b25751dc0a2679270e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_custom_ref_template_test_schema_with_custom_ref_template.assert_model_schema_": {"doc_hash": "3c61404187f6a035221dd3ddda307893e55c0c4cbbb0c0eb90a12ccada290b70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_ref_template_key_error_test_enum_int_default.assert_UserModel_model_js": {"doc_hash": "70e3c8b6b143545c05c1b6170ef8ace642912441083fe271d7548a365042fa5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dict_default_test_dict_default.assert_UserModel_model_js": {"doc_hash": "38443755b85c2780ac30e59e389a17146384d5ce521a88ef6f325cc02995c56b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_default_test_model_default.assert_Outer_model_json_s": {"doc_hash": "b1c6e34e5d8a95011c70a08f50d1cf4f7cf8bd132f010343ae376397e9696fea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_test_constraints_schema.assert_Foo_model_json_sch": {"doc_hash": "3e8abcbd7100b69e3f4403d51457a8831bce349877ed9f93fc8b6c9dd84b10df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_test_constraints_schema_validation.assert_Foo_a_value_": {"doc_hash": "15879528bc0815f383d1db5ddf8842683e5cedabb282b79105906002615e4387"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_raises_test_constraints_schema_validation_raises.with_pytest_raises_Valida.Foo_a_value_": {"doc_hash": "341c018933ca0d66a16148e1b400b2cbbd26d2867e11c26e0a760030be054948"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_kwargs_test_schema_dict_constr.assert_Foo_model_json_sch": {"doc_hash": "90e82329facd32581c2cf133b234c8cacfebf3fe41ff4b4fd24ca913eb8e307c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_bytes_constrained_types_test_bytes_constrained_types.assert_Model_model_json_s": {"doc_hash": "bc1d2af325fe95ee5f670b4596d78debcdd056ead9c8d36e35f76fcc20f56ab8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_dict_test_optional_dict.assert_Model_something_": {"doc_hash": "63c6a3b0ed9f7eb5ee84425c624006361ff63511a48e96f060f58820ac3cbc7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_validator_test_field_with_validator.assert_Model_model_json_s": {"doc_hash": "b95a4b7a6d5b080e0c90cfac4d2c6d11a743062d90fc5e2b049e947546b21386"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_unparameterized_schema_generation_test_unparameterized_schema_generation.assert_foo_dict_schema_": {"doc_hash": "4f2d938ae0c9698b1359ba55382de76823790d0323574c4ae480569535806d35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_known_model_optimization_test_known_model_optimization.assert_Model_model_json_s": {"doc_hash": "a10c21e1274c5a837bcb6abb5e450fe35f038ac1bb987e1089d03164245e17ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_new_type_schema_test_new_type_schema.assert_Model_model_json_s": {"doc_hash": "953e017f67fbba4f4c6a4568552cf5a0f523d858f261b5283387597c995af9a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_literal_schema_test_literal_schema.assert_Model_model_json_s": {"doc_hash": "6581f2c942921eb00ac949ddad96f09b4eef1af50091d767ec584f1e3c429b2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_literal_enum_test_literal_enum.assert_Model_model_json_s": {"doc_hash": "cb800c6134a50a739a7f692e740f34d7c1cde2c3c00fcb43d5f36d7153fa7139"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_color_type_test_model_with_extra_forbidden.assert_Model_model_json_s": {"doc_hash": "56e6b68139a779d62567ca5e8ceb4d9ad0b888775f4080e3ad2d83a03a09a6bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enforced_constraints_test_enforced_constraints.assert_schema_properties": {"doc_hash": "7f45de36a1929477405172e335c24407c883c0a3c1efd8905c0a0c7bee35b594"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_real_constraints_test_real_constraints.assert_Model1_model_json_": {"doc_hash": "404540203aeaefcce616f323ebeacb9f6a1818992dee6266c6d7d584ab1becd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_subfield_field_info_test_subfield_field_info.assert_MyModel_model_json": {"doc_hash": "57f0e2f4f6740abeeec5f045f556caacbdcb000a72d0cfbe0ce7a638f3bda5c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_test_dataclass.assert_model_json_schema_": {"doc_hash": "d3b2ef864c34e254003fab6fa51d9bd9fc8c977d6f6b5e1b29e8c06e3a3e808c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_attributes_test_schema_attributes.assert_Example_model_json": {"doc_hash": "aff56cfb62fa7a740fd975c8bba71ef3b43c65eafe94994ff937b64e5938bc30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_path_modify_schema_test_path_modify_schema.assert_Model_model_json_s": {"doc_hash": "ed0aa1ad16be8e5fd0b76322272a4c299158856779a447edbd9dc0ec876ad0d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_frozen_set_test_frozen_set.assert_Model_model_json_s": {"doc_hash": "3cd69d93f3c8b40d1c34e44dfe90f22d02e14d0a788f16330056a8de2a4d221f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_iterable_test_new_type.assert_Model_model_json_s": {"doc_hash": "f632e4d409bd0db259cfc412569505ab9b31bdd7ad7b6588c9a228cd3b55a3c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_multiple_models_with_same_name_test_multiple_models_with_same_name.assert_model_names_exp": {"doc_hash": "1e678a3d14821c4b8cde4ee7afabf7bf958f789a74a3e2fad937bb640a410107"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_multiple_enums_with_same_name_test_multiple_enums_with_same_name.assert_set_Model_model_js": {"doc_hash": "68f8bb393e0efd3c982ac7f0633e7e459cb97522cac303a1bd82739e8a17340d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_for_generic_field_test_schema_for_generic_field.GenModel.__get_pydantic_core_schema__.return.core_schema_general_plain": {"doc_hash": "e2d3fc1f10965346d2d5f6fa496475de4b0d6e67924990043acb0e035fe938a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_for_generic_field.Model_test_schema_for_generic_field.assert_ModelModified_mode": {"doc_hash": "a3ceb3d4c40bce6b9506ebd5e67984ca911e96f120265f7857f64d51a8a08899"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_namedtuple_default_test_namedtuple_default.assert_LocationBase_model": {"doc_hash": "3910ff87ac89836ca79c6efbb188deeac10a9eb65da987062f6327bd8e0de522"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema_test_advanced_generic_schema.Gen.__pydantic_modify_json_schema__.return.field_schema": {"doc_hash": "19249e11bb75dfb9f4bac316d2661465e06273e8af51fe61fc9813e644957991"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.GenTwoParams_test_advanced_generic_schema.GenTwoParams.__pydantic_modify_json_schema__.return.field_schema": {"doc_hash": "e65c5edf0f81ceadfa33dea1200f8c8ebce13b91f0b216c8361ec660ce499625"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.CustomType_test_advanced_generic_schema.Model.model_config._arbitrary_types_allowed": {"doc_hash": "599019d734c363f3627da2ee712c88dddc26a80d2c5e3bcee07e623e174f6d59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.assert_Model_model_json_s_test_advanced_generic_schema.assert_Model_model_json_s": {"doc_hash": "d352ec1827fccafc876ffb5cc724b39d8fe13d6a1f5b2ab1c6f0a8b2c908a2cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_generic_test_nested_generic.assert_Model_model_json_s": {"doc_hash": "eae9e87e77a4b709df7043db1cdf8db8a52af4f4880d327ee644fff4114b2e4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_generic_model_test_nested_generic_model.assert_Model_model_json_s": {"doc_hash": "560246333e460aaf89aafad8f1c9ca565a20ac1200127099f4fa844dd1f92366"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_complex_nested_generic_test_complex_nested_generic.assert_Model_model_json_s": {"doc_hash": "46e9121448610c17292ef6f3ca89295051bd7bd1d7736c7451e6c85ae50b52bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_field_parameter_test_schema_with_field_parameter.assert_MyModel_model_json": {"doc_hash": "5b4371eece7ba54ae9f4fb677bcc6cc95677a0917f0ac9247ae6278a63b95c93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_modify_schema_dict_keys_test_modify_schema_dict_keys.assert_MyModel_model_json": {"doc_hash": "75542355cfef0729c5183357d34b5215a254ef3dba727a64082377dfc18a8117"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_union_test_discriminated_union.assert_Model_model_json_s": {"doc_hash": "f7bbf0c196fe10f47ceb004ff45980ad545185dd0b63d89a62094b33ef039d35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_test_discriminated_annotated_union.assert_Model_model_json_s": {"doc_hash": "c0c2b45f208e670c1fa526afb3547136183f2867a19fc8f6a6c823d4e66f947c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_discriminated_union_test_nested_discriminated_union.assert_Cat_model_json_sch": {"doc_hash": "d28a045d712f56359ad1538fcd16b3a99cb4a42b87e4c290c5babe1984039197"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deeper_nested_discriminated_annotated_union_test_deeper_nested_discriminated_annotated_union.Model.number": {"doc_hash": "bd628b189e9a2a48532c022dc594f2703aab0659263feba9ebdda743abb09574"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deeper_nested_discriminated_annotated_union.assert_Model_model_json_s_test_deeper_nested_discriminated_annotated_union.assert_Model_model_json_s": {"doc_hash": "e396202d7417797758dda8301336a290cf607cb7ea0b737471fa3a750c31060e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_literal_enum_test_discriminated_annotated_union_literal_enum.Model.number": {"doc_hash": "07561da16e01aa922603c40ec40c60b3381990f99e705bfb81f56d7979c32579"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_literal_enum.assert_Model_model_json_s_test_discriminated_annotated_union_literal_enum.assert_Model_model_json_s": {"doc_hash": "fdd47529af2f8be4ff8825bfb9e03ee3351416a6dfe2d54d5c38d9ceb2f0deef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_alias_same_test_alias_same.assert_Model_model_json_s": {"doc_hash": "c1bed99175a9fe745065534890ed1eb91e9f8ae50e4690edfd90882428667099"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_python_dataclasses_test_nested_python_dataclasses.assert_model_json_schema_": {"doc_hash": "7bcdafe61f56bcc27c5c0b458b42a1912d89caf9a7c7a9c3bfb1cc5f16bffb03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_union_in_list_test_discriminated_union_in_list.assert_Model_model_json_s": {"doc_hash": "b23ffe20b55371cf3b7c7cdeba08c39adca8ed409a0253ef4ad5d1f8780b7b3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_with_type_attributes_test_secrets_schema.assert_Foobar_model_json_": {"doc_hash": "1fd183cce1a22bc0e6e74503e610643741543f717b343a33bdfd24e80ed584aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_override_generate_json_schema_": {"doc_hash": "9a0fb0de09fda3d0b7ee52aaad3dade94ebc2073e928c167af3ca872399dcc2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_json_ultra_simple_model_fixture.return.UltraSimpleModel": {"doc_hash": "5f7b67ad6c805ac968ea5935115242ee82f85c055918eea323b9f38ddc6d4775"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_missing_test_ultra_simple_missing.assert_str_exc_info_value": {"doc_hash": "b5cf4049d23629e49874f2a178d8bedf44e0cb1fcd716c6f71c6da243f29521c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_failed_test_ultra_simple_failed.assert_exc_info_value_err": {"doc_hash": "68e92ff1d3aebd75f3c5f6324cc7cb8bb63e3038f6a81cd6887624599673bd7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_repr_test_ultra_simple_repr.None_7": {"doc_hash": "413018e345c32201f0b8ad6cc892aaa6f43d2e25640c615e8930470050ab9fba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_field_test_nullable_strings_success.assert_m_required_bytes_n": {"doc_hash": "a75787dbc2656f3e94ae44ec79dc89b0a5d194dd511bc75a1d3f6761359a22d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_nullable_strings_fails_test_nullable_strings_fails.assert_exc_info_value_err": {"doc_hash": "2124b945eab628714b65d1ddb98aefc7f737af9c910762dc4defd7f51ea9d0e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_parent_sub_model_fixture_test_forbidden_extra_success.assert_m_foo_whatever": {"doc_hash": "75594cc69575f46ad47fe698b799913a2be86c61f6b08d24f885c7fcff287468"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_forbidden_extra_fails_test_forbidden_extra_fails.assert_exc_info_value_err": {"doc_hash": "3cd4e6df024a79b2f84814503acee55a6a729960c9e73723751b5f4d2b75fa6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_assign_extra_no_validate_test_field_order.assert_list_Model_model_f": {"doc_hash": "f51b3672ef41309cab23bb690e8f384947420ac4992a1879bbfe517961a92eb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_required_test_required.assert_exc_info_value_err": {"doc_hash": "d0e3afb591dc37b7a4dfa6b6036ae67336e6924ed49ddaf6bee137cc961d04db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mutability_test_frozen_with_unhashable_fields_are_not_hashable.assert_unhashable_type_": {"doc_hash": "ab4b35f6b02e975b3498a9abc2fe4ce558e50564ca05845d940d3dd76d35db93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_hash_function_give_different_result_for_different_object_test_hash_function_give_different_result_for_different_object.assert_hash_m_hash_m4": {"doc_hash": "d3867cd1ebc9dfba542bcf16a09b6073546a231c2b97d6f1bba05f37863561a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_validate_assignment_fixture_test_validating_assignment_pass.None_3": {"doc_hash": "1200ea46dc71f41a79058336ef586d3d43669496e3d67aecd11159fb24a614f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validating_assignment_fail_test_enum_values.assert_isinstance_m_foo_": {"doc_hash": "cf8ceebc963ec1077eb967d957fbe94712f757db8039d5e815ce01d5a04fdd4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_literal_enum_values_test_literal_enum_values.assert_exc_info_value_err": {"doc_hash": "dd2e2d12883c5f27448d990bbaa7842ee4b5849a288dee0771fd6a39bc2e9c0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_enum_raw_OtherClass.pass": {"doc_hash": "898afaf5f04600120c1257ada37901b97ea4f53327b28c6631ddc43f6858604c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_arbitrary_type_allowed_validation_fails_test_arbitrary_type_allowed_validation_fails.assert_exc_info_value_err": {"doc_hash": "aaa7f0fd8fe3c74698f5f9d01795688dd39417cb2064c6c9a2435457d067360b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_arbitrary_types_not_allowed_test_type_type_subclass_validation_success.assert_m_t_arbitrary_t": {"doc_hash": "214aeeaa1beb1293521562d0f4b8878a530fc130be28e77abed57dbe8d180150"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_type_type_validation_fails_test_bare_type_type_validation_success.assert_m_t_arbitrary_t": {"doc_hash": "e8ad83d357b290936e2bbb789fda2cf2ad9575fb33d61320b7ca9fb5ce101760"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_bare_type_type_validation_fails_test_bare_type_type_validation_fails.assert_exc_info_value_err": {"doc_hash": "3e003344b35def945ad8bafabf6f292229b919d3c9167aec6daf12cb3354acb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_annotation_field_name_shadows_attribute_test_exclude_unset_dict.None_1": {"doc_hash": "316db6c80448d0b463ac222eac3b0c46a9c9e85985b4baea9b8db7a6efe6535a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_exclude_unset_recursive_test_exclude_unset_recursive.assert_dict_m_c_5": {"doc_hash": "e82275283c0a6c41f9fc893678787f839f0188aca866e2468f846b4e27ce45ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_dict_exclude_unset_populated_by_alias_test_dict_exclude_unset_populated_by_alias_with_extra.None_1": {"doc_hash": "853a5ac6dca1ab1d0f7399976f21bd6098ca6007170689579ae1316fddd941e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_exclude_defaults_test_exclude_defaults.None_2": {"doc_hash": "68b2bf5d8095a361a941917d01479e61a580a9df9d4449b0862eabe2b3e90d72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_dir_fields_test_dict_with_extra_keys.assert_m_model_dump_by_al": {"doc_hash": "76de562bc9bc820e69dba2f400923f733ec04735de4fad8645199840974c543d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ignored_types_test_ignored_types.assert_Model_class_name": {"doc_hash": "c9135f675db1fbb3327190aee00e96dffc86b9caaec1898ae3ed9b1bcfe57f9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_iteration_test_model_iteration.assert_dict_m_c_3": {"doc_hash": "9968918b2e6a334d9a12d8f26be0322b15feff55a208cc5c9a2736032ec2b85a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_nested_list_test_model_export_nested_list.if_raises_match_is_not_No.else_.assert_exclude_origina": {"doc_hash": "2d938d1a479fc541c286ab6a5ffb31b11cf75e6a8d0cea6bc012145ba4d6162f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_dict_exclusion_test_model_export_dict_exclusion.assert_excludes_origin": {"doc_hash": "a8a0b589417aca18113a4eb9c44b88f844117a896aa38aa153a041bf39f926cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_field_exclude_test_field_exclude.assert_my_user_model_dump": {"doc_hash": "e316bb8dc2c7e40307993a7d564f5ee7a64016845adf1fbf5a0742ca8103cfa5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_never_test_revalidate_instances_never.None_3": {"doc_hash": "395252dad43998d9aefd9df36b21892a4fef35a1e9e6528907b9e0d50ae56617"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_sub_instances_test_revalidate_instances_sub_instances.assert_not_hasattr_t_user": {"doc_hash": "bb840873c827f91976e9a2a823855500c31776afcfe76b8b1983db069ea49d2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_always_test_revalidate_instances_always.assert_not_hasattr_t_user": {"doc_hash": "8869d219c296f694cce3c63eb7fa74887df5c535248e96d6600ac38e803e4f72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_copy_on_model_validation_warning_test_copy_on_model_validation_warning.assert_t_user_hobbies_is_": {"doc_hash": "3c423afe361a681bc466055a8879e0150ada0eacc946bf689392f0021c7db118"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validation_deep_copy_test_validation_deep_copy.None_1": {"doc_hash": "9821670a65c38f4cc905557320605657ee108e52dec39cd512e906abede632fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_exclusion_with_fields_and_config_test_model_export_exclusion_with_fields_and_config.assert_m_model_dump_exclu": {"doc_hash": "b4fd0b400e23c6cea4e1e03c0668942320686eb416d8ee4d24c593c2eb8d1557"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_exclusion_inheritance_test_model_export_exclusion_inheritance.assert_actual_expected": {"doc_hash": "d4a502d06373ad8e20ca3a6773fa96b983e6875421045079619e170f0550268c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_with_true_instead_of_ellipsis_test_model_export_with_true_instead_of_ellipsis.assert_m_model_dump_exclu": {"doc_hash": "8ab3a20805defe0f8ba0f842f06d142d52c99ef7c587f92664fdcde3516eb175"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_inclusion_test_model_export_inclusion.assert_actual_expected": {"doc_hash": "7ffd88fc838c8cb162d7478440ddcc5ba7b2f5492fe607a1a6dc691b7bab629d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_inclusion_inheritance_test_model_export_inclusion_inheritance.assert_actual_expected": {"doc_hash": "a58044a7ea90547c8c1ed6977c43d70273ca4eb74cd53ee3cb85e47610ad9043"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_untyped_fields_warning_test_untyped_fields_warning.NonWarningModel.x.1": {"doc_hash": "45b3828e3bdf08620e5070a4ca9a491f35ec79f96ff3b161cd42aa81c3b08ae6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_untyped_fields_error_test_two_defaults.with_pytest_raises_ValueE.Model.a.Field_default_3_default_": {"doc_hash": "ece3251b015500599c1860ae1b42e7f5a9e6b92353cda7db177ea0c5cfcfbf7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_test_default_factory.assert_SingletonFieldMode": {"doc_hash": "67533c582699b116975058facda9d946e0e50eb8592d8f6ccbde419fb53ec858"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_called_once_test_default_factory_called_once_2.assert_m2_id_2": {"doc_hash": "81cfd5ed751830d3b8c56431a5505b221deb0fa14e3846d5bb632e27667e6228"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_validate_children_test_default_factory_validate_children.assert_exc_info_value_err": {"doc_hash": "51268a91105ded3b8078fdc901e5b49ed26ee2f3d2e3ebc5ef9983a6ce03b732"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_parse_test_base_config_type_hinting.get_type_hints_type_M_mod": {"doc_hash": "5abb58218cf11a4a51a6874c6c546f99fc9bd5990b01add2745535ab9e3d2eaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_field_test_frozen_field.with_pytest_raises_TypeEr.r.id.2": {"doc_hash": "ad553863ac88200bd0a0de69475ec70d961f829ea928e88d61d78ddb3aa3fa11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_repr_field_test_repr_field.None_3": {"doc_hash": "fb3b6d3fe6e1b8b203989fcbd504eff245bd117eca64a8b42945eaa4968a683a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_inherited_model_field_copy_test_inherited_model_field_copy.assert_id_image_2_in_id": {"doc_hash": "e2bfcbdae1cd658ce4bcda1b99c4cd74cddde3b4a4fe9c70148bfbdf9a586505"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mapping_retains_type_subclass_test_typing_coercion_counter.assert_repr_m_x_Coun": {"doc_hash": "2fd612f22dd063524aff7a3c7e962148ed7b556c179281eb88d1c1b0db257f07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_typing_counter_value_validation_test_typing_counter_value_validation.assert_exc_info_value_err": {"doc_hash": "3973fce4fc25511308321caddf07707e7e43614e79b45de8650527202c58aeb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_class_kwargs_config_test_class_kwargs_config._assert_Model_model_fiel": {"doc_hash": "e98e7d12b3483ff2330931442a22f6bea3023c5cb9493b329db52d8b7797958b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_class_kwargs_config_and_attr_conflict_test_class_kwargs_custom_config.with_pytest_raises_TypeEr.Model.a": {"doc_hash": "c6024a85c98ba84e88759f649e438ddeb61b80bfa605ecc116e134691e2363c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_new_union_origin_test_new_union_origin._": {"doc_hash": "dabec73455a0a971d585719f4129b64dabe20664340e0059725a76c730a0ab49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_final_field_decl_without_default_val_test_final_field_decl_without_default_val.assert_Model_model_fields": {"doc_hash": "0c6a501364e9dc495b1e85272cdca8ae8125d3b7cf60d1416bd180eeca59ffa6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_final_field_decl_with_default_val_test_final_field_decl_with_default_val.assert_a_not_in_Model_m": {"doc_hash": "93d5a4b2a691dd660040fa38329414394b315b55b01a3e020b0e3e622b8bf962"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_final_field_reassignment_test_field_by_default_is_not_final.assert_not_Model_model_fi": {"doc_hash": "b528cd095fa596af322cd90bc35ed963dba5877e3fb6760f4fbab2c699b3b529"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_test_post_init.assert_calls_submode": {"doc_hash": "33b234c4d1ed433aa30489ec2bf8ec833af8b9b3602985969c8fd241785032d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_args_to_field_type_error_test_model_equality_fields_set.assert_m1_m2": {"doc_hash": "58fca021f0bfdb191f45dfa37be9f90ae885a305067eae2c67c179597e079817"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_equality_private_attrs_test_model_equality_private_attrs.assert_m3_m3_equal": {"doc_hash": "52029d28ec98e7168b7e3238d4f17b3f4b9f17913d66107096fc1f96987275e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_equality_generics_test_model_equality_generics.assert_nested_any_nest": {"doc_hash": "242738efb2a7bc4b2f447a5e4c588c4a83e5ff630c28ef3faaf0f2e82c114559"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_strict_test_model_validate_strict.None_5": {"doc_hash": "12df5cf84922f40f030d4381dbb98be1964e66855d94e7fdff82c019fac665b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_json_strict_test_model_validate_json_strict.None_5": {"doc_hash": "1c08f3640b85a1b32608bde9ea2f6248523c75f8b51efbe634b730f48cd27622"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_python_context_test_validate_python_context.assert_contexts_": {"doc_hash": "8275b84d66f42f3a83f36861e43c51459a4cbfbfb25177a83226c5e647f0bf3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_json_context_": {"doc_hash": "6e86bd41937927c6d21d5a2edf198b0c5f8a4034280b55c0300ed895529f8aa1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_sys_test_model_signature.assert__equals_str_sig_": {"doc_hash": "43bd90ed913b750637951a679ddce2ada656f02cb76772c712ab0e151e3a6e04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_custom_init_signature_test_custom_init_signature.assert__equals_str_sig_": {"doc_hash": "ddbe9b89054a4a2a03df09cf8808446ffff02cbf93e7a704294bde435a2eedd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_custom_init_signature_with_no_var_kw_test_invalid_identifiers_signature.None_1": {"doc_hash": "3fae97463c41d211f0e84cfaf1a2ad44aa7dde370f96997ec767cc202684e9a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_use_field_name_test_optional_field.assert_signature_Model_": {"doc_hash": "0dc4d26ce9bb932afc53588357e4a5b98bca306495599181b899ffb8df2007ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_annotated_field_": {"doc_hash": "699bba8256bb0ddb18c16ca8e43258967c4668545c57eb2aa16d097efcaf8938"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_pytest_try_.except_ImportError_.email_validator.None": {"doc_hash": "b6a3d4c5f40a16d759ec5a2f0eced7ad9b7ff8a5a9e6833933d730eba9d3bc06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_any_url_success_test_any_url_success.assert_Model_v_value_v_": {"doc_hash": "5e37d82225161c9b0c8b619670635f81da861db522c47f3dab6d17581cc75c73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_any_url_invalid_test_any_url_invalid.assert_type_error_ty": {"doc_hash": "5c375190a6df19d2607f937ff34de257ee8fa46418a46f519cf5b916ca8738be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_validate_url_test_url_repr.assert_url_fragment_f": {"doc_hash": "44d10fe98835ab37488f35ca7875afc069858333ff4b372256f2bbd42cee5fd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_ipv4_port_test_fragment_without_query.assert_url_fragment_c": {"doc_hash": "9d65858aa68ecb7d646519305f1d43c650f2e39d689196e6d7c0294f74bdbf90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_http_url_success_test_http_url_success.assert_str_Model_v_value_": {"doc_hash": "bd9532e9956f423d678bebd3a270db5bc21b01f972f809d25715bcd45521ec02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_http_url_invalid_test_http_url_invalid.assert_type_error_ty": {"doc_hash": "959d946982a48e83bb6fd8a5488dadb16a7f624e19e6cc8eafa6f50ad1985e68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_coerce_url_test_coerce_url.assert_str_Model_v_input_": {"doc_hash": "2eb85aaf7bfeb32ba69c309c1804194de3d0a65a91cf90e9f43735e03d2344ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_file_url_success_test_http_urls_default_port.assert_str_m_v_expect": {"doc_hash": "58d43abf69d2edca4921bef5211de5997d8689d6f9e1c8d58f91ab3c0d12012c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_postgres_dsns_test_postgres_dsns.assert_str_Model_a_dsn_a": {"doc_hash": "5dcf19475ef36b138fff3bfe3947056b0a81753d2a509c0c2de0fba8b7e62940"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mysql_dsns_test_mysql_dsns.assert_str_Model_a_dsn_a": {"doc_hash": "716eaee7e1ca56eaa2b9eb583695e76ad512299c1b433ff6c02303fb60473fcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mariadb_dsns_test_mariadb_dsns.assert_str_Model_a_dsn_a": {"doc_hash": "e1e4f36dc4a539843e00f715d1d68b71c322a205c4c3be9751db5ca26f941a86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_postgres_dsns_validation_error_test_postgres_dsns_validation_error.assert_error_error_mes": {"doc_hash": "c229b441b65043853707232f1251f59ca47a257f6791fe687ebad1aee6825e9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_multihost_postgres_dsns_test_multihost_postgres_dsns.None_7": {"doc_hash": "2ba62e003054b26da567ec6bd3c12dfe7af12c1197e070c11904163111be087a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_cockroach_dsns_test_cockroach_dsns.assert_exc_info_value_err": {"doc_hash": "ffe97dd93a38fdb2c0ad93dc2a43f86c5ca6ec8162530fc15a2761383d499fdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_amqp_dsns_test_amqp_dsns.assert_m_a_path_is_None": {"doc_hash": "197cf228727335645f32ebd137364e7be04bccd95ec1c2f3cfe663a2bed9f8de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_redis_dsns_test_redis_dsns.assert_m_a_path_0_": {"doc_hash": "7c9996511cafad8f1f83a2f56537d2f0551fa157f795f964d567fcff18bfef78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mongodb_dsns_test_mongodb_dsns.None_6": {"doc_hash": "04dfb33d0c597e2cb6bb68f792fc108b6843d217777225dc5222dcf8fbedfa14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_kafka_dsns_test_kafka_dsns.assert_m_a_password_is_No": {"doc_hash": "bb5674745d71cd77c6f5ac5b8cebe46889e06be0983c4aa6fd6bee5dc133ab20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_custom_schemes_test_json.assert_m_model_dump_json_": {"doc_hash": "725a696537b4adad58a1f603fb3d77dc791f8433196f7093ff591901ca1274fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_valid_test_address_valid.assert_validate_email_val": {"doc_hash": "58f2e63c7a1c9cf384653f56e187ac75e4935ed18cd6b5673c391ebfdbca1d40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_invalid_test_address_invalid.with_pytest_raises_Pydant.validate_email_value_": {"doc_hash": "694530a86a513f974c742bf1c2443052dd7de5ccc865652929d08a3fee80d2b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_email_validator_not_installed_": {"doc_hash": "5279d16a789721a4fa47cfdc24e54a6603fd6a04b081b229492ee6683c5a9356"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_from_ipaddress_import_IPv_test_ipaddress_success.assert_Model_ip_value_ip": {"doc_hash": "6e3d098e68f2d3c073b210318b29257b0b043bfa92171fb784e8ef5e45ea36c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv4address_success_test_ipv4address_success.assert_Model_ipv4_value_": {"doc_hash": "fc84b5806ec6f7239148373659652ca457b67fd19df3e5c87833cb701dcba886"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_strict_test_ip_strict.assert_Model_v_value_v_": {"doc_hash": "d989c8c6d002fd8570ed0458db710750aabe1c074ea1e4f3f2bb373eab617453"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv6address_success_test_ipv6address_success.assert_Model_ipv6_value_": {"doc_hash": "809f389da6690c6b43e6d2aa2fae13958489a00e2a85549ceee8cda476460196"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipaddress_fails_test_ipaddress_fails.None_1": {"doc_hash": "5954578277fdd675239496ac5d0ba522b9859d4d52a5e6c99718c64971bd35b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv4address_fails_test_ipv4address_fails.None_1": {"doc_hash": "7294d4e4fe61c823e8b392ad571b762c97b666573f3dec0c4efd3224477ff631"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv6address_fails_test_ipv6address_fails.None_1": {"doc_hash": "3d37b3053d7e4df82b36a97e9d4d7959d467ec350e8802ed551dc78956507e09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipnetwork_success_test_ipnetwork_success.assert_Model_ip_value_ip": {"doc_hash": "183774ac601e6df2413d713cbda14832e3575efce522f54a424fc02d7acd0202"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_network_success_test_ip_v4_network_success.assert_Model_ip_value_ip": {"doc_hash": "b67cf6c1a25cafc41a006a0e3b30aa31b502e01f85b76a3ccbd561508899847f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_network_success_test_ip_v6_network_success.assert_Model_ip_value_ip": {"doc_hash": "0dfcdac3f8afed1574a2e57716209d1327bbe57d25e341565bfe2c1dbdd03d22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipnetwork_fails_test_ipnetwork_fails.None_1": {"doc_hash": "4571976581ea300057d2fd71e997c30bca732e80753f1932125c06a953d787a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_network_fails_test_ip_v4_network_fails.None_1": {"doc_hash": "9ec823b81090ea06b0354c19f06f540ae9909cc6330a12830c45e325fb4763b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_network_fails_test_ip_v6_network_fails.None_1": {"doc_hash": "8bf9002d9c904603c2e75653fb4c3bd3fbebdeb1b603d33756c4165a67c1dd55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipinterface_success_test_ipinterface_success.assert_Model_ip_value_ip": {"doc_hash": "3265afc59ef64354579a6c2c00f8e53cd4c707671b7c549cc2e2b4cb4151e1ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_interface_success_test_ip_v4_interface_success.assert_Model_ip_value_ip": {"doc_hash": "bfc2bcf469b3b6836f79ae11e42520d84b2e0b5947139ffcf7ded470c5e8c7a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_interface_success_test_ip_v6_interface_success.assert_Model_ip_value_ip": {"doc_hash": "b96130ef7cb040fabcfb18a38a1d357f9315d43f5460698cbd070d991f751d3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipinterface_fails_test_ipinterface_fails.None_1": {"doc_hash": "d06c591687bca534ca19c1ed65f6b2daa2968a7d797b7261499faccfb51df3b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_interface_fails_test_ip_v4_interface_fails.None_1": {"doc_hash": "51cd143b2ea42cabedadb09c086fdb68b5863c8b52dccff56baddd42d1f98c81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_interface_fails_": {"doc_hash": "48fb7730ce5a184b7f61f3731bd74e6d6d6e5c6f849fc02e819c8a732d0e551e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_from_typing_import_List__test_model_validate_submodel.assert_m_model_dump_": {"doc_hash": "283db2f90aca5353e71651873c14db449da161acdfa93f2b137a2df500a58967"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_wrong_model_test_root_model_error.with_pytest_raises_.MyModel.__root__": {"doc_hash": "10db72977f356a1fe478ae61bf4fe5e24af415e34ff371c78b1bad78e9db377b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_root_test_model_validate_root.MyModel.model_modify_json_schema.return.json_schema_properties_": {"doc_hash": "982949a4f9dc9f8538804a29e629a11e2db430f06eb0195e6ab44c7c86ff4ea3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_root._Validation_test_model_validate_root.assert_m_model_json_schem": {"doc_hash": "6c52730b83bae7082de6b069012f1364a7648acbe639517c92496bca65a946f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_root_list_test_parse_root_list.assert_m_root_a_": {"doc_hash": "76f2f18d0eb0b07e1c2552ef4f0f9707b56fa428d44efda26bab5f873b7bcbbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_root_list_test_parse_nested_root_list.None_1": {"doc_hash": "df043a991756d1befc0157fd838df67af1127fc8ad4bed03f79e641c286b6f74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_root_tuple_test_parse_nested_root_tuple.assert_isinstance_nested_": {"doc_hash": "ff976a6b04838db7ae4689fd6e41ad7fe0f50b8ea04228b1d8a7644f5da669ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_custom_root_": {"doc_hash": "c78ef9af9875d73ff1e60735850daaa1c9e1edad23cbef15056b99a1c520e5a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_platform_test_private_attribute.assert_m___dict___": {"doc_hash": "98a80c5a48978ff9e98b62313654880f87956a7aee9d02b4d2aab5a86aca9a96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_nested_test_private_attribute_factory.assert_m___dict___": {"doc_hash": "9e81d702804a648bc9afe6cdafda09570e5af6e32c0fb1de6dc82ae6c1507719"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_annotation_test_private_attribute_annotation.assert_m___dict___": {"doc_hash": "12280f05d37039fd98d68bf2d4a4035513fa8bd76fd01cf4f225c3bc23d0cbc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_underscore_attrs_are_private_test_underscore_attrs_are_private.with_pytest_raises_.m._bar.1": {"doc_hash": "33fe034b105a1023c32b3efdaf1f9256fd864a59eb72b7962bb76ef963904e57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_intersection_with_extra_field_test_private_attribute_invalid_name.with_pytest_raises_.Model.foo.PrivateAttr_": {"doc_hash": "337705964002321a5c4bb8cd3158f0301e3cf4af9fa8482758dfd7f0d2a5e743"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_slots_are_ignored_test_slots_are_ignored.with_pytest_raises_ValueE.m1.foo._not_spam_": {"doc_hash": "221df9aec11d9a3ed5409f74672d38be4ee29c8a2649d608974c690c1d075255"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_default_and_default_factory_used_error_test_generic_private_attribute.assert_m_model_dump_": {"doc_hash": "66770fadbad78a9b8a0cb04bd7d0882404e82e895e0e1dcaa980367f2fdbc809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_multiple_inheritance_test_private_attribute_multiple_inheritance.assert_m___dict___": {"doc_hash": "c7701295fa15a65ad80ebf63ccfca83dfa449bb88c79026e99b08ed7c2b55ab2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attributes_not_dunder_": {"doc_hash": "caec9c6dab91e8932b9c76fe81309f0e799125494cc51a57a9978fa4f902711b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_rich_repr.py_from_datetime_import_date_": {"doc_hash": "3d1255a0adc25e6f643d3db1ee29d1d730fade90a7dc19d654b1fe94ec6db983"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py___test_serialize_decorator_always.None_1.m_model_dump_json_": {"doc_hash": "5789d69a0c3e21f8a0842c1f8678ec0043a9a64b2ed04178af66927566b1d765"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_json_test_serialize_decorator_json.None_2": {"doc_hash": "688d80d26923d01de2ddfc94595002d0996cfcd0682a2a0a4289179d5922c8a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_unless_none_test_serialize_decorator_unless_none.None_5": {"doc_hash": "9fb80e191c03344350ae5b2289f8f66df561d9d007533577930a5c3e958d9a85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_annotated_customisation_test_annotated_customisation.assert_m_model_dump_json_": {"doc_hash": "7984f9ca43e61f657463512884799d324d77d09195a98debda14ace73aedebe4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_valid_signatures_test_serialize_valid_signatures.MyModel.ser_f4.field_serializer_f4_mo": {"doc_hash": "b53f20f57b00dad815caab0ed14f4e84f16575364baccfc43c735527c373da52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_valid_signatures.m_test_serialize_valid_signatures.assert_m_model_dump_json_": {"doc_hash": "444ba80dc9d36796b52c490becc34e5441e288f5c6cd33ce56364cacee1ed3dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_invalid_signature_no_params_test_serialize_decorator_self_no_info.assert_MyModel_x_1234_mo": {"doc_hash": "fb0628868bf0ddd2e3f5a0cbea16bd72ab6054749a4cea762523c44622903d8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_test_model_serializer_plain.None_8": {"doc_hash": "23b7574943f3c6db214222d73b06e68c97f869c85ba279504e6cfb927c41d4a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_info_test_model_serializer_plain_info.None_5": {"doc_hash": "160850f0a7b441381dd8700f5e3ccf0fd1fc89ca82a79052ef2ab261cd7a076c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrap_test_model_serializer_wrap.None_5": {"doc_hash": "8085c8078210295cae3b75595f9af248001d20e0c1caeab8ac56ca7eb70aea95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrap_info_test_model_serializer_wrap_info.None_5": {"doc_hash": "f8652d0d574bada423337724713a22099c4b2c12376f2328747041e1b5f5dd6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_json_return_type_test_model_serializer_plain_json_return_type.with_pytest_raises_Pydant.m_model_dump_json_": {"doc_hash": "eed792748cfeec09af02869fa6948050ce89ae5211cc54e75cd33e1b7c2e5876"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrong_args_": {"doc_hash": "40e6730ba84e7d02051a6faea149089c59955b31c0a6c264a65edf9a8b1068a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_sys_test_parse_strict_mode_on_field_invalid.assert_exc_info_value_err": {"doc_hash": "2e0b5f7b8b28d2a35743a271037205e33ef159d23746cfb9e3f64b42a65ae831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_strict_mode_on_field_valid_model_with_strict_config_false.return.ModelWithStrictConfig": {"doc_hash": "232333b02684f843dbcd0b2afc2be671b1726204555c28f7551a8b075174216f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_model_with_strict_config_enabled_test_parse_model_with_strict_config_enabled.assert_all_v_model_dump_": {"doc_hash": "dc6fe4fa43fd13415207b67f9e3afbeda26bab809565617ae3967e926037a51b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_model_with_strict_config_disabled_": {"doc_hash": "dcf1fcaaf8935b41ccbce51469a65ea6b7d2dd5d7126aa1223aed1f7328d81c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_structural_pattern_matching.py_sys_": {"doc_hash": "ddeeb8de26a8f5ca5038c79c0f1eacb91a6ef147c3ee1acb57e576cf975099d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_tools.py_from_typing_import_Dict__test_parse_obj_fails.assert_exc_info_value_err": {"doc_hash": "7cc5d2df7096795529d2ae5207ad88565fcdcee86d9e232e80b4178b7552385f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_tools.py_test_parsing_model_naming_test_parse_mapping_as.assert_parse_obj_as_Dict_": {"doc_hash": "cc3b507028b99b183b3e3440ced1f2fe72979774127541872634a90345bc287d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_tools.py_test_schema_": {"doc_hash": "203ce80f99776195bf99678669cc57056dc26ed0098ad7fc6f8cb6678bc3fb2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_itertools_test_strict_raw_type.with_pytest_raises_Valida.Model_v_b_fo_": {"doc_hash": "b0ff8210564f2930cc696c6c238a89ba0b1fd4e228b8d2e2d3f3dabd0c3e60c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_bytes_too_long_test_constrained_bytes_too_long.assert_exc_info_value_err": {"doc_hash": "8c342d6e4ce4aa3e008160ac24c87837074bd4c1b6c175c03dbae421de5990c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_bytes_strict_true_test_constrained_list_default.assert_m_v_": {"doc_hash": "89dd3f1e8779dac23c9250b0427eb3061125af7c7d490b29a24af4786b4fa314"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_too_long_test_constrained_list_too_long.assert_exc_info_value_err": {"doc_hash": "1e3eb5d6e85eba9eb7494abe4ed73417dd972bcc5f8a5da64f71d4a86e5be4f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_too_short_test_constrained_list_too_short.assert_exc_info_value_err": {"doc_hash": "bf17d222da0958f894fff21c4a939c4eb61d7a4a2eb1619480f1cc8f35cf9052"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_optional_test_constrained_list_optional.assert_Model_req_a_o": {"doc_hash": "23dea5818e6e40859ed40c04bc7639a6bca0cc04271b7271edf5591a044598d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_constraints_test_constrained_list_constraints.None_4": {"doc_hash": "4c8f1f28e58a0f10d94a51c6d76c09df65ffd95b038771b30adc8366e069436d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_item_type_fails_test_constrained_list_item_type_fails.assert_exc_info_value_err": {"doc_hash": "3b896631c4e300e7cbf1a809028f0335c14d4cfecf1b05078225dcbfdfe6ac4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_conlist_test_conlist.None_2": {"doc_hash": "8ef2c5436b1c39fd45c6446298e68e6605ac0c806f0d9bcfccdda6d5e75b0244"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_conlist_wrong_type_default_test_constrained_set_default_invalid.assert_m_v_not_valid_": {"doc_hash": "124f5bd76c3d740dcdd8e149b1e5daec6e670d01143f99fa00c7fba22b8d8ca5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_too_long_test_constrained_set_too_long.assert_exc_info_value_err": {"doc_hash": "85e5714fd0bfaa0c6a3a6fb7eeb1af382183cb08bf859ea8ed585c9dd9bcf1b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_too_short_test_constrained_set_too_short.assert_exc_info_value_err": {"doc_hash": "cf457f3e61d4417d19d9f6deb34006dae1723063b68ac1d3303292b262ba2ca5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_optional_test_constrained_set_optional.assert_Model_req_a_o": {"doc_hash": "db2df4f3962620773cd3b19d7511f4e1212ce1f827052cf693d939137b3abd74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_constraints_test_constrained_set_constraints.None_4": {"doc_hash": "ce5143d79ad7587532b1f21148a1945400e45cfd36168f1c5746087471edec73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_item_type_fails_test_constrained_set_item_type_fails.assert_exc_info_value_err": {"doc_hash": "b8b5cce7bfd750e83024d3c6de65ef8ba77650f18115d5ae965882334b208292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_conset_test_conset_not_required.assert_Model_foo_is_Non": {"doc_hash": "4ce1c78ce199495702a0f71663ceb075c7b07b8a83f5ecbaf77e86e0012c2892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_confrozenset_test_confrozenset.None_5": {"doc_hash": "c962ed11d2e0e9c01e86569e39325af05c339fbe57fe2bcbd683a94bd8e3104b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_confrozenset_not_required_test_constrained_frozenset_optional.assert_Model_req_a_o": {"doc_hash": "f2cc4a2ea8beed393b89770007f163216c956002153a0cb8716c37691eb84ce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_constring_model_fixture_test_constrained_str_too_long.assert_exc_info_value_err": {"doc_hash": "bddae93642c824f7df22d231036ad5a14b419ca4ec7c7cf895d3b0a712c0ba85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_str_upper_test_constrained_str_lower.assert_m_v_result": {"doc_hash": "e5cc10f8539be630460bfd6119f84c2780c646c42152c37907571959cef9f661"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_str_max_length_0_test_constrained_str_max_length_0.assert_exc_info_value_err": {"doc_hash": "3606810d3c1099a40e996b9113da12eb07972c7a54e424f7404a365b8680fa85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_import_callable_test_string_import_callable.None_5": {"doc_hash": "0a0edd98c7a7d22521af8c7a2d006cfd533a19616d0a5c37a393769cc02df9d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_import_any_test_string_import_constraints.with_pytest_raises_Valida.PyObjectModel_thing_math": {"doc_hash": "f53f6cbc4ad77e8b6ef8639e6e8d9574dedfdfdc8e25c081b39ac9d1c1ee7dc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_test_decimal_strict.assert_Model_v_v_model_d": {"doc_hash": "7aa8cbacfda38c99650fedb78b2f2f2630809ce4bb68976622e57bf22e9f020e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_date_test_strict_date.None_2": {"doc_hash": "eb1189755fbeb01de02f004ddaf9212e2e02431ba1e6ee12bf683acd1cf38e2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_datetime_test_strict_datetime.None_2": {"doc_hash": "7afbb3f8d517f79e6989cd33aa4651ed93078ec76dc1b5d9fb0aceebed3ff52d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_time_test_strict_time.assert_exc_info_value_err": {"doc_hash": "49e2dc9c21d5db52dc69a9db60e49c0cb8e29e89b1f14a8d4f510832e6bc7032"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_timedelta_test_strict_timedelta.assert_exc_info_value_err": {"doc_hash": "2293c9c388bb46e43845bbe1e59c103bc4b4ce85a99ea6ae0a2ea506551396c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_check_model_fixture_check_model_fixture.return.CheckModel": {"doc_hash": "88ba4239f7a978d07e105b1fb8181f6ae139b0a4e9d6b5c5abc6f503df9c9c0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_BoolCastable_test_string_too_long.assert_exc_info_value_err": {"doc_hash": "90e675870e31f013450988e7716b7842c0078597c53a6dc7b7d7939d698fe8dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_too_short_datetime_model_fixture.return.DatetimeModel": {"doc_hash": "fa1f4784d2b11525d016de772ca18568b682ca157a18c7d3ca41ee821d2c253d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_datetime_successful_test_datetime_successful.assert_m_duration_time": {"doc_hash": "be3b9c4b310a8aa1968da3847d78ecef5b6526827c89d63ef3f9b7bc63100aed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_datetime_errors_test_datetime_errors.assert_exc_info_value_err": {"doc_hash": "fb7faa7768bb756aa331e9d3a11a911911d7a9e55296fe33a9afb2789cbe5257"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_cooking_model_test_enum_successful.assert_repr_m_tool_": {"doc_hash": "0a4ccb7413f1fa3751d2faafde79ac4ec5bfdaf6e0af01f49705c80912cda1fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_enum_fails_test_enum_fails.assert_exc_info_value_err": {"doc_hash": "1c9517395d9a366fdcfcc344856676d578f23aa6dec2795bb102adc8b65a454f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_int_enum_successful_for_str_int_test_int_enum_type.with_pytest_raises_Schema.Model.my_int_enum": {"doc_hash": "db322aa654372e8027559b7f08fa451d6c201ba1e9b581df9eda17621b62ee30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_schema_constraints_test_invalid_decimal_constraint.with_pytest_raises_TypeEr.Foo.a.Field_foo_title_A_tit": {"doc_hash": "8dca56186342b337d56bc8c27174ea36557e9a27fe46f8084eb247e13bbb387a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_success_test_string_success.assert_m_name_email_email": {"doc_hash": "81ad52673dffdea8d872f609a13cc9260e3806db6223ed6d9985b8f0fcb2cd69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_fails_test_string_fails.assert_exc_info_value_err": {"doc_hash": "37386eae52f5dc89424b26d3fb94b5eb3cd38032ffb9456633221cb5b3869660"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_email_validator_not_installed_email_str_test_dict.None_2": {"doc_hash": "e41503cc76ae0bf860652dfb562c4b343ab04c50a0cbafad54612c04ea470f8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_list_success_test_list_success.assert_Model_v_value_v_": {"doc_hash": "1ebfb6a70edb09a4c14d7b4ce55ee2f91ba0e8fa374a1e10edc8e40784d02011"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_list_fails_test_list_fails.assert_exc_info_value_err": {"doc_hash": "75e8ebadb0c0a2cccbbf337c3458b855a4c77312da1b033cc20af2661e80436a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_ordered_dict_test_ordered_dict.assert_exc_info_value_err": {"doc_hash": "36e75c748007177f3efdb6a8b8ef7675bfc35b44ecdd7daa8d2b6c22049d1c5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_success_test_tuple_success.assert_Model_v_value_v_": {"doc_hash": "ee5d84bd19a97393cb1ddf4b644fecc2afaa640196e9192e70342eb5e600f823"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_fails_test_tuple_fails.assert_exc_info_value_err": {"doc_hash": "2caa566b74aab08611b9da76c0d405b5ebe60c839614beee265028f02af84af2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_variable_len_success_test_tuple_variable_len_success.assert_Model_v_value_v_": {"doc_hash": "fc902c1a8f83b649caac55bcc8aaa49c5eab254b52e6059871a8fd778eea549e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_variable_len_fails_test_tuple_variable_len_fails.assert_exc_info_value_err": {"doc_hash": "533f3c6d27f50c724a6d2f8683c3a1128bf85f4a9055a8ceb4337f07de559c96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_set_success_test_set_success.assert_Model_v_value_v_": {"doc_hash": "6e47189b2f4751074ee6a3139fd92b65ac760f2450da9f471733aa9ae551c878"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_set_fails_test_set_type_fails.assert_exc_info_value_err": {"doc_hash": "5621fc3956785556999cf9ba9973bea3b3d857fa756b743dec156775a7f78211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_success_test_sequence_success.assert_Model_v_value_v_": {"doc_hash": "0c04c6bec15388b584a7b447a9eb5569f99c85673eca7b02cf008c4ae3847c8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_int_iterable_test_infinite_iterable_int.assert_exc_info_value_err": {"doc_hash": "0a78638d18a8a9bec7df58a492413af5e29e69da1dd614848fcc5c3788af695a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_iterable_any_test_iterable_any.assert_exc_info_value_err": {"doc_hash": "f0d16b0ce07c5c5caec9f6331bd4afce65cb36996a6038607523f9fcd38e06f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_iterable_test_infinite_iterable_validate_first.assert_exc_info_value_err": {"doc_hash": "d3c3dc381622012d8965ed789a246d4e014c968530cdfb1c16c23ee1bb4e332e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_generator_fails_test_sequence_generator_fails.assert_exc_info_value_err": {"doc_hash": "428c2a554b8dcabfc25aeba56a14bc64f74a47ef32e4aa8d8246be260c512beb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_fails_test_sequence_fails.assert_exc_info_value_err": {"doc_hash": "e9b5bc087a93dec01e241e922e069002b6f6be28e11fd567199ebd23bd4b9132"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_int_validation_test_int_validation.assert_exc_info_value_err": {"doc_hash": "907e354723f6e55663108bd53645a2a35de618386604f9148451f0082dd2af2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_float_validation_test_float_validation._insert_assert_exc_info_": {"doc_hash": "d1fb97e2a6d59bf6f7bbdd42de4d92361c4c11ed8d12b7257bd27feee192a6a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_float_validation.assert_exc_info_value_err_test_float_validation.assert_exc_info_value_err": {"doc_hash": "824a04dacd214521d4bbae320fccbcf8f53a49c74ef9dba597c603e5a198deba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_finite_float_validation_test_finite_float_validation_error.assert_exc_info_value_err": {"doc_hash": "a34b1436982dba59c6134ae3fb5cf80d5a587e9634e44384ef5c3ba24809b9ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_finite_float_config_test_finite_float_config.assert_exc_info_value_err": {"doc_hash": "ecf0730a6d1dd78f209de7936b31327239fed8f1e104c99728940f809ebbe660"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_bytes_test_strict_bytes.None_3.Model_v_0_42_": {"doc_hash": "b30815a0ef37c182b7b4e1c1cff65eb888acd9e7ec3d7be9a71946f0ea7b5f46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_bytes_max_length_test_strict_bytes_max_length.None_1.Model_u_b_1234567_": {"doc_hash": "f78f68b3a9bc06204f7fca0f7b17a6b253888b76a21cdc027fe8dc72d52ae41f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_str_test_strict_str.None_2.Model_v_b_foobar_": {"doc_hash": "e08fb297e3ccd7bfe419ce5cf7c27129ee8a0172d459a5b1773b86e6e0eaf693"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_str_max_length_test_strict_bool.None_2.Model_v_b_1_": {"doc_hash": "88ab62eb31ae25e87c8a35f9982260c14645f20882e6bf5e59fb86e816c823c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_int_test_strict_int.None_3.Model_v_True_": {"doc_hash": "9ae7644e11711a25b61a72049e0200810f6309ba659cccaa874867aef7f390a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_float_test_bool_unhashable_fails.assert_exc_info_value_err": {"doc_hash": "99ee58a1cb8d6d877a0f82c6f83ad27ecf2c3da36ae3081317565824bc833fb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_error_test_uuid_error.None_1.Model_v_None_": {"doc_hash": "082f8741e2b54984b3d3b5d74e8723b8c0a548b72104fd15b5931d15738a39c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_validation_test_uuid_validation.assert_exc_info_value_err": {"doc_hash": "a46982134d4d252915a3d3222a18ce15d31072cd66eb8041f85acde071b17f3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_strict_test_uuid_strict.assert_isinstance_m_d_ty": {"doc_hash": "db9dbdf539a7728fc5fd47d34951716e428502623c6b7f188cbdaa48e5b73742"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_str_strip_whitespace_test_str_strip_whitespace.assert_m_str_check_res": {"doc_hash": "a0fdfc4b8554f1078b6aedfd61fd7bbeb9b71565dadb946c31738764033fb01a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_str_to_upper_ANY_THING.object_": {"doc_hash": "174086069dd6fc2140faca2b289b4ade63cdebddd05bef78199362f82a27f5e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_validation_test_decimal_validation": {"doc_hash": "2c2fdbbcf06b49894b0518c08f954ed222a4441f49904d73de1cc02dd63fde1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_validation.if_mode_Field__fix_allow_inf_model.return.Model": {"doc_hash": "c10f35b2ef942255cbd1b530c276499b3ae08ff8b91a27da912c412bb3477da1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_not_finite_test_decimal_not_finite.if_result_unchanged_.else_.assert_m_v_is_infinite_": {"doc_hash": "f1882ff93316c91196fdc5196c31c83f818cf29fce2a96f7a192f750262130fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_invalid_test_path_validation_fails.assert_exc_info_value_err": {"doc_hash": "5cb9b1c2db7f53561745fa9dba79a05227b76fecc61c6494de7ab059caef0e79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_path_validation_strict_test_path_validation_strict.assert_Model_foo_Path_t": {"doc_hash": "54d96cc9a2346e5d7ed67d38fb4e98e251c6a87f6d1371cd5a665ae18568d041"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_file_path_validation_success_test_file_path_validation_fails.assert_exc_info_value_err": {"doc_hash": "436acb0bfd693dad9cff039a4cdbfcbe11adb28816139c3f320759030bb1748c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_directory_path_validation_success_test_directory_path_validation_fails.assert_exc_info_value_err": {"doc_hash": "beb34d4075396a0299afcefb5b8f74f76b25545fc973f94e528b790acf44cbf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_gt_test_number_gt.assert_exc_info_value_err": {"doc_hash": "346595f4e62021ca2044d594a76e251dad5f26b080589ba4f8862322bd09bd52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_ge_test_number_ge.assert_exc_info_value_err": {"doc_hash": "1a851c40b2ef0518d52f4272fe3f71c56c0289815a533b0b641917d30ea61fe3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_lt_test_number_lt.assert_exc_info_value_err": {"doc_hash": "552e5a24a50de5331cb1167badce7aba63fa6333478158eb4ea8450561f47098"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_le_test_number_multiple_of_int_valid.assert_Model_a_value_mod": {"doc_hash": "b1ecdd5f1ade575a373acb018a4227f1c33e8974e2272a238a123cc3ff9b9459"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_multiple_of_int_invalid_test_number_multiple_of_float_valid.assert_Model_a_value_mod": {"doc_hash": "5fce94cde7cac168a2c38d769511fc6f9322f6f6f9aaf7e15e3c79b17366a32e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_multiple_of_float_invalid_test_number_multiple_of_float_invalid.assert_exc_info_value_err": {"doc_hash": "2476a2ca2a38f4929c1570123c2d84c4512376bb4e74a20b12f3f01a0f81b4b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_new_type_success_test_new_type_success.assert_m_model_dump_": {"doc_hash": "47c632a1125ed5e90050896d48ff71d7e40e13ff6b9c84e9f654a508fee6c9b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_new_type_fails_test_new_type_fails.assert_exc_info_value_err": {"doc_hash": "a51ea9e98556e0f7310e8e5fb3addcbf796002e42ea42b2296db21d0ce5ec4d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_valid_simple_json_test_valid_simple_json_any.assert_JsonModel_json_obj": {"doc_hash": "4b2fa79f2b329227e1ebaa7966b7bc18c86fe128e27dc494ae2e171c434fa623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_simple_json_test_valid_simple_json_bytes.assert_JsonModel_json_obj": {"doc_hash": "0fdf795fd1d0548323f88251802246bcfc322d2ff31eeaee5fdefd4a665b2670"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_valid_detailed_json_test_valid_detailed_json.assert_exc_info_value_err": {"doc_hash": "47b9e8cc540f47e21123e74075c705fceead2993416167fe91c94a73251bd749"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_valid_model_json_test_valid_model_json.assert_m_model_dump_": {"doc_hash": "25971275916939ba633de11020059b6cbb8c95744956943cc31aa47a213f78b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_model_json_test_invalid_model_json.assert_exc_info_value_err": {"doc_hash": "242241e5a7862a8bb480bac00cb3223543b5f01dd968e83a386405e5610eda8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_detailed_json_type_error_test_invalid_detailed_json_type_error.assert_exc_info_value_err": {"doc_hash": "048b30a14df57e93ae74fc64606a08b3a4a6f2844954d975d52b7105a87916d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_not_str_test_json_not_str.assert_exc_info_value_err": {"doc_hash": "785a3dbe86ee7393d54cfaf9b6f7d7c22e2325fb18eb3613f18290239ae3d7a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_before_validator_test_json_optional_simple.None_1": {"doc_hash": "57b19b22d629c8c0e3b8a9f645dd0a85450aaa9902f5a4ebd26943f33a98f20e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_optional_complex_test_json_required.None_1.JsonRequired_": {"doc_hash": "25c800fa444aaa93aa397107ac489493aeea168f7e0a9c73a473de8d6b517a62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_test_pattern._": {"doc_hash": "630ebb1e5b0ee8484d98fede4845ac448887d1e46a885a5856cfcab682e4782d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_error_test_pattern_error.assert_exc_info_value_err": {"doc_hash": "72b41953e0d72dee2ee4fbd62a4edd258fedb9ec2f090c98c98aa7cc2769748b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretstr_test_secretstr.assert_f_empty_password_g": {"doc_hash": "539b5486f37492be98fcca961fbbbaf22ab183577e6eec48de38ff809fc5049d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretstr_is_secret_field_test_secretstr_is_hashable.assert_type_hash_SecretSt": {"doc_hash": "a1859d48b5113aec69bac5cfe37019334c47ad4da02498a9bf915d4e37cb5d76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretstr_error_test_secretstr_error.assert_exc_info_value_err": {"doc_hash": "8de0a259a202ba870d471dbc3775a308309934fb2e550a78cc1fc8908f708b47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secret_str_min_max_length_test_secret_str_min_max_length.assert_Foobar_password_va": {"doc_hash": "cbdd167564b75bf7c7d27ba516d33291dbf72aec2beb99872509678dca5ac26e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_test_secretbytes.assert_f_copied_with_c": {"doc_hash": "430a2d5d40d2b7fe98adfda75d122149da861321330b7f4aa97c4f18607d1539"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_is_secret_field_test_secretbytes_is_hashable.assert_type_hash_SecretBy": {"doc_hash": "8ca1e8e4530297127e4394142f48896316177daacce27984a6c9d055ca4c7567"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_error_test_secretbytes_error.assert_exc_info_value_err": {"doc_hash": "669dedc46a69ab6e2f33611ed95e2b6040a2779bd3f69330b9c371483d86d099"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secret_bytes_min_max_length_test_secret_bytes_min_max_length.assert_Foobar_password_va": {"doc_hash": "febbded2cf11058e85bbb992ef2dfac0e7b0f9a9e670fdeb831f2f48cdf11afb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_generic_without_params_test_generic_without_params_error.assert_exc_info_value_err": {"doc_hash": "c6f566d680bb396269a9dcbf2fd945feff7ba713c606b34ef1ea4d645e65133d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_literal_single_test_literal_single.assert_exc_info_value_err": {"doc_hash": "ec6fc1580e67ae61c36dba0388b785ed48fe854e7e5966d55c9d6175ddc2a1e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_literal_multiple_test_frozenset_field.assert_object_under_test_": {"doc_hash": "d05219bed93a82de4faa18ec02bf2f8a321c28be86f2cefa1f62dc6504669a3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_frozenset_field_conversion_test_frozenset_field_not_convertible.with_pytest_raises_Valida.FrozenSetModel_set_42_": {"doc_hash": "741deec4a6d5efb0e6535d375a5c3d082d75c68721c3c3697ccee20e8bd0de6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_bytesize_conversions_test_bytesize_conversions.None_2": {"doc_hash": "6c2b4e4e9ed5853577dbb446fda351b37d917b2fd7558bb72dfd4214c72af090"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_bytesize_to_test_deque_success.assert_Model_v_1_2_3_": {"doc_hash": "5ec08323152991e168d4c6dcd1dbe2e985a980f8be69dffb8534c09968a347cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_generic_success_test_deque_generic_success.assert_Model_v_value_v_": {"doc_hash": "75394932a0c6928633083e0e06107f87f39db93b435f1c193fc1a3ae08ef8331"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_generic_success_strict_test_deque_generic_success_strict.assert_Model_v_value_v_": {"doc_hash": "b5d8cbd7d63e294e8c737a2dbb366cdd0c869eb39dbe6fb76b8897638daab676"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_fails_test_deque_fails.assert_expected_error_": {"doc_hash": "c204500bdcb062a4ebf8630bafae47f97ad3f152e8101f716bed64ee2a96c86c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_model_test_deque_json.assert_Model_v_deque_1_": {"doc_hash": "dcd99b778660b4424fe003f5d3273922c20c287760ff8ea4282cb0c63d2b68cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_none_test_none.assert_exc_info_value_err": {"doc_hash": "5b7caa34355d31f4672329b5dd66a6f063d2e37429e153ff3ebdcb096053b6aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_default_union_types_test_default_union_types._": {"doc_hash": "2d590e21ca679a741fa509f959781066c647b0d9027b58e274400fa2b9a559fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_default_union_class_test_union_subclass.assert_Model_x_MyStr_1_": {"doc_hash": "00db454fddae91d501042d1cdeac4035e599d787bc99614c8472f43beddf4be2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_union_compound_types_test_union_compound_types.assert_e_value_errors_": {"doc_hash": "5f5a6ca948862bb03dfec69fe637f33fbbaab1f74f5d73e75042a55a3d3d481f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_smart_union_compounded_types_edge_case_test_union_typeddict.assert_M_d_dict_foo_baz_": {"doc_hash": "08e9b54a189bb54114adcc1f8c59ce246076e059055e75f3ce6f9dd94742d719"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_custom_generic_containers_": {"doc_hash": "63fad4f424ccc750d9a7146e8a31ab7d42a5b10e52a951aabf078dbfa48c0e5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_from_collections_import_n_test_namedtuple_simple.None_3": {"doc_hash": "8595f2c193d306c19b71092f2c322d07583645ba746384af558fca6a3ef9e4cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_test_namedtuple.assert_exc_info_value_err": {"doc_hash": "380a3e00dd3a220d776961b62d5c364b734bcb976c8b58b5ff20db66a815787f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_schema_test_namedtuple_schema.assert_Model_model_json_s": {"doc_hash": "a1a021a1386af947efb11ab99d492912d849e38a770d3032c5312946187917d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_right_length_test_namedtuple_right_length.assert_exc_info_value_err": {"doc_hash": "e491b18d7139ca19cc8faae01b921df3d4a6cf21280de4cad464dd6eb56432d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_postponed_annotation_": {"doc_hash": "6fa9c1cb016200f6b4db2b29b998f4a9043b3142efb99e934b7a4a5b7f350245"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_from_collections_import_n_test_validate_digits.with_pytest_raises_Pydant.PaymentCardNumber_validat": {"doc_hash": "9cbd94ff0369d771b1f7281601a79651daac55524c88e39cd3b91649435cca1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_validate_luhn_check_digit_test_validate_luhn_check_digit.if_valid_.else_.with_pytest_raises_Pydant.PaymentCardNumber_validat": {"doc_hash": "bebbba29677e62c851deed76a9588656316777a5235d0cd359c8d9df861e41d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_length_for_brand_test_length_for_brand.if_valid_.else_.assert_exc_info_value_typ": {"doc_hash": "6d2eec3b11ee7a42d9c20ac65dac774be4ec0cdd5d0c21ab810a5690b10e82f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_get_brand_test_valid.assert_card_card_number_m": {"doc_hash": "ec34055ef39163dc5e2da7669f58fe7624e41f6b102ac82e593d95d5a40f1b8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_error_types_test_error_types.with_pytest_raises_Valida.PaymentCard_card_number_c": {"doc_hash": "6c36e1bda862293241cf5b1921348f783fded7e43fd35e3e62a53cab7cf42b93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_payment_card_brand_": {"doc_hash": "52fbcd25abdd75ebe65c374c6bceca4430a696af468f68c8a05492baae5bd621"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py___fixture_typed_dict_all.try_.except_AttributeError_.pytest_skip_f_TypedDict_i": {"doc_hash": "407af166dac2679ee5ca5e846dcef2daaa5d9cbc8c2aae2cd966d6f91d229e8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_fixture_typed_dict_fixture_typed_dict.if_hasattr_TestTypedDict_.else_.pytest_skip_TypedDict_do": {"doc_hash": "1c07a35148ec76744302336f18948f9592c9d9f20fa1685dc96bfc90b25a9dd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_fixture_req_no_req_test_typeddict_all.try_.else_.assert_M_d_dict_foo_baz_": {"doc_hash": "6aa5b7df12eec2e1bd59c2255f05388ae146448ed8eb87810b3889c9148875cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_simple_test_typeddict_annotated_simple.None_1.M_d_dict_foo_baz_bar_": {"doc_hash": "122f02a6fc2706599d3d9fc9eabfb19cea2a4093f5371c0ec2c09544a69cf6c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_total_false_test_typeddict_total_false.with_pytest_raises_Valida.M_d_": {"doc_hash": "09b6c389891049f40cd73d761d59709e47d5db7d1aa8e3a3e36667367c5dbb91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_test_typeddict.assert_exc_info_value_err": {"doc_hash": "8342db3ea559ea3a4fd744e67ee5726d760eafd19d6670448461584d945e8ab9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_non_total_test_typeddict_non_total.assert_m_movie_year_": {"doc_hash": "d107f5ba2914f106fe94cda09ef7f35cff5ee2c574ca4ce2c1f15012120b33b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_partial_new_typeddict_test_typeddict_extra.assert_exc_info_value_err": {"doc_hash": "0386936e0b02585cb2bca439525cc597d31ee8c33869381b3c7c4e3d22e828b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_schema_test_typeddict_schema.assert_Model_model_json_s": {"doc_hash": "6e83f3a53bd6de3ddbcf729eacb360044cfb30e965c4c224c1f53cd84aa443ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_postponed_annotation_test_typeddict_required.assert_Model_model_json_s": {"doc_hash": "b820238f423a8ba88f820072338ad2b8fd74e526e8149decdbe25387e425a241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_from_attributes_test_typeddict_from_attributes.with_pytest_raises_Valida.Model_u_UserCls_foo_15": {"doc_hash": "423864372b637ce288eee088a2e6f189fabcc5411685ffbcd2e6338540983581"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_not_required_schema_test_typeddict_not_required_schema.assert_Model_model_json_s": {"doc_hash": "8e7b878efa7f8207e71eebd7d382377f36dfb65e665713f84472bd72112be621"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typed_dict_inheritance_schema_test_typed_dict_inheritance_schema.assert_Model_model_json_s": {"doc_hash": "6b7c92658b4f2ce903559583fbc3de030d9ea6ceb4f6b11c33572b922fb2fc89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_nonoptional_schema_test_typeddict_annotated_nonoptional_schema.assert_Model_model_json_s": {"doc_hash": "dff3e3dd7757c04eaa54fc15da05691178a747ee9baadb9c61402aed6ff5f533"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_test_typeddict_annotated.if_isinstance_expected_E.else_.assert_Model_d_input_valu": {"doc_hash": "dee309e146014418c36afaff96cd28993e6d5071a7e6f15f50e36c7d533ac3df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_typeddict_test_recursive_typeddict.assert_exc_info_value_err": {"doc_hash": "4d1ca1a076bb164b584b6416dd4936fc3bebdea6588eaf9229f025bce725b290"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_T_test_generic_typeddict_in_concrete_model.assert_exc_info_value_err": {"doc_hash": "a8113287ff648b8ce8cdd582fea5cea8c85a0445e6fe65d3f099215ad73aa223"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_generic_typeddict_in_generic_model_test_generic_typeddict_in_generic_model.assert_exc_info_value_err": {"doc_hash": "fa1fedb905299c2b9d61cdd34421db4be24feb5a12d5b6c7ac347eb3d3822539"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_module_test_recursive_generic_typeddict_in_module.assert_exc_info_value_err": {"doc_hash": "ba473900cb0719057ebbe0ec238da28d46ac44b360a48141a10e2fb1732f37db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_1_test_recursive_generic_typeddict_in_function_1.assert_exc_info_value_err": {"doc_hash": "6425849a49366fcbf76943eaa3dc6111548f820f1e5fbada9f842e928e92db01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_2_test_recursive_generic_typeddict_in_function_2.assert_exc_info_value_err": {"doc_hash": "6f74e727ed4f915a5f56cba6051ccfac83b38efda2d10e7a5809e8bf66fcf594"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_rebuild_error_test_recursive_generic_typeddict_in_function_rebuild_error.with_pytest_raises_.IntModel_rec_int_data_re": {"doc_hash": "57b0872151db67f909a0636cb9ab259c5aa64647aad4c92618ecb0f5cfc50cac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_rebuild_pass_": {"doc_hash": "324ba70738e632f7bc78e4efe313b9494f0117a7b89a53ba042f441b9f0b2558"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_typing.py_typing_": {"doc_hash": "038beb0ed80efd11230b8a3579c7e846b7bf0710c607961ff169a2f6f31fa4fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_collections.abc_LoggedVar.get._": {"doc_hash": "91244c6781bb05505a6bf2c280f6bb68b3c9d3e66191da549e14336bd8bdea24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_display_as_type_test_display_as_type.assert__repr_display_as_t": {"doc_hash": "bf2c99e91fe6be497e6bc315acb03336641d748e39ccfa7f398ec5439cf79ea2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_display_as_type_310_test_display_as_type_310.assert__repr_display_as_t": {"doc_hash": "1594dd5b0eb22dfed242a6bae564c6b27f57209afa7ac1d903930a8bc3ca64fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_lenient_issubclass_test_lenient_issubclass_is_lenient.assert_lenient_issubclass": {"doc_hash": "52942f66078312e2c66ae0c5e136a9dd042abe341b8da8f5ab8367d65c3bfa0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_unique_list_test_unique_list.assert_unique_list_unique": {"doc_hash": "246a801b8ec6219a999935ffdd294ee2e8c3062f9e72241cffacb498eda71f08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_value_items_test_value_items.None_16": {"doc_hash": "d7f23a6d91e4af2d5b8bec612c9f1824fee4c8574112e827aa625527cd2d4f89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_value_items_merge_test_value_items_merge.assert_actual_expected": {"doc_hash": "fe6f2aeb1a26961cb97c2772a68667a1cd753ca95e102d4e64dc18f8b6282236"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_value_items_error_test_pretty.assert_list_m___pretty___": {"doc_hash": "77a7c6c58852ed466ff9bc75773633124b6667f0219d8663f18a55c6df3d3f55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_pretty_color_test_devtools_output.assert_devtools_pformat_M": {"doc_hash": "6a06017769c6ce3ef93adeca204c8305563d327f8deeaadb847034388e36fd4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_deep_update_test_deep_update.assert_deep_update_mappin": {"doc_hash": "293b0890f42b3426a9107090483947bec0b7daf187efea0cb90864156d6626ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_deep_update_is_not_mutating_test_all_literal_values.None_2": {"doc_hash": "3afb194b4356025dbeb015b0db91fed6d6188523c594bf6b36e3069285d1fc58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_smart_deepcopy_immutable_non_sequence_test_smart_deepcopy_immutable_non_sequence.assert_smart_deepcopy_obj": {"doc_hash": "e7688eee344efe84338ce5b4531b21c2bb18ffaddf4869050b83a83a2117213e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_smart_deepcopy_empty_collection_T_1.TypeVar_T_": {"doc_hash": "6d519b01532666274a7d114d207312f54bb2870ab6b011ca9bfd801376cbb9c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_get_origin_test_get_origin.assert_get_origin_input_v": {"doc_hash": "62332800c61d659bd6c826aef25638ab05dcd0a2a39dbc6e675f1976a0e4d43f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_all_identical_": {"doc_hash": "a24bd1d8969a58a0d65d544a8c370199ba0883015aab33ebf4950cf62a2e19c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_json_SomeNamedTuple.x": {"doc_hash": "e13ffd59c052414460af92fb7df3cbd2c477f03240d76378e76e39f70e74bfc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_types_test_types.assert_expected_v_val_": {"doc_hash": "2247010ec03bac580fc04c109c1f2227aa3c3088fc24748b8f10cd90119a58ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_IntList_test_type_alias.assert_res_1_2_": {"doc_hash": "c210cb9b9b69f94c5e84e6806604bd2f72d8ee0230fdc0342543a56792cfda85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_python_strict_test_validate_python_strict.None_5": {"doc_hash": "ca7d2041bab99a61e89d86ee9113aad4e986cbb6e6467518d3d13ad579452773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_json_strict_test_validate_json_strict.None_5": {"doc_hash": "465df03361cb6f1a3a43dee293b8c530d4ef5784468cc6d5b0f055f1bb254f35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_python_context_test_validate_python_context.assert_contexts_": {"doc_hash": "227972dcdb0f5b328a5836624fe5e384dc90c5779d98a04ba074b3cecaa8ae90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_json_context_test_validate_json_context.assert_contexts_": {"doc_hash": "9f12bc2673afaff3b18fc33f9f41fbd5aec4a377db695d3c22793959790472ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_merge_config_": {"doc_hash": "4fb820a587f5cd3bfb06ad491a2181d4b47424a4e93745bb1a5b7aabb47c9055"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_re_test_simple.assert_exc_info_value_err": {"doc_hash": "1e81c31c38acfefa9a629428ee9479cf977fae06feecb6c335ed99431231bcea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_int_validation_test_int_validation.assert_Model_a_2_63_": {"doc_hash": "03cbdc3a630cceb6c5fac9e08870153be5742193a46c7d4b4af4ffaae48ef8c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_int_overflow_validation_test_frozenset_validation.assert_Model_a_1_2_": {"doc_hash": "19daf030e467556216168b9333a06fbf4521a4b5daf6d57f52d507d1faafc384"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_deque_validation_test_deque_validation.assert_Model_a_6_a_": {"doc_hash": "80d2dceba056b6a9ecdee4c37c8851a1b79b7f04bee6ce0a5b9ca9f15f146907"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_whole_test_validate_whole.assert_Model_a_1_2_a_": {"doc_hash": "be17790980b186f8cfffc67bea83e6abe276afc2a36e4754f956c12798285b30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_pre_error_test_validate_pre_error.Model.check_a2.return.v": {"doc_hash": "9547e876144e8553b0a13e92dfcf91eb3f20dc550c8a0d1b265f26498c562721"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_pre_error.assert_Model_a_3_8_a__test_validate_pre_error.None_5": {"doc_hash": "d575677d1431f1ad0fbf4001fb13935f7888a1fadcbdfb4e4bbe5a64ee1c63f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_validate_assignment_model_fixture_validate_assignment_model_fixture.return.ValidateAssignmentModel": {"doc_hash": "de84e45b18a6ed49909d14ea54f8b0e5ffd6fe5596da0f3159b2c82e9a7cae2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_ok_test_validating_assignment_dict.assert_exc_info_value_err": {"doc_hash": "d0d4df7d6fc00807de1d09f0acd02d5a6a0a4a0384b20c12c2bcb86380206049"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_values_dict_test_validating_assignment_values_dict.assert_model_b_4": {"doc_hash": "19ea63a479f0b584a707da248a778bb3f5e31ea581bd6448dfad172bca35f0a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_multiple_test_validate_multiple.assert_exc_info_value_err": {"doc_hash": "582e32b10bac255a56c86a5ce47206fc29e926941a1b0610bcaf669064fbc8fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_classmethod_test_use_no_fields_field_validator.with_pytest_raises_.Model.checker.return.v": {"doc_hash": "d13361814fb0a062b63d8221490fd43690654b538f405624c8a0646d4fe9db97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_bad_fields_throws_configerror_test_validator_bad_fields_throws_configerror.with_pytest_raises_TypeEr.Model.with_pytest_warns_Depreca.check_fields.return.v": {"doc_hash": "be6576513d75ad778471fcacef5687ec5ff7d660697aba8c5a418a5ed6df68ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_bad_fields_throws_configerror_test_validate_always.assert_check_calls_2": {"doc_hash": "554732ff2a54e1ead256711c9831cf2a03a87caa7f39cf381bddc209aa67fdfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_test_validate_always_on_inheritance.assert_check_calls_2": {"doc_hash": "a3a9aea3d1d78672f5a5faf632a9029ac46796d0d20862eb72af3b80e3d0fe68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_on_inheritance_test_validate_not_always.assert_check_calls_1": {"doc_hash": "456f342488263502fa37baa7e94ebd1258022b2b17f4ee6b86ea05b7ec87acb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_wildcard_validators_test_wildcard_validators.assert_calls_check_": {"doc_hash": "f55ce1b1253f0931c44f99d016de470709f9b0fd9af5c44c16b37d4c1c69ef33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_wildcard_validator_error_test_wildcard_validator_error.assert_exc_info_value_err": {"doc_hash": "ca0efecc03f63715bd7c91fe1805b19f455a2ac5303d742fbc59d6d8546a36fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_invalid_field_test_validate_child.with_pytest_raises_Valida.Child_a_snap_": {"doc_hash": "b51af79b0b30ea44910c3b37489debfdefc2fc5227ee5675b14b5ec7777832f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_extra_test_validate_child_extra.with_pytest_raises_Valida.Child_a_snap_": {"doc_hash": "b5452af6822b95680e139b27ef7891859db4db7b230a8c6c173272099dbbc8e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_all_test_validate_child_all.with_pytest_warns_Depreca.with_pytest_raises_Valida.Child_a_snap_": {"doc_hash": "f7fc1854db409dc266176234faa052f1b0eaef569ee3ca768573e32cc97a5e93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_parent_test_validate_parent.None_1.Child_a_snap_": {"doc_hash": "3689fff18ffa82ea9474cec961bfe307e81e4cf3d94329c2d5d31116d513002c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_parent_all_test_inheritance_keep.assert_Child_a_0_a_1": {"doc_hash": "54e71ef42945f39cc0c68fc5d40ecbc3a59e9eace34d6fd6eea1773d01d232f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_test_inheritance_replace.assert_Child_a_a_": {"doc_hash": "39e9e3e2d41e2072b56c9038cb4781caea91cfaddfe5dfe86665b5f236d45ad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_root_validator_test_inheritance_replace_root_validator.Parent.parent_val_after.return.values": {"doc_hash": "af70d9ecdc5d8d173b9cb9b24c7eb2d304714d86dc5b30f22531055465e34fc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_root_validator.Child_test_inheritance_replace_root_validator.assert_Child_a_a_": {"doc_hash": "6ab62924ceb583c51cd57dc074930ab5d4146f907c9326ada35d9efd58556848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validation_each_item_test_validation_each_item_nullable.assert_Model_foobar_1_": {"doc_hash": "4b1cdbbde719ed1d82c4a69becdec15269b341d6f6f295ad0f57ceab8eec7b8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validation_each_item_one_sublevel_test_validation_each_item_one_sublevel.assert_Model_foobar_1_": {"doc_hash": "5fbcd3d235e157349277b41c8ef2fcf301afb6af33e5902a26c99ca92eccf92d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_key_validation_test_validator_always_optional.assert_check_calls_2": {"doc_hash": "5509ef6660b3c189ea044b649414eb1457d2cfe27ab0dca759cf9c61bb9a0855"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_optional_test_field_validator_validate_default_optional.assert_check_calls_2": {"doc_hash": "753b19c0bd1483bc365420976554cfd50ca5761c716e257ebed51d1f06719238"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_always_pre_test_field_validator_validate_default_pre.assert_check_calls_2": {"doc_hash": "a0d73235e78c56f26d4b1fa8436778ba0bfc329f36e80f4696d1391c870ee6e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_always_post_test_validator_always_post.assert_Model_a_defa": {"doc_hash": "02c3b03b1a69927a145fae8d8e82dad452cc98251a86daa02345927fab0418d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_post_test_field_validator_validate_default_post_optional.assert_Model_a_defa": {"doc_hash": "67fc2d5da7ec5e7ac15935c92347f9d83bf9a7220fd03bad363d8b9761f129e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_datetime_validator_test_datetime_validator.assert_check_calls_3": {"doc_hash": "e61fea5083c4a30dd0cb833df46d45b7ed4b8f4180bce15ef9061e5334d36e39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_datetime_field_validator_test_pre_called_once.assert_check_calls_1": {"doc_hash": "db5bad48f70bcd3e01fb61b8c3ce2be1bf5d99ac03c013e8fdb1cec148139fce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_assert_raises_validation_error_test_assert_raises_validation_error.assert_exc_info_value_err": {"doc_hash": "3a6ef82317e28c97d094981f919569caa00280d48e2669d0f87fd414b0bfe047"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_test_root_validator.Model.example_root_validator2.return.dict_values_c_changed_": {"doc_hash": "a30d5d1c6c623e348a5c8632f291b205ac51275f20544eec267627963e46501b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator.assert_Model_a_123_b__test_root_validator.assert_root_val_values_": {"doc_hash": "939edb85e0d59f887b5669715c141e016f51c634198a8a7de4b9afbc4778ce37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_pre_test_root_validator_pre.assert_exc_info_value_err": {"doc_hash": "26f108f936361907c7d66bec5198e64eb29f5b5aa4b4bebeeee8a2494bc19123"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_repeat_test_root_validator_repeat2.with_pytest_warns_UserWar.Model.repeat_validator_1.return.values": {"doc_hash": "8e25ea95154d9014ae7459c658bb35607d03f88f16cb6a47c7f7b5aee1f85823"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_types_test_root_validator_types.assert_root_val_values_": {"doc_hash": "7d39ae9d764151d0a5334c9b729d0a2409711ccebb0a12a871722a71cebdb838"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_returns_none_exception_test_reuse_global_validators.assert_dict_Model_x_1_y_": {"doc_hash": "2643b96602f5718996994d34e01330863b6faa60aaf184a6ade2693c3d8d0466"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_declare_with_reused_validators_reset_tracked_validators._FUNCS_update_original_tr": {"doc_hash": "0fdd40a268929f2174f92a6ddadb69567bcf642d38fb19c13fb76b0806bf5db5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_allow_reuse_test_allow_reuse.if_duplication_count_1_.else_.declare_with_reused_valid": {"doc_hash": "c889f3a9885cf8a579c180ac949b8bac02ba79faac16b89d46f34d28042f80bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_classmethod_test_root_validator_classmethod.Model.example_root_validator.root_validator_skip_on_fa": {"doc_hash": "632ebdca2617642dc64719720c3567a78ef57cc0338bc81961b30badc5da592f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_classmethod.assert_Model_a_123_b__test_root_validator_classmethod.assert_root_val_values_": {"doc_hash": "063b3064eada784c0f412b73315c1a46f639e07d316ed86b94ae8bd46259ec67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_assignment_validator_cls_test_literal_validator.assert_exc_info_value_err": {"doc_hash": "0334b7d7b3fa9285111c5a8badd844f6ad899d571847c6d4ae15e1c2d5c4f2d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_literal_validator_str_enum_test_literal_validator_str_enum.None_5": {"doc_hash": "bcb18edcd9650cee446974cdf2f747510d495b67e7fc3551c953495d01baa333"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_nested_literal_validator_test_union_literal_with_constraints.with_pytest_raises_TypeEr.m_x_1": {"doc_hash": "7957dab96503ee71b2c1b355cabe4d50ca6ef2828a926607abe5a96d2b3b75d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_that_is_being_validated_is_excluded_from_validator_values_test_field_that_is_being_validated_is_excluded_from_validator_values.Model.validate_bar.return.v": {"doc_hash": "092ff241602723d2f293e637b013c9e731d7d80101d39bed211e4bfd787623c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_that_is_being_validated_is_excluded_from_validator_values.model_test_exceptions_in_field_validators_restore_original_field_value.assert_model_foo_foo_": {"doc_hash": "3c844363c52a90351e6792e6601a8c309a4f48c4a5eab9f94bc98d2dfd066426"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_overridden_root_validators_test_overridden_root_validators.None_1": {"doc_hash": "a01374afa6f80b69c1e0e66843b77dc6c99ec931eb9e864474d966acad785328"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_pre_root_validator_fail_test_validating_assignment_pre_root_validator_fail.assert_exc_info_value_err": {"doc_hash": "ee78917906a152dbba2ac6ba8e1b156c28bbac297aa218ada83bb57bbcfe0e06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_skip_on_failure_invalid_test_root_validator_skip_on_failure_invalid.with_pytest_raises_TypeEr.Model.root_val.return.values": {"doc_hash": "627c9b6a99f89bab520a679cc32d0612e60612417ccf23856a0bfef256b32ace"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_skip_on_failure_valid_test_root_validator_skip_on_failure_valid.Model.root_val.return.values": {"doc_hash": "52e8c8f0e837d90dcea1779adcbaf64aa6728fb77e2f07ef65c2312a9436308e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_many_values_change__get_source_line.with_open_filename_as_f_.return.f_readline_": {"doc_hash": "5d3fcebf8c1d68a215fcf51a090f2309fb639ac21bc8bc87cf55471548f1640f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_deprecated_test_v1_validator_deprecated.assert_check_x_in_sourc": {"doc_hash": "b7cd54a553ddada784527b3c6ed6b725cbc44aec14f21316a3c7e9f22015a24a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_info_field_name_data_before_test_info_field_name_data_before.assert_Model_a_b_your_foo": {"doc_hash": "1a007aa99e04ceaa9505265fc79fc249cce5ad29aaf66d456b81dce4411afb5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_decorator_proxy_test_decorator_proxy.assert_Model_val3_1_2": {"doc_hash": "3900967859399174313703be2ab7cd78deee5046e938df2d1829d74bdb4abb30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_self_test_v1_validator_signature_kwargs_not_allowed.with_pytest_warns_Depreca.with_pytest_raises_TypeEr.Model.check_a._": {"doc_hash": "d607b850ea1a37ea430c22fcbf0c1919b5df168067fbb9d9db3d74958c465ce8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_kwargs1_test_v1_validator_signature_kwargs1.assert_Model_a_1_b_2_mo": {"doc_hash": "aa842b93eeebe3b40e8a679675f9ff352dbc0f5b35697b091d986aa0cdb7623a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_kwargs2_test_v1_validator_signature_kwargs2.assert_Model_a_1_b_2_mo": {"doc_hash": "44e994d218d2de7ae95583abca0325e2872500fba86ecd1c898fe00e0285c28c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_values_test_v1_validator_signature_with_values.assert_Model_a_1_b_2_mo": {"doc_hash": "ca981e2ac94998bd27cc94692edc25dc7a7e7dfcfc298a252dc8c3702fe1cdd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_values_kw_only_test_v1_validator_signature_with_values_kw_only.assert_Model_a_1_b_2_mo": {"doc_hash": "28eb5f57220cf14d7c184f40a2daf6590bcb147cce55a20050b6f8dea2e56bb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_field_test_v1_validator_signature_with_config.with_pytest_warns_Depreca.with_pytest_raises_TypeEr.Model.check_b._": {"doc_hash": "0dec46f65bc73b8ebc1ec66e7ed746f63ffcf62078548a9f276b72f8d4e2b17d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_model_config_validate_default_": {"doc_hash": "316ebd857802db76936608a9361d757eced881004160939a89014e2f7e2dc83d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_re_test_simple.assert_MyDataclass_a_thi": {"doc_hash": "e93e74c5775cf1667387b69b48fe290e4305cff2d1a8e730c2db68b460778d8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_validate_before_test_validate_before.assert_MyDataclass_a_1_": {"doc_hash": "ab4afec24e6b9df581c7104c37389bd6a3908c0bff1fbc17889109c827ae7e35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_validate_multiple_test_validate_multiple.assert_exc_info_value_err": {"doc_hash": "4c46707f5c1fcc8dc69ed62bd5ddba7b4c50ca3fd0956fae5938928c076bc049"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_type_error_test_type_error.with_pytest_raises_TypeEr.MyDataclass_a_x_b_x_": {"doc_hash": "4fc2c43a7cf422dc2e3d610b227d5476a72ffa749a956516657f7ffa6ae3599a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_classmethod_test_inheritance_replace.assert_Child_a_0_a_5": {"doc_hash": "0eaf44048d98efc69448c46143596582c229dfa250cd1ed6e47942901b9afc5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_root_validator_": {"doc_hash": "46c0575bb42041103f725e9eff2a313c01ff665ca7ceb03fde797666668af18d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_version.py_re_": {"doc_hash": "c1aeba6ce7af8114bd07d1e9c551a1e1310e961858699b49c2eba92f8ca987ce"}}, "docstore/data": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/changes/make_history.py__usr_bin_env_python3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/changes/make_history.py__usr_bin_env_python3_", "embedding": null, "metadata": {"file_path": "changes/make_history.py", "file_name": "make_history.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["docstring"], "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": "#!/usr/bin/env python3\nimport re\nimport sys\nfrom datetime import date\nfrom importlib.machinery import SourceFileLoader\nfrom pathlib import Path\n\nTHIS_DIR = Path(__file__).parent\nname_regex = re.compile(r'(\\d+)-(.*?)\\.md')\nbullet_list = []\n\nfor p in THIS_DIR.glob('*.md'):\n if p.name == 'README.md':\n continue\n m = name_regex.fullmatch(p.name)\n if not m:\n raise RuntimeError(f'{p.name!r}: invalid change file name')\n gh_id, creator = m.groups()\n content = p.read_text().replace('\\r\\n', '\\n').strip('\\n. ')\n if '\\n\\n' in content:\n raise RuntimeError(f'{p.name!r}: content includes multiple paragraphs')\n content = content.replace('\\n', '\\n ')\n priority = 0\n if '**breaking change' in content.lower():\n priority = 2\n elif content.startswith('**'):\n priority = 1\n bullet_list.append((priority, int(gh_id), f'* {content}, #{gh_id} by @{creator}'))\n\nif not bullet_list:\n print('no changes found')\n sys.exit(0)\n\nversion = SourceFileLoader('version', 'pydantic/version.py').load_module()\nchunk_title = f'v{version.VERSION} ({date.today():%Y-%m-%d})'\nnew_chunk = '## {}\\n\\n{}\\n\\n'.format(chunk_title, '\\n'.join(c for *_, c in sorted(bullet_list, reverse=True)))\n\nprint(f'{chunk_title}...{len(bullet_list)} items')\nhistory_path = THIS_DIR / '..' / 'HISTORY.md'\nhistory = new_chunk + history_path.read_text()\n\nhistory_path.write_text(history)\nfor p in THIS_DIR.glob('*.md'):\n if p.name != 'README.md':\n p.unlink()\n\nprint(\n 'changes deleted and HISTORY.md successfully updated, to reset use:\\n\\n'\n ' git checkout -- changes/*-*.md HISTORY.md\\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_pydantic__pydantic/docs/plugins/conversion_table.py_from_dataclasses_import_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_from_dataclasses_import_d_", "embedding": null, "metadata": {"file_path": "docs/plugins/conversion_table.py", "file_name": "conversion_table.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 822, "span_ids": ["imports", "impl", "Row"], "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": "from dataclasses import dataclass\nfrom datetime import date, datetime, time, timedelta\nfrom decimal import Decimal\nfrom typing import Any, Literal, Mapping\n\nfrom pydantic_core import CoreSchema, core_schema\nfrom typing_extensions import TypedDict\n\n# TODO: List of missing types\n# deque\n# typing.Any\n# typing.NamedTuple\n# collections.namedtuple\n# typing.Sequence\n# typing.Iterable\n# typing.Type\n# typing.Pattern\n# ipaddress.IPv4Address\n# ipaddress.IPv4Interface\n# ipaddress.IPv4Network\n# ipaddress.IPv6Address\n# ipaddress.IPv6Interface\n# ipaddress.IPv6Network\n# enum.Enum\n# enum.IntEnum\n# decimal.Decimal\n# pathlib.Path\n# uuid.UUID\n# ByteSize\n\n\n@dataclass\nclass Row:\n field_type: type[Any]\n input_type: type[Any]\n mode: Literal['Lax', 'Strict']\n input_format: Literal['Python', 'JSON', 'Python & JSON']\n condition: str | None = None\n valid_examples: list[Any] | None = None\n invalid_examples: list[Any] | None = None\n core_schemas: list[type[CoreSchema]] | None = None\n\n\ntable: list[Row] =\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_pydantic__pydantic/docs/plugins/main.py_json_on_files.return.files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_json_on_files.return.files", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["imports", "on_files", "on_pre_build"], "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": "import json\nimport logging\nimport os\nimport re\nfrom pathlib import Path\nfrom textwrap import indent\n\nimport autoflake # type: ignore\nimport pyupgrade._main as pyupgrade_main # type: ignore\nimport tomli\nfrom mkdocs.config import Config\nfrom mkdocs.structure.files import Files\nfrom mkdocs.structure.pages import Page\n\nfrom .conversion_table import table\n\nlogger = logging.getLogger('mkdocs.plugin')\nTHIS_DIR = Path(__file__).parent\nDOCS_DIR = THIS_DIR.parent\nPROJECT_ROOT = DOCS_DIR.parent\n\n\ndef on_pre_build(config: Config) -> None:\n \"\"\"\n Before the build starts.\n \"\"\"\n add_changelog()\n\n\ndef on_files(files: Files, config: Config) -> Files:\n \"\"\"\n After the files are loaded, but before they are read.\n \"\"\"\n return 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_pydantic__pydantic/docs/plugins/main.py_on_page_markdown_on_page_markdown.if_md_add_version_mark.else_.return.markdown": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_on_page_markdown_on_page_markdown.if_md_add_version_mark.else_.return.markdown", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 53, "span_ids": ["on_page_markdown"], "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 on_page_markdown(markdown: str, page: Page, config: Config, files: Files) -> str:\n \"\"\"\n Called on each file after it is read and before it is converted to HTML.\n \"\"\"\n markdown = upgrade_python(markdown)\n markdown = insert_json_output(markdown)\n markdown = remove_code_fence_attributes(markdown)\n if md := add_version(markdown, page):\n return md\n elif md := build_schema_mappings(markdown, page):\n return md\n elif md := build_conversion_table(markdown, page):\n return md\n elif md := devtools_example(markdown, page):\n return md\n else:\n return markdown", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_changelog_MAX_MINOR_VERSION.11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_changelog_MAX_MINOR_VERSION.11", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 69, "span_ids": ["impl:9", "add_changelog"], "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 add_changelog() -> None:\n history = (PROJECT_ROOT / 'HISTORY.md').read_text()\n history = re.sub(r'#(\\d+)', r'[#\\1](https://github.com/pydantic/pydantic/issues/\\1)', history)\n history = re.sub(r'(\\s)@([\\w\\-]+)', r'\\1[@\\2](https://github.com/\\2)', history, flags=re.I)\n history = re.sub('@@', '@', history)\n new_file = DOCS_DIR / 'changelog.md'\n\n # avoid writing file unless the content has changed to avoid infinite build loop\n if not new_file.is_file() or new_file.read_text() != history:\n new_file.write_text(history)\n\n\nMIN_MINOR_VERSION = 7\nMAX_MINOR_VERSION = 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_pydantic__pydantic/docs/plugins/main.py_upgrade_python_upgrade_python.return.re_sub_r_py_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_upgrade_python_upgrade_python.return.re_sub_r_py_n_", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 107, "span_ids": ["upgrade_python"], "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 upgrade_python(markdown: str) -> str:\n \"\"\"\n Apply pyupgrade to all python code blocks, unless explicitly skipped, create a tab for each version.\n \"\"\"\n\n def add_tabs(match: re.Match[str]) -> str:\n prefix = match.group(1)\n if 'upgrade=\"skip\"' in prefix:\n return match.group(0)\n\n if m := re.search(r'requires=\"3.(\\d+)\"', prefix):\n min_minor_version = int(m.group(1))\n else:\n min_minor_version = MIN_MINOR_VERSION\n\n py_code = match.group(2)\n output = []\n last_code = py_code\n for minor_version in range(min_minor_version, MAX_MINOR_VERSION + 1):\n if minor_version == min_minor_version:\n tab_code = py_code\n else:\n tab_code = _upgrade_code(py_code, minor_version)\n if tab_code == last_code:\n continue\n last_code = tab_code\n\n content = indent(f'{prefix}\\n{tab_code}```', ' ' * 4)\n output.append(f'=== \"Python 3.{minor_version} and above\"\\n\\n{content}')\n\n if len(output) == 1:\n return match.group(0)\n else:\n return '\\n\\n'.join(output)\n\n return re.sub(r'^(``` *py.*?)\\n(.+?)^```', add_tabs, markdown, flags=re.M | re.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_pydantic__pydantic/docs/plugins/main.py__upgrade_code_insert_json_output.return.re_sub_r_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py__upgrade_code_insert_json_output.return.re_sub_r_n_", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 140, "span_ids": ["_upgrade_code", "insert_json_output"], "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 _upgrade_code(code: str, min_version: int) -> str:\n upgraded = pyupgrade_main._fix_plugins(\n code,\n settings=pyupgrade_main.Settings(\n min_version=(3, min_version),\n keep_percent_format=True,\n keep_mock=False,\n keep_runtime_typing=True,\n ),\n )\n return autoflake.fix_code(upgraded, remove_all_unused_imports=True)\n\n\ndef insert_json_output(markdown: str) -> str:\n \"\"\"\n Find `output=\"json\"` code fence tags and replace with a separate JSON section\n \"\"\"\n\n def replace_json(m: re.Match[str]) -> str:\n start, attrs, code = m.groups()\n\n def replace_last_print(m2: re.Match[str]) -> str:\n ind, json_text = m2.groups()\n json_text = indent(json.dumps(json.loads(json_text), indent=2), ind)\n # no trailing fence as that's not part of code\n return f'\\n{ind}```\\n\\n{ind}JSON output:\\n\\n{ind}```json\\n{json_text}\\n'\n\n code = re.sub(r'\\n( *)\"\"\"(.*?)\\1\"\"\"\\n$', replace_last_print, code, flags=re.S)\n return f'{start}{attrs}{code}{start}\\n'\n\n return re.sub(r'(^ *```)([^\\n]*?output=\"json\"[^\\n]*?\\n)(.+?)\\1', replace_json, markdown, flags=re.M | re.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_pydantic__pydantic/docs/plugins/main.py_remove_code_fence_attributes_remove_code_fence_attributes.return.re_sub_r_py_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_remove_code_fence_attributes_remove_code_fence_attributes.return.re_sub_r_py_", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 155, "span_ids": ["remove_code_fence_attributes"], "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 remove_code_fence_attributes(markdown: str) -> str:\n \"\"\"\n There's no way to add attributes to code fences that works with both pycharm and mkdocs, hence we use\n `py key=\"value\"` to provide attributes to pytest-examples, then remove those attributes here.\n\n https://youtrack.jetbrains.com/issue/IDEA-297873 & https://python-markdown.github.io/extensions/fenced_code_blocks/\n \"\"\"\n\n def remove_attrs(match: re.Match[str]) -> str:\n suffix = re.sub(r' (?:test|lint|upgrade|group|requires|output)=\".+?\"', '', match.group(2), flags=re.M)\n return f'{match.group(1)}{suffix}'\n\n return re.sub(r'^( *``` *py)(.*)', remove_attrs, markdown, flags=re.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_pydantic__pydantic/docs/plugins/main.py_add_version__generate_table_heading.return._generate_table_row_col_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_version__generate_table_heading.return._generate_table_row_col_n", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 177, "span_ids": ["add_version", "_generate_table_row", "_generate_table_heading"], "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 add_version(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'index.md':\n return None\n\n version_ref = os.getenv('GITHUB_REF')\n if version_ref:\n version = re.sub('^refs/tags/', '', version_ref.lower())\n version_str = f'Documentation for version: **{version}**'\n else:\n version_str = 'Documentation for development version'\n markdown = re.sub(r'{{ *version *}}', version_str, markdown)\n return markdown\n\n\ndef _generate_table_row(col_values: list[str]) -> str:\n return f'| {\" | \".join(col_values)} |\\n'\n\n\ndef _generate_table_heading(col_names: list[str]) -> str:\n return _generate_table_row(col_names) + _generate_table_row(['-'] * len(col_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_pydantic__pydantic/docs/plugins/main.py_build_schema_mappings_build_schema_mappings.return.re_sub_r_schema_mappi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_schema_mappings_build_schema_mappings.return.re_sub_r_schema_mappi", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 207, "span_ids": ["build_schema_mappings"], "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 build_schema_mappings(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'usage/schema.md':\n return None\n\n col_names = [\n 'Python type',\n 'JSON Schema Type',\n 'Additional JSON Schema',\n 'Defined in',\n 'Notes',\n ]\n table_text = _generate_table_heading(col_names)\n\n with (THIS_DIR / 'schema_mappings.toml').open('rb') as f:\n table = tomli.load(f)\n\n for t in table.values():\n py_type = t['py_type']\n json_type = t['json_type']\n additional = t['additional']\n defined_in = t['defined_in']\n notes = t['notes']\n if additional and not isinstance(additional, str):\n additional = json.dumps(additional)\n cols = [f'`{py_type}`', f'`{json_type}`', f'`{additional}`' if additional else '', defined_in, notes]\n table_text += _generate_table_row(cols)\n\n return re.sub(r'{{ *schema_mappings_table *}}', table_text, markdown)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_conversion_table_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_conversion_table_", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 243, "span_ids": ["build_conversion_table", "devtools_example"], "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 build_conversion_table(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'usage/conversion_table.md':\n return None\n\n col_names = [\n 'Field Type',\n 'Input',\n 'Mode',\n 'Input Source',\n 'Conditions',\n ]\n table_text = _generate_table_heading(col_names)\n\n for row in table:\n cols = [\n f'`{row.field_type.__name__}`' if hasattr(row.field_type, '__name__') else f'`{row.field_type}`',\n f'`{row.input_type.__name__}`' if hasattr(row.input_type, '__name__') else f'`{row.input_type}`',\n row.mode,\n row.input_format,\n row.condition if row.condition else '',\n ]\n table_text += _generate_table_row(cols)\n\n return re.sub(r'{{ *conversion_table *}}', table_text, markdown)\n\n\ndef devtools_example(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'usage/devtools.md':\n return None\n\n html = (THIS_DIR / 'devtools_output.html').read_text().strip('\\n')\n full_html = f'
\\n
{html}
\\n
'\n return re.sub(r'{{ *devtools_example *}}', full_html, markdown)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py_from_pydantic_core_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py_from_pydantic_core_import_", "embedding": null, "metadata": {"file_path": "pydantic/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 130, "span_ids": ["imports"], "tokens": 722}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 pydantic_core import ValidationError\nfrom pydantic_core.core_schema import (\n FieldSerializationInfo,\n FieldValidationInfo,\n SerializationInfo,\n SerializerFunctionWrapHandler,\n ValidationInfo,\n ValidatorFunctionWrapHandler,\n)\n\nfrom . import dataclasses\nfrom .analyzed_type import AnalyzedType\nfrom .config import BaseConfig, ConfigDict, Extra\nfrom .decorator import validate_arguments\nfrom .decorators import field_serializer, field_validator, model_serializer, root_validator, validator\nfrom .errors import *\nfrom .fields import Field, PrivateAttr\nfrom .main import *\nfrom .networks import *\nfrom .tools import *\nfrom .types import *\nfrom .version import VERSION\n\n__version__ = VERSION\n\n# WARNING __all__ from .errors is not included here, it will be removed as an export here in v2\n# please use \"from pydantic.errors import ...\" instead\n__all__ = [\n 'AnalyzedType',\n # dataclasses\n 'dataclasses',\n # decorators\n 'root_validator',\n 'validator',\n 'field_validator',\n 'field_serializer',\n 'model_serializer',\n 'ValidationInfo',\n 'FieldValidationInfo',\n 'SerializationInfo',\n 'FieldSerializationInfo',\n 'ValidatorFunctionWrapHandler',\n 'SerializerFunctionWrapHandler',\n # config\n 'BaseConfig',\n 'ConfigDict',\n 'Extra',\n # decorator\n 'validate_arguments',\n # error_wrappers\n 'ValidationError',\n 'PydanticUserError',\n 'PydanticSchemaGenerationError',\n 'PydanticUndefinedAnnotation',\n # fields\n 'Field',\n # main\n 'BaseModel',\n 'create_model',\n # network\n 'AnyUrl',\n 'AnyHttpUrl',\n 'FileUrl',\n 'HttpUrl',\n 'UrlConstraints',\n 'EmailStr',\n 'NameEmail',\n 'IPvAnyAddress',\n 'IPvAnyInterface',\n 'IPvAnyNetwork',\n 'PostgresDsn',\n 'CockroachDsn',\n 'AmqpDsn',\n 'RedisDsn',\n 'MongoDsn',\n 'KafkaDsn',\n 'MySQLDsn',\n 'MariaDBDsn',\n 'validate_email',\n # tools\n 'parse_obj_as',\n 'schema_of',\n 'schema_json_of',\n # types\n 'Strict',\n 'StrictStr',\n 'conbytes',\n 'conlist',\n 'conset',\n 'confrozenset',\n 'constr',\n 'ImportString',\n 'conint',\n 'PositiveInt',\n 'NegativeInt',\n 'NonNegativeInt',\n 'NonPositiveInt',\n 'confloat',\n 'PositiveFloat',\n 'NegativeFloat',\n 'NonNegativeFloat',\n 'NonPositiveFloat',\n 'FiniteFloat',\n 'condecimal',\n 'condate',\n 'UUID1',\n 'UUID3',\n 'UUID4',\n 'UUID5',\n 'FilePath',\n 'DirectoryPath',\n 'Json',\n 'SecretField',\n 'SecretStr',\n 'SecretBytes',\n 'StrictBool',\n 'StrictBytes',\n 'StrictInt',\n 'StrictFloat',\n 'PaymentCardNumber',\n 'PrivateAttr',\n 'ByteSize',\n 'PastDate',\n 'FutureDate',\n 'AwareDatetime',\n 'NaiveDatetime',\n # version\n '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_pydantic__pydantic/pydantic/_hypothesis_plugin.py____CSS3_Colors_as_name_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py____CSS3_Colors_as_name_h", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 90, "span_ids": ["docstring:11", "docstring"], "tokens": 910}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 MESS AND NEEDS TO BE REWRITTEN, SORRY ZAC.\n\nRegister Hypothesis strategies for Pydantic custom types.\n\nThis enables fully-automatic generation of test data for most Pydantic classes.\n\nNote that this module has *no* runtime impact on Pydantic itself; instead it\nis registered as a setuptools entry point and Hypothesis will import it if\nPydantic is installed. See also:\n\nhttps://hypothesis.readthedocs.io/en/latest/strategies.html#registering-strategies-via-setuptools-entry-points\nhttps://hypothesis.readthedocs.io/en/latest/data.html#hypothesis.strategies.register_type_strategy\nhttps://hypothesis.readthedocs.io/en/latest/strategies.html#interaction-with-pytest-cov\nhttps://docs.pydantic.dev/usage/types/#pydantic-types\n\nNote that because our motivation is to *improve user experience*, the strategies\nare always sound (never generate invalid data) but sacrifice completeness for\nmaintainability (ie may be unable to generate some tricky but valid data).\n\nFinally, this module makes liberal use of `# type: ignore[]` pragmas.\nThis is because Hypothesis annotates `register_type_strategy()` with\n`(T, SearchStrategy[T])`, but in most cases we register e.g. `ConstrainedInt`\nto generate instances of the builtin `int` type which match the constraints.\n\"\"\"\n\nimport contextlib\nimport datetime\nimport ipaddress\nimport json\nimport math\nfrom fractions import Fraction\nfrom typing import Callable, Dict, Type, TypeVar, Union, overload\n\nimport hypothesis.strategies as st\n\nimport pydantic\nimport pydantic.color\nimport pydantic.types\n\nfrom ._internal._utils import lenient_issubclass\n\n# FilePath and DirectoryPath are explicitly unsupported, as we'd have to create\n# them on-disk, and that's unsafe in general without being told *where* to do so.\n#\n# URLs are unsupported because it's easy for users to define their own strategy for\n# \"normal\" URLs, and hard for us to define a general strategy which includes \"weird\"\n# URLs but doesn't also have unpredictable performance problems.\n#\n# conlist() and conset() are unsupported for now, because the workarounds for\n# Cython and Hypothesis to handle parametrized generic types are incompatible.\n# Once Cython can support 'normal' generics we'll revisit this.\n\n# Emails\ntry:\n import email_validator\nexcept ImportError: # pragma: no cover\n pass\nelse:\n\n def is_valid_email(s: str) -> bool:\n # Hypothesis' st.emails() occasionally generates emails like 0@A0--0.ac\n # that are invalid according to email-validator, so we filter those out.\n try:\n email_validator.validate_email(s, check_deliverability=False)\n return True\n except email_validator.EmailNotValidError: # pragma: no cover\n return False\n\n # Note that these strategies deliberately stay away from any tricky Unicode\n # or other encoding issues; we're just trying to generate *something* valid.\n st.register_type_strategy(pydantic.EmailStr, st.emails().filter(is_valid_email)) # type: ignore[arg-type]\n st.register_type_strategy(\n pydantic.NameEmail,\n st.builds(\n '{} <{}>'.format, # type: ignore[arg-type]\n st.from_regex('[A-Za-z0-9_]+( [A-Za-z0-9_]+){0,5}', fullmatch=True),\n st.emails().filter(is_valid_email),\n ),\n )\n\n# # PyObject - dotted names, in this case taken from the math module.\n# st.register_type_strategy(\n# pydantic.PyObject, # type: ignore[arg-type]\n# st.sampled_from(\n# [cast(pydantic.PyObject, f'math.{name}') for name in sorted(vars(math)) if not name.startswith('_')]\n# ),\n# )\n\n# CSS3 Colors; as name, hex, rgb(a) tuples or strings, or hsl strings\nst.register_type_strategy(pydantic.SecretStr, st.text().map(pydantic.SecretStr))\nst.register_type_strategy(pydantic.Json, resolve_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_pydantic__pydantic/pydantic/_hypothesis_plugin.py__color_regexes_None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__color_regexes_None_5", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 159, "span_ids": ["impl:11", "impl:9", "add_luhn_digit", "docstring:11"], "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": "#\n_color_regexes = (\n '|'.join(\n (\n pydantic.color.r_hex_short,\n pydantic.color.r_hex_long,\n pydantic.color.r_rgb,\n pydantic.color.r_hsl,\n )\n )\n # Use more precise regex patterns to avoid value-out-of-range errors\n .replace(pydantic.color._r_sl, r'(?:(\\d\\d?(?:\\.\\d+)?|100(?:\\.0+)?)%)')\n .replace(pydantic.color._r_alpha, r'(?:(0(?:\\.\\d+)?|1(?:\\.0+)?|\\.\\d+|\\d{1,2}%))')\n .replace(pydantic.color._r_255, r'(?:((?:\\d|\\d\\d|[01]\\d\\d|2[0-4]\\d|25[0-4])(?:\\.\\d+)?|255(?:\\.0+)?))')\n)\nst.register_type_strategy(\n pydantic.color.Color,\n st.one_of(\n st.sampled_from(sorted(pydantic.color.COLORS_BY_NAME)),\n st.tuples(\n st.integers(0, 255),\n st.integers(0, 255),\n st.integers(0, 255),\n st.none() | st.floats(0, 1) | st.floats(0, 100).map('{}%'.format),\n ),\n st.from_regex(_color_regexes, fullmatch=True),\n ),\n)\n\n\n# Card numbers, valid according to the Luhn algorithm\n\n\ndef add_luhn_digit(card_number: str) -> str:\n # See https://en.wikipedia.org/wiki/Luhn_algorithm\n for digit in '0123456789':\n with contextlib.suppress(Exception):\n pydantic.PaymentCardNumber.validate_luhn_check_digit(card_number + digit)\n return card_number + digit\n raise AssertionError('Unreachable') # pragma: no cover\n\n\ncard_patterns = (\n # Note that these patterns omit the Luhn check digit; that's added by the function above\n '4[0-9]{14}', # Visa\n '5[12345][0-9]{13}', # Mastercard\n '3[47][0-9]{12}', # American Express\n '[0-26-9][0-9]{10,17}', # other (incomplete to avoid overlap)\n)\nst.register_type_strategy(\n pydantic.PaymentCardNumber,\n st.from_regex('|'.join(card_patterns), fullmatch=True).map(add_luhn_digit), # type: ignore[arg-type]\n)\n\n# UUIDs\n# st.register_type_strategy(pydantic.UUID1, st.uuids(version=1))\n# st.register_type_strategy(pydantic.UUID3, st.uuids(version=3))\n# st.register_type_strategy(pydantic.UUID4, st.uuids(version=4))\n# st.register_type_strategy(pydantic.UUID5, st.uuids(version=5))\n\n# Secrets\nst.register_type_strategy(pydantic.SecretBytes, st.binary().map(pydantic.SecretBytes))\nst.register_type_strategy(pydantic.SecretStr, st.text().map(pydantic.SecretStr))\n\n# IP addresses, networks, and interfaces\nst.register_type_strategy(pydantic.IPvAnyAddress, st.ip_addresses()) # type: ignore[arg-type]\nst.register_type_strategy(\n pydantic.IPvAnyInterface,\n st.from_type(ipaddress.IPv4Interface) | st.from_type(ipaddress.IPv6Interface), # type: ignore[arg-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_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_6__registered_2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_6__registered_2.pass", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 188, "span_ids": ["impl:11", "_registered_2", "impl:19", "_registered"], "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": "st.register_type_strategy(\n pydantic.IPvAnyNetwork,\n st.from_type(ipaddress.IPv4Network) | st.from_type(ipaddress.IPv6Network), # type: ignore[arg-type]\n)\n\n# We hook into the con***() functions and the ConstrainedNumberMeta metaclass,\n# so here we only have to register subclasses for other constrained types which\n# don't go via those mechanisms. Then there are the registration hooks below.\n# st.register_type_strategy(pydantic.StrictBool, st.booleans())\n# st.register_type_strategy(pydantic.StrictStr, st.text())\n\n\n# Constrained-type resolver functions\n#\n# For these ones, we actually want to inspect the type in order to work out a\n# satisfying strategy. First up, the machinery for tracking resolver functions:\n\nRESOLVERS: Dict[type, Callable[[type], st.SearchStrategy]] = {} # type: ignore[type-arg]\nT = TypeVar('T')\n\n\n@overload\ndef _registered(typ: Type[T]) -> Type[T]:\n pass\n\n\n@overload\ndef _registered(typ: pydantic.types) -> pydantic.types:\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_pydantic__pydantic/pydantic/_hypothesis_plugin.py__registered_3_resolves.return.inner": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__registered_3_resolves.return.inner", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 211, "span_ids": ["resolves", "_registered_3"], "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 _registered(typ: Union[Type[T]]) -> Union[Type[T]]:\n # This function replaces the version in `pydantic.types`, in order to\n # effect the registration of new constrained types so that Hypothesis\n # can generate valid examples.\n pydantic.types._DEFINED_TYPES.add(typ)\n for supertype, resolver in RESOLVERS.items():\n if issubclass(typ, supertype):\n st.register_type_strategy(typ, resolver(typ))\n return typ\n raise NotImplementedError(f'Unknown type {typ!r} has no resolver to register') # pragma: no cover\n\n\ndef resolves(\n typ: Union[type],\n) -> Callable[[Callable[..., st.SearchStrategy]], Callable[..., st.SearchStrategy]]: # type: ignore[type-arg]\n def inner(f): # type: ignore\n assert f not in RESOLVERS\n RESOLVERS[typ] = f\n return f\n\n return 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_pydantic__pydantic/pydantic/_hypothesis_plugin.py__Type_to_strategy_resolv_resolve_json.return.st_builds_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__Type_to_strategy_resolv_resolve_json.return.st_builds_", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 234, "span_ids": ["resolve_json", "resolves"], "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": "# Type-to-strategy resolver functions\n\n\n# @resolves(pydantic.JsonWrapper)\ndef resolve_json(cls): # type: ignore[no-untyped-def]\n try:\n inner = st.none() if cls.inner_type is None else st.from_type(cls.inner_type)\n except Exception: # pragma: no cover\n finite = st.floats(allow_infinity=False, allow_nan=False)\n inner = st.recursive(\n base=st.one_of(st.none(), st.booleans(), st.integers(), finite, st.text()),\n extend=lambda x: st.lists(x) | st.dictionaries(st.text(), x), # type: ignore\n )\n inner_type = getattr(cls, 'inner_type', None)\n return st.builds(\n cls.inner_type.json if lenient_issubclass(inner_type, pydantic.BaseModel) else json.dumps,\n inner,\n ensure_ascii=st.booleans(),\n indent=st.none() | st.integers(0, 16),\n sort_keys=st.booleans(),\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_pydantic__pydantic/pydantic/_hypothesis_plugin.py__resolves_pydantic_Cons_resolve_conbytes.return.st_from_regex_pattern_enc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py__resolves_pydantic_Cons_resolve_conbytes.return.st_from_regex_pattern_enc", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 255, "span_ids": ["resolve_json", "resolve_conbytes"], "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": "# @resolves(pydantic.ConstrainedBytes)\ndef resolve_conbytes(cls): # type: ignore[no-untyped-def] # pragma: no cover\n min_size = cls.min_length or 0\n max_size = cls.max_length\n if not cls.strip_whitespace:\n return st.binary(min_size=min_size, max_size=max_size)\n # Fun with regex to ensure we neither start nor end with whitespace\n repeats = '{{{},{}}}'.format(\n min_size - 2 if min_size > 2 else 0,\n max_size - 2 if (max_size or 0) > 2 else '',\n )\n if min_size >= 2:\n pattern = rf'\\W.{repeats}\\W'\n elif min_size == 1:\n pattern = rf'\\W(.{repeats}\\W)?'\n else:\n assert min_size == 0\n pattern = rf'(\\W(.{repeats}\\W)?)?'\n return st.from_regex(pattern.encode(), fullmatch=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_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_42_resolve_condecimal.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_42_resolve_condecimal.return.s", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 273, "span_ids": ["resolve_conbytes", "resolve_condecimal"], "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": "# @resolves(pydantic.ConstrainedDecimal)\ndef resolve_condecimal(cls): # type: ignore[no-untyped-def]\n min_value = cls.ge\n max_value = cls.le\n if cls.gt is not None:\n assert min_value is None, 'Set `gt` or `ge`, but not both'\n min_value = cls.gt\n if cls.lt is not None:\n assert max_value is None, 'Set `lt` or `le`, but not both'\n max_value = cls.lt\n s = st.decimals(min_value, max_value, allow_nan=False, places=cls.decimal_places)\n if cls.lt is not None:\n s = s.filter(lambda d: d < cls.lt)\n if cls.gt is not None:\n s = s.filter(lambda d: cls.gt < d)\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_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_43_resolve_confloat.return.st_integers_min_value_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_43_resolve_confloat.return.st_integers_min_value_ma", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 276, "end_line": 305, "span_ids": ["resolve_condecimal", "resolve_confloat"], "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": "# @resolves(pydantic.ConstrainedFloat)\ndef resolve_confloat(cls): # type: ignore[no-untyped-def]\n min_value = cls.ge\n max_value = cls.le\n exclude_min = False\n exclude_max = False\n\n if cls.gt is not None:\n assert min_value is None, 'Set `gt` or `ge`, but not both'\n min_value = cls.gt\n exclude_min = True\n if cls.lt is not None:\n assert max_value is None, 'Set `lt` or `le`, but not both'\n max_value = cls.lt\n exclude_max = True\n\n if cls.multiple_of is None:\n return st.floats(min_value, max_value, exclude_min=exclude_min, exclude_max=exclude_max, allow_nan=False)\n\n if min_value is not None:\n min_value = math.ceil(min_value / cls.multiple_of)\n if exclude_min:\n min_value = min_value + 1\n if max_value is not None:\n assert max_value >= cls.multiple_of, 'Cannot build model with max value smaller than multiple of'\n max_value = math.floor(max_value / cls.multiple_of)\n if exclude_max:\n max_value = max_value - 1\n\n return st.integers(min_value, max_value).map(lambda x: x * cls.multiple_of)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_44_resolve_conint.return.st_integers_min_value_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_44_resolve_conint.return.st_integers_min_value_ma", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 328, "span_ids": ["resolve_conint", "resolve_confloat"], "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": "# @resolves(pydantic.ConstrainedInt)\ndef resolve_conint(cls): # type: ignore[no-untyped-def]\n min_value = cls.ge\n max_value = cls.le\n if cls.gt is not None:\n assert min_value is None, 'Set `gt` or `ge`, but not both'\n min_value = cls.gt + 1\n if cls.lt is not None:\n assert max_value is None, 'Set `lt` or `le`, but not both'\n max_value = cls.lt - 1\n\n if cls.multiple_of is None or cls.multiple_of == 1:\n return st.integers(min_value, max_value)\n\n # These adjustments and the .map handle integer-valued multiples, while the\n # .filter handles trickier cases as for confloat.\n if min_value is not None:\n min_value = math.ceil(Fraction(min_value) / Fraction(cls.multiple_of))\n if max_value is not None:\n max_value = math.floor(Fraction(max_value) / Fraction(cls.multiple_of))\n return st.integers(min_value, max_value).map(lambda x: x * cls.multiple_of)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_45_resolve_condate.return.st_dates_min_value_max_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_45_resolve_condate.return.st_dates_min_value_max_v", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 331, "end_line": 347, "span_ids": ["resolve_conint", "resolve_condate"], "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": "# @resolves(pydantic.ConstrainedDate)\ndef resolve_condate(cls): # type: ignore[no-untyped-def]\n if cls.ge is not None:\n assert cls.gt is None, 'Set `gt` or `ge`, but not both'\n min_value = cls.ge\n elif cls.gt is not None:\n min_value = cls.gt + datetime.timedelta(days=1)\n else:\n min_value = datetime.date.min\n if cls.le is not None:\n assert cls.lt is None, 'Set `lt` or `le`, but not both'\n max_value = cls.le\n elif cls.lt is not None:\n max_value = cls.lt - datetime.timedelta(days=1)\n else:\n max_value = datetime.date.max\n return st.dates(min_value, max_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_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_46_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_hypothesis_plugin.py_None_46_", "embedding": null, "metadata": {"file_path": "pydantic/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 387, "span_ids": ["impl:23", "resolve_constr", "resolve_condate"], "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": "#\n\n\n# @resolves(pydantic.ConstrainedStr)\ndef resolve_constr(cls): # type: ignore[no-untyped-def] # pragma: no cover\n min_size = cls.min_length or 0\n max_size = cls.max_length\n\n if cls.regex is None and not cls.strip_whitespace:\n return st.text(min_size=min_size, max_size=max_size)\n\n if cls.regex is not None:\n strategy = st.from_regex(cls.regex)\n if cls.strip_whitespace:\n strategy = strategy.filter(lambda s: s == s.strip())\n elif cls.strip_whitespace:\n repeats = '{{{},{}}}'.format(\n min_size - 2 if min_size > 2 else 0,\n max_size - 2 if (max_size or 0) > 2 else '',\n )\n if min_size >= 2:\n strategy = st.from_regex(rf'\\W.{repeats}\\W')\n elif min_size == 1:\n strategy = st.from_regex(rf'\\W(.{repeats}\\W)?')\n else:\n assert min_size == 0\n strategy = st.from_regex(rf'(\\W(.{repeats}\\W)?)?')\n\n if min_size == 0 and max_size is None:\n return strategy\n elif max_size is None:\n return strategy.filter(lambda s: min_size <= len(s))\n return strategy.filter(lambda s: min_size <= len(s) <= max_size)\n\n\n# Finally, register all previously-defined types, and patch in our new function\n# for typ in list(pydantic.types._DEFINED_TYPES):\n# _registered(typ)\npydantic.types._registered = _registered\nst.register_type_strategy(pydantic.Json, resolve_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_pydantic__pydantic/pydantic/_internal/_core_metadata.py_from___future___import_an_CoreMetadata.pydantic_js_prefer_positional_arguments": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_from___future___import_an_CoreMetadata.pydantic_js_prefer_positional_arguments", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["imports", "CoreMetadata"], "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": "from __future__ import annotations as _annotations\n\nimport typing\nimport warnings\nfrom typing import Any\n\nimport typing_extensions\n\nif typing.TYPE_CHECKING:\n from pydantic_core import CoreSchema, core_schema\n\n from ..json_schema import JsonSchemaValue\n\n\nclass CoreMetadata(typing_extensions.TypedDict, total=False):\n # `pydantic_cs_update_function Retrieves the function that will be used to update the CoreSchema.\n # This is generally obtained from a `__pydantic_update_schema__` function\n pydantic_cs_update_function: UpdateCoreSchemaCallable | None\n\n # The pydantic_js_override, if present, is used instead of performing JSON schema generation for this core schema.\n pydantic_js_override: JsonSchemaValue | typing.Callable[[], JsonSchemaValue] | None\n\n # The `pydantic_js_cs_override`, if present, is used as the input schema for JSON schema generation in place\n # of this schema. This will be ignored if js_override is present.\n pydantic_js_cs_override: CoreSchema | typing.Callable[[], CoreSchema] | None\n\n # The `pydantic_js_modify_function`, if present, is called after generating the JSON schema.\n # This is still called on the js_override if that is present, and is also called\n # on the result of generating for the js_cs_override if that is present.\n pydantic_js_modify_function: typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None\n\n # If `pydantic_js_prefer_positional_arguments` is True, the JSON schema generator will\n # prefer positional over keyword arguments for an 'arguments' schema.\n pydantic_js_prefer_positional_arguments: bool | 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_pydantic__pydantic/pydantic/_internal/_core_metadata.py_UpdateCoreSchemaCallable_CoreMetadataHandler.__init__.if_metadata_is_None_.elif_not_isinstance_metad.raise_TypeError_f_CoreSch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_UpdateCoreSchemaCallable_CoreMetadataHandler.__init__.if_metadata_is_None_.elif_not_isinstance_metad.raise_TypeError_f_CoreSch", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 59, "span_ids": ["UpdateCoreSchemaCallable", "CoreMetadataHandler", "UpdateCoreSchemaCallable.__call__", "CoreMetadataHandler.__init__"], "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 UpdateCoreSchemaCallable(typing_extensions.Protocol):\n def __call__(self, schema: CoreSchema, **kwargs: Any) -> None:\n ...\n\n\nclass CoreMetadataHandler:\n \"\"\"\n Because the metadata field in pydantic_core is of type `Any`, we can't assume much about its contents.\n\n This class is used to interact with the metadata field on a CoreSchema object in a consistent\n way throughout pydantic.\n \"\"\"\n\n __slots__ = ('_schema',)\n\n def __init__(self, schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField):\n self._schema = schema\n\n metadata = schema.get('metadata')\n if metadata is None:\n schema['metadata'] = CoreMetadata()\n elif not isinstance(metadata, dict):\n raise TypeError(f'CoreSchema metadata should be a dict; got {metadata!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_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.metadata_CoreMetadataHandler.get_js_cs_override.return.js_cs_override": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.metadata_CoreMetadataHandler.get_js_cs_override.return.js_cs_override", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 84, "span_ids": ["CoreMetadataHandler.metadata", "CoreMetadataHandler.get_js_override", "CoreMetadataHandler.get_js_cs_override"], "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 CoreMetadataHandler:\n\n @property\n def metadata(self) -> CoreMetadata:\n \"\"\"\n Retrieves the metadata dict off the schema, initializing it to a dict if it is None\n and raises an error if it is not a dict.\n \"\"\"\n metadata = self._schema.get('metadata')\n if metadata is None:\n self._schema['metadata'] = metadata = CoreMetadata()\n if not isinstance(metadata, dict):\n raise TypeError(f'CoreSchema metadata should be a dict; got {metadata!r}.')\n return metadata # type: ignore[return-value]\n\n def get_js_override(self) -> JsonSchemaValue | None:\n js_override = self.metadata.get('pydantic_js_override')\n if callable(js_override):\n return js_override()\n return js_override #\n\n def get_js_cs_override(self) -> CoreSchema | None:\n js_cs_override = self.metadata.get('pydantic_js_cs_override')\n if callable(js_cs_override):\n return js_cs_override()\n return js_cs_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_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.compose_js_modify_functions_CoreMetadataHandler.compose_js_modify_functions.self_metadata_pydantic_j": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.compose_js_modify_functions_CoreMetadataHandler.compose_js_modify_functions.self_metadata_pydantic_j", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 102, "span_ids": ["CoreMetadataHandler.compose_js_modify_functions"], "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 CoreMetadataHandler:\n\n def compose_js_modify_functions(\n self, js_modify_function: typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None, inner: bool = False\n ) -> None:\n \"\"\"\n Composes the provided js_modify_function with the existing js_modify_function.\n\n This operation is performed in-place and modifies the wrapped schema's metadata.\n\n If `inner` is True, the provided js_modify_function will be called on the input schema first.\n \"\"\"\n\n if inner:\n outer_func, inner_func = self.metadata.get('pydantic_js_modify_function'), js_modify_function\n else:\n outer_func, inner_func = js_modify_function, self.metadata.get('pydantic_js_modify_function')\n\n self.metadata['pydantic_js_modify_function'] = compose_js_modify_functions(outer_func, inner_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_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.apply_js_modify_function_CoreMetadataHandler.apply_js_modify_function.return.modified_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler.apply_js_modify_function_CoreMetadataHandler.apply_js_modify_function.return.modified_schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 119, "span_ids": ["CoreMetadataHandler.apply_js_modify_function"], "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 CoreMetadataHandler:\n\n def apply_js_modify_function(self, schema: JsonSchemaValue) -> JsonSchemaValue:\n \"\"\"\n Return the result of calling the js_modify_function on the provided JSON schema.\n \"\"\"\n js_modify_function = self.metadata.get('pydantic_js_modify_function')\n if js_modify_function is None:\n return schema\n\n modified_schema = js_modify_function(schema)\n if modified_schema is None:\n warnings.warn(\n f'JSON schema modification function {js_modify_function} returned None; it should return a schema',\n UserWarning,\n )\n modified_schema = schema\n return modified_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_build_metadata_dict_build_metadata_dict.return.metadata": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_build_metadata_dict_build_metadata_dict.return.metadata", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 150, "span_ids": ["build_metadata_dict"], "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 build_metadata_dict(\n *, # force keyword arguments to make it easier to modify this signature in a backwards-compatible way\n cs_update_function: UpdateCoreSchemaCallable | None = None,\n js_override: JsonSchemaValue | typing.Callable[[], JsonSchemaValue] | None = None,\n js_cs_override: CoreSchema | typing.Callable[[], CoreSchema] | None = None,\n js_modify_function: typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None = None,\n js_prefer_positional_arguments: bool | None = None,\n initial_metadata: Any | None = None,\n) -> Any:\n \"\"\"\n Builds a dict to use as the metadata field of a CoreSchema object in a manner that is consistent\n with the CoreMetadataHandler class.\n \"\"\"\n if initial_metadata is not None and not isinstance(initial_metadata, dict):\n raise TypeError(f'CoreSchema metadata should be a dict; got {initial_metadata!r}.')\n\n metadata = CoreMetadata(\n pydantic_cs_update_function=cs_update_function,\n pydantic_js_override=js_override,\n pydantic_js_cs_override=js_cs_override,\n pydantic_js_modify_function=js_modify_function,\n pydantic_js_prefer_positional_arguments=js_prefer_positional_arguments,\n )\n metadata = {k: v for k, v in metadata.items() if v is not None} # type: ignore[assignment]\n\n if initial_metadata is not None:\n metadata = {**initial_metadata, **metadata} # type: ignore[misc]\n\n return metadata", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_compose_js_modify_functions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_compose_js_modify_functions_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 172, "span_ids": ["compose_js_modify_functions"], "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 compose_js_modify_functions(\n outer: typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None,\n inner: typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None,\n) -> typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None:\n \"\"\"\n Composes the provided `outer` and `inner` js_modify_functions.\n\n The `outer` function will be called on the result of calling the `inner` function on the provided schema.\n \"\"\"\n if outer is None:\n return inner\n if inner is None:\n return outer\n\n def combined_js_modify_function(schema: JsonSchemaValue) -> JsonSchemaValue:\n assert outer is not None and inner is not None # for mypy\n return outer(inner(schema))\n\n return combined_js_modify_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_pydantic__pydantic/pydantic/_internal/_core_utils.py__TODO_Should_we_move_Wa_is_list_like_schema_with_items_schema.return.schema_type_in_list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__TODO_Should_we_move_Wa_is_list_like_schema_with_items_schema.return.schema_type_in_list_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 58, "span_ids": ["is_list_like_schema_with_items_schema", "is_core_schema", "is_function_with_inner_schema", "docstring", "is_dataclass_field", "is_typed_dict_field"], "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": "# TODO: Should we move WalkAndApply into pydantic_core proper?\n\nfrom __future__ import annotations\n\nfrom typing import Any, Callable, Union, cast\n\nfrom pydantic_core import CoreSchema, CoreSchemaType, core_schema\nfrom typing_extensions import TypeGuard, get_args\n\nfrom . import _repr\n\nAnyFunctionSchema = Union[\n core_schema.AfterValidatorFunctionSchema,\n core_schema.BeforeValidatorFunctionSchema,\n core_schema.WrapValidatorFunctionSchema,\n core_schema.PlainValidatorFunctionSchema,\n]\n\n\nFunctionSchemaWithInnerSchema = Union[\n core_schema.AfterValidatorFunctionSchema,\n core_schema.BeforeValidatorFunctionSchema,\n core_schema.WrapValidatorFunctionSchema,\n]\n\n_CORE_SCHEMA_FIELD_TYPES = {'typed-dict-field', 'dataclass-field'}\n\n\ndef is_typed_dict_field(\n schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField,\n) -> TypeGuard[core_schema.TypedDictField]:\n return schema['type'] == 'typed-dict-field'\n\n\ndef is_dataclass_field(\n schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField,\n) -> TypeGuard[core_schema.DataclassField]:\n return schema['type'] == 'dataclass-field'\n\n\ndef is_core_schema(\n schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField,\n) -> TypeGuard[CoreSchema]:\n return schema['type'] not in _CORE_SCHEMA_FIELD_TYPES\n\n\ndef is_function_with_inner_schema(\n schema: CoreSchema | core_schema.TypedDictField,\n) -> TypeGuard[FunctionSchemaWithInnerSchema]:\n return is_core_schema(schema) and schema['type'] in ('function-before', 'function-after', 'function-wrap')\n\n\ndef is_list_like_schema_with_items_schema(\n schema: CoreSchema,\n) -> TypeGuard[\n core_schema.ListSchema | core_schema.TupleVariableSchema | core_schema.SetSchema | core_schema.FrozenSetSchema\n]:\n return schema['type'] in ('list', 'tuple-variable', 'set', 'frozenset')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_get_type_ref_get_type_ref.return.type_ref": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_get_type_ref_get_type_ref.return.type_ref", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 86, "span_ids": ["get_type_ref"], "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 get_type_ref(type_: type[Any], args_override: tuple[type[Any], ...] | None = None) -> str:\n \"\"\"\n Produces the ref to be used for this type by pydantic_core's core schemas.\n\n This `args_override` argument was added for the purpose of creating valid recursive references\n when creating generic models without needing to create a concrete class.\n \"\"\"\n origin = getattr(type_, '__pydantic_generic_origin__', None) or type_\n args = getattr(type_, '__pydantic_generic_args__', None) or args_override or ()\n\n module_name = getattr(origin, '__module__', '')\n qualname = getattr(origin, '__qualname__', f'')\n type_ref = f'{module_name}.{qualname}:{id(origin)}'\n\n arg_refs: list[str] = []\n for arg in args:\n if isinstance(arg, str):\n # Handle string literals as a special case; we may be able to remove this special handling if we\n # wrap them in a ForwardRef at some point.\n arg_ref = f'{arg}:str-{id(arg)}'\n else:\n arg_ref = f'{_repr.display_as_type(arg)}:{id(arg)}'\n arg_refs.append(arg_ref)\n if arg_refs:\n type_ref = f'{type_ref}[{\",\".join(arg_refs)}]'\n return type_ref", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_consolidate_refs_consolidate_refs.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_consolidate_refs_consolidate_refs.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 113, "span_ids": ["consolidate_refs"], "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 consolidate_refs(schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n \"\"\"\n This function walks a schema recursively, replacing all but the first occurrence of each ref with\n a definition-ref schema referencing that ref.\n\n This makes the fundamental assumption that any time two schemas have the same ref, occurrences\n after the first can safely be replaced.\n\n In most cases, schemas with the same ref should not actually be produced, or should be completely identical.\n However, as an implementation detail, recursive generic models will emit a non-identical schema deeper in the\n tree with a re-used ref, with the intent that that schema gets replaced with a recursive reference once the\n specific generic parametrization to use can be determined.\n \"\"\"\n refs = set()\n\n def _replace_refs(s: core_schema.CoreSchema) -> core_schema.CoreSchema:\n ref: str | None = s.get('ref') # type: ignore[assignment]\n if ref:\n if ref in refs:\n return {'type': 'definition-ref', 'schema_ref': ref}\n refs.add(ref)\n return s\n\n schema = WalkAndApply(_replace_refs, apply_before_recurse=True).walk(schema)\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_collect_definitions_collect_definitions.return.valid_definitions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_collect_definitions_collect_definitions.return.valid_definitions", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 132, "span_ids": ["collect_definitions"], "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 collect_definitions(schema: core_schema.CoreSchema) -> dict[str, core_schema.CoreSchema]:\n # Only collect valid definitions. This is equivalent to collecting all definitions for \"valid\" schemas,\n # but allows us to reuse this logic while removing \"invalid\" definitions\n valid_definitions = dict()\n\n def _record_valid_refs(s: core_schema.CoreSchema) -> core_schema.CoreSchema:\n ref: str | None = s.get('ref') # type: ignore[assignment]\n if ref:\n metadata = s.get('metadata')\n definition_is_invalid = isinstance(metadata, dict) and 'invalid' in metadata\n if not definition_is_invalid:\n valid_definitions[ref] = s\n return s\n\n WalkAndApply(_record_valid_refs).walk(schema)\n\n return valid_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_pydantic__pydantic/pydantic/_internal/_core_utils.py_remove_unnecessary_invalid_definitions_remove_unnecessary_invalid_definitions.return.WalkAndApply__remove_inva": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_remove_unnecessary_invalid_definitions_remove_unnecessary_invalid_definitions.return.WalkAndApply__remove_inva", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 154, "span_ids": ["remove_unnecessary_invalid_definitions"], "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 remove_unnecessary_invalid_definitions(schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n valid_refs = collect_definitions(schema).keys()\n\n def _remove_invalid_defs(s: core_schema.CoreSchema) -> core_schema.CoreSchema:\n if s['type'] != 'definitions':\n return s\n\n new_schema = s.copy()\n\n new_definitions = []\n for definition in s['definitions']:\n metadata = definition.get('metadata')\n if isinstance(metadata, dict) and 'invalid' in metadata and definition['ref'] in valid_refs:\n continue\n new_definitions.append(definition)\n\n new_schema['definitions'] = new_definitions\n return new_schema\n\n return WalkAndApply(_remove_invalid_defs).walk(schema)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_define_expected_missing_refs_collect_invalid_schemas.return.invalid_schemas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_define_expected_missing_refs_collect_invalid_schemas.return.invalid_schemas", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 190, "span_ids": ["collect_invalid_schemas", "define_expected_missing_refs"], "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 define_expected_missing_refs(\n schema: core_schema.CoreSchema, allowed_missing_refs: set[str]\n) -> core_schema.CoreSchema:\n refs = set()\n\n def _record_refs(s: core_schema.CoreSchema) -> core_schema.CoreSchema:\n ref: str | None = s.get('ref') # type: ignore[assignment]\n if ref:\n refs.add(ref)\n return s\n\n WalkAndApply(_record_refs).walk(schema)\n\n expected_missing_refs = allowed_missing_refs.difference(refs)\n if expected_missing_refs:\n definitions: list[core_schema.CoreSchema] = [\n # TODO: Replace this with a (new) CoreSchema that, if present at any level, makes validation fail\n core_schema.none_schema(ref=ref, metadata={'pydantic_debug_missing_ref': True, 'invalid': True})\n for ref in expected_missing_refs\n ]\n return core_schema.definitions_schema(schema, definitions)\n return schema\n\n\ndef collect_invalid_schemas(schema: core_schema.CoreSchema) -> list[core_schema.CoreSchema]:\n invalid_schemas: list[core_schema.CoreSchema] = []\n\n def _is_schema_valid(s: core_schema.CoreSchema) -> core_schema.CoreSchema:\n if s.get('metadata', {}).get('invalid'):\n invalid_schemas.append(s)\n return s\n\n WalkAndApply(_is_schema_valid).walk(schema)\n return invalid_schemas", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply_WalkAndApply._handle_other_schemas.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply_WalkAndApply._handle_other_schemas.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 226, "span_ids": ["WalkAndApply._walk", "WalkAndApply", "WalkAndApply.__init__", "WalkAndApply._build_schema_type_to_method", "WalkAndApply.walk", "WalkAndApply._handle_other_schemas"], "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 WalkAndApply:\n def __init__(\n self, f: Callable[[core_schema.CoreSchema], core_schema.CoreSchema], apply_before_recurse: bool = True\n ):\n self.f = f\n\n self.apply_before_recurse = apply_before_recurse\n\n self._schema_type_to_method = self._build_schema_type_to_method()\n\n def _build_schema_type_to_method(self) -> dict[CoreSchemaType, Callable[[CoreSchema], CoreSchema]]:\n mapping: dict[CoreSchemaType, Callable[[CoreSchema], CoreSchema]] = {}\n for key in get_args(CoreSchemaType):\n method_name = f\"handle_{key.replace('-', '_')}_schema\"\n mapping[key] = getattr(self, method_name, self._handle_other_schemas)\n return mapping\n\n def walk(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n return self._walk(schema)\n\n def _walk(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n schema = schema.copy()\n if self.apply_before_recurse:\n schema = self.f(schema)\n method = self._schema_type_to_method[schema['type']]\n schema = method(schema)\n if not self.apply_before_recurse:\n schema = self.f(schema)\n return schema\n\n def _handle_other_schemas(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n if 'schema' in schema:\n schema['schema'] = self._walk(schema['schema']) # type: ignore\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_definitions_schema_WalkAndApply.handle_definitions_schema.return.new_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_definitions_schema_WalkAndApply.handle_definitions_schema.return.new_schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 246, "span_ids": ["WalkAndApply.handle_definitions_schema"], "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 WalkAndApply:\n\n def handle_definitions_schema(self, schema: core_schema.DefinitionsSchema) -> CoreSchema:\n new_definitions = []\n for definition in schema['definitions']:\n updated_definition = self._walk(definition)\n if 'ref' in updated_definition:\n # If the updated definition schema doesn't have a 'ref', it shouldn't go in the definitions\n # This is most likely to happen due to replacing something with a definition reference, in\n # which case it should certainly not go in the definitions list\n new_definitions.append(updated_definition)\n new_inner_schema = self._walk(schema['schema'])\n\n if not new_definitions and len(schema) == 3:\n # This means we'd be returning a \"trivial\" definitions schema that just wrapped the inner schema\n return new_inner_schema\n\n new_schema = schema.copy()\n new_schema['schema'] = new_inner_schema\n new_schema['definitions'] = new_definitions\n return new_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_list_schema_WalkAndApply.handle_lax_or_strict_schema.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_list_schema_WalkAndApply.handle_lax_or_strict_schema.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 320, "span_ids": ["WalkAndApply.handle_lax_or_strict_schema", "WalkAndApply.handle_list_schema", "WalkAndApply.handle_generator_schema", "WalkAndApply.handle_chain_schema", "WalkAndApply.handle_dict_schema", "WalkAndApply.handle_frozenset_schema", "WalkAndApply.handle_tuple_variable_schema", "WalkAndApply.handle_function_schema", "WalkAndApply.handle_union_schema", "WalkAndApply.handle_tuple_positional_schema", "WalkAndApply.handle_tagged_union_schema", "WalkAndApply.handle_set_schema"], "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": "class WalkAndApply:\n\n def handle_list_schema(self, schema: core_schema.ListSchema) -> CoreSchema:\n if 'items_schema' in schema:\n schema['items_schema'] = self._walk(schema['items_schema'])\n return schema\n\n def handle_set_schema(self, schema: core_schema.SetSchema) -> CoreSchema:\n if 'items_schema' in schema:\n schema['items_schema'] = self._walk(schema['items_schema'])\n return schema\n\n def handle_frozenset_schema(self, schema: core_schema.FrozenSetSchema) -> CoreSchema:\n if 'items_schema' in schema:\n schema['items_schema'] = self._walk(schema['items_schema'])\n return schema\n\n def handle_generator_schema(self, schema: core_schema.GeneratorSchema) -> CoreSchema:\n if 'items_schema' in schema:\n schema['items_schema'] = self._walk(schema['items_schema'])\n return schema\n\n def handle_tuple_variable_schema(\n self, schema: core_schema.TupleVariableSchema | core_schema.TuplePositionalSchema\n ) -> CoreSchema:\n schema = cast(core_schema.TupleVariableSchema, schema)\n if 'items_schema' in schema:\n # Could drop the # type: ignore on the next line if we made 'mode' required in TupleVariableSchema\n schema['items_schema'] = self._walk(schema['items_schema'])\n return schema\n\n def handle_tuple_positional_schema(\n self, schema: core_schema.TupleVariableSchema | core_schema.TuplePositionalSchema\n ) -> CoreSchema:\n schema = cast(core_schema.TuplePositionalSchema, schema)\n schema['items_schema'] = [self._walk(v) for v in schema['items_schema']]\n if 'extra_schema' in schema:\n schema['extra_schema'] = self._walk(schema['extra_schema'])\n return schema\n\n def handle_dict_schema(self, schema: core_schema.DictSchema) -> CoreSchema:\n if 'keys_schema' in schema:\n schema['keys_schema'] = self._walk(schema['keys_schema'])\n if 'values_schema' in schema:\n schema['values_schema'] = self._walk(schema['values_schema'])\n return schema\n\n def handle_function_schema(\n self,\n schema: AnyFunctionSchema,\n ) -> CoreSchema:\n if not is_function_with_inner_schema(schema):\n return schema\n schema['schema'] = self._walk(schema['schema'])\n return schema\n\n def handle_union_schema(self, schema: core_schema.UnionSchema) -> CoreSchema:\n schema['choices'] = [self._walk(v) for v in schema['choices']]\n return schema\n\n def handle_tagged_union_schema(self, schema: core_schema.TaggedUnionSchema) -> CoreSchema:\n new_choices: dict[str | int, str | int | CoreSchema] = {}\n for k, v in schema['choices'].items():\n new_choices[k] = v if isinstance(v, (str, int)) else self._walk(v)\n schema['choices'] = new_choices\n return schema\n\n def handle_chain_schema(self, schema: core_schema.ChainSchema) -> CoreSchema:\n schema['steps'] = [self._walk(v) for v in schema['steps']]\n return schema\n\n def handle_lax_or_strict_schema(self, schema: core_schema.LaxOrStrictSchema) -> CoreSchema:\n schema['lax_schema'] = self._walk(schema['lax_schema'])\n schema['strict_schema'] = self._walk(schema['strict_schema'])\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_typed_dict_schema_WalkAndApply.handle_typed_dict_schema.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_typed_dict_schema_WalkAndApply.handle_typed_dict_schema.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 322, "end_line": 331, "span_ids": ["WalkAndApply.handle_typed_dict_schema"], "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 WalkAndApply:\n\n def handle_typed_dict_schema(self, schema: core_schema.TypedDictSchema) -> CoreSchema:\n if 'extra_validator' in schema:\n schema['extra_validator'] = self._walk(schema['extra_validator'])\n replaced_fields: dict[str, core_schema.TypedDictField] = {}\n for k, v in schema['fields'].items():\n replaced_field = v.copy()\n replaced_field['schema'] = self._walk(v['schema'])\n replaced_fields[k] = replaced_field\n schema['fields'] = replaced_fields\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_arguments_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_WalkAndApply.handle_arguments_schema_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 351, "span_ids": ["WalkAndApply.handle_call_schema", "WalkAndApply.handle_arguments_schema"], "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 WalkAndApply:\n\n def handle_arguments_schema(self, schema: core_schema.ArgumentsSchema) -> CoreSchema:\n replaced_arguments_schema = []\n for param in schema['arguments_schema']:\n replaced_param = param.copy()\n replaced_param['schema'] = self._walk(param['schema'])\n replaced_arguments_schema.append(replaced_param)\n schema['arguments_schema'] = replaced_arguments_schema\n if 'var_args_schema' in schema:\n schema['var_args_schema'] = self._walk(schema['var_args_schema'])\n if 'var_kwargs_schema' in schema:\n schema['var_kwargs_schema'] = self._walk(schema['var_kwargs_schema'])\n return schema\n\n def handle_call_schema(self, schema: core_schema.CallSchema) -> CoreSchema:\n schema['arguments_schema'] = self._walk(schema['arguments_schema'])\n if 'return_schema' in schema:\n schema['return_schema'] = self._walk(schema['return_schema'])\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py___if_typing_TYPE_CHECKING_.PydanticDataclass.__pydantic_config__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py___if_typing_TYPE_CHECKING_.PydanticDataclass.__pydantic_config__", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_dataclasses.py", "file_name": "_dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "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": "\"\"\"\nPrivate logic for creating pydantic dataclasses.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport typing\nimport warnings\nfrom functools import wraps\nfrom typing import Any, Callable, ClassVar\n\nfrom pydantic_core import ArgsKwargs, SchemaSerializer, SchemaValidator, core_schema\n\nfrom ..config import ConfigDict\nfrom ..errors import PydanticUndefinedAnnotation\nfrom ..fields import FieldInfo\nfrom . import _decorators\nfrom ._core_utils import get_type_ref\nfrom ._fields import collect_fields\nfrom ._forward_ref import PydanticForwardRef\nfrom ._generate_schema import dataclass_schema, generate_config\nfrom ._model_construction import MockValidator\n\n__all__ = 'StandardDataclass', 'PydanticDataclass', 'prepare_dataclass'\n\nif typing.TYPE_CHECKING:\n\n class StandardDataclass(typing.Protocol):\n __dataclass_fields__: ClassVar[dict[str, Any]]\n __dataclass_params__: ClassVar[Any] # in reality `dataclasses._DataclassParams`\n __post_init__: ClassVar[Callable[..., None]]\n\n def __init__(self, *args: object, **kwargs: object) -> None:\n pass\n\n class PydanticDataclass(StandardDataclass, typing.Protocol):\n __pydantic_validator__: typing.ClassVar[SchemaValidator]\n __pydantic_core_schema__: typing.ClassVar[core_schema.CoreSchema]\n __pydantic_serializer__: typing.ClassVar[SchemaSerializer]\n __pydantic_decorators__: typing.ClassVar[_decorators.DecoratorInfos]\n \"\"\"metadata for `@validator`, `@root_validator` and `@serializer` decorators\"\"\"\n __pydantic_fields__: typing.ClassVar[dict[str, FieldInfo]]\n __pydantic_config__: typing.ClassVar[ConfigDict]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_prepare_dataclass_prepare_dataclass.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_prepare_dataclass_prepare_dataclass.return.True", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_dataclasses.py", "file_name": "_dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 120, "span_ids": ["prepare_dataclass"], "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": "def prepare_dataclass(\n cls: type[Any],\n config: ConfigDict,\n kw_only: bool,\n *,\n raise_errors: bool = True,\n types_namespace: dict[str, Any] | None = None,\n) -> bool:\n \"\"\"\n Prepare a raw class to become a pydantic dataclass.\n\n Returns `True` if the validation construction is successfully completed, else `False`.\n\n This logic is called on a class which is yet to be wrapped in `dataclasses.dataclass()`.\n \"\"\"\n if hasattr(cls, '__post_init_post_parse__'):\n warnings.warn(\n 'Support for `__post_init_post_parse__` has been dropped, the method will not be called', DeprecationWarning\n )\n\n name = cls.__name__\n bases = cls.__bases__\n\n dataclass_ref = get_type_ref(cls)\n self_schema = core_schema.definition_reference_schema(dataclass_ref)\n types_namespace = {**(types_namespace or {}), name: PydanticForwardRef(self_schema, cls)}\n try:\n fields, _ = collect_fields(cls, bases, types_namespace, is_dataclass=True, dc_kw_only=kw_only)\n except PydanticUndefinedAnnotation as e:\n if raise_errors:\n raise\n warning_string = (\n f'`{name}` is not fully defined, you should define `{e}`, then call TODO! `methods.rebuild({name})`'\n )\n if config['undefined_types_warning']:\n raise UserWarning(warning_string)\n cls.__pydantic_validator__ = MockValidator(warning_string)\n return False\n\n decorators = cls.__pydantic_decorators__\n\n cls.__pydantic_core_schema__ = schema = dataclass_schema(\n cls,\n dataclass_ref,\n fields,\n decorators,\n config['arbitrary_types_allowed'],\n types_namespace,\n )\n\n core_config = generate_config(config, cls)\n cls.__pydantic_fields__ = fields\n cls.__pydantic_validator__ = validator = SchemaValidator(schema, core_config)\n # this works because cls has been transformed into a dataclass by the time \"cls\" is called\n cls.__pydantic_serializer__ = SchemaSerializer(schema, core_config)\n cls.__pydantic_config__ = config\n\n if config.get('validate_assignment'):\n\n @wraps(cls.__setattr__)\n def validated_setattr(instance: Any, __field: str, __value: str) -> None:\n validator.validate_assignment(instance, __field, __value)\n\n cls.__setattr__ = validated_setattr.__get__(None, cls)\n\n # dataclass.__init__ must be defined here so its `__qualname__` can be changed since functions can't copied.\n\n def __init__(__dataclass_self__: PydanticDataclass, *args: Any, **kwargs: Any) -> None:\n __tracebackhide__ = True\n s = __dataclass_self__\n s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s)\n\n __init__.__qualname__ = f'{cls.__qualname__}.__init__'\n cls.__init__ = __init__\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_pydantic__pydantic/pydantic/_internal/_dataclasses.py_is_builtin_dataclass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_is_builtin_dataclass_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_dataclasses.py", "file_name": "_dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 152, "span_ids": ["is_builtin_dataclass"], "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 is_builtin_dataclass(_cls: type[Any]) -> bool:\n \"\"\"\n Whether a class is a stdlib dataclass\n (useful to discriminated a pydantic dataclass that is actually a wrapper around a stdlib dataclass)\n\n we check that\n - `_cls` is a dataclass\n - `_cls` is not a processed pydantic dataclass (with a basemodel attached)\n - `_cls` is not a pydantic dataclass inheriting directly from a stdlib dataclass\n e.g.\n ```py\n @dataclasses.dataclass\n class A:\n x: int\n\n @pydantic.dataclasses.dataclass\n class B(A):\n y: int\n ```\n In this case, when we first check `B`, we make an extra check and look at the annotations ('y'),\n which won't be a superset of all the dataclass fields (only the stdlib fields i.e. 'x')\n \"\"\"\n import dataclasses\n\n return (\n dataclasses.is_dataclass(_cls)\n and not hasattr(_cls, '__pydantic_validator__')\n and set(_cls.__dataclass_fields__).issuperset(set(getattr(_cls, '__annotations__', {})))\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_pydantic__pydantic/pydantic/_internal/_decorators.py___FIELD_SERIALIZER_TAG.__field_serializer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py___FIELD_SERIALIZER_TAG.__field_serializer_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 47, "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": "\"\"\"\nLogic related to validators applied to models etc. via the `@validator` and `@root_validator` decorators.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport warnings\nfrom inspect import Parameter, Signature, signature\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n Generic,\n Set,\n Tuple,\n TypeVar,\n Union,\n cast,\n overload,\n)\n\nfrom pydantic_core.core_schema import (\n FieldPlainSerializerFunction,\n FieldValidationInfo,\n FieldValidatorFunction,\n FieldWrapSerializerFunction,\n FieldWrapValidatorFunction,\n GeneralPlainSerializerFunction,\n GeneralWrapSerializerFunction,\n JsonReturnTypes,\n SerializationInfo,\n SerializerFunctionWrapHandler,\n ValidationInfo,\n WhenUsed,\n)\nfrom typing_extensions import Protocol, TypeAlias\n\nfrom pydantic._internal._repr import Representation\n\nif TYPE_CHECKING:\n from typing_extensions import Literal\n\n\nFIELD_VALIDATOR_TAG = '_field_validator'\nROOT_VALIDATOR_TAG = '_root_validator'\n\nFIELD_SERIALIZER_TAG = '_field_serializer'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ValidatorDecoratorInfo_ValidatorDecoratorInfo.__init__.self.check_fields.check_fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ValidatorDecoratorInfo_ValidatorDecoratorInfo.__init__.self.check_fields.check_fields", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 84, "span_ids": ["ValidatorDecoratorInfo.__init__", "ValidatorDecoratorInfo"], "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 ValidatorDecoratorInfo(Representation):\n \"\"\"\n A container for data from `@validator` so that we can access it\n while building the pydantic-core schema.\n \"\"\"\n\n __slots__ = 'fields', 'mode', 'each_item', 'always', 'check_fields'\n\n fields: tuple[str, ...]\n mode: Literal['before', 'after']\n each_item: bool\n always: bool\n check_fields: bool | None\n\n def __init__(\n self,\n *,\n fields: tuple[str, ...],\n # pre=True/False in v1 should be converted to mode='before'/'after' in v2\n mode: Literal['before', 'after'],\n each_item: bool,\n always: bool,\n check_fields: bool | None,\n ) -> None:\n \"\"\"\n :param mode: the pydantic-core validator mode.\n :param check_fields: whether to check that the fields actually exist on the model.\n :param each_item: if True this validator gets applied to the internal items of\n lists/sets/dicts instead of the collection itself.\n \"\"\"\n self.fields = fields\n self.mode = mode\n self.each_item = each_item\n self.always = always\n self.check_fields = check_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_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldValidatorDecoratorInfo_RootValidatorDecoratorInfo.__init__.self.mode.mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldValidatorDecoratorInfo_RootValidatorDecoratorInfo.__init__.self.mode.mode", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 134, "span_ids": ["RootValidatorDecoratorInfo.__init__", "FieldValidatorDecoratorInfo", "RootValidatorDecoratorInfo", "FieldValidatorDecoratorInfo.__init__"], "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": "class FieldValidatorDecoratorInfo(Representation):\n \"\"\"\n A container for data from `@field_validator` so that we can access it\n while building the pydantic-core schema.\n \"\"\"\n\n __slots__ = 'fields', 'mode', 'sub_path', 'check_fields'\n\n fields: tuple[str, ...]\n mode: Literal['before', 'after', 'wrap', 'plain']\n sub_path: tuple[str | int, ...] | None\n check_fields: bool | None\n\n def __init__(\n self,\n *,\n fields: tuple[str, ...],\n mode: Literal['before', 'after', 'wrap', 'plain'],\n sub_path: tuple[str | int, ...] | None,\n check_fields: bool | None,\n ) -> None:\n \"\"\"\n :param fields: the fields this validator applies to.\n :param mode: the pydantic-core validator mode.\n :param sub_path: Not yet supported.\n :param check_fields: whether to check that the fields actually exist on the model.\n \"\"\"\n self.fields = fields\n self.mode = mode\n self.sub_path = sub_path\n self.check_fields = check_fields\n\n\nclass RootValidatorDecoratorInfo(Representation):\n \"\"\"\n A container for data from `@root_validator` so that we can access it\n while building the pydantic-core schema.\n \"\"\"\n\n def __init__(\n self,\n *,\n mode: Literal['before', 'after'],\n ) -> None:\n \"\"\"\n :param mode: the pydantic-core validator mode\n \"\"\"\n self.mode = 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_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldSerializerDecoratorInfo_FieldSerializerDecoratorInfo.__init__.self.type.type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldSerializerDecoratorInfo_FieldSerializerDecoratorInfo.__init__.self.type.type", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 170, "span_ids": ["FieldSerializerDecoratorInfo.__init__", "FieldSerializerDecoratorInfo"], "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 FieldSerializerDecoratorInfo(Representation):\n \"\"\"\n A container for data from `@field_serializer` so that we can access it\n while building the pydantic-core schema.\n \"\"\"\n\n __slots__ = 'fields', 'sub_path', 'mode', 'json_return_type', 'when_used', 'check_fields', 'type'\n\n fields: tuple[str, ...]\n mode: Literal['plain', 'wrap']\n type: Literal['general', 'field']\n json_return_type: JsonReturnTypes | None\n when_used: WhenUsed\n sub_path: tuple[str | int, ...] | None\n check_fields: bool | None\n\n def __init__(\n self,\n *,\n fields: tuple[str, ...],\n mode: Literal['plain', 'wrap'],\n type: Literal['general', 'field'],\n json_return_type: JsonReturnTypes | None = None,\n when_used: WhenUsed = 'always',\n sub_path: tuple[str | int, ...] | None = None,\n check_fields: bool | None = None,\n ) -> None:\n self.fields = fields\n self.sub_path = sub_path\n self.mode = mode\n self.json_return_type = json_return_type\n self.when_used = when_used\n self.check_fields = check_fields\n 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_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelSerializerDecoratorInfo_DecoratedType._Union_classmethod_Return": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelSerializerDecoratorInfo_DecoratedType._Union_classmethod_Return", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 173, "end_line": 203, "span_ids": ["ModelSerializerDecoratorInfo.__init__", "ModelSerializerDecoratorInfo", "impl:8"], "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 ModelSerializerDecoratorInfo(Representation):\n \"\"\"\n A container for data from `@model_serializer` so that we can access it\n while building the pydantic-core schema.\n \"\"\"\n\n __slots__ = 'mode', 'json_return_type', 'when_used'\n\n mode: Literal['plain', 'wrap']\n json_return_type: JsonReturnTypes | None\n\n def __init__(\n self,\n *,\n mode: Literal['plain', 'wrap'],\n json_return_type: JsonReturnTypes | None = None,\n ) -> None:\n self.mode = mode\n self.json_return_type = json_return_type\n\n\nDecoratorInfo = Union[\n ValidatorDecoratorInfo,\n FieldValidatorDecoratorInfo,\n RootValidatorDecoratorInfo,\n FieldSerializerDecoratorInfo,\n ModelSerializerDecoratorInfo,\n]\n\nReturnType = TypeVar('ReturnType')\nDecoratedType: TypeAlias = 'Union[classmethod[ReturnType], staticmethod[ReturnType], Callable[..., ReturnType]]'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_PydanticDecoratorMarker_PydanticDecoratorMarker.__get___2.return.self_wrapped___get___obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_PydanticDecoratorMarker_PydanticDecoratorMarker.__get___2.return.self_wrapped___get___obj_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 239, "span_ids": ["PydanticDecoratorMarker.__get___2", "PydanticDecoratorMarker.__get___1", "PydanticDecoratorMarker", "PydanticDecoratorMarker.__init__", "PydanticDecoratorMarker.__get__"], "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 PydanticDecoratorMarker(Generic[ReturnType], Representation):\n \"\"\"\n Wrap a classmethod, staticmethod or unbound function\n and act as a descriptor that allows us to detect decorated items\n from the class' attributes.\n\n This class' __get__ returns the wrapped item's __get__ result,\n which makes it transparent for classmethods and staticmethods.\n \"\"\"\n\n def __init__(\n self,\n wrapped: DecoratedType[ReturnType],\n decorator_info: DecoratorInfo,\n shim: Callable[[Callable[..., Any]], Callable[..., Any]] | None,\n ) -> None:\n self.wrapped = wrapped\n self.decorator_info = decorator_info\n self.shim = shim\n\n @overload\n def __get__(self, obj: None, objtype: None) -> PydanticDecoratorMarker[ReturnType]:\n ...\n\n @overload\n def __get__(self, obj: object, objtype: type[object]) -> Callable[..., ReturnType]:\n ...\n\n def __get__(\n self, obj: object | None, objtype: type[object] | None = None\n ) -> Callable[..., ReturnType] | PydanticDecoratorMarker[ReturnType]:\n if obj is None:\n return self\n return self.wrapped.__get__(obj, objtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfoType_Decorator.__init__.self.info.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfoType_Decorator.__init__.self.info.info", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 263, "span_ids": ["Decorator.__init__", "impl:14", "Decorator"], "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": "DecoratorInfoType = TypeVar('DecoratorInfoType', bound=DecoratorInfo)\n\n\nclass Decorator(Generic[DecoratorInfoType], Representation):\n \"\"\"\n A generic container class to join together the decorator metadata\n (metadata from decorator itself, which we have when the\n decorator is called but not when we are building the core-schema)\n and the bound function (which we have after the class itself is created).\n \"\"\"\n\n def __init__(\n self,\n cls_var_name: str,\n func: Callable[..., Any],\n unwrapped_func: Callable[..., Any],\n info: DecoratorInfoType,\n ) -> None:\n self.cls_var_name = cls_var_name\n self.func = func\n self.unwrapped_func = unwrapped_func\n self.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_pydantic__pydantic/pydantic/_internal/_decorators.py_AnyDecorator_DecoratorInfos.__init__.self.model_serializer._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_AnyDecorator_DecoratorInfos.__init__.self.model_serializer._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 290, "span_ids": ["impl:16", "DecoratorInfos.__init__", "DecoratorInfos"], "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": "AnyDecorator = Union[\n Decorator[ValidatorDecoratorInfo],\n Decorator[FieldValidatorDecoratorInfo],\n Decorator[RootValidatorDecoratorInfo],\n Decorator[FieldSerializerDecoratorInfo],\n Decorator[ModelSerializerDecoratorInfo],\n]\n\n\nclass DecoratorInfos(Representation):\n # mapping of name in the class namespace to decorator info\n # note that the name in the class namespace is the function or attribute name\n # not the field name!\n validator: dict[str, Decorator[ValidatorDecoratorInfo]]\n field_validator: dict[str, Decorator[FieldValidatorDecoratorInfo]]\n root_validator: dict[str, Decorator[RootValidatorDecoratorInfo]]\n field_serializer: dict[str, Decorator[FieldSerializerDecoratorInfo]]\n model_serializer: dict[str, Decorator[ModelSerializerDecoratorInfo]]\n\n def __init__(self) -> None:\n self.validator = {}\n self.field_validator = {}\n self.root_validator = {}\n self.field_serializer = {}\n self.model_serializer = {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_gather_decorator_functions_gather_decorator_functions.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_gather_decorator_functions_gather_decorator_functions.return.res", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 293, "end_line": 338, "span_ids": ["gather_decorator_functions"], "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": "def gather_decorator_functions(cls: type[Any]) -> DecoratorInfos:\n \"\"\"\n We want to collect all DecFunc instances that exist as\n attributes in the namespace of the class (a BaseModel or dataclass)\n that called us\n But we want to collect these in the order of the bases\n So instead of getting them all from the leaf class (the class that called us),\n we traverse the bases from root (the oldest ancestor class) to leaf\n and collect all of the instances as we go, taking care to replace\n any duplicate ones with the last one we see to mimic how function overriding\n works with inheritance.\n If we do replace any functions we put the replacement into the position\n the replaced function was in; that is, we maintain the order.\n \"\"\"\n\n # reminder: dicts are ordered and replacement does not alter the order\n res = DecoratorInfos()\n for base in cls.__bases__:\n existing = cast(Union[DecoratorInfos, None], getattr(base, '__pydantic_decorators__', None))\n if existing is not None:\n res.validator.update(existing.validator)\n res.field_validator.update(existing.field_validator)\n res.root_validator.update(existing.root_validator)\n res.field_serializer.update(existing.field_serializer)\n res.model_serializer.update(existing.model_serializer)\n\n for var_name, var_value in vars(cls).items():\n if isinstance(var_value, PydanticDecoratorMarker):\n func = var_value.wrapped.__get__(None, cls)\n shimmed_func = var_value.shim(func) if var_value.shim is not None else func\n info = var_value.decorator_info\n if isinstance(info, ValidatorDecoratorInfo):\n res.validator[var_name] = Decorator(var_name, shimmed_func, func, info)\n elif isinstance(info, FieldValidatorDecoratorInfo):\n res.field_validator[var_name] = Decorator(var_name, shimmed_func, func, info)\n elif isinstance(info, RootValidatorDecoratorInfo):\n res.root_validator[var_name] = Decorator(var_name, shimmed_func, func, info)\n elif isinstance(info, FieldSerializerDecoratorInfo):\n res.field_serializer[var_name] = Decorator(var_name, shimmed_func, func, info)\n else:\n assert isinstance(info, ModelSerializerDecoratorInfo)\n res.model_serializer[var_name] = Decorator(var_name, shimmed_func, func, info)\n # replace our marker with the bound, concrete function\n setattr(cls, var_name, func)\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_pydantic__pydantic/pydantic/_internal/_decorators.py__FUNCS_prepare_serializer_decorator.return.function": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py__FUNCS_prepare_serializer_decorator.return.function", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 341, "end_line": 358, "span_ids": ["impl:18", "prepare_serializer_decorator"], "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": "_FUNCS: set[str] = set()\n\n\ndef prepare_serializer_decorator(\n function: Callable[..., Any] | classmethod[Any] | staticmethod[Any], allow_reuse: bool\n) -> Callable[..., Any] | classmethod[Any]:\n \"\"\"\n Warn about validators/serializers with duplicated names since without this, they can be overwritten silently\n which generally isn't the intended behaviour, don't run in ipython (see #312) or if `allow_reuse` is True.\n \"\"\"\n if isinstance(function, staticmethod):\n function = function.__func__\n if not allow_reuse and not in_ipython():\n ref = f'{function.__module__}::{function.__qualname__}'\n if ref in _FUNCS:\n warnings.warn(f'duplicate validator function \"{ref}\"; if this is intended, set `allow_reuse=True`')\n _FUNCS.add(ref)\n return 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_pydantic__pydantic/pydantic/_internal/_decorators.py_unwrap_unbound_methods_ensure_classmethod_based_on_signature.return.function": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_unwrap_unbound_methods_ensure_classmethod_based_on_signature.return.function", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 391, "span_ids": ["unwrap_unbound_methods", "is_classmethod_from_sig", "is_instance_method_from_sig", "ensure_classmethod_based_on_signature"], "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 unwrap_unbound_methods(function: Callable[..., Any] | classmethod[Any] | staticmethod[Any]) -> Callable[..., Any]:\n \"\"\"\n Unwrap unbound classmethods and staticmethods\n \"\"\"\n if isinstance(function, (classmethod, staticmethod)):\n return function.__func__\n return function\n\n\ndef is_classmethod_from_sig(function: Callable[..., Any] | classmethod[Any] | staticmethod[Any]) -> bool:\n sig = signature(unwrap_unbound_methods(function))\n first = next(iter(sig.parameters.values()), None)\n if first and first.name == 'cls':\n return True\n return False\n\n\ndef is_instance_method_from_sig(function: Callable[..., Any] | classmethod[Any] | staticmethod[Any]) -> bool:\n sig = signature(unwrap_unbound_methods(function))\n first = next(iter(sig.parameters.values()), None)\n if first and first.name == 'self':\n return True\n return False\n\n\ndef ensure_classmethod_based_on_signature(\n function: Callable[..., Any] | classmethod[Any] | staticmethod[Any],\n) -> classmethod[Any] | staticmethod[Any] | Callable[..., Any]:\n if not isinstance(function, classmethod) and is_classmethod_from_sig(function):\n return classmethod(function)\n return 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_pydantic__pydantic/pydantic/_internal/_decorators.py_check_for_duplicate_validator_check_for_duplicate_validator.if_not_allow_reuse_and_no._FUNCS_add_ref_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_check_for_duplicate_validator_check_for_duplicate_validator.if_not_allow_reuse_and_no._FUNCS_add_ref_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 406, "span_ids": ["check_for_duplicate_validator"], "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 check_for_duplicate_validator(\n function: Callable[..., Any] | classmethod[Any] | staticmethod[Any], allow_reuse: bool\n) -> None:\n \"\"\"\n Warn about validators with duplicated names since without this, they can be overwritten silently\n which generally isn't the intended behaviour, don't run in ipython (see #312) or if `allow_reuse` is True.\n \"\"\"\n if not allow_reuse and not in_ipython():\n function = unwrap_unbound_methods(function)\n ref = f'{function.__module__}::{function.__qualname__}'\n if ref in _FUNCS:\n warnings.warn(f'duplicate validator function \"{ref}\"; if this is intended, set `allow_reuse=True`')\n _FUNCS.add(ref)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_in_ipython_V1_VALIDATOR_VALID_SIGNATURES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_in_ipython_V1_VALIDATOR_VALID_SIGNATURES._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 480, "span_ids": ["V1ValidatorWithValuesKwOnly", "V1ValidatorWithValuesAndKwargs", "V1ValidatorWithKwargs", "V1ValidatorWithValuesAndKwargs.__call__", "OnlyValueValidator.__call__", "V1ValidatorWithValues.__call__", "V1ValidatorWithValues", "impl:20", "OnlyValueValidator", "V1ValidatorWithKwargs.__call__", "in_ipython", "V1ValidatorWithValuesKwOnly.__call__"], "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": "def in_ipython() -> bool:\n \"\"\"\n Check whether we're in an ipython environment, including jupyter notebooks.\n \"\"\"\n try:\n eval('__IPYTHON__')\n except NameError:\n return False\n else: # pragma: no cover\n return True\n\n\nclass OnlyValueValidator(Protocol):\n \"\"\"\n A simple validator, supported for V1 validators and V2 validators\n \"\"\"\n\n def __call__(self, __value: Any) -> Any:\n ...\n\n\nclass V1ValidatorWithValues(Protocol):\n def __call__(self, __value: Any, values: dict[str, Any]) -> Any:\n ...\n\n\nclass V1ValidatorWithValuesKwOnly(Protocol):\n def __call__(self, __value: Any, *, values: dict[str, Any]) -> Any:\n ...\n\n\nclass V1ValidatorWithKwargs(Protocol):\n def __call__(self, __value: Any, **kwargs: Any) -> Any:\n ...\n\n\nclass V1ValidatorWithValuesAndKwargs(Protocol):\n def __call__(self, __value: Any, values: dict[str, Any], **kwargs: Any) -> Any:\n ...\n\n\nV1Validator = Union[\n V1ValidatorWithValues, V1ValidatorWithValuesKwOnly, V1ValidatorWithKwargs, V1ValidatorWithValuesAndKwargs\n]\n\n\nV1_VALIDATOR_VALID_SIGNATURES = \"\"\"\\\ndef f1(value: Any) -> Any: ...\ndef f2(value: Any, values: Dict[str, Any]) -> Any: ...\n\nclass Model(BaseModel):\n x: int\n\n @validator('x')\n @classmethod # optional\n def val_x1(cls, value: Any) -> Any: ...\n\n @validator('x')\n @classmethod # optional\n def val_x2(cls, value: Any, values: Dict[str, Any]) -> Any: ...\n\n @validator('x')\n @staticmethod # required\n def val_x3(value: Any) -> Any: ...\n\n @validator('x')\n @staticmethod # required\n def val_x4(value: Any, values: Dict[str, Any]) -> Any: ...\n\n val_x5 = validator('x')(f1)\n val_x6 = validator('x')(f2)\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_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_v1_field_validator_make_generic_v1_field_validator.raise_TypeError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_v1_field_validator_make_generic_v1_field_validator.raise_TypeError_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 483, "end_line": 536, "span_ids": ["make_generic_v1_field_validator"], "tokens": 548}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_generic_v1_field_validator(validator: V1Validator) -> FieldValidatorFunction:\n sig = signature(unwrap_unbound_methods(validator))\n positional_params: list[str] = []\n keyword_only_params: list[str] = []\n accepts_kwargs = False\n for param_name, parameter in sig.parameters.items():\n if param_name in ('field', 'config'):\n raise TypeError(\n 'The `field` and `config` parameters are not available in Pydantic V2.'\n ' Please use the `info` parameter instead.'\n ' You can access the configuration via `info.config`,'\n ' but it is a dictionary instead of an object like it was in Pydantic V1.'\n ' The `field` argument is no longer available.'\n )\n if parameter.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD):\n positional_params.append(param_name)\n elif parameter.kind is Parameter.KEYWORD_ONLY:\n keyword_only_params.append(param_name)\n else:\n assert parameter.kind is Parameter.VAR_KEYWORD\n accepts_kwargs = True\n\n accepts_values_kw = (keyword_only_params == ['values'] and len(positional_params) == 1) or (\n len(positional_params) == 2 and positional_params[1] == 'values'\n )\n\n if accepts_kwargs and len(positional_params) == 1:\n # has (v, **kwargs) or (v, values, **kwargs)\n val1 = cast(Union[V1ValidatorWithKwargs, V1ValidatorWithValuesAndKwargs], validator)\n\n def wrapper1(value: Any, info: FieldValidationInfo) -> Any:\n return val1(value, values=info.data)\n\n return wrapper1\n if len(positional_params) == 1 and keyword_only_params == []:\n # (v) -> Any\n val2 = cast(OnlyValueValidator, validator)\n\n def wrapper2(value: Any, _: ValidationInfo) -> Any:\n return val2(value)\n\n return wrapper2\n elif len(positional_params) in (1, 2) and accepts_values_kw:\n # (v, values) -> Any or (v, *, values) -> Any\n val3 = cast(V1ValidatorWithValues, validator)\n\n def wrapper3(value: Any, info: FieldValidationInfo) -> Any:\n return val3(value, values=info.data)\n\n return wrapper3\n raise TypeError(\n f'Unsupported signature for V1 style validator {validator}: {sig} is not supported.'\n f' Valid signatures are:\\n{V1_VALIDATOR_VALID_SIGNATURES}'\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_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_v2_field_validator_make_generic_v2_field_validator_11.return.val2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_v2_field_validator_make_generic_v2_field_validator_11.return.val2", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 539, "end_line": 571, "span_ids": ["make_generic_v2_field_validator_11", "make_generic_v2_field_validator", "make_generic_v2_field_validator_10"], "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": "@overload\ndef make_generic_v2_field_validator(\n validator: FieldWrapValidatorFunction, mode: Literal['wrap']\n) -> FieldWrapValidatorFunction:\n ...\n\n\n@overload\ndef make_generic_v2_field_validator(\n validator: OnlyValueValidator | FieldValidatorFunction, mode: Literal['before', 'after', 'plain']\n) -> FieldValidatorFunction:\n ...\n\n\ndef make_generic_v2_field_validator(\n validator: OnlyValueValidator | FieldValidatorFunction | FieldWrapValidatorFunction, mode: str\n) -> FieldValidatorFunction | FieldWrapValidatorFunction:\n \"\"\"\n In order to support different signatures, including deprecated validator signatures from v1,\n we introspect the function signature and wrap it in a parent function that has a signature\n compatible with pydantic_core\n \"\"\"\n if mode in ('before', 'after', 'plain') and len(signature(validator).parameters) == 1:\n val1 = cast(OnlyValueValidator, validator)\n\n # allow the (v) -> Any signature as a convenience\n def wrapper1(value: Any, info: FieldValidationInfo) -> Any:\n return val1(value)\n\n return wrapper1\n\n val2 = cast(Union[FieldValidatorFunction, FieldWrapValidatorFunction], validator)\n return val2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_RootValidatorValues_V2CoreAfterRootValidator.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_RootValidatorValues_V2CoreAfterRootValidator.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 574, "end_line": 593, "span_ids": ["V1RootValidatorFunction.__call__", "V2CoreAfterRootValidator", "V2CoreBeforeRootValidator.__call__", "V2CoreBeforeRootValidator", "V1RootValidatorFunction", "impl:24", "V2CoreAfterRootValidator.__call__"], "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": "RootValidatorValues = Dict[str, Any]\nRootValidatorFieldsSet = Set[str]\nRootValidatorValuesAndFieldsSet = Tuple[RootValidatorValues, RootValidatorFieldsSet]\n\n\nclass V1RootValidatorFunction(Protocol):\n def __call__(self, __values: RootValidatorValues) -> RootValidatorValues:\n ...\n\n\nclass V2CoreBeforeRootValidator(Protocol):\n def __call__(self, __values: RootValidatorValues, __info: ValidationInfo) -> RootValidatorValues:\n ...\n\n\nclass V2CoreAfterRootValidator(Protocol):\n def __call__(\n self, __values_and_fields_set: RootValidatorValuesAndFieldsSet, __info: ValidationInfo\n ) -> RootValidatorValuesAndFieldsSet:\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_pydantic__pydantic/pydantic/_internal/_decorators.py_make_v1_generic_root_validator_make_v1_generic_root_validator.return._wrapper2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_v1_generic_root_validator_make_v1_generic_root_validator.return._wrapper2", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 596, "end_line": 617, "span_ids": ["make_v1_generic_root_validator"], "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_v1_generic_root_validator(\n validator: V1RootValidatorFunction, pre: bool\n) -> V2CoreBeforeRootValidator | V2CoreAfterRootValidator:\n \"\"\"\n Wrap a V1 style root validator for V2 compatibility\n \"\"\"\n if pre is True:\n # mode='before' for pydantic-core\n def _wrapper1(values: RootValidatorValues, _: ValidationInfo) -> RootValidatorValues:\n return validator(values)\n\n return _wrapper1\n\n # mode='after' for pydantic-core\n def _wrapper2(\n values_and_fields_set: tuple[RootValidatorValues, RootValidatorFieldsSet], _: ValidationInfo\n ) -> tuple[RootValidatorValues, RootValidatorFieldsSet]:\n values, fields_set = values_and_fields_set\n values = validator(values)\n return (values, fields_set)\n\n return _wrapper2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_GenericPlainSerializerFunctionWithoutInfo__VALID_SERIALIZER_SIGNATURES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_GenericPlainSerializerFunctionWithoutInfo__VALID_SERIALIZER_SIGNATURES._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 620, "end_line": 673, "span_ids": ["impl:30"], "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": "GenericPlainSerializerFunctionWithoutInfo = Callable[[Any], Any]\nFieldPlainSerializerFunctionWithoutInfo = Callable[[Any, Any], Any]\nFieldWrapSerializerFunctionWithoutInfo = Callable[[Any, Any, SerializerFunctionWrapHandler], Any]\nGeneralWrapSerializerFunctionWithoutInfo = Callable[[Any, SerializerFunctionWrapHandler], Any]\n\nAnyCoreSerializer = Union[\n FieldPlainSerializerFunction,\n FieldWrapSerializerFunction,\n GeneralPlainSerializerFunction,\n GeneralWrapSerializerFunction,\n]\n\nAnySerializerFunction = Union[\n GenericPlainSerializerFunctionWithoutInfo,\n GeneralWrapSerializerFunctionWithoutInfo,\n AnyCoreSerializer,\n]\n\n\n_VALID_SERIALIZER_SIGNATURES = \"\"\"\\\nValid serializer signatures are:\n\n# an instance method with the default mode or `mode='plain'`\n@serializer('x') # or @serialize('x', mode='plain')\ndef ser_x(self, value: Any, info: pydantic.FieldSerializationInfo): ...\n\n# a static method or free-standing function with the default mode or `mode='plain'`\n@serializer('x') # or @serialize('x', mode='plain')\n@staticmethod\ndef ser_x(value: Any, info: pydantic.FieldSerializationInfo): ...\n# equivalent to\ndef ser_x(value: Any, info: pydantic.FieldSerializationInfo): ...\nserializer('x')(ser_x)\n\n# an instance method with `mode='wrap'`\n@serializer('x', mode='wrap')\ndef ser_x(self, value: Any, nxt: pydantic.SerializerFunctionWrapHandler, info: pydantic.FieldSerializationInfo): ...\n\n# a static method or free-standing function with `mode='wrap'`\n@serializer('x', mode='wrap')\n@staticmethod\ndef ser_x(value: Any, nxt: pydantic.SerializerFunctionWrapHandler, info: pydantic.FieldSerializationInfo): ...\n# equivalent to\ndef ser_x(value: Any, nxt: pydantic.SerializerFunctionWrapHandler, info: pydantic.FieldSerializationInfo): ...\nserializer('x')(ser_x)\n\nFor all of these, you can also choose to omit the `info` argument, for example:\n\n@serializer('x')\ndef ser_x(self, value: Any): ...\n\n@serializer('x', mode='wrap')\ndef ser_x(self, value: Any, handler: pydantic.SerializerFunctionWrapHandler): ...\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_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_field_serializer_make_generic_field_serializer.if_mode_plain_.else_.return.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_field_serializer_make_generic_field_serializer.if_mode_plain_.else_.return.func", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 676, "end_line": 745, "span_ids": ["make_generic_field_serializer"], "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": "def make_generic_field_serializer(\n serializer: AnySerializerFunction, mode: Literal['plain', 'wrap'], type: Literal['field', 'general']\n) -> AnyCoreSerializer:\n \"\"\"\n Wrap serializers to allow ignoring the `info` argument as a convenience.\n \"\"\"\n sig = signature(serializer)\n if is_instance_method_from_sig(serializer):\n # for the errors below to exclude self\n sig = Signature(parameters=list(sig.parameters.values())[1:])\n\n n_positional = sum(\n 1\n for param in sig.parameters.values()\n if param.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD)\n )\n if mode == 'plain':\n if n_positional == 1:\n if type == 'general':\n func1 = cast(GenericPlainSerializerFunctionWithoutInfo, serializer)\n\n def wrap_generic_serializer_single_argument(value: Any, _: SerializationInfo) -> Any:\n return func1(value)\n\n return wrap_generic_serializer_single_argument\n else:\n assert type == 'field'\n func2 = cast(FieldPlainSerializerFunctionWithoutInfo, serializer)\n\n def wrap_field_serializer_single_argument(self: Any, value: Any, _: SerializationInfo) -> Any:\n return func2(self, value)\n\n return wrap_field_serializer_single_argument\n if n_positional != 2:\n raise TypeError(\n f'Unrecognized serializer signature for {serializer} with `mode={mode}`:{sig}\\n'\n f' {_VALID_SERIALIZER_SIGNATURES}'\n )\n func = cast(AnyCoreSerializer, serializer)\n return func\n else:\n assert mode == 'wrap'\n if n_positional == 2:\n if type == 'general':\n func3 = cast(GeneralWrapSerializerFunctionWithoutInfo, serializer)\n\n def wrap_general_serializer_in_wrap_mode(\n value: Any, handler: SerializerFunctionWrapHandler, _: SerializationInfo\n ) -> Any:\n return func3(value, handler)\n\n return wrap_general_serializer_in_wrap_mode\n else:\n assert type == 'field'\n func4 = cast(FieldWrapSerializerFunctionWithoutInfo, serializer)\n\n def wrap_field_serializer_in_wrap_mode(\n self: Any, value: Any, handler: SerializerFunctionWrapHandler, _: SerializationInfo\n ) -> Any:\n return func4(self, value, handler)\n\n return wrap_field_serializer_in_wrap_mode\n\n if n_positional != 3:\n raise TypeError(\n f'Unrecognized serializer signature for {serializer} with `mode={mode}`:{sig}\\n'\n f' {_VALID_SERIALIZER_SIGNATURES}'\n )\n func = cast(AnyCoreSerializer, serializer)\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_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_model_serializer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_make_generic_model_serializer_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 748, "end_line": 789, "span_ids": ["make_generic_model_serializer"], "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 make_generic_model_serializer(\n serializer: AnySerializerFunction, mode: Literal['plain', 'wrap']\n) -> AnyCoreSerializer:\n \"\"\"\n Wrap serializers to allow ignoring the `info` argument as a convenience.\n \"\"\"\n sig = signature(serializer)\n\n n_positional = sum(\n 1\n for param in sig.parameters.values()\n if param.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD)\n )\n if mode == 'plain':\n if n_positional == 1:\n func1 = cast(GenericPlainSerializerFunctionWithoutInfo, serializer)\n\n def wrap_model_serializer_single_argument(value: Any, _: SerializationInfo) -> Any:\n return func1(value)\n\n return wrap_model_serializer_single_argument\n if n_positional != 2:\n raise TypeError(f'Unrecognized serializer signature for {serializer} with `mode={mode}`:{sig}')\n func = cast(AnyCoreSerializer, serializer)\n return func\n else:\n assert mode == 'wrap'\n if n_positional == 2:\n func2 = cast(GeneralWrapSerializerFunctionWithoutInfo, serializer)\n\n def wrap_model_serializer_in_wrap_mode(\n value: Any, handler: SerializerFunctionWrapHandler, _: SerializationInfo\n ) -> Any:\n return func2(value, handler)\n\n return wrap_model_serializer_in_wrap_mode\n\n if n_positional != 3:\n raise TypeError(f'Unrecognized serializer signature for {serializer} with `mode={mode}`:{sig}')\n func = cast(AnyCoreSerializer, serializer)\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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_from___future___import_an_apply_discriminator.return._ApplyInferredDiscriminat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_from___future___import_an_apply_discriminator.return._ApplyInferredDiscriminat", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "apply_discriminator"], "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": "from __future__ import annotations as _annotations\n\nfrom enum import Enum\nfrom typing import Sequence\n\nfrom pydantic_core import core_schema\n\nfrom ..errors import PydanticUserError\nfrom . import _core_utils\nfrom ._core_utils import collect_definitions\n\n\ndef apply_discriminator(\n schema: core_schema.CoreSchema, discriminator: str, definitions: dict[str, core_schema.CoreSchema] | None = None\n) -> core_schema.CoreSchema:\n return _ApplyInferredDiscriminator(discriminator, definitions or {}).apply(schema)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator__ApplyInferredDiscriminator._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator__ApplyInferredDiscriminator._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 31, "span_ids": ["_ApplyInferredDiscriminator"], "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 _ApplyInferredDiscriminator:\n \"\"\"\n This class is used to convert an input schema containing a union schema into one where that union is\n replaced with a tagged-union, with all the associated debugging and performance benefits.\n\n This is done by:\n * Validating that the input schema is compatible with the provided discriminator\n * Introspecting the schema to determine which discriminator values should map to which union choices\n * Handling various edge cases such as 'definitions', 'default', 'nullable' schemas, and more\n\n I have chosen to implement the conversion algorithm in this class, rather than a function,\n to make it easier to maintain state while recursively walking the provided CoreSchema.\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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator.__init____ApplyInferredDiscriminator.__init__.self._used.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator.__init____ApplyInferredDiscriminator.__init__.self._used.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 85, "span_ids": ["_ApplyInferredDiscriminator.__init__"], "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": "class _ApplyInferredDiscriminator:\n\n def __init__(self, discriminator: str, definitions: dict[str, core_schema.CoreSchema]):\n # `discriminator` should be the name of the field which will serve as the discriminator.\n # It must be the python name of the field, and *not* the field's alias. Note that as of now,\n # all members of a discriminated union _must_ use a field with the same name as the discriminator.\n # This may change if/when we expose a way to manually specify the TaggedUnionSchema's choices.\n self.discriminator = discriminator\n\n # `definitions` should contain a mapping of schema ref to schema for all schemas which might\n # be referenced by some choice\n self.definitions = definitions\n\n # `_discriminator_alias` will hold the value, if present, of the alias for the discriminator\n #\n # Note: following the v1 implementation, we currently disallow the use of different aliases\n # for different choices. This is not a limitation of pydantic_core, but if we try to handle\n # this, the inference logic gets complicated very quickly, and could result in confusing\n # debugging challenges for users making subtle mistakes.\n #\n # Rather than trying to do the most powerful inference possible, I think we should eventually\n # expose a way to more-manually control the way the TaggedUnionSchema is constructed through\n # the use of a new type which would be placed as an Annotation on the Union type. This would\n # provide the full flexibility/power of pydantic_core's TaggedUnionSchema where necessary for\n # more complex cases, without over-complicating the inference logic for the common cases.\n self._discriminator_alias: str | None = None\n\n # `_should_be_nullable` indicates whether the converted union has `None` as an allowed value.\n # If `None` is an acceptable value of the (possibly-wrapped) union, we ignore it while\n # constructing the TaggedUnionSchema, but set the `_should_be_nullable` attribute to True.\n # Once we have constructed the TaggedUnionSchema, if `_should_be_nullable` is True, we ensure\n # that the final schema gets wrapped as a NullableSchema. This has the same semantics on the\n # python side, but resolves the issue that `None` cannot correspond to any discriminator values.\n self._should_be_nullable = False\n\n # `_is_nullable` is used to track if the final produced schema will definitely be nullable;\n # we set it to True if the input schema is wrapped in a nullable schema that we know will be preserved\n # as an indication that, even if None is discovered as one of the union choices, we will not need to wrap\n # the final value in another nullable schema.\n #\n # This is more complicated than just checking for the final outermost schema having type 'nullable' thanks\n # to the possible presence of other wrapper schemas such as DefinitionsSchema, WithDefaultSchema, etc.\n self._is_nullable = False\n\n # `_choices_to_handle` serves as a stack of choices to add to the tagged union. Initially, choices\n # from the union in the wrapped schema will be appended to this list, and the recursive choice-handling\n # algorithm may add more choices to this stack as (nested) unions are encountered.\n self._choices_to_handle: list[core_schema.CoreSchema] = []\n\n # `_tagged_union_choices` is built during the call to `apply`, and will hold the choices to be included\n # in the output TaggedUnionSchema that will replace the union from the input schema\n self._tagged_union_choices: dict[str | int, str | int | core_schema.CoreSchema] = {}\n\n # `_used` is changed to True after applying the discriminator to prevent accidental re-use\n self._used = 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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator.apply__ApplyInferredDiscriminator.apply.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator.apply__ApplyInferredDiscriminator.apply.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 104, "span_ids": ["_ApplyInferredDiscriminator.apply"], "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 _ApplyInferredDiscriminator:\n\n def apply(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n \"\"\"\n Return a new CoreSchema based on `schema` that uses a tagged-union with the discriminator provided\n to this class.\n \"\"\"\n old_definitions = collect_definitions(schema)\n assert not self._used\n schema = self._apply_to_root(schema)\n if self._should_be_nullable and not self._is_nullable:\n schema = core_schema.nullable_schema(schema)\n self._used = True\n new_definitions = collect_definitions(schema)\n\n missing_definitions = [v for k, v in old_definitions.items() if k not in new_definitions]\n if missing_definitions:\n schema = core_schema.definitions_schema(schema, missing_definitions)\n\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._apply_to_root__ApplyInferredDiscriminator._apply_to_root.return.core_schema_tagged_union_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._apply_to_root__ApplyInferredDiscriminator._apply_to_root.return.core_schema_tagged_union_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 159, "span_ids": ["_ApplyInferredDiscriminator._apply_to_root"], "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 _ApplyInferredDiscriminator:\n\n def _apply_to_root(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n \"\"\"\n This method handles the outer-most stage of recursion over the input schema:\n unwrapping nullable or definitions schemas, and calling the `_handle_choice`\n method iteratively on the choices extracted (recursively) from the possibly-wrapped union.\n \"\"\"\n if schema['type'] == 'nullable':\n self._is_nullable = True\n wrapped = self._apply_to_root(schema['schema'])\n nullable_wrapper = schema.copy()\n nullable_wrapper['schema'] = wrapped\n return nullable_wrapper\n\n if schema['type'] == 'definitions':\n wrapped = self._apply_to_root(schema['schema'])\n definitions_wrapper = schema.copy()\n definitions_wrapper['schema'] = wrapped\n return definitions_wrapper\n\n if schema['type'] != 'union':\n raise TypeError('`discriminator` can only be used with `Union` type with more than one variant')\n\n if len(schema['choices']) < 2:\n raise TypeError('`discriminator` can only be used with `Union` type with more than one variant')\n\n # Reverse the choices list before extending the stack so that they get handled in the order they occur\n self._choices_to_handle.extend(schema['choices'][::-1])\n while self._choices_to_handle:\n choice = self._choices_to_handle.pop()\n self._handle_choice(choice)\n\n if self._discriminator_alias is not None and self._discriminator_alias != self.discriminator:\n # * We need to annotate `discriminator` as a union here to handle both branches of this conditional\n # * We need to annotate `discriminator` as list[list[str | int]] and not list[list[str]] due to the\n # invariance of list, and because list[list[str | int]] is the type of the discriminator argument\n # to tagged_union_schema below\n # * See the docstring of pydantic_core.core_schema.tagged_union_schema for more details about how to\n # interpret the value of the discriminator argument to tagged_union_schema. (The list[list[str]] here\n # is the appropriate way to provide a list of fallback attributes to check for a discriminator value.)\n discriminator: str | list[list[str | int]] = [[self.discriminator], [self._discriminator_alias]]\n else:\n discriminator = self.discriminator\n return core_schema.tagged_union_schema(\n choices=self._tagged_union_choices,\n discriminator=discriminator,\n custom_error_type=schema.get('custom_error_type'),\n custom_error_message=schema.get('custom_error_message'),\n custom_error_context=schema.get('custom_error_context'),\n strict=False,\n from_attributes=True,\n ref=schema.get('ref'),\n metadata=schema.get('metadata'),\n serialization=schema.get('serialization'),\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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._handle_choice__ApplyInferredDiscriminator._handle_choice.if_choice_type_non.else_.self__set_unique_choice_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._handle_choice__ApplyInferredDiscriminator._handle_choice.if_choice_type_non.else_.self__set_unique_choice_f", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 210, "span_ids": ["_ApplyInferredDiscriminator._handle_choice"], "tokens": 599}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ApplyInferredDiscriminator:\n\n def _handle_choice(self, choice: core_schema.CoreSchema) -> None:\n \"\"\"\n This method handles the \"middle\" stage of recursion over the input schema.\n Specifically, it is responsible for handling each choice of the outermost union\n (and any \"coalesced\" choices obtained from inner unions).\n\n Here, \"handling\" entails:\n * Coalescing nested unions and compatible tagged-unions\n * Tracking the presence of 'none' and 'nullable' schemas occurring as choices\n * Validating that each allowed discriminator value maps to a unique choice\n * Updating the _tagged_union_choices mapping that will ultimately be used to build the TaggedUnionSchema.\n \"\"\"\n if choice['type'] == 'none':\n self._should_be_nullable = True\n elif choice['type'] == 'definitions':\n self._handle_choice(choice['schema'])\n elif choice['type'] == 'nullable':\n self._should_be_nullable = True\n self._handle_choice(choice['schema']) # unwrap the nullable schema\n elif choice['type'] == 'union':\n # Reverse the choices list before extending the stack so that they get handled in the order they occur\n self._choices_to_handle.extend(choice['choices'][::-1])\n elif choice['type'] == 'definition-ref':\n if choice['schema_ref'] not in self.definitions:\n raise ValueError(f\"Missing definition for ref {choice['schema_ref']!r}\")\n self._handle_choice(self.definitions[choice['schema_ref']])\n elif choice['type'] not in {\n 'model',\n 'typed-dict',\n 'tagged-union',\n 'lax-or-strict',\n 'dataclass',\n 'dataclass-args',\n } and not _core_utils.is_function_with_inner_schema(choice):\n # We should eventually handle 'definition-ref' as well\n raise TypeError(\n f'{choice[\"type\"]!r} is not a valid discriminated union variant;'\n ' should be a `BaseModel` or `dataclass`'\n )\n else:\n if choice['type'] == 'tagged-union' and self._is_discriminator_shared(choice):\n # In this case, this inner tagged-union is compatible with the outer tagged-union,\n # and its choices can be coalesced into the outer TaggedUnionSchema.\n subchoices = [x for x in choice['choices'].values() if not isinstance(x, (str, int))]\n # Reverse the choices list before extending the stack so that they get handled in the order they occur\n self._choices_to_handle.extend(subchoices[::-1])\n return\n\n inferred_discriminator_values = self._infer_discriminator_values_for_choice(choice, source_name=None)\n self._set_unique_choice_for_values(choice, inferred_discriminator_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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._is_discriminator_shared__ApplyInferredDiscriminator._is_discriminator_shared.return.inner_discriminator_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._is_discriminator_shared__ApplyInferredDiscriminator._is_discriminator_shared.return.inner_discriminator_se", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 223, "span_ids": ["_ApplyInferredDiscriminator._is_discriminator_shared"], "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 _ApplyInferredDiscriminator:\n\n def _is_discriminator_shared(self, choice: core_schema.TaggedUnionSchema) -> bool:\n \"\"\"\n This method returns a boolean indicating whether the discriminator for the `choice`\n is the same as that being used for the outermost tagged union. This is used to\n determine whether this TaggedUnionSchema choice should be \"coalesced\" into the top level,\n or whether it should be treated as a separate (nested) choice.\n \"\"\"\n inner_discriminator = choice['discriminator']\n return inner_discriminator == self.discriminator or (\n isinstance(inner_discriminator, list)\n and (self.discriminator in inner_discriminator or [self.discriminator] in inner_discriminator)\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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_choice.if_choice_type_def.else_.raise_TypeError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_choice.if_choice_type_def.else_.raise_TypeError_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 286, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_choice"], "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 _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_choice(\n self, choice: core_schema.CoreSchema, source_name: str | None\n ) -> list[str | int]:\n \"\"\"\n This function recurses over `choice`, extracting all discriminator values that should map to this choice.\n\n `model_name` is accepted for the purpose of producing useful error messages.\n \"\"\"\n if choice['type'] == 'definitions':\n return self._infer_discriminator_values_for_choice(choice['schema'], source_name=source_name)\n elif choice['type'] == 'function-plain':\n raise TypeError(\n f'{choice[\"type\"]!r} is not a valid discriminated union variant;'\n ' should be a `BaseModel` or `dataclass`'\n )\n elif _core_utils.is_function_with_inner_schema(choice):\n return self._infer_discriminator_values_for_choice(choice['schema'], source_name=source_name)\n elif choice['type'] == 'lax-or-strict':\n return sorted(\n set(\n self._infer_discriminator_values_for_choice(choice['lax_schema'], source_name=None)\n + self._infer_discriminator_values_for_choice(choice['strict_schema'], source_name=None)\n )\n )\n\n elif choice['type'] == 'tagged-union':\n values: list[str | int] = []\n # Ignore str/int \"choices\" since these are just references to other choices\n subchoices = [x for x in choice['choices'].values() if not isinstance(x, (str, int))]\n for subchoice in subchoices:\n subchoice_values = self._infer_discriminator_values_for_choice(subchoice, source_name=None)\n values.extend(subchoice_values)\n return values\n\n elif choice['type'] == 'union':\n values = []\n for subchoice in choice['choices']:\n subchoice_values = self._infer_discriminator_values_for_choice(subchoice, source_name=None)\n values.extend(subchoice_values)\n return values\n\n elif choice['type'] == 'nullable':\n self._should_be_nullable = True\n return self._infer_discriminator_values_for_choice(choice['schema'], source_name=None)\n\n elif choice['type'] == 'model':\n return self._infer_discriminator_values_for_choice(choice['schema'], source_name=choice['cls'].__name__)\n\n elif choice['type'] == 'dataclass':\n return self._infer_discriminator_values_for_choice(choice['schema'], source_name=choice['cls'].__name__)\n\n elif choice['type'] == 'dataclass-args':\n return self._infer_discriminator_values_for_dataclass_choice(choice, source_name=source_name)\n\n elif choice['type'] == 'typed-dict':\n return self._infer_discriminator_values_for_typed_dict_choice(choice, source_name=source_name)\n\n else:\n raise TypeError(\n f'{choice[\"type\"]!r} is not a valid discriminated union variant;'\n ' should be a `BaseModel` or `dataclass`'\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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice.return.self__infer_discriminator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice.return.self__infer_discriminator", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 299, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice"], "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 _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_typed_dict_choice(\n self, choice: core_schema.TypedDictSchema, source_name: str | None = None\n ) -> list[str | int]:\n \"\"\"\n This method just extracts the _infer_discriminator_values_for_choice logic specific to TypedDictSchema\n for the sake of readability.\n \"\"\"\n source = 'TypedDict' if source_name is None else f'Model {source_name!r}'\n field = choice['fields'].get(self.discriminator)\n if field is None:\n raise PydanticUserError(f'{source} needs a discriminator field for key {self.discriminator!r}')\n return self._infer_discriminator_values_for_field(field, 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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice.return.self__infer_discriminator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice.return.self__infer_discriminator", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 310, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice"], "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 _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_dataclass_choice(\n self, choice: core_schema.DataclassArgsSchema, source_name: str | None = None\n ) -> list[str | int]:\n source = 'DataclassArgs' if source_name is None else f'Dataclass {source_name!r}'\n for field in choice['fields']:\n if field['name'] == self.discriminator:\n break\n else:\n raise PydanticUserError(f'{source} needs a discriminator field for key {self.discriminator!r}')\n return self._infer_discriminator_values_for_field(field, 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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_field__ApplyInferredDiscriminator._infer_discriminator_values_for_field.return.self__infer_discriminator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_field__ApplyInferredDiscriminator._infer_discriminator_values_for_field.return.self__infer_discriminator", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 312, "end_line": 325, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_field"], "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 _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_field(\n self, field: core_schema.TypedDictField | core_schema.DataclassField, source: str\n ) -> list[str | int]:\n alias = field.get('validation_alias', self.discriminator)\n if not isinstance(alias, str):\n raise TypeError(f'Alias {alias!r} is not supported in a discriminated union')\n if self._discriminator_alias is None:\n self._discriminator_alias = alias\n elif self._discriminator_alias != alias:\n raise PydanticUserError(\n f'Aliases for discriminator {self.discriminator!r} must be the same '\n f'(got {alias}, {self._discriminator_alias})'\n )\n return self._infer_discriminator_values_for_inner_schema(field['schema'], 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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema__ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema.if_schema_type_lit.else_.raise_PydanticUserError_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema__ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema.if_schema_type_lit.else_.raise_PydanticUserError_f", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 327, "end_line": 359, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema"], "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 _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_inner_schema(\n self, schema: core_schema.CoreSchema, source: str\n ) -> list[str | int]:\n \"\"\"\n When inferring discriminator values for a field, we typically extract the expected values from a literal schema.\n This function does that, but also handles nested unions and defaults.\n \"\"\"\n if schema['type'] == 'literal':\n values = []\n for v in schema['expected']:\n if isinstance(v, Enum):\n v = v.value\n if not isinstance(v, (str, int)):\n raise TypeError(f'Unsupported value for discriminator field: {v!r}')\n values.append(v)\n return values\n\n elif schema['type'] == 'union':\n # Generally when multiple values are allowed they should be placed in a single `Literal`, but\n # we add this case to handle the situation where a field is annotated as a `Union` of `Literal`s.\n # For example, this lets us handle `Union[Literal['key'], Union[Literal['Key'], Literal['KEY']]]`\n values = []\n for choice in schema['choices']:\n choice_values = self._infer_discriminator_values_for_inner_schema(choice, source)\n values.extend(choice_values)\n return values\n\n elif schema['type'] == 'default':\n # This will happen if the field has a default value; we ignore it while extracting the discriminator values\n return self._infer_discriminator_values_for_inner_schema(schema['schema'], source)\n\n else:\n raise PydanticUserError(f'{source} needs field {self.discriminator!r} to be of type `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_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._set_unique_choice_for_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator._set_unique_choice_for_values_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 385, "span_ids": ["_ApplyInferredDiscriminator._set_unique_choice_for_values"], "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 _ApplyInferredDiscriminator:\n\n def _set_unique_choice_for_values(self, choice: core_schema.CoreSchema, values: Sequence[str | int]) -> None:\n \"\"\"\n This method updates `self.tagged_union_choices` so that all provided (discriminator) `values` map to the\n provided `choice`, validating that none of these values already map to another (different) choice.\n \"\"\"\n primary_value: str | int | None = None\n for discriminator_value in values:\n if discriminator_value in self._tagged_union_choices:\n # It is okay if `value` is already in tagged_union_choices as long as it maps to the same value.\n # Because tagged_union_choices may map values to other values, we need to walk the choices dict\n # until we get to a \"real\" choice, and confirm that is equal to the one assigned.\n existing_choice = self._tagged_union_choices[discriminator_value]\n while isinstance(existing_choice, (str, int)):\n existing_choice = self._tagged_union_choices[existing_choice]\n if existing_choice != choice:\n raise TypeError(\n f'Value {discriminator_value!r} for discriminator '\n f'{self.discriminator!r} mapped to multiple choices'\n )\n elif primary_value is None:\n self._tagged_union_choices[discriminator_value] = choice\n primary_value = discriminator_value\n else:\n self._tagged_union_choices[discriminator_value] = primary_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_pydantic__pydantic/pydantic/_internal/_fields.py___if_TYPE_CHECKING_.FieldInfo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py___if_TYPE_CHECKING_.FieldInfo", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["docstring"], "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": "\"\"\"\nPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport sys\nimport typing\nfrom abc import ABC, abstractmethod\nfrom copy import copy\nfrom typing import TYPE_CHECKING, Any\n\nfrom pydantic_core import core_schema\n\nfrom ._forward_ref import PydanticForwardRef\nfrom ._generics import replace_types\nfrom ._repr import Representation\nfrom ._typing_extra import get_cls_type_hints_lenient, get_type_hints, is_classvar\n\nif TYPE_CHECKING:\n from ..fields import FieldInfo", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_get_type_hints_infer_globalns_get_type_hints_infer_globalns.return.get_type_hints_obj_globa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_get_type_hints_infer_globalns_get_type_hints_infer_globalns.return.get_type_hints_obj_globa", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 37, "span_ids": ["get_type_hints_infer_globalns"], "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 get_type_hints_infer_globalns(\n obj: Any,\n localns: dict[str, Any] | None = None,\n include_extras: bool = False,\n) -> dict[str, Any]:\n module_name = getattr(obj, '__module__', None)\n globalns: dict[str, Any] | None = None\n if module_name:\n try:\n globalns = sys.modules[module_name].__dict__\n except KeyError:\n # happens occasionally, see https://github.com/pydantic/pydantic/issues/2363\n pass\n return get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__UndefinedType_SchemaRef.__init__.self.__pydantic_core_schema__.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__UndefinedType_SchemaRef.__init__.self.__pydantic_core_schema__.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 82, "span_ids": ["PydanticMetadata", "impl:2", "_UndefinedType.__repr__", "PydanticGeneralMetadata", "_UndefinedType.__deepcopy__", "SchemaRef.__init__", "PydanticGeneralMetadata.__init__", "_UndefinedType.__reduce__", "SchemaRef", "_UndefinedType", "_UndefinedType.__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 _UndefinedType:\n \"\"\"\n Singleton class to represent an undefined value.\n \"\"\"\n\n def __repr__(self) -> str:\n return 'PydanticUndefined'\n\n def __copy__(self) -> _UndefinedType:\n return self\n\n def __reduce__(self) -> str:\n return 'Undefined'\n\n def __deepcopy__(self, _: Any) -> _UndefinedType:\n return self\n\n\nUndefined = _UndefinedType()\n\n\nclass PydanticMetadata(Representation):\n \"\"\"\n Base class for annotation markers like `Strict`.\n \"\"\"\n\n __slots__ = ()\n\n\nclass PydanticGeneralMetadata(PydanticMetadata):\n def __init__(self, **metadata: Any):\n self.__dict__ = metadata\n\n\nclass SchemaRef(Representation):\n \"\"\"\n Holds a reference to another schema.\n \"\"\"\n\n __slots__ = ('__pydantic_core_schema__',)\n\n def __init__(self, schema: core_schema.CoreSchema):\n self.__pydantic_core_schema__ = schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_CustomValidator_DC_KW_ONLY.getattr_dataclasses_KW_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_CustomValidator_DC_KW_ONLY.getattr_dataclasses_KW_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 111, "span_ids": ["impl:4", "CustomValidator._update_attrs", "CustomValidator.__pydantic_update_schema__", "CustomValidator", "CustomValidator.__call__"], "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 CustomValidator(ABC):\n \"\"\"\n Used to define functional validators which can be updated with constraints.\n \"\"\"\n\n @abstractmethod\n def __pydantic_update_schema__(self, schema: core_schema.CoreSchema, **constraints: Any) -> None:\n raise NotImplementedError()\n\n @abstractmethod\n def __call__(self, __input_value: Any, __info: core_schema.ValidationInfo) -> Any:\n raise NotImplementedError()\n\n def _update_attrs(self, constraints: dict[str, Any], attrs: set[str] | None = None) -> None:\n \"\"\"\n Utility for updating attributes/slots and raising an error if they don't exist, to be used by\n implementations of `CustomValidator`.\n \"\"\"\n attrs = attrs or set(self.__slots__) # type: ignore[attr-defined]\n for k, v in constraints.items():\n if k not in attrs:\n raise TypeError(f'{k!r} is not a valid constraint for {self.__class__.__name__}')\n setattr(self, k, v)\n\n\n# KW_ONLY is only available in Python 3.10+\nDC_KW_ONLY = getattr(dataclasses, 'KW_ONLY', 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_pydantic__pydantic/pydantic/_internal/_fields.py_collect_fields_collect_fields.class_vars.set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_fields_collect_fields.class_vars.set_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 150, "span_ids": ["collect_fields"], "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": "def collect_fields( # noqa: C901\n cls: type[Any],\n bases: tuple[type[Any], ...],\n types_namespace: dict[str, Any] | None,\n *,\n is_dataclass: bool = False,\n dc_kw_only: bool | None = None,\n) -> tuple[dict[str, FieldInfo], set[str]]:\n \"\"\"\n Collect the fields of:\n * a nascent pydantic model\n * a nascent pydantic dataclass\n * or, a standard library dataclass\n Also collect the names of any ClassVars present in the type hints.\n\n The returned value is a tuple of two items: the fields dict, and the set of ClassVar names.\n\n :param cls: BaseModel or dataclass\n :param bases: parents of the class, generally `cls.__bases__`\n :param types_namespace: optional extra namespace to look for types in\n :param is_dataclass: whether the class is a dataclass, used to decide about kw_only setting\n :param dc_kw_only: whether the whole dataclass is kw_only\n \"\"\"\n from ..fields import FieldInfo\n\n type_hints = get_cls_type_hints_lenient(cls, types_namespace)\n\n # https://docs.python.org/3/howto/annotations.html#accessing-the-annotations-dict-of-an-object-in-python-3-9-and-older\n # annotations is only used for finding fields in parent classes\n annotations = cls.__dict__.get('__annotations__', {})\n fields: dict[str, FieldInfo] = {}\n\n # currently just used for `init=False` dataclass fields, this logic can probably be removed if\n # we simplify this function to not be \"all things to all men\"\n omitted_fields: set[str] | None = getattr(cls, '__pydantic_omitted_fields__', None)\n\n class_vars: set[str] = set()\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_pydantic__pydantic/pydantic/_internal/_fields.py_collect_fields.for_ann_name_ann_type_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_fields.for_ann_name_ann_type_in_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 267, "span_ids": ["collect_fields"], "tokens": 1184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_fields( # noqa: C901\n cls: type[Any],\n bases: tuple[type[Any], ...],\n types_namespace: dict[str, Any] | None,\n *,\n is_dataclass: bool = False,\n dc_kw_only: bool | None = None,\n) -> tuple[dict[str, FieldInfo], set[str]]:\n # ... other code\n for ann_name, ann_type in type_hints.items():\n if is_classvar(ann_type):\n class_vars.add(ann_name)\n continue\n if ann_name.startswith('_') or (omitted_fields and ann_name in omitted_fields):\n continue\n\n if DC_KW_ONLY and ann_type is DC_KW_ONLY:\n # all field fields will be kw_only\n dc_kw_only = True\n continue\n kw_only = dc_kw_only\n\n init_var = False\n if ann_type is dataclasses.InitVar:\n if sys.version_info < (3, 8):\n raise RuntimeError('InitVar is not supported in Python 3.7 as type information is lost')\n\n init_var = True\n ann_type = Any\n elif isinstance(ann_type, dataclasses.InitVar):\n init_var = True\n ann_type = ann_type.type\n\n # when building a generic model with `MyModel[int]`, the generic_origin check makes sure we don't get\n # \"... shadows an attribute\" errors\n generic_origin = getattr(cls, '__pydantic_generic_origin__', None)\n for base in bases:\n if hasattr(base, ann_name):\n if base is generic_origin:\n # Don't error when \"shadowing\" of attributes in parametrized generics\n continue\n if is_dataclass and dataclasses.is_dataclass(base):\n # Don't error when shadowing a field in a parent dataclass\n continue\n raise NameError(\n f'Field name \"{ann_name}\" shadows an attribute in parent \"{base.__qualname__}\"; '\n f'you might want to use a different field name with \"alias=\\'{ann_name}\\'\".'\n )\n\n try:\n default = getattr(cls, ann_name, Undefined)\n if default is Undefined and generic_origin:\n default = (generic_origin.__pydantic_generic_defaults__ or {}).get(ann_name, Undefined)\n if default is Undefined:\n raise AttributeError\n except AttributeError:\n if ann_name in annotations or isinstance(ann_type, PydanticForwardRef):\n field_info = FieldInfo.from_annotation(ann_type)\n else:\n # if field has no default value and is not in __annotations__ this means that it is\n # defined in a base class and we can take it from there\n model_fields_lookup: dict[str, FieldInfo] = {}\n for x in cls.__bases__[::-1]:\n model_fields_lookup.update(getattr(x, 'model_fields', {}))\n if ann_name in model_fields_lookup:\n # The field was present on one of the (possibly multiple) base classes\n # copy the field to make sure typevar substitutions don't cause issues with the base classes\n field_info = copy(model_fields_lookup[ann_name])\n else:\n # The field was not found on any base classes; this seems to be caused by fields not getting\n # generated thanks to models not being fully defined while initializing recursive models.\n # Nothing stops us from just creating a new FieldInfo for this type hint, so we do this.\n field_info = FieldInfo.from_annotation(ann_type)\n else:\n if isinstance(default, dataclasses.Field):\n if not default.init:\n # dataclasses.Field with init=False are not fields\n continue\n if DC_KW_ONLY and default.kw_only is True:\n kw_only = True\n\n field_info = FieldInfo.from_annotated_attribute(ann_type, default)\n # attributes which are fields are removed from the class namespace:\n # 1. To match the behaviour of annotation-only fields\n # 2. To avoid false positives in the NameError check above\n try:\n delattr(cls, ann_name)\n if cls.__pydantic_generic_parameters__: # model can be parametrized\n assert cls.__pydantic_generic_defaults__ is not None\n cls.__pydantic_generic_defaults__[ann_name] = default\n except AttributeError:\n pass # indicates the attribute was on a parent class\n\n if is_dataclass:\n # for dataclasses we preserve the default value if it is set\n # field, e.g. `a: int = 1` gets kept as is\n # and `a: int = field(default=1, repr=False)` gets converted to the above\n if isinstance(default, (dataclasses.Field, FieldInfo)):\n if default.default not in (\n Undefined,\n dataclasses.MISSING,\n ):\n setattr(cls, ann_name, default.default)\n else:\n # not a field default\n setattr(cls, ann_name, default)\n\n if init_var:\n field_info.init_var = True\n if kw_only is not None:\n field_info.kw_only = kw_only\n fields[ann_name] = field_info\n\n typevars_map = getattr(cls, '__pydantic_generic_typevars_map__', None)\n if typevars_map:\n for field in fields.values():\n try:\n field.annotation = typing._eval_type( # type: ignore[attr-defined]\n field.annotation, types_namespace, None\n )\n except NameError:\n pass\n field.annotation = replace_types(field.annotation, typevars_map)\n\n return fields, class_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_pydantic__pydantic/pydantic/_internal/_forward_ref.py_from___future___import_an_PydanticRecursiveRef.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_from___future___import_an_PydanticRecursiveRef.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_forward_ref.py", "file_name": "_forward_ref.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["DeferredReplaceTypes", "imports", "impl:2", "DeferredClassGetitem", "PydanticRecursiveRef.__call__", "PydanticRecursiveRef"], "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": "from __future__ import annotations as _annotations\n\nfrom dataclasses import dataclass, replace\nfrom typing import TYPE_CHECKING, Any, Union\n\nfrom pydantic_core import core_schema\nfrom typing_extensions import Literal, TypedDict\n\nfrom ._typing_extra import TypeVarType\n\nif TYPE_CHECKING:\n from pydantic import BaseModel\n\n\nclass DeferredClassGetitem(TypedDict):\n kind: Literal['class_getitem']\n item: Any\n\n\nclass DeferredReplaceTypes(TypedDict):\n kind: Literal['replace_types']\n typevars_map: dict[TypeVarType, Any]\n\n\nDeferredAction = Union[DeferredClassGetitem, DeferredReplaceTypes]\n\n\n@dataclass\nclass PydanticRecursiveRef:\n type_ref: str\n\n __name__ = 'PydanticRecursiveRef'\n __hash__ = object.__hash__\n\n def __call__(self) -> None:\n \"\"\"\n Defining __call__ is necessary for the `typing` module to let you use an instance of\n this class as the result of resolving a standard ForwardRef\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_pydantic__pydantic/pydantic/_internal/_forward_ref.py_PydanticForwardRef_PydanticForwardRef.replace_types.return.replace_self_deferred_ac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_PydanticForwardRef_PydanticForwardRef.replace_types.return.replace_self_deferred_ac", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_forward_ref.py", "file_name": "_forward_ref.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 69, "span_ids": ["PydanticForwardRef.__call__", "PydanticForwardRef.__getitem__", "PydanticForwardRef", "PydanticForwardRef.replace_types"], "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": "@dataclass\nclass PydanticForwardRef:\n \"\"\"\n No-op marker class for (recursive) type references.\n\n Most of the logic here exists to handle recursive generics.\n \"\"\"\n\n schema: core_schema.CoreSchema\n model: type[BaseModel]\n deferred_actions: tuple[DeferredAction, ...] = ()\n\n __name__ = 'PydanticForwardRef'\n __hash__ = object.__hash__\n\n def __call__(self) -> None:\n \"\"\"\n Defining __call__ is necessary for the `typing` module to let you use an instance of\n this class as the result of resolving a standard ForwardRef\n \"\"\"\n\n def __getitem__(self, item: Any) -> PydanticForwardRef:\n updated_actions = self.deferred_actions + ({'kind': 'class_getitem', 'item': item},)\n return replace(self, deferred_actions=updated_actions)\n\n def replace_types(self, typevars_map: Any) -> PydanticForwardRef:\n updated_actions = self.deferred_actions + ({'kind': 'replace_types', 'typevars_map': typevars_map},)\n return replace(self, deferred_actions=updated_actions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_PydanticForwardRef.resolve_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_PydanticForwardRef.resolve_model_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_forward_ref.py", "file_name": "_forward_ref.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 83, "span_ids": ["PydanticForwardRef.resolve_model"], "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": "@dataclass\nclass PydanticForwardRef:\n\n def resolve_model(self) -> type[BaseModel] | PydanticForwardRef:\n from ._generics import replace_types\n\n model: type[BaseModel] | PydanticForwardRef = self.model\n for action in self.deferred_actions:\n if action['kind'] == 'replace_types':\n model = replace_types(model, action['typevars_map'])\n elif action['kind'] == 'class_getitem':\n model = model[action['item']] # type: ignore[index]\n else:\n raise ValueError(f'Unexpected action: {action}')\n return model", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py___check_validator_fields_against_field_name.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py___check_validator_fields_against_field_name.return.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 73, "span_ids": ["check_validator_fields_against_field_name", "docstring"], "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": "\"\"\"\nConvert python types to pydantic-core schema.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport collections.abc\nimport dataclasses\nimport re\nimport sys\nimport typing\nimport warnings\nfrom itertools import chain\nfrom typing import TYPE_CHECKING, Any, Callable, ForwardRef, Iterable, Mapping, TypeVar, Union\n\nfrom annotated_types import BaseMetadata, GroupedMetadata\nfrom pydantic_core import SchemaError, SchemaValidator, core_schema\nfrom typing_extensions import Annotated, Literal, TypedDict, get_args, get_origin, is_typeddict\n\nfrom ..errors import PydanticSchemaGenerationError, PydanticUndefinedAnnotation, PydanticUserError\nfrom ..fields import FieldInfo\nfrom ..json_schema import JsonSchemaValue, update_json_schema\nfrom . import _discriminated_union, _typing_extra\nfrom ._core_metadata import CoreMetadataHandler, build_metadata_dict\nfrom ._core_utils import (\n consolidate_refs,\n define_expected_missing_refs,\n get_type_ref,\n is_list_like_schema_with_items_schema,\n remove_unnecessary_invalid_definitions,\n)\nfrom ._decorators import (\n Decorator,\n DecoratorInfos,\n FieldSerializerDecoratorInfo,\n FieldValidatorDecoratorInfo,\n ModelSerializerDecoratorInfo,\n RootValidatorDecoratorInfo,\n ValidatorDecoratorInfo,\n)\nfrom ._fields import PydanticGeneralMetadata, PydanticMetadata, Undefined, collect_fields, get_type_hints_infer_globalns\nfrom ._forward_ref import PydanticForwardRef, PydanticRecursiveRef\nfrom ._generics import recursively_defined_type_refs, replace_types\n\nif TYPE_CHECKING:\n from ..config import ConfigDict\n from ..main import BaseModel\n from ._dataclasses import StandardDataclass\n\n__all__ = 'dataclass_schema', 'GenerateSchema', 'generate_config'\n\n_SUPPORTS_TYPEDDICT = sys.version_info >= (3, 11)\n\nFieldDecoratorInfo = Union[ValidatorDecoratorInfo, FieldValidatorDecoratorInfo, FieldSerializerDecoratorInfo]\nFieldDecoratorInfoType = TypeVar('FieldDecoratorInfoType', bound=FieldDecoratorInfo)\nAnyFieldDecorator = Union[\n Decorator[ValidatorDecoratorInfo],\n Decorator[FieldValidatorDecoratorInfo],\n Decorator[FieldSerializerDecoratorInfo],\n]\n\n\ndef check_validator_fields_against_field_name(\n info: FieldDecoratorInfo,\n field: str,\n) -> bool:\n if isinstance(info, ValidatorDecoratorInfo):\n # V1 compat: accept `'*'` as a wildcard that matches all fields\n if info.fields == ('*',):\n return True\n for v_field_name in info.fields:\n if v_field_name == field:\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_check_decorator_fields_exist_filter_field_decorator_info_by_field.return._dec_for_dec_in_validator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_check_decorator_fields_exist_filter_field_decorator_info_by_field.return._dec_for_dec_in_validator", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 95, "span_ids": ["filter_field_decorator_info_by_field", "check_decorator_fields_exist"], "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 check_decorator_fields_exist(decorators: Iterable[AnyFieldDecorator], fields: Iterable[str]) -> None:\n fields = set(fields)\n for dec in decorators:\n if isinstance(dec.info, ValidatorDecoratorInfo) and dec.info.fields == ('*',):\n # V1 compat: accept `'*'` as a wildcard that matches all fields\n continue\n if dec.info.check_fields is False:\n continue\n for field in dec.info.fields:\n if field not in fields:\n raise PydanticUserError(\n f'Validators defined with incorrect fields: {dec.unwrapped_func.__name__}'\n \" (use check_fields=False if you're inheriting from the model and intended this)\"\n )\n\n\ndef filter_field_decorator_info_by_field(\n validator_functions: Iterable[Decorator[FieldDecoratorInfoType]], field: str\n) -> list[Decorator[FieldDecoratorInfoType]]:\n return [dec for dec in validator_functions if check_validator_fields_against_field_name(dec.info, 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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_each_item_validators_apply_each_item_validators.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_each_item_validators_apply_each_item_validators.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 124, "span_ids": ["apply_each_item_validators"], "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": "def apply_each_item_validators(\n schema: core_schema.CoreSchema, each_item_validators: list[Decorator[ValidatorDecoratorInfo]]\n) -> core_schema.CoreSchema:\n # TODO: remove this V1 compatibility shim once it's deprecated\n # push down any `each_item=True` validators\n # note that this won't work for any Annotated types that get wrapped by a function validator\n # but that's okay because that didn't exist in V1\n if schema['type'] == 'nullable':\n schema['schema'] = apply_each_item_validators(schema['schema'], each_item_validators)\n return schema\n elif is_list_like_schema_with_items_schema(schema):\n inner_schema = schema.get('items_schema', None)\n if inner_schema is None:\n inner_schema = core_schema.any_schema()\n schema['items_schema'] = apply_validators(inner_schema, each_item_validators)\n elif schema['type'] == 'dict':\n # push down any `each_item=True` validators onto dict _values_\n # this is super arbitrary but it's the V1 behavior\n inner_schema = schema.get('values_schema', None)\n if inner_schema is None:\n inner_schema = core_schema.any_schema()\n schema['values_schema'] = apply_validators(inner_schema, each_item_validators)\n elif each_item_validators:\n raise TypeError(\n f\"`@validator(..., each_item=True)` cannot be applied to fields with a schema of {schema['type']}\"\n )\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_dataclass_schema_dataclass_schema.return.apply_model_serializers_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_dataclass_schema_dataclass_schema.return.apply_model_serializers_d", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 145, "span_ids": ["dataclass_schema"], "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 dataclass_schema(\n cls: type[Any],\n ref: str,\n fields: dict[str, FieldInfo],\n decorators: DecoratorInfos,\n arbitrary_types: bool,\n types_namespace: dict[str, Any] | None,\n) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a dataclass.\n \"\"\"\n # TODO add typevars_map argument when we support generic dataclasses\n schema_generator = GenerateSchema(arbitrary_types, types_namespace)\n args = [schema_generator.generate_dc_field_schema(k, v, decorators) for k, v in fields.items()]\n has_post_init = hasattr(cls, '__post_init__')\n args_schema = core_schema.dataclass_args_schema(cls.__name__, args, collect_init_only=has_post_init)\n inner_schema = apply_validators(args_schema, decorators.root_validator.values())\n dc_schema = core_schema.dataclass_schema(cls, inner_schema, post_init=has_post_init, ref=ref)\n return apply_model_serializers(dc_schema, decorators.model_serializer.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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_generate_config_generate_config.return.core_config": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_generate_config_generate_config.return.core_config", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 173, "span_ids": ["generate_config"], "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 generate_config(config: ConfigDict, cls: type[Any]) -> core_schema.CoreConfig:\n \"\"\"\n Create a pydantic-core config from a pydantic config.\n \"\"\"\n extra = None if config['extra'] is None else config['extra'].value\n core_config = core_schema.CoreConfig( # type: ignore[misc]\n **core_schema.dict_not_none(\n title=config['title'] or cls.__name__,\n extra_fields_behavior=extra,\n allow_inf_nan=config['allow_inf_nan'],\n populate_by_name=config['populate_by_name'],\n str_strip_whitespace=config['str_strip_whitespace'],\n str_to_lower=config['str_to_lower'],\n str_to_upper=config['str_to_upper'],\n strict=config['strict'],\n ser_json_timedelta=config['ser_json_timedelta'],\n ser_json_bytes=config['ser_json_bytes'],\n from_attributes=config['from_attributes'],\n loc_by_alias=config['loc_by_alias'],\n revalidate_instances=config['revalidate_instances'],\n validate_default=config['validate_default'],\n str_max_length=config.get('str_max_length'),\n str_min_length=config.get('str_min_length'),\n )\n )\n return core_config", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema_GenerateSchema.arbitrary_types.return.self__arbitrary_types_sta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema_GenerateSchema.arbitrary_types.return.self__arbitrary_types_sta", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 191, "span_ids": ["GenerateSchema", "GenerateSchema.__init__", "GenerateSchema.arbitrary_types"], "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 GenerateSchema:\n __slots__ = '_arbitrary_types_stack', 'types_namespace', 'typevars_map', 'recursion_cache', 'definitions'\n\n def __init__(\n self, arbitrary_types: bool, types_namespace: dict[str, Any] | None, typevars_map: dict[Any, Any] | None = None\n ):\n self._arbitrary_types_stack: list[bool] = [arbitrary_types] # we need a stack for recursing into child models\n self.types_namespace = types_namespace\n self.typevars_map = typevars_map\n\n self.recursion_cache: dict[str, core_schema.DefinitionReferenceSchema] = {}\n self.definitions: dict[str, core_schema.CoreSchema] = {}\n\n @property\n def arbitrary_types(self) -> bool:\n return self._arbitrary_types_stack[-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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_schema_GenerateSchema.generate_schema.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_schema_GenerateSchema.generate_schema.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 211, "span_ids": ["GenerateSchema.generate_schema"], "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 GenerateSchema:\n\n def generate_schema(self, obj: Any) -> core_schema.CoreSchema:\n schema = self._generate_schema(obj)\n\n schema = remove_unnecessary_invalid_definitions(schema)\n\n js_modify_function = _get_pydantic_modify_json_schema(obj)\n if js_modify_function is None:\n # Need to do this to handle custom generics:\n if hasattr(obj, '__origin__'):\n js_modify_function = _get_pydantic_modify_json_schema(obj.__origin__)\n\n CoreMetadataHandler(schema).compose_js_modify_functions(js_modify_function)\n\n if 'ref' in schema:\n # definitions and definition-ref schemas don't have 'ref', causing the type error ignored on the next line\n schema_ref = schema['ref'] # type: ignore[typeddict-item]\n self.definitions[schema_ref] = schema\n\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.model_schema_GenerateSchema.model_schema.return.apply_model_serializers_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.model_schema_GenerateSchema.model_schema.return.apply_model_serializers_m", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 260, "span_ids": ["GenerateSchema.model_schema"], "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 GenerateSchema:\n\n def model_schema(self, cls: type[BaseModel]) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a pydantic model.\n \"\"\"\n model_ref = get_type_ref(cls)\n cached_def = self.recursion_cache.get(model_ref)\n if cached_def is not None:\n return cached_def\n\n self.recursion_cache[model_ref] = core_schema.definition_reference_schema(model_ref)\n fields = cls.model_fields\n decorators = cls.__pydantic_decorators__\n check_decorator_fields_exist(\n chain(\n decorators.field_validator.values(),\n decorators.field_serializer.values(),\n decorators.validator.values(),\n ),\n fields.keys(),\n )\n # TODO: we need to do something similar to this for pydantic dataclasses\n # This should be straight forward once we expose the pydantic config on the dataclass;\n # I have done this in my PR for dataclasses JSON schema\n self._arbitrary_types_stack.append(cls.model_config['arbitrary_types_allowed'])\n try:\n fields_schema: core_schema.CoreSchema = core_schema.typed_dict_schema(\n {k: self.generate_td_field_schema(k, v, decorators) for k, v in fields.items()},\n return_fields_set=True,\n )\n finally:\n self._arbitrary_types_stack.pop()\n inner_schema = apply_validators(fields_schema, decorators.root_validator.values())\n\n inner_schema = consolidate_refs(inner_schema)\n inner_schema = define_expected_missing_refs(inner_schema, recursively_defined_type_refs())\n\n core_config = generate_config(cls.model_config, cls)\n model_post_init = '__pydantic_post_init__' if hasattr(cls, '__pydantic_post_init__') else None\n\n model_schema = core_schema.model_schema(\n cls,\n inner_schema,\n ref=model_ref,\n config=core_config,\n post_init=model_post_init,\n metadata=build_metadata_dict(js_modify_function=cls.model_modify_json_schema),\n )\n return apply_model_serializers(model_schema, decorators.model_serializer.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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_from_property_GenerateSchema._generate_schema_from_property.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_from_property_GenerateSchema._generate_schema_from_property.return.None", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 279, "span_ids": ["GenerateSchema._generate_schema_from_property"], "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 GenerateSchema:\n\n def _generate_schema_from_property(self, obj: Any, source: Any) -> core_schema.CoreSchema | None:\n \"\"\"\n Try to generate schema from either the `__get_pydantic_core_schema__` function or\n `__pydantic_core_schema__` property.\n\n Note: `__get_pydantic_core_schema__` takes priority so it can decide whether to use a `__pydantic_core_schema__`\n attribute, or generate a fresh schema.\n \"\"\"\n get_schema = getattr(obj, '__get_pydantic_core_schema__', None)\n if get_schema is not None:\n # Can return None to tell pydantic not to override\n return get_schema(source=source, gen_schema=self)\n\n schema_property = getattr(obj, '__pydantic_core_schema__', None)\n if schema_property is not None:\n return schema_property\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_GenerateSchema._generate_schema.try_.except_TypeError_obj_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_GenerateSchema._generate_schema.try_.except_TypeError_obj_.pass", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 339, "span_ids": ["GenerateSchema._generate_schema"], "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 GenerateSchema:\n\n def _generate_schema(self, obj: Any) -> core_schema.CoreSchema: # noqa: C901\n \"\"\"\n Recursively generate a pydantic-core schema for any supported python type.\n \"\"\"\n if isinstance(obj, str):\n return {'type': obj} # type: ignore[return-value,misc]\n elif isinstance(obj, dict):\n # we assume this is already a valid schema\n return obj # type: ignore[return-value]\n elif isinstance(obj, ForwardRef):\n # we assume that types_namespace has the target of forward references in its scope,\n # but this could fail, for example, if calling Validator on an imported type which contains\n # forward references to other types only defined in the module from which it was imported\n # `Validator(SomeImportedTypeAliasWithAForwardReference)`\n # or the equivalent for BaseModel\n # class Model(BaseModel):\n # x: SomeImportedTypeAliasWithAForwardReference\n try:\n obj = _typing_extra.evaluate_fwd_ref(obj, globalns=self.types_namespace)\n except NameError as e:\n raise PydanticUndefinedAnnotation.from_name_error(e) from e\n\n # if obj is still a ForwardRef, it means we can't evaluate it, raise PydanticUndefinedAnnotation\n if isinstance(obj, ForwardRef):\n raise PydanticUndefinedAnnotation(obj.__forward_arg__, f'Unable to evaluate forward reference {obj}')\n\n if self.typevars_map is not None:\n obj = replace_types(obj, self.typevars_map)\n\n from_property = self._generate_schema_from_property(obj, obj)\n if from_property is not None:\n return from_property\n\n if isinstance(obj, PydanticRecursiveRef):\n return core_schema.definition_reference_schema(schema_ref=obj.type_ref)\n\n if isinstance(obj, PydanticForwardRef):\n if not obj.deferred_actions:\n return obj.schema\n resolved_model = obj.resolve_model()\n if isinstance(resolved_model, PydanticForwardRef):\n # If you still have a PydanticForwardRef after resolving, it should be deeply nested enough that it will\n # eventually be substituted out. So it is safe to return an invalid schema here.\n # TODO: Replace this with a (new) CoreSchema that, if present at any level, makes validation fail\n return core_schema.none_schema(\n metadata={'invalid': True, 'pydantic_debug_self_schema': resolved_model.schema}\n )\n else:\n model_ref = get_type_ref(resolved_model)\n return core_schema.definition_reference_schema(model_ref)\n\n try:\n if obj in {bool, int, float, str, bytes, list, set, frozenset, dict}:\n # Note: obj may fail to be hashable if it has an unhashable annotation\n return {'type': obj.__name__}\n elif obj is tuple:\n return {'type': 'tuple-variable'}\n except TypeError: # obj not hashable; can happen due to unhashable annotations\n pass\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema.if_obj_is_Any_or_obj_is_o_GenerateSchema._generate_schema.None_7.return.from_property": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema.if_obj_is_Any_or_obj_is_o_GenerateSchema._generate_schema.None_7.return.from_property", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 341, "end_line": 392, "span_ids": ["GenerateSchema._generate_schema"], "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": "class GenerateSchema:\n\n def _generate_schema(self, obj: Any) -> core_schema.CoreSchema:\n # ... other code\n\n if obj is Any or obj is object:\n return core_schema.AnySchema(type='any')\n elif obj is None or obj is _typing_extra.NoneType:\n return core_schema.NoneSchema(type='none')\n elif obj == type:\n return self._type_schema()\n elif _typing_extra.is_callable_type(obj):\n return core_schema.CallableSchema(type='callable')\n elif _typing_extra.is_literal_type(obj):\n return self._literal_schema(obj)\n elif is_typeddict(obj):\n return self._typed_dict_schema(obj, None)\n elif _typing_extra.is_namedtuple(obj):\n return self._namedtuple_schema(obj)\n elif _typing_extra.is_new_type(obj):\n # NewType, can't use isinstance because it fails <3.7\n return self.generate_schema(obj.__supertype__)\n elif obj == re.Pattern:\n return self._pattern_schema(obj)\n elif isinstance(obj, type):\n if obj is dict:\n return self._dict_schema(obj)\n if issubclass(obj, dict):\n # TODO: We would need to handle generic subclasses of certain typing dict subclasses here\n # This includes subclasses of typing.Counter, typing.DefaultDict, and typing.OrderedDict\n # Note also that we may do a better job of handling typing.DefaultDict by inspecting its arguments.\n return self._dict_subclass_schema(obj)\n # probably need to take care of other subclasses here\n elif isinstance(obj, typing.TypeVar):\n return self._unsubstituted_typevar_schema(obj)\n\n # TODO: _std_types_schema iterates over the __mro__ looking for an expected schema.\n # This will catch subclasses of typing.Deque, preventing us from properly supporting user-defined\n # generic subclasses. (In principle this would also catch typing.OrderedDict, but that is currently\n # already getting caught in the `issubclass(obj, dict):` check above.\n std_schema = self._std_types_schema(obj)\n if std_schema is not None:\n return std_schema\n\n origin = get_origin(obj)\n if origin is None:\n if self.arbitrary_types:\n return core_schema.is_instance_schema(obj)\n else:\n raise PydanticSchemaGenerationError(\n f'Unable to generate pydantic-core schema for {obj!r}. '\n f'Setting `arbitrary_types_allowed=True` in the model_config may prevent this error.'\n )\n\n from_property = self._generate_schema_from_property(origin, obj)\n if from_property is not None:\n return from_property\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema.if__typing_extra_origin_i_GenerateSchema._generate_schema.if__typing_extra_origin_i.else_.if_self_arbitrary_types_a.else_.raise_PydanticSchemaGener": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema.if__typing_extra_origin_i_GenerateSchema._generate_schema.if__typing_extra_origin_i.else_.if_self_arbitrary_types_a.else_.raise_PydanticSchemaGener", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 448, "span_ids": ["GenerateSchema._generate_schema"], "tokens": 677}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _generate_schema(self, obj: Any) -> core_schema.CoreSchema:\n # ... other code\n\n if _typing_extra.origin_is_union(origin):\n return self._union_schema(obj)\n elif issubclass(origin, Annotated): # type: ignore[arg-type]\n return self._annotated_schema(obj)\n elif issubclass(origin, typing.List):\n return self._generic_collection_schema(list, obj, origin)\n elif issubclass(origin, typing.Set):\n return self._generic_collection_schema(set, obj, origin)\n elif issubclass(origin, typing.FrozenSet):\n return self._generic_collection_schema(frozenset, obj, origin)\n elif issubclass(origin, typing.Tuple): # type: ignore[arg-type]\n # TODO: To support generic subclasses of typing.Tuple, we need to better-introspect the args to origin\n return self._tuple_schema(obj)\n elif issubclass(origin, typing.Counter):\n # Subclasses of typing.Counter may be handled as subclasses of dict; see note above\n return self._counter_schema(obj)\n elif origin in (typing.Dict, dict):\n return self._dict_schema(obj)\n elif is_typeddict(origin):\n return self._typed_dict_schema(obj, origin)\n elif issubclass(origin, typing.Dict):\n # Subclasses of typing.Dict may be handled as subclasses of dict; see note above\n return self._dict_subclass_schema(obj)\n elif issubclass(origin, typing.Mapping):\n # Because typing.Mapping does not have a specified `__init__` signature, we don't validate into subclasses\n return self._mapping_schema(obj)\n elif issubclass(origin, typing.Type): # type: ignore[arg-type]\n return self._subclass_schema(obj)\n elif issubclass(origin, typing.Deque):\n from ._std_types_schema import deque_schema\n\n return deque_schema(self, obj)\n elif issubclass(origin, typing.OrderedDict):\n # Subclasses of typing.OrderedDict may be handled as subclasses of dict; see note above\n from ._std_types_schema import ordered_dict_schema\n\n return ordered_dict_schema(self, obj)\n elif issubclass(origin, typing.Sequence):\n # Because typing.Sequence does not have a specified `__init__` signature, we don't validate into subclasses\n return self._sequence_schema(obj)\n elif issubclass(origin, typing.MutableSet):\n raise PydanticSchemaGenerationError('Unable to generate pydantic-core schema MutableSet TODO.')\n elif issubclass(origin, (typing.Iterable, collections.abc.Iterable)):\n # Because typing.Iterable does not have a specified `__init__` signature, we don't validate into subclasses\n return self._iterable_schema(obj)\n elif issubclass(origin, (re.Pattern, typing.Pattern)):\n return self._pattern_schema(obj)\n else:\n if self.arbitrary_types and isinstance(origin, type):\n return core_schema.is_instance_schema(origin)\n else:\n raise PydanticSchemaGenerationError(\n f'Unable to generate pydantic-core schema for {obj!r} (origin={origin!r}). '\n f'Setting `arbitrary_types_allowed=True` in the model_config may prevent this error.'\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_td_field_schema_GenerateSchema.generate_td_field_schema.return.core_schema_typed_dict_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_td_field_schema_GenerateSchema.generate_td_field_schema.return.core_schema_typed_dict_fi", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 450, "end_line": 469, "span_ids": ["GenerateSchema.generate_td_field_schema"], "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 GenerateSchema:\n\n def generate_td_field_schema(\n self,\n name: str,\n field_info: FieldInfo,\n decorators: DecoratorInfos,\n *,\n required: bool = True,\n ) -> core_schema.TypedDictField:\n \"\"\"\n Prepare a TypedDictField to represent a model or typeddict field.\n \"\"\"\n common_field = self._common_field_schema(name, field_info, decorators)\n return core_schema.typed_dict_field(\n common_field['schema'],\n required=False if not field_info.is_required() else required,\n serialization_exclude=common_field['serialization_exclude'],\n validation_alias=common_field['validation_alias'],\n serialization_alias=common_field['serialization_alias'],\n metadata=common_field['metadata'],\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_dc_field_schema_GenerateSchema.generate_dc_field_schema.return.core_schema_dataclass_fie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.generate_dc_field_schema_GenerateSchema.generate_dc_field_schema.return.core_schema_dataclass_fie", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 471, "end_line": 490, "span_ids": ["GenerateSchema.generate_dc_field_schema"], "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 GenerateSchema:\n\n def generate_dc_field_schema(\n self,\n name: str,\n field_info: FieldInfo,\n decorators: DecoratorInfos,\n ) -> core_schema.DataclassField:\n \"\"\"\n Prepare a DataclassField to represent the parameter/field, of a dataclass\n \"\"\"\n common_field = self._common_field_schema(name, field_info, decorators)\n return core_schema.dataclass_field(\n name,\n common_field['schema'],\n init_only=field_info.init_var or None,\n kw_only=None if field_info.kw_only else False,\n serialization_exclude=common_field['serialization_exclude'],\n validation_alias=common_field['validation_alias'],\n serialization_alias=common_field['serialization_alias'],\n metadata=common_field['metadata'],\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._common_field_schema_GenerateSchema._common_field_schema.return._common_field_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._common_field_schema_GenerateSchema._common_field_schema.return._common_field_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 492, "end_line": 540, "span_ids": ["GenerateSchema._common_field_schema"], "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 GenerateSchema:\n\n def _common_field_schema(self, name: str, field_info: FieldInfo, decorators: DecoratorInfos) -> _CommonField:\n assert field_info.annotation is not None, 'field_info.annotation should not be None when generating a schema'\n\n schema = self.generate_schema(field_info.annotation)\n\n if field_info.discriminator is not None:\n schema = _discriminated_union.apply_discriminator(schema, field_info.discriminator, self.definitions)\n schema = apply_annotations(schema, field_info.metadata, self.definitions)\n\n # TODO: remove this V1 compatibility shim once it's deprecated\n # push down any `each_item=True` validators\n # note that this won't work for any Annotated types that get wrapped by a function validator\n # but that's okay because that didn't exist in V1\n this_field_validators = filter_field_decorator_info_by_field(decorators.validator.values(), name)\n if _validators_require_validate_default(this_field_validators):\n field_info.validate_default = True\n each_item_validators = [v for v in this_field_validators if v.info.each_item is True]\n this_field_validators = [v for v in this_field_validators if v not in each_item_validators]\n schema = apply_each_item_validators(schema, each_item_validators)\n\n schema = apply_validators(schema, filter_field_decorator_info_by_field(this_field_validators, name))\n schema = apply_validators(\n schema, filter_field_decorator_info_by_field(decorators.field_validator.values(), name)\n )\n\n # the default validator needs to go outside of any other validators\n # so that it is the topmost validator for the typed-dict-field validator\n # which uses it to check if the field has a default value or not\n if not field_info.is_required():\n schema = wrap_default(field_info, schema)\n\n schema = apply_field_serializers(\n schema, filter_field_decorator_info_by_field(decorators.field_serializer.values(), name)\n )\n json_schema_updates = {\n 'title': field_info.title,\n 'description': field_info.description,\n 'examples': field_info.examples,\n }\n json_schema_updates = {k: v for k, v in json_schema_updates.items() if v is not None}\n json_schema_updates.update(field_info.json_schema_extra or {})\n metadata = build_metadata_dict(js_modify_function=lambda s: update_json_schema(s, json_schema_updates))\n return _common_field(\n schema,\n serialization_exclude=True if field_info.exclude else None,\n validation_alias=field_info.alias,\n serialization_alias=field_info.alias,\n metadata=metadata,\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._union_schema_GenerateSchema._union_schema.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._union_schema_GenerateSchema._union_schema.return.s", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 562, "span_ids": ["GenerateSchema._union_schema"], "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 GenerateSchema:\n\n def _union_schema(self, union_type: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a Union.\n \"\"\"\n args = get_args(union_type)\n choices: list[core_schema.CoreSchema] = []\n nullable = False\n for arg in args:\n if arg is None or arg is _typing_extra.NoneType:\n nullable = True\n else:\n choices.append(self.generate_schema(arg))\n\n if len(choices) == 1:\n s = choices[0]\n else:\n s = core_schema.union_schema(choices)\n\n if nullable:\n s = core_schema.nullable_schema(s)\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._annotated_schema_GenerateSchema._literal_schema.return.core_schema_literal_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._annotated_schema_GenerateSchema._literal_schema.return.core_schema_literal_schem", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 564, "end_line": 578, "span_ids": ["GenerateSchema._annotated_schema", "GenerateSchema._literal_schema"], "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 GenerateSchema:\n\n def _annotated_schema(self, annotated_type: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for an Annotated type, e.g. `Annotated[int, Field(...)]` or `Annotated[int, Gt(0)]`.\n \"\"\"\n first_arg, *other_args = get_args(annotated_type)\n schema = self.generate_schema(first_arg)\n return apply_annotations(schema, other_args, self.definitions)\n\n def _literal_schema(self, literal_type: Any) -> core_schema.LiteralSchema:\n \"\"\"\n Generate schema for a Literal.\n \"\"\"\n expected = _typing_extra.all_literal_values(literal_type)\n assert expected, f'literal \"expected\" cannot be empty, obj={literal_type}'\n return core_schema.literal_schema(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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._typed_dict_schema_GenerateSchema._typed_dict_schema.return.core_schema_typed_dict_sc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._typed_dict_schema_GenerateSchema._typed_dict_schema.return.core_schema_typed_dict_sc", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 580, "end_line": 643, "span_ids": ["GenerateSchema._typed_dict_schema"], "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 GenerateSchema:\n\n def _typed_dict_schema(\n self, typed_dict_cls: Any, origin: Any\n ) -> core_schema.TypedDictSchema | core_schema.DefinitionReferenceSchema:\n \"\"\"\n Generate schema for a TypedDict.\n\n It is not possible to track required/optional keys in TypedDict without __required_keys__\n since TypedDict.__new__ erases the base classes (it replaces them with just `dict`)\n and thus we can track usage of total=True/False\n __required_keys__ was added in Python 3.9\n (https://github.com/miss-islington/cpython/blob/1e9939657dd1f8eb9f596f77c1084d2d351172fc/Doc/library/typing.rst?plain=1#L1546-L1548)\n however it is buggy\n (https://github.com/python/typing_extensions/blob/ac52ac5f2cb0e00e7988bae1e2a1b8257ac88d6d/src/typing_extensions.py#L657-L666).\n Hence to avoid creating validators that do not do what users expect we only\n support typing.TypedDict on Python >= 3.11 or typing_extension.TypedDict on all versions\n \"\"\"\n if origin is not None:\n typeddict_typevars_map = dict(zip(origin.__parameters__, typed_dict_cls.__args__))\n typed_dict_cls = origin\n else:\n typeddict_typevars_map = {}\n\n if not _SUPPORTS_TYPEDDICT and type(typed_dict_cls).__module__ == 'typing':\n raise PydanticUserError(\n 'Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.11.'\n )\n\n required_keys: frozenset[str] = typed_dict_cls.__required_keys__\n\n fields: dict[str, core_schema.TypedDictField] = {}\n\n obj_ref = f'{typed_dict_cls.__module__}.{typed_dict_cls.__qualname__}:{id(typed_dict_cls)}'\n if obj_ref in self.recursion_cache:\n return self.recursion_cache[obj_ref]\n else:\n self.recursion_cache[obj_ref] = core_schema.definition_reference_schema(obj_ref)\n\n for field_name, annotation in get_type_hints_infer_globalns(\n typed_dict_cls, localns=self.types_namespace, include_extras=True\n ).items():\n annotation = replace_types(annotation, typeddict_typevars_map)\n required = field_name in required_keys\n\n if get_origin(annotation) == _typing_extra.Required:\n required = True\n annotation = get_args(annotation)[0]\n elif get_origin(annotation) == _typing_extra.NotRequired:\n required = False\n annotation = get_args(annotation)[0]\n\n field_info = FieldInfo.from_annotation(annotation)\n fields[field_name] = self.generate_td_field_schema(\n field_name, field_info, DecoratorInfos(), required=required\n )\n\n typed_dict_ref = get_type_ref(typed_dict_cls)\n return core_schema.typed_dict_schema(\n fields,\n extra_behavior='forbid',\n ref=typed_dict_ref,\n metadata=build_metadata_dict(\n js_modify_function=lambda s: update_json_schema(s, {'title': typed_dict_cls.__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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._namedtuple_schema_GenerateSchema._namedtuple_schema.return.core_schema_call_schema_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._namedtuple_schema_GenerateSchema._namedtuple_schema.return.core_schema_call_schema_a", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 645, "end_line": 664, "span_ids": ["GenerateSchema._namedtuple_schema"], "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 GenerateSchema:\n\n def _namedtuple_schema(self, namedtuple_cls: Any) -> core_schema.CallSchema:\n \"\"\"\n Generate schema for a NamedTuple.\n \"\"\"\n annotations: dict[str, Any] = get_type_hints_infer_globalns(\n namedtuple_cls, include_extras=True, localns=self.types_namespace\n )\n if not annotations:\n # annotations is empty, happens if namedtuple_cls defined via collections.namedtuple(...)\n annotations = {k: Any for k in namedtuple_cls._fields}\n\n arguments_schema = core_schema.ArgumentsSchema(\n type='arguments',\n arguments_schema=[\n self._generate_parameter_schema(field_name, annotation)\n for field_name, annotation in annotations.items()\n ],\n metadata=build_metadata_dict(js_prefer_positional_arguments=True),\n )\n return core_schema.call_schema(arguments_schema, namedtuple_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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_parameter_schema_GenerateSchema._generate_parameter_schema.return.parameter_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_parameter_schema_GenerateSchema._generate_parameter_schema.return.parameter_schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 666, "end_line": 685, "span_ids": ["GenerateSchema._generate_parameter_schema"], "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 GenerateSchema:\n\n def _generate_parameter_schema(\n self,\n name: str,\n annotation: type[Any],\n mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] | None = None,\n ) -> core_schema.ArgumentsParameter:\n \"\"\"\n Prepare a ArgumentsParameter to represent a field in a namedtuple, dataclass or function signature.\n \"\"\"\n field = FieldInfo.from_annotation(annotation)\n assert field.annotation is not None, 'field.annotation should not be None when generating a schema'\n schema = self.generate_schema(field.annotation)\n schema = apply_annotations(schema, field.metadata, self.definitions)\n\n parameter_schema = core_schema.arguments_parameter(name, schema)\n if mode is not None:\n parameter_schema['mode'] = mode\n if field.alias is not None:\n parameter_schema['alias'] = field.alias\n return parameter_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generic_collection_schema_GenerateSchema._generic_collection_schema.if_origin_parent_type_.else_.return.core_schema_general_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generic_collection_schema_GenerateSchema._generic_collection_schema.if_origin_parent_type_.else_.return.core_schema_general_after", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 687, "end_line": 711, "span_ids": ["GenerateSchema._generic_collection_schema"], "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 GenerateSchema:\n\n def _generic_collection_schema(\n self, parent_type: type[Any], type_: type[Any], origin: type[Any]\n ) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for List, Set, and FrozenSet, possibly parameterized.\n\n :param parent_type: Either `list`, `set` or `frozenset` - the builtin type\n :param type_: The type of the collection, e.g. `List[int]` or `List`, or a subclass of one of them\n :param origin: The origin type\n \"\"\"\n schema: core_schema.CoreSchema = { # type: ignore[misc,assignment]\n 'type': parent_type.__name__.lower(),\n 'items_schema': self.generate_schema(get_first_arg(type_)),\n }\n\n if origin == parent_type:\n return schema\n else:\n # Ensure the validated value is converted back to the specific subclass type\n # NOTE: we might have better performance by using a tuple or list validator for the schema here,\n # but if you care about performance, you can define your own schema.\n # We should optimize for compatibility, not performance in this case\n return core_schema.general_after_validator_function(\n lambda __input_value, __info: type_(__input_value), schema\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._tuple_schema_GenerateSchema._tuple_schema.if_not_params_.else_.return.core_schema_tuple_positio": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._tuple_schema_GenerateSchema._tuple_schema.if_not_params_.else_.return.core_schema_tuple_positio", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 713, "end_line": 739, "span_ids": ["GenerateSchema._tuple_schema"], "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 GenerateSchema:\n\n def _tuple_schema(self, tuple_type: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a Tuple, e.g. `tuple[int, str]` or `tuple[int, ...]`.\n \"\"\"\n params = get_args(tuple_type)\n # NOTE: subtle difference: `tuple[()]` gives `params=()`, whereas `typing.Tuple[()]` gives `params=((),)`\n if not params:\n if tuple_type == typing.Tuple:\n return core_schema.tuple_variable_schema()\n else:\n # special case for `tuple[()]` which means `tuple[]` - an empty tuple\n return core_schema.tuple_positional_schema([])\n elif params[-1] is Ellipsis:\n if len(params) == 2:\n sv = core_schema.tuple_variable_schema(self.generate_schema(params[0]))\n return sv\n\n # not sure this case is valid in python, but may as well support it here since pydantic-core does\n *items_schema, extra_schema = params\n return core_schema.tuple_positional_schema(\n [self.generate_schema(p) for p in items_schema], extra_schema=self.generate_schema(extra_schema)\n )\n elif len(params) == 1 and params[0] == ():\n # special case for `Tuple[()]` which means `Tuple[]` - an empty tuple\n return core_schema.tuple_positional_schema([])\n else:\n return core_schema.tuple_positional_schema([self.generate_schema(p) for p in 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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dict_schema_GenerateSchema._dict_subclass_schema.return.core_schema_general_wrap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dict_schema_GenerateSchema._dict_subclass_schema.return.core_schema_general_wrap_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 741, "end_line": 773, "span_ids": ["GenerateSchema._dict_subclass_schema", "GenerateSchema._dict_schema"], "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 GenerateSchema:\n\n def _dict_schema(self, dict_type: Any) -> core_schema.DictSchema:\n \"\"\"\n Generate schema for a Dict, e.g. `dict[str, int]`.\n \"\"\"\n try:\n arg0, arg1 = get_args(dict_type)\n except ValueError:\n return core_schema.dict_schema()\n else:\n return core_schema.dict_schema(\n keys_schema=self.generate_schema(arg0),\n values_schema=self.generate_schema(arg1),\n )\n\n def _dict_subclass_schema(self, dict_subclass: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a subclass of dict or Dict\n \"\"\"\n try:\n arg0, arg1 = get_args(dict_subclass)\n except ValueError:\n arg0, arg1 = Any, Any\n\n from ._validators import mapping_validator\n\n # TODO could do `core_schema.chain_schema(core_schema.is_instance_schema(dict_subclass), ...` in strict mode\n return core_schema.general_wrap_validator_function(\n mapping_validator,\n core_schema.dict_schema(\n keys_schema=self.generate_schema(arg0),\n values_schema=self.generate_schema(arg1),\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._counter_schema_GenerateSchema._counter_schema.return.core_schema_general_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._counter_schema_GenerateSchema._counter_schema.return.core_schema_general_after", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 775, "end_line": 790, "span_ids": ["GenerateSchema._counter_schema"], "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 GenerateSchema:\n\n def _counter_schema(self, counter_type: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for `typing.Counter`\n \"\"\"\n arg = get_first_arg(counter_type)\n\n from ._validators import construct_counter\n\n # TODO could do `core_schema.chain_schema(core_schema.is_instance_schema(Counter), ...` in strict mode\n return core_schema.general_after_validator_function(\n construct_counter,\n core_schema.dict_schema(\n keys_schema=self.generate_schema(arg),\n values_schema=core_schema.int_schema(),\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._mapping_schema_GenerateSchema._type_schema.return.core_schema_custom_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._mapping_schema_GenerateSchema._type_schema.return.core_schema_custom_error_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 792, "end_line": 816, "span_ids": ["GenerateSchema._type_schema", "GenerateSchema._mapping_schema"], "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 GenerateSchema:\n\n def _mapping_schema(self, mapping_type: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a Dict, e.g. `dict[str, int]`.\n \"\"\"\n try:\n arg0, arg1 = get_args(mapping_type)\n except ValueError:\n return core_schema.is_instance_schema(typing.Mapping, cls_repr='Mapping')\n else:\n from ._validators import mapping_validator\n\n return core_schema.general_wrap_validator_function(\n mapping_validator,\n core_schema.dict_schema(\n keys_schema=self.generate_schema(arg0),\n values_schema=self.generate_schema(arg1),\n ),\n )\n\n def _type_schema(self) -> core_schema.CoreSchema:\n return core_schema.custom_error_schema(\n core_schema.is_instance_schema(type),\n custom_error_type='is_type',\n custom_error_message='Input should be a 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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._subclass_schema_GenerateSchema._subclass_schema.if_type_param_Any_.else_.return.core_schema_is_subclass_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._subclass_schema_GenerateSchema._subclass_schema.if_type_param_Any_.else_.return.core_schema_is_subclass_s", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 818, "end_line": 835, "span_ids": ["GenerateSchema._subclass_schema"], "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 GenerateSchema:\n\n def _subclass_schema(self, type_: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a Type, e.g. `Type[int]`.\n \"\"\"\n type_param = get_first_arg(type_)\n if type_param == Any:\n return self._type_schema()\n elif isinstance(type_param, typing.TypeVar):\n if type_param.__bound__:\n return core_schema.is_subclass_schema(type_param.__bound__)\n elif type_param.__constraints__:\n return core_schema.union_schema(\n [self.generate_schema(typing.Type[c]) for c in type_param.__constraints__]\n )\n else:\n return self._type_schema()\n else:\n return core_schema.is_subclass_schema(type_param)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._sequence_schema_GenerateSchema._iterable_schema.return.core_schema_generator_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._sequence_schema_GenerateSchema._iterable_schema.return.core_schema_generator_sch", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 837, "end_line": 866, "span_ids": ["GenerateSchema._sequence_schema", "GenerateSchema._iterable_schema"], "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 GenerateSchema:\n\n def _sequence_schema(self, sequence_type: Any) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a Sequence, e.g. `Sequence[int]`.\n \"\"\"\n item_type = get_first_arg(sequence_type)\n\n if item_type == Any:\n return core_schema.is_instance_schema(typing.Sequence, cls_repr='Sequence')\n else:\n from ._validators import sequence_validator\n\n return core_schema.chain_schema(\n [\n core_schema.is_instance_schema(typing.Sequence, cls_repr='Sequence'),\n core_schema.general_wrap_validator_function(\n sequence_validator,\n core_schema.list_schema(self.generate_schema(item_type), allow_any_iter=True),\n ),\n ]\n )\n\n def _iterable_schema(self, type_: Any) -> core_schema.GeneratorSchema:\n \"\"\"\n Generate a schema for an `Iterable`.\n\n TODO replace with pydantic-core's generator validator.\n \"\"\"\n item_type = get_first_arg(type_)\n\n return core_schema.generator_schema(self.generate_schema(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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._pattern_schema_GenerateSchema._pattern_schema.if_param_str_.else_.raise_PydanticSchemaGener": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._pattern_schema_GenerateSchema._pattern_schema.if_param_str_.else_.raise_PydanticSchemaGener", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 868, "end_line": 891, "span_ids": ["GenerateSchema._pattern_schema"], "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 GenerateSchema:\n\n def _pattern_schema(self, pattern_type: Any) -> core_schema.CoreSchema:\n from . import _serializers, _validators\n\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'regex'})\n ser = core_schema.general_plain_serializer_function_ser_schema(\n _serializers.pattern_serializer, json_return_type='str'\n )\n if pattern_type == typing.Pattern or pattern_type == re.Pattern:\n # bare type\n return core_schema.general_plain_validator_function(\n _validators.pattern_either_validator, serialization=ser, metadata=metadata\n )\n\n param = get_args(pattern_type)[0]\n if param == str:\n return core_schema.general_plain_validator_function(\n _validators.pattern_str_validator, serialization=ser, metadata=metadata\n )\n elif param == bytes:\n return core_schema.general_plain_validator_function(\n _validators.pattern_bytes_validator, serialization=ser, metadata=metadata\n )\n else:\n raise PydanticSchemaGenerationError(f'Unable to generate pydantic-core schema for {pattern_type!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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._std_types_schema_GenerateSchema._std_types_schema.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._std_types_schema_GenerateSchema._std_types_schema.return.None", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 893, "end_line": 916, "span_ids": ["GenerateSchema._std_types_schema"], "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 GenerateSchema:\n\n def _std_types_schema(self, obj: Any) -> core_schema.CoreSchema | None:\n \"\"\"\n Generate schema for types in the standard library.\n \"\"\"\n if not isinstance(obj, type):\n return None\n\n # Import here to avoid the extra import time earlier since _std_validators imports lots of things globally\n import dataclasses\n\n from ._std_types_schema import SCHEMA_LOOKUP\n\n # instead of iterating over a list and calling is_instance, this should be somewhat faster,\n # especially as it should catch most types on the first iteration\n # (same as we do/used to do in json encoding)\n for base in obj.__mro__[:-1]:\n try:\n encoder = SCHEMA_LOOKUP[base]\n except KeyError:\n continue\n return encoder(self, obj)\n if dataclasses.is_dataclass(obj):\n return self._dataclass_schema(obj)\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dataclass_schema_GenerateSchema._unsubstituted_typevar_schema.if_typevar___bound___.else_.return.core_schema_AnySchema_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dataclass_schema_GenerateSchema._unsubstituted_typevar_schema.if_typevar___bound___.else_.return.core_schema_AnySchema_typ", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 918, "end_line": 945, "span_ids": ["GenerateSchema._unsubstituted_typevar_schema", "GenerateSchema._dataclass_schema"], "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 GenerateSchema:\n\n def _dataclass_schema(self, dataclass: type[StandardDataclass]) -> core_schema.CoreSchema:\n \"\"\"\n Generate schema for a dataclass.\n \"\"\"\n # FIXME we need a way to make sure kw_only info is propagated through to fields\n fields, _ = collect_fields(\n dataclass, dataclass.__bases__, self.types_namespace, dc_kw_only=True, is_dataclass=True\n )\n\n return dataclass_schema(\n dataclass,\n get_type_ref(dataclass),\n fields,\n # FIXME we need to get validators and serializers from the dataclasses\n DecoratorInfos(),\n self.arbitrary_types,\n self.types_namespace,\n )\n\n def _unsubstituted_typevar_schema(self, typevar: typing.TypeVar) -> core_schema.CoreSchema:\n assert isinstance(typevar, typing.TypeVar)\n\n if typevar.__bound__:\n return self.generate_schema(typevar.__bound__)\n elif typevar.__constraints__:\n return self._union_schema(typing.Union[typevar.__constraints__])\n else:\n return core_schema.AnySchema(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_pydantic__pydantic/pydantic/_internal/_generate_schema.py__VALIDATOR_F_MATCH__VALIDATOR_F_MATCH._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__VALIDATOR_F_MATCH__VALIDATOR_F_MATCH._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 948, "end_line": 959, "span_ids": ["impl:12"], "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": "_VALIDATOR_F_MATCH: Mapping[\n tuple[str, bool], Callable[[Callable[..., Any], core_schema.CoreSchema], core_schema.CoreSchema]\n] = {\n ('before', True): core_schema.field_before_validator_function,\n ('after', True): core_schema.field_after_validator_function,\n ('plain', True): lambda f, _: core_schema.field_plain_validator_function(f),\n ('wrap', True): core_schema.field_wrap_validator_function,\n ('before', False): core_schema.general_before_validator_function,\n ('after', False): core_schema.general_after_validator_function,\n ('plain', False): lambda f, _: core_schema.general_plain_validator_function(f),\n ('wrap', False): core_schema.general_wrap_validator_function,\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_validators_apply_validators.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_validators_apply_validators.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 962, "end_line": 974, "span_ids": ["apply_validators"], "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 apply_validators(\n schema: core_schema.CoreSchema,\n validators: Iterable[Decorator[RootValidatorDecoratorInfo]]\n | Iterable[Decorator[ValidatorDecoratorInfo]]\n | Iterable[Decorator[FieldValidatorDecoratorInfo]],\n) -> core_schema.CoreSchema:\n \"\"\"\n Apply validators to a schema.\n \"\"\"\n for validator in validators:\n is_field = isinstance(validator.info, (FieldValidatorDecoratorInfo, ValidatorDecoratorInfo))\n schema = _VALIDATOR_F_MATCH[(validator.info.mode, is_field)](validator.func, schema)\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__validators_require_validate_default__validators_require_validate_default.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__validators_require_validate_default__validators_require_validate_default.return.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 977, "end_line": 991, "span_ids": ["_validators_require_validate_default"], "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 _validators_require_validate_default(validators: Iterable[Decorator[ValidatorDecoratorInfo]]) -> bool:\n \"\"\"\n In v1, if any of the validators for a field had `always=True`, the default value would be validated.\n\n This serves as an auxiliary function for re-implementing that logic, by looping over a provided\n collection of (v1-style) ValidatorDecoratorInfo's and checking if any of them have `always=True`.\n\n We should be able to drop this function and the associated logic calling it once we drop support\n for v1-style validator decorators. (Or we can extend it and keep it if we add something equivalent\n to the v1-validator `always` kwarg to `field_validator`.)\n \"\"\"\n for validator in validators:\n if validator.info.always:\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_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_field_serializers_apply_field_serializers.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_field_serializers_apply_field_serializers.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 994, "end_line": 1026, "span_ids": ["apply_field_serializers"], "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 apply_field_serializers(\n schema: core_schema.CoreSchema, serializers: list[Decorator[FieldSerializerDecoratorInfo]]\n) -> core_schema.CoreSchema:\n \"\"\"\n Apply field serializers to a schema.\n \"\"\"\n if serializers:\n # use the last serializer to make it easy to override a serializer set on a parent model\n serializer = serializers[-1]\n if serializer.info.mode == 'wrap':\n sf = (\n core_schema.field_wrap_serializer_function_ser_schema\n if serializer.info.type == 'field'\n else core_schema.general_wrap_serializer_function_ser_schema\n )\n schema['serialization'] = sf( # type: ignore[operator]\n serializer.func,\n json_return_type=serializer.info.json_return_type,\n when_used=serializer.info.when_used,\n )\n else:\n assert serializer.info.mode == 'plain'\n sf = (\n core_schema.field_plain_serializer_function_ser_schema\n if serializer.info.type == 'field'\n else core_schema.general_plain_serializer_function_ser_schema\n )\n schema['serialization'] = sf( # type: ignore[operator]\n serializer.func,\n json_return_type=serializer.info.json_return_type,\n when_used=serializer.info.when_used,\n )\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_model_serializers_apply_model_serializers.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_model_serializers_apply_model_serializers.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1029, "end_line": 1050, "span_ids": ["apply_model_serializers"], "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 apply_model_serializers(\n schema: core_schema.CoreSchema, serializers: Iterable[Decorator[ModelSerializerDecoratorInfo]]\n) -> core_schema.CoreSchema:\n \"\"\"\n Apply model serializers to a schema.\n \"\"\"\n if serializers:\n serializer = list(serializers)[-1]\n\n if serializer.info.mode == 'wrap':\n ser_schema: core_schema.SerSchema = core_schema.general_wrap_serializer_function_ser_schema(\n serializer.func,\n json_return_type=serializer.info.json_return_type,\n )\n else:\n # plain\n ser_schema = core_schema.general_plain_serializer_function_ser_schema(\n serializer.func,\n json_return_type=serializer.info.json_return_type,\n )\n schema['serialization'] = ser_schema\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_annotations_apply_annotations.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_annotations_apply_annotations.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1053, "end_line": 1066, "span_ids": ["apply_annotations"], "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 apply_annotations(\n schema: core_schema.CoreSchema, annotations: typing.Iterable[Any], definitions: dict[str, core_schema.CoreSchema]\n) -> core_schema.CoreSchema:\n \"\"\"\n Apply arguments from `Annotated` or from `FieldInfo` to a schema.\n \"\"\"\n handler = CoreMetadataHandler(schema)\n for metadata in annotations:\n schema = apply_single_annotation(schema, metadata, definitions)\n\n metadata_js_modify_function = _get_pydantic_modify_json_schema(metadata)\n handler.compose_js_modify_functions(metadata_js_modify_function)\n\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_single_annotation_apply_single_annotation.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_single_annotation_apply_single_annotation.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1069, "end_line": 1131, "span_ids": ["apply_single_annotation"], "tokens": 653}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_single_annotation( # noqa C901\n schema: core_schema.CoreSchema, metadata: Any, definitions: dict[str, core_schema.CoreSchema]\n) -> core_schema.CoreSchema:\n if metadata is None:\n return schema\n\n metadata_schema = getattr(metadata, '__pydantic_core_schema__', None)\n if metadata_schema is not None:\n return metadata_schema\n\n metadata_get_schema = getattr(metadata, '__get_pydantic_core_schema__', None)\n if metadata_get_schema is not None:\n return metadata_get_schema(schema)\n\n if isinstance(metadata, GroupedMetadata):\n # GroupedMetadata yields `BaseMetadata`s\n return apply_annotations(schema, metadata, definitions)\n elif isinstance(metadata, FieldInfo):\n schema = apply_annotations(schema, metadata.metadata, definitions)\n if metadata.discriminator is not None:\n schema = _discriminated_union.apply_discriminator(schema, metadata.discriminator, definitions)\n # TODO setting a default here needs to be tested\n return wrap_default(metadata, schema)\n\n if isinstance(metadata, PydanticGeneralMetadata):\n metadata_dict = metadata.__dict__\n elif isinstance(metadata, (BaseMetadata, PydanticMetadata)):\n metadata_dict = dataclasses.asdict(metadata) # type: ignore[call-overload]\n elif isinstance(metadata, type) and issubclass(metadata, PydanticMetadata):\n # also support PydanticMetadata classes being used without initialisation,\n # e.g. `Annotated[int, Strict]` as well as `Annotated[int, Strict()]`\n metadata_dict = {k: v for k, v in vars(metadata).items() if not k.startswith('_')}\n else:\n # PEP 593: \"If a library (or tool) encounters a typehint Annotated[T, x] and has no\n # special logic for metadata x, it should ignore it and simply treat the type as T.\"\n # Allow, but ignore, any unknown metadata.\n return schema\n\n # TODO we need a way to remove metadata which this line currently prevents\n metadata_dict = {k: v for k, v in metadata_dict.items() if v is not None}\n if not metadata_dict:\n return schema\n\n handler = CoreMetadataHandler(schema)\n update_schema_function = handler.metadata.get('pydantic_cs_update_function')\n if update_schema_function is not None:\n new_schema = update_schema_function(schema, **metadata_dict)\n if new_schema is not None:\n schema = new_schema\n else:\n if schema['type'] == 'nullable':\n # for nullable schemas, metadata is automatically applied to the inner schema\n # TODO need to do the same for lists, tuples and more\n schema['schema'].update(metadata_dict)\n else:\n schema.update(metadata_dict) # type: ignore[typeddict-item]\n try:\n SchemaValidator(schema)\n except SchemaError as e:\n # TODO: Generate an easier-to-understand ValueError here saying the field constraints are not enforced\n # The relevant test is: `tests.test_schema.test_unenforced_constraints_schema\n raise e\n return schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_wrap_default_get_first_arg.try_.except_IndexError_.return.Any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_wrap_default_get_first_arg.try_.except_IndexError_.return.Any", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1134, "end_line": 1154, "span_ids": ["get_first_arg", "wrap_default"], "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 wrap_default(field_info: FieldInfo, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n if field_info.default_factory:\n return core_schema.with_default_schema(\n schema, default_factory=field_info.default_factory, validate_default=field_info.validate_default\n )\n elif field_info.default is not Undefined:\n return core_schema.with_default_schema(\n schema, default=field_info.default, validate_default=field_info.validate_default\n )\n else:\n return schema\n\n\ndef get_first_arg(type_: Any) -> Any:\n \"\"\"\n Get the first argument from a typing object, e.g. `List[int]` -> `int`, or `Any` if no argument.\n \"\"\"\n try:\n return get_args(type_)[0]\n except IndexError:\n return 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_pydantic__pydantic/pydantic/_internal/_generate_schema.py__get_pydantic_modify_json_schema__CommonField.metadata": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__get_pydantic_modify_json_schema__CommonField.metadata", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1157, "end_line": 1175, "span_ids": ["_CommonField", "_get_pydantic_modify_json_schema"], "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 _get_pydantic_modify_json_schema(obj: Any) -> typing.Callable[[JsonSchemaValue], JsonSchemaValue] | None:\n js_modify_function = getattr(obj, '__pydantic_modify_json_schema__', None)\n\n if js_modify_function is None and hasattr(obj, '__modify_schema__'):\n warnings.warn(\n 'The __modify_schema__ method is deprecated, use __pydantic_modify_json_schema__ instead',\n DeprecationWarning,\n )\n return obj.__modify_schema__\n\n return js_modify_function\n\n\nclass _CommonField(TypedDict):\n schema: core_schema.CoreSchema\n validation_alias: str | list[str | int] | list[list[str | int]] | None\n serialization_alias: str | None\n serialization_exclude: bool | None\n metadata: 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_pydantic__pydantic/pydantic/_internal/_generate_schema.py__common_field_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__common_field_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1178, "end_line": 1193, "span_ids": ["_common_field"], "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 _common_field(\n schema: core_schema.CoreSchema,\n *,\n validation_alias: str | list[str | int] | list[list[str | int]] | None = None,\n serialization_alias: str | None = None,\n serialization_exclude: bool | None = None,\n metadata: Any = None,\n) -> _CommonField:\n return {\n 'schema': schema,\n 'validation_alias': validation_alias,\n 'serialization_alias': serialization_alias,\n 'serialization_exclude': serialization_exclude,\n 'metadata': metadata,\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_pydantic__pydantic/pydantic/_internal/_generics.py_from___future___import_an_None_3.else_.GenericTypesCache.WeakValueDictionary": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_from___future___import_an_None_3.else_.GenericTypesCache.WeakValueDictionary", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 74, "span_ids": ["imports", "impl:13"], "tokens": 650}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 annotations\n\nimport sys\nimport types\nimport typing\nfrom collections import ChainMap\nfrom contextlib import contextmanager\nfrom contextvars import ContextVar\nfrom types import prepare_class\nfrom typing import TYPE_CHECKING, Any, Iterator, List, Mapping, MutableMapping, Tuple, TypeVar\nfrom weakref import WeakValueDictionary\n\nimport typing_extensions\n\nfrom ._core_utils import get_type_ref\nfrom ._forward_ref import PydanticForwardRef, PydanticRecursiveRef\nfrom ._typing_extra import TypeVarType, typing_base\nfrom ._utils import all_identical, is_basemodel\n\nif sys.version_info >= (3, 10):\n from typing import _UnionGenericAlias # type: ignore[attr-defined]\n\nif TYPE_CHECKING:\n from pydantic import BaseModel\n\nGenericTypesCacheKey = Tuple[Any, Any, Tuple[Any, ...]]\n\n# TODO: We want to remove LimitedDict, but to do this, we'll need to improve the handling of generics caching\n# Right now, to handle recursive generics, we some types must remain cached for brief periods without references\n# By chaining the WeakValuesDict with a LimitedDict, we have a way to retain caching for all types with references,\n# while also retaining a limited number of types even without references. This is generally enough to build\n# specific recursive generic models without losing required items out of the cache.\n\nKT = TypeVar('KT')\nVT = TypeVar('VT')\n_LIMITED_DICT_SIZE = 100\nif TYPE_CHECKING:\n\n class LimitedDict(dict, MutableMapping[KT, VT]): # type: ignore[type-arg]\n def __init__(self, size_limit: int = _LIMITED_DICT_SIZE):\n ...\n\nelse:\n\n class LimitedDict(dict):\n \"\"\"\n Limit the size/length of a dict used for caching to avoid unlimited increase in memory usage.\n\n Since the dict is ordered, and we always remove elements from the beginning, this is effectively a FIFO cache.\n \"\"\"\n\n def __init__(self, size_limit: int = _LIMITED_DICT_SIZE):\n self.size_limit = size_limit\n super().__init__()\n\n def __setitem__(self, __key: Any, __value: Any) -> None:\n super().__setitem__(__key, __value)\n if len(self) > self.size_limit:\n excess = len(self) - self.size_limit + self.size_limit // 10\n to_remove = list(self.keys())[:excess]\n for key in to_remove:\n del self[key]\n\n def __class_getitem__(cls, *args: Any) -> Any:\n # to avoid errors with 3.7\n return cls\n\n\n# weak dictionaries allow the dynamically created parametrized versions of generic models to get collected\n# once they are no longer referenced by the caller.\nif sys.version_info >= (3, 9): # Typing for weak dictionaries available at 3.9\n GenericTypesCache = WeakValueDictionary[GenericTypesCacheKey, 'type[BaseModel]']\nelse:\n GenericTypesCache = WeakValueDictionary", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_None_4__GENERIC_TYPES_CACHE.GenericTypesCache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_None_4__GENERIC_TYPES_CACHE.GenericTypesCache_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 113, "span_ids": ["impl:13"], "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": "if TYPE_CHECKING:\n\n class DeepChainMap(ChainMap[KT, VT]):\n ...\n\nelse:\n\n class DeepChainMap(ChainMap):\n \"\"\"\n Variant of ChainMap that allows direct updates to inner scopes\n\n Taken from https://docs.python.org/3/library/collections.html#collections.ChainMap,\n with some light modifications for this use case.\n \"\"\"\n\n def clear(self) -> None:\n for mapping in self.maps:\n mapping.clear()\n\n def __setitem__(self, key: KT, value: VT) -> None:\n for mapping in self.maps:\n mapping[key] = value\n\n def __delitem__(self, key: KT) -> None:\n hit = False\n for mapping in self.maps:\n if key in mapping:\n del mapping[key]\n hit = True\n if not hit:\n raise KeyError(key)\n\n\n# Despite the fact that LimitedDict _seems_ no longer necessary, I'm very nervous to actually remove it\n# and discover later on that we need to re-add all this infrastructure...\n# _GENERIC_TYPES_CACHE = DeepChainMap(GenericTypesCache(), LimitedDict())\n\n_GENERIC_TYPES_CACHE = GenericTypesCache()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_create_generic_submodel_create_generic_submodel.return.created_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_create_generic_submodel_create_generic_submodel.return.created_model", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 153, "span_ids": ["create_generic_submodel"], "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 create_generic_submodel(\n model_name: str, origin: type[BaseModel], args: tuple[Any, ...], params: tuple[Any, ...]\n) -> type[BaseModel]:\n \"\"\"\n Dynamically create a submodel of a provided (generic) BaseModel.\n\n This is used when producing concrete parametrizations of generic models. This function\n only *creates* the new subclass; the schema/validators/serialization must be updated to\n reflect a concrete parametrization elsewhere.\n\n :param model_name: name of the newly created model\n :param origin: base class for the new model to inherit from\n \"\"\"\n namespace: dict[str, Any] = {'__module__': origin.__module__}\n bases = (origin,)\n meta, ns, kwds = prepare_class(model_name, bases)\n namespace.update(ns)\n created_model = meta(\n model_name,\n bases,\n namespace,\n __pydantic_generic_origin__=origin,\n __pydantic_generic_args__=args,\n __pydantic_generic_parameters__=params,\n __pydantic_reset_parent_namespace__=False,\n **kwds,\n )\n\n model_module, called_globally = _get_caller_frame_info(depth=3)\n if called_globally: # create global reference and therefore allow pickling\n object_by_reference = None\n reference_name = model_name\n reference_module_globals = sys.modules[created_model.__module__].__dict__\n while object_by_reference is not created_model:\n object_by_reference = reference_module_globals.setdefault(reference_name, created_model)\n reference_name += '_'\n\n return created_model", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__get_caller_frame_info_DictValues._values___class__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__get_caller_frame_info_DictValues._values___class__", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 172, "span_ids": ["impl:23", "_get_caller_frame_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 _get_caller_frame_info(depth: int = 2) -> tuple[str | None, bool]:\n \"\"\"\n Used inside a function to check whether it was called globally\n\n :returns Tuple[module_name, called_globally]\n \"\"\"\n try:\n previous_caller_frame = sys._getframe(depth)\n except ValueError as e:\n raise RuntimeError('This function must be used inside another function') from e\n except AttributeError: # sys module does not have _getframe function, so there's nothing we can do about it\n return None, False\n frame_globals = previous_caller_frame.f_globals\n return frame_globals.get('__name__'), previous_caller_frame.f_locals is frame_globals\n\n\nDictValues: type[Any] = {}.values().__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_pydantic__pydantic/pydantic/_internal/_generics.py_iter_contained_typevars_get_origin.return.typing_extensions_get_ori": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_iter_contained_typevars_get_origin.return.typing_extensions_get_ori", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 206, "span_ids": ["iter_contained_typevars", "get_args", "get_origin"], "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 iter_contained_typevars(v: Any) -> Iterator[TypeVarType]:\n \"\"\"\n Recursively iterate through all subtypes and type args of `v` and yield any typevars that are found.\n\n This is inspired as an alternative to directly accessing the `__parameters__` attribute of a GenericAlias,\n since __parameters__ of (nested) generic BaseModel subclasses won't show up in that list.\n \"\"\"\n if isinstance(v, TypeVar):\n yield v\n elif is_basemodel(v):\n yield from v.__pydantic_generic_parameters__ or ()\n elif isinstance(v, (DictValues, list)):\n for var in v:\n yield from iter_contained_typevars(var)\n else:\n args = get_args(v)\n for arg in args:\n yield from iter_contained_typevars(arg)\n\n\ndef get_args(v: Any) -> Any:\n pydantic_generic_args = getattr(v, '__pydantic_generic_args__', None)\n if pydantic_generic_args:\n return pydantic_generic_args\n return typing_extensions.get_args(v)\n\n\ndef get_origin(v: Any) -> Any:\n pydantic_generic_origin = getattr(v, '__pydantic_generic_origin__', None)\n if pydantic_generic_origin:\n return pydantic_generic_origin\n return typing_extensions.get_origin(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_pydantic__pydantic/pydantic/_internal/_generics.py_replace_types_replace_types.return.type_map_get_type__type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_replace_types_replace_types.return.type_map_get_type__type_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 285, "span_ids": ["replace_types"], "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 replace_types(type_: Any, type_map: Mapping[Any, Any] | None) -> Any:\n \"\"\"Return type with all occurrences of `type_map` keys recursively replaced with their values.\n\n :param type_: Any type, class or generic alias\n :param type_map: Mapping from `TypeVar` instance to concrete types.\n :return: New type representing the basic structure of `type_` with all\n `typevar_map` keys recursively replaced.\n\n >>> replace_types(Tuple[str, Union[List[str], float]], {str: int})\n Tuple[int, Union[List[int], float]]\n\n \"\"\"\n if not type_map:\n return type_\n\n type_args = get_args(type_)\n origin_type = get_origin(type_)\n\n if origin_type is typing_extensions.Annotated:\n annotated_type, *annotations = type_args\n annotated = replace_types(annotated_type, type_map)\n for annotation in annotations:\n annotated = typing_extensions.Annotated[annotated, annotation]\n return annotated\n\n # Having type args is a good indicator that this is a typing module\n # class instantiation or a generic alias of some sort.\n if type_args:\n resolved_type_args = tuple(replace_types(arg, type_map) for arg in type_args)\n if all_identical(type_args, resolved_type_args):\n # If all arguments are the same, there is no need to modify the\n # type or create a new object at all\n return type_\n if (\n origin_type is not None\n and isinstance(type_, typing_base)\n and not isinstance(origin_type, typing_base)\n and getattr(type_, '_name', None) is not None\n ):\n # In python < 3.9 generic aliases don't exist so any of these like `list`,\n # `type` or `collections.abc.Callable` need to be translated.\n # See: https://www.python.org/dev/peps/pep-0585\n origin_type = getattr(typing, type_._name)\n assert origin_type is not None\n # PEP-604 syntax (Ex.: list | str) is represented with a types.UnionType object that does not have __getitem__.\n # We also cannot use isinstance() since we have to compare types.\n if sys.version_info >= (3, 10) and origin_type is types.UnionType: # noqa: E721\n return _UnionGenericAlias(origin_type, resolved_type_args)\n return origin_type[resolved_type_args]\n\n # We handle pydantic generic models separately as they don't have the same\n # semantics as \"typing\" classes or generic aliases\n\n if not origin_type and is_basemodel(type_):\n parameters = type_.__pydantic_generic_parameters__\n if not parameters:\n return type_\n resolved_type_args = tuple(replace_types(t, type_map) for t in parameters)\n if all_identical(parameters, resolved_type_args):\n return type_\n return type_[resolved_type_args] # type: ignore[index]\n\n # Handle special case for typehints that can have lists as arguments.\n # `typing.Callable[[int, str], int]` is an example for this.\n if isinstance(type_, (List, list)):\n resolved_list = list(replace_types(element, type_map) for element in type_)\n if all_identical(type_, resolved_list):\n return type_\n return resolved_list\n\n if isinstance(type_, PydanticForwardRef):\n # queue the replacement as a deferred action\n return type_.replace_types(type_map)\n\n # If all else fails, we try to resolve the type directly and otherwise just\n # return the input with no modifications.\n return type_map.get(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_pydantic__pydantic/pydantic/_internal/_generics.py_check_parameters_count__generic_recursion_cache.ContextVar__generic_recu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_check_parameters_count__generic_recursion_cache.ContextVar__generic_recu", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 296, "span_ids": ["impl:25", "check_parameters_count"], "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 check_parameters_count(cls: type[BaseModel], parameters: tuple[Any, ...]) -> None:\n actual = len(parameters)\n expected = len(cls.__pydantic_generic_parameters__ or ())\n if actual != expected:\n description = 'many' if actual > expected else 'few'\n raise TypeError(f'Too {description} parameters for {cls}; actual {actual}, expected {expected}')\n\n\n_generic_recursion_cache: ContextVar[set[str] | None] = ContextVar('_generic_recursion_cache', default=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_pydantic__pydantic/pydantic/_internal/_generics.py_generic_recursion_self_type_recursively_defined_type_refs._don_t_allow_modificatio": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_generic_recursion_self_type_recursively_defined_type_refs._don_t_allow_modificatio", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 336, "span_ids": ["generic_recursion_self_type", "recursively_defined_type_refs"], "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": "@contextmanager\ndef generic_recursion_self_type(\n origin: type[BaseModel], args: tuple[Any, ...]\n) -> Iterator[PydanticForwardRef | PydanticRecursiveRef | None]:\n \"\"\"\n This contextmanager should be placed around the recursive calls used to build a generic type,\n and accept as arguments the generic origin type and the type arguments being passed to it.\n\n If the same origin and arguments are observed twice, it implies that a self-reference placeholder\n can be used while building the core schema, and will produce a schema_ref that will be valid in the\n final parent schema.\n \"\"\"\n previously_seen_type_refs = _generic_recursion_cache.get()\n if previously_seen_type_refs is None:\n previously_seen_type_refs = set()\n token = _generic_recursion_cache.set(previously_seen_type_refs)\n else:\n token = None\n\n try:\n type_ref = get_type_ref(origin, args_override=args)\n if type_ref in previously_seen_type_refs:\n self_type = PydanticRecursiveRef(type_ref=type_ref)\n yield self_type\n else:\n previously_seen_type_refs.add(type_ref)\n yield None\n finally:\n if token:\n _generic_recursion_cache.reset(token)\n\n\ndef recursively_defined_type_refs() -> set[str]:\n visited = _generic_recursion_cache.get()\n if not visited:\n return set() # not in a generic recursion, so there are no types\n\n return visited.copy() # don't allow modifications", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_cached_generic_type_early_get_cached_generic_type_early.return._GENERIC_TYPES_CACHE_get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_cached_generic_type_early_get_cached_generic_type_early.return._GENERIC_TYPES_CACHE_get_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 357, "span_ids": ["get_cached_generic_type_early"], "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 get_cached_generic_type_early(parent: type[BaseModel], typevar_values: Any) -> type[BaseModel] | None:\n \"\"\"\n The use of a two-stage cache lookup approach was necessary to have the highest performance possible for\n repeated calls to `__class_getitem__` on generic types (which may happen in tighter loops during runtime),\n while still ensuring that certain alternative parametrizations ultimately resolve to the same type.\n\n As a concrete example, this approach was necessary to make Model[List[T]][int] equal to Model[List[int]].\n The approach could be modified to not use two different cache keys at different points, but the\n _early_cache_key is optimized to be as quick to compute as possible (for repeated-access speed), and the\n _late_cache_key is optimized to be as \"correct\" as possible, so that two types that will ultimately be the\n same after resolving the type arguments will always produce cache hits.\n\n If we wanted to move to only using a single cache key per type, we would either need to always use the\n slower/more computationally intensive logic associated with _late_cache_key, or would need to accept\n that Model[List[T]][int] is a different type than Model[List[T]][int]. Because we rely on subclass relationships\n during validation, I think it is worthwhile to ensure that types that are functionally equivalent are actually\n equal.\n \"\"\"\n return _GENERIC_TYPES_CACHE.get(_early_cache_key(parent, typevar_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_pydantic__pydantic/pydantic/_internal/_generics.py_get_cached_generic_type_late_get_cached_generic_type_late.return.cached": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_cached_generic_type_late_get_cached_generic_type_late.return.cached", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 360, "end_line": 369, "span_ids": ["get_cached_generic_type_late"], "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 get_cached_generic_type_late(\n parent: type[BaseModel], typevar_values: Any, origin: type[BaseModel], args: tuple[Any, ...]\n) -> type[BaseModel] | None:\n \"\"\"\n See the docstring of `get_cached_generic_type_early` for more information about the two-stage cache lookup.\n \"\"\"\n cached = _GENERIC_TYPES_CACHE.get(_late_cache_key(origin, args, typevar_values))\n if cached is not None:\n set_cached_generic_type(parent, typevar_values, cached, origin, args)\n return cached", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_set_cached_generic_type_set_cached_generic_type.if_origin_and_args_._GENERIC_TYPES_CACHE__lat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_set_cached_generic_type_set_cached_generic_type.if_origin_and_args_._GENERIC_TYPES_CACHE__lat", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 372, "end_line": 387, "span_ids": ["set_cached_generic_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": "def set_cached_generic_type(\n parent: type[BaseModel],\n typevar_values: tuple[Any, ...],\n type_: type[BaseModel],\n origin: type[BaseModel] | None = None,\n args: tuple[Any, ...] | None = None,\n) -> None:\n \"\"\"\n See the docstring of `get_cached_generic_type_early` for more information about why items are cached with\n two different keys.\n \"\"\"\n _GENERIC_TYPES_CACHE[_early_cache_key(parent, typevar_values)] = type_\n if len(typevar_values) == 1:\n _GENERIC_TYPES_CACHE[_early_cache_key(parent, typevar_values[0])] = type_\n if origin and args:\n _GENERIC_TYPES_CACHE[_late_cache_key(origin, args, typevar_values)] = 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_pydantic__pydantic/pydantic/_internal/_generics.py__union_orderings_key__union_orderings_key.if_isinstance_typevar_val.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__union_orderings_key__union_orderings_key.if_isinstance_typevar_val.else_.return._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 390, "end_line": 412, "span_ids": ["_union_orderings_key"], "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 _union_orderings_key(typevar_values: Any) -> Any:\n \"\"\"\n This is intended to help differentiate between Union types with the same arguments in different order.\n\n Thanks to caching internal to the `typing` module, it is not possible to distinguish between\n List[Union[int, float]] and List[Union[float, int]] (and similarly for other \"parent\" origins besides List)\n because `typing` considers Union[int, float] to be equal to Union[float, int].\n\n However, you _can_ distinguish between (top-level) Union[int, float] vs. Union[float, int].\n Because we parse items as the first Union type that is successful, we get slightly more consistent behavior\n if we make an effort to distinguish the ordering of items in a union. It would be best if we could _always_\n get the exact-correct order of items in the union, but that would require a change to the `typing` module itself.\n (See https://github.com/python/cpython/issues/86483 for reference.)\n \"\"\"\n if isinstance(typevar_values, tuple):\n args_data = []\n for value in typevar_values:\n args_data.append(_union_orderings_key(value))\n return tuple(args_data)\n elif typing_extensions.get_origin(typevar_values) is typing.Union:\n return get_args(typevar_values)\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_pydantic__pydantic/pydantic/_internal/_generics.py__early_cache_key__early_cache_key.return.cls_typevar_values__uni": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__early_cache_key__early_cache_key.return.cls_typevar_values__uni", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 415, "end_line": 425, "span_ids": ["_early_cache_key"], "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": "def _early_cache_key(cls: type[BaseModel], typevar_values: Any) -> GenericTypesCacheKey:\n \"\"\"\n This is intended for minimal computational overhead during lookups of cached types.\n\n Note that this is overly simplistic, and it's possible that two different cls/typevar_values\n inputs would ultimately result in the same type being created in BaseModel.__class_getitem__.\n To handle this, we have a fallback _late_cache_key that is checked later if the _early_cache_key\n lookup fails, and should result in a cache hit _precisely_ when the inputs to __class_getitem__\n would result in the same type.\n \"\"\"\n return cls, typevar_values, _union_orderings_key(typevar_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_pydantic__pydantic/pydantic/_internal/_generics.py__late_cache_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__late_cache_key_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 428, "end_line": 439, "span_ids": ["_late_cache_key"], "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 _late_cache_key(origin: type[BaseModel], args: tuple[Any, ...], typevar_values: Any) -> GenericTypesCacheKey:\n \"\"\"\n This is intended for use later in the process of creating a new type, when we have more information\n about the exact args that will be passed. If it turns out that a different set of inputs to\n __class_getitem__ resulted in the same inputs to the generic type creation process, we can still\n return the cached type, and update the cache with the _early_cache_key as well.\n \"\"\"\n # The _union_orderings_key is placed at the start here to ensure there cannot be a collision with an\n # _early_cache_key, as that function will always produce a BaseModel subclass as the first item in the key,\n # whereas this function will always produce a tuple as the first item in the key.\n return _union_orderings_key(typevar_values), origin, 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_pydantic__pydantic/pydantic/_internal/_model_construction.py___init_private_attributes.for_name_private_attr_in.if_default_is_not_Undefin.object_setattr_self__nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py___init_private_attributes.for_name_private_attr_in.if_default_is_not_Undefin.object_setattr_self__nam", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["init_private_attributes", "docstring"], "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": "\"\"\"\nPrivate logic for creating models.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport typing\nfrom types import FunctionType\nfrom typing import Any, Callable\n\nfrom pydantic_core import SchemaSerializer, SchemaValidator\n\nfrom ..errors import PydanticUndefinedAnnotation, PydanticUserError\nfrom ..fields import FieldInfo, ModelPrivateAttr, PrivateAttr\nfrom ._decorators import PydanticDecoratorMarker\nfrom ._fields import Undefined, collect_fields\nfrom ._generate_schema import GenerateSchema, generate_config\nfrom ._typing_extra import add_module_globals, is_classvar\nfrom ._utils import ClassAttribute, is_valid_identifier\n\nif typing.TYPE_CHECKING:\n from inspect import Signature\n\n from ..config import ConfigDict\n from ..main import BaseModel\n\n__all__ = 'object_setattr', 'init_private_attributes', 'inspect_namespace', 'MockValidator'\n\nIGNORED_TYPES: tuple[Any, ...] = (FunctionType, property, type, classmethod, staticmethod, PydanticDecoratorMarker)\nobject_setattr = object.__setattr__\n\n\ndef init_private_attributes(self_: Any, _context: Any) -> None:\n \"\"\"\n This method is bound to model classes to initialise private attributes.\n\n It takes context as an argument since that's what pydantic-core passes when calling it.\n \"\"\"\n for name, private_attr in self_.__private_attributes__.items():\n default = private_attr.get_default()\n if default is not Undefined:\n object_setattr(self_, name, 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_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace_inspect_namespace.return.private_attributes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace_inspect_namespace.return.private_attributes", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 123, "span_ids": ["inspect_namespace"], "tokens": 749}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def inspect_namespace( # noqa C901\n namespace: dict[str, Any],\n ignored_types: tuple[type[Any], ...],\n base_class_vars: set[str],\n base_class_fields: set[str],\n) -> dict[str, ModelPrivateAttr]:\n \"\"\"\n iterate over the namespace and:\n * gather private attributes\n * check for items which look like fields but are not (e.g. have no annotation) and warn\n \"\"\"\n all_ignored_types = ignored_types + IGNORED_TYPES\n\n private_attributes: dict[str, ModelPrivateAttr] = {}\n raw_annotations = namespace.get('__annotations__', {})\n\n if '__root__' in raw_annotations or '__root__' in namespace:\n # TODO: Update error message with migration description and/or link to documentation\n # Needs to mention:\n # * Use root_validator to wrap input data in a dict\n # * Use model_serializer to extract wrapped data during dumping\n # * Use model_modify_json_schema (or whatever it becomes) to unwrap the JSON schema\n raise TypeError(\n '__root__ models are no longer supported in v2; a migration guide will be added in the near future'\n )\n\n ignored_names: set[str] = set()\n for var_name, value in list(namespace.items()):\n if var_name == 'model_config':\n continue\n elif isinstance(value, all_ignored_types):\n ignored_names.add(var_name)\n continue\n elif isinstance(value, ModelPrivateAttr):\n if var_name.startswith('__'):\n raise NameError(\n f'Private attributes \"{var_name}\" must not have dunder names; '\n 'use a single underscore prefix instead.'\n )\n elif not single_underscore(var_name):\n raise NameError(\n f'Private attributes \"{var_name}\" must not be a valid field name; '\n f'use sunder names, e.g. \"_{var_name}\"'\n )\n private_attributes[var_name] = value\n del namespace[var_name]\n elif var_name.startswith('__'):\n continue\n elif var_name.startswith('_'):\n if var_name in raw_annotations and not is_classvar(raw_annotations[var_name]):\n private_attributes[var_name] = PrivateAttr(default=value)\n del namespace[var_name]\n elif var_name in base_class_vars:\n continue\n elif var_name not in raw_annotations:\n if var_name in base_class_fields:\n raise PydanticUserError(\n f'Field {var_name!r} defined on a base class was overridden by a non-annotated attribute. '\n f'All field definitions, including overrides, require a type annotation.',\n )\n elif isinstance(value, FieldInfo):\n raise PydanticUserError(f'Field {var_name!r} requires a type annotation')\n else:\n raise PydanticUserError(\n f'A non-annotated attribute was detected: `{var_name} = {value!r}`. All model fields require a '\n f'type annotation; if {var_name!r} is not meant to be a field, you may be able to resolve this '\n f'error by annotating it as a ClassVar or updating model_config[\"ignored_types\"].',\n )\n\n for ann_name, ann_type in raw_annotations.items():\n if (\n single_underscore(ann_name)\n and ann_name not in private_attributes\n and ann_name not in ignored_names\n and not is_classvar(ann_type)\n and ann_type not in all_ignored_types\n ):\n private_attributes[ann_name] = PrivateAttr()\n\n return private_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_pydantic__pydantic/pydantic/_internal/_model_construction.py_single_underscore_set_model_fields.cls___class_vars___update": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_single_underscore_set_model_fields.cls___class_vars___update", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 144, "span_ids": ["set_model_fields", "get_model_types_namespace", "single_underscore"], "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 single_underscore(name: str) -> bool:\n return name.startswith('_') and not name.startswith('__')\n\n\ndef get_model_types_namespace(cls: type[BaseModel], parent_frame_namespace: dict[str, Any] | None) -> dict[str, Any]:\n ns = add_module_globals(cls, parent_frame_namespace)\n ns[cls.__name__] = cls\n return ns\n\n\ndef set_model_fields(cls: type[BaseModel], bases: tuple[type[Any], ...], types_namespace: dict[str, Any]) -> None:\n \"\"\"\n Collect and set `cls.model_fields` and `cls.__class_vars__`.\n \"\"\"\n fields, class_vars = collect_fields(cls, bases, types_namespace)\n\n apply_alias_generator(cls.model_config, fields)\n cls.model_fields = fields\n cls.__class_vars__.update(class_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_pydantic__pydantic/pydantic/_internal/_model_construction.py_complete_model_class_complete_model_class.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_complete_model_class_complete_model_class.return.True", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 197, "span_ids": ["complete_model_class"], "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 complete_model_class(\n cls: type[BaseModel],\n cls_name: str,\n types_namespace: dict[str, Any] | None,\n *,\n raise_errors: bool = True,\n) -> bool:\n \"\"\"\n Finish building a model class.\n\n Returns `True` if the model is successfully completed, else `False`.\n\n This logic must be called after class has been created since validation functions must be bound\n and `get_type_hints` requires a class object.\n \"\"\"\n gen_schema = GenerateSchema(\n cls.model_config['arbitrary_types_allowed'], types_namespace, cls.__pydantic_generic_typevars_map__\n )\n try:\n schema = gen_schema.generate_schema(cls)\n except PydanticUndefinedAnnotation as e:\n if raise_errors:\n raise\n if cls.model_config['undefined_types_warning']:\n config_warning_string = (\n f'`{cls_name}` has an undefined annotation: `{e.name}`. '\n f'It may be possible to resolve this by setting '\n f'undefined_types_warning=False in the config for `{cls_name}`.'\n )\n # FIXME UserWarning should not be raised here, but rather warned!\n raise UserWarning(config_warning_string)\n usage_warning_string = (\n f'`{cls_name}` is not fully defined; you should define `{e.name}`, then call `{cls_name}.model_rebuild()` '\n f'before the first `{cls_name}` instance is created.'\n )\n cls.__pydantic_validator__ = MockValidator(usage_warning_string) # type: ignore[assignment]\n return False\n\n core_config = generate_config(cls.model_config, cls)\n\n # debug(schema)\n cls.__pydantic_core_schema__ = schema\n cls.__pydantic_validator__ = SchemaValidator(schema, core_config)\n cls.__pydantic_serializer__ = SchemaSerializer(schema, core_config)\n cls.__pydantic_model_complete__ = True\n\n # set __signature__ attr only for model class, but not for its instances\n cls.__signature__ = ClassAttribute(\n '__signature__', generate_model_signature(cls.__init__, cls.model_fields, cls.model_config)\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_pydantic__pydantic/pydantic/_internal/_model_construction.py_generate_model_signature_generate_model_signature.return.Signature_parameters_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_generate_model_signature_generate_model_signature.return.Signature_parameters_list", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 265, "span_ids": ["generate_model_signature"], "tokens": 585}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_model_signature(init: Callable[..., None], fields: dict[str, FieldInfo], config: ConfigDict) -> Signature:\n \"\"\"\n Generate signature for model based on its fields\n \"\"\"\n from inspect import Parameter, Signature, signature\n from itertools import islice\n\n from ..config import Extra\n\n present_params = signature(init).parameters.values()\n merged_params: dict[str, Parameter] = {}\n var_kw = None\n use_var_kw = False\n\n for param in islice(present_params, 1, None): # skip self arg\n # inspect does \"clever\" things to show annotations as strings because we have\n # `from __future__ import annotations` in main, we don't want that\n if param.annotation == 'Any':\n param = param.replace(annotation=Any)\n if param.kind is param.VAR_KEYWORD:\n var_kw = param\n continue\n merged_params[param.name] = param\n\n if var_kw: # if custom init has no var_kw, fields which are not declared in it cannot be passed through\n allow_names = config['populate_by_name']\n for field_name, field in fields.items():\n param_name = field.alias or field_name\n if field_name in merged_params or param_name in merged_params:\n continue\n elif not is_valid_identifier(param_name):\n if allow_names and is_valid_identifier(field_name):\n param_name = field_name\n else:\n use_var_kw = True\n continue\n\n # TODO: replace annotation with actual expected types once #1055 solved\n kwargs = {} if field.is_required() else {'default': field.get_default(call_default_factory=False)}\n merged_params[param_name] = Parameter(\n param_name, Parameter.KEYWORD_ONLY, annotation=field.rebuild_annotation(), **kwargs\n )\n\n if config['extra'] is Extra.allow:\n use_var_kw = True\n\n if var_kw and use_var_kw:\n # Make sure the parameter for extra kwargs\n # does not have the same name as a field\n default_model_signature = [\n ('__pydantic_self__', Parameter.POSITIONAL_OR_KEYWORD),\n ('data', Parameter.VAR_KEYWORD),\n ]\n if [(p.name, p.kind) for p in present_params] == default_model_signature:\n # if this is the standard model signature, use extra_data as the extra args name\n var_kw_name = 'extra_data'\n else:\n # else start from var_kw\n var_kw_name = var_kw.name\n\n # generate a name that's definitely unique\n while var_kw_name in fields:\n var_kw_name += '_'\n merged_params[var_kw_name] = var_kw.replace(name=var_kw_name)\n\n return Signature(parameters=list(merged_params.values()), return_annotation=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_pydantic__pydantic/pydantic/_internal/_model_construction.py_MockValidator_MockValidator.__getattr__.raise_PydanticUserError_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_MockValidator_MockValidator.__getattr__.raise_PydanticUserError_s", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 268, "end_line": 282, "span_ids": ["MockValidator.__getattr__", "MockValidator.__init__", "MockValidator"], "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 MockValidator:\n \"\"\"\n Mocker for `pydantic_core.SchemaValidator` which just raises an error when one of its methods is accessed.\n \"\"\"\n\n __slots__ = ('_error_message',)\n\n def __init__(self, error_message: str) -> None:\n self._error_message = error_message\n\n def __getattr__(self, item: str) -> None:\n __tracebackhide__ = True\n # raise an AttributeError if `item` doesn't exist\n getattr(SchemaValidator, item)\n raise PydanticUserError(self._error_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_pydantic__pydantic/pydantic/_internal/_model_construction.py_apply_alias_generator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_apply_alias_generator_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 285, "end_line": 297, "span_ids": ["apply_alias_generator"], "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 apply_alias_generator(config: ConfigDict, fields: dict[str, FieldInfo]) -> None:\n alias_generator = config['alias_generator']\n if alias_generator is None:\n return\n\n for name, field_info in fields.items():\n if field_info.alias_priority is None or field_info.alias_priority <= 1:\n alias = alias_generator(name)\n if not isinstance(alias, str):\n raise TypeError(f'alias_generator {alias_generator} must return str, not {alias.__class__}')\n field_info.alias = alias\n field_info.alias_priority = 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_pydantic__pydantic/pydantic/_internal/_repr.py___PlainRepr.__repr__.return.str_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py___PlainRepr.__repr__.return.str_self_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_repr.py", "file_name": "_repr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["PlainRepr", "PlainRepr.__repr__", "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": "\"\"\"\nTools to provide pretty/human-readable display of objects.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport types\nimport typing\nfrom typing import Any\n\nimport typing_extensions\n\nfrom . import _typing_extra\n\nif typing.TYPE_CHECKING:\n ReprArgs = typing.Iterable[tuple[str | None, Any]]\n RichReprResult = typing.Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]\n\n\nclass PlainRepr(str):\n \"\"\"\n String class where repr doesn't include quotes. Useful with Representation when you want to return a string\n representation of something that is valid (or pseudo-valid) python.\n \"\"\"\n\n def __repr__(self) -> str:\n return str(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_pydantic__pydantic/pydantic/_internal/_repr.py_Representation_Representation.__repr_args__.return._a_v_for_a_v_in_attrs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_Representation_Representation.__repr_args__.return._a_v_for_a_v_in_attrs", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_repr.py", "file_name": "_repr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 50, "span_ids": ["Representation", "Representation.__repr_args__"], "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 Representation:\n # Mixin to provide `__str__`, `__repr__`, and `__pretty__` and `__rich_repr__` methods.\n # `__pretty__` is used by [devtools](https://python-devtools.helpmanual.io/).\n # `__rich_repr__` is used by [rich](https://rich.readthedocs.io/en/stable/pretty.html).\n # (this is not a docstring to avoid adding a docstring to classes which inherit from Representation)\n\n # we don't want to use a type annotation here as it can break get_type_hints\n __slots__ = tuple() # type: typing.Collection[str]\n\n def __repr_args__(self) -> ReprArgs:\n \"\"\"\n Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden.\n\n Can either return:\n * name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]`\n * or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]`\n \"\"\"\n attrs_names = self.__slots__\n if not attrs_names and hasattr(self, '__dict__'):\n attrs_names = self.__dict__.keys()\n attrs = ((s, getattr(self, s)) for s in attrs_names)\n return [(a, v) for a, v in attrs if v 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_pydantic__pydantic/pydantic/_internal/_repr.py_Representation.__repr_name___Representation.__rich_repr__.for_name_field_repr_in_s.if_name_is_None_.else_.yield_name_field_repr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_Representation.__repr_name___Representation.__rich_repr__.for_name_field_repr_in_s.if_name_is_None_.else_.yield_name_field_repr", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_repr.py", "file_name": "_repr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 88, "span_ids": ["Representation.__repr_str__", "Representation.__rich_repr__", "Representation.__str__", "Representation.__repr__", "Representation.__pretty__", "Representation.__repr_name__"], "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 Representation:\n # Mixin to provide `__str__`, `__repr__`, and `__pretty__` and `__rich_repr__` methods.\n # `__pretty__` is used by [devtools](https://python-devtools.helpmanual.io/).\n # `__rich_repr__` is used by [rich](https://rich.readthedocs.io/en/stable/pretty.html).\n # (this is not a docstring to avoid adding a docstring to classes which inherit from Representation)\n\n def __repr_name__(self) -> str:\n \"\"\"\n Name of the instance's class, used in __repr__.\n \"\"\"\n return self.__class__.__name__\n\n def __repr_str__(self, join_str: str) -> str:\n return join_str.join(repr(v) if a is None else f'{a}={v!r}' for a, v in self.__repr_args__())\n\n def __pretty__(self, fmt: typing.Callable[[Any], Any], **kwargs: Any) -> typing.Generator[Any, None, None]:\n \"\"\"\n Used by devtools (https://python-devtools.helpmanual.io/) to provide a human-readable representations of objects\n \"\"\"\n yield self.__repr_name__() + '('\n yield 1\n for name, value in self.__repr_args__():\n if name is not None:\n yield name + '='\n yield fmt(value)\n yield ','\n yield 0\n yield -1\n yield ')'\n\n def __str__(self) -> str:\n return self.__repr_str__(' ')\n\n def __repr__(self) -> str:\n return f'{self.__repr_name__()}({self.__repr_str__(\", \")})'\n\n def __rich_repr__(self) -> RichReprResult:\n \"\"\"Get fields for Rich library\"\"\"\n for name, field_repr in self.__repr_args__():\n if name is None:\n yield field_repr\n else:\n yield name, field_repr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_display_as_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_display_as_type_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_repr.py", "file_name": "_repr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 117, "span_ids": ["display_as_type"], "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 display_as_type(obj: Any) -> str:\n \"\"\"\n Pretty representation of a type, should be as close as possible to the original type definition string.\n\n Takes some logic from `typing._type_repr`.\n \"\"\"\n if isinstance(obj, types.FunctionType):\n return obj.__name__\n elif obj is ...:\n return '...'\n elif isinstance(obj, Representation):\n return repr(obj)\n\n if not isinstance(obj, (_typing_extra.typing_base, _typing_extra.WithArgsTypes, type)):\n obj = obj.__class__\n\n if _typing_extra.origin_is_union(typing_extensions.get_origin(obj)):\n args = ', '.join(map(display_as_type, typing_extensions.get_args(obj)))\n return f'Union[{args}]'\n elif isinstance(obj, _typing_extra.WithArgsTypes):\n args = ', '.join(map(display_as_type, typing_extensions.get_args(obj)))\n return f'{obj.__qualname__}[{args}]'\n elif isinstance(obj, type):\n return obj.__qualname__\n else:\n return repr(obj).replace('typing.', '').replace('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_pydantic__pydantic/pydantic/_internal/_serializers.py_from___future___import_an_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_serializers.py_from___future___import_an_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_serializers.py", "file_name": "_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports", "serialize_deque", "pattern_serializer"], "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": "from __future__ import annotations as _annotations\n\nfrom collections import deque\nfrom typing import Any, Pattern\n\nfrom pydantic_core import PydanticOmit\nfrom pydantic_core.core_schema import SerializationInfo, SerializerFunctionWrapHandler\n\n\ndef pattern_serializer(input_value: Pattern[Any], info: SerializationInfo) -> str | Pattern[Any]:\n if info.mode == 'json':\n return input_value.pattern\n else:\n return input_value\n\n\ndef serialize_deque(\n __value: Any, __serialize: SerializerFunctionWrapHandler, __info: SerializationInfo\n) -> list[Any] | deque[Any]:\n items = []\n for index, item in enumerate(__value):\n try:\n v = __serialize(item, index)\n except PydanticOmit:\n pass\n else:\n items.append(v)\n if __info.mode_is_json():\n return items\n else:\n return deque(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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py___timedelta_schema.return.core_schema_TimedeltaSche": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py___timedelta_schema.return.core_schema_TimedeltaSche", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 62, "span_ids": ["date_schema", "time_schema", "datetime_schema", "timedelta_schema", "schema_function", "docstring"], "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": "\"\"\"\nLogic for generating pydantic-core schemas for standard library types.\n\nImport of this module is deferred since it contains imports of many standard library modules.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport inspect\nimport typing\nfrom collections import OrderedDict, deque\nfrom datetime import date, datetime, time, timedelta\nfrom decimal import Decimal\nfrom enum import Enum\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom pathlib import PurePath\nfrom typing import Any, Callable\nfrom uuid import UUID\n\nfrom pydantic_core import CoreSchema, MultiHostUrl, PydanticCustomError, Url, core_schema\nfrom typing_extensions import Literal, get_args\n\nfrom ..json_schema import update_json_schema\nfrom . import _serializers, _validators\nfrom ._core_metadata import build_metadata_dict\nfrom ._core_utils import get_type_ref\n\nif typing.TYPE_CHECKING:\n from ._generate_schema import GenerateSchema\n\n StdSchemaFunction = Callable[[GenerateSchema, type[Any]], core_schema.CoreSchema]\n\n__all__ = ('SCHEMA_LOOKUP',)\n\nSCHEMA_LOOKUP: dict[type[Any], StdSchemaFunction] = {}\n\n\ndef schema_function(type: type[Any]) -> Callable[[StdSchemaFunction], StdSchemaFunction]:\n def wrapper(func: StdSchemaFunction) -> StdSchemaFunction:\n SCHEMA_LOOKUP[type] = func\n return func\n\n return wrapper\n\n\n@schema_function(date)\ndef date_schema(_schema_generator: GenerateSchema, _t: type[Any]) -> core_schema.DateSchema:\n return core_schema.DateSchema(type='date')\n\n\n@schema_function(datetime)\ndef datetime_schema(_schema_generator: GenerateSchema, _t: type[Any]) -> core_schema.DatetimeSchema:\n return core_schema.DatetimeSchema(type='datetime')\n\n\n@schema_function(time)\ndef time_schema(_schema_generator: GenerateSchema, _t: type[Any]) -> core_schema.TimeSchema:\n return core_schema.TimeSchema(type='time')\n\n\n@schema_function(timedelta)\ndef timedelta_schema(_schema_generator: GenerateSchema, _t: type[Any]) -> core_schema.TimedeltaSchema:\n return core_schema.TimedeltaSchema(type='timedelta')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_enum_schema_enum_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_enum_schema_enum_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 112, "span_ids": ["enum_schema"], "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": "@schema_function(Enum)\ndef enum_schema(_schema_generator: GenerateSchema, enum_type: type[Enum]) -> core_schema.CoreSchema:\n def to_enum(__input_value: Any, _: core_schema.ValidationInfo) -> Enum:\n try:\n return enum_type(__input_value)\n except ValueError:\n raise PydanticCustomError('enum', 'Input is not a valid enum member')\n\n enum_ref = get_type_ref(enum_type)\n literal_schema = core_schema.literal_schema(\n [m.value for m in enum_type.__members__.values()],\n )\n description = None if not enum_type.__doc__ else inspect.cleandoc(enum_type.__doc__)\n if description == 'An enumeration.': # This is the default value provided by enum.EnumMeta.__new__; don't use it\n description = None\n updates = {'title': enum_type.__name__, 'description': description}\n updates = {k: v for k, v in updates.items() if v is not None}\n metadata = build_metadata_dict(\n js_cs_override=literal_schema.copy(), js_modify_function=lambda s: update_json_schema(s, updates)\n )\n\n lax: CoreSchema\n json_type: Literal['int', 'float', 'str']\n if issubclass(enum_type, int):\n # this handles `IntEnum`, and also `Foobar(int, Enum)`\n updates['type'] = 'integer'\n lax = core_schema.chain_schema(\n [core_schema.int_schema(), literal_schema, core_schema.general_plain_validator_function(to_enum)],\n metadata=metadata,\n )\n json_type = 'int'\n elif issubclass(enum_type, str):\n # this handles `StrEnum` (3.11 only), and also `Foobar(str, Enum)`\n updates['type'] = 'string'\n lax = core_schema.chain_schema(\n [core_schema.str_schema(), literal_schema, core_schema.general_plain_validator_function(to_enum)],\n metadata=metadata,\n )\n json_type = 'str'\n else:\n lax = core_schema.general_after_validator_function(to_enum, literal_schema, metadata=metadata)\n json_type = 'str'\n return core_schema.lax_or_strict_schema(\n lax_schema=lax,\n strict_schema=core_schema.is_instance_schema(enum_type, json_types={json_type}),\n ref=enum_ref,\n metadata=metadata,\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_decimal_schema_decimal_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_decimal_schema_decimal_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 143, "span_ids": ["decimal_schema"], "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": "@schema_function(Decimal)\ndef decimal_schema(_schema_generator: GenerateSchema, _decimal_type: type[Decimal]) -> core_schema.LaxOrStrictSchema:\n decimal_validator = _validators.DecimalValidator()\n metadata = build_metadata_dict(\n cs_update_function=decimal_validator.__pydantic_update_schema__,\n # Use a lambda here so `apply_metadata` is called on the decimal_validator before the override is generated\n js_cs_override=lambda: decimal_validator.json_schema_override_schema(),\n )\n lax = core_schema.general_after_validator_function(\n decimal_validator,\n core_schema.union_schema(\n [\n core_schema.is_instance_schema(Decimal, json_types={'int', 'float'}),\n core_schema.int_schema(),\n core_schema.float_schema(),\n core_schema.str_schema(strip_whitespace=True),\n ],\n strict=True,\n ),\n )\n strict = core_schema.custom_error_schema(\n core_schema.general_after_validator_function(\n decimal_validator,\n core_schema.is_instance_schema(Decimal, json_types={'int', 'float'}),\n ),\n custom_error_type='decimal_type',\n custom_error_message='Input should be a valid Decimal instance or decimal string in JSON',\n )\n return core_schema.lax_or_strict_schema(lax_schema=lax, strict_schema=strict, metadata=metadata)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_uuid_schema_uuid_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_uuid_schema_uuid_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 183, "span_ids": ["uuid_schema"], "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": "@schema_function(UUID)\ndef uuid_schema(_schema_generator: GenerateSchema, uuid_type: type[UUID]) -> core_schema.LaxOrStrictSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'uuid'})\n # TODO, is this actually faster than `function_after(union(is_instance, is_str, is_bytes))`?\n lax = core_schema.union_schema(\n [\n core_schema.is_instance_schema(uuid_type, json_types={'str'}),\n core_schema.general_after_validator_function(\n _validators.uuid_validator,\n core_schema.union_schema([core_schema.str_schema(), core_schema.bytes_schema()]),\n ),\n ],\n custom_error_type='uuid_type',\n custom_error_message='Input should be a valid UUID, string, or bytes',\n strict=True,\n metadata=metadata,\n )\n\n return core_schema.lax_or_strict_schema(\n lax_schema=lax,\n strict_schema=core_schema.chain_schema(\n [\n core_schema.is_instance_schema(uuid_type, json_types={'str'}),\n core_schema.union_schema(\n [\n core_schema.is_instance_schema(UUID),\n core_schema.chain_schema(\n [\n core_schema.str_schema(),\n core_schema.general_plain_validator_function(_validators.uuid_validator),\n ]\n ),\n ]\n ),\n ],\n metadata=metadata,\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_path_schema_path_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_path_schema_path_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 212, "span_ids": ["path_schema"], "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": "@schema_function(PurePath)\ndef path_schema(_schema_generator: GenerateSchema, path_type: type[PurePath]) -> core_schema.LaxOrStrictSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'path'})\n # TODO, is this actually faster than `function_after(...)` as above?\n lax = core_schema.union_schema(\n [\n core_schema.is_instance_schema(path_type, json_types={'str'}, metadata=metadata),\n core_schema.general_after_validator_function(\n _validators.path_validator,\n core_schema.str_schema(),\n metadata=metadata,\n ),\n ],\n custom_error_type='path_type',\n custom_error_message='Input is not a valid path',\n strict=True,\n )\n\n return core_schema.lax_or_strict_schema(\n lax_schema=lax,\n strict_schema=core_schema.general_after_validator_function(\n lambda x, _: path_type(x),\n core_schema.is_instance_schema(path_type, json_types={'str'}),\n serialization=core_schema.to_string_ser_schema(),\n metadata=metadata,\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__deque_ser_schema__deque_any_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__deque_ser_schema__deque_any_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 234, "span_ids": ["_deque_ser_schema", "_deque_any_schema"], "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 _deque_ser_schema(\n inner_schema: core_schema.CoreSchema | None = None,\n) -> core_schema.WrapSerializerFunctionSerSchema:\n return core_schema.general_wrap_serializer_function_ser_schema(\n _serializers.serialize_deque, schema=inner_schema or core_schema.any_schema()\n )\n\n\ndef _deque_any_schema() -> core_schema.LaxOrStrictSchema:\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_wrap_validator_function(\n _validators.deque_any_validator,\n core_schema.list_schema(),\n ),\n strict_schema=core_schema.general_after_validator_function(\n lambda x, _: deque(x),\n core_schema.is_instance_schema(deque, json_types={'list'}),\n ),\n serialization=_deque_ser_schema(),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_deque_schema_deque_schema.if_arg_typing_Any_.else_.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_deque_schema_deque_schema.if_arg_typing_Any_.else_.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 275, "span_ids": ["deque_schema"], "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": "@schema_function(deque)\ndef deque_schema(schema_generator: GenerateSchema, obj: Any) -> core_schema.CoreSchema:\n if obj == deque:\n # bare `deque` type used as annotation\n return _deque_any_schema()\n\n try:\n arg = get_args(obj)[0]\n except IndexError:\n # not argument bare `Deque` is equivalent to `Deque[Any]`\n return _deque_any_schema()\n\n if arg == typing.Any:\n # `Deque[Any]`\n return _deque_any_schema()\n else:\n # `Deque[Something]`\n inner_schema = schema_generator.generate_schema(arg)\n # Use a lambda here so `apply_metadata` is called on the decimal_validator before the override is generated\n metadata = build_metadata_dict(js_cs_override=lambda: core_schema.list_schema(inner_schema))\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_after_validator_function(\n _validators.deque_typed_validator,\n core_schema.list_schema(inner_schema),\n serialization=_deque_ser_schema(inner_schema),\n metadata=metadata,\n ),\n strict_schema=core_schema.chain_schema(\n [\n core_schema.is_instance_schema(deque, json_types={'list'}),\n core_schema.list_schema(inner_schema, allow_any_iter=True),\n core_schema.general_plain_validator_function(\n _validators.deque_typed_validator,\n ),\n ],\n metadata=metadata,\n ),\n serialization=_deque_ser_schema(inner_schema),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__ordered_dict_any_schema_ordered_dict_schema.if_keys_arg_typing_Any.else_.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__ordered_dict_any_schema_ordered_dict_schema.if_keys_arg_typing_Any.else_.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 325, "span_ids": ["_ordered_dict_any_schema", "ordered_dict_schema"], "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 _ordered_dict_any_schema() -> core_schema.LaxOrStrictSchema:\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_wrap_validator_function(\n _validators.ordered_dict_any_validator, core_schema.dict_schema()\n ),\n strict_schema=core_schema.general_after_validator_function(\n lambda x, _: OrderedDict(x),\n core_schema.is_instance_schema(OrderedDict, json_types={'dict'}),\n ),\n )\n\n\n@schema_function(OrderedDict)\ndef ordered_dict_schema(schema_generator: GenerateSchema, obj: Any) -> core_schema.CoreSchema:\n if obj == OrderedDict:\n # bare `ordered_dict` type used as annotation\n return _ordered_dict_any_schema()\n\n try:\n keys_arg, values_arg = get_args(obj)\n except ValueError:\n # not argument bare `OrderedDict` is equivalent to `OrderedDict[Any, Any]`\n return _ordered_dict_any_schema()\n\n if keys_arg == typing.Any and values_arg == typing.Any:\n # `OrderedDict[Any, Any]`\n return _ordered_dict_any_schema()\n else:\n inner_schema = core_schema.dict_schema(\n schema_generator.generate_schema(keys_arg), schema_generator.generate_schema(values_arg)\n )\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_after_validator_function(\n _validators.ordered_dict_typed_validator,\n core_schema.dict_schema(\n schema_generator.generate_schema(keys_arg), schema_generator.generate_schema(values_arg)\n ),\n ),\n strict_schema=core_schema.general_after_validator_function(\n lambda x, _: OrderedDict(x),\n core_schema.chain_schema(\n [\n core_schema.is_instance_schema(OrderedDict, json_types={'dict'}),\n core_schema.dict_schema(inner_schema),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_make_strict_ip_schema_ip_v4_address_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_make_strict_ip_schema_ip_v4_address_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 343, "span_ids": ["make_strict_ip_schema", "ip_v4_address_schema"], "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 make_strict_ip_schema(tp: type[Any], metadata: Any) -> CoreSchema:\n return core_schema.general_after_validator_function(\n lambda x, _: tp(x),\n core_schema.is_instance_schema(tp, json_types={'str'}),\n metadata=metadata,\n )\n\n\n@schema_function(IPv4Address)\ndef ip_v4_address_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'ipv4'})\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_plain_validator_function(_validators.ip_v4_address_validator, metadata=metadata),\n strict_schema=make_strict_ip_schema(IPv4Address, metadata=metadata),\n serialization=core_schema.to_string_ser_schema(),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v4_interface_schema_ip_v4_interface_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v4_interface_schema_ip_v4_interface_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 346, "end_line": 355, "span_ids": ["ip_v4_interface_schema"], "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": "@schema_function(IPv4Interface)\ndef ip_v4_interface_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'ipv4interface'})\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_plain_validator_function(\n _validators.ip_v4_interface_validator, metadata=metadata\n ),\n strict_schema=make_strict_ip_schema(IPv4Interface, metadata=metadata),\n serialization=core_schema.to_string_ser_schema(),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v4_network_schema_ip_v4_network_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v4_network_schema_ip_v4_network_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 358, "end_line": 365, "span_ids": ["ip_v4_network_schema"], "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": "@schema_function(IPv4Network)\ndef ip_v4_network_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'ipv4network'})\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_plain_validator_function(_validators.ip_v4_network_validator, metadata=metadata),\n strict_schema=make_strict_ip_schema(IPv4Network, metadata=metadata),\n serialization=core_schema.to_string_ser_schema(),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_address_schema_ip_v6_address_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_address_schema_ip_v6_address_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 368, "end_line": 375, "span_ids": ["ip_v6_address_schema"], "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": "@schema_function(IPv6Address)\ndef ip_v6_address_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'ipv6'})\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_plain_validator_function(_validators.ip_v6_address_validator, metadata=metadata),\n strict_schema=make_strict_ip_schema(IPv6Address, metadata=metadata),\n serialization=core_schema.to_string_ser_schema(),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_interface_schema_ip_v6_interface_schema.return.core_schema_lax_or_strict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_interface_schema_ip_v6_interface_schema.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 387, "span_ids": ["ip_v6_interface_schema"], "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": "@schema_function(IPv6Interface)\ndef ip_v6_interface_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'ipv6interface'})\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_plain_validator_function(\n _validators.ip_v6_interface_validator, metadata=metadata\n ),\n strict_schema=make_strict_ip_schema(IPv6Interface, metadata=metadata),\n serialization=core_schema.to_string_ser_schema(),\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_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_network_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_v6_network_schema_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_std_types_schema.py", "file_name": "_std_types_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 390, "end_line": 408, "span_ids": ["url_schema", "multi_host_url_schema", "ip_v6_network_schema"], "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": "@schema_function(IPv6Network)\ndef ip_v6_network_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n metadata = build_metadata_dict(js_override={'type': 'string', 'format': 'ipv6network'})\n return core_schema.lax_or_strict_schema(\n lax_schema=core_schema.general_plain_validator_function(_validators.ip_v6_network_validator, metadata=metadata),\n strict_schema=make_strict_ip_schema(IPv6Network, metadata=metadata),\n serialization=core_schema.to_string_ser_schema(),\n )\n\n\n@schema_function(Url)\ndef url_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n return {'type': 'url'}\n\n\n@schema_function(MultiHostUrl)\ndef multi_host_url_schema(_schema_generator: GenerateSchema, _obj: Any) -> core_schema.CoreSchema:\n return {'type': 'multi-host-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_pydantic__pydantic/pydantic/_internal/_typing_extra.py____since_mypy_doesn_t_allo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py____since_mypy_doesn_t_allo", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 85, "span_ids": ["impl:27", "docstring"], "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": "\"\"\"\nLogic for interacting with type annotations, mostly extensions, shims and hacks to wrap python's typing module.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport sys\nimport types\nimport typing\nfrom collections.abc import Callable\nfrom types import GetSetDescriptorType\nfrom typing import Any, ForwardRef\n\nfrom typing_extensions import Annotated, Final, Literal, get_args, get_origin\n\n__all__ = (\n 'NoneType',\n 'is_none_type',\n 'is_callable_type',\n 'is_literal_type',\n 'all_literal_values',\n 'is_annotated',\n 'is_namedtuple',\n 'is_new_type',\n 'is_classvar',\n 'is_finalvar',\n 'WithArgsTypes',\n 'typing_base',\n 'origin_is_union',\n 'NotRequired',\n 'Required',\n 'parent_frame_namespace',\n 'get_type_hints',\n 'EllipsisType',\n 'add_module_globals',\n 'get_cls_type_hints_lenient',\n)\n\ntry:\n from typing import _TypingBase # type: ignore[attr-defined]\nexcept ImportError:\n from typing import _Final as _TypingBase # type: ignore[attr-defined]\n\ntyping_base = _TypingBase\n\n\nif sys.version_info < (3, 9):\n # python < 3.9 does not have GenericAlias (list[int], tuple[str, ...] and so on)\n TypingGenericAlias = ()\nelse:\n from typing import GenericAlias as TypingGenericAlias # type: ignore\n\n\nif sys.version_info < (3, 11):\n from typing_extensions import NotRequired, Required\nelse:\n from typing import NotRequired, Required\n\n\nif sys.version_info < (3, 10):\n\n def origin_is_union(tp: type[Any] | None) -> bool:\n return tp is typing.Union\n\n WithArgsTypes = (TypingGenericAlias,)\n\nelse:\n\n def origin_is_union(tp: type[Any] | None) -> bool:\n return tp is typing.Union or tp is types.UnionType # noqa: E721\n\n WithArgsTypes = typing._GenericAlias, types.GenericAlias, types.UnionType # type: ignore[attr-defined]\n\n\nif sys.version_info < (3, 10):\n NoneType = type(None)\n EllipsisType = type(Ellipsis)\nelse:\n from types import EllipsisType as EllipsisType\n from types import NoneType as NoneType\n\n\nNONE_TYPES: tuple[Any, Any, Any] = (None, NoneType, Literal[None])\n\n\nTypeVarType = Any # since mypy doesn't allow the use of TypeVar as a 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_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_4_literal_values.return.get_args_type__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_4_literal_values.return.get_args_type__", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 129, "span_ids": ["literal_values", "is_callable_type", "impl:27", "is_literal_type"], "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": "if sys.version_info < (3, 8):\n # Even though this implementation is slower, we need it for python 3.7:\n # In python 3.7 \"Literal\" is not a builtin type and uses a different\n # mechanism.\n # for this reason `Literal[None] is Literal[None]` evaluates to `False`,\n # breaking the faster implementation used for the other python versions.\n\n def is_none_type(type_: Any) -> bool:\n return type_ in NONE_TYPES\n\nelif sys.version_info[:2] == (3, 8):\n\n def is_none_type(type_: Any) -> bool:\n for none_type in NONE_TYPES:\n if type_ is none_type:\n return True\n # With python 3.8, specifically 3.8.10, Literal \"is\" checks are very flakey\n # can change on very subtle changes like use of types in other modules,\n # hopefully this check avoids that issue.\n if is_literal_type(type_): # pragma: no cover\n return all_literal_values(type_) == [None]\n return False\n\nelse:\n\n def is_none_type(type_: Any) -> bool:\n for none_type in NONE_TYPES:\n if type_ is none_type:\n return True\n return False\n\n\ndef is_callable_type(type_: type[Any]) -> bool:\n return type_ is Callable or get_origin(type_) is Callable\n\n\ndef is_literal_type(type_: type[Any]) -> bool:\n return Literal is not None and get_origin(type_) is Literal\n\n\ndef literal_values(type_: type[Any]) -> tuple[Any, ...]:\n return get_args(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_pydantic__pydantic/pydantic/_internal/_typing_extra.py_all_literal_values_all_literal_values.return.list_x_for_value_in_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_all_literal_values_all_literal_values.return.list_x_for_value_in_value", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 142, "span_ids": ["all_literal_values"], "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": "def all_literal_values(type_: type[Any]) -> list[Any]:\n \"\"\"\n This method is used to retrieve all Literal values as\n Literal can be used recursively (see https://www.python.org/dev/peps/pep-0586)\n e.g. `Literal[Literal[Literal[1, 2, 3], \"foo\"], 5, None]`\n \"\"\"\n if not is_literal_type(type_):\n return [type_]\n\n values = literal_values(type_)\n return list(x for value in values for x in all_literal_values(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_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_annotated_is_finalvar.return._check_finalvar_ann_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_annotated_is_finalvar.return._check_finalvar_ann_type_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 204, "span_ids": ["is_classvar", "is_new_type", "is_finalvar", "_check_finalvar", "is_annotated", "is_namedtuple", "impl:32", "_check_classvar"], "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": "def is_annotated(ann_type: Any) -> bool:\n from ._utils import lenient_issubclass\n\n origin = get_origin(ann_type)\n return origin is not None and lenient_issubclass(origin, Annotated)\n\n\ndef is_namedtuple(type_: type[Any]) -> bool:\n \"\"\"\n Check if a given class is a named tuple.\n It can be either a `typing.NamedTuple` or `collections.namedtuple`\n \"\"\"\n from ._utils import lenient_issubclass\n\n return lenient_issubclass(type_, tuple) and hasattr(type_, '_fields')\n\n\ntest_new_type = typing.NewType('test_new_type', str)\n\n\ndef is_new_type(type_: type[Any]) -> bool:\n \"\"\"\n Check whether type_ was created using typing.NewType.\n\n Can't use isinstance because it fails <3.10.\n \"\"\"\n return isinstance(type_, test_new_type.__class__) and hasattr(type_, '__supertype__') # type: ignore[arg-type]\n\n\ndef _check_classvar(v: type[Any] | None) -> bool:\n if v is None:\n return False\n\n return v.__class__ == typing.ClassVar.__class__ and getattr(v, '_name', None) == 'ClassVar'\n\n\ndef is_classvar(ann_type: type[Any]) -> bool:\n if _check_classvar(ann_type) or _check_classvar(get_origin(ann_type)):\n return True\n\n # this is an ugly workaround for class vars that contain forward references and are therefore themselves\n # forward references, see #3679\n if ann_type.__class__ == typing.ForwardRef and ann_type.__forward_arg__.startswith('ClassVar['):\n return True\n\n return False\n\n\ndef _check_finalvar(v: type[Any] | None) -> bool:\n \"\"\"\n Check if a given type is a `typing.Final` type.\n \"\"\"\n if v is None:\n return False\n\n return v.__class__ == Final.__class__ and (sys.version_info < (3, 8) or getattr(v, '_name', None) == 'Final')\n\n\ndef is_finalvar(ann_type: type[Any]) -> bool:\n return _check_finalvar(ann_type) or _check_finalvar(get_origin(ann_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_pydantic__pydantic/pydantic/_internal/_typing_extra.py_parent_frame_namespace_parent_frame_namespace.if_frame_f_back_is_None_.else_.return.frame_f_locals": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_parent_frame_namespace_parent_frame_namespace.if_frame_f_back_is_None_.else_.return.frame_f_locals", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 225, "span_ids": ["parent_frame_namespace"], "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 parent_frame_namespace(*, parent_depth: int = 2) -> dict[str, Any] | None:\n \"\"\"\n We allow use of items in parent namespace to get around the issue with `get_type_hints` only looking in the\n global module namespace. See https://github.com/pydantic/pydantic/issues/2678#issuecomment-1008139014 -> Scope\n and suggestion at the end of the next comment by @gvanrossum.\n\n WARNING 1: it matters exactly where this is called. By default, this function will build a namespace from the\n parent of where it is called.\n\n WARNING 2: this only looks in the parent namespace, not other parents since (AFAIK) there's no way to collect a\n dict of exactly what's in scope. Using `f_back` would work sometimes but would be very wrong and confusing in many\n other cases. See https://discuss.python.org/t/is-there-a-way-to-access-parent-nested-namespaces/20659.\n \"\"\"\n frame = sys._getframe(parent_depth)\n # if f_back is None, it's the global module namespace and we don't need to include it here\n if frame.f_back is None:\n return None\n else:\n return frame.f_locals", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_add_module_globals_add_module_globals.return.globalns_or_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_add_module_globals_add_module_globals.return.globalns_or_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 243, "span_ids": ["add_module_globals"], "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 add_module_globals(obj: Any, globalns: dict[str, Any] | None) -> dict[str, Any]:\n module_name = getattr(obj, '__module__', None)\n if module_name:\n try:\n module_globalns = sys.modules[module_name].__dict__\n except KeyError:\n # happens occasionally, see https://github.com/pydantic/pydantic/issues/2363\n pass\n else:\n if globalns:\n return {**module_globalns, **globalns}\n else:\n # copy module globals to make sure it can't be updated later\n return module_globalns.copy()\n\n return globalns 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_pydantic__pydantic/pydantic/_internal/_typing_extra.py_get_cls_type_hints_lenient_get_cls_type_hints_lenient.return.hints": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_get_cls_type_hints_lenient_get_cls_type_hints_lenient.return.hints", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 270, "span_ids": ["get_cls_type_hints_lenient"], "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 get_cls_type_hints_lenient(obj: Any, globalns: dict[str, Any] | None = None) -> dict[str, Any]:\n \"\"\"\n Collect annotations from a class, including those from parent classes.\n\n Unlike `typing.get_type_hints`, this function will not evaluate forward references so won't error if\n a forward reference is not resolvable.\n \"\"\"\n # TODO: Try handling typevars_map here\n hints = {}\n for base in reversed(obj.__mro__):\n ann = base.__dict__.get('__annotations__')\n localns = dict(vars(base))\n if ann is not None and ann is not GetSetDescriptorType:\n for name, value in ann.items():\n if value is None:\n value = NoneType\n elif isinstance(value, str):\n value = ForwardRef(value, is_argument=False, is_class=True)\n\n try:\n hints[name] = typing._eval_type(value, globalns, localns) # type: ignore[attr-defined]\n except NameError:\n # the point of this function is to be tolerant to this case\n hints[name] = value\n return hints", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_5_None_5._noqa_F811": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_5_None_5._noqa_F811", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 273, "end_line": 295, "span_ids": ["impl:34"], "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": "if sys.version_info < (3, 9):\n\n def ForwardRefWrapper(arg: Any, is_argument: bool = True, *, is_class: bool = False) -> typing.ForwardRef:\n \"\"\"\n Wrapper for ForwardRef that accounts for the `is_class` argument missing in older versions.\n The `module` argument is omitted as it breaks <3.9 and isn't used in the calls below.\n\n See https://github.com/python/cpython/pull/28560 for some background\n\n Implemented as EAFP with memory.\n \"\"\"\n global fr_has_is_class\n\n if not fr_has_is_class:\n return typing.ForwardRef(arg, is_argument)\n\n try:\n return typing.ForwardRef(arg, is_argument, is_class=is_class)\n except TypeError:\n fr_has_is_class = False\n return typing.ForwardRef(arg, is_argument)\n\n ForwardRef = ForwardRefWrapper # noqa F811", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_if_sys_version_info_3_if_sys_version_info_3.else_.get_type_hints.return.hints_if_include_extras_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_if_sys_version_info_3_if_sys_version_info_3.else_.get_type_hints.return.hints_if_include_extras_e", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 427, "span_ids": ["impl:34"], "tokens": 1235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, 10):\n get_type_hints = typing.get_type_hints\n\nelse:\n \"\"\"\n For older versions of python, we have a custom implementation of `get_type_hints` which is a close as possible to\n the implementation in CPython 3.10.8.\n \"\"\"\n fr_has_is_class = True\n\n @typing.no_type_check\n def get_type_hints( # noqa: C901\n obj: Any,\n globalns: dict[str, Any] | None = None,\n localns: dict[str, Any] | None = None,\n include_extras: bool = False,\n ) -> dict[str, Any]: # pragma: no cover\n \"\"\"\n Taken verbatim from python 3.10.8 unchanged, except:\n * type annotations of the function definition above.\n * prefixing `typing.` where appropriate\n * Use `ForwardRefWrapper` instead of `typing.ForwardRef`\n\n https://github.com/python/cpython/blob/aaaf5174241496afca7ce4d4584570190ff972fe/Lib/typing.py#L1773-L1875\n\n DO NOT CHANGE THIS METHOD UNLESS ABSOLUTELY NECESSARY.\n ======================================================\n\n Return type hints for an object.\n\n This is often the same as obj.__annotations__, but it handles\n forward references encoded as string literals, adds Optional[t] if a\n default value equal to None is set and recursively replaces all\n 'Annotated[T, ...]' with 'T' (unless 'include_extras=True').\n\n The argument may be a module, class, method, or function. The annotations\n are returned as a dictionary. For classes, annotations include also\n inherited members.\n\n TypeError is raised if the argument is not of a type that can contain\n annotations, and an empty dictionary is returned if no annotations are\n present.\n\n BEWARE -- the behavior of globalns and localns is counterintuitive\n (unless you are familiar with how eval() and exec() work). The\n search order is locals first, then globals.\n\n - If no dict arguments are passed, an attempt is made to use the\n globals from obj (or the respective module's globals for classes),\n and these are also used as the locals. If the object does not appear\n to have globals, an empty dictionary is used. For classes, the search\n order is globals first then locals.\n\n - If one dict argument is passed, it is used for both globals and\n locals.\n\n - If two dict arguments are passed, they specify globals and\n locals, respectively.\n \"\"\"\n\n if getattr(obj, '__no_type_check__', None):\n return {}\n # Classes require a special treatment.\n if isinstance(obj, type):\n hints = {}\n for base in reversed(obj.__mro__):\n if globalns is None:\n base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {})\n else:\n base_globals = globalns\n ann = base.__dict__.get('__annotations__', {})\n if isinstance(ann, types.GetSetDescriptorType):\n ann = {}\n base_locals = dict(vars(base)) if localns is None else localns\n if localns is None and globalns is None:\n # This is surprising, but required. Before Python 3.10,\n # get_type_hints only evaluated the globalns of\n # a class. To maintain backwards compatibility, we reverse\n # the globalns and localns order so that eval() looks into\n # *base_globals* first rather than *base_locals*.\n # This only affects ForwardRefs.\n base_globals, base_locals = base_locals, base_globals\n for name, value in ann.items():\n if value is None:\n value = type(None)\n if isinstance(value, str):\n value = ForwardRef(value, is_argument=False, is_class=True)\n\n value = typing._eval_type(value, base_globals, base_locals)\n hints[name] = value\n return hints if include_extras else {k: typing._strip_annotations(t) for k, t in hints.items()}\n\n if globalns is None:\n if isinstance(obj, types.ModuleType):\n globalns = obj.__dict__\n else:\n nsobj = obj\n # Find globalns for the unwrapped object.\n while hasattr(nsobj, '__wrapped__'):\n nsobj = nsobj.__wrapped__\n globalns = getattr(nsobj, '__globals__', {})\n if localns is None:\n localns = globalns\n elif localns is None:\n localns = globalns\n hints = getattr(obj, '__annotations__', None)\n if hints is None:\n # Return empty annotations for something that _could_ have them.\n if isinstance(obj, typing._allowed_types):\n return {}\n else:\n raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj))\n defaults = typing._get_defaults(obj)\n hints = dict(hints)\n for name, value in hints.items():\n if value is None:\n value = type(None)\n if isinstance(value, str):\n # class-level forward refs were handled above, this must be either\n # a module-level annotation or a function argument annotation\n\n value = ForwardRef(\n value,\n is_argument=not isinstance(obj, types.ModuleType),\n is_class=False,\n )\n value = typing._eval_type(value, globalns, localns)\n if name in defaults and defaults[name] is None:\n value = typing.Optional[value]\n hints[name] = value\n return hints if include_extras else {k: typing._strip_annotations(t) for k, t in hints.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_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_7_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_7_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 430, "end_line": 443, "span_ids": ["impl:43"], "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": "if sys.version_info < (3, 9):\n\n def evaluate_fwd_ref(\n ref: ForwardRef, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None\n ) -> Any:\n return ref._evaluate(globalns=globalns, localns=localns)\n\nelse:\n\n def evaluate_fwd_ref(\n ref: ForwardRef, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None\n ) -> Any:\n return ref._evaluate(globalns=globalns, localns=localns, recursive_guard=frozenset())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py___lenient_issubclass.try_.except_TypeError_._pragma_no_cover": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py___lenient_issubclass.try_.except_TypeError_._pragma_no_cover", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 97, "span_ids": ["lenient_issubclass", "lenient_isinstance", "sequence_like", "docstring"], "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": "\"\"\"\nBucket of reusable internal utilities.\n\nThis should be reduced as much as possible with functions only used in one place, moved to that place.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport keyword\nimport typing\nimport weakref\nfrom collections import OrderedDict, defaultdict, deque\nfrom copy import deepcopy\nfrom itertools import zip_longest\nfrom types import BuiltinFunctionType, CodeType, FunctionType, GeneratorType, LambdaType, ModuleType\nfrom typing import Any, TypeVar\n\nfrom typing_extensions import TypeGuard\n\nfrom . import _repr, _typing_extra\n\nif typing.TYPE_CHECKING:\n MappingIntStrAny = typing.Mapping[int | str, Any]\n AbstractSetIntStr = typing.AbstractSet[int | str]\n from ..main import BaseModel\n\n__all__ = (\n 'sequence_like',\n 'lenient_isinstance',\n 'lenient_issubclass',\n 'is_valid_identifier',\n 'deep_update',\n 'update_not_none',\n 'almost_equal_floats',\n 'to_camel',\n 'smart_deepcopy',\n 'ValueItems',\n 'ClassAttribute',\n 'dict_not_none',\n 'AbstractSetIntStr',\n 'MappingIntStrAny',\n 'all_identical',\n)\n\n# these are types that are returned unchanged by deepcopy\nIMMUTABLE_NON_COLLECTIONS_TYPES: set[type[Any]] = {\n int,\n float,\n complex,\n str,\n bool,\n bytes,\n type,\n _typing_extra.NoneType,\n FunctionType,\n BuiltinFunctionType,\n LambdaType,\n weakref.ref,\n CodeType,\n # note: including ModuleType will differ from behaviour of deepcopy by not producing error.\n # It might be not a good idea in general, but considering that this function used only internally\n # against default values of fields, this will allow to actually have a field with module as default value\n ModuleType,\n NotImplemented.__class__,\n Ellipsis.__class__,\n}\n\n# these are types that if empty, might be copied with simple copy() instead of deepcopy()\nBUILTIN_COLLECTIONS: set[type[Any]] = {\n list,\n set,\n tuple,\n frozenset,\n dict,\n OrderedDict,\n defaultdict,\n deque,\n}\n\n\ndef sequence_like(v: Any) -> bool:\n return isinstance(v, (list, tuple, set, frozenset, GeneratorType, deque))\n\n\ndef lenient_isinstance(o: Any, class_or_tuple: type[Any] | tuple[type[Any], ...] | None) -> bool:\n try:\n return isinstance(o, class_or_tuple) # type: ignore[arg-type]\n except TypeError:\n return False\n\n\ndef lenient_issubclass(cls: Any, class_or_tuple: Any) -> bool:\n try:\n return isinstance(cls, type) and issubclass(cls, class_or_tuple)\n except TypeError:\n if isinstance(cls, _typing_extra.WithArgsTypes):\n return False\n raise # pragma: no cover", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_is_basemodel_is_basemodel.return.lenient_issubclass_cls_B": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_is_basemodel_is_basemodel.return.lenient_issubclass_cls_B", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 111, "span_ids": ["is_basemodel"], "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_basemodel(cls: Any) -> TypeGuard[type[BaseModel]]:\n \"\"\"\n We can remove this function and go back to using lenient_issubclass, but this is nice because it\n ensures that we get proper type-checking, which lenient_issubclass doesn't provide.\n\n Would be nice if there was a lenient_issubclass-equivalent in typing_extensions, or otherwise\n a way to define such a function that would support proper type-checking; maybe we should bring it up\n at the typing summit..\n \"\"\"\n from ..main import BaseModel\n\n return lenient_issubclass(cls, BaseModel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_is_valid_identifier_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_is_valid_identifier_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 163, "span_ids": ["to_lower_camel", "update_not_none", "deep_update", "impl:12", "impl:14", "to_camel", "almost_equal_floats", "dict_not_none", "is_valid_identifier"], "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 is_valid_identifier(identifier: str) -> bool:\n \"\"\"\n Checks that a string is a valid identifier and not a Python keyword.\n :param identifier: The identifier to test.\n :return: True if the identifier is valid.\n \"\"\"\n return identifier.isidentifier() and not keyword.iskeyword(identifier)\n\n\nKeyType = TypeVar('KeyType')\n\n\ndef deep_update(mapping: dict[KeyType, Any], *updating_mappings: dict[KeyType, Any]) -> dict[KeyType, Any]:\n updated_mapping = mapping.copy()\n for updating_mapping in updating_mappings:\n for k, v in updating_mapping.items():\n if k in updated_mapping and isinstance(updated_mapping[k], dict) and isinstance(v, dict):\n updated_mapping[k] = deep_update(updated_mapping[k], v)\n else:\n updated_mapping[k] = v\n return updated_mapping\n\n\ndef dict_not_none(__pos: dict[str, Any] = None, **kwargs: Any) -> dict[str, Any]:\n return {k: v for k, v in (__pos or kwargs).items() if v is not None}\n\n\ndef update_not_none(mapping: dict[Any, Any], **update: Any) -> None:\n mapping.update({k: v for k, v in update.items() if v is not None})\n\n\ndef almost_equal_floats(value_1: float, value_2: float, *, delta: float = 1e-8) -> bool:\n \"\"\"\n Return True if two floats are almost equal\n \"\"\"\n return abs(value_1 - value_2) <= delta\n\n\ndef to_camel(string: str) -> str:\n return ''.join(word.capitalize() for word in string.split('_'))\n\n\ndef to_lower_camel(string: str) -> str:\n if len(string) >= 1:\n pascal_string = to_camel(string)\n return pascal_string[0].lower() + pascal_string[1:]\n return string.lower()\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_pydantic__pydantic/pydantic/_internal/_utils.py_unique_list_unique_list.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_unique_list_unique_list.return.result", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 186, "span_ids": ["unique_list"], "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 unique_list(\n input_list: list[T] | tuple[T, ...],\n *,\n name_factory: typing.Callable[[T], str] = str,\n) -> list[T]:\n \"\"\"\n Make a list unique while maintaining order.\n We update the list if another one with the same name is set\n (e.g. root validator overridden in subclass)\n \"\"\"\n result: list[T] = []\n result_names: list[str] = []\n for v in input_list:\n v_name = name_factory(v)\n if v_name not in result_names:\n result_names.append(v_name)\n result.append(v)\n else:\n result[result_names.index(v_name)] = v\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_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems_ValueItems.for_element.return.item_if_not_self_is_true_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems_ValueItems.for_element.return.item_if_not_self_is_true_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 227, "span_ids": ["ValueItems.is_included", "ValueItems.for_element", "ValueItems.is_excluded", "ValueItems.__init__", "ValueItems"], "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 ValueItems(_repr.Representation):\n \"\"\"\n Class for more convenient calculation of excluded or included fields on values.\n \"\"\"\n\n __slots__ = ('_items', '_type')\n\n def __init__(self, value: Any, items: AbstractSetIntStr | MappingIntStrAny) -> None:\n items = self._coerce_items(items)\n\n if isinstance(value, (list, tuple)):\n items = self._normalize_indexes(items, len(value))\n\n self._items: MappingIntStrAny = items\n\n def is_excluded(self, item: Any) -> bool:\n \"\"\"\n Check if item is fully excluded.\n\n :param item: key or index of a value\n \"\"\"\n return self.is_true(self._items.get(item))\n\n def is_included(self, item: Any) -> bool:\n \"\"\"\n Check if value is contained in self._items\n\n :param item: key or index of value\n \"\"\"\n return item in self._items\n\n def for_element(self, e: int | str) -> AbstractSetIntStr | MappingIntStrAny | None:\n \"\"\"\n :param e: key or index of element on value\n :return: raw values for element if self._items is dict and contain needed element\n \"\"\"\n\n item = self._items.get(e)\n return item if not self.is_true(item) 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_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems._normalize_indexes_ValueItems._normalize_indexes.return.normalized_items": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems._normalize_indexes_ValueItems._normalize_indexes.return.normalized_items", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 266, "span_ids": ["ValueItems._normalize_indexes"], "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": "class ValueItems(_repr.Representation):\n\n def _normalize_indexes(self, items: MappingIntStrAny, v_length: int) -> dict[int | str, Any]:\n \"\"\"\n :param items: dict or set of indexes which will be normalized\n :param v_length: length of sequence indexes of which will be\n\n >>> self._normalize_indexes({0: True, -2: True, -1: True}, 4)\n {0: True, 2: True, 3: True}\n >>> self._normalize_indexes({'__all__': True}, 4)\n {0: True, 1: True, 2: True, 3: True}\n \"\"\"\n\n normalized_items: dict[int | str, Any] = {}\n all_items = None\n for i, v in items.items():\n if not (isinstance(v, typing.Mapping) or isinstance(v, typing.AbstractSet) or self.is_true(v)):\n raise TypeError(f'Unexpected type of exclude value for index \"{i}\" {v.__class__}')\n if i == '__all__':\n all_items = self._coerce_value(v)\n continue\n if not isinstance(i, int):\n raise TypeError(\n 'Excluding fields from a sequence of sub-models or dicts must be performed index-wise: '\n 'expected integer keys or keyword \"__all__\"'\n )\n normalized_i = v_length + i if i < 0 else i\n normalized_items[normalized_i] = self.merge(v, normalized_items.get(normalized_i))\n\n if not all_items:\n return normalized_items\n if self.is_true(all_items):\n for i in range(v_length):\n normalized_items.setdefault(i, ...)\n return normalized_items\n for i in range(v_length):\n normalized_item = normalized_items.setdefault(i, {})\n if not self.is_true(normalized_item):\n normalized_items[i] = self.merge(all_items, normalized_item)\n return normalized_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_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems.merge_ValueItems.merge.return.merged": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems.merge_ValueItems.merge.return.merged", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 268, "end_line": 305, "span_ids": ["ValueItems.merge"], "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 ValueItems(_repr.Representation):\n\n @classmethod\n def merge(cls, base: Any, override: Any, intersect: bool = False) -> Any:\n \"\"\"\n Merge a ``base`` item with an ``override`` item.\n\n Both ``base`` and ``override`` are converted to dictionaries if possible.\n Sets are converted to dictionaries with the sets entries as keys and\n Ellipsis as values.\n\n Each key-value pair existing in ``base`` is merged with ``override``,\n while the rest of the key-value pairs are updated recursively with this function.\n\n Merging takes place based on the \"union\" of keys if ``intersect`` is\n set to ``False`` (default) and on the intersection of keys if\n ``intersect`` is set to ``True``.\n \"\"\"\n override = cls._coerce_value(override)\n base = cls._coerce_value(base)\n if override is None:\n return base\n if cls.is_true(base) or base is None:\n return override\n if cls.is_true(override):\n return base if intersect else override\n\n # intersection or union of keys while preserving ordering:\n if intersect:\n merge_keys = [k for k in base if k in override] + [k for k in override if k in base]\n else:\n merge_keys = list(base) + [k for k in override if k not in base]\n\n merged: dict[int | str, Any] = {}\n for k in merge_keys:\n merged_item = cls.merge(base.get(k), override.get(k), intersect=intersect)\n if merged_item is not None:\n merged[k] = merged_item\n\n return merged", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems._coerce_items_ValueItems.__repr_args__.return._None_self__items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_ValueItems._coerce_items_ValueItems.__repr_args__.return._None_self__items_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 329, "span_ids": ["ValueItems._coerce_items", "ValueItems._coerce_value", "ValueItems.__repr_args__", "ValueItems.is_true"], "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 ValueItems(_repr.Representation):\n\n @staticmethod\n def _coerce_items(items: AbstractSetIntStr | MappingIntStrAny) -> MappingIntStrAny:\n if isinstance(items, typing.Mapping):\n pass\n elif isinstance(items, typing.AbstractSet):\n items = dict.fromkeys(items, ...)\n else:\n class_name = getattr(items, '__class__', '???')\n raise TypeError(f'Unexpected type of exclude value {class_name}')\n return items\n\n @classmethod\n def _coerce_value(cls, value: Any) -> Any:\n if value is None or cls.is_true(value):\n return value\n return cls._coerce_items(value)\n\n @staticmethod\n def is_true(v: Any) -> bool:\n return v is True or v is ...\n\n def __repr_args__(self) -> _repr.ReprArgs:\n return [(None, 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_pydantic__pydantic/pydantic/_internal/_utils.py_None_1_Obj.TypeVar_Obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_None_1_Obj.TypeVar_Obj_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 356, "span_ids": ["impl:16"], "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": "if typing.TYPE_CHECKING:\n\n def ClassAttribute(name: str, value: T) -> T:\n ...\n\nelse:\n\n class ClassAttribute:\n \"\"\"\n Hide class attribute from its instances\n \"\"\"\n\n __slots__ = 'name', 'value'\n\n def __init__(self, name: str, value: Any) -> None:\n self.name = name\n self.value = value\n\n def __get__(self, instance: Any, owner: type[Any]) -> None:\n if instance is None:\n return self.value\n raise AttributeError(f'{self.name!r} attribute of {owner.__name__!r} is class-only')\n\n\nObj = TypeVar('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_pydantic__pydantic/pydantic/_internal/_utils.py_smart_deepcopy_smart_deepcopy._slowest_way_when_we_act": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_smart_deepcopy_smart_deepcopy._slowest_way_when_we_act", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 377, "span_ids": ["smart_deepcopy"], "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": "def smart_deepcopy(obj: Obj) -> Obj:\n \"\"\"\n Return type as is for immutable built-in types\n Use obj.copy() for built-in empty collections\n Use copy.deepcopy() for non-empty collections and unknown objects\n \"\"\"\n\n obj_type = obj.__class__\n if obj_type in IMMUTABLE_NON_COLLECTIONS_TYPES:\n return obj # fastest case: obj is immutable and not collection therefore will not be copied anyway\n try:\n if not obj and obj_type in BUILTIN_COLLECTIONS:\n # faster way for empty collections, no need to copy its members\n return obj if obj_type is tuple else obj.copy() # type: ignore # tuple doesn't have copy method\n except (TypeError, ValueError, RuntimeError):\n # do we really dare to catch ALL errors? Seems a bit risky\n pass\n\n return deepcopy(obj) # slowest way when we actually might need a deepcopy", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__EMPTY_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__EMPTY_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 397, "span_ids": ["impl:20", "all_identical"], "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": "_EMPTY = object()\n\n\ndef all_identical(left: typing.Iterable[Any], right: typing.Iterable[Any]) -> bool:\n \"\"\"\n Check that the items of `left` are the same objects as those in `right`.\n\n >>> a, b = object(), object()\n >>> all_identical([a, b, a], [a, b, a])\n True\n >>> all_identical([a, b, [a]], [a, b, [a]]) # new list object, while \"equal\" is not \"identical\"\n False\n \"\"\"\n for left_item, right_item in zip_longest(left, right, fillvalue=_EMPTY):\n if left_item is not right_item:\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_pydantic__pydantic/pydantic/_internal/_validators.py____fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py____fields", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "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": "\"\"\"\nValidator functions for standard library types.\n\nImport of this module is deferred since it contains imports of many standard library modules.\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport re\nimport typing\nfrom collections import OrderedDict, defaultdict, deque\nfrom decimal import Decimal, DecimalException\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom pathlib import Path\nfrom typing import Any\nfrom uuid import UUID\n\nfrom pydantic_core import PydanticCustomError, PydanticKnownError, core_schema\n\nfrom . import _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_pydantic__pydantic/pydantic/_internal/_validators.py_mapping_validator_construct_counter.return.typing_Counter___input_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_mapping_validator_construct_counter.return.typing_Counter___input_va", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 23, "end_line": 49, "span_ids": ["mapping_validator", "construct_counter"], "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 mapping_validator(\n __input_value: typing.Mapping[Any, Any],\n validator: core_schema.ValidatorFunctionWrapHandler,\n info: core_schema.ValidationInfo,\n) -> typing.Mapping[Any, Any]:\n \"\"\"\n Validator for `Mapping` types, if required `isinstance(v, Mapping)` has already been called.\n \"\"\"\n v_dict = validator(__input_value)\n value_type = type(__input_value)\n\n # the rest of the logic is just re-creating the original type from `v_dict`\n if value_type == dict:\n return v_dict\n elif issubclass(value_type, defaultdict):\n default_factory = __input_value.default_factory # type: ignore[attr-defined]\n return value_type(default_factory, v_dict)\n else:\n # best guess at how to re-create the original type, more custom construction logic might be required\n return value_type(v_dict) # type: ignore[call-arg]\n\n\ndef construct_counter(__input_value: typing.Mapping[Any, Any], _: core_schema.ValidationInfo) -> typing.Counter[Any]:\n \"\"\"\n Validator for `Counter` types, if required `isinstance(v, Counter)` has already been called.\n \"\"\"\n return typing.Counter(__input_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_pydantic__pydantic/pydantic/_internal/_validators.py_sequence_validator_sequence_validator.if_value_type_list_.else_._type_ignore_call_arg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_sequence_validator_sequence_validator.if_value_type_list_.else_._type_ignore_call_arg_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 83, "span_ids": ["sequence_validator"], "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 sequence_validator(\n __input_value: typing.Sequence[Any],\n validator: core_schema.ValidatorFunctionWrapHandler,\n _: core_schema.ValidationInfo,\n) -> typing.Sequence[Any]:\n \"\"\"\n Validator for `Sequence` types, isinstance(v, Sequence) has already been called.\n \"\"\"\n value_type = type(__input_value)\n v_list = validator(__input_value)\n\n # the rest of the logic is just re-creating the original type from `v_list`\n if value_type == list:\n return v_list\n elif issubclass(value_type, str):\n try:\n return ''.join(v_list)\n except TypeError:\n # can happen if you pass a string like '123' to `Sequence[int]`\n raise PydanticKnownError('string_type')\n elif issubclass(value_type, bytes):\n try:\n return b''.join(v_list)\n except TypeError:\n # can happen if you pass a string like '123' to `Sequence[int]`\n raise PydanticKnownError('bytes_type')\n elif issubclass(value_type, range):\n # return the list as we probably can't re-create the range\n return v_list\n else:\n # best guess at how to re-create the original type, more custom construction logic might be required\n return value_type(v_list) # type: ignore[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_pydantic__pydantic/pydantic/_internal/_validators.py_import_string__import_string_logic.None_1.except_AttributeError_as_.raise_ImportError_f_Modul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_import_string__import_string_logic.None_1.except_AttributeError_as_.raise_ImportError_f_Modul", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 113, "span_ids": ["_import_string_logic", "import_string"], "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 import_string(value: Any) -> Any:\n if isinstance(value, str):\n try:\n return _import_string_logic(value)\n except ImportError as e:\n raise PydanticCustomError('import_error', 'Invalid python path: {error}', {'error': str(e)})\n else:\n # otherwise we just return the value and let the next validator do the rest of the work\n return value\n\n\ndef _import_string_logic(dotted_path: str) -> Any:\n \"\"\"\n Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the\n last name in the path. Raise ImportError if the import fails.\n \"\"\"\n from importlib import import_module\n\n try:\n module_path, class_name = dotted_path.strip(' ').rsplit('.', 1)\n except ValueError as e:\n raise ImportError(f'\"{dotted_path}\" doesn\\'t look like a module path') from e\n\n module = import_module(module_path)\n try:\n return getattr(module, class_name)\n except AttributeError as e:\n raise ImportError(f'Module \"{module_path}\" does not define a \"{class_name}\" attribute') 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_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator_DecimalValidator.__init__.self.strict.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator_DecimalValidator.__init__.self.strict.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 140, "span_ids": ["DecimalValidator", "DecimalValidator.__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": "class DecimalValidator(_fields.CustomValidator):\n __slots__ = (\n 'gt',\n 'ge',\n 'lt',\n 'le',\n 'max_digits',\n 'decimal_places',\n 'multiple_of',\n 'allow_inf_nan',\n 'check_digits',\n 'strict',\n )\n\n def __init__(self) -> None:\n self.gt: int | Decimal | None = None\n self.ge: int | Decimal | None = None\n self.lt: int | Decimal | None = None\n self.le: int | Decimal | None = None\n self.max_digits: int | None = None\n self.decimal_places: int | None = None\n self.multiple_of: int | Decimal | None = None\n self.allow_inf_nan: bool = False\n self.check_digits: bool = False\n self.strict: bool = 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_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator.json_schema_override_schema_DecimalValidator.__pydantic_update_schema__.if_self_check_digits_and_.raise_ValueError_allow_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator.json_schema_override_schema_DecimalValidator.__pydantic_update_schema__.if_self_check_digits_and_.raise_ValueError_allow_i", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 164, "span_ids": ["DecimalValidator.json_schema_override_schema", "DecimalValidator.__pydantic_update_schema__"], "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 DecimalValidator(_fields.CustomValidator):\n\n def json_schema_override_schema(self) -> core_schema.CoreSchema:\n \"\"\"\n This function is used to produce an \"override schema\" for generating the JSON schema of fields of type Decimal.\n\n The purpose of an override schema is to use the pre-existing approach to producing a JSON schema from a\n CoreSchema, where we know we want to use a different CoreSchema for the purposes of JSON schema generation.\n (Generally because we know what we want and an appropriately simplified CoreSchema will produce it.)\n \"\"\"\n return core_schema.float_schema(\n allow_inf_nan=self.allow_inf_nan,\n multiple_of=None if self.multiple_of is None else float(self.multiple_of),\n le=None if self.le is None else float(self.le),\n ge=None if self.ge is None else float(self.ge),\n lt=None if self.lt is None else float(self.lt),\n gt=None if self.gt is None else float(self.gt),\n )\n\n def __pydantic_update_schema__(self, schema: core_schema.CoreSchema, **kwargs: Any) -> None:\n self._update_attrs(kwargs)\n\n self.check_digits = self.max_digits is not None or self.decimal_places is not None\n if self.check_digits and self.allow_inf_nan:\n raise ValueError('allow_inf_nan=True cannot be used with max_digits or decimal_places')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator.__call___DecimalValidator.__repr__.return.f_DecimalValidator_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_DecimalValidator.__call___DecimalValidator.__repr__.return.f_DecimalValidator_s_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 249, "span_ids": ["DecimalValidator.__repr__", "DecimalValidator.__call__"], "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 DecimalValidator(_fields.CustomValidator):\n\n def __call__( # noqa: C901 (ignore complexity)\n self, __input_value: int | float | str, _: core_schema.ValidationInfo\n ) -> Decimal:\n if isinstance(__input_value, Decimal):\n value = __input_value\n else:\n try:\n value = Decimal(str(__input_value))\n except DecimalException:\n raise PydanticCustomError('decimal_parsing', 'Input should be a valid decimal')\n\n if not self.allow_inf_nan or self.check_digits:\n _1, digit_tuple, exponent = value.as_tuple()\n if not self.allow_inf_nan and exponent in {'F', 'n', 'N'}:\n raise PydanticKnownError('finite_number')\n\n if self.check_digits:\n if isinstance(exponent, str):\n raise PydanticKnownError('finite_number')\n elif exponent >= 0:\n # A positive exponent adds that many trailing zeros.\n digits = len(digit_tuple) + exponent\n decimals = 0\n else:\n # If the absolute value of the negative exponent is larger than the\n # number of digits, then it's the same as the number of digits,\n # because it'll consume all the digits in digit_tuple and then\n # add abs(exponent) - len(digit_tuple) leading zeros after the\n # decimal point.\n if abs(exponent) > len(digit_tuple):\n digits = decimals = abs(exponent)\n else:\n digits = len(digit_tuple)\n decimals = abs(exponent)\n\n if self.max_digits is not None and digits > self.max_digits:\n raise PydanticCustomError(\n 'decimal_max_digits',\n 'ensure that there are no more than {max_digits} digits in total',\n {'max_digits': self.max_digits},\n )\n\n if self.decimal_places is not None and decimals > self.decimal_places:\n raise PydanticCustomError(\n 'decimal_max_places',\n 'ensure that there are no more than {decimal_places} decimal places',\n {'decimal_places': self.decimal_places},\n )\n\n if self.max_digits is not None and self.decimal_places is not None:\n whole_digits = digits - decimals\n expected = self.max_digits - self.decimal_places\n if whole_digits > expected:\n raise PydanticCustomError(\n 'decimal_whole_digits',\n 'ensure that there are no more than {whole_digits} digits before the decimal point',\n {'whole_digits': expected},\n )\n\n if self.multiple_of is not None:\n mod = value / self.multiple_of % 1\n if mod != 0:\n raise PydanticCustomError(\n 'decimal_multiple_of',\n 'Input should be a multiple of {multiple_of}',\n {'multiple_of': self.multiple_of},\n )\n\n if self.gt is not None and not value > self.gt:\n raise PydanticKnownError('greater_than', {'gt': self.gt})\n elif self.ge is not None and not value >= self.ge:\n raise PydanticKnownError('greater_than_equal', {'ge': self.ge})\n\n if self.lt is not None and not value < self.lt:\n raise PydanticKnownError('less_than', {'lt': self.lt})\n if self.le is not None and not value <= self.le:\n raise PydanticKnownError('less_than_equal', {'le': self.le})\n\n return value\n\n def __repr__(self) -> str:\n slots = [(k, getattr(self, k)) for k in self.__slots__]\n s = ', '.join(f'{k}={v!r}' for k, v in slots if v is not None)\n return f'DecimalValidator({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_pydantic__pydantic/pydantic/_internal/_validators.py_uuid_validator_uuid_validator.try_.except_ValueError_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_uuid_validator_uuid_validator.try_.except_ValueError_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 264, "span_ids": ["uuid_validator"], "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": "def uuid_validator(__input_value: str | bytes, _: core_schema.ValidationInfo) -> UUID:\n try:\n if isinstance(__input_value, str):\n return UUID(__input_value)\n else:\n try:\n return UUID(__input_value.decode())\n except ValueError:\n # 16 bytes in big-endian order as the bytes argument fail\n # the above check\n return UUID(bytes=__input_value)\n except ValueError:\n raise PydanticCustomError('uuid_parsing', 'Input should be a valid UUID, unable to parse string as an UUID')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_path_validator_pattern_either_validator.if_isinstance___input_val.else_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_path_validator_pattern_either_validator.if_isinstance___input_val.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 267, "end_line": 281, "span_ids": ["pattern_either_validator", "path_validator"], "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 path_validator(__input_value: str, _: core_schema.ValidationInfo) -> Path:\n try:\n return Path(__input_value)\n except TypeError:\n raise PydanticCustomError('path_type', 'Input is not a valid path')\n\n\ndef pattern_either_validator(__input_value: Any, _: core_schema.ValidationInfo) -> typing.Pattern[Any]:\n if isinstance(__input_value, typing.Pattern):\n return __input_value\n elif isinstance(__input_value, (str, bytes)):\n # todo strict mode\n return compile_pattern(__input_value)\n else:\n raise PydanticCustomError('pattern_type', 'Input should be a valid pattern')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_str_validator_pattern_str_validator.if_isinstance___input_val.else_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_str_validator_pattern_str_validator.if_isinstance___input_val.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 295, "span_ids": ["pattern_str_validator"], "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 pattern_str_validator(__input_value: Any, _: core_schema.ValidationInfo) -> typing.Pattern[str]:\n if isinstance(__input_value, typing.Pattern):\n if isinstance(__input_value.pattern, str):\n return __input_value\n else:\n raise PydanticCustomError('pattern_str_type', 'Input should be a string pattern')\n elif isinstance(__input_value, str):\n return compile_pattern(__input_value)\n elif isinstance(__input_value, bytes):\n raise PydanticCustomError('pattern_str_type', 'Input should be a string pattern')\n else:\n raise PydanticCustomError('pattern_type', 'Input should be a valid pattern')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_bytes_validator_pattern_bytes_validator.if_isinstance___input_val.else_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_bytes_validator_pattern_bytes_validator.if_isinstance___input_val.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 309, "span_ids": ["pattern_bytes_validator"], "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 pattern_bytes_validator(__input_value: Any, _: core_schema.ValidationInfo) -> Any:\n if isinstance(__input_value, typing.Pattern):\n if isinstance(__input_value.pattern, bytes):\n return __input_value\n else:\n raise PydanticCustomError('pattern_bytes_type', 'Input should be a bytes pattern')\n elif isinstance(__input_value, bytes):\n return compile_pattern(__input_value)\n elif isinstance(__input_value, str):\n raise PydanticCustomError('pattern_bytes_type', 'Input should be a bytes pattern')\n else:\n raise PydanticCustomError('pattern_type', 'Input should be a valid pattern')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_PatternType_ip_v6_address_validator.try_.except_ValueError_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_PatternType_ip_v6_address_validator.try_.except_ValueError_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 312, "end_line": 365, "span_ids": ["ordered_dict_typed_validator", "compile_pattern", "deque_typed_validator", "impl", "ip_v6_address_validator", "deque_any_validator", "ordered_dict_any_validator", "ip_v4_address_validator"], "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": "PatternType = typing.TypeVar('PatternType', str, bytes)\n\n\ndef compile_pattern(pattern: PatternType) -> typing.Pattern[PatternType]:\n try:\n return re.compile(pattern)\n except re.error:\n raise PydanticCustomError('pattern_regex', 'Input should be a valid regular expression')\n\n\ndef deque_any_validator(\n __input_value: Any, validator: core_schema.ValidatorFunctionWrapHandler, _: core_schema.ValidationInfo\n) -> deque[Any]:\n if isinstance(__input_value, deque):\n return __input_value\n else:\n return deque(validator(__input_value))\n\n\ndef deque_typed_validator(__input_value: list[Any], _: core_schema.ValidationInfo) -> deque[Any]:\n return deque(__input_value)\n\n\ndef ordered_dict_any_validator(\n __input_value: Any, validator: core_schema.ValidatorFunctionWrapHandler, _: core_schema.ValidationInfo\n) -> OrderedDict[Any, Any]:\n if isinstance(__input_value, OrderedDict):\n return __input_value\n else:\n return OrderedDict(validator(__input_value))\n\n\ndef ordered_dict_typed_validator(__input_value: list[Any], _: core_schema.ValidationInfo) -> OrderedDict[Any, Any]:\n return OrderedDict(__input_value)\n\n\ndef ip_v4_address_validator(__input_value: Any, _: core_schema.ValidationInfo) -> IPv4Address:\n if isinstance(__input_value, IPv4Address):\n return __input_value\n\n try:\n return IPv4Address(__input_value)\n except ValueError:\n raise PydanticCustomError('ip_v4_address', 'Input is not a valid IPv4 address')\n\n\ndef ip_v6_address_validator(__input_value: Any, _: core_schema.ValidationInfo) -> IPv6Address:\n if isinstance(__input_value, IPv6Address):\n return __input_value\n\n try:\n return IPv6Address(__input_value)\n except ValueError:\n raise PydanticCustomError('ip_v6_address', 'Input is not a valid IPv6 address')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v4_network_validator_ip_v4_network_validator.try_.except_ValueError_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v4_network_validator_ip_v4_network_validator.try_.except_ValueError_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 368, "end_line": 381, "span_ids": ["ip_v4_network_validator"], "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": "def ip_v4_network_validator(__input_value: Any, _: core_schema.ValidationInfo) -> IPv4Network:\n \"\"\"\n Assume IPv4Network initialised with a default ``strict`` argument\n\n See more:\n https://docs.python.org/library/ipaddress.html#ipaddress.IPv4Network\n \"\"\"\n if isinstance(__input_value, IPv4Network):\n return __input_value\n\n try:\n return IPv4Network(__input_value)\n except ValueError:\n raise PydanticCustomError('ip_v4_network', 'Input is not a valid IPv4 network')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v6_network_validator_ip_v6_network_validator.try_.except_ValueError_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v6_network_validator_ip_v6_network_validator.try_.except_ValueError_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 397, "span_ids": ["ip_v6_network_validator"], "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": "def ip_v6_network_validator(__input_value: Any, _: core_schema.ValidationInfo) -> IPv6Network:\n \"\"\"\n Assume IPv6Network initialised with a default ``strict`` argument\n\n See more:\n https://docs.python.org/library/ipaddress.html#ipaddress.IPv6Network\n \"\"\"\n if isinstance(__input_value, IPv6Network):\n return __input_value\n\n try:\n return IPv6Network(__input_value)\n except ValueError:\n raise PydanticCustomError('ip_v6_network', 'Input is not a valid IPv6 network')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v4_interface_validator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_ip_v4_interface_validator_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 418, "span_ids": ["ip_v6_interface_validator", "ip_v4_interface_validator"], "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 ip_v4_interface_validator(__input_value: Any, _: core_schema.ValidationInfo) -> IPv4Interface:\n if isinstance(__input_value, IPv4Interface):\n return __input_value\n\n try:\n return IPv4Interface(__input_value)\n except ValueError:\n raise PydanticCustomError('ip_v4_interface', 'Input is not a valid IPv4 interface')\n\n\ndef ip_v6_interface_validator(__input_value: Any, _: core_schema.ValidationInfo) -> IPv6Interface:\n if isinstance(__input_value, IPv6Interface):\n return __input_value\n\n try:\n return IPv6Interface(__input_value)\n except ValueError:\n raise PydanticCustomError('ip_v6_interface', 'Input is not a valid IPv6 interface')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_from___future___import_an_if_TYPE_CHECKING_.IncEx.Union_Set_int_Set_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_from___future___import_an_if_TYPE_CHECKING_.IncEx.Union_Set_int_Set_str_", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["imports"], "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": "from __future__ import annotations as _annotations\n\nimport sys\nfrom typing import TYPE_CHECKING, Any, Dict, Generic, Iterable, Set, TypeVar, Union, overload\n\nfrom pydantic_core import CoreConfig, CoreSchema, SchemaSerializer, SchemaValidator, core_schema\nfrom typing_extensions import Literal\n\nfrom pydantic.config import ConfigDict\nfrom pydantic.json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema\n\nfrom ._internal import _generate_schema, _typing_extra\n\nT = TypeVar('T')\n\nif TYPE_CHECKING:\n # should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope\n IncEx = Union[Set[int], Set[str], Dict[int, Any], Dict[str, 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_pydantic__pydantic/pydantic/analyzed_type.py__get_schema__get_schema.return.gen_generate_schema_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py__get_schema__get_schema.return.gen_generate_schema_type_", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 65, "span_ids": ["_get_schema"], "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 _get_schema(type_: Any, config: CoreConfig | None, parent_depth: int) -> CoreSchema:\n \"\"\"\n BaseModel uses it's own __module__ to find out where it was defined\n and then look for symbols to resolve forward references in those globals\n On the other hand this function can be called with arbitrary objects,\n including type aliases where __module__ (always `typing.py`) is not useful\n So instead we look at the globals in our parent stack frame\n This works for the case where this function is called in a module that\n has the target of forward references in its scope but\n does not work for more complex cases\n for example, take the following:\n\n a.py\n ```python\n from typing import List, Dict\n IntList = List[int]\n OuterDict = Dict[str, 'IntList']\n ```\n\n b.py\n ```python\n from pydantic import AnalyzedType\n from a import OuterDict\n IntList = int # replaces the symbol the forward reference is looking for\n v = AnalyzedType(OuterDict)\n v({\"x\": 1}) # should fail but doesn't\n ```\n\n If OuterDict were a BaseModel this would work because it would resolve\n the forward reference within the `a.py` namespace.\n But `AnalyzedType(OuterDict)`\n can't know what module OuterDict came from.\n In other words, the assumption that _all_ forward references exist in the\n module we are being called from is not technically always true\n Although most of the time it is and it works fine for recursive models and such/\n BaseModel's behavior isn't perfect either and _can_ break in similar ways,\n so there is no right or wrong between the two.\n But at the very least this behavior is _subtly_ different from BaseModel's.\n \"\"\"\n arbitrary_types = bool((config or {}).get('arbitrary_types_allowed', False))\n local_ns = _typing_extra.parent_frame_namespace(parent_depth=parent_depth)\n global_ns = sys._getframe(max(parent_depth - 1, 1)).f_globals.copy()\n global_ns.update(local_ns or {})\n gen = _generate_schema.GenerateSchema(arbitrary_types=arbitrary_types, types_namespace=global_ns, typevars_map={})\n return gen.generate_schema(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_pydantic__pydantic/pydantic/analyzed_type.py__TODO_merge_replace_t__translate_config._type_ignore_misc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py__TODO_merge_replace_t__translate_config._type_ignore_misc_", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 97, "span_ids": ["_get_schema", "_translate_config"], "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": "# TODO: merge / replace this with _internal/_generate_schema.py::generate_config\n# once we change the config logic to make ConfigDict not be a partial\ndef _translate_config(config: ConfigDict) -> core_schema.CoreConfig:\n \"\"\"\n Create a pydantic-core config from a pydantic config.\n \"\"\"\n unset: Any = object()\n core_config: dict[str, Any] = dict(\n title=config['title'] if 'title' in config and config['title'] is not None else unset,\n typed_dict_extra_behavior=config['extra'].value if 'extra' in config and config['extra'] is not None else unset,\n allow_inf_nan=config['allow_inf_nan'] if 'allow_inf_nan' in config else unset,\n populate_by_name=config['populate_by_name'] if 'populate_by_name' in config else unset,\n str_strip_whitespace=config['str_strip_whitespace'] if 'str_strip_whitespace' in config else unset,\n str_to_lower=config['str_to_lower'] if 'str_to_lower' in config else unset,\n str_to_upper=config['str_to_upper'] if 'str_to_upper' in config else unset,\n strict=config['strict'] if 'strict' in config else unset,\n ser_json_timedelta=config['ser_json_timedelta'] if 'ser_json_timedelta' in config else unset,\n ser_json_bytes=config['ser_json_bytes'] if 'ser_json_bytes' in config else unset,\n from_attributes=config['from_attributes'] if 'from_attributes' in config else unset,\n loc_by_alias=config['loc_by_alias'] if 'loc_by_alias' in config else unset,\n revalidate_instances=config['revalidate_instances'] if 'revalidate_instances' in config else unset,\n validate_default=config['validate_default'] if 'validate_default' in config else unset,\n str_max_length=(\n config['str_max_length'] if 'str_max_length' in config and config['str_max_length'] is not None else unset\n ),\n str_min_length=config['str_min_length'] if 'str_min_length' in config else unset,\n )\n for k in [k for k in core_config if core_config[k] is unset]:\n core_config.pop(k)\n return CoreConfig(**core_config) # type: ignore[misc]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType_AnalyzedType.validate_json.return.self_validator_validate_j": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType_AnalyzedType.validate_json.return.self_validator_validate_j", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 156, "span_ids": ["AnalyzedType.validate_python", "AnalyzedType", "AnalyzedType.__init__", "AnalyzedType.validate_json"], "tokens": 527}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnalyzedType(Generic[T]):\n if TYPE_CHECKING:\n\n @overload\n def __new__(cls, __type: type[T], *, config: ConfigDict | None = ...) -> AnalyzedType[T]:\n ...\n\n # this overload is for non-type things like Union[int, str]\n # Pyright currently handles this \"correctly\", but MyPy understands this as AnalyzedType[object]\n # so an explicit type cast is needed\n @overload\n def __new__(cls, __type: T, *, config: ConfigDict | None = ...) -> AnalyzedType[T]:\n ...\n\n def __new__(cls, __type: Any, *, config: ConfigDict | None = ...) -> AnalyzedType[T]:\n raise NotImplementedError\n\n def __init__(self, __type: Any, *, config: ConfigDict | None = None, _parent_depth: int = 2) -> None:\n core_config: CoreConfig\n if config is not None:\n core_config = _translate_config(config)\n else:\n core_config = CoreConfig()\n try:\n core_config.update(__type.__pydantic_core_config__)\n except AttributeError:\n pass\n\n core_schema: CoreSchema\n try:\n core_schema = __type.__pydantic_core_schema__\n except AttributeError:\n core_schema = _get_schema(__type, core_config, parent_depth=_parent_depth + 1)\n\n validator: SchemaValidator\n if hasattr(__type, '__pydantic_validator__') and config is None:\n validator = __type.__pydantic_validator__\n else:\n validator = SchemaValidator(core_schema, core_config)\n\n serializer: SchemaSerializer\n if hasattr(__type, '__pydantic_serializer__') and config is None:\n serializer = __type.__pydantic_serializer__\n else:\n serializer = SchemaSerializer(core_schema, core_config)\n\n self.core_schema = core_schema\n self.validator = validator\n self.serializer = serializer\n\n def validate_python(self, __object: Any, *, strict: bool | None = None, context: dict[str, Any] | None = None) -> T:\n return self.validator.validate_python(__object, strict=strict, context=context)\n\n def validate_json(\n self, __data: str | bytes, *, strict: bool | None = None, context: dict[str, Any] | None = None\n ) -> T:\n return self.validator.validate_json(__data, strict=strict, context=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_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.dump_python_AnalyzedType.dump_python.return.self_serializer_to_python": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.dump_python_AnalyzedType.dump_python.return.self_serializer_to_python", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 183, "span_ids": ["AnalyzedType.dump_python"], "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 AnalyzedType(Generic[T]):\n\n def dump_python(\n self,\n __instance: T,\n *,\n mode: Literal['json', 'python'] = 'python',\n include: IncEx | None = None,\n exclude: IncEx | None = None,\n by_alias: bool = False,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n round_trip: bool = False,\n warnings: bool = True,\n ) -> Any:\n return self.serializer.to_python(\n __instance,\n mode=mode,\n by_alias=by_alias,\n include=include,\n exclude=exclude,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_none,\n round_trip=round_trip,\n warnings=warnings,\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_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.dump_json_AnalyzedType.json_schema.return.schema_generator_instance": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.dump_json_AnalyzedType.json_schema.return.schema_generator_instance", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 220, "span_ids": ["AnalyzedType.dump_json", "AnalyzedType.json_schema"], "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 AnalyzedType(Generic[T]):\n\n def dump_json(\n self,\n __instance: T,\n *,\n indent: int | None = None,\n include: IncEx | None = None,\n exclude: IncEx | None = None,\n by_alias: bool = False,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n round_trip: bool = False,\n warnings: bool = True,\n ) -> bytes:\n return self.serializer.to_json(\n __instance,\n indent=indent,\n include=include,\n exclude=exclude,\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_none,\n round_trip=round_trip,\n warnings=warnings,\n )\n\n def json_schema(\n self,\n *,\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n ) -> dict[str, Any]:\n schema_generator_instance = schema_generator(by_alias=by_alias, ref_template=ref_template)\n return schema_generator_instance.generate(self.core_schema)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.json_schemas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/analyzed_type.py_AnalyzedType.json_schemas_", "embedding": null, "metadata": {"file_path": "pydantic/analyzed_type.py", "file_name": "analyzed_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 248, "span_ids": ["AnalyzedType.json_schemas"], "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 AnalyzedType(Generic[T]):\n\n @staticmethod\n def json_schemas(\n __analyzed_types: Iterable[AnalyzedType[Any]],\n *,\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n title: str | None = None,\n description: str | None = None,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n ) -> dict[str, Any]:\n # TODO: can we use model.__schema_cache__?\n schema_generator_instance = schema_generator(by_alias=by_alias, ref_template=ref_template)\n\n core_schemas = [at.core_schema for at in __analyzed_types]\n\n definitions = schema_generator_instance.generate_definitions(core_schemas)\n\n json_schema: dict[str, Any] = {}\n if definitions:\n json_schema['$defs'] = definitions\n if title:\n json_schema['title'] = title\n if description:\n json_schema['description'] = description\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py___HslColorTuple.Union_Tuple_float_float_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py___HslColorTuple.Union_Tuple_float_float_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["docstring"], "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": "\"\"\"\nColor definitions are used as per CSS3 specification:\nhttp://www.w3.org/TR/css3-color/#svg-color\n\nA few colors have multiple names referring to the sames colors, eg. `grey` and `gray` or `aqua` and `cyan`.\n\nIn these cases the LAST color when sorted alphabetically takes preferences,\neg. Color((0, 255, 255)).as_named() == 'cyan' because \"cyan\" comes after \"aqua\".\n\"\"\"\nimport math\nimport re\nfrom colorsys import hls_to_rgb, rgb_to_hls\nfrom typing import Any, Dict, Optional, Tuple, Union, cast\n\nfrom pydantic_core import PydanticCustomError, core_schema\n\nfrom ._internal import _repr, _utils\n\nColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]]\nColorType = Union[ColorTuple, str]\nHslColorTuple = Union[Tuple[float, float, float], Tuple[float, float, float, float]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_RGBA_RGBA.__getitem__.return.self__tuple_item_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_RGBA_RGBA.__getitem__.return.self__tuple_item_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 40, "span_ids": ["RGBA", "RGBA.__getitem__", "RGBA.__init__"], "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 RGBA:\n \"\"\"\n Internal use only as a representation of a color.\n \"\"\"\n\n __slots__ = 'r', 'g', 'b', 'alpha', '_tuple'\n\n def __init__(self, r: float, g: float, b: float, alpha: Optional[float]):\n self.r = r\n self.g = g\n self.b = b\n self.alpha = alpha\n\n self._tuple: Tuple[float, float, float, Optional[float]] = (r, g, b, alpha)\n\n def __getitem__(self, item: Any) -> Any:\n return self._tuple[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_pydantic__pydantic/pydantic/color.py__these_are_not_compiled__rads.2_math_pi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py__these_are_not_compiled__rads.2_math_pi", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 62, "span_ids": ["RGBA.__getitem__", "impl:27", "impl:7"], "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": "# these are not compiled here to avoid import slowdown, they'll be compiled the first time they're used, then cached\n_r_255 = r'(\\d{1,3}(?:\\.\\d+)?)'\n_r_comma = r'\\s*,\\s*'\n_r_alpha = r'(\\d(?:\\.\\d+)?|\\.\\d+|\\d{1,2}%)'\n_r_h = r'(-?\\d+(?:\\.\\d+)?|-?\\.\\d+)(deg|rad|turn)?'\n_r_sl = r'(\\d{1,3}(?:\\.\\d+)?)%'\nr_hex_short = r'\\s*(?:#|0x)?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?\\s*'\nr_hex_long = r'\\s*(?:#|0x)?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?\\s*'\n# CSS3 RGB examples: rgb(0, 0, 0), rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 50%)\nr_rgb = fr'\\s*rgba?\\(\\s*{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_255}(?:{_r_comma}{_r_alpha})?\\s*\\)\\s*'\n# CSS3 HSL examples: hsl(270, 60%, 50%), hsla(270, 60%, 50%, 0.5), hsla(270, 60%, 50%, 50%)\nr_hsl = fr'\\s*hsla?\\(\\s*{_r_h}{_r_comma}{_r_sl}{_r_comma}{_r_sl}(?:{_r_comma}{_r_alpha})?\\s*\\)\\s*'\n# CSS4 RGB examples: rgb(0 0 0), rgb(0 0 0 / 0.5), rgb(0 0 0 / 50%), rgba(0 0 0 / 50%)\nr_rgb_v4_style = fr'\\s*rgba?\\(\\s*{_r_255}\\s+{_r_255}\\s+{_r_255}(?:\\s*/\\s*{_r_alpha})?\\s*\\)\\s*'\n# CSS4 HSL examples: hsl(270 60% 50%), hsl(270 60% 50% / 0.5), hsl(270 60% 50% / 50%), hsla(270 60% 50% / 50%)\nr_hsl_v4_style = fr'\\s*hsla?\\(\\s*{_r_h}\\s+{_r_sl}\\s+{_r_sl}(?:\\s*/\\s*{_r_alpha})?\\s*\\)\\s*'\n\n# colors where the two hex characters are the same, if all colors match this the short version of hex colors can be used\nrepeat_colors = {int(c * 2, 16) for c in '0123456789abcdef'}\nrads = 2 * math.pi", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color_Color.as_named.if_self__rgba_alpha_is_No.else_.return.self_as_hex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color_Color.as_named.if_self__rgba_alpha_is_No.else_.return.self_as_hex_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 108, "span_ids": ["Color.original", "Color.__pydantic_modify_json_schema__", "Color.__init__", "Color.as_named", "Color"], "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 Color(_repr.Representation):\n __slots__ = '_original', '_rgba'\n\n def __init__(self, value: ColorType) -> None:\n self._rgba: RGBA\n self._original: ColorType\n if isinstance(value, (tuple, list)):\n self._rgba = parse_tuple(value)\n elif isinstance(value, str):\n self._rgba = parse_str(value)\n elif isinstance(value, Color):\n self._rgba = value._rgba\n value = value._original\n else:\n raise PydanticCustomError(\n 'color_error', 'value is not a valid color: value must be a tuple, list or string'\n )\n\n # if we've got here value must be a valid color\n self._original = value\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: Dict[str, Any]) -> Dict[str, Any]:\n field_schema.update(type='string', format='color')\n return field_schema\n\n def original(self) -> ColorType:\n \"\"\"\n Original value passed to Color\n \"\"\"\n return self._original\n\n def as_named(self, *, fallback: bool = False) -> str:\n if self._rgba.alpha is None:\n rgb = cast(Tuple[int, int, int], self.as_rgb_tuple())\n try:\n return COLORS_BY_VALUE[rgb]\n except KeyError as e:\n if fallback:\n return self.as_hex()\n else:\n raise ValueError('no named color found, use fallback=True, as_hex() or as_rgb()') from e\n else:\n return self.as_hex()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hex_Color.as_hex.return._as_hex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hex_Color.as_hex.return._as_hex", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 122, "span_ids": ["Color.as_hex"], "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 Color(_repr.Representation):\n\n def as_hex(self) -> str:\n \"\"\"\n Hex string representing the color can be 3, 4, 6 or 8 characters depending on whether the string\n a \"short\" representation of the color is possible and whether there's an alpha channel.\n \"\"\"\n values = [float_to_255(c) for c in self._rgba[:3]]\n if self._rgba.alpha is not None:\n values.append(float_to_255(self._rgba.alpha))\n\n as_hex = ''.join(f'{v:02x}' for v in values)\n if all(c in repeat_colors for c in values):\n as_hex = ''.join(as_hex[c] for c in range(0, len(as_hex), 2))\n return '#' + as_hex", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_rgb_Color.as_rgb.if_self__rgba_alpha_is_No.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_rgb_Color.as_rgb.if_self__rgba_alpha_is_No.else_.return._", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 134, "span_ids": ["Color.as_rgb"], "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 Color(_repr.Representation):\n\n def as_rgb(self) -> str:\n \"\"\"\n Color as an rgb(, , ) or rgba(, , , ) string.\n \"\"\"\n if self._rgba.alpha is None:\n return f'rgb({float_to_255(self._rgba.r)}, {float_to_255(self._rgba.g)}, {float_to_255(self._rgba.b)})'\n else:\n return (\n f'rgba({float_to_255(self._rgba.r)}, {float_to_255(self._rgba.g)}, {float_to_255(self._rgba.b)}, '\n f'{round(self._alpha_float(), 2)})'\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_pydantic__pydantic/pydantic/color.py_Color.as_rgb_tuple_Color.as_rgb_tuple.if_alpha_is_None_.else_.return.r_g_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_rgb_tuple_Color.as_rgb_tuple.if_alpha_is_None_.else_.return.r_g_b", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 156, "span_ids": ["Color.as_rgb_tuple"], "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 Color(_repr.Representation):\n\n def as_rgb_tuple(self, *, alpha: Optional[bool] = None) -> ColorTuple:\n \"\"\"\n Color as an RGB or RGBA tuple; red, green and blue are in the range 0 to 255, alpha if included is\n in the range 0 to 1.\n\n :param alpha: whether to include the alpha channel, options are\n None - (default) include alpha only if it's set (e.g. not None)\n True - always include alpha,\n False - always omit alpha,\n \"\"\"\n r, g, b = (float_to_255(c) for c in self._rgba[:3])\n if alpha is None:\n if self._rgba.alpha is None:\n return r, g, b\n else:\n return r, g, b, self._alpha_float()\n elif alpha:\n return r, g, b, self._alpha_float()\n else:\n # alpha is False\n return r, g, 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_pydantic__pydantic/pydantic/color.py_Color.as_hsl_Color.as_hsl.if_self__rgba_alpha_is_No.else_.return.f_hsl_h_360_0_0f_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hsl_Color.as_hsl.if_self__rgba_alpha_is_No.else_.return.f_hsl_h_360_0_0f_s_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 167, "span_ids": ["Color.as_hsl"], "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 Color(_repr.Representation):\n\n def as_hsl(self) -> str:\n \"\"\"\n Color as an hsl(, , ) or hsl(, , , ) string.\n \"\"\"\n if self._rgba.alpha is None:\n h, s, li = self.as_hsl_tuple(alpha=False) # type: ignore\n return f'hsl({h * 360:0.0f}, {s:0.0%}, {li:0.0%})'\n else:\n h, s, li, a = self.as_hsl_tuple(alpha=True) # type: ignore\n return f'hsl({h * 360:0.0f}, {s:0.0%}, {li:0.0%}, {round(a, 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_pydantic__pydantic/pydantic/color.py_Color.as_hsl_tuple_Color.as_hsl_tuple.if_alpha_.else_.return.h_s_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_hsl_tuple_Color.as_hsl_tuple.if_alpha_.else_.return.h_s_l", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 191, "span_ids": ["Color.as_hsl_tuple"], "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 Color(_repr.Representation):\n\n def as_hsl_tuple(self, *, alpha: Optional[bool] = None) -> HslColorTuple:\n \"\"\"\n Color as an HSL or HSLA tuple, e.g. hue, saturation, lightness and optionally alpha; all elements are in\n the range 0 to 1.\n\n NOTE: this is HSL as used in HTML and most other places, not HLS as used in python's colorsys.\n\n :param alpha: whether to include the alpha channel, options are\n None - (default) include alpha only if it's set (e.g. not None)\n True - always include alpha,\n False - always omit alpha,\n \"\"\"\n h, l, s = rgb_to_hls(self._rgba.r, self._rgba.g, self._rgba.b) # noqa: E741\n if alpha is None:\n if self._rgba.alpha is None:\n return h, s, l\n else:\n return h, s, l, self._alpha_float()\n if alpha:\n return h, s, l, self._alpha_float()\n else:\n # alpha is False\n return h, s, 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_pydantic__pydantic/pydantic/color.py_Color._alpha_float_Color.__hash__.return.hash_self_as_rgb_tuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color._alpha_float_Color.__hash__.return.hash_self_as_rgb_tuple_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 216, "span_ids": ["Color._alpha_float", "Color.__hash__", "Color.__get_pydantic_core_schema__", "Color.__repr_args__", "Color.__eq__", "Color.__str__", "Color._validate"], "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 Color(_repr.Representation):\n\n def _alpha_float(self) -> float:\n return 1 if self._rgba.alpha is None else self._rgba.alpha\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.PlainValidatorFunctionSchema:\n return core_schema.general_plain_validator_function(\n cls._validate, serialization=core_schema.to_string_ser_schema()\n )\n\n @classmethod\n def _validate(cls, __input_value: Any, _: Any) -> 'Color':\n return cls(__input_value)\n\n def __str__(self) -> str:\n return self.as_named(fallback=True)\n\n def __repr_args__(self) -> '_repr.ReprArgs':\n return [(None, self.as_named(fallback=True))] + [('rgb', self.as_rgb_tuple())]\n\n def __eq__(self, other: Any) -> bool:\n return isinstance(other, Color) and self.as_rgb_tuple() == other.as_rgb_tuple()\n\n def __hash__(self) -> int:\n return hash(self.as_rgb_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_pydantic__pydantic/pydantic/color.py_parse_tuple_parse_tuple.if_len_value_3_.else_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_tuple_parse_tuple.if_len_value_3_.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 230, "span_ids": ["parse_tuple"], "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 parse_tuple(value: Tuple[Any, ...]) -> RGBA:\n \"\"\"\n Parse a tuple or list as a color.\n \"\"\"\n if len(value) == 3:\n r, g, b = (parse_color_value(v) for v in value)\n return RGBA(r, g, b, None)\n elif len(value) == 4:\n r, g, b = (parse_color_value(v) for v in value[:3])\n return RGBA(r, g, b, parse_float_alpha(value[3]))\n else:\n raise PydanticCustomError('color_error', 'value is not a valid color: tuples must have length 3 or 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_pydantic__pydantic/pydantic/color.py_parse_str_parse_str.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_str_parse_str.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 233, "end_line": 278, "span_ids": ["parse_str"], "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 parse_str(value: str) -> RGBA:\n \"\"\"\n Parse a string to an RGBA tuple, trying the following formats (in this order):\n * named color, see COLORS_BY_NAME below\n * hex short eg. `fff` (prefix can be `#`, `0x` or nothing)\n * hex long eg. `ffffff` (prefix can be `#`, `0x` or nothing)\n * `rgb(, , ) `\n * `rgba(, , , )`\n \"\"\"\n value_lower = value.lower()\n try:\n r, g, b = COLORS_BY_NAME[value_lower]\n except KeyError:\n pass\n else:\n return ints_to_rgba(r, g, b, None)\n\n m = re.fullmatch(r_hex_short, value_lower)\n if m:\n *rgb, a = m.groups()\n r, g, b = (int(v * 2, 16) for v in rgb)\n if a:\n alpha: Optional[float] = int(a * 2, 16) / 255\n else:\n alpha = None\n return ints_to_rgba(r, g, b, alpha)\n\n m = re.fullmatch(r_hex_long, value_lower)\n if m:\n *rgb, a = m.groups()\n r, g, b = (int(v, 16) for v in rgb)\n if a:\n alpha = int(a, 16) / 255\n else:\n alpha = None\n return ints_to_rgba(r, g, b, alpha)\n\n m = re.fullmatch(r_rgb, value_lower) or re.fullmatch(r_rgb_v4_style, value_lower)\n if m:\n return ints_to_rgba(*m.groups()) # type: ignore\n\n m = re.fullmatch(r_hsl, value_lower) or re.fullmatch(r_hsl_v4_style, value_lower)\n if m:\n return parse_hsl(*m.groups()) # type: ignore\n\n raise PydanticCustomError('color_error', 'value is not a valid color: string not recognised as a valid color')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_ints_to_rgba_parse_color_value.if_0_color_max_val_.else_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_ints_to_rgba_parse_color_value.if_0_color_max_val_.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 301, "span_ids": ["parse_color_value", "ints_to_rgba"], "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 ints_to_rgba(r: Union[int, str], g: Union[int, str], b: Union[int, str], alpha: Optional[float] = None) -> RGBA:\n return RGBA(parse_color_value(r), parse_color_value(g), parse_color_value(b), parse_float_alpha(alpha))\n\n\ndef parse_color_value(value: Union[int, str], max_val: int = 255) -> float:\n \"\"\"\n Parse a value checking it's a valid int in the range 0 to max_val and divide by max_val to give a number\n in the range 0 to 1\n \"\"\"\n try:\n color = float(value)\n except ValueError:\n raise PydanticCustomError('color_error', 'value is not a valid color: color values must be a valid number')\n if 0 <= color <= max_val:\n return color / max_val\n else:\n raise PydanticCustomError(\n 'color_error',\n 'value is not a valid color: color values must be in the range 0 to {max_val}',\n {'max_val': max_val},\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_pydantic__pydantic/pydantic/color.py_parse_float_alpha_parse_float_alpha.if__utils_almost_equal_fl.else_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_float_alpha_parse_float_alpha.if__utils_almost_equal_fl.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 323, "span_ids": ["parse_float_alpha"], "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 parse_float_alpha(value: Union[None, str, float, int]) -> Optional[float]:\n \"\"\"\n Parse a value checking it's a valid float in the range 0 to 1\n \"\"\"\n if value is None:\n return None\n try:\n if isinstance(value, str) and value.endswith('%'):\n alpha = float(value[:-1]) / 100\n else:\n alpha = float(value)\n except ValueError:\n raise PydanticCustomError('color_error', 'value is not a valid color: alpha values must be a valid float')\n\n if _utils.almost_equal_floats(alpha, 1):\n return None\n elif 0 <= alpha <= 1:\n return alpha\n else:\n raise PydanticCustomError('color_error', 'value is not a valid color: alpha values must be in the range 0 to 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_pydantic__pydantic/pydantic/color.py_parse_hsl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_hsl_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 326, "end_line": 500, "span_ids": ["impl:33", "float_to_255", "impl:35", "parse_hsl"], "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 parse_hsl(h: str, h_units: str, sat: str, light: str, alpha: Optional[float] = None) -> RGBA:\n \"\"\"\n Parse raw hue, saturation, lightness and alpha values and convert to RGBA.\n \"\"\"\n s_value, l_value = parse_color_value(sat, 100), parse_color_value(light, 100)\n\n h_value = float(h)\n if h_units in {None, 'deg'}:\n h_value = h_value % 360 / 360\n elif h_units == 'rad':\n h_value = h_value % rads / rads\n else:\n # turns\n h_value = h_value % 1\n\n r, g, b = hls_to_rgb(h_value, l_value, s_value)\n return RGBA(r, g, b, parse_float_alpha(alpha))\n\n\ndef float_to_255(c: float) -> int:\n return int(round(c * 255))\n\n\nCOLORS_BY_NAME =\n # ... other code\n\nCOLORS_BY_VALUE = {v: k for k, v in COLORS_BY_NAME.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_pydantic__pydantic/pydantic/config.py_from___future___import_an_Extra.forbid._forbid_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_from___future___import_an_Extra.forbid._forbid_", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["imports", "Extra"], "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": "from __future__ import annotations as _annotations\n\nimport warnings\nfrom enum import Enum\nfrom typing import TYPE_CHECKING, Any, Callable\n\nfrom typing_extensions import Literal, Protocol, TypedDict\n\nfrom pydantic.errors import PydanticUserError\n\nif TYPE_CHECKING:\n from typing import overload\n\n from .main import BaseModel\n\n class SchemaExtraCallable(Protocol):\n # TODO: This has been replaced with __pydantic_modify_json_schema__ in v2; need to make sure we\n # document the migration, in particular changing `model_class` to `cls` from the classmethod\n # TODO: Note that the argument to Field(...) that served a similar purpose received the FieldInfo as well.\n # Should we accept that argument here too? Will that add a ton of boilerplate?\n # Tentative suggestion to previous TODO: I think we let the json_schema_extra argument\n # to FieldInfo be a callable that accepts schema, model_class, and field_info. And use\n # similar machinery to `_apply_modify_schema` to call the function properly for different signatures.\n # (And use this Protocol-based approach to get good type-checking.)\n @overload\n def __call__(self, schema: dict[str, Any]) -> None:\n pass\n\n @overload\n def __call__(self, schema: dict[str, Any], model_class: type[BaseModel]) -> None:\n pass\n\nelse:\n SchemaExtraCallable = Callable[..., None]\n\n__all__ = 'BaseConfig', 'ConfigDict', 'Extra', 'build_config', 'prepare_config'\n\n\nclass Extra(str, Enum):\n allow = 'allow'\n ignore = 'ignore'\n forbid = 'forbid'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__ConfigDict__ConfigDict.validate_default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__ConfigDict__ConfigDict.validate_default", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 74, "span_ids": ["_ConfigDict"], "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 _ConfigDict(TypedDict, total=False):\n title: str | None\n str_to_lower: bool\n str_to_upper: bool\n str_strip_whitespace: bool\n str_min_length: int\n str_max_length: int | None\n extra: Extra | None\n frozen: bool\n populate_by_name: bool\n use_enum_values: bool\n validate_assignment: bool\n arbitrary_types_allowed: bool # TODO default True, or remove\n undefined_types_warning: bool # TODO review docs\n from_attributes: bool\n # whether to use the used alias (or first alias for \"field required\" errors) instead of field_names\n # to construct error `loc`s, default True\n loc_by_alias: bool\n alias_generator: Callable[[str], str] | None\n ignored_types: tuple[type, ...]\n allow_inf_nan: bool\n\n # new in V2\n strict: bool\n # whether instances of models and dataclasses (including subclass instances) should re-validate, default 'never'\n revalidate_instances: Literal['always', 'never', 'subclass-instances']\n ser_json_timedelta: Literal['iso8601', 'float']\n ser_json_bytes: Literal['utf8', 'base64']\n # whether to validate default values during validation, default False\n validate_default: 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_pydantic__pydantic/pydantic/config.py_config_keys_ConfigMetaclass.__getattr__.try_.except_KeyError_as_exc_.raise_AttributeError_f_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_config_keys_ConfigMetaclass.__getattr__.try_.except_KeyError_as_exc_.raise_AttributeError_f_ty", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 169, "span_ids": ["ConfigMetaclass", "ConfigMetaclass.__getattr__", "impl:7"], "tokens": 722}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "config_keys = set(_ConfigDict.__annotations__.keys())\n\nif TYPE_CHECKING:\n\n class ConfigDict(_ConfigDict):\n ...\n\nelse:\n\n class ConfigDict(dict):\n _V2_REMOVED_KEYS = {\n 'allow_mutation',\n 'error_msg_templates',\n 'fields',\n 'getter_dict',\n 'schema_extra',\n 'smart_union',\n 'underscore_attrs_are_private',\n 'json_loads',\n 'json_dumps',\n 'json_encoders',\n 'copy_on_model_validation',\n 'post_init_call',\n }\n _V2_RENAMED_KEYS = {\n 'allow_population_by_field_name': 'populate_by_name',\n 'anystr_lower': 'str_to_lower',\n 'anystr_strip_whitespace': 'str_strip_whitespace',\n 'anystr_upper': 'str_to_upper',\n 'keep_untouched': 'ignored_types',\n 'max_anystr_length': 'str_max_length',\n 'min_anystr_length': 'str_min_length',\n 'orm_mode': 'from_attributes',\n 'validate_all': 'validate_default',\n }\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n deprecated_removed_keys = ConfigDict._V2_REMOVED_KEYS & self.keys()\n deprecated_renamed_keys = ConfigDict._V2_RENAMED_KEYS.keys() & self.keys()\n if deprecated_removed_keys or deprecated_renamed_keys:\n renamings = {k: self._V2_RENAMED_KEYS[k] for k in sorted(deprecated_renamed_keys)}\n renamed_bullets = [f'* {k!r} has been renamed to {v!r}' for k, v in renamings.items()]\n removed_bullets = [f'* {k!r} has been removed' for k in sorted(deprecated_removed_keys)]\n message = '\\n'.join(['Valid config keys have changed in V2:'] + renamed_bullets + removed_bullets)\n warnings.warn(message, UserWarning)\n\n def __missing__(self, key: str) -> Any:\n if key in _default_config: # need this check to prevent a recursion error\n return _default_config[key]\n raise KeyError(key)\n\n\n_default_config = ConfigDict(\n title=None,\n str_to_lower=False,\n str_to_upper=False,\n str_strip_whitespace=False,\n str_min_length=0,\n str_max_length=None,\n # let the model / dataclass decide how to handle it\n extra=None,\n frozen=False,\n revalidate_instances='never',\n populate_by_name=False,\n use_enum_values=False,\n validate_assignment=False,\n arbitrary_types_allowed=False,\n undefined_types_warning=True,\n from_attributes=False,\n loc_by_alias=True,\n alias_generator=None,\n ignored_types=(),\n allow_inf_nan=True,\n strict=False,\n ser_json_timedelta='iso8601',\n ser_json_bytes='utf8',\n validate_default=False,\n)\n\n\nclass ConfigMetaclass(type):\n def __getattr__(self, item: str) -> Any:\n warnings.warn(\n f'Support for \"config\" as \"{self.__name__}\" is deprecated and will be removed in a future version\"',\n DeprecationWarning,\n )\n\n try:\n return _default_config[item] # type: ignore[literal-required]\n except KeyError as exc:\n raise AttributeError(f\"type object '{self.__name__}' has no attribute {exc}\") from 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_pydantic__pydantic/pydantic/config.py_BaseConfig_BaseConfig.__init_subclass__.return.super___init_subclass__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_BaseConfig_BaseConfig.__init_subclass__.return.super___init_subclass__", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 198, "span_ids": ["BaseConfig", "BaseConfig.__getattr__", "BaseConfig.__init_subclass__"], "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 BaseConfig(metaclass=ConfigMetaclass):\n \"\"\"\n This class is only retained for backwards compatibility.\n\n The preferred approach going forward is to assign a ConfigDict to the `model_config` attribute of the Model class.\n \"\"\"\n\n def __getattr__(self, item: str) -> Any:\n warnings.warn(\n f'Support for \"config\" as \"{type(self).__name__}\" is deprecated and will be removed in a future version',\n DeprecationWarning,\n )\n try:\n return super().__getattribute__(item)\n except AttributeError as exc:\n try:\n return getattr(type(self), item)\n except AttributeError:\n # reraising changes the displayed text to reflect that `self` is not a type\n raise AttributeError(str(exc)) from exc\n\n def __init_subclass__(cls, **kwargs: Any) -> None:\n warnings.warn(\n '`BaseConfig` is deprecated and will be removed in a future version',\n DeprecationWarning,\n )\n return super().__init_subclass__(**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_pydantic__pydantic/pydantic/config.py_get_config_get_config._type_ignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_get_config_get_config._type_ignore", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 201, "end_line": 215, "span_ids": ["get_config"], "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 get_config(config: ConfigDict | dict[str, Any] | type[Any] | None, error_label: str | None = None) -> ConfigDict:\n if config is None:\n return ConfigDict()\n\n if isinstance(config, dict):\n config_dict = config\n else:\n warnings.warn(\n f'Support for \"config\" as \"{type(config).__name__}\" is deprecated and will be removed in a future version',\n DeprecationWarning,\n )\n config_dict = {k: getattr(config, k) for k in dir(config) if not k.startswith('__')}\n\n prepare_config(config_dict, error_label or 'ConfigDict')\n return ConfigDict(config_dict) # type: ignore", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_build_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_build_config_", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 218, "end_line": 266, "span_ids": ["build_config", "prepare_config"], "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": "def build_config(\n cls_name: str, bases: tuple[type[Any], ...], namespace: dict[str, Any], kwargs: dict[str, Any]\n) -> ConfigDict:\n \"\"\"\n Build a new ConfigDict instance based on (from lowest to highest)\n - options defined in base\n - options defined in namespace\n - options defined via kwargs\n \"\"\"\n config_kwargs = {k: kwargs.pop(k) for k in list(kwargs.keys()) if k in config_keys}\n\n config_bases = {}\n configs_ordered = []\n # collect all config options from bases\n for base in bases:\n config = getattr(base, 'model_config', None)\n if config:\n configs_ordered.append(config)\n config_bases.update({key: value for key, value in config.items()})\n config_new = dict(config_bases.items())\n\n config_class_from_namespace = namespace.get('Config')\n config_dict_from_namespace = namespace.get('model_config')\n\n if config_class_from_namespace and config_dict_from_namespace:\n raise PydanticUserError('\"Config\" and \"model_config\" cannot be used together')\n\n config_from_namespace = config_dict_from_namespace or get_config(config_class_from_namespace)\n\n if config_from_namespace:\n configs_ordered.append(config_from_namespace)\n config_new.update(config_from_namespace)\n configs_ordered.append(config_kwargs)\n\n config_new.update(config_kwargs)\n new_model_config = ConfigDict(config_new) # type: ignore\n\n prepare_config(new_model_config, cls_name)\n return new_model_config\n\n\ndef prepare_config(config: ConfigDict | dict[str, Any], error_label: str) -> None:\n extra = config.get('extra')\n if extra is not None and not isinstance(extra, Extra):\n try:\n config['extra'] = Extra(extra)\n except ValueError as e:\n raise ValueError(f'{error_label!r}: {extra!r} is not a valid value for config[{\"extra\"!r}]') 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_pydantic__pydantic/pydantic/dataclasses.py___if_sys_version_info_3.else_.dataclass_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py___if_sys_version_info_3.else_.dataclass_1._", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 91, "span_ids": ["docstring"], "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": "\"\"\"\nProvide an enhanced dataclass that performs validation.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport sys\nfrom typing import TYPE_CHECKING, Any, Callable, TypeVar, overload\n\nfrom typing_extensions import Literal, dataclass_transform\n\nfrom ._internal import _dataclasses as _pydantic_dataclasses\nfrom ._internal import _decorators\nfrom .config import ConfigDict, get_config\nfrom .fields import Field, FieldInfo\n\nif TYPE_CHECKING:\n from ._internal._dataclasses import PydanticDataclass\n\n\n__all__ = ('dataclass',)\n\n_T = TypeVar('_T')\n\nif sys.version_info >= (3, 10):\n\n @dataclass_transform(field_specifiers=(dataclasses.field, Field))\n @overload\n def dataclass(\n *,\n init: Literal[False] = False,\n repr: bool = True,\n eq: bool = True,\n order: bool = False,\n unsafe_hash: bool = False,\n frozen: bool = False,\n config: ConfigDict | type[object] | None = None,\n validate_on_init: bool | None = None,\n kw_only: bool = ...,\n ) -> Callable[[type[_T]], type[PydanticDataclass]]:\n ...\n\n @dataclass_transform(field_specifiers=(dataclasses.field, Field))\n @overload\n def dataclass(\n _cls: type[_T],\n *,\n init: Literal[False] = False,\n repr: bool = True,\n eq: bool = True,\n order: bool = False,\n unsafe_hash: bool = False,\n frozen: bool = False,\n config: ConfigDict | type[object] | None = None,\n validate_on_init: bool | None = None,\n kw_only: bool = ...,\n ) -> type[PydanticDataclass]:\n ...\n\nelse:\n\n @dataclass_transform(field_specifiers=(dataclasses.field, Field))\n @overload\n def dataclass(\n *,\n init: Literal[False] = False,\n repr: bool = True,\n eq: bool = True,\n order: bool = False,\n unsafe_hash: bool = False,\n frozen: bool = False,\n config: ConfigDict | type[object] | None = None,\n validate_on_init: bool | None = None,\n ) -> Callable[[type[_T]], type[PydanticDataclass]]:\n ...\n\n @dataclass_transform(field_specifiers=(dataclasses.field, Field))\n @overload\n def dataclass(\n _cls: type[_T],\n *,\n init: Literal[False] = False,\n repr: bool = True,\n eq: bool = True,\n order: bool = False,\n unsafe_hash: bool = False,\n frozen: bool = False,\n config: ConfigDict | type[object] | None = None,\n validate_on_init: bool | None = None,\n ) -> type[PydanticDataclass]:\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_pydantic__pydantic/pydantic/dataclasses.py_dataclass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass_", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 174, "span_ids": ["dataclass"], "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": "@dataclass_transform(field_specifiers=(dataclasses.field, Field))\ndef dataclass(\n _cls: type[_T] | None = None,\n *,\n init: Literal[False] = False,\n repr: bool = True,\n eq: bool = True,\n order: bool = False,\n unsafe_hash: bool = False,\n frozen: bool = False,\n config: ConfigDict | type[object] | None = None,\n validate_on_init: bool | None = None,\n kw_only: bool = False,\n) -> Callable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]:\n \"\"\"\n Like the python standard lib dataclasses but enhanced with validation.\n \"\"\"\n assert init is False, 'pydantic.dataclasses.dataclass only supports init=False'\n\n def create_dataclass(cls: type[Any]) -> type[PydanticDataclass]:\n # Keep track of the original __doc__ so that we can restore it after applying the dataclasses decorator\n # Otherwise, classes with no __doc__ will have their signature added into the JSON schema description,\n # since dataclasses.dataclass will set this as the __doc__\n original_doc = cls.__doc__\n\n decorators = _decorators.gather_decorator_functions(cls)\n if dataclasses.is_dataclass(cls) and not hasattr(cls, '__pydantic_fields__'):\n # don't preserve the docstring for vanilla dataclasses, as it may include the signature\n # this matches v1 behavior, and there was an explicit test for it\n original_doc = None\n\n # so we don't add validation to the existing std lib dataclass, so we subclass it, but we need to\n # set `__pydantic_fields__` while subclassing so the logic below can treat the new class like its\n # parent is a pydantic dataclass\n dc_fields = dataclasses.fields(cls)\n pydantic_fields = {}\n omitted_fields = set()\n for f in dc_fields:\n if f.init:\n pydantic_fields[f.name] = FieldInfo.from_dataclass_field(f)\n else:\n omitted_fields.add(f.name)\n fields = {f.name: FieldInfo.from_dataclass_field(f) for f in dataclasses.fields(cls) if f.init}\n cls = type(\n cls.__name__,\n (cls,),\n {\n '__pydantic_fields__': fields,\n '__pydantic_omitted_fields__': omitted_fields or None,\n '__pydantic_decorators__': decorators,\n },\n )\n else:\n setattr(cls, '__pydantic_decorators__', decorators)\n\n config_dict = get_config(config, cls.__name__)\n _pydantic_dataclasses.prepare_dataclass(cls, config_dict, kw_only)\n\n if sys.version_info >= (3, 10):\n kwargs = dict(kw_only=kw_only)\n else:\n kwargs = {}\n\n cls = dataclasses.dataclass( # type: ignore[call-overload]\n cls,\n init=init,\n repr=repr,\n eq=eq,\n order=order,\n unsafe_hash=unsafe_hash,\n frozen=frozen,\n **kwargs,\n )\n cls.__doc__ = original_doc\n return cls\n\n if _cls is None:\n return create_dataclass\n\n return create_dataclass(_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_pydantic__pydantic/pydantic/decorator.py___validate_arguments_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py___validate_arguments_1._", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["validate_arguments", "validate_arguments_1", "docstring"], "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": "\"\"\"\nTODO this should be removed when we implement `validate` #4669\n\"\"\"\nfrom functools import wraps\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload\n\nfrom ._internal import _typing_extra, _utils\nfrom .config import Extra, get_config\nfrom .decorators import field_validator\nfrom .errors import PydanticUserError\nfrom .main import BaseModel, create_model\n\n__all__ = ('validate_arguments',)\n\nif TYPE_CHECKING:\n AnyCallable = Callable[..., Any]\n\n AnyCallableT = TypeVar('AnyCallableT', bound=AnyCallable)\n ConfigType = Union[None, Type[Any], Dict[str, Any]]\n\n\n@overload\ndef validate_arguments(func: None = None, *, config: 'ConfigType' = None) -> Callable[['AnyCallableT'], 'AnyCallableT']:\n ...\n\n\n@overload\ndef validate_arguments(func: 'AnyCallableT') -> 'AnyCallableT':\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_pydantic__pydantic/pydantic/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 59, "span_ids": ["impl:10", "validate_arguments_2"], "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 validate_arguments(func: Optional['AnyCallableT'] = None, *, config: 'ConfigType' = None) -> Any:\n \"\"\"\n Decorator to validate the arguments passed to a function.\n \"\"\"\n\n def validate(_func: 'AnyCallable') -> 'AnyCallable':\n vd = ValidatedFunction(_func, config)\n\n @wraps(_func)\n def wrapper_function(*args: Any, **kwargs: Any) -> Any:\n return vd.call(*args, **kwargs)\n\n wrapper_function.vd = vd # type: ignore\n wrapper_function.validate = vd.init_model_instance # type: ignore\n wrapper_function.raw_function = vd.raw_function # type: ignore\n wrapper_function.model = vd.model # type: ignore\n return wrapper_function\n\n if func:\n return validate(func)\n else:\n return validate\n\n\nALT_V_ARGS = 'v__args'\nALT_V_KWARGS = 'v__kwargs'\nV_POSITIONAL_ONLY_NAME = 'v__positional_only'\nV_DUPLICATE_KWARGS = 'v__duplicate_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_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 136, "span_ids": ["ValidatedFunction", "ValidatedFunction.__init__", "ValidatedFunction.call", "ValidatedFunction.init_model_instance"], "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 ValidatedFunction:\n def __init__(self, function: 'AnyCallableT', config: 'ConfigType'):\n from inspect import Parameter, signature\n\n parameters: Mapping[str, Parameter] = signature(function).parameters\n\n if parameters.keys() & {ALT_V_ARGS, ALT_V_KWARGS, V_POSITIONAL_ONLY_NAME, V_DUPLICATE_KWARGS}:\n raise PydanticUserError(\n f'\"{ALT_V_ARGS}\", \"{ALT_V_KWARGS}\", \"{V_POSITIONAL_ONLY_NAME}\" and \"{V_DUPLICATE_KWARGS}\" '\n f'are not permitted as argument names when using the \"{validate_arguments.__name__}\" decorator'\n )\n\n self.raw_function = function\n self.arg_mapping: Dict[int, str] = {}\n self.positional_only_args = set()\n self.v_args_name = 'args'\n self.v_kwargs_name = 'kwargs'\n\n type_hints = _typing_extra.get_type_hints(function, include_extras=True)\n takes_args = False\n takes_kwargs = False\n fields: Dict[str, Tuple[Any, Any]] = {}\n for i, (name, p) in enumerate(parameters.items()):\n if p.annotation is p.empty:\n annotation = Any\n else:\n annotation = type_hints[name]\n\n default = ... if p.default is p.empty else p.default\n if p.kind == Parameter.POSITIONAL_ONLY:\n self.arg_mapping[i] = name\n fields[name] = annotation, default\n fields[V_POSITIONAL_ONLY_NAME] = List[str], None\n self.positional_only_args.add(name)\n elif p.kind == Parameter.POSITIONAL_OR_KEYWORD:\n self.arg_mapping[i] = name\n fields[name] = annotation, default\n fields[V_DUPLICATE_KWARGS] = List[str], None\n elif p.kind == Parameter.KEYWORD_ONLY:\n fields[name] = annotation, default\n elif p.kind == Parameter.VAR_POSITIONAL:\n self.v_args_name = name\n fields[name] = Tuple[annotation, ...], None\n takes_args = True\n else:\n assert p.kind == Parameter.VAR_KEYWORD, p.kind\n self.v_kwargs_name = name\n fields[name] = Dict[str, annotation], None # type: ignore\n takes_kwargs = True\n\n # these checks avoid a clash between \"args\" and a field with that name\n if not takes_args and self.v_args_name in fields:\n self.v_args_name = ALT_V_ARGS\n\n # same with \"kwargs\"\n if not takes_kwargs and self.v_kwargs_name in fields:\n self.v_kwargs_name = ALT_V_KWARGS\n\n if not takes_args:\n # we add the field so validation below can raise the correct exception\n fields[self.v_args_name] = List[Any], None\n\n if not takes_kwargs:\n # same with kwargs\n fields[self.v_kwargs_name] = Dict[Any, Any], None\n\n self.create_model(fields, takes_args, takes_kwargs, config)\n\n def init_model_instance(self, *args: Any, **kwargs: Any) -> BaseModel:\n values = self.build_values(args, kwargs)\n return self.model(**values)\n\n def call(self, *args: Any, **kwargs: Any) -> Any:\n m = self.init_model_instance(*args, **kwargs)\n return self.execute(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_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 179, "span_ids": ["ValidatedFunction.build_values"], "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 ValidatedFunction:\n\n def build_values(self, args: Tuple[Any, ...], kwargs: Dict[str, Any]) -> Dict[str, Any]:\n values: Dict[str, Any] = {}\n if args:\n arg_iter = enumerate(args)\n while True:\n try:\n i, a = next(arg_iter)\n except StopIteration:\n break\n arg_name = self.arg_mapping.get(i)\n if arg_name is not None:\n values[arg_name] = a\n else:\n values[self.v_args_name] = [a] + [a for _, a in arg_iter]\n break\n\n var_kwargs: Dict[str, Any] = {}\n wrong_positional_args = []\n duplicate_kwargs = []\n fields_alias = [\n field.alias\n for name, field in self.model.model_fields.items()\n if name not in (self.v_args_name, self.v_kwargs_name)\n ]\n non_var_fields = set(self.model.model_fields) - {self.v_args_name, self.v_kwargs_name}\n for k, v in kwargs.items():\n if k in non_var_fields or k in fields_alias:\n if k in self.positional_only_args:\n wrong_positional_args.append(k)\n if k in values:\n duplicate_kwargs.append(k)\n values[k] = v\n else:\n var_kwargs[k] = v\n\n if var_kwargs:\n values[self.v_kwargs_name] = var_kwargs\n if wrong_positional_args:\n values[V_POSITIONAL_ONLY_NAME] = wrong_positional_args\n if duplicate_kwargs:\n values[V_DUPLICATE_KWARGS] = duplicate_kwargs\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_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.execute_ValidatedFunction.execute.if_self_v_args_name_in_d_.else_.return.self_raw_function_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.execute_ValidatedFunction.execute.if_self_v_args_name_in_d_.else_.return.self_raw_function_d_", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 208, "span_ids": ["ValidatedFunction.execute"], "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 ValidatedFunction:\n\n def execute(self, m: BaseModel) -> Any:\n d = {k: v for k, v in m.__dict__.items() if k in m.__fields_set__ or m.model_fields[k].default_factory}\n var_kwargs = d.pop(self.v_kwargs_name, {})\n\n if self.v_args_name in d:\n args_: List[Any] = []\n in_kwargs = False\n kwargs = {}\n for name, value in d.items():\n if in_kwargs:\n kwargs[name] = value\n elif name == self.v_args_name:\n args_ += value\n in_kwargs = True\n else:\n args_.append(value)\n return self.raw_function(*args_, **kwargs, **var_kwargs)\n elif self.positional_only_args:\n args_ = []\n kwargs = {}\n for name, value in d.items():\n if name in self.positional_only_args:\n args_.append(value)\n else:\n kwargs[name] = value\n return self.raw_function(*args_, **kwargs, **var_kwargs)\n else:\n return self.raw_function(**d, **var_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_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.create_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py_ValidatedFunction.create_model_", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 265, "span_ids": ["ValidatedFunction.create_model"], "tokens": 539}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidatedFunction:\n\n def create_model(self, fields: Dict[str, Any], takes_args: bool, takes_kwargs: bool, config: 'ConfigType') -> None:\n pos_args = len(self.arg_mapping)\n\n config_dict = get_config(config, getattr(self.raw_function, '__name__', 'validate_arguments'))\n\n if 'alias_generator' in config_dict:\n raise PydanticUserError(\n 'Setting the \"alias_generator\" property on custom Config for '\n '@validate_arguments is not yet supported, please remove.'\n )\n if 'extra' not in config_dict:\n config_dict['extra'] = Extra.forbid\n\n class DecoratorBaseModel(BaseModel):\n @field_validator(self.v_args_name, check_fields=False, allow_reuse=True)\n @classmethod\n def check_args(cls, v: Optional[List[Any]]) -> Optional[List[Any]]:\n if takes_args or v is None:\n return v\n\n raise TypeError(f'{pos_args} positional arguments expected but {pos_args + len(v)} given')\n\n @field_validator(self.v_kwargs_name, check_fields=False, allow_reuse=True)\n @classmethod\n def check_kwargs(cls, v: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]:\n if takes_kwargs or v is None:\n return v\n\n plural = '' if len(v) == 1 else 's'\n keys = ', '.join(map(repr, v.keys()))\n raise TypeError(f'unexpected keyword argument{plural}: {keys}')\n\n @field_validator(V_POSITIONAL_ONLY_NAME, check_fields=False, allow_reuse=True)\n @classmethod\n def check_positional_only(cls, v: Optional[List[str]]) -> None:\n if v is None:\n return\n\n plural = '' if len(v) == 1 else 's'\n keys = ', '.join(map(repr, v))\n raise TypeError(f'positional-only argument{plural} passed as keyword argument{plural}: {keys}')\n\n @field_validator(V_DUPLICATE_KWARGS, check_fields=False, allow_reuse=True)\n @classmethod\n def check_duplicate_kwargs(cls, v: Optional[List[str]]) -> None:\n if v is None:\n return\n\n plural = '' if len(v) == 1 else 's'\n keys = ', '.join(map(repr, v))\n raise TypeError(f'multiple values for argument{plural}: {keys}')\n\n model_config = config_dict\n\n self.model = create_model(_utils.to_camel(self.raw_function.__name__), __base__=DecoratorBaseModel, **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_pydantic__pydantic/pydantic/decorators.py____V1ValidatorType.TypeVar__V1ValidatorType": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py____V1ValidatorType.TypeVar__V1ValidatorType", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 101, "span_ids": ["_V1ValidatorWithValuesAndKwargsClsMethod", "_V1ValidatorWithValuesClsMethod.__call__", "_V1ValidatorWithValuesClsMethod", "_V1ValidatorWithValuesAndKwargsClsMethod.__call__", "_V2ValidatorClsMethod", "impl", "_V1RootValidatorClsMethod.__call__", "_V1ValidatorWithValuesKwOnlyClsMethod.__call__", "_V1RootValidatorClsMethod", "_V2WrapValidatorClsMethod.__call__", "_V2WrapValidatorClsMethod", "_OnlyValueValidatorClsMethod.__call__", "docstring", "_OnlyValueValidatorClsMethod", "_V2ValidatorClsMethod.__call__", "_V1ValidatorWithKwargsClsMethod", "_V1ValidatorWithKwargsClsMethod.__call__", "_V1ValidatorWithValuesKwOnlyClsMethod"], "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": "\"\"\"\nPublic methods related to:\n* `validator` - a decorator to add validation to a field on a model\n* `root_validator` - a decorator to add validation to a model as a whole\n* `serializer` - a decorator to add serialization to a field on a model\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nfrom functools import partial\nfrom types import FunctionType\nfrom typing import Any, Callable, TypeVar, Union, overload\nfrom warnings import warn\n\nfrom pydantic_core import core_schema as _core_schema\nfrom typing_extensions import Literal, Protocol\n\nfrom ._internal import _decorators\n\n\nclass _OnlyValueValidatorClsMethod(Protocol):\n def __call__(self, __cls: Any, __value: Any) -> Any:\n ...\n\n\nclass _V1ValidatorWithValuesClsMethod(Protocol):\n def __call__(self, __cls: Any, __value: Any, values: dict[str, Any]) -> Any:\n ...\n\n\nclass _V1ValidatorWithValuesKwOnlyClsMethod(Protocol):\n def __call__(self, __cls: Any, __value: Any, *, values: dict[str, Any]) -> Any:\n ...\n\n\nclass _V1ValidatorWithKwargsClsMethod(Protocol):\n def __call__(self, __cls: Any, **kwargs: Any) -> Any:\n ...\n\n\nclass _V1ValidatorWithValuesAndKwargsClsMethod(Protocol):\n def __call__(self, __cls: Any, values: dict[str, Any], **kwargs: Any) -> Any:\n ...\n\n\nclass _V2ValidatorClsMethod(Protocol):\n def __call__(self, __cls: Any, __input_value: Any, __info: _core_schema.FieldValidationInfo) -> Any:\n ...\n\n\nclass _V2WrapValidatorClsMethod(Protocol):\n def __call__(\n self,\n __cls: Any,\n __input_value: Any,\n __validator: _core_schema.ValidatorFunctionWrapHandler,\n __info: _core_schema.ValidationInfo,\n ) -> Any:\n ...\n\n\nclass _V1RootValidatorClsMethod(Protocol):\n def __call__(self, __cls: Any, __values: _decorators.RootValidatorValues) -> _decorators.RootValidatorValues:\n ...\n\n\nV1Validator = Union[\n _OnlyValueValidatorClsMethod,\n _V1ValidatorWithValuesClsMethod,\n _V1ValidatorWithValuesKwOnlyClsMethod,\n _V1ValidatorWithKwargsClsMethod,\n _V1ValidatorWithValuesAndKwargsClsMethod,\n _decorators.V1ValidatorWithValues,\n _decorators.V1ValidatorWithValuesKwOnly,\n _decorators.V1ValidatorWithKwargs,\n _decorators.V1ValidatorWithValuesAndKwargs,\n]\n\nV2Validator = Union[\n _V2ValidatorClsMethod,\n _core_schema.FieldValidatorFunction,\n _OnlyValueValidatorClsMethod,\n _decorators.OnlyValueValidator,\n]\n\nV2WrapValidator = Union[\n _V2WrapValidatorClsMethod,\n _core_schema.GeneralWrapValidatorFunction,\n _core_schema.FieldWrapValidatorFunction,\n]\n\nV1RootValidator = Union[\n _V1RootValidatorClsMethod,\n _decorators.V1RootValidatorFunction,\n]\n\n\n# Allow both a V1 (assumed pre=False) or V2 (assumed mode='after') validator\n# We lie to type checkers and say we return the same thing we get\n# but in reality we return a proxy object that _mostly_ behaves like the wrapped thing\n_V1ValidatorType = TypeVar('_V1ValidatorType', bound=Union[V1Validator, 'classmethod[Any]', 'staticmethod[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_pydantic__pydantic/pydantic/decorators.py__V2BeforeAfterOrPlainValidatorType__V1RootValidatorFunctionType.TypeVar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py__V2BeforeAfterOrPlainValidatorType__V1RootValidatorFunctionType.TypeVar_", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 117, "span_ids": ["impl"], "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": "_V2BeforeAfterOrPlainValidatorType = TypeVar(\n '_V2BeforeAfterOrPlainValidatorType',\n bound=Union[V2Validator, 'classmethod[Any]', 'staticmethod[Any]'],\n)\n_V2WrapValidatorType = TypeVar(\n '_V2WrapValidatorType', bound=Union[V2WrapValidator, 'classmethod[Any]', 'staticmethod[Any]']\n)\n_V1RootValidatorFunctionType = TypeVar(\n '_V1RootValidatorFunctionType',\n bound=Union[\n _decorators.V1RootValidatorFunction,\n _V1RootValidatorClsMethod,\n 'classmethod[Any]',\n 'staticmethod[Any]',\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_pydantic__pydantic/pydantic/decorators.py_validator_validator.mode._before_if_pre_is_True_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_validator_validator.mode._before_if_pre_is_True_e", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 161, "span_ids": ["validator"], "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 validator(\n __field: str,\n *fields: str,\n pre: bool = False,\n each_item: bool = False,\n always: bool = False,\n check_fields: bool | None = None,\n allow_reuse: bool = False,\n) -> Callable[[_V1ValidatorType], _V1ValidatorType]:\n \"\"\"\n Decorate methods on the class indicating that they should be used to validate fields\n :param __field: the first field the validator should be called on;\n this is separate from `fields` to ensure an error is raised if you don't pass at least one\n :param fields: additional field(s) the validator should be called on\n :param pre: whether or not this validator should be called before the standard validators (else after)\n :param each_item: for complex objects (sets, lists etc.) whether to validate individual elements rather than the\n whole object\n :param always: whether this method and other validators should be called even if the value is missing\n :param check_fields: whether to check that the fields actually exist on the model\n :param allow_reuse: whether to track and raise an error if another validator refers to the decorated function\n \"\"\"\n fields = tuple((__field, *fields))\n if isinstance(fields[0], FunctionType):\n raise TypeError(\n 'field_validators should be used with fields and keyword arguments, not bare. '\n \"E.g. usage should be `@validator('', ...)`\"\n )\n elif not all(isinstance(field, str) for field in fields):\n raise TypeError(\n 'validator fields should be passed as separate string args. '\n \"E.g. usage should be `@validator('', '', ...)`\"\n )\n\n warn(\n 'Pydantic V1 style `@validator` validators are deprecated.'\n ' You should migrate to Pydantic V2 style `@field_validator` validators,'\n ' see the migration guide for more details',\n DeprecationWarning,\n stacklevel=2,\n )\n\n mode: Literal['before', 'after'] = 'before' if pre is True else 'after'\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_pydantic__pydantic/pydantic/decorators.py_validator.dec_validator._type_ignore_return_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_validator.dec_validator._type_ignore_return_val", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 179, "span_ids": ["validator"], "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 validator(\n __field: str,\n *fields: str,\n pre: bool = False,\n each_item: bool = False,\n always: bool = False,\n check_fields: bool | None = None,\n allow_reuse: bool = False,\n) -> Callable[[_V1ValidatorType], _V1ValidatorType]:\n # ... other code\n\n def dec(f: Any) -> _decorators.PydanticDecoratorMarker[Any]:\n if _decorators.is_instance_method_from_sig(f):\n raise TypeError('`@validator` cannot be applied to instance methods')\n _decorators.check_for_duplicate_validator(f, allow_reuse=allow_reuse)\n # auto apply the @classmethod decorator\n f = _decorators.ensure_classmethod_based_on_signature(f)\n wrap = _decorators.make_generic_v1_field_validator\n validator_wrapper_info = _decorators.ValidatorDecoratorInfo(\n fields=fields,\n mode=mode,\n each_item=each_item,\n always=always,\n check_fields=check_fields,\n )\n return _decorators.PydanticDecoratorMarker(f, validator_wrapper_info, shim=wrap)\n\n return dec # type: ignore[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_pydantic__pydantic/pydantic/decorators.py_field_validator_field_validator_2._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_validator_field_validator_2._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 203, "span_ids": ["field_validator", "field_validator_2"], "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": "@overload\ndef field_validator(\n __field: str,\n *fields: str,\n mode: Literal['before', 'after', 'plain'] = ...,\n check_fields: bool | None = ...,\n sub_path: tuple[str | int, ...] | None = ...,\n allow_reuse: bool = False,\n) -> Callable[[_V2BeforeAfterOrPlainValidatorType], _V2BeforeAfterOrPlainValidatorType]:\n ...\n\n\n@overload\ndef field_validator(\n __field: str,\n *fields: str,\n mode: Literal['wrap'],\n check_fields: bool | None = ...,\n sub_path: tuple[str | int, ...] | None = ...,\n allow_reuse: bool = False,\n) -> Callable[[_V2WrapValidatorType], _V2WrapValidatorType]:\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_pydantic__pydantic/pydantic/decorators.py_field_validator_3_field_validator_3.if_isinstance_fields_0_.elif_not_all_isinstance_f.raise_TypeError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_validator_3_field_validator_3.if_isinstance_fields_0_.elif_not_all_isinstance_f.raise_TypeError_", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 234, "span_ids": ["field_validator_3"], "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 field_validator(\n __field: str,\n *fields: str,\n mode: Literal['before', 'after', 'wrap', 'plain'] = 'after',\n check_fields: bool | None = None,\n sub_path: tuple[str | int, ...] | None = None,\n allow_reuse: bool = False,\n) -> Callable[[Any], Any]:\n \"\"\"\n Decorate methods on the class indicating that they should be used to validate fields\n :param __field: the first field the field_validator should be called on;\n this is separate from `fields` to ensure an error is raised if you don't pass at least one\n :param fields: additional field(s) the field_validator should be called on\n :param mode: TODO\n :param check_fields: whether to check that the fields actually exist on the model\n :param sub_path: TODO\n :param allow_reuse: whether to track and raise an error if another validator refers to the decorated function\n \"\"\"\n fields = tuple((__field, *fields))\n if isinstance(fields[0], FunctionType):\n raise TypeError(\n 'field_validators should be used with fields and keyword arguments, not bare. '\n \"E.g. usage should be `@validator('', ...)`\"\n )\n elif not all(isinstance(field, str) for field in fields):\n raise TypeError(\n 'field_validator fields should be passed as separate string args. '\n \"E.g. usage should be `@validator('', '', ...)`\"\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_pydantic__pydantic/pydantic/decorators.py_field_validator_3.dec_field_validator_3.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_validator_3.dec_field_validator_3.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 250, "span_ids": ["field_validator_3"], "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 field_validator(\n __field: str,\n *fields: str,\n mode: Literal['before', 'after', 'wrap', 'plain'] = 'after',\n check_fields: bool | None = None,\n sub_path: tuple[str | int, ...] | None = None,\n allow_reuse: bool = False,\n) -> Callable[[Any], Any]:\n # ... other code\n\n def dec(f: Callable[..., Any] | staticmethod[Any] | classmethod[Any]) -> _decorators.PydanticDecoratorMarker[Any]:\n if _decorators.is_instance_method_from_sig(f):\n raise TypeError('`@field_validator` cannot be applied to instance methods')\n _decorators.check_for_duplicate_validator(f, allow_reuse=allow_reuse)\n # auto apply the @classmethod decorator and warn users if we had to do so\n f = _decorators.ensure_classmethod_based_on_signature(f)\n\n wrap = partial(_decorators.make_generic_v2_field_validator, mode=mode)\n\n validator_wrapper_info = _decorators.FieldValidatorDecoratorInfo(\n fields=fields, mode=mode, sub_path=sub_path, check_fields=check_fields\n )\n return _decorators.PydanticDecoratorMarker(f, validator_wrapper_info, shim=wrap)\n\n return 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_pydantic__pydantic/pydantic/decorators.py_root_validator_root_validator_6._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_root_validator_root_validator_6._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 284, "span_ids": ["root_validator", "root_validator_5", "root_validator_6"], "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": "@overload\ndef root_validator(\n *,\n # if you don't specify `pre` the default is `pre=False`\n # which means you need to specify `skip_on_failure=True`\n skip_on_failure: Literal[True],\n allow_reuse: bool = ...,\n) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType,]:\n ...\n\n\n@overload\ndef root_validator(\n *,\n # if you specify `pre=True` then you don't need to specify\n # `skip_on_failure`, in fact it is not allowed as an argument!\n pre: Literal[True],\n allow_reuse: bool = ...,\n) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType,]:\n ...\n\n\n@overload\ndef root_validator(\n *,\n # if you explicitly specify `pre=False` then you\n # MUST specify `skip_on_failure=True`\n pre: Literal[False],\n skip_on_failure: Literal[True],\n allow_reuse: bool = ...,\n) -> Callable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType,]:\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_pydantic__pydantic/pydantic/decorators.py_root_validator_7_root_validator_7.wrap.partial__decorators_make_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_root_validator_7_root_validator_7.wrap.partial__decorators_make_", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 309, "span_ids": ["root_validator_7"], "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 root_validator(\n *,\n pre: bool = False,\n skip_on_failure: bool = False,\n allow_reuse: bool = False,\n) -> Callable[[Any], _decorators.PydanticDecoratorMarker[Any]]:\n \"\"\"\n Decorate methods on a model indicating that they should be used to validate (and perhaps modify) data either\n before or after standard model parsing/validation is performed.\n \"\"\"\n mode: Literal['before', 'after'] = 'before' if pre is True else 'after'\n if pre is False and skip_on_failure is not True:\n raise TypeError(\n 'If you use `@root_validator` with pre=False (the default)'\n ' you MUST specify `skip_on_failure=True`.'\n ' The `skip_on_failure=False` option is no longer available.'\n ' If you were not trying to set `skip_on_failure=False` you'\n ' can safely set `skip_on_failure=True`.'\n ' If you do, this root validator will no longer be called'\n ' if validation fails for any of the fields.'\n ' Please see the migration guide for more details.'\n )\n wrap = partial(_decorators.make_v1_generic_root_validator, pre=pre)\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_pydantic__pydantic/pydantic/decorators.py_root_validator_7.dec_root_validator_7.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_root_validator_7.dec_root_validator_7.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 320, "span_ids": ["root_validator_7"], "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 root_validator(\n *,\n pre: bool = False,\n skip_on_failure: bool = False,\n allow_reuse: bool = False,\n) -> Callable[[Any], _decorators.PydanticDecoratorMarker[Any]]:\n # ... other code\n\n def dec(f: Callable[..., Any] | classmethod[Any] | staticmethod[Any]) -> Any:\n if _decorators.is_instance_method_from_sig(f):\n raise TypeError('`@root_validator` cannot be applied to instance methods')\n _decorators.check_for_duplicate_validator(f, allow_reuse=allow_reuse)\n # auto apply the @classmethod decorator and warn users if we had to do so\n res = _decorators.ensure_classmethod_based_on_signature(f)\n validator_wrapper_info = _decorators.RootValidatorDecoratorInfo(mode=mode)\n return _decorators.PydanticDecoratorMarker(res, validator_wrapper_info, shim=wrap)\n\n return 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_pydantic__pydantic/pydantic/decorators.py__PlainSerializationFunction__WrapSerializeMethodType.TypeVar__WrapSerializeMe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py__PlainSerializationFunction__WrapSerializeMethodType.TypeVar__WrapSerializeMe", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 323, "end_line": 340, "span_ids": ["impl:17"], "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": "_PlainSerializationFunction = Union[\n _core_schema.GeneralPlainSerializerFunction,\n _core_schema.FieldPlainSerializerFunction,\n _decorators.GenericPlainSerializerFunctionWithoutInfo,\n _decorators.FieldPlainSerializerFunctionWithoutInfo,\n]\n\n\n_WrapSerializationFunction = Union[\n _core_schema.GeneralWrapSerializerFunction,\n _core_schema.FieldWrapSerializerFunction,\n _decorators.GeneralWrapSerializerFunctionWithoutInfo,\n _decorators.FieldWrapSerializerFunctionWithoutInfo,\n]\n\n\n_PlainSerializeMethodType = TypeVar('_PlainSerializeMethodType', bound=_PlainSerializationFunction)\n_WrapSerializeMethodType = TypeVar('_WrapSerializeMethodType', bound=_WrapSerializationFunction)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_field_serializer._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_field_serializer._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 343, "end_line": 353, "span_ids": ["field_serializer"], "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": "@overload\ndef field_serializer(\n __field: str,\n *fields: str,\n json_return_type: _core_schema.JsonReturnTypes | None = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = ...,\n sub_path: tuple[str | int, ...] | None = ...,\n check_fields: bool | None = ...,\n allow_reuse: bool = ...,\n) -> Callable[[_PlainSerializeMethodType], _PlainSerializeMethodType]:\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_pydantic__pydantic/pydantic/decorators.py_field_serializer_9_field_serializer_9._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_9_field_serializer_9._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 356, "end_line": 367, "span_ids": ["field_serializer_9"], "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": "@overload\ndef field_serializer(\n __field: str,\n *fields: str,\n mode: Literal['plain'],\n json_return_type: _core_schema.JsonReturnTypes | None = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = ...,\n sub_path: tuple[str | int, ...] | None = ...,\n check_fields: bool | None = ...,\n allow_reuse: bool = ...,\n) -> Callable[[_PlainSerializeMethodType], _PlainSerializeMethodType]:\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_pydantic__pydantic/pydantic/decorators.py_field_serializer_10_field_serializer_10._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_10_field_serializer_10._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 370, "end_line": 381, "span_ids": ["field_serializer_10"], "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": "@overload\ndef field_serializer(\n __field: str,\n *fields: str,\n mode: Literal['wrap'],\n json_return_type: _core_schema.JsonReturnTypes | None = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = ...,\n sub_path: tuple[str | int, ...] | None = ...,\n check_fields: bool | None = ...,\n allow_reuse: bool = ...,\n) -> Callable[[_WrapSerializeMethodType], _WrapSerializeMethodType]:\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_pydantic__pydantic/pydantic/decorators.py_field_serializer_11_field_serializer_11._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_11_field_serializer_11._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 409, "span_ids": ["field_serializer_11"], "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 field_serializer(\n *fields: str,\n mode: Literal['plain', 'wrap'] = 'plain',\n json_return_type: _core_schema.JsonReturnTypes | None = None,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always',\n sub_path: tuple[str | int, ...] | None = None,\n check_fields: bool | None = None,\n allow_reuse: bool = False,\n) -> Callable[[Any], Any]:\n \"\"\"\n Decorate methods on the class indicating that they should be used to serialize fields.\n Four signatures are supported:\n - (self, value: Any, info: FieldSerializationInfo)\n - (self, value: Any, nxt: SerializerFunctionWrapHandler, info: FieldSerializationInfo)\n - (value: Any, info: SerializationInfo)\n - (value: Any, nxt: SerializerFunctionWrapHandler, info: SerializationInfo)\n\n :param fields: which field(s) the method should be called on\n :param mode: `'plain'` means the function will be called instead of the default serialization logic,\n `'wrap'` means the function will be called with an argument to optionally call the default serialization logic.\n :param json_return_type: The type that the function returns if the serialization mode is JSON.\n :param when_used: When the function should be called\n :param sub_path: TODO\n :param check_fields: whether to check that the fields actually exist on the model\n :param allow_reuse: whether to track and raise an error if another validator refers to the decorated function\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_pydantic__pydantic/pydantic/decorators.py_field_serializer_11.dec_field_serializer_11.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_field_serializer_11.dec_field_serializer_11.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 411, "end_line": 428, "span_ids": ["field_serializer_11"], "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 field_serializer(\n *fields: str,\n mode: Literal['plain', 'wrap'] = 'plain',\n json_return_type: _core_schema.JsonReturnTypes | None = None,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always',\n sub_path: tuple[str | int, ...] | None = None,\n check_fields: bool | None = None,\n allow_reuse: bool = False,\n) -> Callable[[Any], Any]:\n\n def dec(f: Callable[..., Any] | staticmethod[Any] | classmethod[Any]) -> _decorators.PydanticDecoratorMarker[Any]:\n res = _decorators.prepare_serializer_decorator(f, allow_reuse)\n type_: Literal['field', 'general'] = 'field' if _decorators.is_instance_method_from_sig(f) else 'general'\n\n dec_info = _decorators.FieldSerializerDecoratorInfo(\n fields=fields,\n mode=mode,\n type=type_,\n json_return_type=json_return_type,\n when_used=when_used,\n sub_path=sub_path,\n check_fields=check_fields,\n )\n return _decorators.PydanticDecoratorMarker(\n res, dec_info, shim=partial(_decorators.make_generic_field_serializer, mode=mode, type=type_)\n )\n\n return 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_pydantic__pydantic/pydantic/decorators.py_model_serializer_model_serializer._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_model_serializer_model_serializer._", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 431, "end_line": 447, "span_ids": ["model_serializer"], "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 model_serializer(\n __f: Callable[..., Any] = None,\n *,\n mode: Literal['plain', 'wrap'] = 'plain',\n json_return_type: _core_schema.JsonReturnTypes | None = None,\n allow_reuse: bool = False,\n) -> Callable[[Any], _decorators.PydanticDecoratorMarker[Any]] | _decorators.PydanticDecoratorMarker[Any]:\n \"\"\"\n Function decorate to add a function which will be called to serialize the model.\n\n (`when_used` is not permitted here since it make no sense)\n\n :param mode: `'plain'` means the function will be called instead of the default serialization logic,\n `'wrap'` means the function will be called with an argument to optionally call the default serialization logic.\n :param json_return_type: The type that the function returns if the serialization mode is JSON.\n :param allow_reuse: whether to track and raise an error if another validator refers to the decorated function\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_pydantic__pydantic/pydantic/decorators.py_model_serializer.dec_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorators.py_model_serializer.dec_", "embedding": null, "metadata": {"file_path": "pydantic/decorators.py", "file_name": "decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 467, "span_ids": ["model_serializer"], "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 model_serializer(\n __f: Callable[..., Any] = None,\n *,\n mode: Literal['plain', 'wrap'] = 'plain',\n json_return_type: _core_schema.JsonReturnTypes | None = None,\n allow_reuse: bool = False,\n) -> Callable[[Any], _decorators.PydanticDecoratorMarker[Any]] | _decorators.PydanticDecoratorMarker[Any]:\n\n def dec(f: Callable[..., Any]) -> _decorators.PydanticDecoratorMarker[Any]:\n if isinstance(f, (staticmethod, classmethod)) or not _decorators.is_instance_method_from_sig(f):\n raise TypeError('`@model_serializer` must be applied to instance methods')\n\n res = _decorators.prepare_serializer_decorator(f, allow_reuse)\n\n dec_info = _decorators.ModelSerializerDecoratorInfo(\n mode=mode,\n json_return_type=json_return_type,\n )\n return _decorators.PydanticDecoratorMarker(\n res, dec_info, shim=partial(_decorators.make_generic_model_serializer, mode=mode)\n )\n\n if __f is None:\n return dec\n else:\n return dec(__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_pydantic__pydantic/pydantic/deprecated/copy_internals.py_from___future___import_an__object_setattr._model_construction_objec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py_from___future___import_an__object_setattr._model_construction_objec", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/copy_internals.py", "file_name": "copy_internals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["imports"], "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": "from __future__ import annotations as _annotations\n\nimport typing\nfrom copy import deepcopy\nfrom enum import Enum\nfrom typing import Any\n\nfrom .._internal import (\n _model_construction,\n _typing_extra,\n _utils,\n)\nfrom .._internal._fields import Undefined\n\nif typing.TYPE_CHECKING:\n from pydantic import BaseModel\n from pydantic._internal._utils import AbstractSetIntStr, MappingIntStrAny\n\n AnyClassMethod = classmethod[Any]\n TupleGenerator = typing.Generator[tuple[str, Any], None, None]\n Model = typing.TypeVar('Model', bound='BaseModel')\n # should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope\n IncEx = set[int] | set[str] | dict[int, Any] | dict[str, Any] | None\n\n_object_setattr = _model_construction.object_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_pydantic__pydantic/pydantic/deprecated/copy_internals.py__iter__iter.for_field_key_v_in_self_.yield_dict_key_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__iter__iter.for_field_key_v_in_self_.yield_dict_key_v", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/copy_internals.py", "file_name": "copy_internals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 87, "span_ids": ["_iter"], "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": "def _iter(\n self: BaseModel,\n to_dict: bool = False,\n by_alias: bool = False,\n include: AbstractSetIntStr | MappingIntStrAny | None = None,\n exclude: AbstractSetIntStr | MappingIntStrAny | None = None,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n) -> TupleGenerator:\n # Merge field set excludes with explicit exclude parameter with explicit overriding field set options.\n # The extra \"is not None\" guards are not logically necessary but optimizes performance for the simple case.\n if exclude is not None:\n exclude = _utils.ValueItems.merge(\n {k: v.exclude for k, v in self.model_fields.items() if v.exclude is not None}, exclude\n )\n\n if include is not None:\n include = _utils.ValueItems.merge({k: v.include for k, v in self.model_fields.items()}, include, intersect=True)\n\n allowed_keys = _calculate_keys(self, include=include, exclude=exclude, exclude_unset=exclude_unset) # type: ignore\n if allowed_keys is None and not (to_dict or by_alias or exclude_unset or exclude_defaults or exclude_none):\n # huge boost for plain _iter()\n yield from self.__dict__.items()\n return\n\n value_exclude = _utils.ValueItems(self, exclude) if exclude is not None else None\n value_include = _utils.ValueItems(self, include) if include is not None else None\n\n for field_key, v in self.__dict__.items():\n if (allowed_keys is not None and field_key not in allowed_keys) or (exclude_none and v is None):\n continue\n\n if exclude_defaults:\n try:\n field = self.model_fields[field_key]\n except KeyError:\n pass\n else:\n if not field.is_required() and field.default == v:\n continue\n\n if by_alias and field_key in self.model_fields:\n dict_key = self.model_fields[field_key].alias or field_key\n else:\n dict_key = field_key\n\n if to_dict or value_include or value_exclude:\n v = _get_value( # type: ignore[no-untyped-call]\n type(self),\n v,\n to_dict=to_dict,\n by_alias=by_alias,\n include=value_include and value_include.for_element(field_key),\n exclude=value_exclude and value_exclude.for_element(field_key),\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_none,\n )\n yield dict_key, 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_pydantic__pydantic/pydantic/deprecated/copy_internals.py__copy_and_set_values__copy_and_set_values.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__copy_and_set_values__copy_and_set_values.return.m", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/copy_internals.py", "file_name": "copy_internals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 108, "span_ids": ["_copy_and_set_values"], "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 _copy_and_set_values(\n self: Model, values: typing.Dict[str, Any], fields_set: set[str], *, deep: bool # noqa UP006\n) -> Model:\n if deep:\n # chances of having empty dict here are quite low for using smart_deepcopy\n values = deepcopy(values)\n\n cls = self.__class__\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', values)\n _object_setattr(m, '__fields_set__', fields_set)\n for name in self.__private_attributes__:\n value = getattr(self, name, Undefined)\n if value is not Undefined:\n if deep:\n value = deepcopy(value)\n _object_setattr(m, name, value)\n\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_pydantic__pydantic/pydantic/deprecated/copy_internals.py__get_value__get_value.if_isinstance_v_dict_.else_.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__get_value__get_value.if_isinstance_v_dict_.else_.return.v", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/copy_internals.py", "file_name": "copy_internals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 183, "span_ids": ["_get_value"], "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": "@typing.no_type_check\ndef _get_value(\n cls: type[BaseModel],\n v: Any,\n to_dict: bool,\n by_alias: bool,\n include: AbstractSetIntStr | MappingIntStrAny | None,\n exclude: AbstractSetIntStr | MappingIntStrAny | None,\n exclude_unset: bool,\n exclude_defaults: bool,\n exclude_none: bool,\n) -> Any:\n from pydantic import BaseModel\n\n if isinstance(v, BaseModel):\n if to_dict:\n return v.model_dump(\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n include=include,\n exclude=exclude,\n exclude_none=exclude_none,\n )\n else:\n return v.copy(include=include, exclude=exclude)\n\n value_exclude = _utils.ValueItems(v, exclude) if exclude else None\n value_include = _utils.ValueItems(v, include) if include else None\n\n if isinstance(v, dict):\n return {\n k_: _get_value(\n cls,\n v_,\n to_dict=to_dict,\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n include=value_include and value_include.for_element(k_),\n exclude=value_exclude and value_exclude.for_element(k_),\n exclude_none=exclude_none,\n )\n for k_, v_ in v.items()\n if (not value_exclude or not value_exclude.is_excluded(k_))\n and (not value_include or value_include.is_included(k_))\n }\n\n elif _utils.sequence_like(v):\n seq_args = (\n _get_value(\n cls,\n v_,\n to_dict=to_dict,\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n include=value_include and value_include.for_element(i),\n exclude=value_exclude and value_exclude.for_element(i),\n exclude_none=exclude_none,\n )\n for i, v_ in enumerate(v)\n if (not value_exclude or not value_exclude.is_excluded(i))\n and (not value_include or value_include.is_included(i))\n )\n\n return v.__class__(*seq_args) if _typing_extra.is_namedtuple(v.__class__) else v.__class__(seq_args)\n\n elif isinstance(v, Enum) and getattr(cls.model_config, 'use_enum_values', False):\n return v.value\n\n else:\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_pydantic__pydantic/pydantic/deprecated/copy_internals.py__calculate_keys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__calculate_keys_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/copy_internals.py", "file_name": "copy_internals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 212, "span_ids": ["_calculate_keys"], "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 _calculate_keys(\n self: BaseModel,\n include: MappingIntStrAny | None,\n exclude: MappingIntStrAny | None,\n exclude_unset: bool,\n update: typing.Dict[str, Any] | None = None, # noqa UP006\n) -> typing.AbstractSet[str] | None:\n if include is None and exclude is None and exclude_unset is False:\n return None\n\n keys: typing.AbstractSet[str]\n if exclude_unset:\n keys = self.__fields_set__.copy()\n else:\n keys = self.__dict__.keys()\n\n if include is not None:\n keys &= include.keys()\n\n if update:\n keys -= update.keys()\n\n if exclude:\n keys -= {k for k, v in exclude.items() if _utils.ValueItems.is_true(v)}\n\n return 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_pydantic__pydantic/pydantic/deprecated/json.py_datetime_isoformat.return.o_isoformat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_datetime_isoformat.return.o_isoformat_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "span_ids": ["imports", "isoformat"], "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": "import datetime\nfrom collections import deque\nfrom decimal import Decimal\nfrom enum import Enum\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom pathlib import Path\nfrom re import Pattern\nfrom types import GeneratorType\nfrom typing import Any, Callable, Dict, Type, Union\nfrom uuid import UUID\n\nfrom ..color import Color\nfrom ..networks import NameEmail\nfrom ..types import SecretBytes, SecretStr\n\n__all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat'\n\n\ndef isoformat(o: Union[datetime.date, datetime.time]) -> str:\n return o.isoformat()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_decimal_encoder_decimal_encoder.if_isinstance_exponent_i.else_.return.float_dec_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_decimal_encoder_decimal_encoder.if_isinstance_exponent_i.else_.return.float_dec_value_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 23, "end_line": 42, "span_ids": ["decimal_encoder"], "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 decimal_encoder(dec_value: Decimal) -> Union[int, float]:\n \"\"\"\n Encodes a Decimal as int of there's no exponent, otherwise float\n\n This is useful when we use ConstrainedDecimal to represent Numeric(x,0)\n where a integer (but not int typed) is used. Encoding this as a float\n results in failed round-tripping between encode and parse.\n Our Id type is a prime example of this.\n\n >>> decimal_encoder(Decimal(\"1.0\"))\n 1.0\n\n >>> decimal_encoder(Decimal(\"1\"))\n 1\n \"\"\"\n exponent = dec_value.as_tuple().exponent\n if isinstance(exponent, int) and exponent >= 0:\n return int(dec_value)\n else:\n return float(dec_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_pydantic__pydantic/pydantic/deprecated/json.py_ENCODERS_BY_TYPE_ENCODERS_BY_TYPE._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_ENCODERS_BY_TYPE_ENCODERS_BY_TYPE._", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 70, "span_ids": ["impl:3"], "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": "ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {\n bytes: lambda o: o.decode(),\n Color: str,\n datetime.date: isoformat,\n datetime.datetime: isoformat,\n datetime.time: isoformat,\n datetime.timedelta: lambda td: td.total_seconds(),\n Decimal: decimal_encoder,\n Enum: lambda o: o.value,\n frozenset: list,\n deque: list,\n GeneratorType: list,\n IPv4Address: str,\n IPv4Interface: str,\n IPv4Network: str,\n IPv6Address: str,\n IPv6Interface: str,\n IPv6Network: str,\n NameEmail: str,\n Path: str,\n Pattern: lambda o: o.pattern,\n SecretBytes: str,\n SecretStr: str,\n set: list,\n UUID: 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_pydantic__pydantic/pydantic/deprecated/json.py_pydantic_encoder_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.raise_TypeError_f_Object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_pydantic_encoder_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.raise_TypeError_f_Object_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 91, "span_ids": ["pydantic_encoder"], "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 pydantic_encoder(obj: Any) -> Any:\n from dataclasses import asdict, is_dataclass\n\n from ..main import BaseModel\n\n if isinstance(obj, BaseModel):\n return obj.model_dump()\n elif is_dataclass(obj):\n return asdict(obj)\n\n # Check the class type and its superclasses for a matching encoder\n for base in obj.__class__.__mro__[:-1]:\n try:\n encoder = ENCODERS_BY_TYPE[base]\n except KeyError:\n continue\n return encoder(obj)\n else: # We have exited the for loop without finding a suitable encoder\n raise TypeError(f\"Object of type '{obj.__class__.__name__}' is not JSON serializable\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_custom_pydantic_encoder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_custom_pydantic_encoder_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 114, "span_ids": ["timedelta_isoformat", "custom_pydantic_encoder"], "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 custom_pydantic_encoder(type_encoders: Dict[Any, Callable[[Type[Any]], Any]], obj: Any) -> Any:\n # Check the class type and its superclasses for a matching encoder\n for base in obj.__class__.__mro__[:-1]:\n try:\n encoder = type_encoders[base]\n except KeyError:\n continue\n\n return encoder(obj)\n else: # We have exited the for loop without finding a suitable encoder\n return pydantic_encoder(obj)\n\n\ndef timedelta_isoformat(td: datetime.timedelta) -> str:\n \"\"\"\n ISO 8601 encoding for Python timedelta object.\n \"\"\"\n minutes, seconds = divmod(td.seconds, 60)\n hours, minutes = divmod(minutes, 60)\n return f'{\"-\" if td.days < 0 else \"\"}P{abs(td.days)}DT{hours:d}H{minutes:d}M{seconds:d}.{td.microseconds:06d}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_pydantic__pydantic/pydantic/deprecated/parse.py_from___future___import_an_load_str_bytes.if_proto_Protocol_json.else_.raise_TypeError_f_Unknown": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_from___future___import_an_load_str_bytes.if_proto_Protocol_json.else_.raise_TypeError_f_Unknown", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/parse.py", "file_name": "parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["imports", "Protocol", "load_str_bytes"], "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": "from __future__ import annotations\n\nimport json\nimport pickle\nfrom enum import Enum\nfrom pathlib import Path\nfrom typing import Any, Callable\n\n\nclass Protocol(str, Enum):\n json = 'json'\n pickle = 'pickle'\n\n\ndef load_str_bytes(\n b: str | bytes,\n *,\n content_type: str = None,\n encoding: str = 'utf8',\n proto: Protocol = None,\n allow_pickle: bool = False,\n json_loads: Callable[[str], Any] = json.loads,\n) -> Any:\n if proto is None and content_type:\n if content_type.endswith(('json', 'javascript')):\n pass\n elif allow_pickle and content_type.endswith('pickle'):\n proto = Protocol.pickle\n else:\n raise TypeError(f'Unknown content-type: {content_type}')\n\n proto = proto or Protocol.json\n\n if proto == Protocol.json:\n if isinstance(b, bytes):\n b = b.decode(encoding)\n return json_loads(b)\n elif proto == Protocol.pickle:\n if not allow_pickle:\n raise RuntimeError('Trying to decode with pickle with allow_pickle=False')\n bb = b if isinstance(b, bytes) else b.encode()\n return pickle.loads(bb)\n else:\n raise TypeError(f'Unknown protocol: {proto}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_load_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_load_file_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/parse.py", "file_name": "parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 67, "span_ids": ["load_file"], "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 load_file(\n path: str | Path,\n *,\n content_type: str = None,\n encoding: str = 'utf8',\n proto: Protocol = None,\n allow_pickle: bool = False,\n json_loads: Callable[[str], Any] = json.loads,\n) -> Any:\n path = Path(path)\n b = path.read_bytes()\n if content_type is None:\n if path.suffix in ('.js', '.json'):\n proto = Protocol.json\n elif path.suffix == '.pkl':\n proto = Protocol.pickle\n\n return load_str_bytes(\n b, proto=proto, content_type=content_type, encoding=encoding, allow_pickle=allow_pickle, json_loads=json_loads\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_pydantic__pydantic/pydantic/errors.py_from___future___import_an_PydanticUserError.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_from___future___import_an_PydanticUserError.pass", "embedding": null, "metadata": {"file_path": "pydantic/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["imports", "PydanticUserError", "PydanticErrorMixin.__init__", "PydanticErrorMixin"], "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": "from __future__ import annotations as _annotations\n\nimport re\n\n__all__ = (\n 'PydanticUserError',\n 'PydanticSchemaGenerationError',\n 'PydanticUndefinedAnnotation',\n 'PydanticInvalidForJsonSchema',\n)\n\n\nclass PydanticErrorMixin:\n \"\"\"\n Pydantic Error Mixin for common functions\n \"\"\"\n\n def __init__(self, code: str, *, message: str | None = None) -> None:\n self.code = code\n self.message = message\n\n\nclass PydanticUserError(PydanticErrorMixin, TypeError):\n \"\"\"\n Error caused by incorrect use of Pydantic\n \"\"\"\n\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_pydantic__pydantic/pydantic/errors.py_PydanticUndefinedAnnotation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticUndefinedAnnotation_", "embedding": null, "metadata": {"file_path": "pydantic/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 66, "span_ids": ["PydanticUndefinedAnnotation.__str__", "PydanticInvalidForJsonSchema", "PydanticUndefinedAnnotation", "PydanticUndefinedAnnotation.from_name_error", "PydanticUndefinedAnnotation.__init__", "PydanticSchemaGenerationError"], "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 PydanticUndefinedAnnotation(PydanticErrorMixin, NameError):\n \"\"\"\n Error occurs when annotations are not yet defined\n \"\"\"\n\n def __init__(self, name: str, message: str | None = None) -> None:\n self.name = name\n super().__init__(code=name, message=message)\n\n @classmethod\n def from_name_error(cls, name_error: NameError) -> PydanticUndefinedAnnotation:\n try:\n name = name_error.name\n except AttributeError:\n name = re.search(r\".*'(.+?)'\", str(name_error)).group(1) # type: ignore[union-attr]\n return cls(name=name, message=str(name_error))\n\n def __str__(self) -> str:\n return f'Undefined annotation: {self.message}'\n\n\nclass PydanticSchemaGenerationError(PydanticUserError):\n \"\"\"\n Error occurs when schema has not been generated correctly.\n \"\"\"\n\n pass\n\n\nclass PydanticInvalidForJsonSchema(PydanticUserError):\n \"\"\"\n Error raised when a type from a CoreSchema is not compatible with JSON schema generation\n \"\"\"\n\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_pydantic__pydantic/pydantic/fields.py_from___future___import_an_FieldInfo.__init__.self.validate_default.kwargs_get_validate_defa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_from___future___import_an_FieldInfo.__init__.self.validate_default.kwargs_get_validate_defa", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 97, "span_ids": ["imports", "FieldInfo", "FieldInfo.__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": "from __future__ import annotations as _annotations\n\nimport typing\nfrom copy import copy\nfrom typing import Any\n\nimport annotated_types\nimport typing_extensions\n\nfrom . import types\nfrom ._internal import _fields, _forward_ref, _repr, _typing_extra, _utils\nfrom ._internal._fields import Undefined\n\nif typing.TYPE_CHECKING:\n from dataclasses import Field as DataclassField\n\n from ._internal._repr import ReprArgs\n\n\nclass FieldInfo(_repr.Representation):\n \"\"\"\n Hold information about a field, FieldInfo is used however a field is defined, whether or not the `Field()`\n function below is explicitly used.\n \"\"\"\n\n # TODO: Need to add attribute annotations\n\n __slots__ = (\n 'annotation',\n 'default',\n 'default_factory',\n 'alias',\n 'alias_priority',\n 'title',\n 'description',\n 'examples',\n 'exclude',\n 'include',\n 'metadata',\n 'repr',\n 'discriminator',\n 'json_schema_extra',\n 'init_var',\n 'kw_only',\n 'validate_default',\n )\n\n # used to convert kwargs to metadata/constraints,\n # None has a special meaning - these items are collected into a `PydanticGeneralMetadata`\n metadata_lookup: dict[str, typing.Callable[[Any], Any] | None] = {\n 'gt': annotated_types.Gt,\n 'ge': annotated_types.Ge,\n 'lt': annotated_types.Lt,\n 'le': annotated_types.Le,\n 'multiple_of': annotated_types.MultipleOf,\n 'strict': types.Strict,\n 'min_length': annotated_types.MinLen,\n 'max_length': annotated_types.MaxLen,\n 'pattern': None,\n 'allow_inf_nan': None,\n 'min_items': None,\n 'max_items': None,\n 'frozen': None,\n 'max_digits': None,\n 'decimal_places': None,\n }\n\n def __init__(self, **kwargs: Any) -> None:\n # TODO: This is a good place to add migration warnings; we should use overload for type-hinting the signature\n self.annotation, annotation_metadata = self._extract_metadata(kwargs.get('annotation'))\n\n default = kwargs.pop('default', Undefined)\n if default is Ellipsis:\n self.default = Undefined\n else:\n self.default = default\n\n self.default_factory = kwargs.get('default_factory')\n\n if self.default is not Undefined and self.default_factory is not None:\n raise ValueError('cannot specify both default and default_factory')\n\n self.alias = kwargs.get('alias')\n self.alias_priority = kwargs.get('alias_priority') or 2 if self.alias is not None else None\n self.title = kwargs.get('title')\n self.description = kwargs.get('description')\n self.examples = kwargs.get('examples')\n self.exclude = kwargs.get('exclude')\n self.include = kwargs.get('include')\n self.metadata = self._collect_metadata(kwargs) + annotation_metadata\n self.discriminator = kwargs.get('discriminator')\n self.repr = kwargs.get('repr', True)\n self.json_schema_extra = kwargs.get('json_schema_extra')\n # currently only used on dataclasses\n self.init_var = kwargs.get('init_var', None)\n self.kw_only = kwargs.get('kw_only', None)\n self.validate_default = kwargs.get('validate_default', 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_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_field_FieldInfo.from_field.return.cls_default_default_kw": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_field_FieldInfo.from_field.return.cls_default_default_kw", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 110, "span_ids": ["FieldInfo.from_field"], "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 FieldInfo(_repr.Representation):\n\n @classmethod\n def from_field(cls, default: Any = Undefined, **kwargs: Any) -> FieldInfo:\n \"\"\"\n Create `FieldInfo` with the `Field` function, e.g.:\n >>> import pydantic\n >>> class MyModel(pydantic.BaseModel):\n >>> foo: int = pydantic.Field(4, ...) # <-- like this\n \"\"\"\n # TODO: This is a good place to add migration warnings; should we use overload for type-hinting the signature?\n if 'annotation' in kwargs:\n raise TypeError('\"annotation\" is not permitted as a Field keyword argument')\n return cls(default=default, **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_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_annotation_FieldInfo.from_annotation.return.cls_annotation_annotation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_annotation_FieldInfo.from_annotation.return.cls_annotation_annotation", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 136, "span_ids": ["FieldInfo.from_annotation"], "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 FieldInfo(_repr.Representation):\n\n @classmethod\n def from_annotation(cls, annotation: type[Any] | _forward_ref.PydanticForwardRef) -> FieldInfo:\n \"\"\"\n Create `FieldInfo` from a bare annotation, e.g.:\n >>> import pydantic\n >>> class MyModel(pydantic.BaseModel):\n >>> foo: int # <-- like this\n\n We also account for the case where the annotation can be an instance of `Annotated` and where\n one of the (not first) arguments in `Annotated` are an instance of `FieldInfo`, e.g.:\n >>> import pydantic, annotated_types, typing\n >>> class MyModel(pydantic.BaseModel):\n >>> foo: typing.Annotated[int, annotated_types.Gt(42)]\n >>> bar: typing.Annotated[int, Field(gt=42)]\n \"\"\"\n if _typing_extra.is_annotated(annotation):\n first_arg, *extra_args = typing_extensions.get_args(annotation)\n field_info = cls._find_field_info_arg(extra_args)\n if field_info:\n new_field_info = copy(field_info)\n new_field_info.annotation = first_arg\n new_field_info.metadata += [a for a in extra_args if not isinstance(a, FieldInfo)]\n return new_field_info\n\n return cls(annotation=annotation)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_annotated_attribute_FieldInfo.from_annotated_attribute.if_isinstance_default_cl.else_.return.cls_annotation_annotation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_annotated_attribute_FieldInfo.from_annotated_attribute.if_isinstance_default_cl.else_.return.cls_annotation_annotation", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 172, "span_ids": ["FieldInfo.from_annotated_attribute"], "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 FieldInfo(_repr.Representation):\n\n @classmethod\n def from_annotated_attribute(cls, annotation: type[Any], default: Any) -> FieldInfo:\n \"\"\"\n Create `FieldInfo` from an annotation with a default value, e.g.:\n >>> import pydantic, annotated_types, typing\n >>> class MyModel(pydantic.BaseModel):\n >>> foo: int = 4 # <-- like this\n >>> bar: typing.Annotated[int, annotated_types.Gt(4)] = 4 # <-- or this\n >>> spam: typing.Annotated[int, pydantic.Field(gt=4)] = 4 # <-- or this\n \"\"\"\n import dataclasses\n\n if isinstance(default, cls):\n default.annotation, annotation_metadata = cls._extract_metadata(annotation)\n default.metadata += annotation_metadata\n return default\n elif isinstance(default, dataclasses.Field):\n pydantic_field = cls.from_dataclass_field(default)\n pydantic_field.annotation, annotation_metadata = cls._extract_metadata(annotation)\n pydantic_field.metadata += annotation_metadata\n return pydantic_field\n else:\n if _typing_extra.is_annotated(annotation):\n first_arg, *extra_args = typing_extensions.get_args(annotation)\n field_info = cls._find_field_info_arg(extra_args)\n if field_info is not None:\n if not field_info.is_required():\n raise TypeError('Default may not be specified twice on the same field')\n new_field_info = copy(field_info)\n new_field_info.default = default\n new_field_info.annotation = first_arg\n new_field_info.metadata += [a for a in extra_args if not isinstance(a, FieldInfo)]\n return new_field_info\n\n return cls(annotation=annotation, default=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_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_dataclass_field_FieldInfo.from_dataclass_field.return.field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_dataclass_field_FieldInfo.from_dataclass_field.return.field", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 195, "span_ids": ["FieldInfo.from_dataclass_field"], "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 FieldInfo(_repr.Representation):\n\n @classmethod\n def from_dataclass_field(cls, dc_field: DataclassField[Any]) -> FieldInfo:\n \"\"\"\n Construct a `FieldInfo` from a `dataclasses.Field` instance.\n \"\"\"\n import dataclasses\n\n default = dc_field.default\n if default is dataclasses.MISSING:\n default = Undefined\n\n if dc_field.default_factory is dataclasses.MISSING:\n default_factory: typing.Callable[[], Any] | None = None\n else:\n default_factory = dc_field.default_factory\n\n # use the `Field` function so in correct kwargs raise the correct `TypeError`\n field = Field(default=default, default_factory=default_factory, repr=dc_field.repr, **dc_field.metadata)\n\n field.annotation, annotation_metadata = cls._extract_metadata(dc_field.type)\n field.metadata += annotation_metadata\n return 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_pydantic__pydantic/pydantic/fields.py_FieldInfo._extract_metadata_FieldInfo._find_field_info_arg.return.next_a_for_a_in_args_if_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._extract_metadata_FieldInfo._find_field_info_arg.return.next_a_for_a_in_args_if_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 197, "end_line": 219, "span_ids": ["FieldInfo._extract_metadata", "FieldInfo._find_field_info_arg"], "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 FieldInfo(_repr.Representation):\n\n @classmethod\n def _extract_metadata(cls, annotation: type[Any] | None) -> tuple[type[Any] | None, list[Any]]:\n \"\"\"\n Try to extract metadata/constraints from an annotation if it's using `Annotated`.\n\n Returns a tuple of `(annotation_type, annotation_metadata)`.\n \"\"\"\n if annotation is not None:\n if _typing_extra.is_annotated(annotation):\n first_arg, *extra_args = typing_extensions.get_args(annotation)\n if cls._find_field_info_arg(extra_args):\n raise TypeError('Field may not be used twice on the same field')\n return first_arg, list(extra_args)\n\n return annotation, []\n\n @staticmethod\n def _find_field_info_arg(args: Any) -> FieldInfo | None:\n \"\"\"\n Find an instance of `FieldInfo` if it's in args, expected to be called with all but the first argument of\n `Annotated`.\n \"\"\"\n return next((a for a in args if isinstance(a, FieldInfo)), 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_pydantic__pydantic/pydantic/fields.py_FieldInfo._collect_metadata_FieldInfo._collect_metadata.return.metadata": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._collect_metadata_FieldInfo._collect_metadata.return.metadata", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 221, "end_line": 244, "span_ids": ["FieldInfo._collect_metadata"], "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 FieldInfo(_repr.Representation):\n\n @classmethod\n def _collect_metadata(cls, kwargs: dict[str, Any]) -> list[Any]:\n \"\"\"\n Collect annotations from kwargs, the return type is actually `annotated_types.BaseMetadata | PydanticMetadata`\n but it gets combined with `list[Any]` from `Annotated[T, ...]`, hence types.\n \"\"\"\n\n metadata: list[Any] = []\n general_metadata = {}\n for key, value in list(kwargs.items()):\n try:\n marker = cls.metadata_lookup[key]\n except KeyError:\n continue\n\n del kwargs[key]\n if value is not None:\n if marker is None:\n general_metadata[key] = value\n else:\n metadata.append(marker(value))\n if general_metadata:\n metadata.append(_fields.PydanticGeneralMetadata(**general_metadata))\n return metadata", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.get_default_FieldInfo.rebuild_annotation.if_not_self_metadata_.else_.return.typing_extensions__Annota": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.get_default_FieldInfo.rebuild_annotation.if_not_self_metadata_.else_.return.typing_extensions__Annota", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 269, "span_ids": ["FieldInfo.get_default", "FieldInfo.is_required", "FieldInfo.rebuild_annotation"], "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 FieldInfo(_repr.Representation):\n\n def get_default(self, *, call_default_factory: bool = False) -> Any:\n \"\"\"\n We expose an option for whether to call the default_factory (if present), as calling it may\n result in side effects that we want to avoid. However, there are times when it really should\n be called (namely, when instantiating a model via `model_construct`).\n \"\"\"\n if self.default_factory is None:\n return _utils.smart_deepcopy(self.default)\n elif call_default_factory:\n return self.default_factory()\n else:\n return None\n\n def is_required(self) -> bool:\n return self.default is Undefined and self.default_factory is None\n\n def rebuild_annotation(self) -> Any:\n \"\"\"\n Rebuild the original annotation for use in signatures.\n \"\"\"\n if not self.metadata:\n return self.annotation\n else:\n return typing_extensions._AnnotatedAlias(self.annotation, self.metadata)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.__repr_args___FieldInfo.__repr_args__.for_s_in_self___slots___.if_s_default_factory_.else_.if_value_is_not_None_and_.yield_s_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.__repr_args___FieldInfo.__repr_args__.for_s_in_self___slots___.if_s_default_factory_.else_.if_value_is_not_None_and_.yield_s_value", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 287, "span_ids": ["FieldInfo.__repr_args__"], "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 FieldInfo(_repr.Representation):\n\n def __repr_args__(self) -> ReprArgs:\n yield 'annotation', _repr.PlainRepr(_repr.display_as_type(self.annotation))\n yield 'required', self.is_required()\n\n for s in self.__slots__:\n if s == 'annotation':\n continue\n elif s == 'metadata' and not self.metadata:\n continue\n elif s == 'repr' and self.repr is True:\n continue\n if s == 'default_factory' and self.default_factory is not None:\n yield 'default_factory', _repr.PlainRepr(_repr.display_as_type(self.default_factory))\n else:\n value = getattr(self, s)\n if value is not None and value is not Undefined:\n yield s, 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_pydantic__pydantic/pydantic/fields.py_Field_Field._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field_Field._", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 374, "span_ids": ["Field"], "tokens": 1217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def Field(\n default: Any = Undefined,\n *,\n default_factory: typing.Callable[[], Any] | None = None,\n alias: str = None,\n # TODO:\n # Alternative 1: we could drop alias_priority and tell people to manually override aliases in child classes\n # Alternative 2: we could add a new argument `override_with_alias_generator=True` equivalent to `alias_priority=1`\n alias_priority: int = None,\n title: str = None,\n description: str = None,\n examples: list[Any] = None,\n exclude: typing.AbstractSet[int | str] | typing.Mapping[int | str, Any] | Any = None,\n include: typing.AbstractSet[int | str] | typing.Mapping[int | str, Any] | Any = None,\n gt: float = None,\n ge: float = None,\n lt: float = None,\n le: float = None,\n multiple_of: float = None,\n allow_inf_nan: bool = None,\n max_digits: int = None,\n decimal_places: int = None,\n min_items: int = None,\n max_items: int = None,\n min_length: int = None,\n max_length: int = None,\n frozen: bool = None,\n pattern: str = None,\n discriminator: str = None,\n repr: bool = True,\n strict: bool | None = None,\n json_schema_extra: dict[str, Any] | None = None,\n validate_default: bool | None = None,\n) -> Any:\n \"\"\"\n Used to provide extra information about a field, either for the model schema or complex validation. Some arguments\n apply only to number fields (``int``, ``float``, ``Decimal``) and some apply only to ``str``.\n\n :param default: since this is replacing the field's default, its first argument is used\n to set the default, use ellipsis (``...``) to indicate the field is required\n :param default_factory: callable that will be called when a default value is needed for this field\n If both `default` and `default_factory` are set, an error is raised.\n :param alias: the public name of the field\n :param title: can be any string, used in the schema\n :param description: can be any string, used in the schema\n :param examples: can be any list of json-encodable data, used in the schema\n :param exclude: exclude this field while dumping.\n Takes same values as the ``include`` and ``exclude`` arguments on the ``.dict`` method.\n :param include: include this field while dumping.\n Takes same values as the ``include`` and ``exclude`` arguments on the ``.dict`` method.\n :param gt: only applies to numbers, requires the field to be \"greater than\". The schema\n will have an ``exclusiveMinimum`` validation keyword\n :param ge: only applies to numbers, requires the field to be \"greater than or equal to\". The\n schema will have a ``minimum`` validation keyword\n :param lt: only applies to numbers, requires the field to be \"less than\". The schema\n will have an ``exclusiveMaximum`` validation keyword\n :param le: only applies to numbers, requires the field to be \"less than or equal to\". The\n schema will have a ``maximum`` validation keyword\n :param multiple_of: only applies to numbers, requires the field to be \"a multiple of\". The\n schema will have a ``multipleOf`` validation keyword\n :param allow_inf_nan: only applies to numbers, allows the field to be NaN or infinity (+inf or -inf),\n which is a valid Python float. Default True, set to False for compatibility with JSON.\n :param max_digits: only applies to Decimals, requires the field to have a maximum number\n of digits within the decimal. It does not include a zero before the decimal point or trailing decimal zeroes.\n :param decimal_places: only applies to Decimals, requires the field to have at most a number of decimal places\n allowed. It does not include trailing decimal zeroes.\n :param min_items: only applies to lists, requires the field to have a minimum number of\n elements. The schema will have a ``minItems`` validation keyword\n :param max_items: only applies to lists, requires the field to have a maximum number of\n elements. The schema will have a ``maxItems`` validation keyword\n :param min_length: only applies to strings, requires the field to have a minimum length. The\n schema will have a ``minLength`` validation keyword\n :param max_length: only applies to strings, requires the field to have a maximum length. The\n schema will have a ``maxLength`` validation keyword\n :param frozen: a boolean which defaults to True. When False, the field raises a TypeError if the field is\n assigned on an instance. The BaseModel Config must set validate_assignment to True\n :param pattern: only applies to strings, requires the field match against a regular expression\n pattern string. The schema will have a ``pattern`` validation keyword\n :param discriminator: only useful with a (discriminated a.k.a. tagged) `Union` of sub models with a common field.\n The `discriminator` is the name of this common field to shorten validation and improve generated schema\n :param repr: show this field in the representation\n :param json_schema_extra: extra dict to be merged with the JSON Schema for this field\n :param strict: enable or disable strict parsing mode\n :param validate_default: whether the default value should be validated for this field\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_pydantic__pydantic/pydantic/fields.py_Field.return_Field.return.FieldInfo_from_field_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field.return_Field.return.FieldInfo_from_field_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 375, "end_line": 404, "span_ids": ["Field"], "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": "def Field(\n default: Any = Undefined,\n *,\n default_factory: typing.Callable[[], Any] | None = None,\n alias: str = None,\n # TODO:\n # Alternative 1: we could drop alias_priority and tell people to manually override aliases in child classes\n # Alternative 2: we could add a new argument `override_with_alias_generator=True` equivalent to `alias_priority=1`\n alias_priority: int = None,\n title: str = None,\n description: str = None,\n examples: list[Any] = None,\n exclude: typing.AbstractSet[int | str] | typing.Mapping[int | str, Any] | Any = None,\n include: typing.AbstractSet[int | str] | typing.Mapping[int | str, Any] | Any = None,\n gt: float = None,\n ge: float = None,\n lt: float = None,\n le: float = None,\n multiple_of: float = None,\n allow_inf_nan: bool = None,\n max_digits: int = None,\n decimal_places: int = None,\n min_items: int = None,\n max_items: int = None,\n min_length: int = None,\n max_length: int = None,\n frozen: bool = None,\n pattern: str = None,\n discriminator: str = None,\n repr: bool = True,\n strict: bool | None = None,\n json_schema_extra: dict[str, Any] | None = None,\n validate_default: bool | None = None,\n) -> Any:\n return FieldInfo.from_field(\n default,\n default_factory=default_factory,\n alias=alias,\n alias_priority=alias_priority,\n title=title,\n description=description,\n examples=examples,\n exclude=exclude,\n include=include,\n gt=gt,\n ge=ge,\n lt=lt,\n le=le,\n multiple_of=multiple_of,\n allow_inf_nan=allow_inf_nan,\n max_digits=max_digits,\n decimal_places=decimal_places,\n min_items=min_items,\n max_items=max_items,\n min_length=min_length,\n max_length=max_length,\n frozen=frozen,\n pattern=pattern,\n discriminator=discriminator,\n repr=repr,\n json_schema_extra=json_schema_extra,\n strict=strict,\n validate_default=validate_default,\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_pydantic__pydantic/pydantic/fields.py_ModelPrivateAttr_ModelPrivateAttr.__eq__.return.isinstance_other_self___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_ModelPrivateAttr_ModelPrivateAttr.__eq__.return.isinstance_other_self___", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 407, "end_line": 434, "span_ids": ["ModelPrivateAttr.__init__", "ModelPrivateAttr.__set_name__", "ModelPrivateAttr.get_default", "ModelPrivateAttr", "ModelPrivateAttr.__eq__"], "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 ModelPrivateAttr(_repr.Representation):\n __slots__ = 'default', 'default_factory'\n\n def __init__(self, default: Any = Undefined, *, default_factory: typing.Callable[[], Any] | None = None) -> None:\n self.default = default\n self.default_factory = default_factory\n\n def __set_name__(self, cls: type[Any], name: str) -> None:\n \"\"\"\n preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487\n \"\"\"\n if self.default is not Undefined:\n try:\n set_name = getattr(self.default, '__set_name__')\n except AttributeError:\n pass\n else:\n if callable(set_name):\n set_name(cls, name)\n\n def get_default(self) -> Any:\n return _utils.smart_deepcopy(self.default) if self.default_factory is None else self.default_factory()\n\n def __eq__(self, other: Any) -> bool:\n return isinstance(other, self.__class__) and (self.default, self.default_factory) == (\n other.default,\n other.default_factory,\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_pydantic__pydantic/pydantic/fields.py_PrivateAttr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_PrivateAttr_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 437, "end_line": 460, "span_ids": ["PrivateAttr"], "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 PrivateAttr(\n default: Any = Undefined,\n *,\n default_factory: typing.Callable[[], Any] | None = None,\n) -> Any:\n \"\"\"\n Indicates that attribute is only used internally and never mixed with regular fields.\n\n Types or values of private attrs are not checked by pydantic, it's up to you to keep them relevant.\n\n Private attrs are stored in model __slots__.\n\n :param default: the attribute's default value\n :param default_factory: callable that will be called when a default value is needed for this attribute\n If both `default` and `default_factory` are set, an error is raised.\n \"\"\"\n if default is not Undefined and default_factory is not None:\n raise ValueError('cannot specify both default and default_factory')\n\n return ModelPrivateAttr(\n default,\n default_factory=default_factory,\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_pydantic__pydantic/pydantic/json_schema.py_from___future___import_an_JsonRef.NewType_JsonRef_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_from___future___import_an_JsonRef.NewType_JsonRef_str_", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 79, "span_ids": ["update_json_schema", "impl:4", "PydanticJsonSchemaWarning", "imports", "impl:6"], "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": "from __future__ import annotations as _annotations\n\nimport inspect\nimport math\nimport re\nimport sys\nimport warnings\nfrom dataclasses import is_dataclass\nfrom enum import Enum\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Counter,\n Dict,\n Iterable,\n List,\n NewType,\n Sequence,\n Tuple,\n Type,\n Union,\n cast,\n)\nfrom weakref import WeakKeyDictionary\n\nimport pydantic_core\nfrom typing_extensions import Literal\n\nfrom ._internal import _core_metadata, _core_utils, _typing_extra\nfrom .errors import PydanticInvalidForJsonSchema, PydanticUserError\n\nif TYPE_CHECKING:\n from pydantic_core import CoreSchema, CoreSchemaType, core_schema\n\n from . import ConfigDict\n from ._internal._dataclasses import PydanticDataclass\n from .main import BaseModel\n\nJsonSchemaValue = Dict[str, Any]\n\n\ndef update_json_schema(schema: JsonSchemaValue, updates: dict[str, Any]) -> JsonSchemaValue:\n \"\"\"\n A convenience function useful for creating `js_modify_function` functions that just set values for some keys.\n\n TODO: This is basically just a wrapper for dict.update that returns the dict.\n Would it be better to just make this a less-\"domain-specific\" utility function?\n \"\"\"\n schema.update(updates)\n return schema\n\n\n# These are \"kind\" labels that can be used to control warnings. See `GenerateJsonSchema.render_warning_message`\nJsonSchemaWarningKind = Literal['skipped-choice', 'non-serializable-default']\n\n\nclass PydanticJsonSchemaWarning(UserWarning):\n \"\"\"\n This class is used to emit warnings produced during JSON schema generation.\n See the `GenerateJsonSchema.emit_warning` and `GenerateJsonSchema.render_warning_message`\n methods for more details; these can be overridden to control warning behavior\n \"\"\"\n\n\n# ##### JSON Schema Generation #####\nDEFAULT_REF_TEMPLATE = '#/$defs/{model}'\n\n# There are three types of references relevant to building JSON schemas:\n# 1. core_schema \"ref\" values; these are not exposed as part of the JSON schema\n# * these might look like the fully qualified path of a model, its id, or something similar\nCoreRef = NewType('CoreRef', str)\n# 2. keys of the \"definitions\" object that will eventually go into the JSON schema\n# * by default, these look like \"MyModel\", though may change in the presence of collisions\n# * eventually, we may want to make it easier to modify the way these names are generated\nDefsRef = NewType('DefsRef', str)\n# 3. the values corresponding to the \"$ref\" key in the schema\n# * By default, these look like \"#/$defs/MyModel\", as in {\"$ref\": \"#/$defs/MyModel\"}\nJsonRef = NewType('JsonRef', 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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema_GenerateJsonSchema.__init__.self._used.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema_GenerateJsonSchema.__init__.self._used.False", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 111, "span_ids": ["GenerateJsonSchema.__init__", "GenerateJsonSchema"], "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 GenerateJsonSchema:\n # See https://json-schema.org/understanding-json-schema/reference/schema.html#id4 for more info about dialects\n schema_dialect = 'https://json-schema.org/draft/2020-12/schema'\n\n # `self.render_warning_message` will do nothing if its argument `kind` is in `ignored_warning_kinds`;\n # this value can be modified on subclasses to easily control which warnings are emitted\n ignored_warning_kinds: set[JsonSchemaWarningKind] = {'skipped-choice'}\n\n def __init__(self, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE):\n self.by_alias = by_alias\n self.ref_template = ref_template\n\n self.core_to_json_refs: dict[CoreRef, JsonRef] = {}\n self.core_to_defs_refs: dict[CoreRef, DefsRef] = {}\n self.defs_to_core_refs: dict[DefsRef, CoreRef] = {}\n self.json_to_defs_refs: dict[JsonRef, DefsRef] = {}\n\n self.definitions: dict[DefsRef, JsonSchemaValue] = {}\n\n # When collisions are detected, we choose a non-colliding name\n # during generation, but we also track the colliding tag so that it\n # can be remapped for the first occurrence at the end of the process\n self.collisions: set[DefsRef] = set()\n self.defs_ref_fallbacks: dict[CoreRef, list[DefsRef]] = {}\n\n self._schema_type_to_method = self.build_schema_type_to_method()\n\n # This changes to True after generating a schema, to prevent issues caused by accidental re-use\n # of a single instance of a schema generator\n self._used = 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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.build_schema_type_to_method_GenerateJsonSchema.build_schema_type_to_method.return.mapping": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.build_schema_type_to_method_GenerateJsonSchema.build_schema_type_to_method.return.mapping", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 124, "span_ids": ["GenerateJsonSchema.build_schema_type_to_method"], "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 GenerateJsonSchema:\n\n def build_schema_type_to_method(self) -> dict[CoreSchemaType, Callable[[CoreSchema], JsonSchemaValue]]:\n mapping: dict[CoreSchemaType, Callable[[CoreSchema], JsonSchemaValue]] = {}\n for key in _typing_extra.all_literal_values(pydantic_core.CoreSchemaType): # type: ignore[arg-type]\n method_name = f\"{key.replace('-', '_')}_schema\"\n try:\n mapping[key] = getattr(self, method_name)\n except AttributeError as e:\n raise TypeError(\n f'No method for generating JsonSchema for core_schema.type={key!r} '\n f'(expected: {type(self).__name__}.{method_name})'\n ) from e\n return 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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_definitions_GenerateJsonSchema.generate_definitions.return.self_definitions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_definitions_GenerateJsonSchema.generate_definitions.return.self_definitions", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 141, "span_ids": ["GenerateJsonSchema.generate_definitions"], "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 GenerateJsonSchema:\n\n def generate_definitions(self, schemas: list[CoreSchema]) -> dict[DefsRef, JsonSchemaValue]:\n \"\"\"\n Given a list of core_schema, generate all JSON schema definitions, and return the generated definitions.\n \"\"\"\n if self._used:\n raise PydanticUserError(\n 'This JSON schema generator has already been used to generate a JSON schema. '\n f'You must create a new instance of {type(self).__name__} to generate a new JSON schema.'\n )\n for schema in schemas:\n self.generate_inner(schema)\n\n self.resolve_collisions({})\n\n self._used = True\n return self.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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_GenerateJsonSchema.generate.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_GenerateJsonSchema.generate.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 183, "span_ids": ["GenerateJsonSchema.generate"], "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": "class GenerateJsonSchema:\n\n def generate(self, schema: CoreSchema) -> JsonSchemaValue:\n if self._used:\n raise PydanticUserError(\n 'This JSON schema generator has already been used to generate a JSON schema. '\n f'You must create a new instance of {type(self).__name__} to generate a new JSON schema.'\n )\n\n json_schema = self.generate_inner(schema)\n json_ref_counts = self.get_json_ref_counts(json_schema)\n\n # Remove the top-level $ref if present; note that the _generate method already ensures there are no sibling keys\n ref = json_schema.get('$ref')\n while ref is not None: # may need to unpack multiple levels\n ref_json_schema = self.get_schema_from_definitions(JsonRef(ref))\n if json_ref_counts[ref] > 1 or ref_json_schema is None:\n # Keep the ref, but use an allOf to remove the top level $ref\n json_schema = {'allOf': [{'$ref': ref}]}\n else:\n # \"Unpack\" the ref since this is the only reference\n json_schema = ref_json_schema.copy() # copy to prevent recursive dict reference\n json_ref_counts[ref] -= 1\n ref = json_schema.get('$ref')\n\n # Remove any definitions that, thanks to $ref-substitution, are no longer present.\n # I think this should only _possibly_ apply to the root model, though I'm not 100% sure.\n # It might be safe to remove this logic, but I'm keeping it for now\n all_json_refs = list(self.json_to_defs_refs.keys())\n for k in all_json_refs:\n if json_ref_counts[k] < 1:\n del self.definitions[self.json_to_defs_refs[k]]\n\n json_schema = self.resolve_collisions(json_schema)\n if self.definitions:\n json_schema['$defs'] = self.definitions\n\n # For now, we will not set the $schema key. However, if desired, this can be easily added by overriding\n # this method and adding the following line after a call to super().generate(schema):\n # json_schema['$schema'] = self.schema_dialect\n\n self._used = True\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_inner_GenerateJsonSchema.generate_inner.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.generate_inner_GenerateJsonSchema.generate_inner.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 242, "span_ids": ["GenerateJsonSchema.generate_inner"], "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": "class GenerateJsonSchema:\n\n def generate_inner(\n self, schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField\n ) -> JsonSchemaValue:\n # If a schema with the same CoreRef has been handled, just return a reference to it\n # Note that this assumes that it will _never_ be the case that the same CoreRef is used\n # on types that should have different JSON schemas\n if 'ref' in schema:\n core_ref = CoreRef(schema['ref']) # type: ignore[typeddict-item]\n if core_ref in self.core_to_json_refs:\n return {'$ref': self.core_to_json_refs[core_ref]}\n\n # Generate the JSON schema, accounting for the json_schema_override and core_schema_override\n metadata_handler = _core_metadata.CoreMetadataHandler(schema)\n js_override = metadata_handler.get_js_override()\n js_cs_override = metadata_handler.get_js_cs_override()\n\n if js_override is not None:\n json_schema = js_override\n elif js_cs_override is not None:\n # If there is a core schema override, use it to generate the JSON schema\n json_schema = self.generate_inner(js_cs_override)\n else:\n # Generate the core-schema-type-specific bits of the schema generation:\n if _core_utils.is_typed_dict_field(schema):\n json_schema = self.typed_dict_field_schema(schema)\n elif _core_utils.is_dataclass_field(schema):\n json_schema = self.dataclass_field_schema(schema)\n elif _core_utils.is_core_schema(schema): # Ideally we wouldn't need this redundant typeguard..\n generate_for_schema_type = self._schema_type_to_method[schema['type']]\n json_schema = generate_for_schema_type(schema)\n else:\n raise TypeError(f'Unexpected schema type: schema={schema}')\n\n # Apply the modify_js function, if present\n schema_to_update: JsonSchemaValue | None = None\n if '$ref' in json_schema and schema.get('type') == 'model':\n # If we have a schema with a $ref, we actually need to update the _referenced_ schema\n schema_to_update = self.get_schema_from_definitions(JsonRef(json_schema['$ref']))\n if schema_to_update is not None:\n # Do an in-place update to schema_to_update, regardless of whether the js_modify_function\n # returns a new dict or modifies the old one\n updated = metadata_handler.apply_js_modify_function(schema_to_update).copy()\n schema_to_update.clear()\n schema_to_update.update(updated)\n else:\n json_schema = metadata_handler.apply_js_modify_function(json_schema)\n\n # Resolve issues caused by sibling keys next to a top-level $ref (see `handle_ref_overrides` for details)\n json_schema = self.handle_ref_overrides(json_schema)\n\n # Populate the definitions\n if 'ref' in schema:\n core_ref = CoreRef(schema['ref']) # type: ignore[typeddict-item]\n defs_ref, ref_json_schema = self.get_cache_defs_ref_schema(core_ref)\n self.definitions[defs_ref] = json_schema\n json_schema = ref_json_schema\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._Schema_generation_m_GenerateJsonSchema.callable_schema.return.self_handle_invalid_for_j": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._Schema_generation_m_GenerateJsonSchema.callable_schema.return.self_handle_invalid_for_j", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 308, "span_ids": ["GenerateJsonSchema.is_subclass_schema", "GenerateJsonSchema.str_schema", "GenerateJsonSchema.callable_schema", "GenerateJsonSchema.int_schema", "GenerateJsonSchema.bytes_schema", "GenerateJsonSchema.is_instance_schema", "GenerateJsonSchema.any_schema", "GenerateJsonSchema.bool_schema", "GenerateJsonSchema.datetime_schema", "GenerateJsonSchema.timedelta_schema", "GenerateJsonSchema.literal_schema", "GenerateJsonSchema.time_schema", "GenerateJsonSchema.generate_inner", "GenerateJsonSchema.date_schema", "GenerateJsonSchema.none_schema", "GenerateJsonSchema.float_schema"], "tokens": 765}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateJsonSchema:\n\n # ### Schema generation methods\n def any_schema(self, schema: core_schema.AnySchema) -> JsonSchemaValue:\n return {}\n\n def none_schema(self, schema: core_schema.NoneSchema) -> JsonSchemaValue:\n return {'type': 'null'}\n\n def bool_schema(self, schema: core_schema.BoolSchema) -> JsonSchemaValue:\n return {'type': 'boolean'}\n\n def int_schema(self, schema: core_schema.IntSchema) -> JsonSchemaValue:\n json_schema = {'type': 'integer'}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.numeric)\n json_schema = {k: v for k, v in json_schema.items() if v not in {math.inf, -math.inf}}\n return json_schema\n\n def float_schema(self, schema: core_schema.FloatSchema) -> JsonSchemaValue:\n json_schema = {'type': 'number'}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.numeric)\n json_schema = {k: v for k, v in json_schema.items() if v not in {math.inf, -math.inf}}\n return json_schema\n\n def str_schema(self, schema: core_schema.StringSchema) -> JsonSchemaValue:\n json_schema = {'type': 'string'}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.string)\n return json_schema\n\n def bytes_schema(self, schema: core_schema.BytesSchema) -> JsonSchemaValue:\n json_schema = {'type': 'string', 'format': 'binary'}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.bytes)\n return json_schema\n\n def date_schema(self, schema: core_schema.DateSchema) -> JsonSchemaValue:\n json_schema = {'type': 'string', 'format': 'date'}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.date)\n return json_schema\n\n def time_schema(self, schema: core_schema.TimeSchema) -> JsonSchemaValue:\n return {'type': 'string', 'format': 'time'}\n\n def datetime_schema(self, schema: core_schema.DatetimeSchema) -> JsonSchemaValue:\n return {'type': 'string', 'format': 'date-time'}\n\n def timedelta_schema(self, schema: core_schema.TimedeltaSchema) -> JsonSchemaValue:\n # It's weird that this schema has 'type': 'number' but also specifies a 'format'.\n # Relevant issue: https://github.com/pydantic/pydantic/issues/5034\n # TODO: Probably should just change this to str (look at readme intro for speeddate)\n return {'type': 'number', 'format': 'time-delta'}\n\n def literal_schema(self, schema: core_schema.LiteralSchema) -> JsonSchemaValue:\n expected = [v.value if isinstance(v, Enum) else v for v in schema['expected']]\n\n if len(expected) == 1:\n return {'const': expected[0]}\n else:\n return {'enum': expected}\n\n def is_instance_schema(self, schema: core_schema.IsInstanceSchema) -> JsonSchemaValue:\n return self.handle_invalid_for_json_schema(schema, f'core_schema.IsInstanceSchema ({schema[\"cls\"]})')\n\n def is_subclass_schema(self, schema: core_schema.IsSubclassSchema) -> JsonSchemaValue:\n return {} # TODO: This was for compatibility with V1 -- is this the right thing to do?\n\n def callable_schema(self, schema: core_schema.CallableSchema) -> JsonSchemaValue:\n return self.handle_invalid_for_json_schema(schema, 'core_schema.CallableSchema')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.list_schema_GenerateJsonSchema.tuple_positional_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.list_schema_GenerateJsonSchema.tuple_positional_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 327, "span_ids": ["GenerateJsonSchema.tuple_positional_schema", "GenerateJsonSchema.list_schema"], "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 GenerateJsonSchema:\n\n def list_schema(self, schema: core_schema.ListSchema) -> JsonSchemaValue:\n items_schema = {} if 'items_schema' not in schema else self.generate_inner(schema['items_schema'])\n json_schema = {'type': 'array', 'items': items_schema}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.array)\n return json_schema\n\n def tuple_positional_schema(self, schema: core_schema.TuplePositionalSchema) -> JsonSchemaValue:\n json_schema: JsonSchemaValue = {'type': 'array'}\n json_schema['minItems'] = len(schema['items_schema'])\n prefixItems = [self.generate_inner(item) for item in schema['items_schema']]\n if prefixItems:\n json_schema['prefixItems'] = prefixItems\n if 'extra_schema' in schema:\n json_schema['items'] = self.generate_inner(schema['extra_schema'])\n else:\n json_schema['maxItems'] = len(schema['items_schema'])\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.array)\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.tuple_variable_schema_GenerateJsonSchema.generator_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.tuple_variable_schema_GenerateJsonSchema.generator_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 329, "end_line": 352, "span_ids": ["GenerateJsonSchema.set_schema", "GenerateJsonSchema.generator_schema", "GenerateJsonSchema.frozenset_schema", "GenerateJsonSchema._common_set_schema", "GenerateJsonSchema.tuple_variable_schema"], "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 GenerateJsonSchema:\n\n def tuple_variable_schema(self, schema: core_schema.TupleVariableSchema) -> JsonSchemaValue:\n json_schema: JsonSchemaValue = {'type': 'array', 'items': {}}\n if 'items_schema' in schema:\n json_schema['items'] = self.generate_inner(schema['items_schema'])\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.array)\n return json_schema\n\n def set_schema(self, schema: core_schema.SetSchema) -> JsonSchemaValue:\n return self._common_set_schema(schema)\n\n def frozenset_schema(self, schema: core_schema.FrozenSetSchema) -> JsonSchemaValue:\n return self._common_set_schema(schema)\n\n def _common_set_schema(self, schema: core_schema.SetSchema | core_schema.FrozenSetSchema) -> JsonSchemaValue:\n items_schema = {} if 'items_schema' not in schema else self.generate_inner(schema['items_schema'])\n json_schema = {'type': 'array', 'uniqueItems': True, 'items': items_schema}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.array)\n return json_schema\n\n def generator_schema(self, schema: core_schema.GeneratorSchema) -> JsonSchemaValue:\n items_schema = {} if 'items_schema' not in schema else self.generate_inner(schema['items_schema'])\n json_schema = {'type': 'array', 'items': items_schema}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.array)\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.dict_schema_GenerateJsonSchema.dict_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.dict_schema_GenerateJsonSchema.dict_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 369, "span_ids": ["GenerateJsonSchema.dict_schema"], "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 GenerateJsonSchema:\n\n def dict_schema(self, schema: core_schema.DictSchema) -> JsonSchemaValue:\n json_schema: JsonSchemaValue = {'type': 'object'}\n\n keys_schema = self.generate_inner(schema['keys_schema']).copy() if 'keys_schema' in schema else {}\n keys_pattern = keys_schema.pop('pattern', None)\n\n values_schema = self.generate_inner(schema['values_schema']).copy() if 'values_schema' in schema else {}\n values_schema.pop('title', None) # don't give a title to the additionalProperties\n if values_schema or keys_pattern is not None: # don't add additionalProperties if it's empty\n if keys_pattern is None:\n json_schema['additionalProperties'] = values_schema\n else:\n json_schema['patternProperties'] = {keys_pattern: values_schema}\n\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.object)\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._function_schema_GenerateJsonSchema.function_wrap_schema.return.self__function_schema_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._function_schema_GenerateJsonSchema.function_wrap_schema.return.self__function_schema_sch", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 371, "end_line": 393, "span_ids": ["GenerateJsonSchema._function_schema", "GenerateJsonSchema.function_wrap_schema", "GenerateJsonSchema.function_after_schema", "GenerateJsonSchema.function_plain_schema", "GenerateJsonSchema.function_before_schema"], "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 GenerateJsonSchema:\n\n def _function_schema(\n self,\n schema: _core_utils.AnyFunctionSchema,\n ) -> JsonSchemaValue:\n if _core_utils.is_function_with_inner_schema(schema):\n # I'm not sure if this might need to be different if the function's mode is 'before'\n return self.generate_inner(schema['schema'])\n # function-plain\n return self.handle_invalid_for_json_schema(\n schema, f'core_schema.PlainValidatorFunctionSchema ({schema[\"function\"]})'\n )\n\n def function_before_schema(self, schema: core_schema.BeforeValidatorFunctionSchema) -> JsonSchemaValue:\n return self._function_schema(schema)\n\n def function_after_schema(self, schema: core_schema.AfterValidatorFunctionSchema) -> JsonSchemaValue:\n return self._function_schema(schema)\n\n def function_plain_schema(self, schema: core_schema.PlainValidatorFunctionSchema) -> JsonSchemaValue:\n return self._function_schema(schema)\n\n def function_wrap_schema(self, schema: core_schema.WrapValidatorFunctionSchema) -> JsonSchemaValue:\n return self._function_schema(schema)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.default_schema_GenerateJsonSchema.default_schema.if_ref_in_json_schema_.else_.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.default_schema_GenerateJsonSchema.default_schema.if_ref_in_json_schema_.else_.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 395, "end_line": 420, "span_ids": ["GenerateJsonSchema.default_schema"], "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 GenerateJsonSchema:\n\n def default_schema(self, schema: core_schema.WithDefaultSchema) -> JsonSchemaValue:\n json_schema = self.generate_inner(schema['schema'])\n\n if 'default' in schema:\n default = schema['default']\n elif 'default_factory' in schema:\n default = schema['default_factory']()\n else:\n raise ValueError('`schema` has neither default nor default_factory')\n\n try:\n encoded_default = self.encode_default(default)\n except pydantic_core.PydanticSerializationError:\n self.emit_warning(\n 'non-serializable-default',\n f'Default value {default} is not JSON serializable; excluding default from JSON schema',\n )\n # Return the inner schema, as though there was no default\n return json_schema\n\n if '$ref' in json_schema:\n # Since reference schemas do not support child keys, we wrap the reference schema in a single-case allOf:\n return {'allOf': [json_schema], 'default': encoded_default}\n else:\n json_schema['default'] = encoded_default\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.nullable_schema_GenerateJsonSchema.union_schema.return.self_get_flattened_anyof_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.nullable_schema_GenerateJsonSchema.union_schema.return.self_get_flattened_anyof_", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 422, "end_line": 444, "span_ids": ["GenerateJsonSchema.union_schema", "GenerateJsonSchema.nullable_schema"], "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 GenerateJsonSchema:\n\n def nullable_schema(self, schema: core_schema.NullableSchema) -> JsonSchemaValue:\n null_schema = {'type': 'null'}\n inner_json_schema = self.generate_inner(schema['schema'])\n\n if inner_json_schema == null_schema:\n return null_schema\n else:\n # Thanks to the equality check against `null_schema` above, I think 'oneOf' would also be valid here;\n # I'll use 'anyOf' for now, but it could be changed it if it would work better with some external tooling\n return self.get_flattened_anyof([inner_json_schema, null_schema])\n\n def union_schema(self, schema: core_schema.UnionSchema) -> JsonSchemaValue:\n generated: list[JsonSchemaValue] = []\n\n choices = schema['choices']\n for s in choices:\n try:\n generated.append(self.generate_inner(s))\n except PydanticInvalidForJsonSchema as exc:\n self.emit_warning('skipped-choice', str(exc))\n if len(generated) == 1:\n return generated[0]\n return self.get_flattened_anyof(generated)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.tagged_union_schema_GenerateJsonSchema.tagged_union_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.tagged_union_schema_GenerateJsonSchema.tagged_union_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 478, "span_ids": ["GenerateJsonSchema.tagged_union_schema"], "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 GenerateJsonSchema:\n\n def tagged_union_schema(self, schema: core_schema.TaggedUnionSchema) -> JsonSchemaValue:\n generated: dict[str, JsonSchemaValue] = {}\n for k, v in schema['choices'].items():\n if not isinstance(v, (str, int)):\n try:\n # Use str(k) since keys must be strings for json; while not technically correct,\n # it's the closest that can be represented in valid JSON\n generated[str(k)] = self.generate_inner(v).copy()\n except PydanticInvalidForJsonSchema as exc:\n self.emit_warning('skipped-choice', str(exc))\n\n # Populate the schema with any \"indirect\" references\n for k, v in schema['choices'].items():\n if isinstance(v, (str, int)):\n while isinstance(schema['choices'][v], (str, int)):\n v = schema['choices'][v]\n if str(v) in generated:\n # while it might seem unnecessary to check `if str(v) in generated`, a PydanticInvalidForJsonSchema\n # may have been raised above, which would mean that the schema we want to reference won't be present\n generated[str(k)] = generated[str(v)]\n\n one_of_choices = _deduplicate_schemas(generated.values())\n json_schema: JsonSchemaValue = {'oneOf': one_of_choices}\n\n # This reflects the v1 behavior; TODO: we should make it possible to exclude OpenAPI stuff from the JSON schema\n openapi_discriminator = self._extract_discriminator(schema, one_of_choices)\n if openapi_discriminator is not None:\n json_schema['discriminator'] = {\n 'propertyName': openapi_discriminator,\n 'mapping': {k: v.get('$ref', v) for k, v in generated.items()},\n }\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._extract_discriminator_GenerateJsonSchema._extract_discriminator.return.openapi_discriminator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._extract_discriminator_GenerateJsonSchema._extract_discriminator.return.openapi_discriminator", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 521, "span_ids": ["GenerateJsonSchema._extract_discriminator"], "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": "class GenerateJsonSchema:\n\n def _extract_discriminator(\n self, schema: core_schema.TaggedUnionSchema, one_of_choices: list[_JsonDict]\n ) -> str | None:\n \"\"\"\n Extract a compatible OpenAPI discriminator from the schema and one_of choices that end up in the final schema.\n \"\"\"\n openapi_discriminator: str | None = None\n if 'discriminator' not in schema:\n return None\n\n if isinstance(schema['discriminator'], str):\n return schema['discriminator']\n\n if isinstance(schema['discriminator'], list):\n # If the discriminator is a single item list containing a string, that is equivalent to the string case\n if len(schema['discriminator']) == 1 and isinstance(schema['discriminator'][0], str):\n return schema['discriminator'][0]\n # When an alias is used that is different from the field name, the discriminator will be a list of single\n # str lists, one for the attribute and one for the actual alias. The logic here will work even if there is\n # more than one possible attribute, and looks for whether a single alias choice is present as a documented\n # property on all choices. If so, that property will be used as the OpenAPI discriminator.\n for alias_path in schema['discriminator']:\n if not isinstance(alias_path, list):\n break # this means that the discriminator is not a list of alias paths\n if len(alias_path) != 1:\n continue # this means that the \"alias\" does not represent a single field\n alias = alias_path[0]\n if not isinstance(alias, str):\n continue # this means that the \"alias\" does not represent a field\n alias_is_present_on_all_choices = True\n for choice in one_of_choices:\n while '$ref' in choice:\n assert isinstance(choice['$ref'], str)\n choice = self.get_schema_from_definitions(JsonRef(choice['$ref'])) or {}\n properties = choice.get('properties', {})\n if not isinstance(properties, dict) or alias not in properties:\n alias_is_present_on_all_choices = False\n break\n if alias_is_present_on_all_choices:\n openapi_discriminator = alias\n break\n return openapi_discriminator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.chain_schema_GenerateJsonSchema.typed_dict_schema.return.self__named_required_fiel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.chain_schema_GenerateJsonSchema.typed_dict_schema.return.self__named_required_fiel", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 523, "end_line": 546, "span_ids": ["GenerateJsonSchema.lax_or_strict_schema", "GenerateJsonSchema.chain_schema", "GenerateJsonSchema.typed_dict_schema"], "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 GenerateJsonSchema:\n\n def chain_schema(self, schema: core_schema.ChainSchema) -> JsonSchemaValue:\n try:\n # Note: If we wanted to generate a schema for the _serialization_, would want to use the _last_ step:\n return self.generate_inner(schema['steps'][0])\n except IndexError as e:\n raise ValueError('Cannot generate a JsonSchema for a zero-step ChainSchema') from e\n\n def lax_or_strict_schema(self, schema: core_schema.LaxOrStrictSchema) -> JsonSchemaValue:\n \"\"\"\n LaxOrStrict will use the strict branch for serialization internally,\n unless it was overridden here.\n \"\"\"\n # TODO: Need to read the default value off of model config or whatever\n use_strict = schema.get('strict', False) # TODO: replace this default False\n # If your JSON schema fails to generate it is probably\n # because one of the following two branches failed.\n if use_strict:\n return self.generate_inner(schema['strict_schema'])\n else:\n return self.generate_inner(schema['lax_schema'])\n\n def typed_dict_schema(self, schema: core_schema.TypedDictSchema) -> JsonSchemaValue:\n named_required_fields = [(k, v['required'], v) for k, v in schema['fields'].items()]\n return self._named_required_fields_schema(named_required_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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._named_required_fields_schema_GenerateJsonSchema._named_required_fields_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._named_required_fields_schema_GenerateJsonSchema._named_required_fields_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 548, "end_line": 577, "span_ids": ["GenerateJsonSchema._named_required_fields_schema"], "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 GenerateJsonSchema:\n\n def _named_required_fields_schema(\n self, named_required_fields: Sequence[tuple[str, bool, core_schema.TypedDictField | core_schema.DataclassField]]\n ) -> JsonSchemaValue:\n properties: dict[str, JsonSchemaValue] = {}\n required_fields: list[str] = []\n for name, required, field in named_required_fields:\n if self.by_alias:\n alias = field.get('validation_alias', name)\n if isinstance(alias, str):\n name = alias\n elif isinstance(alias, list):\n for path in alias:\n if isinstance(path, list) and len(path) == 1 and isinstance(path[0], str):\n # Use the first valid single-item string path; the code that constructs the alias array\n # should ensure the first such item is what belongs in the JSON schema\n name = path[0]\n break\n field_json_schema = self.generate_inner(field).copy()\n if 'title' not in field_json_schema and self.field_title_should_be_set(field):\n title = self.get_title_from_name(name)\n field_json_schema['title'] = title\n field_json_schema = self.handle_ref_overrides(field_json_schema)\n properties[name] = field_json_schema\n if required:\n required_fields.append(name)\n\n json_schema = {'type': 'object', 'properties': properties}\n if required_fields:\n json_schema['required'] = required_fields\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.typed_dict_field_schema_GenerateJsonSchema.model_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.typed_dict_field_schema_GenerateJsonSchema.model_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 579, "end_line": 598, "span_ids": ["GenerateJsonSchema.typed_dict_field_schema", "GenerateJsonSchema.dataclass_field_schema", "GenerateJsonSchema.model_schema"], "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 GenerateJsonSchema:\n\n def typed_dict_field_schema(self, schema: core_schema.TypedDictField) -> JsonSchemaValue:\n json_schema = self.generate_inner(schema['schema'])\n\n return json_schema\n\n def dataclass_field_schema(self, schema: core_schema.DataclassField) -> JsonSchemaValue:\n json_schema = self.generate_inner(schema['schema'])\n\n return json_schema\n\n def model_schema(self, schema: core_schema.ModelSchema) -> JsonSchemaValue:\n # We do not use schema['model'].model_json_schema() because it could lead to inconsistent refs handling, etc.\n json_schema = self.generate_inner(schema['schema'])\n\n if 'config' in schema:\n title = schema['config'].get('title')\n forbid_additional_properties = schema['config'].get('extra_fields_behavior') == 'forbid'\n json_schema = self._update_class_schema(json_schema, title, forbid_additional_properties)\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._update_class_schema_GenerateJsonSchema.dataclass_args_schema.return.self__named_required_fiel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema._update_class_schema_GenerateJsonSchema.dataclass_args_schema.return.self__named_required_fiel", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 600, "end_line": 621, "span_ids": ["GenerateJsonSchema._update_class_schema", "GenerateJsonSchema.dataclass_args_schema"], "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 GenerateJsonSchema:\n\n def _update_class_schema(\n self, json_schema: JsonSchemaValue, title: str | None, forbid_additional_properties: bool\n ) -> JsonSchemaValue:\n if '$ref' in json_schema:\n schema_to_update = self.get_schema_from_definitions(JsonRef(json_schema['$ref'])) or json_schema\n else:\n schema_to_update = json_schema\n\n if title is not None:\n # referenced_schema['title'] = title\n schema_to_update.setdefault('title', title)\n\n if forbid_additional_properties:\n schema_to_update['additionalProperties'] = False\n\n return json_schema\n\n def dataclass_args_schema(self, schema: core_schema.DataclassArgsSchema) -> JsonSchemaValue:\n named_required_fields = [\n (field['name'], field['schema']['type'] != 'default', field) for field in schema['fields']\n ]\n return self._named_required_fields_schema(named_required_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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.dataclass_schema_GenerateJsonSchema.dataclass_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.dataclass_schema_GenerateJsonSchema.dataclass_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 623, "end_line": 645, "span_ids": ["GenerateJsonSchema.dataclass_schema"], "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 GenerateJsonSchema:\n\n def dataclass_schema(self, schema: core_schema.DataclassSchema) -> JsonSchemaValue:\n # TODO: Better-share this logic with model_schema\n # I'd prefer to clean this up _after_ we rework the approach to customizing dataclass JSON schema though\n\n json_schema = self.generate_inner(schema['schema']).copy()\n\n cls = schema['cls']\n config: ConfigDict = getattr(cls, '__pydantic_config__', cast('ConfigDict', {}))\n\n title = config.get('title') or cls.__name__\n forbid_additional_properties = config.get('extra') == 'forbid'\n json_schema = self._update_class_schema(json_schema, title, forbid_additional_properties)\n\n # Dataclass-specific handling of description\n if is_dataclass(cls) and not hasattr(cls, '__pydantic_validator__'):\n # vanilla dataclass; don't use cls.__doc__ as it will contain the class signature by default\n description = None\n else:\n description = None if cls.__doc__ is None else inspect.cleandoc(cls.__doc__)\n if description:\n json_schema['description'] = description\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.arguments_schema_GenerateJsonSchema.arguments_schema.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.arguments_schema_GenerateJsonSchema.arguments_schema.return._", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 647, "end_line": 678, "span_ids": ["GenerateJsonSchema.arguments_schema"], "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 GenerateJsonSchema:\n\n def arguments_schema(self, schema: core_schema.ArgumentsSchema) -> JsonSchemaValue:\n metadata = _core_metadata.CoreMetadataHandler(schema).metadata\n prefer_positional = metadata.get('pydantic_js_prefer_positional_arguments')\n\n arguments = schema['arguments_schema']\n kw_only_arguments = [a for a in arguments if a.get('mode') == 'keyword_only']\n kw_or_p_arguments = [a for a in arguments if a.get('mode') in {'positional_or_keyword', None}]\n p_only_arguments = [a for a in arguments if a.get('mode') == 'positional_only']\n var_args_schema = schema.get('var_args_schema')\n var_kwargs_schema = schema.get('var_kwargs_schema')\n\n if prefer_positional:\n positional_possible = not kw_only_arguments and not var_kwargs_schema\n if positional_possible:\n return self.p_arguments_schema(p_only_arguments + kw_or_p_arguments, var_args_schema)\n\n keyword_possible = not p_only_arguments and not var_args_schema\n if keyword_possible:\n return self.kw_arguments_schema(kw_or_p_arguments + kw_only_arguments, var_kwargs_schema)\n\n if not prefer_positional:\n positional_possible = not kw_only_arguments and not var_kwargs_schema\n if positional_possible:\n return self.p_arguments_schema(p_only_arguments + kw_or_p_arguments, var_args_schema)\n\n return {\n 'type': 'object',\n 'properties': {\n '__args__': self.p_arguments_schema(p_only_arguments, var_args_schema),\n '__kwargs__': self.kw_arguments_schema(kw_or_p_arguments + kw_only_arguments, var_args_schema),\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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.kw_arguments_schema_GenerateJsonSchema.kw_arguments_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.kw_arguments_schema_GenerateJsonSchema.kw_arguments_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 680, "end_line": 707, "span_ids": ["GenerateJsonSchema.kw_arguments_schema"], "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 GenerateJsonSchema:\n\n def kw_arguments_schema(\n self, arguments: list[core_schema.ArgumentsParameter], var_kwargs_schema: CoreSchema | None\n ) -> JsonSchemaValue:\n properties: dict[str, JsonSchemaValue] = {}\n required: list[str] = []\n for argument in arguments:\n name = self.get_argument_name(argument)\n argument_schema = self.generate_inner(argument['schema']).copy()\n argument_schema['title'] = self.get_title_from_name(name)\n properties[name] = argument_schema\n\n if argument['schema']['type'] != 'default':\n # This assumes that if the argument has a default value,\n # the inner schema must be of type WithDefaultSchema.\n # I believe this is true, but I am not 100% sure\n required.append(name)\n\n json_schema: JsonSchemaValue = {'type': 'object', 'properties': properties}\n if required:\n json_schema['required'] = required\n\n if var_kwargs_schema:\n additional_properties_schema = self.generate_inner(var_kwargs_schema)\n if additional_properties_schema:\n json_schema['additionalProperties'] = additional_properties_schema\n else:\n json_schema['additionalProperties'] = False\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.p_arguments_schema_GenerateJsonSchema.p_arguments_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.p_arguments_schema_GenerateJsonSchema.p_arguments_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 709, "end_line": 739, "span_ids": ["GenerateJsonSchema.p_arguments_schema"], "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 GenerateJsonSchema:\n\n def p_arguments_schema(\n self, arguments: list[core_schema.ArgumentsParameter], var_args_schema: CoreSchema | None\n ) -> JsonSchemaValue:\n prefix_items: list[JsonSchemaValue] = []\n min_items = 0\n\n for argument in arguments:\n name = self.get_argument_name(argument)\n\n argument_schema = self.generate_inner(argument['schema']).copy()\n argument_schema['title'] = self.get_title_from_name(name)\n prefix_items.append(argument_schema)\n\n if argument['schema']['type'] != 'default':\n # This assumes that if the argument has a default value,\n # the inner schema must be of type WithDefaultSchema.\n # I believe this is true, but I am not 100% sure\n min_items += 1\n\n json_schema: JsonSchemaValue = {'type': 'array', 'prefixItems': prefix_items}\n if min_items:\n json_schema['minItems'] = min_items\n\n if var_args_schema:\n items_schema = self.generate_inner(var_args_schema)\n if items_schema:\n json_schema['items'] = items_schema\n else:\n json_schema['maxItems'] = len(prefix_items)\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_argument_name_GenerateJsonSchema.custom_error_schema.return.self_generate_inner_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_argument_name_GenerateJsonSchema.custom_error_schema.return.self_generate_inner_schem", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 741, "end_line": 755, "span_ids": ["GenerateJsonSchema.custom_error_schema", "GenerateJsonSchema.call_schema", "GenerateJsonSchema.get_argument_name"], "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 GenerateJsonSchema:\n\n def get_argument_name(self, argument: core_schema.ArgumentsParameter) -> str:\n name = argument['name']\n if self.by_alias:\n alias = argument.get('alias')\n if isinstance(alias, str):\n name = alias\n else:\n pass # might want to do something else?\n return name\n\n def call_schema(self, schema: core_schema.CallSchema) -> JsonSchemaValue:\n return self.generate_inner(schema['arguments_schema'])\n\n def custom_error_schema(self, schema: core_schema.CustomErrorSchema) -> JsonSchemaValue:\n return self.generate_inner(schema['schema'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.json_schema_GenerateJsonSchema.json_schema.return._type_string_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.json_schema_GenerateJsonSchema.json_schema.return._type_string_forma", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 757, "end_line": 764, "span_ids": ["GenerateJsonSchema.json_schema"], "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 GenerateJsonSchema:\n\n def json_schema(self, schema: core_schema.JsonSchema) -> JsonSchemaValue:\n # TODO: For v1 compatibility, we should probably be using `schema['schema']` to produce the schema.\n # This is a serialization vs. validation thing; see https://github.com/pydantic/pydantic/issues/5072\n # -\n # The behavior below is not currently consistent with the v1 behavior, so should probably be changed.\n # I think making it work like v1 should be as easy as handling schema['schema'] instead, with the note\n # that we'll need to make generics work with Json (there is a test for this in test_generics.py).\n return {'type': 'string', 'format': 'json-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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.url_schema_GenerateJsonSchema.get_title_from_name.return.name_title_replace___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.url_schema_GenerateJsonSchema.get_title_from_name.return.name_title_replace___", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 766, "end_line": 790, "span_ids": ["GenerateJsonSchema.get_title_from_name", "GenerateJsonSchema.definitions_schema", "GenerateJsonSchema.url_schema", "GenerateJsonSchema.definition_ref_schema", "GenerateJsonSchema.multi_host_url_schema"], "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": "class GenerateJsonSchema:\n\n def url_schema(self, schema: core_schema.UrlSchema) -> JsonSchemaValue:\n json_schema = {'type': 'string', 'format': 'uri', 'minLength': 1}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.string)\n return json_schema\n\n def multi_host_url_schema(self, schema: core_schema.MultiHostUrlSchema) -> JsonSchemaValue:\n # Note: 'multi-host-uri' is a custom/pydantic-specific format, not part of the JSON Schema spec\n json_schema = {'type': 'string', 'format': 'multi-host-uri', 'minLength': 1}\n self.update_with_validations(json_schema, schema, self.ValidationsMapping.string)\n return json_schema\n\n def definitions_schema(self, schema: core_schema.DefinitionsSchema) -> JsonSchemaValue:\n for definition in schema['definitions']:\n self.generate_inner(definition)\n return self.generate_inner(schema['schema'])\n\n def definition_ref_schema(self, schema: core_schema.DefinitionReferenceSchema) -> JsonSchemaValue:\n core_ref = CoreRef(schema['schema_ref'])\n defs_ref, ref_json_schema = self.get_cache_defs_ref_schema(core_ref)\n return ref_json_schema\n\n # ### Utility methods\n\n def get_title_from_name(self, name: str) -> str:\n return name.title().replace('_', ' ')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.field_title_should_be_set_GenerateJsonSchema.normalize_name.return.re_sub_r_a_zA_Z0_9___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.field_title_should_be_set_GenerateJsonSchema.normalize_name.return.re_sub_r_a_zA_Z0_9___", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 792, "end_line": 826, "span_ids": ["GenerateJsonSchema.normalize_name", "GenerateJsonSchema.field_title_should_be_set"], "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 GenerateJsonSchema:\n\n def field_title_should_be_set(\n self, schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField\n ) -> bool:\n \"\"\"\n Returns true if a field with the given schema should have a title set based on the field name.\n\n Intuitively, we want this to return true for schemas that wouldn't otherwise provide their own title\n (e.g., int, float, str), and false for those that would (e.g., BaseModel subclasses).\n \"\"\"\n if _core_utils.is_typed_dict_field(schema) or _core_utils.is_dataclass_field(schema):\n return self.field_title_should_be_set(schema['schema'])\n\n elif _core_utils.is_core_schema(schema):\n if schema.get('ref'): # things with refs, such as models and enums, should not have titles set\n return False\n\n js_cs_override = _core_metadata.CoreMetadataHandler(schema).get_js_cs_override()\n if js_cs_override:\n return self.field_title_should_be_set(js_cs_override)\n\n if schema['type'] in {'default', 'nullable', 'definitions'}:\n return self.field_title_should_be_set(schema['schema']) # type: ignore[typeddict-item]\n if _core_utils.is_function_with_inner_schema(schema):\n return self.field_title_should_be_set(schema['schema'])\n if schema['type'] == 'definition-ref':\n # Referenced schemas should not have titles set for the same reason\n # schemas with refs should not\n return False\n return True # anything else should have title set\n\n else:\n raise TypeError(f'Unexpected schema type: schema={schema}')\n\n def normalize_name(self, name: str) -> str:\n return re.sub(r'[^a-zA-Z0-9.\\-_]', '_', name).replace('.', '__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_defs_ref_GenerateJsonSchema.get_defs_ref._should_never_get_here_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_defs_ref_GenerateJsonSchema.get_defs_ref._should_never_get_here_i", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 828, "end_line": 857, "span_ids": ["GenerateJsonSchema.get_defs_ref"], "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 GenerateJsonSchema:\n\n def get_defs_ref(self, core_ref: CoreRef) -> DefsRef:\n \"\"\"\n Override this method to change the way that definitions keys are generated from a core reference.\n \"\"\"\n # Split the core ref into \"components\"; generic origins and arguments are each separate components\n components = re.split(r'([\\][,])', core_ref)\n # Remove IDs from each component\n components = [x.split(':')[0] for x in components]\n core_ref_no_id = ''.join(components)\n # Remove everything before the last period from each \"component\"\n components = [re.sub(r'(?:[^.[\\]]+\\.)+((?:[^.[\\]]+))', r'\\1', x) for x in components]\n short_ref = ''.join(components)\n\n first_choice = DefsRef(self.normalize_name(short_ref)) # name\n second_choice = DefsRef(self.normalize_name(core_ref_no_id)) # module + qualname\n third_choice = DefsRef(self.normalize_name(core_ref)) # module + qualname + id\n\n # It is important that the generated defs_ref values be such that at least one could not\n # be generated for any other core_ref. Currently, this should be the case because we include\n # the id of the source type in the core_ref, and therefore in the third_choice\n choices = [first_choice, second_choice, third_choice]\n self.defs_ref_fallbacks[core_ref] = choices[1:]\n\n for choice in choices:\n if self.defs_to_core_refs.get(choice, core_ref) == core_ref:\n return choice\n else:\n self.collisions.add(choice)\n\n return choices[-1] # should never get here if the final choice is guaranteed unique", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.resolve_collisions_GenerateJsonSchema.resolve_collisions.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.resolve_collisions_GenerateJsonSchema.resolve_collisions.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 859, "end_line": 893, "span_ids": ["GenerateJsonSchema.resolve_collisions"], "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 GenerateJsonSchema:\n\n def resolve_collisions(self, json_schema: JsonSchemaValue) -> JsonSchemaValue:\n \"\"\"\n This function ensures that any defs_ref's that were involved in collisions\n (due to simplification of the core_ref) get updated, even if they were the\n first occurrence of the colliding defs_ref.\n\n This is intended to prevent confusion where the type that gets the \"shortened\"\n ref depends on the order in which the types were visited.\n \"\"\"\n made_changes = True\n\n # Note that because the defs ref choices eventually produce values that use the IDs and\n # should _never_ collide, it should not be possible for this while loop to run forever\n while made_changes:\n made_changes = False\n\n for defs_ref, core_ref in self.defs_to_core_refs.items():\n if defs_ref not in self.collisions:\n continue\n\n for choice in self.defs_ref_fallbacks[core_ref]:\n if choice == defs_ref or choice in self.collisions:\n continue\n\n if self.defs_to_core_refs.get(choice, core_ref) == core_ref:\n json_schema = self.change_defs_ref(defs_ref, choice, json_schema)\n made_changes = True\n break\n else:\n self.collisions.add(choice)\n\n if made_changes:\n break\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.change_defs_ref_GenerateJsonSchema.change_defs_ref.self_core_to_json_refs_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.change_defs_ref_GenerateJsonSchema.change_defs_ref.self_core_to_json_refs_co", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 895, "end_line": 906, "span_ids": ["GenerateJsonSchema.change_defs_ref"], "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 GenerateJsonSchema:\n\n def change_defs_ref(self, old: DefsRef, new: DefsRef, json_schema: JsonSchemaValue) -> JsonSchemaValue:\n if new == old:\n return json_schema\n core_ref = self.defs_to_core_refs[old]\n old_json_ref = self.core_to_json_refs[core_ref]\n new_json_ref = JsonRef(self.ref_template.format(model=new))\n\n self.definitions[new] = self.definitions.pop(old)\n self.defs_to_core_refs[new] = self.defs_to_core_refs.pop(old)\n self.json_to_defs_refs[new_json_ref] = self.json_to_defs_refs.pop(old_json_ref)\n self.core_to_defs_refs[core_ref] = new\n self.core_to_json_refs[core_ref] = new_json_ref\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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.change_defs_ref.walk_replace_json_schema_ref_GenerateJsonSchema.change_defs_ref.return.walk_replace_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.change_defs_ref.walk_replace_json_schema_ref_GenerateJsonSchema.change_defs_ref.return.walk_replace_json_schema_", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 908, "end_line": 922, "span_ids": ["GenerateJsonSchema.change_defs_ref"], "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 GenerateJsonSchema:\n\n def change_defs_ref(self, old: DefsRef, new: DefsRef, json_schema: JsonSchemaValue) -> JsonSchemaValue:\n # ... other code\n\n def walk_replace_json_schema_ref(item: Any) -> Any:\n \"\"\"\n Recursively update the JSON schema to use the new defs_ref.\n \"\"\"\n if isinstance(item, list):\n return [walk_replace_json_schema_ref(item) for item in item]\n elif isinstance(item, dict):\n ref = item.get('$ref')\n if ref == old_json_ref:\n item['$ref'] = new_json_ref\n return {k: walk_replace_json_schema_ref(v) for k, v in item.items()}\n else:\n return item\n\n return walk_replace_json_schema_ref(json_schema)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_cache_defs_ref_schema_GenerateJsonSchema.get_cache_defs_ref_schema.return.defs_ref_ref_json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_cache_defs_ref_schema_GenerateJsonSchema.get_cache_defs_ref_schema.return.defs_ref_ref_json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 924, "end_line": 944, "span_ids": ["GenerateJsonSchema.get_cache_defs_ref_schema"], "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 GenerateJsonSchema:\n\n def get_cache_defs_ref_schema(self, core_ref: CoreRef) -> tuple[DefsRef, JsonSchemaValue]:\n \"\"\"\n This method wraps the get_defs_ref method with some cache-lookup/population logic,\n and returns both the produced defs_ref and the JSON schema that will refer to the right definition.\n \"\"\"\n maybe_defs_ref = self.core_to_defs_refs.get(core_ref)\n if maybe_defs_ref is not None:\n json_ref = self.core_to_json_refs[core_ref]\n return maybe_defs_ref, {'$ref': json_ref}\n\n defs_ref = self.get_defs_ref(core_ref)\n\n # populate the ref translation mappings\n self.core_to_defs_refs[core_ref] = defs_ref\n self.defs_to_core_refs[defs_ref] = core_ref\n\n json_ref = JsonRef(self.ref_template.format(model=defs_ref))\n self.core_to_json_refs[core_ref] = json_ref\n self.json_to_defs_refs[json_ref] = defs_ref\n ref_json_schema = {'$ref': json_ref}\n return defs_ref, ref_json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.handle_ref_overrides_GenerateJsonSchema.handle_ref_overrides.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.handle_ref_overrides_GenerateJsonSchema.handle_ref_overrides.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 946, "end_line": 986, "span_ids": ["GenerateJsonSchema.handle_ref_overrides"], "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 GenerateJsonSchema:\n\n def handle_ref_overrides(self, json_schema: JsonSchemaValue) -> JsonSchemaValue:\n \"\"\"\n It is not valid for a schema with a top-level $ref to have sibling keys.\n\n During our own schema generation, we treat sibling keys as overrides to the referenced schema,\n but this is not how the official JSON schema spec works.\n\n Because of this, we first remove any sibling keys that are redundant with the referenced schema, then if\n any remain, we transform the schema from a top-level '$ref' to use allOf to move the $ref out of the top level.\n (See bottom of https://swagger.io/docs/specification/using-ref/ for a reference about this behavior)\n \"\"\"\n if '$ref' in json_schema:\n # prevent modifications to the input; this copy may be safe to drop if there is significant overhead\n json_schema = json_schema.copy()\n\n referenced_json_schema = self.get_schema_from_definitions(JsonRef(json_schema['$ref']))\n if referenced_json_schema is None:\n # This can happen when building schemas for models with not-yet-defined references.\n # It may be a good idea to do a recursive pass at the end of the generation to remove\n # any redundant override keys.\n if len(json_schema) > 1:\n # Make it an allOf to at least resolve the sibling keys issue\n json_schema = json_schema.copy()\n json_schema.setdefault('allOf', [])\n json_schema['allOf'].append({'$ref': json_schema['$ref']})\n del json_schema['$ref']\n\n return json_schema\n for k, v in list(json_schema.items()):\n if k == '$ref':\n continue\n if k in referenced_json_schema and referenced_json_schema[k] == v:\n del json_schema[k] # redundant key\n if len(json_schema) > 1:\n # There is a remaining \"override\" key, so we need to move $ref out of the top level\n json_ref = JsonRef(json_schema['$ref'])\n del json_schema['$ref']\n assert 'allOf' not in json_schema # this should never happen, but just in case\n json_schema['allOf'] = [{'$ref': json_ref}]\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_schema_from_definitions_GenerateJsonSchema.update_with_validations.for_core_key_json_schema.if_core_key_in_core_schem._type_ignore_literal_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_schema_from_definitions_GenerateJsonSchema.update_with_validations.for_core_key_json_schema.if_core_key_in_core_schem._type_ignore_literal_re", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 988, "end_line": 1003, "span_ids": ["GenerateJsonSchema.update_with_validations", "GenerateJsonSchema.encode_default", "GenerateJsonSchema.get_schema_from_definitions"], "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 GenerateJsonSchema:\n\n def get_schema_from_definitions(self, json_ref: JsonRef) -> JsonSchemaValue | None:\n return self.definitions.get(self.json_to_defs_refs[json_ref])\n\n def encode_default(self, dft: Any) -> Any:\n return pydantic_core.to_jsonable_python(dft)\n\n def update_with_validations(\n self, json_schema: JsonSchemaValue, core_schema: CoreSchema, mapping: dict[str, str]\n ) -> None:\n \"\"\"\n Update the json_schema with the corresponding validations specified in the core_schema,\n using the provided mapping to translate keys in core_schema to the appropriate keys for a JSON schema.\n \"\"\"\n for core_key, json_schema_key in mapping.items():\n if core_key in core_schema:\n json_schema[json_schema_key] = core_schema[core_key] # type: ignore[literal-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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.ValidationsMapping_GenerateJsonSchema.ValidationsMapping.date._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.ValidationsMapping_GenerateJsonSchema.ValidationsMapping.date._", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1005, "end_line": 1042, "span_ids": ["GenerateJsonSchema.ValidationsMapping"], "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 GenerateJsonSchema:\n\n class ValidationsMapping:\n \"\"\"\n This class just contains mappings from core_schema attribute names to the corresponding\n JSON schema attribute names. While I suspect it is unlikely to be necessary, you can in\n principle override this class in a subclass of GenerateJsonSchema (by inheriting from\n GenerateJsonSchema.ValidationsMapping) to change these mappings.\n \"\"\"\n\n numeric = {\n 'multiple_of': 'multipleOf',\n 'le': 'maximum',\n 'ge': 'minimum',\n 'lt': 'exclusiveMaximum',\n 'gt': 'exclusiveMinimum',\n }\n bytes = {\n 'min_length': 'minLength',\n 'max_length': 'maxLength',\n }\n string = {\n 'min_length': 'minLength',\n 'max_length': 'maxLength',\n 'pattern': 'pattern',\n }\n array = {\n 'min_length': 'minItems',\n 'max_length': 'maxItems',\n }\n object = {\n 'min_length': 'minProperties',\n 'max_length': 'maxProperties',\n }\n date = {\n 'le': 'maximum',\n 'ge': 'minimum',\n 'lt': 'exclusiveMaximum',\n 'gt': 'exclusiveMinimum',\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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_flattened_anyof_GenerateJsonSchema.get_json_ref_counts.return.json_refs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.get_flattened_anyof_GenerateJsonSchema.get_json_ref_counts.return.json_refs", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1044, "end_line": 1078, "span_ids": ["GenerateJsonSchema.get_json_ref_counts", "GenerateJsonSchema.get_flattened_anyof"], "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 GenerateJsonSchema:\n\n def get_flattened_anyof(self, schemas: list[JsonSchemaValue]) -> JsonSchemaValue:\n members = []\n for schema in schemas:\n if len(schema) == 1 and 'anyOf' in schema:\n members.extend(schema['anyOf'])\n else:\n members.append(schema)\n members = _deduplicate_schemas(members)\n if len(members) == 1:\n return members[0]\n return {'anyOf': members}\n\n def get_json_ref_counts(self, json_schema: JsonSchemaValue) -> dict[JsonRef, int]:\n \"\"\"\n Get all values corresponding to the key '$ref' anywhere in the json_schema\n \"\"\"\n json_refs: dict[JsonRef, int] = Counter()\n\n def _add_json_refs(schema: Any) -> None:\n if isinstance(schema, dict):\n if '$ref' in schema:\n json_ref = JsonRef(schema['$ref'])\n already_visited = json_ref in json_refs\n json_refs[json_ref] += 1\n if already_visited:\n return # prevent recursion on a definition that was already visited\n _add_json_refs(self.definitions[self.json_to_defs_refs[json_ref]])\n for v in schema.values():\n _add_json_refs(v)\n elif isinstance(schema, list):\n for v in schema:\n _add_json_refs(v)\n\n _add_json_refs(json_schema)\n return json_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_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.handle_invalid_for_json_schema_GenerateJsonSchema.emit_warning.if_message_is_not_None_.warnings_warn_message_Py": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.handle_invalid_for_json_schema_GenerateJsonSchema.emit_warning.if_message_is_not_None_.warnings_warn_message_Py", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1080, "end_line": 1096, "span_ids": ["GenerateJsonSchema.handle_invalid_for_json_schema", "GenerateJsonSchema.emit_warning"], "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 GenerateJsonSchema:\n\n def handle_invalid_for_json_schema(\n self, schema: CoreSchema | core_schema.TypedDictField | core_schema.DataclassField, error_info: str\n ) -> JsonSchemaValue:\n if _core_metadata.CoreMetadataHandler(schema).metadata.get('pydantic_js_modify_function') is not None:\n # Since there is a json schema modify function, assume that this type is meant to be handled,\n # and the modify function will set all properties as appropriate\n return {}\n else:\n raise PydanticInvalidForJsonSchema(f'Cannot generate a JsonSchema for {error_info}')\n\n def emit_warning(self, kind: JsonSchemaWarningKind, detail: str) -> None:\n \"\"\"\n This method simply emits PydanticJsonSchemaWarnings based on handling in the `warning_message` method.\n \"\"\"\n message = self.render_warning_message(kind, detail)\n if message is not None:\n warnings.warn(message, PydanticJsonSchemaWarning)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.render_warning_message_GenerateJsonSchema.render_warning_message.return.f_detail_kind_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py_GenerateJsonSchema.render_warning_message_GenerateJsonSchema.render_warning_message.return.f_detail_kind_", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1098, "end_line": 1108, "span_ids": ["GenerateJsonSchema.render_warning_message"], "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 GenerateJsonSchema:\n\n def render_warning_message(self, kind: JsonSchemaWarningKind, detail: str) -> str | None:\n \"\"\"\n This method is responsible for ignoring warnings as desired, and for formatting the warning messages.\n\n You can override the value of `ignored_warning_kinds` in a subclass of GenerateJsonSchema\n to modify what warnings are generated. If you want more control, you can override this method;\n just return None in situations where you don't want warnings to be emitted.\n \"\"\"\n if kind in self.ignored_warning_kinds:\n return None\n return f'{detail} [{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_pydantic__pydantic/pydantic/json_schema.py__Start_JSON_Schema_models_json_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__Start_JSON_Schema_models_json_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1111, "end_line": 1136, "span_ids": ["GenerateJsonSchema.render_warning_message", "models_json_schema"], "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": "# ##### Start JSON Schema Generation Functions #####\n# TODO: These should be moved to the pydantic.funcs module or whatever when appropriate.\n\n\ndef models_json_schema(\n models: Sequence[type[BaseModel] | type[PydanticDataclass]],\n *,\n by_alias: bool = True,\n title: str | None = None,\n description: str | None = None,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n) -> dict[str, Any]:\n # TODO: Put this in the \"methods\" module once that is created?\n instance = schema_generator(by_alias=by_alias, ref_template=ref_template)\n definitions = instance.generate_definitions([x.__pydantic_core_schema__ for x in models])\n\n json_schema: dict[str, Any] = {}\n if definitions:\n json_schema['$defs'] = definitions\n if title:\n json_schema['title'] = title\n if description:\n json_schema['description'] = description\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__TODO_Consider_removing_model_json_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__TODO_Consider_removing_model_json_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1139, "end_line": 1167, "span_ids": ["model_json_schema", "impl:14", "models_json_schema"], "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": "# TODO: Consider removing this cache, as it already gets used pretty infrequently.\n\nif sys.version_info >= (3, 9): # Typing for weak dictionaries available at 3.9\n _JsonSchemaCache = WeakKeyDictionary[Type[Any], Dict[Any, Any]]\nelse:\n _JsonSchemaCache = WeakKeyDictionary\n\n_JSON_SCHEMA_CACHE = _JsonSchemaCache()\n\n\ndef model_json_schema(\n cls: type[BaseModel] | type[PydanticDataclass],\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n) -> dict[str, Any]:\n # TODO: Put this in the \"methods\" module once that is created\n cls_json_schema_cache = _JSON_SCHEMA_CACHE.get(cls)\n if cls_json_schema_cache is None:\n _JSON_SCHEMA_CACHE[cls] = cls_json_schema_cache = {}\n\n cached = cls_json_schema_cache.get((by_alias, ref_template, schema_generator))\n if cached is not None:\n return cached\n\n json_schema = schema_generator(by_alias=by_alias, ref_template=ref_template).generate(cls.__pydantic_core_schema__)\n cls_json_schema_cache[(by_alias, ref_template, schema_generator)] = json_schema\n\n return json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__End_JSON_Schema_G_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json_schema.py__End_JSON_Schema_G_", "embedding": null, "metadata": {"file_path": "pydantic/json_schema.py", "file_name": "json_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1170, "end_line": 1189, "span_ids": ["impl:22", "_deduplicate_schemas", "_make_json_hashable", "model_json_schema"], "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": "# ##### End JSON Schema Generation Functions #####\n\n\n_Json = Union[Dict[str, Any], List[Any], str, int, float, bool, None]\n_JsonDict = Dict[str, _Json]\n_HashableJson = Union[Tuple[Tuple[str, Any], ...], Tuple[Any, ...], str, int, float, bool, None]\n\n\ndef _deduplicate_schemas(schemas: Iterable[_JsonDict]) -> list[_JsonDict]:\n return list({_make_json_hashable(schema): schema for schema in schemas}.values())\n\n\ndef _make_json_hashable(value: _Json) -> _HashableJson:\n if isinstance(value, dict):\n return tuple(sorted((k, _make_json_hashable(v)) for k, v in value.items()))\n elif isinstance(value, list):\n return tuple(_make_json_hashable(v) for v in value)\n else:\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_pydantic__pydantic/pydantic/main.py____base_class_defined.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py____base_class_defined.False", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["docstring"], "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": "\"\"\"\nLogic for creating models, could perhaps be renamed to `models.py`.\n\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport typing\nimport warnings\nfrom abc import ABCMeta\nfrom copy import copy, deepcopy\nfrom inspect import getdoc\nfrom pathlib import Path\nfrom types import prepare_class, resolve_bases\nfrom typing import Any, Generic\n\nimport pydantic_core\nimport typing_extensions\n\nfrom ._internal import (\n _decorators,\n _forward_ref,\n _generics,\n _model_construction,\n _repr,\n _typing_extra,\n _utils,\n)\nfrom ._internal._fields import Undefined\nfrom .config import BaseConfig, ConfigDict, Extra, build_config, get_config\nfrom .deprecated import copy_internals as _deprecated_copy_internals\nfrom .deprecated import parse as _deprecated_parse\nfrom .errors import PydanticUndefinedAnnotation, PydanticUserError\nfrom .fields import Field, FieldInfo, ModelPrivateAttr\nfrom .json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema, JsonSchemaValue, model_json_schema\n\nif typing.TYPE_CHECKING:\n from inspect import Signature\n\n from pydantic_core import CoreSchema, SchemaSerializer, SchemaValidator\n\n from ._internal._generate_schema import GenerateSchema\n from ._internal._utils import AbstractSetIntStr, MappingIntStrAny\n\n AnyClassMethod = classmethod[Any]\n TupleGenerator = typing.Generator[tuple[str, Any], None, None]\n Model = typing.TypeVar('Model', bound='BaseModel')\n # should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope\n IncEx = set[int] | set[str] | dict[int, Any] | dict[str, Any] | None\n\n__all__ = 'BaseModel', 'create_model'\n\n_object_setattr = _model_construction.object_setattr\n# Note `ModelMetaclass` refers to `BaseModel`, but is also used to *create* `BaseModel`, so we need to add this extra\n# (somewhat hacky) boolean to keep track of whether we've created the `BaseModel` class yet, and therefore whether it's\n# safe to refer to it. If it *hasn't* been created, we assume that the `__new__` call we're in the middle of is for\n# the `BaseModel` class, since that's defined immediately after the metaclass.\n_base_class_defined = 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_pydantic__pydantic/pydantic/main.py_ModelMetaclass_ModelMetaclass.__instancecheck__.return.hasattr_instance___pyda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_ModelMetaclass_ModelMetaclass.__instancecheck__.return.hasattr_instance___pyda", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 166, "span_ids": ["ModelMetaclass.__instancecheck__", "ModelMetaclass.__new__", "ModelMetaclass"], "tokens": 1105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@typing_extensions.dataclass_transform(kw_only_default=True, field_specifiers=(Field,))\nclass ModelMetaclass(ABCMeta):\n def __new__(\n mcs,\n cls_name: str,\n bases: tuple[type[Any], ...],\n namespace: dict[str, Any],\n __pydantic_generic_origin__: type[BaseModel] | None = None,\n __pydantic_generic_args__: tuple[Any, ...] | None = None,\n __pydantic_generic_parameters__: tuple[Any, ...] | None = None,\n __pydantic_reset_parent_namespace__: bool = True,\n **kwargs: Any,\n ) -> type:\n if _base_class_defined:\n base_field_names, class_vars, base_private_attributes = _collect_bases_data(bases)\n\n config_new = build_config(cls_name, bases, namespace, kwargs)\n namespace['model_config'] = config_new\n private_attributes = _model_construction.inspect_namespace(\n namespace, config_new.get('ignored_types', ()), class_vars, base_field_names\n )\n if private_attributes:\n slots: set[str] = set(namespace.get('__slots__', ()))\n namespace['__slots__'] = slots | private_attributes.keys()\n\n if 'model_post_init' in namespace:\n # if there are private_attributes and a model_post_init function, we wrap them both\n # in a single function\n namespace['_init_private_attributes'] = _model_construction.init_private_attributes\n\n def __pydantic_post_init__(self_: Any, context: Any) -> None:\n self_._init_private_attributes(context)\n self_.model_post_init(context)\n\n namespace['__pydantic_post_init__'] = __pydantic_post_init__\n else:\n namespace['__pydantic_post_init__'] = _model_construction.init_private_attributes\n elif 'model_post_init' in namespace:\n namespace['__pydantic_post_init__'] = namespace['model_post_init']\n\n namespace['__class_vars__'] = class_vars\n namespace['__private_attributes__'] = {**base_private_attributes, **private_attributes}\n\n if '__hash__' not in namespace and config_new['frozen']:\n\n def hash_func(self_: Any) -> int:\n return hash(self_.__class__) + hash(tuple(self_.__dict__.values()))\n\n namespace['__hash__'] = hash_func\n\n cls: type[BaseModel] = super().__new__(mcs, cls_name, bases, namespace, **kwargs) # type: ignore\n\n cls.__pydantic_decorators__ = _decorators.gather_decorator_functions(cls)\n\n # FIXME all generics related attributes should be moved into a dict, like `__pydantic_decorators__`\n parent_typevars_map = {}\n for base in bases:\n base_typevars_map = getattr(base, '__pydantic_generic_typevars_map__', None)\n if base_typevars_map:\n parent_typevars_map.update(base_typevars_map)\n\n cls.__pydantic_generic_args__ = __pydantic_generic_args__\n cls.__pydantic_generic_origin__ = __pydantic_generic_origin__\n cls.__pydantic_generic_parameters__ = __pydantic_generic_parameters__ or getattr(\n cls, '__parameters__', None\n )\n cls.__pydantic_generic_defaults__ = None if not cls.__pydantic_generic_parameters__ else {}\n if __pydantic_generic_origin__ is None:\n cls.__pydantic_generic_typevars_map__ = None\n else:\n new_typevars_map = dict(\n zip(_generics.iter_contained_typevars(__pydantic_generic_origin__), __pydantic_generic_args__ or ())\n )\n cls.__pydantic_generic_typevars_map__ = {**parent_typevars_map, **new_typevars_map}\n\n cls.__pydantic_model_complete__ = False # Ensure this specific class gets completed\n\n # preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487\n # for attributes not in `new_namespace` (e.g. private attributes)\n for name, obj in private_attributes.items():\n set_name = getattr(obj, '__set_name__', None)\n if callable(set_name):\n set_name(cls, name)\n\n if __pydantic_reset_parent_namespace__:\n cls.__pydantic_parent_namespace__ = _typing_extra.parent_frame_namespace()\n parent_namespace = getattr(cls, '__pydantic_parent_namespace__', None)\n\n types_namespace = _model_construction.get_model_types_namespace(cls, parent_namespace)\n _model_construction.set_model_fields(cls, bases, types_namespace)\n _model_construction.complete_model_class(\n cls,\n cls_name,\n types_namespace,\n raise_errors=False,\n )\n return cls\n else:\n # this is the BaseModel class itself being created, no logic required\n return super().__new__(mcs, cls_name, bases, namespace, **kwargs)\n\n def __instancecheck__(self, instance: Any) -> bool:\n \"\"\"\n Avoid calling ABC _abc_subclasscheck unless we're pretty sure.\n\n See #3829 and python/cpython#92810\n \"\"\"\n return hasattr(instance, '__pydantic_validator__') and super().__instancecheck__(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_pydantic__pydantic/pydantic/main.py_BaseModel_BaseModel.model_validate.return.cls___pydantic_validator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel_BaseModel.model_validate.return.cls___pydantic_validator_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 220, "span_ids": ["BaseModel.__get_pydantic_core_schema__", "BaseModel.model_validate", "BaseModel.__init__", "BaseModel"], "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": "class BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n if typing.TYPE_CHECKING:\n # populated by the metaclass, defined here to help IDEs only\n __pydantic_validator__: typing.ClassVar[SchemaValidator]\n __pydantic_core_schema__: typing.ClassVar[CoreSchema]\n __pydantic_serializer__: typing.ClassVar[SchemaSerializer]\n __pydantic_decorators__: typing.ClassVar[_decorators.DecoratorInfos]\n \"\"\"metadata for `@validator`, `@root_validator` and `@serializer` decorators\"\"\"\n model_fields: typing.ClassVar[dict[str, FieldInfo]] = {}\n __signature__: typing.ClassVar[Signature]\n __private_attributes__: typing.ClassVar[dict[str, ModelPrivateAttr]]\n __class_vars__: typing.ClassVar[set[str]]\n __fields_set__: set[str] = set()\n __pydantic_generic_args__: typing.ClassVar[tuple[Any, ...] | None]\n __pydantic_generic_defaults__: typing.ClassVar[dict[str, Any] | None]\n __pydantic_generic_origin__: typing.ClassVar[type[BaseModel] | None]\n __pydantic_generic_parameters__: typing.ClassVar[tuple[_typing_extra.TypeVarType, ...] | None]\n __pydantic_generic_typevars_map__: typing.ClassVar[dict[_typing_extra.TypeVarType, Any] | None]\n __pydantic_parent_namespace__: typing.ClassVar[dict[str, Any] | None]\n else:\n __pydantic_validator__ = _model_construction.MockValidator(\n 'Pydantic models should inherit from BaseModel, BaseModel cannot be instantiated directly'\n )\n\n model_config = ConfigDict()\n __slots__ = '__dict__', '__fields_set__'\n __doc__ = '' # Null out the Representation docstring\n __pydantic_model_complete__ = False\n\n def __init__(__pydantic_self__, **data: Any) -> None:\n \"\"\"\n Create a new model by parsing and validating input data from keyword arguments.\n\n Raises ValidationError if the input data cannot be parsed to form a valid model.\n\n Uses something other than `self` for the first arg to allow \"self\" as a field name.\n \"\"\"\n # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\n __tracebackhide__ = True\n __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: type[BaseModel], gen_schema: GenerateSchema) -> CoreSchema:\n return gen_schema.model_schema(cls)\n\n @classmethod\n def model_validate(\n cls: type[Model], obj: Any, *, strict: bool | None = None, context: dict[str, Any] | None = None\n ) -> Model:\n # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\n __tracebackhide__ = True\n return cls.__pydantic_validator__.validate_python(obj, strict=strict, context=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_pydantic__pydantic/pydantic/main.py_BaseModel.model_validate_json_BaseModel.None_1.model_post_init.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_validate_json_BaseModel.None_1.model_post_init.pass", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 237, "span_ids": ["BaseModel.model_validate_json", "BaseModel:31"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def model_validate_json(\n cls: type[Model],\n json_data: str | bytes | bytearray,\n *,\n strict: bool | None = None,\n context: dict[str, Any] | None = None,\n ) -> Model:\n # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\n __tracebackhide__ = True\n return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)\n\n if typing.TYPE_CHECKING:\n # model_after_init is called after at the end of `__init__` if it's defined\n def model_post_init(self, _context: Any) -> 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_pydantic__pydantic/pydantic/main.py_BaseModel.__setattr___BaseModel.__setattr__.if_name_startswith___.else_.self___fields_set___add_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__setattr___BaseModel.__setattr__.if_name_startswith___.else_.self___fields_set___add_n", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 239, "end_line": 256, "span_ids": ["BaseModel.__setattr__"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def __setattr__(self, name: str, value: Any) -> None:\n if name in self.__class_vars__:\n raise AttributeError(\n f'\"{name}\" is a ClassVar of `{self.__class__.__name__}` and cannot be set on an instance. '\n f'If you want to set a value on the class, use `{self.__class__.__name__}.{name} = value`.'\n )\n if name.startswith('_'):\n _object_setattr(self, name, value)\n elif self.model_config['frozen']:\n raise TypeError(f'\"{self.__class__.__name__}\" is frozen and does not support item assignment')\n elif self.model_config['validate_assignment']:\n self.__pydantic_validator__.validate_assignment(self, name, value)\n elif self.model_config['extra'] is not Extra.allow and name not in self.model_fields:\n # TODO - matching error\n raise ValueError(f'\"{self.__class__.__name__}\" object has no field \"{name}\"')\n else:\n self.__dict__[name] = value\n self.__fields_set__.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_pydantic__pydantic/pydantic/main.py_BaseModel.__getstate___BaseModel.__setstate__.for_name_value_in_state_._object_setattr_self_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__getstate___BaseModel.__setstate__.for_name_value_in_state_._object_setattr_self_nam", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 270, "span_ids": ["BaseModel.__setstate__", "BaseModel.__getstate__"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def __getstate__(self) -> dict[Any, Any]:\n private_attrs = ((k, getattr(self, k, Undefined)) for k in self.__private_attributes__)\n return {\n '__dict__': self.__dict__,\n '__fields_set__': self.__fields_set__,\n '__private_attribute_values__': {k: v for k, v in private_attrs if v is not Undefined},\n }\n\n def __setstate__(self, state: dict[Any, Any]) -> None:\n _object_setattr(self, '__dict__', state['__dict__'])\n _object_setattr(self, '__fields_set__', state['__fields_set__'])\n for name, value in state.get('__private_attribute_values__', {}).items():\n _object_setattr(self, name, 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_pydantic__pydantic/pydantic/main.py_BaseModel.model_dump_BaseModel.model_dump.return.self___pydantic_serialize": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_dump_BaseModel.model_dump.return.self___pydantic_serialize", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 272, "end_line": 299, "span_ids": ["BaseModel.model_dump"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def model_dump(\n self,\n *,\n mode: typing_extensions.Literal['json', 'python'] | str = 'python',\n include: IncEx = None,\n exclude: IncEx = None,\n by_alias: bool = False,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n round_trip: bool = False,\n warnings: bool = True,\n ) -> dict[str, Any]:\n \"\"\"\n Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.\n \"\"\"\n return self.__pydantic_serializer__.to_python(\n self,\n mode=mode,\n by_alias=by_alias,\n include=include,\n exclude=exclude,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_none,\n round_trip=round_trip,\n warnings=warnings,\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_pydantic__pydantic/pydantic/main.py_BaseModel.model_dump_json_BaseModel.model_dump_json.return.self___pydantic_serialize": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_dump_json_BaseModel.model_dump_json.return.self___pydantic_serialize", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 328, "span_ids": ["BaseModel.model_dump_json"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def model_dump_json(\n self,\n *,\n indent: int | None = None,\n include: IncEx = None,\n exclude: IncEx = None,\n by_alias: bool = False,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n round_trip: bool = False,\n warnings: bool = True,\n ) -> str:\n \"\"\"\n Generate a JSON representation of the model, `include` and `exclude` arguments as per `dict()`.\n \"\"\"\n return self.__pydantic_serializer__.to_json(\n self,\n indent=indent,\n include=include,\n exclude=exclude,\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_none,\n round_trip=round_trip,\n warnings=warnings,\n ).decode()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_construct_BaseModel.model_construct.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_construct_BaseModel.model_construct.return.m", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 330, "end_line": 353, "span_ids": ["BaseModel.model_construct"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def model_construct(cls: type[Model], _fields_set: set[str] | None = None, **values: Any) -> Model:\n \"\"\"\n Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.\n Default values are respected, but no other validation is performed.\n Behaves as if `Config.extra = 'allow'` was set since it adds all passed values\n \"\"\"\n m = cls.__new__(cls)\n fields_values: dict[str, Any] = {}\n for name, field in cls.model_fields.items():\n if field.alias and field.alias in values:\n fields_values[name] = values[field.alias]\n elif name in values:\n fields_values[name] = values[name]\n elif not field.is_required():\n fields_values[name] = field.get_default(call_default_factory=True)\n fields_values.update(values)\n _object_setattr(m, '__dict__', fields_values)\n if _fields_set is None:\n _fields_set = set(values.keys())\n _object_setattr(m, '__fields_set__', _fields_set)\n if hasattr(m, '__pydantic_post_init__'):\n m.__pydantic_post_init__(context=None)\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_pydantic__pydantic/pydantic/main.py_BaseModel.model_json_schema_BaseModel.model_json_schema.return.model_json_schema_cls_by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_json_schema_BaseModel.model_json_schema.return.model_json_schema_cls_by", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 367, "span_ids": ["BaseModel.model_json_schema"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def model_json_schema(\n cls,\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n ) -> dict[str, Any]:\n \"\"\"\n To override the logic used to generate the JSON schema, you can create a subclass of GenerateJsonSchema\n with your desired modifications, then override this method on a custom base class and set the default\n value of `schema_generator` to be your subclass.\n \"\"\"\n return model_json_schema(cls, by_alias=by_alias, ref_template=ref_template, schema_generator=schema_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_pydantic__pydantic/pydantic/main.py_BaseModel.model_modify_json_schema_BaseModel.model_modify_json_schema.return._metadata_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_modify_json_schema_BaseModel.model_modify_json_schema.return._metadata_json_schem", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 382, "span_ids": ["BaseModel.model_modify_json_schema"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def model_modify_json_schema(cls, json_schema: JsonSchemaValue) -> JsonSchemaValue:\n \"\"\"\n Overriding this method provides a simple way to modify the JSON schema generated for the model.\n\n This is a convenience method primarily intended to control how the \"generic\" properties of the JSON schema\n are populated. See https://json-schema.org/understanding-json-schema/reference/generic.html for more details.\n\n If you want to make more sweeping changes to how the JSON schema is generated, you will probably want to create\n a subclass of `GenerateJsonSchema` and pass it as `schema_generator` in `BaseModel.model_json_schema`.\n \"\"\"\n metadata = {'title': cls.model_config['title'] or cls.__name__, 'description': getdoc(cls) or None}\n metadata = {k: v for k, v in metadata.items() if v is not None}\n return {**metadata, **json_schema}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_rebuild_BaseModel.model_rebuild.if_not_force_and_cls___py.else_.return._model_construction_compl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_rebuild_BaseModel.model_rebuild.if_not_force_and_cls___py.else_.return._model_construction_compl", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 411, "span_ids": ["BaseModel.model_rebuild"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def model_rebuild(\n cls,\n *,\n force: bool = False,\n raise_errors: bool = True,\n _parent_namespace_depth: int = 2,\n ) -> bool | None:\n \"\"\"\n Try to (Re)construct the model schema.\n \"\"\"\n if not force and cls.__pydantic_model_complete__:\n return None\n else:\n if _parent_namespace_depth > 0:\n frame_parent_ns = _typing_extra.parent_frame_namespace(parent_depth=_parent_namespace_depth) or {}\n cls_parent_ns = cls.__pydantic_parent_namespace__ or {}\n cls.__pydantic_parent_namespace__ = {**cls_parent_ns, **frame_parent_ns}\n\n types_namespace = cls.__pydantic_parent_namespace__\n\n types_namespace = _model_construction.get_model_types_namespace(cls, types_namespace)\n return _model_construction.complete_model_class(\n cls,\n cls.__name__,\n types_namespace,\n raise_errors=raise_errors,\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_pydantic__pydantic/pydantic/main.py_BaseModel.__iter___BaseModel.__eq__.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__iter___BaseModel.__eq__.return.True", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 413, "end_line": 440, "span_ids": ["BaseModel.__iter__", "BaseModel.__eq__"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def __iter__(self) -> TupleGenerator:\n \"\"\"\n so `dict(model)` works\n \"\"\"\n yield from self.__dict__.items()\n\n def __eq__(self, other: Any) -> bool:\n if not isinstance(other, BaseModel):\n return False\n\n # When comparing instances of generic types for equality, as long as all field values are equal,\n # only require their generic origin types to be equal, rather than exact type equality.\n # This prevents headaches like MyGeneric(x=1) != MyGeneric[Any](x=1).\n self_type = getattr(self, '__pydantic_generic_origin__', None) or self.__class__\n other_type = getattr(other, '__pydantic_generic_origin__', None) or other.__class__\n\n if self_type != other_type:\n return False\n\n if self.__dict__ != other.__dict__:\n return False\n\n # If the types and field values match, check for equality of private attributes\n for k in self.__private_attributes__:\n if getattr(self, k, Undefined) != getattr(other, k, Undefined):\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_pydantic__pydantic/pydantic/main.py_BaseModel.model_copy_BaseModel.__copy__.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_copy_BaseModel.__copy__.return.m", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 442, "end_line": 469, "span_ids": ["BaseModel.__copy__", "BaseModel.model_copy"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def model_copy(self: Model, *, update: dict[str, Any] | None = None, deep: bool = False) -> Model:\n \"\"\"\n Returns a copy of the model.\n\n :param update: values to change/add in the new model. Note: the data is not validated before creating\n the new model: you should trust this data\n :param deep: set to `True` to make a deep copy of the model\n :return: new model instance\n \"\"\"\n copied = self.__deepcopy__() if deep else self.__copy__()\n if update:\n copied.__dict__.update(update)\n copied.__fields_set__.update(update.keys())\n return copied\n\n def __copy__(self: Model) -> Model:\n \"\"\"\n Returns a shallow copy of the model\n \"\"\"\n cls = type(self)\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', copy(self.__dict__))\n _object_setattr(m, '__fields_set__', copy(self.__fields_set__))\n for name in self.__private_attributes__:\n value = getattr(self, name, Undefined)\n if value is not Undefined:\n _object_setattr(m, name, value)\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_pydantic__pydantic/pydantic/main.py_BaseModel.__deepcopy___BaseModel.__repr_args__.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__deepcopy___BaseModel.__repr_args__.return._", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 471, "end_line": 492, "span_ids": ["BaseModel.__deepcopy__", "BaseModel.__repr_args__"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def __deepcopy__(self: Model, memo: dict[int, Any] | None = None) -> Model:\n \"\"\"\n Returns a deep copy of the model\n \"\"\"\n cls = type(self)\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', deepcopy(self.__dict__, memo=memo))\n # This next line doesn't need a deepcopy because __fields_set__ is a set[str],\n # and attempting a deepcopy would be marginally slower.\n _object_setattr(m, '__fields_set__', copy(self.__fields_set__))\n for name in self.__private_attributes__:\n value = getattr(self, name, Undefined)\n if value is not Undefined:\n _object_setattr(m, name, deepcopy(value, memo=memo))\n return m\n\n def __repr_args__(self) -> _repr.ReprArgs:\n return [\n (k, v)\n for k, v in self.__dict__.items()\n if not k.startswith('_') and (k not in self.model_fields or self.model_fields[k].repr)\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_pydantic__pydantic/pydantic/main.py_BaseModel.__class_getitem___BaseModel.__class_getitem__.return.submodel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__class_getitem___BaseModel.__class_getitem__.return.submodel", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 494, "end_line": 556, "span_ids": ["BaseModel.__class_getitem__"], "tokens": 650}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def __class_getitem__(\n cls, typevar_values: type[Any] | tuple[type[Any], ...]\n ) -> type[BaseModel] | _forward_ref.PydanticForwardRef | _forward_ref.PydanticRecursiveRef:\n cached = _generics.get_cached_generic_type_early(cls, typevar_values)\n if cached is not None:\n return cached\n\n if cls is BaseModel:\n raise TypeError('Type parameters should be placed on typing.Generic, not BaseModel')\n if not hasattr(cls, '__parameters__'):\n raise TypeError(f'{cls} cannot be parametrized because it does not inherit from typing.Generic')\n if not cls.__pydantic_generic_parameters__ and Generic not in cls.__bases__:\n raise TypeError(f'{cls} is not a generic class')\n\n if not isinstance(typevar_values, tuple):\n typevar_values = (typevar_values,)\n _generics.check_parameters_count(cls, typevar_values)\n\n # Build map from generic typevars to passed params\n typevars_map: dict[_typing_extra.TypeVarType, type[Any]] = dict(\n zip(cls.__pydantic_generic_parameters__ or (), typevar_values)\n )\n\n if _utils.all_identical(typevars_map.keys(), typevars_map.values()) and typevars_map:\n submodel = cls # if arguments are equal to parameters it's the same object\n _generics.set_cached_generic_type(cls, typevar_values, submodel)\n else:\n parent_args = cls.__pydantic_generic_args__\n if not parent_args:\n args = typevar_values\n else:\n args = tuple(_generics.replace_types(arg, typevars_map) for arg in parent_args)\n\n origin = cls.__pydantic_generic_origin__ or cls\n model_name = origin.model_parametrized_name(args)\n params = tuple(\n {param: None for param in _generics.iter_contained_typevars(typevars_map.values())}\n ) # use dict as ordered set\n\n with _generics.generic_recursion_self_type(origin, args) as maybe_self_type:\n if maybe_self_type is not None:\n return maybe_self_type\n\n cached = _generics.get_cached_generic_type_late(cls, typevar_values, origin, args)\n if cached is not None:\n return cached\n\n # Attempt to rebuild the origin in case new types have been defined\n try:\n # depth 3 gets you above this __class_getitem__ call\n origin.model_rebuild(_parent_namespace_depth=3)\n except PydanticUndefinedAnnotation:\n # It's okay if it fails, it just means there are still undefined types\n # that could be evaluated later.\n # TODO: Presumably we should error if validation is attempted here?\n pass\n\n submodel = _generics.create_generic_submodel(model_name, origin, args, params)\n\n # Update cache\n _generics.set_cached_generic_type(cls, typevar_values, submodel, origin, args)\n\n return submodel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_parametrized_name_BaseModel.model_parametrized_name.return.f_cls___name___params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_parametrized_name_BaseModel.model_parametrized_name.return.f_cls___name___params_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 558, "end_line": 579, "span_ids": ["BaseModel.model_parametrized_name"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def model_parametrized_name(cls, params: tuple[type[Any], ...]) -> str:\n \"\"\"\n Compute class name for parametrizations of generic classes.\n\n :param params: Tuple of types of the class . Given a generic class\n `Model` with 2 type variables and a concrete model `Model[str, int]`,\n the value `(str, int)` would be passed to `params`.\n :return: String representing the new class where `params` are\n passed to `cls` as type variables.\n\n This method can be overridden to achieve a custom naming scheme for generic BaseModels.\n \"\"\"\n if not issubclass(cls, Generic): # type: ignore[arg-type]\n raise TypeError('Concrete names should only be generated for generic models.')\n\n # Any strings received should represent forward references, so we handle them specially below.\n # If we eventually move toward wrapping them in a ForwardRef in __class_getitem__ in the future,\n # we may be able to remove this special case.\n param_names = [param if isinstance(param, str) else _repr.display_as_type(param) for param in params]\n params_component = ', '.join(param_names)\n return f'{cls.__name__}[{params_component}]'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._Deprecated_method_BaseModel.dict.return.self_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._Deprecated_method_BaseModel.dict.return.self_model_dump_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 581, "end_line": 600, "span_ids": ["BaseModel.model_parametrized_name", "BaseModel.dict"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n # ##### Deprecated methods from v1 #####\n def dict(\n self,\n *,\n include: IncEx = None,\n exclude: IncEx = None,\n by_alias: bool = False,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n ) -> typing.Dict[str, Any]: # noqa UP006\n warnings.warn('The `dict` method is deprecated; use `model_dump` instead.', DeprecationWarning)\n return self.model_dump(\n include=include,\n exclude=exclude,\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_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_pydantic__pydantic/pydantic/main.py_BaseModel.json_BaseModel.parse_obj.return.cls_model_validate_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.json_BaseModel.parse_obj.return.cls_model_validate_obj_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 602, "end_line": 636, "span_ids": ["BaseModel.json", "BaseModel.parse_obj"], "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": "class BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def json(\n self,\n *,\n include: IncEx = None,\n exclude: IncEx = None,\n by_alias: bool = False,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n # TODO: What do we do about the following arguments?\n # Do they need to go on model_config now, and get used by the serializer?\n encoder: typing.Callable[[Any], Any] | None = Undefined, # type: ignore[assignment]\n models_as_dict: bool = Undefined, # type: ignore[assignment]\n **dumps_kwargs: Any,\n ) -> str:\n warnings.warn('The `json` method is deprecated; use `model_dump_json` instead.', DeprecationWarning)\n if encoder is not Undefined:\n raise TypeError('The `encoder` argument is no longer supported; use field serializers instead.')\n if models_as_dict is not Undefined:\n raise TypeError('The `models_as_dict` argument is no longer supported; use a model serializer instead.')\n if dumps_kwargs:\n raise TypeError('`dumps_kwargs` keyword arguments are no longer supported.')\n return self.model_dump_json(\n include=include,\n exclude=exclude,\n by_alias=by_alias,\n exclude_unset=exclude_unset,\n exclude_defaults=exclude_defaults,\n exclude_none=exclude_none,\n )\n\n @classmethod\n def parse_obj(cls: type[Model], obj: Any) -> Model:\n warnings.warn('The `parse_obj` method is deprecated; use `model_validate` instead.', DeprecationWarning)\n return cls.model_validate(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_pydantic__pydantic/pydantic/main.py_BaseModel.parse_raw_BaseModel.parse_raw.return.cls_model_validate_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.parse_raw_BaseModel.parse_raw.return.cls_model_validate_obj_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 638, "end_line": 681, "span_ids": ["BaseModel.parse_raw"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def parse_raw(\n cls: type[Model],\n b: str | bytes,\n *,\n content_type: str = None,\n encoding: str = 'utf8',\n proto: _deprecated_parse.Protocol = None,\n allow_pickle: bool = False,\n ) -> Model:\n warnings.warn(\n 'The `parse_raw` method is deprecated; if your data is JSON use `model_json_validate`, '\n 'otherwise load the data then use `model_validate` instead.',\n DeprecationWarning,\n )\n try:\n obj = _deprecated_parse.load_str_bytes(\n b,\n proto=proto,\n content_type=content_type,\n encoding=encoding,\n allow_pickle=allow_pickle,\n )\n except (ValueError, TypeError) as exc:\n import json\n\n # try to match V1\n if isinstance(exc, UnicodeDecodeError):\n type_str = 'value_error.unicodedecode'\n elif isinstance(exc, json.JSONDecodeError):\n type_str = 'value_error.jsondecode'\n elif isinstance(exc, ValueError):\n type_str = 'value_error'\n else:\n type_str = 'type_error'\n\n # ctx is missing here, but since we've added `input` to the error, we're not pretending it's the same\n error: pydantic_core.InitErrorDetails = {\n 'type': pydantic_core.PydanticCustomError(type_str, str(exc)),\n 'loc': ('__root__',),\n 'input': b,\n }\n raise pydantic_core.ValidationError(cls.__name__, [error])\n return cls.model_validate(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_pydantic__pydantic/pydantic/main.py_BaseModel.parse_file_BaseModel.parse_file.return.cls_parse_obj_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.parse_file_BaseModel.parse_file.return.cls_parse_obj_obj_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 683, "end_line": 705, "span_ids": ["BaseModel.parse_file"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def parse_file(\n cls: type[Model],\n path: str | Path,\n *,\n content_type: str = None,\n encoding: str = 'utf8',\n proto: _deprecated_parse.Protocol = None,\n allow_pickle: bool = False,\n ) -> Model:\n warnings.warn(\n 'The `parse_file` method is deprecated; load the data from file, then if your data is JSON '\n 'use `model_json_validate` otherwise `model_validate` instead.',\n DeprecationWarning,\n )\n obj = _deprecated_parse.load_file(\n path,\n proto=proto,\n content_type=content_type,\n encoding=encoding,\n allow_pickle=allow_pickle,\n )\n return cls.parse_obj(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_pydantic__pydantic/pydantic/main.py_BaseModel.from_orm_BaseModel.construct.return.cls_model_construct__fiel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.from_orm_BaseModel.construct.return.cls_model_construct__fiel", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 707, "end_line": 721, "span_ids": ["BaseModel.from_orm", "BaseModel.construct"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def from_orm(cls: type[Model], obj: Any) -> Model:\n warnings.warn(\n 'The `from_orm` method is deprecated; set model_config[\"from_attributes\"]=True '\n 'and use `model_validate` instead.',\n DeprecationWarning,\n )\n if not cls.model_config['from_attributes']:\n raise PydanticUserError('You must set the config attribute `from_attributes=True` to use from_orm')\n return cls.model_validate(obj)\n\n @classmethod\n def construct(cls: type[Model], _fields_set: set[str] | None = None, **values: Any) -> Model:\n warnings.warn('The `construct` method is deprecated; use `model_construct` instead.', DeprecationWarning)\n return cls.model_construct(_fields_set=_fields_set, **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_pydantic__pydantic/pydantic/main.py_BaseModel.copy_BaseModel.copy.return._deprecated_copy_internal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.copy_BaseModel.copy.return._deprecated_copy_internal", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 723, "end_line": 761, "span_ids": ["BaseModel.copy"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n def copy(\n self: Model,\n *,\n include: AbstractSetIntStr | MappingIntStrAny | None = None,\n exclude: AbstractSetIntStr | MappingIntStrAny | None = None,\n update: typing.Dict[str, Any] | None = None, # noqa UP006\n deep: bool = False,\n ) -> Model:\n \"\"\"\n This method is now deprecated; use `model_copy` instead. If you need include / exclude, use:\n\n data = self.model_dump(include=include, exclude=exclude, round_trip=True)\n data = {**data, **(update or {})}\n copied = self.model_validate(data)\n \"\"\"\n warnings.warn(\n 'The `copy` method is deprecated; use `model_copy` instead. '\n 'See the docstring of `BaseModel.copy` for details about how to handle `include` and `exclude`.',\n DeprecationWarning,\n )\n\n values = dict(\n _deprecated_copy_internals._iter(\n self, to_dict=False, by_alias=False, include=include, exclude=exclude, exclude_unset=False\n ),\n **(update or {}),\n )\n\n # new `__fields_set__` can have unset optional fields with a set value in `update` kwarg\n if update:\n fields_set = self.__fields_set__ | update.keys()\n else:\n fields_set = set(self.__fields_set__)\n\n # removing excluded fields from `__fields_set__`\n if exclude:\n fields_set -= set(exclude)\n\n return _deprecated_copy_internals._copy_and_set_values(self, values, fields_set, deep=deep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_BaseModel.schema_json.return.json_dumps_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_BaseModel.schema_json.return.json_dumps_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 763, "end_line": 786, "span_ids": ["BaseModel.schema", "BaseModel.schema_json"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def schema(\n cls, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE\n ) -> typing.Dict[str, Any]: # noqa UP006\n warnings.warn('The `schema` method is deprecated; use `model_json_schema` instead.', DeprecationWarning)\n return cls.model_json_schema(by_alias=by_alias, ref_template=ref_template)\n\n @classmethod\n def schema_json(\n cls, *, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, **dumps_kwargs: Any\n ) -> str:\n import json\n\n warnings.warn(\n 'The `schema_json` method is deprecated; use `model_json_schema` and json.dumps instead.',\n DeprecationWarning,\n )\n from .deprecated.json import pydantic_encoder\n\n return json.dumps(\n cls.model_json_schema(by_alias=by_alias, ref_template=ref_template),\n default=pydantic_encoder,\n **dumps_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_pydantic__pydantic/pydantic/main.py_BaseModel.validate_BaseModel._calculate_keys.return._deprecated_copy_internal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.validate_BaseModel._calculate_keys.return._deprecated_copy_internal", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 788, "end_line": 824, "span_ids": ["BaseModel._get_value", "BaseModel._iter", "BaseModel._copy_and_set_values", "BaseModel._calculate_keys", "BaseModel.validate", "BaseModel.update_forward_refs"], "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 BaseModel(_repr.Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def validate(cls: type[Model], value: Any) -> Model:\n warnings.warn('The `validate` method is deprecated; use `model_validate` instead.', DeprecationWarning)\n return cls.model_validate(value)\n\n @classmethod\n def update_forward_refs(cls, **localns: Any) -> None:\n warnings.warn(\n 'The `update_forward_refs` method is deprecated; use `model_rebuild` instead.', DeprecationWarning\n )\n if localns:\n raise TypeError('`localns` arguments are not longer accepted.')\n cls.model_rebuild(force=True)\n\n def _iter(self, *args: Any, **kwargs: Any) -> Any:\n warnings.warn('The private method `_iter` will be removed and should no longer be used.', DeprecationWarning)\n return _deprecated_copy_internals._iter(self, *args, **kwargs)\n\n def _copy_and_set_values(self, *args: Any, **kwargs: Any) -> Any:\n warnings.warn(\n 'The private method `_copy_and_set_values` will be removed and should no longer be used.',\n DeprecationWarning,\n )\n return _deprecated_copy_internals._copy_and_set_values(self, *args, **kwargs)\n\n @classmethod\n def _get_value(cls, *args: Any, **kwargs: Any) -> Any:\n warnings.warn(\n 'The private method `_get_value` will be removed and should no longer be used.', DeprecationWarning\n )\n return _deprecated_copy_internals._get_value(cls, *args, **kwargs)\n\n def _calculate_keys(self, *args: Any, **kwargs: Any) -> Any:\n warnings.warn(\n 'The private method `_calculate_keys` will be removed and should no longer be used.', DeprecationWarning\n )\n return _deprecated_copy_internals._calculate_keys(self, *args, **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_pydantic__pydantic/pydantic/main.py__base_class_defined_3_create_model_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__base_class_defined_3_create_model_1._", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 827, "end_line": 855, "span_ids": ["create_model", "impl:18", "create_model_1"], "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": "_base_class_defined = True\n\n\n@typing.overload\ndef create_model(\n __model_name: str,\n *,\n __config__: ConfigDict | type[BaseConfig] | None = None,\n __base__: None = None,\n __module__: str = __name__,\n __validators__: dict[str, AnyClassMethod] = None,\n __cls_kwargs__: dict[str, Any] = None,\n **field_definitions: Any,\n) -> type[Model]:\n ...\n\n\n@typing.overload\ndef create_model(\n __model_name: str,\n *,\n __config__: ConfigDict | type[BaseConfig] | None = None,\n __base__: type[Model] | tuple[type[Model], ...],\n __module__: str = __name__,\n __validators__: dict[str, AnyClassMethod] = None,\n __cls_kwargs__: dict[str, Any] = None,\n **field_definitions: Any,\n) -> type[Model]:\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_pydantic__pydantic/pydantic/main.py_create_model_2_create_model_2.return.meta___model_name_resolv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_2_create_model_2.return.meta___model_name_resolv", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 858, "end_line": 932, "span_ids": ["create_model_2"], "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": "def create_model(\n __model_name: str,\n *,\n __config__: ConfigDict | type[BaseConfig] | None = None,\n __base__: type[Model] | tuple[type[Model], ...] | None = None,\n __module__: str = __name__,\n __validators__: dict[str, AnyClassMethod] = None,\n __cls_kwargs__: dict[str, Any] = None,\n __slots__: tuple[str, ...] | None = None,\n **field_definitions: Any,\n) -> type[Model]:\n \"\"\"\n Dynamically create a model.\n :param __model_name: name of the created model\n :param __config__: config dict/class to use for the new model\n :param __base__: base class for the new model to inherit from\n :param __module__: module of the created model\n :param __validators__: a dict of method names and @validator class methods\n :param __cls_kwargs__: a dict for class creation\n :param __slots__: Deprecated, `__slots__` should not be passed to `create_model`\n :param field_definitions: fields of the model (or extra fields if a base is supplied)\n in the format `=(, )` or `=, e.g.\n `foobar=(str, ...)` or `foobar=123`, or, for complex use-cases, in the format\n `=` or `=(, )`, e.g.\n `foo=Field(datetime, default_factory=datetime.utcnow, alias='bar')` or\n `foo=(str, FieldInfo(title='Foo'))`\n \"\"\"\n if __slots__ is not None:\n # __slots__ will be ignored from here on\n warnings.warn('__slots__ should not be passed to create_model', RuntimeWarning)\n\n if __base__ is not None:\n if __config__ is not None:\n raise PydanticUserError('to avoid confusion __config__ and __base__ cannot be used together')\n if not isinstance(__base__, tuple):\n __base__ = (__base__,)\n else:\n __base__ = (typing.cast(typing.Type['Model'], BaseModel),)\n\n __cls_kwargs__ = __cls_kwargs__ or {}\n\n fields = {}\n annotations = {}\n\n for f_name, f_def in field_definitions.items():\n if f_name.startswith('_'):\n warnings.warn(f'fields may not start with an underscore, ignoring \"{f_name}\"', RuntimeWarning)\n if isinstance(f_def, tuple):\n try:\n f_annotation, f_value = f_def\n except ValueError as e:\n raise PydanticUserError(\n 'field definitions should either be a tuple of (, ) or just a '\n 'default value, unfortunately this means tuples as '\n 'default values are not allowed'\n ) from e\n else:\n f_annotation, f_value = None, f_def\n\n if f_annotation:\n annotations[f_name] = f_annotation\n fields[f_name] = f_value\n\n namespace: dict[str, Any] = {'__annotations__': annotations, '__module__': __module__}\n if __validators__:\n namespace.update(__validators__)\n namespace.update(fields)\n if __config__:\n namespace['model_config'] = get_config(__config__, __model_name)\n resolved_bases = resolve_bases(__base__)\n meta, ns, kwds = prepare_class(__model_name, resolved_bases, kwds=__cls_kwargs__)\n if resolved_bases is not __base__:\n ns['__orig_bases__'] = __base__\n namespace.update(ns)\n return meta(__model_name, resolved_bases, namespace, __pydantic_reset_parent_namespace__=False, **kwds)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__collect_bases_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__collect_bases_data_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 935, "end_line": 946, "span_ids": ["_collect_bases_data"], "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 _collect_bases_data(bases: tuple[type[Any], ...]) -> tuple[set[str], set[str], dict[str, ModelPrivateAttr]]:\n field_names: set[str] = set()\n class_vars: set[str] = set()\n private_attributes: dict[str, ModelPrivateAttr] = {}\n for base in bases:\n if _base_class_defined and issubclass(base, BaseModel) and base != BaseModel:\n # model_fields might not be defined yet in the case of generics, so we use getattr here:\n field_names.update(getattr(base, 'model_fields', {}).keys())\n class_vars.update(base.__class_vars__)\n private_attributes.update(base.__private_attributes__)\n return field_names, class_vars, private_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_pydantic__pydantic/pydantic/mypy.py_from___future___import_an_plugin.return.PydanticPlugin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_from___future___import_an_plugin.return.PydanticPlugin", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 109, "span_ids": ["imports", "impl:17", "plugin", "parse_mypy_version"], "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": "from __future__ import annotations\n\nimport sys\nfrom configparser import ConfigParser\nfrom typing import Any, Callable\n\nfrom mypy.errorcodes import ErrorCode\nfrom mypy.nodes import (\n ARG_NAMED,\n ARG_NAMED_OPT,\n ARG_OPT,\n ARG_POS,\n ARG_STAR2,\n MDEF,\n Argument,\n AssignmentStmt,\n Block,\n CallExpr,\n ClassDef,\n Context,\n Decorator,\n EllipsisExpr,\n Expression,\n FuncBase,\n FuncDef,\n JsonDict,\n MemberExpr,\n NameExpr,\n PassStmt,\n PlaceholderNode,\n RefExpr,\n Statement,\n StrExpr,\n SymbolNode,\n SymbolTableNode,\n TempNode,\n TypeInfo,\n TypeVarExpr,\n Var,\n)\nfrom mypy.options import Options\nfrom mypy.plugin import (\n CheckerPluginInterface,\n ClassDefContext,\n FunctionContext,\n MethodContext,\n Plugin,\n ReportConfigContext,\n SemanticAnalyzerPluginInterface,\n)\nfrom mypy.plugins import dataclasses\nfrom mypy.semanal import set_callable_name\nfrom mypy.server.trigger import make_wildcard_trigger\nfrom mypy.types import (\n AnyType,\n CallableType,\n Instance,\n NoneType,\n Overloaded,\n Type,\n TypeOfAny,\n TypeType,\n TypeVarType,\n UnionType,\n get_proper_type,\n)\nfrom mypy.typevars import fill_typevars\nfrom mypy.util import get_unique_redefinition_name\nfrom mypy.version import __version__ as mypy_version\n\ntry:\n from mypy.types import TypeVarDef # type: ignore[attr-defined]\nexcept ImportError: # pragma: no cover\n # Backward-compatible with TypeVarDef from Mypy 0.930.\n from mypy.types import TypeVarType as TypeVarDef\n\nCONFIGFILE_KEY = 'pydantic-mypy'\nMETADATA_KEY = 'pydantic-mypy-metadata'\nBASEMODEL_FULLNAME = 'pydantic.main.BaseModel'\nMODEL_METACLASS_FULLNAME = 'pydantic.main.ModelMetaclass'\nFIELD_FULLNAME = 'pydantic.fields.Field'\nDATACLASS_FULLNAME = 'pydantic.dataclasses.dataclass'\nDECORATOR_FULLNAMES = {\n 'pydantic.decorators.validator',\n 'pydantic.decorators.field_validator',\n 'pydantic.decorators.root_validator',\n 'pydantic.decorators.serializer',\n}\n\n\ndef parse_mypy_version(version: str) -> tuple[int, ...]:\n return tuple(map(int, version.partition('+')[0].split('.')))\n\n\nMYPY_VERSION_TUPLE = parse_mypy_version(mypy_version)\nBUILTINS_NAME = 'builtins' if MYPY_VERSION_TUPLE >= (0, 930) else '__builtins__'\n\n# Increment version if plugin changes and mypy caches should be invalidated\n__version__ = 2\n\n\ndef plugin(version: str) -> type[Plugin]:\n \"\"\"\n `version` is the mypy version string\n\n We might want to use this to print a warning if the mypy version being used is\n newer, or especially older, than we expect (or need).\n \"\"\"\n return PydanticPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin_PydanticPlugin._pydantic_model_class_maker_callback.transformer_transform_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin_PydanticPlugin._pydantic_model_class_maker_callback.transformer_transform_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 160, "span_ids": ["PydanticPlugin.__init__", "PydanticPlugin.get_method_hook", "PydanticPlugin._pydantic_model_class_maker_callback", "PydanticPlugin.get_function_hook", "PydanticPlugin.get_class_decorator_hook", "PydanticPlugin.get_base_class_hook", "PydanticPlugin.report_config_data", "PydanticPlugin.get_metaclass_hook", "PydanticPlugin"], "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 PydanticPlugin(Plugin):\n def __init__(self, options: Options) -> None:\n self.plugin_config = PydanticPluginConfig(options)\n self._plugin_data = self.plugin_config.to_data()\n super().__init__(options)\n\n def get_base_class_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:\n sym = self.lookup_fully_qualified(fullname)\n if sym and isinstance(sym.node, TypeInfo): # pragma: no branch\n # No branching may occur if the mypy cache has not been cleared\n if any(get_fullname(base) == BASEMODEL_FULLNAME for base in sym.node.mro):\n return self._pydantic_model_class_maker_callback\n return None\n\n def get_metaclass_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:\n if fullname == MODEL_METACLASS_FULLNAME:\n return self._pydantic_model_metaclass_marker_callback\n return None\n\n def get_function_hook(self, fullname: str) -> Callable[[FunctionContext], Type] | None:\n sym = self.lookup_fully_qualified(fullname)\n if sym and sym.fullname == FIELD_FULLNAME:\n return self._pydantic_field_callback\n return None\n\n def get_method_hook(self, fullname: str) -> Callable[[MethodContext], Type] | None:\n if fullname.endswith('.from_orm'):\n return from_attributes_callback\n return None\n\n def get_class_decorator_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:\n \"\"\"Mark pydantic.dataclasses as dataclass.\n\n Mypy version 1.1.1 added support for `@dataclass_transform` decorator.\n \"\"\"\n if fullname == DATACLASS_FULLNAME and MYPY_VERSION_TUPLE < (1, 1):\n return dataclasses.dataclass_class_maker_callback # type: ignore[return-value]\n return None\n\n def report_config_data(self, ctx: ReportConfigContext) -> dict[str, Any]:\n \"\"\"Return all plugin config data.\n\n Used by mypy to determine if cache needs to be discarded.\n \"\"\"\n return self._plugin_data\n\n def _pydantic_model_class_maker_callback(self, ctx: ClassDefContext) -> None:\n transformer = PydanticModelTransformer(ctx, self.plugin_config)\n transformer.transform()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin._pydantic_model_metaclass_marker_callback_PydanticPlugin._pydantic_model_metaclass_marker_callback.if_getattr_info_metaclass.info_metaclass.type.dataclass_transform_spec.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin._pydantic_model_metaclass_marker_callback_PydanticPlugin._pydantic_model_metaclass_marker_callback.if_getattr_info_metaclass.info_metaclass.type.dataclass_transform_spec.None", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 173, "span_ids": ["PydanticPlugin._pydantic_model_metaclass_marker_callback"], "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 PydanticPlugin(Plugin):\n\n def _pydantic_model_metaclass_marker_callback(self, ctx: ClassDefContext) -> None:\n \"\"\"Reset dataclass_transform_spec attribute of ModelMetaclass.\n\n Let the plugin handle it. This behavior can be disabled\n if 'debug_dataclass_transform' is set to True', for testing purposes.\n \"\"\"\n if self.plugin_config.debug_dataclass_transform:\n return\n info_metaclass = ctx.cls.info.declared_metaclass\n assert info_metaclass, \"callback not passed from 'get_metaclass_hook'\"\n if getattr(info_metaclass.type, 'dataclass_transform_spec', None):\n info_metaclass.type.dataclass_transform_spec = 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_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin._pydantic_field_callback_PydanticPlugin._pydantic_field_callback.return.default_any_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin._pydantic_field_callback_PydanticPlugin._pydantic_field_callback.return.default_any_type", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 222, "span_ids": ["PydanticPlugin._pydantic_field_callback"], "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": "class PydanticPlugin(Plugin):\n\n def _pydantic_field_callback(self, ctx: FunctionContext) -> Type:\n \"\"\"\n Extract the type of the `default` argument from the Field function, and use it as the return type.\n\n In particular:\n * Check whether the default and default_factory argument is specified.\n * Output an error if both are specified.\n * Retrieve the type of the argument which is specified, and use it as return type for the function.\n \"\"\"\n default_any_type = ctx.default_return_type\n\n assert ctx.callee_arg_names[0] == 'default', '\"default\" is no longer first argument in Field()'\n assert ctx.callee_arg_names[1] == 'default_factory', '\"default_factory\" is no longer second argument in Field()'\n default_args = ctx.args[0]\n default_factory_args = ctx.args[1]\n\n if default_args and default_factory_args:\n error_default_and_default_factory_specified(ctx.api, ctx.context)\n return default_any_type\n\n if default_args:\n default_type = ctx.arg_types[0][0]\n default_arg = default_args[0]\n\n # Fallback to default Any type if the field is required\n if not isinstance(default_arg, EllipsisExpr):\n return default_type\n\n elif default_factory_args:\n default_factory_type = ctx.arg_types[1][0]\n\n # Functions which use `ParamSpec` can be overloaded, exposing the callable's types as a parameter\n # Pydantic calls the default factory without any argument, so we retrieve the first item\n if isinstance(default_factory_type, Overloaded):\n default_factory_type = default_factory_type.items[0]\n\n if isinstance(default_factory_type, CallableType):\n ret_type = default_factory_type.ret_type\n # mypy doesn't think `ret_type` has `args`, you'd think mypy should know,\n # add this check in case it varies by version\n args = getattr(ret_type, 'args', None)\n if args:\n if all(isinstance(arg, TypeVarType) for arg in args):\n # Looks like the default factory is a type like `list` or `dict`, replace all args with `Any`\n ret_type.args = tuple(default_any_type for _ in args) # type: ignore[attr-defined]\n return ret_type\n\n return default_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_pydantic__pydantic/pydantic/mypy.py_PydanticPluginConfig_PydanticPluginConfig.to_data.return._key_getattr_self_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPluginConfig_PydanticPluginConfig.to_data.return._key_getattr_self_key_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 257, "span_ids": ["PydanticPluginConfig.__init__", "PydanticPluginConfig", "PydanticPluginConfig.to_data"], "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 PydanticPluginConfig:\n __slots__ = (\n 'init_forbid_extra',\n 'init_typed',\n 'warn_required_dynamic_aliases',\n 'debug_dataclass_transform',\n )\n init_forbid_extra: bool\n init_typed: bool\n warn_required_dynamic_aliases: bool\n debug_dataclass_transform: bool # undocumented\n\n def __init__(self, options: Options) -> None:\n if options.config_file is None: # pragma: no cover\n return\n\n toml_config = parse_toml(options.config_file)\n if toml_config is not None:\n config = toml_config.get('tool', {}).get('pydantic-mypy', {})\n for key in self.__slots__:\n setting = config.get(key, False)\n if not isinstance(setting, bool):\n raise ValueError(f'Configuration value must be a boolean for key: {key}')\n setattr(self, key, setting)\n else:\n plugin_config = ConfigParser()\n plugin_config.read(options.config_file)\n for key in self.__slots__:\n setting = plugin_config.getboolean(CONFIGFILE_KEY, key, fallback=False)\n setattr(self, key, setting)\n\n def to_data(self) -> dict[str, Any]:\n return {key: getattr(self, key) for key in self.__slots__}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_from_attributes_callback_from_attributes_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_from_attributes_callback_from_attributes_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 282, "span_ids": ["from_attributes_callback"], "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 from_attributes_callback(ctx: MethodContext) -> Type:\n \"\"\"\n Raise an error if from_attributes is not enabled\n \"\"\"\n model_type: Instance\n ctx_type = ctx.type\n if isinstance(ctx_type, TypeType):\n ctx_type = ctx_type.item\n if isinstance(ctx_type, CallableType) and isinstance(ctx_type.ret_type, Instance):\n model_type = ctx_type.ret_type # called on the class\n elif isinstance(ctx_type, Instance):\n model_type = ctx_type # called on an instance (unusual, but still valid)\n else: # pragma: no cover\n detail = f'ctx.type: {ctx_type} (of type {ctx_type.__class__.__name__})'\n error_unexpected_behavior(detail, ctx.api, ctx.context)\n return ctx.default_return_type\n pydantic_metadata = model_type.type.metadata.get(METADATA_KEY)\n if pydantic_metadata is None:\n return ctx.default_return_type\n from_attributes = pydantic_metadata.get('config', {}).get('from_attributes')\n if from_attributes is not True:\n error_from_attributes(get_name(model_type.type), ctx.api, 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer_PydanticModelTransformer.transform.info_metadata_METADATA_KE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer_PydanticModelTransformer.transform.info_metadata_METADATA_KE", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 285, "end_line": 324, "span_ids": ["PydanticModelTransformer.transform", "PydanticModelTransformer.__init__", "PydanticModelTransformer"], "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 PydanticModelTransformer:\n tracked_config_fields: set[str] = {\n 'extra',\n 'frozen',\n 'from_attributes',\n 'populate_by_name',\n 'alias_generator',\n }\n\n def __init__(self, ctx: ClassDefContext, plugin_config: PydanticPluginConfig) -> None:\n self._ctx = ctx\n self.plugin_config = plugin_config\n\n def transform(self) -> None:\n \"\"\"\n Configures the BaseModel subclass according to the plugin settings.\n\n In particular:\n * determines the model config and fields,\n * adds a fields-aware signature for the initializer and construct methods\n * freezes the class if frozen = True\n * stores the fields, config, and if the class is settings in the mypy metadata for access by subclasses\n \"\"\"\n ctx = self._ctx\n info = self._ctx.cls.info\n\n self.adjust_validator_signatures()\n config = self.collect_config()\n fields = self.collect_fields(config)\n for field in fields:\n if info[field.name].type is None:\n if not ctx.api.final_iteration:\n ctx.api.defer()\n self.add_initializer(fields, config)\n self.add_model_construct_method(fields)\n self.set_frozen(fields, frozen=config.frozen is True)\n info.metadata[METADATA_KEY] = {\n 'fields': {field.name: field.serialize() for field in fields},\n 'config': config.set_values_dict(),\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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.adjust_validator_signatures_PydanticModelTransformer.adjust_validator_signatures.for_name_sym_in_self__ct.if_isinstance_sym_node_D.if_.sym.node.func.is_class.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.adjust_validator_signatures_PydanticModelTransformer.adjust_validator_signatures.for_name_sym_in_self__ct.if_isinstance_sym_node_D.if_.sym.node.func.is_class.True", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 326, "end_line": 343, "span_ids": ["PydanticModelTransformer.adjust_validator_signatures"], "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 PydanticModelTransformer:\n\n def adjust_validator_signatures(self) -> None:\n \"\"\"\n When we decorate a function `f` with `pydantic.validator(...)`, `pydantic.field_validator`\n or `pydantic.serializer(...)`, mypy sees `f` as a regular method taking a `self` instance,\n even though pydantic internally wraps `f` with `classmethod` if necessary.\n\n Teach mypy this by marking any function whose outermost decorator is a `validator()`,\n `field_validator()` or `serializer()` call as a `classmethod`.\n \"\"\"\n for name, sym in self._ctx.cls.info.names.items():\n if isinstance(sym.node, Decorator):\n first_dec = sym.node.original_decorators[0]\n if (\n isinstance(first_dec, CallExpr)\n and isinstance(first_dec.callee, NameExpr)\n and first_dec.callee.fullname in DECORATOR_FULLNAMES\n ):\n sym.node.func.is_class = 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_config_PydanticModelTransformer.collect_config.return.config": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_config_PydanticModelTransformer.collect_config.return.config", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 345, "end_line": 410, "span_ids": ["PydanticModelTransformer.collect_config"], "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 PydanticModelTransformer:\n\n def collect_config(self) -> ModelConfigData: # noqa: C901 (ignore complexity)\n \"\"\"\n Collects the values of the config attributes that are used by the plugin, accounting for parent classes.\n \"\"\"\n ctx = self._ctx\n cls = ctx.cls\n config = ModelConfigData()\n\n has_config_kwargs = False\n has_config_from_namespace = False\n\n for name, expr in cls.keywords.items():\n config_data = self.get_config_update(name, expr)\n if config_data:\n has_config_kwargs = True\n config.update(config_data)\n\n for stmt in cls.defs.body:\n if not isinstance(stmt, (AssignmentStmt, ClassDef)):\n continue\n\n if isinstance(stmt, AssignmentStmt):\n lhs = stmt.lvalues[0]\n if not isinstance(lhs, NameExpr) or lhs.name != 'model_config' or not isinstance(stmt.rvalue, CallExpr):\n continue\n for arg_name, arg in zip(stmt.rvalue.arg_names, stmt.rvalue.args):\n if arg_name is None:\n continue\n config.update(self.get_config_update(arg_name, arg))\n\n if isinstance(stmt, ClassDef):\n if stmt.name != 'Config': # 'deprecated' Config-class\n continue\n for substmt in stmt.defs.body:\n if not isinstance(substmt, AssignmentStmt):\n continue\n lhs = substmt.lvalues[0]\n if not isinstance(lhs, NameExpr):\n continue\n config.update(self.get_config_update(lhs.name, substmt.rvalue))\n\n if has_config_kwargs:\n ctx.api.fail(\n 'Specifying config in two places is ambiguous, use either Config attribute or class kwargs',\n cls,\n )\n break\n\n has_config_from_namespace = True\n\n if has_config_kwargs or has_config_from_namespace:\n if (\n config.has_alias_generator\n and not config.populate_by_name\n and self.plugin_config.warn_required_dynamic_aliases\n ):\n error_required_dynamic_aliases(ctx.api, stmt)\n for info in cls.info.mro[1:]: # 0 is the current class\n if METADATA_KEY not in info.metadata:\n continue\n\n # Each class depends on the set of fields in its ancestors\n ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info)))\n for name, value in info.metadata[METADATA_KEY]['config'].items():\n config.setdefault(name, value)\n return config", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_fields_PydanticModelTransformer.collect_fields.return.all_fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_fields_PydanticModelTransformer.collect_fields.return.all_fields", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 412, "end_line": 446, "span_ids": ["PydanticModelTransformer.collect_fields"], "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 PydanticModelTransformer:\n\n def collect_fields(self, model_config: ModelConfigData) -> list[PydanticModelField]:\n \"\"\"\n Collects the fields for the model, accounting for parent classes\n \"\"\"\n # First, collect fields belonging to the current class.\n ctx = self._ctx\n cls = self._ctx.cls\n fields: list[PydanticModelField] = []\n known_fields: set[str] = set()\n for stmt in cls.defs.body:\n maybe_field = self.collect_field_from_stmt(stmt, model_config)\n if maybe_field is not None:\n fields.append(maybe_field)\n known_fields.add(maybe_field.name)\n\n all_fields = fields.copy()\n for info in cls.info.mro[1:]: # 0 is the current class, -2 is BaseModel, -1 is object\n if METADATA_KEY not in info.metadata:\n continue\n\n superclass_fields = []\n # Each class depends on the set of fields in its ancestors\n ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info)))\n\n for name, data in info.metadata[METADATA_KEY]['fields'].items():\n if name not in known_fields:\n field = PydanticModelField.deserialize(info, data)\n known_fields.add(name)\n superclass_fields.append(field)\n else:\n (field,) = (a for a in all_fields if a.name == name)\n all_fields.remove(field)\n superclass_fields.append(field)\n all_fields = superclass_fields + all_fields\n return all_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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_from_stmt_PydanticModelTransformer.collect_field_from_stmt.return.PydanticModelField_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_from_stmt_PydanticModelTransformer.collect_field_from_stmt.return.PydanticModelField_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 448, "end_line": 506, "span_ids": ["PydanticModelTransformer.collect_field_from_stmt"], "tokens": 576}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def collect_field_from_stmt(self, stmt: Statement, model_config: ModelConfigData) -> PydanticModelField | None:\n ctx = self._ctx\n cls = self._ctx.cls\n if not isinstance(stmt, AssignmentStmt):\n return None\n\n lhs = stmt.lvalues[0]\n if not isinstance(lhs, NameExpr) or lhs.name.startswith('_') or lhs.name == 'model_config':\n return None\n\n if not stmt.new_syntax:\n if (\n isinstance(stmt.rvalue, CallExpr)\n and isinstance(stmt.rvalue.callee, CallExpr)\n and isinstance(stmt.rvalue.callee.callee, NameExpr)\n and stmt.rvalue.callee.callee.fullname in DECORATOR_FULLNAMES\n ):\n # This is a (possibly-reused) validator or serializer, not a field\n # In particular, it looks something like: my_validator = validator('my_field', allow_reuse=True)(f)\n # Eventually, we may want to attempt to respect model_config['ignored_types']\n return None\n\n # The assignment does not have an annotation, and it's not anything else we recognize\n error_untyped_fields(ctx.api, stmt)\n return None\n\n sym = cls.info.names.get(lhs.name)\n if sym is None: # pragma: no cover\n # This is likely due to a star import (see the dataclasses plugin for a more detailed explanation)\n # This is the same logic used in the dataclasses plugin\n return None\n\n node = sym.node\n if isinstance(node, PlaceholderNode): # pragma: no cover\n # See the PlaceholderNode docstring for more detail about how this can occur\n # Basically, it is an edge case when dealing with complex import logic\n # This is the same logic used in the dataclasses plugin\n return None\n if not isinstance(node, Var): # pragma: no cover\n # Don't know if this edge case still happens with the `is_valid_field` check above\n # but better safe than sorry\n return None\n\n # x: ClassVar[int] is ignored by dataclasses.\n if node.is_classvar:\n return None\n\n is_required = self.get_is_required(cls, stmt, lhs)\n alias, has_dynamic_alias = self.get_alias_info(stmt)\n if has_dynamic_alias and not model_config.populate_by_name and self.plugin_config.warn_required_dynamic_aliases:\n error_required_dynamic_aliases(ctx.api, stmt)\n return PydanticModelField(\n name=lhs.name,\n is_required=is_required,\n alias=alias,\n has_dynamic_alias=has_dynamic_alias,\n line=stmt.line,\n column=stmt.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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.if___init___not_in_ctx_.add_method_ctx___init__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.if___init___not_in_ctx_.add_method_ctx___init__", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 508, "end_line": 526, "span_ids": ["PydanticModelTransformer.add_initializer"], "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 PydanticModelTransformer:\n\n def add_initializer(self, fields: list[PydanticModelField], config: ModelConfigData) -> None:\n \"\"\"\n Adds a fields-aware `__init__` method to the class.\n\n The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings.\n \"\"\"\n ctx = self._ctx\n typed = self.plugin_config.init_typed\n use_alias = config.populate_by_name is not True\n force_all_optional = bool(config.has_alias_generator and not config.populate_by_name)\n init_arguments = self.get_field_arguments(\n fields, typed=typed, force_all_optional=force_all_optional, use_alias=use_alias\n )\n if not self.should_init_forbid_extra(fields, config):\n var = Var('kwargs')\n init_arguments.append(Argument(var, AnyType(TypeOfAny.explicit), None, ARG_STAR2))\n\n if '__init__' not in ctx.cls.info.names:\n add_method(ctx, '__init__', init_arguments, 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_model_construct_method_PydanticModelTransformer.add_model_construct_method.add_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_model_construct_method_PydanticModelTransformer.add_model_construct_method.add_method_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 528, "end_line": 558, "span_ids": ["PydanticModelTransformer.add_model_construct_method"], "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 PydanticModelTransformer:\n\n def add_model_construct_method(self, fields: list[PydanticModelField]) -> None:\n \"\"\"\n Adds a fully typed `model_construct` classmethod to the class.\n\n Similar to the fields-aware __init__ method, but always uses the field names (not aliases),\n and does not treat settings fields as optional.\n \"\"\"\n ctx = self._ctx\n set_str = ctx.api.named_type(f'{BUILTINS_NAME}.set', [ctx.api.named_type(f'{BUILTINS_NAME}.str')])\n optional_set_str = UnionType([set_str, NoneType()])\n fields_set_argument = Argument(Var('_fields_set', optional_set_str), optional_set_str, None, ARG_OPT)\n construct_arguments = self.get_field_arguments(fields, typed=True, force_all_optional=False, use_alias=False)\n construct_arguments = [fields_set_argument] + construct_arguments\n\n obj_type = ctx.api.named_type(f'{BUILTINS_NAME}.object')\n self_tvar_name = '_PydanticBaseModel' # Make sure it does not conflict with other names in the class\n tvar_fullname = ctx.cls.fullname + '.' + self_tvar_name\n # requires mypy>0.910\n self_type = TypeVarDef(self_tvar_name, tvar_fullname, -1, [], obj_type)\n self_tvar_expr = TypeVarExpr(self_tvar_name, tvar_fullname, [], obj_type)\n ctx.cls.info.names[self_tvar_name] = SymbolTableNode(MDEF, self_tvar_expr)\n\n add_method(\n ctx,\n 'model_construct',\n construct_arguments,\n return_type=self_type,\n self_type=self_type,\n tvar_def=self_type,\n is_classmethod=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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.set_frozen_PydanticModelTransformer.set_frozen.for_field_in_fields_.if_sym_node_is_not_None_.else_.info_names_get_name_var_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.set_frozen_PydanticModelTransformer.set_frozen.for_field_in_fields_.if_sym_node_is_not_None_.else_.info_names_get_name_var_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 560, "end_line": 591, "span_ids": ["PydanticModelTransformer.set_frozen"], "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 PydanticModelTransformer:\n\n def set_frozen(self, fields: list[PydanticModelField], frozen: bool) -> None:\n \"\"\"\n Marks all fields as properties so that attempts to set them trigger mypy errors.\n\n This is the same approach used by the attrs and dataclasses plugins.\n \"\"\"\n ctx = self._ctx\n info = ctx.cls.info\n for field in fields:\n sym_node = info.names.get(field.name)\n if sym_node is not None:\n var = sym_node.node\n if isinstance(var, Var):\n var.is_property = frozen\n elif isinstance(var, PlaceholderNode) and not ctx.api.final_iteration:\n # See https://github.com/pydantic/pydantic/issues/5191 to hit this branch for test coverage\n ctx.api.defer()\n else: # pragma: no cover\n # I don't know whether it's possible to hit this branch, but I've added it for safety\n try:\n var_str = str(var)\n except TypeError:\n # This happens for PlaceholderNode; perhaps it will happen for other types in the future..\n var_str = repr(var)\n detail = f'sym_node.node: {var_str} (of type {var.__class__})'\n error_unexpected_behavior(detail, ctx.api, ctx.cls)\n else:\n var = field.to_var(info, use_alias=False)\n var.info = info\n var.is_property = frozen\n var._fullname = get_fullname(info) + '.' + get_name(var)\n info.names[get_name(var)] = 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_config_update_PydanticModelTransformer.get_config_update.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_config_update_PydanticModelTransformer.get_config_update.return.None", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 593, "end_line": 618, "span_ids": ["PydanticModelTransformer.get_config_update"], "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 PydanticModelTransformer:\n\n def get_config_update(self, name: str, arg: Expression) -> ModelConfigData | None:\n \"\"\"\n Determines the config update due to a single kwarg in the ConfigDict definition.\n\n Warns if a tracked config attribute is set to a value the plugin doesn't know how to interpret (e.g., an int)\n \"\"\"\n if name not in self.tracked_config_fields:\n return None\n if name == 'extra':\n if isinstance(arg, StrExpr):\n forbid_extra = arg.value == 'forbid'\n elif isinstance(arg, MemberExpr):\n forbid_extra = arg.name == 'forbid'\n else:\n error_invalid_config_value(name, self._ctx.api, arg)\n return None\n return ModelConfigData(forbid_extra=forbid_extra)\n if name == 'alias_generator':\n has_alias_generator = True\n if isinstance(arg, NameExpr) and arg.fullname == 'builtins.None':\n has_alias_generator = False\n return ModelConfigData(has_alias_generator=has_alias_generator)\n if isinstance(arg, NameExpr) and arg.fullname in ('builtins.True', 'builtins.False'):\n return ModelConfigData(**{name: arg.fullname == 'builtins.True'})\n error_invalid_config_value(name, self._ctx.api, arg)\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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_is_required_PydanticModelTransformer.get_is_required.return.isinstance_expr_Ellipsis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_is_required_PydanticModelTransformer.get_is_required.return.isinstance_expr_Ellipsis", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 620, "end_line": 645, "span_ids": ["PydanticModelTransformer.get_is_required"], "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 PydanticModelTransformer:\n\n @staticmethod\n def get_is_required(cls: ClassDef, stmt: AssignmentStmt, lhs: NameExpr) -> bool:\n \"\"\"\n Returns a boolean indicating whether the field defined in `stmt` is a required field.\n \"\"\"\n expr = stmt.rvalue\n if isinstance(expr, TempNode):\n # TempNode means annotation-only, so only non-required if Optional\n value_type = get_proper_type(cls.info[lhs.name].type)\n if isinstance(value_type, UnionType) and any(isinstance(item, NoneType) for item in value_type.items):\n # Annotated as Optional, or otherwise having NoneType in the union\n return False\n return True\n if isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME:\n # The \"default value\" is a call to `Field`; at this point, the field is\n # only required if default is Ellipsis (i.e., `field_name: Annotation = Field(...)`) or if default_factory\n # is specified.\n for arg, name in zip(expr.args, expr.arg_names):\n # If name is None, then this arg is the default because it is the only positonal argument.\n if name is None or name == 'default':\n return arg.__class__ is EllipsisExpr\n if name == 'default_factory':\n return False\n return True\n # Only required if the \"default value\" is Ellipsis (i.e., `field_name: Annotation = ...`)\n return isinstance(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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_alias_info_PydanticModelTransformer.get_alias_info.return.None_False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_alias_info_PydanticModelTransformer.get_alias_info.return.None_False", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 647, "end_line": 674, "span_ids": ["PydanticModelTransformer.get_alias_info"], "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 PydanticModelTransformer:\n\n @staticmethod\n def get_alias_info(stmt: AssignmentStmt) -> tuple[str | None, bool]:\n \"\"\"\n Returns a pair (alias, has_dynamic_alias), extracted from the declaration of the field defined in `stmt`.\n\n `has_dynamic_alias` is True if and only if an alias is provided, but not as a string literal.\n If `has_dynamic_alias` is True, `alias` will be None.\n \"\"\"\n expr = stmt.rvalue\n if isinstance(expr, TempNode):\n # TempNode means annotation-only\n return None, False\n\n if not (\n isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME\n ):\n # Assigned value is not a call to pydantic.fields.Field\n return None, False\n\n for i, arg_name in enumerate(expr.arg_names):\n if arg_name != 'alias':\n continue\n arg = expr.args[i]\n if isinstance(arg, StrExpr):\n return arg.value, False\n else:\n return None, True\n return None, 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_field_arguments_PydanticModelTransformer.get_field_arguments.return.arguments": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_field_arguments_PydanticModelTransformer.get_field_arguments.return.arguments", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 676, "end_line": 690, "span_ids": ["PydanticModelTransformer.get_field_arguments"], "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 PydanticModelTransformer:\n\n def get_field_arguments(\n self, fields: list[PydanticModelField], typed: bool, force_all_optional: bool, use_alias: bool\n ) -> list[Argument]:\n \"\"\"\n Helper function used during the construction of the `__init__` and `model_construct` method signatures.\n\n Returns a list of mypy Argument instances for use in the generated signatures.\n \"\"\"\n info = self._ctx.cls.info\n arguments = [\n field.to_argument(info, typed=typed, force_optional=force_all_optional, use_alias=use_alias)\n for field in fields\n if not (use_alias and field.has_dynamic_alias)\n ]\n return 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.should_init_forbid_extra_PydanticModelTransformer.is_dynamic_alias_present.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.should_init_forbid_extra_PydanticModelTransformer.is_dynamic_alias_present.return.False", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 692, "end_line": 719, "span_ids": ["PydanticModelTransformer.should_init_forbid_extra", "PydanticModelTransformer.is_dynamic_alias_present"], "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 PydanticModelTransformer:\n\n def should_init_forbid_extra(self, fields: list[PydanticModelField], config: ModelConfigData) -> bool:\n \"\"\"\n Indicates whether the generated `__init__` should get a `**kwargs` at the end of its signature\n\n We disallow arbitrary kwargs if the extra config setting is \"forbid\", or if the plugin config says to,\n *unless* a required dynamic alias is present (since then we can't determine a valid signature).\n \"\"\"\n if not config.populate_by_name:\n if self.is_dynamic_alias_present(fields, bool(config.has_alias_generator)):\n return False\n if config.forbid_extra:\n return True\n return self.plugin_config.init_forbid_extra\n\n @staticmethod\n def is_dynamic_alias_present(fields: list[PydanticModelField], has_alias_generator: bool) -> bool:\n \"\"\"\n Returns whether any fields on the model have a \"dynamic alias\", i.e., an alias that cannot be\n determined during static analysis.\n \"\"\"\n for field in fields:\n if field.has_dynamic_alias:\n return True\n if has_alias_generator:\n for field in fields:\n if field.alias is 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_pydantic__pydantic/pydantic/mypy.py_PydanticModelField_PydanticModelField.to_var.return.Var_name_info_self_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField_PydanticModelField.to_var.return.Var_name_info_self_name_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 722, "end_line": 737, "span_ids": ["PydanticModelField", "PydanticModelField.to_var", "PydanticModelField.__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 PydanticModelField:\n def __init__(\n self, name: str, is_required: bool, alias: str | None, has_dynamic_alias: bool, line: int, column: int\n ):\n self.name = name\n self.is_required = is_required\n self.alias = alias\n self.has_dynamic_alias = has_dynamic_alias\n self.line = line\n self.column = column\n\n def to_var(self, info: TypeInfo, use_alias: bool) -> Var:\n name = self.name\n if use_alias and self.alias is not None:\n name = self.alias\n return Var(name, info[self.name].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_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_argument_PydanticModelField.deserialize.return.cls_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_argument_PydanticModelField.deserialize.return.cls_data_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 739, "end_line": 756, "span_ids": ["PydanticModelField.deserialize", "PydanticModelField.serialize", "PydanticModelField.to_argument"], "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 PydanticModelField:\n\n def to_argument(self, info: TypeInfo, typed: bool, force_optional: bool, use_alias: bool) -> Argument:\n if typed and info[self.name].type is not None:\n type_annotation = info[self.name].type\n else:\n type_annotation = AnyType(TypeOfAny.explicit)\n return Argument(\n variable=self.to_var(info, use_alias),\n type_annotation=type_annotation,\n initializer=None,\n kind=ARG_NAMED_OPT if force_optional or not self.is_required else ARG_NAMED,\n )\n\n def serialize(self) -> JsonDict:\n return self.__dict__\n\n @classmethod\n def deserialize(cls, info: TypeInfo, data: JsonDict) -> PydanticModelField:\n return cls(**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_pydantic__pydantic/pydantic/mypy.py_ModelConfigData_ModelConfigData.setdefault.if_getattr_self_key_is_.setattr_self_key_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_ModelConfigData_ModelConfigData.setdefault.if_getattr_self_key_is_.setattr_self_key_value_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 759, "end_line": 785, "span_ids": ["ModelConfigData", "ModelConfigData.update", "ModelConfigData.__init__", "ModelConfigData.setdefault", "ModelConfigData.set_values_dict"], "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 ModelConfigData:\n def __init__(\n self,\n forbid_extra: bool | None = None,\n frozen: bool | None = None,\n from_attributes: bool | None = None,\n populate_by_name: bool | None = None,\n has_alias_generator: bool | None = None,\n ):\n self.forbid_extra = forbid_extra\n self.frozen = frozen\n self.from_attributes = from_attributes\n self.populate_by_name = populate_by_name\n self.has_alias_generator = has_alias_generator\n\n def set_values_dict(self) -> dict[str, Any]:\n return {k: v for k, v in self.__dict__.items() if v is not None}\n\n def update(self, config: ModelConfigData | None) -> None:\n if config is None:\n return\n for k, v in config.set_values_dict().items():\n setattr(self, k, v)\n\n def setdefault(self, key: str, value: Any) -> None:\n if getattr(self, key) is None:\n setattr(self, 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_pydantic__pydantic/pydantic/mypy.py_ERROR_ORM_error_required_dynamic_aliases.api_fail_Required_dynami": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_ERROR_ORM_error_required_dynamic_aliases.api_fail_Required_dynami", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 788, "end_line": 805, "span_ids": ["error_from_attributes", "impl:23", "error_invalid_config_value", "error_required_dynamic_aliases"], "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": "ERROR_ORM = ErrorCode('pydantic-orm', 'Invalid from_attributes call', 'Pydantic')\nERROR_CONFIG = ErrorCode('pydantic-config', 'Invalid config value', 'Pydantic')\nERROR_ALIAS = ErrorCode('pydantic-alias', 'Dynamic alias disallowed', 'Pydantic')\nERROR_UNEXPECTED = ErrorCode('pydantic-unexpected', 'Unexpected behavior', 'Pydantic')\nERROR_UNTYPED = ErrorCode('pydantic-field', 'Untyped field disallowed', 'Pydantic')\nERROR_FIELD_DEFAULTS = ErrorCode('pydantic-field', 'Invalid Field defaults', 'Pydantic')\n\n\ndef error_from_attributes(model_name: str, api: CheckerPluginInterface, context: Context) -> None:\n api.fail(f'\"{model_name}\" does not have from_attributes=True', context, code=ERROR_ORM)\n\n\ndef error_invalid_config_value(name: str, api: SemanticAnalyzerPluginInterface, context: Context) -> None:\n api.fail(f'Invalid value for \"Config.{name}\"', context, code=ERROR_CONFIG)\n\n\ndef error_required_dynamic_aliases(api: SemanticAnalyzerPluginInterface, context: Context) -> None:\n api.fail('Required dynamic aliases disallowed', context, code=ERROR_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_pydantic__pydantic/pydantic/mypy.py_error_unexpected_behavior_error_default_and_default_factory_specified.api_fail_Field_default_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_error_unexpected_behavior_error_default_and_default_factory_specified.api_fail_Field_default_a", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 808, "end_line": 823, "span_ids": ["error_default_and_default_factory_specified", "error_unexpected_behavior", "error_untyped_fields"], "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 error_unexpected_behavior(\n detail: str, api: CheckerPluginInterface | SemanticAnalyzerPluginInterface, context: Context\n) -> None: # pragma: no cover\n # Can't think of a good way to test this, but I confirmed it renders as desired by adding to a non-error path\n link = 'https://github.com/pydantic/pydantic/issues/new/choose'\n full_message = f'The pydantic mypy plugin ran into unexpected behavior: {detail}\\n'\n full_message += f'Please consider reporting this bug at {link} so we can try to fix it!'\n api.fail(full_message, context, code=ERROR_UNEXPECTED)\n\n\ndef error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None:\n api.fail('Untyped fields disallowed', context, code=ERROR_UNTYPED)\n\n\ndef error_default_and_default_factory_specified(api: CheckerPluginInterface, context: Context) -> None:\n api.fail('Field default and default_factory cannot be specified together', context, code=ERROR_FIELD_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_pydantic__pydantic/pydantic/mypy.py_add_method_add_method.info_defn_defs_body_appen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_add_method_add_method.info_defn_defs_body_appen", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 826, "end_line": 906, "span_ids": ["add_method"], "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 add_method(\n ctx: ClassDefContext,\n name: str,\n args: list[Argument],\n return_type: Type,\n self_type: Type | None = None,\n tvar_def: TypeVarDef | None = None,\n is_classmethod: bool = False,\n is_new: bool = False,\n # is_staticmethod: bool = False,\n) -> None:\n \"\"\"\n Adds a new method to a class.\n\n This can be dropped if/when https://github.com/python/mypy/issues/7301 is merged\n \"\"\"\n info = ctx.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 ctx.cls.defs.body.remove(sym.node) # pragma: no cover\n\n self_type = self_type or fill_typevars(info)\n if is_classmethod or is_new:\n first = [Argument(Var('_cls'), TypeType.make_normalized(self_type), None, ARG_POS)]\n # elif is_staticmethod:\n # first = []\n else:\n self_type = self_type or fill_typevars(info)\n first = [Argument(Var('__pydantic_self__'), self_type, None, ARG_POS)]\n args = first + 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(get_name(arg.variable))\n arg_kinds.append(arg.kind)\n\n function_type = ctx.api.named_type(f'{BUILTINS_NAME}.function')\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.is_class = is_classmethod\n # func.is_static = is_staticmethod\n func._fullname = get_fullname(info) + '.' + 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 if is_classmethod: # or is_staticmethod:\n func.is_decorated = True\n v = Var(name, func.type)\n v.info = info\n v._fullname = func._fullname\n # if is_classmethod:\n v.is_classmethod = True\n dec = Decorator(func, [NameExpr('classmethod')], v)\n # else:\n # v.is_staticmethod = True\n # dec = Decorator(func, [NameExpr('staticmethod')], v)\n\n dec.line = info.line\n sym = SymbolTableNode(MDEF, dec)\n else:\n sym = SymbolTableNode(MDEF, func)\n sym.plugin_generated = True\n\n info.names[name] = sym\n info.defn.defs.body.append(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_pydantic__pydantic/pydantic/mypy.py_get_fullname_get_name.return.fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_get_fullname_get_name.return.fn", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 909, "end_line": 926, "span_ids": ["get_fullname", "get_name"], "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 get_fullname(x: FuncBase | SymbolNode) -> str:\n \"\"\"\n Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped.\n \"\"\"\n fn = x.fullname\n if callable(fn): # pragma: no cover\n return fn()\n return fn\n\n\ndef get_name(x: FuncBase | SymbolNode) -> str:\n \"\"\"\n Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped.\n \"\"\"\n fn = x.name\n if callable(fn): # pragma: no cover\n return fn()\n return 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_pydantic__pydantic/pydantic/mypy.py_parse_toml_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_parse_toml_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 929, "end_line": 946, "span_ids": ["parse_toml"], "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 parse_toml(config_file: str) -> dict[str, Any] | None:\n if not config_file.endswith('.toml'):\n return None\n\n if sys.version_info >= (3, 11):\n import tomllib as toml_\n else:\n try:\n import tomli as toml_\n except ImportError: # pragma: no cover\n import warnings\n\n warnings.warn('No TOML parser installed, cannot read configuration from `pyproject.toml`.')\n return None\n\n with open(config_file, 'rb') as rf:\n return toml_.load(rf)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_from___future___import_an_KafkaDsn.Annotated_Url_UrlConstra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_from___future___import_an_KafkaDsn.Annotated_Url_UrlConstra", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 95, "span_ids": ["impl:9", "imports", "UrlConstraints"], "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": "from __future__ import annotations as _annotations\n\nimport dataclasses as _dataclasses\nimport re\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom typing import TYPE_CHECKING, Any\n\nfrom pydantic_core import MultiHostUrl, PydanticCustomError, Url, core_schema\nfrom typing_extensions import Annotated\n\nfrom ._internal import _fields, _repr\n\nif TYPE_CHECKING:\n import email_validator\n\n NetworkType = str | bytes | int | tuple[str | bytes | int, str | int]\n\nelse:\n email_validator = None\n\n\n__all__ = [\n 'AnyUrl',\n 'AnyHttpUrl',\n 'FileUrl',\n 'HttpUrl',\n 'UrlConstraints',\n 'EmailStr',\n 'NameEmail',\n 'IPvAnyAddress',\n 'IPvAnyInterface',\n 'IPvAnyNetwork',\n 'PostgresDsn',\n 'CockroachDsn',\n 'AmqpDsn',\n 'RedisDsn',\n 'MongoDsn',\n 'KafkaDsn',\n 'validate_email',\n 'MySQLDsn',\n 'MariaDBDsn',\n]\n\n\n@_dataclasses.dataclass\nclass UrlConstraints(_fields.PydanticMetadata):\n max_length: int | None = None\n allowed_schemes: list[str] | None = None\n host_required: bool | None = None\n default_host: str | None = None\n default_port: int | None = None\n default_path: str | None = None\n\n\nAnyUrl = Url\n# host_required is false because all schemes are \"special\" so host is required by rust-url automatically\nAnyHttpUrl = Annotated[Url, UrlConstraints(allowed_schemes=['http', 'https'])]\nHttpUrl = Annotated[Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'])]\nFileUrl = Annotated[Url, UrlConstraints(allowed_schemes=['file'])]\nPostgresDsn = Annotated[\n MultiHostUrl,\n UrlConstraints(\n host_required=True,\n allowed_schemes=[\n 'postgres',\n 'postgresql',\n 'postgresql+asyncpg',\n 'postgresql+pg8000',\n 'postgresql+psycopg',\n 'postgresql+psycopg2',\n 'postgresql+psycopg2cffi',\n 'postgresql+py-postgresql',\n 'postgresql+pygresql',\n ],\n ),\n]\n\nCockroachDsn = Annotated[\n Url,\n UrlConstraints(\n host_required=True,\n allowed_schemes=[\n 'cockroachdb',\n 'cockroachdb+psycopg2',\n 'cockroachdb+asyncpg',\n ],\n ),\n]\nAmqpDsn = Annotated[Url, UrlConstraints(allowed_schemes=['amqp', 'amqps'])]\nRedisDsn = Annotated[\n Url,\n UrlConstraints(allowed_schemes=['redis', 'rediss'], default_host='localhost', default_port=6379, default_path='/0'),\n]\nMongoDsn = Annotated[MultiHostUrl, UrlConstraints(allowed_schemes=['mongodb', 'mongodb+srv'], default_port=27017)]\nKafkaDsn = Annotated[Url, UrlConstraints(allowed_schemes=['kafka'], default_host='localhost', default_port=9092)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_MySQLDsn_None_1.else_.EmailStr.validate.return.validate_email___input_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_MySQLDsn_None_1.else_.EmailStr.validate.return.validate_email___input_va", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 152, "span_ids": ["impl:9", "import_email_validator", "impl:33"], "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": "MySQLDsn = Annotated[\n Url,\n UrlConstraints(\n allowed_schemes=[\n 'mysql',\n 'mysql+mysqlconnector',\n 'mysql+aiomysql',\n 'mysql+asyncmy',\n 'mysql+mysqldb',\n 'mysql+pymysql',\n 'mysql+cymysql',\n 'mysql+pyodbc',\n ],\n default_port=3306,\n ),\n]\nMariaDBDsn = Annotated[\n Url,\n UrlConstraints(\n allowed_schemes=['mariadb', 'mariadb+mariadbconnector', 'mariadb+pymysql'],\n default_port=3306,\n ),\n]\n\n\ndef import_email_validator() -> None:\n global email_validator\n try:\n import email_validator\n except ImportError as e:\n raise ImportError('email-validator is not installed, run `pip install pydantic[email]`') from e\n\n\nif TYPE_CHECKING:\n EmailStr = Annotated[str, ...]\nelse:\n\n class EmailStr:\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n import_email_validator()\n if schema is None:\n return core_schema.general_after_validator_function(cls.validate, core_schema.str_schema())\n else:\n assert schema['type'] == 'str', 'EmailStr must be used with string fields'\n return core_schema.general_after_validator_function(cls.validate, schema)\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.update(type='string', format='email')\n return field_schema\n\n @classmethod\n def validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> str:\n return validate_email(__input_value)[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_pydantic__pydantic/pydantic/networks.py_NameEmail_NameEmail.__str__.return.f_self_name_self_emai": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NameEmail_NameEmail.__str__.return.f_self_name_self_emai", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 188, "span_ids": ["NameEmail.__get_pydantic_core_schema__", "NameEmail._validate", "NameEmail", "NameEmail.__str__", "NameEmail.__eq__", "NameEmail.__pydantic_modify_json_schema__", "NameEmail.__init__"], "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 NameEmail(_repr.Representation):\n __slots__ = 'name', 'email'\n\n def __init__(self, name: str, email: str):\n self.name = name\n self.email = email\n\n def __eq__(self, other: Any) -> bool:\n return isinstance(other, NameEmail) and (self.name, self.email) == (other.name, other.email)\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.update(type='string', format='name-email')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.AfterValidatorFunctionSchema:\n import_email_validator()\n return core_schema.general_after_validator_function(\n cls._validate,\n core_schema.union_schema([core_schema.is_instance_schema(cls), core_schema.str_schema()]),\n serialization=core_schema.to_string_ser_schema(),\n )\n\n @classmethod\n def _validate(cls, __input_value: NameEmail | str, _: core_schema.ValidationInfo) -> NameEmail:\n if isinstance(__input_value, cls):\n return __input_value\n else:\n name, email = validate_email(__input_value) # type: ignore[arg-type]\n return cls(name, email)\n\n def __str__(self) -> str:\n return f'{self.name} <{self.email}>'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyAddress_IPvAnyAddress._validate._type_ignore_return_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyAddress_IPvAnyAddress._validate._type_ignore_return_val", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 216, "span_ids": ["IPvAnyAddress.__get_pydantic_core_schema__", "IPvAnyAddress.__pydantic_modify_json_schema__", "IPvAnyAddress._validate", "IPvAnyAddress.__new__", "IPvAnyAddress"], "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 IPvAnyAddress:\n __slots__ = ()\n\n def __new__(cls, value: Any) -> IPv4Address | IPv6Address: # type: ignore[misc]\n try:\n return IPv4Address(value)\n except ValueError:\n pass\n\n try:\n return IPv6Address(value)\n except ValueError:\n raise PydanticCustomError('ip_any_address', 'value is not a valid IPv4 or IPv6 address')\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.update(type='string', format='ipvanyaddress')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.PlainValidatorFunctionSchema:\n return core_schema.general_plain_validator_function(cls._validate)\n\n @classmethod\n def _validate(cls, __input_value: Any, _: core_schema.ValidationInfo) -> IPv4Address | IPv6Address:\n return cls(__input_value) # type: ignore[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_pydantic__pydantic/pydantic/networks.py_IPvAnyInterface_IPvAnyInterface._validate._type_ignore_return_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyInterface_IPvAnyInterface._validate._type_ignore_return_val", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 244, "span_ids": ["IPvAnyInterface.__new__", "IPvAnyInterface.__pydantic_modify_json_schema__", "IPvAnyInterface", "IPvAnyInterface.__get_pydantic_core_schema__", "IPvAnyInterface._validate"], "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 IPvAnyInterface:\n __slots__ = ()\n\n def __new__(cls, value: NetworkType) -> IPv4Interface | IPv6Interface: # type: ignore[misc]\n try:\n return IPv4Interface(value)\n except ValueError:\n pass\n\n try:\n return IPv6Interface(value)\n except ValueError:\n raise PydanticCustomError('ip_any_interface', 'value is not a valid IPv4 or IPv6 interface')\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.update(type='string', format='ipvanyinterface')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.PlainValidatorFunctionSchema:\n return core_schema.general_plain_validator_function(cls._validate)\n\n @classmethod\n def _validate(cls, __input_value: NetworkType, _: core_schema.ValidationInfo) -> IPv4Interface | IPv6Interface:\n return cls(__input_value) # type: ignore[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_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork_IPvAnyNetwork.__new__.None_1.except_ValueError_.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork_IPvAnyNetwork.__new__.None_1.except_ValueError_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 247, "end_line": 261, "span_ids": ["IPvAnyNetwork.__new__", "IPvAnyNetwork"], "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 IPvAnyNetwork:\n __slots__ = ()\n\n def __new__(cls, value: NetworkType) -> IPv4Network | IPv6Network: # type: ignore[misc]\n # Assume IP Network is defined with a default value for ``strict`` argument.\n # Define your own class if you want to specify network address check strictness.\n try:\n return IPv4Network(value)\n except ValueError:\n pass\n\n try:\n return IPv6Network(value)\n except ValueError:\n raise PydanticCustomError('ip_any_network', 'value is not a valid IPv4 or IPv6 network')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork.__pydantic_modify_json_schema___pretty_email_regex.re_compile_r_w_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork.__pydantic_modify_json_schema___pretty_email_regex.re_compile_r_w_", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 277, "span_ids": ["IPvAnyNetwork.__pydantic_modify_json_schema__", "IPvAnyNetwork._validate", "impl:37", "IPvAnyNetwork.__get_pydantic_core_schema__"], "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 IPvAnyNetwork:\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.update(type='string', format='ipvanynetwork')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.PlainValidatorFunctionSchema:\n return core_schema.general_plain_validator_function(cls._validate)\n\n @classmethod\n def _validate(cls, __input_value: NetworkType, _: core_schema.ValidationInfo) -> IPv4Network | IPv6Network:\n return cls(__input_value) # type: ignore[return-value]\n\n\npretty_email_regex = re.compile(r' *([\\w ]*?) *<(.+?)> *')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_validate_email_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_validate_email_", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 307, "span_ids": ["validate_email"], "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 validate_email(value: str) -> tuple[str, str]:\n \"\"\"\n Email address validation using https://pypi.org/project/email-validator/\n\n Notes:\n * raw ip address (literal) domain parts are not allowed.\n * \"John Doe \" style \"pretty\" email addresses are processed\n * spaces are striped from the beginning and end of addresses but no error is raised\n \"\"\"\n if email_validator is None:\n import_email_validator()\n\n m = pretty_email_regex.fullmatch(value)\n name: str | None = None\n if m:\n name, value = m.groups()\n\n email = value.strip()\n\n try:\n parts = email_validator.validate_email(email, check_deliverability=False)\n except email_validator.EmailNotValidError as e:\n raise PydanticCustomError(\n 'value_error', 'value is not a valid email address: {reason}', {'reason': str(e.args[0])}\n ) from e\n\n return name or parts['local'], parts['email']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_from___future___import_an_parse_obj_as.return.AnalyzedType_type__valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_from___future___import_an_parse_obj_as.return.AnalyzedType_type__valid", "embedding": null, "metadata": {"file_path": "pydantic/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["imports", "parse_obj_as"], "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": "from __future__ import annotations\n\nimport json\nimport warnings\nfrom typing import Any, Callable, Type, TypeVar, Union\n\nfrom . import AnalyzedType\n\n__all__ = 'parse_obj_as', 'schema_of', 'schema_json_of'\n\nfrom .json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema\n\nNameFactory = Union[str, Callable[[Type[Any]], str]]\n\n\nT = TypeVar('T')\n\n\ndef parse_obj_as(type_: type[T], obj: Any, type_name: NameFactory | None = None) -> T:\n # TODO: add deprecation warning of some sort\n if type_name is not None: # pragma: no cover\n warnings.warn(\n 'The type_name parameter is deprecated. parse_obj_as no longer creates temporary models',\n DeprecationWarning,\n stacklevel=2,\n )\n return AnalyzedType(type_).validate_python(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_pydantic__pydantic/pydantic/tools.py_schema_of_schema_of.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_schema_of_schema_of.return.res", "embedding": null, "metadata": {"file_path": "pydantic/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 54, "span_ids": ["schema_of"], "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 schema_of(\n type_: Any,\n *,\n title: NameFactory | None = None,\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n) -> dict[str, Any]:\n \"\"\"Generate a JSON schema (as dict) for the passed model or dynamically generated one\"\"\"\n res = AnalyzedType(type_).json_schema(\n by_alias=by_alias,\n schema_generator=schema_generator,\n ref_template=ref_template,\n )\n if title is not None:\n if isinstance(title, str):\n res['title'] = title\n else:\n warnings.warn(\n 'Passing a callable for the `title` parameter is deprecated and no longer supported',\n DeprecationWarning,\n stacklevel=2,\n )\n res['title'] = title(type_)\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_pydantic__pydantic/pydantic/tools.py_schema_json_of_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py_schema_json_of_", "embedding": null, "metadata": {"file_path": "pydantic/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 71, "span_ids": ["schema_json_of"], "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 schema_json_of(\n type_: Any,\n *,\n title: NameFactory | None = None,\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,\n **dumps_kwargs: Any,\n) -> str:\n \"\"\"Generate a JSON schema (as JSON) for the passed model or dynamically generated one\"\"\"\n return json.dumps(\n schema_of(type_, title=title, by_alias=by_alias, ref_template=ref_template, schema_generator=schema_generator),\n **dumps_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_pydantic__pydantic/pydantic/types.py_from___future___import_an_StrictBool.Annotated_bool_Strict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_from___future___import_an_StrictBool.Annotated_bool_Strict_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 85, "span_ids": ["imports", "impl:3", "Strict"], "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": "from __future__ import annotations as _annotations\n\nimport abc\nimport dataclasses as _dataclasses\nimport re\nfrom datetime import date, datetime\nfrom decimal import Decimal\nfrom enum import Enum\nfrom pathlib import Path\nfrom typing import (\n TYPE_CHECKING,\n Any,\n ClassVar,\n FrozenSet,\n Generic,\n Hashable,\n List,\n Set,\n TypeVar,\n cast,\n)\nfrom uuid import UUID\n\nimport annotated_types\nfrom pydantic_core import PydanticCustomError, PydanticKnownError, core_schema\nfrom typing_extensions import Annotated, Literal\n\nfrom ._internal import _fields, _validators\n\n__all__ = [\n 'Strict',\n 'StrictStr',\n 'conbytes',\n 'conlist',\n 'conset',\n 'confrozenset',\n 'constr',\n 'ImportString',\n 'conint',\n 'PositiveInt',\n 'NegativeInt',\n 'NonNegativeInt',\n 'NonPositiveInt',\n 'confloat',\n 'PositiveFloat',\n 'NegativeFloat',\n 'NonNegativeFloat',\n 'NonPositiveFloat',\n 'FiniteFloat',\n 'condecimal',\n 'UUID1',\n 'UUID3',\n 'UUID4',\n 'UUID5',\n 'FilePath',\n 'DirectoryPath',\n 'Json',\n 'SecretField',\n 'SecretStr',\n 'SecretBytes',\n 'StrictBool',\n 'StrictBytes',\n 'StrictInt',\n 'StrictFloat',\n 'PaymentCardNumber',\n 'ByteSize',\n 'PastDate',\n 'FutureDate',\n 'condate',\n 'AwareDatetime',\n 'NaiveDatetime',\n]\n\nfrom ._internal._core_metadata import build_metadata_dict\nfrom ._internal._utils import update_not_none\n\n\n@_dataclasses.dataclass\nclass Strict(_fields.PydanticMetadata):\n strict: bool = True\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BOOLEAN TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nStrictBool = Annotated[bool, 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_pydantic__pydantic/pydantic/types.py_None_1_conint.return.Annotated_type_ignor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_1_conint.return.Annotated_type_ignor", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 104, "span_ids": ["impl:3", "conint"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\ndef conint(\n *,\n strict: bool | None = None,\n gt: int | None = None,\n ge: int | None = None,\n lt: int | None = None,\n le: int | None = None,\n multiple_of: int | None = None,\n) -> type[int]:\n return Annotated[ # type: ignore[return-value]\n int,\n Strict(strict) if strict is not None else None,\n annotated_types.Interval(gt=gt, ge=ge, lt=lt, le=le),\n annotated_types.MultipleOf(multiple_of) if multiple_of is not None else None,\n ]\n\nif TYPE_CHECKING:\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_pydantic__pydantic/pydantic/types.py_PositiveInt_AllowInfNan.allow_inf_nan.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveInt_AllowInfNan.allow_inf_nan.True", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 118, "span_ids": ["AllowInfNan", "impl:5"], "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": "PositiveInt = Annotated[int, annotated_types.Gt(0)]\nNegativeInt = Annotated[int, annotated_types.Lt(0)]\nNonPositiveInt = Annotated[int, annotated_types.Le(0)]\nNonNegativeInt = Annotated[int, annotated_types.Ge(0)]\nStrictInt = Annotated[int, Strict()]\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n@_dataclasses.dataclass\nclass AllowInfNan(_fields.PydanticMetadata):\n allow_inf_nan: bool = True\n\nif TYPE_CHECKING:\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_pydantic__pydantic/pydantic/types.py_confloat_confloat.return.Annotated_type_ignor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_confloat_confloat.return.Annotated_type_ignor", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 137, "span_ids": ["confloat"], "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 confloat(\n *,\n strict: bool | None = None,\n gt: float | None = None,\n ge: float | None = None,\n lt: float | None = None,\n le: float | None = None,\n multiple_of: float | None = None,\n allow_inf_nan: bool | None = None,\n) -> type[float]:\n return Annotated[ # type: ignore[return-value]\n float,\n Strict(strict) if strict is not None else None,\n annotated_types.Interval(gt=gt, ge=ge, lt=lt, le=le),\n annotated_types.MultipleOf(multiple_of) if multiple_of is not None else None,\n AllowInfNan(allow_inf_nan) if allow_inf_nan 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_pydantic__pydantic/pydantic/types.py_PositiveFloat_StrictBytes.Annotated_bytes_Strict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveFloat_StrictBytes.Annotated_bytes_Strict_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 164, "span_ids": ["impl:27", "impl:15", "conbytes"], "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": "PositiveFloat = Annotated[float, annotated_types.Gt(0)]\nNegativeFloat = Annotated[float, annotated_types.Lt(0)]\nNonPositiveFloat = Annotated[float, annotated_types.Le(0)]\nNonNegativeFloat = Annotated[float, annotated_types.Ge(0)]\nStrictFloat = Annotated[float, Strict(True)]\nFiniteFloat = Annotated[float, AllowInfNan(False)]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTES TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\ndef conbytes(\n *,\n min_length: int | None = None,\n max_length: int | None = None,\n strict: bool | None = None,\n) -> type[bytes]:\n return Annotated[ # type: ignore[return-value]\n bytes,\n Strict(strict) if strict is not None else None,\n annotated_types.Len(min_length or 0, max_length),\n ]\n\n\nStrictBytes = Annotated[bytes, Strict()]\n\nif TYPE_CHECKING:\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_pydantic__pydantic/pydantic/types.py_None_4_constr.return.Annotated_type_ignor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_4_constr.return.Annotated_type_ignor", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 190, "span_ids": ["constr", "impl:27"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRING TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\ndef constr(\n *,\n strip_whitespace: bool | None = None,\n to_upper: bool | None = None,\n to_lower: bool | None = None,\n strict: bool | None = None,\n min_length: int | None = None,\n max_length: int | None = None,\n pattern: str | None = None,\n) -> type[str]:\n return Annotated[ # type: ignore[return-value]\n str,\n Strict(strict) if strict is not None else None,\n annotated_types.Len(min_length or 0, max_length),\n _fields.PydanticGeneralMetadata(\n strip_whitespace=strip_whitespace,\n to_upper=to_upper,\n to_lower=to_lower,\n pattern=pattern,\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_pydantic__pydantic/pydantic/types.py_StrictStr_if_TYPE_CHECKING_.else_.ImportString.__repr__.return._ImportString_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StrictStr_if_TYPE_CHECKING_.else_.ImportString.__repr__.return._ImportString_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 252, "span_ids": ["confrozenset", "impl:29", "impl:33", "impl:35", "conset", "conlist"], "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": "StrictStr = Annotated[str, Strict()]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ COLLECTION TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nHashableItemType = TypeVar('HashableItemType', bound=Hashable)\n\n\ndef conset(\n item_type: type[HashableItemType], *, min_length: int = None, max_length: int = None\n) -> type[set[HashableItemType]]:\n return Annotated[ # type: ignore[return-value]\n Set[item_type], annotated_types.Len(min_length or 0, max_length) # type: ignore[valid-type]\n ]\n\n\ndef confrozenset(\n item_type: type[HashableItemType], *, min_length: int | None = None, max_length: int | None = None\n) -> type[frozenset[HashableItemType]]:\n return Annotated[ # type: ignore[return-value]\n FrozenSet[item_type], # type: ignore[valid-type]\n annotated_types.Len(min_length or 0, max_length),\n ]\n\n\nAnyItemType = TypeVar('AnyItemType')\n\n\ndef conlist(\n item_type: type[AnyItemType], *, min_length: int | None = None, max_length: int | None = None\n) -> type[list[AnyItemType]]:\n return Annotated[ # type: ignore[return-value]\n List[item_type], # type: ignore[valid-type]\n annotated_types.Len(min_length or 0, max_length),\n ]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~ IMPORT STRING TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAnyType = TypeVar('AnyType')\nif TYPE_CHECKING:\n ImportString = Annotated[AnyType, ...]\nelse:\n\n class ImportString:\n @classmethod\n def __class_getitem__(cls, item: AnyType) -> AnyType:\n return Annotated[item, cls()]\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n if schema is None or schema == {'type': 'any'}:\n # Treat bare usage of ImportString (`schema is None`) as the same as ImportString[Any]\n return core_schema.general_plain_validator_function(lambda v, _: _validators.import_string(v))\n else:\n return core_schema.general_before_validator_function(lambda v, _: _validators.import_string(v), schema)\n\n def __repr__(self) -> str:\n return 'ImportString'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_7_condecimal.return.Annotated_type_ignor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_7_condecimal.return.Annotated_type_ignor", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 277, "span_ids": ["condecimal", "impl:35"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECIMAL TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\ndef condecimal(\n *,\n strict: bool | None = None,\n gt: int | Decimal | None = None,\n ge: int | Decimal | None = None,\n lt: int | Decimal | None = None,\n le: int | Decimal | None = None,\n multiple_of: int | Decimal | None = None,\n max_digits: int | None = None,\n decimal_places: int | None = None,\n allow_inf_nan: bool | None = None,\n) -> type[Decimal]:\n return Annotated[ # type: ignore[return-value]\n Decimal,\n Strict(strict) if strict is not None else None,\n annotated_types.Interval(gt=gt, ge=ge, lt=lt, le=le),\n annotated_types.MultipleOf(multiple_of) if multiple_of is not None else None,\n _fields.PydanticGeneralMetadata(max_digits=max_digits, decimal_places=decimal_places),\n AllowInfNan(allow_inf_nan) if allow_inf_nan 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_pydantic__pydantic/pydantic/types.py_None_8_UuidVersion.validate.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_8_UuidVersion.validate.return.value", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 304, "span_ids": ["UuidVersion", "UuidVersion.__pydantic_modify_json_schema__", "condecimal", "UuidVersion.__get_pydantic_core_schema__", "UuidVersion.validate"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UUID TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n@_dataclasses.dataclass(frozen=True) # Add frozen=True to make it hashable\nclass UuidVersion:\n uuid_version: Literal[1, 3, 4, 5]\n\n def __pydantic_modify_json_schema__(self, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.pop('anyOf', None) # remove the bytes/str union\n field_schema.update(type='string', format=f'uuid{self.uuid_version}')\n return field_schema\n\n def __get_pydantic_core_schema__(\n self, schema: core_schema.CoreSchema, **_kwargs: Any\n ) -> core_schema.AfterValidatorFunctionSchema:\n return core_schema.general_after_validator_function(\n cast(core_schema.GeneralValidatorFunction, self.validate), schema\n )\n\n def validate(self, value: UUID, _: core_schema.ValidationInfo) -> UUID:\n if value.version != self.uuid_version:\n raise PydanticCustomError(\n 'uuid_version', 'uuid version {required_version} expected', {'required_version': self.uuid_version}\n )\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_pydantic__pydantic/pydantic/types.py_UUID1_PathType.__get_pydantic_core_schema__.return.core_schema_general_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_UUID1_PathType.__get_pydantic_core_schema__.return.core_schema_general_after", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 337, "span_ids": ["PathType.__get_pydantic_core_schema__", "PathType.__pydantic_modify_json_schema__", "impl:41", "PathType"], "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": "UUID1 = Annotated[UUID, UuidVersion(1)]\nUUID3 = Annotated[UUID, UuidVersion(3)]\nUUID4 = Annotated[UUID, UuidVersion(4)]\nUUID5 = Annotated[UUID, UuidVersion(5)]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PATH TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n@_dataclasses.dataclass\nclass PathType:\n path_type: Literal['file', 'dir', 'new']\n\n def __pydantic_modify_json_schema__(self, field_schema: dict[str, Any]) -> dict[str, Any]:\n format_conversion = {'file': 'file-path', 'dir': 'directory-path'}\n field_schema.update(format=format_conversion.get(self.path_type, 'path'), type='string')\n return field_schema\n\n def __get_pydantic_core_schema__(\n self, schema: core_schema.CoreSchema, **_kwargs: Any\n ) -> core_schema.AfterValidatorFunctionSchema:\n function_lookup = {\n 'file': cast(core_schema.GeneralValidatorFunction, self.validate_file),\n 'dir': cast(core_schema.GeneralValidatorFunction, self.validate_directory),\n 'new': cast(core_schema.GeneralValidatorFunction, self.validate_new),\n }\n\n return core_schema.general_after_validator_function(\n function_lookup[self.path_type],\n schema,\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_pydantic__pydantic/pydantic/types.py_PathType.validate_file_PathType.validate_new.if_path_exists_.else_.return.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PathType.validate_file_PathType.validate_new.if_path_exists_.else_.return.path", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 360, "span_ids": ["PathType.validate_directory", "PathType.validate_new", "PathType.validate_file"], "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": "@_dataclasses.dataclass\nclass PathType:\n\n @staticmethod\n def validate_file(path: Path, _: core_schema.ValidationInfo) -> Path:\n if path.is_file():\n return path\n else:\n raise PydanticCustomError('path_not_file', 'Path does not point to a file')\n\n @staticmethod\n def validate_directory(path: Path, _: core_schema.ValidationInfo) -> Path:\n if path.is_dir():\n return path\n else:\n raise PydanticCustomError('path_not_directory', 'Path does not point to a directory')\n\n @staticmethod\n def validate_new(path: Path, _: core_schema.ValidationInfo) -> Path:\n if path.exists():\n raise PydanticCustomError('path_exists', 'path already exists')\n elif not path.parent.exists():\n raise PydanticCustomError('parent_does_not_exist', 'Parent directory does not exist')\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_pydantic__pydantic/pydantic/types.py_FilePath_SecretType.TypeVar_SecretType_str": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_FilePath_SecretType.TypeVar_SecretType_str", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 363, "end_line": 403, "span_ids": ["impl:49"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nFilePath = Annotated[Path, PathType('file')]\nDirectoryPath = Annotated[Path, PathType('dir')]\nNewPath = Annotated[Path, PathType('new')]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n Json = Annotated[AnyType, ...] # Json[list[str]] will be recognized by type checkers as list[str]\n\nelse:\n\n class Json:\n @classmethod\n def __class_getitem__(cls, item: AnyType) -> AnyType:\n return Annotated[item, cls()]\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.JsonSchema:\n return core_schema.json_schema(schema)\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n field_schema.update(type='string', format='json-string')\n return field_schema\n\n def __repr__(self) -> str:\n return 'Json'\n\n def __hash__(self) -> int:\n return hash(type(self))\n\n def __eq__(self, other: Any) -> bool:\n return type(other) == type(self)\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SECRET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSecretType = TypeVar('SecretType', str, 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_pydantic__pydantic/pydantic/types.py_SecretField_SecretField.__get_pydantic_core_schema__.return.core_schema_general_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretField_SecretField.__get_pydantic_core_schema__.return.core_schema_general_after", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 406, "end_line": 445, "span_ids": ["SecretField.__get_pydantic_core_schema__", "SecretField", "SecretField.__init__", "SecretField.get_secret_value"], "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 SecretField(abc.ABC, Generic[SecretType]):\n _error_kind: str\n\n def __init__(self, secret_value: SecretType) -> None:\n self._secret_value: SecretType = secret_value\n\n def get_secret_value(self) -> SecretType:\n return self._secret_value\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.AfterValidatorFunctionSchema:\n validator = SecretFieldValidator(cls)\n if issubclass(cls, SecretStr):\n # Use a lambda here so that `apply_metadata` can be called on the validator before the override is generated\n js_cs_override = lambda: core_schema.str_schema( # noqa E731\n min_length=validator.min_length,\n max_length=validator.max_length,\n )\n elif issubclass(cls, SecretBytes):\n js_cs_override = lambda: core_schema.bytes_schema( # noqa E731\n min_length=validator.min_length,\n max_length=validator.max_length,\n )\n else:\n js_cs_override = None\n metadata = build_metadata_dict(\n cs_update_function=validator.__pydantic_update_schema__, js_cs_override=js_cs_override\n )\n return core_schema.general_after_validator_function(\n validator,\n core_schema.union_schema(\n [core_schema.is_instance_schema(cls), cls._pre_core_schema()],\n strict=True,\n custom_error_type=cls._error_kind,\n ),\n metadata=metadata,\n serialization=core_schema.general_plain_serializer_function_ser_schema(\n cls._serialize, json_return_type='str'\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_pydantic__pydantic/pydantic/types.py_SecretField._serialize_SecretField.__repr__.return.f_self___class_____name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretField._serialize_SecretField.__repr__.return.f_self___class_____name_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 447, "end_line": 490, "span_ids": ["SecretField.__repr__", "SecretField._display", "SecretField._serialize", "SecretField.__len__", "SecretField.__eq__", "SecretField.__str__", "SecretField.__pydantic_modify_json_schema__", "SecretField._pre_core_schema", "SecretField.__hash__"], "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 SecretField(abc.ABC, Generic[SecretType]):\n\n @classmethod\n def _serialize(\n cls, value: SecretField[SecretType], info: core_schema.SerializationInfo\n ) -> str | SecretField[SecretType]:\n if info.mode == 'json':\n # we want the output to always be string without the `b'` prefix for byties,\n # hence we just use `secret_display`\n return secret_display(value)\n else:\n return value\n\n @classmethod\n @abc.abstractmethod\n def _pre_core_schema(cls) -> core_schema.CoreSchema:\n ...\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema: dict[str, Any]) -> dict[str, Any]:\n update_not_none(\n field_schema,\n type='string',\n writeOnly=True,\n format='password',\n )\n return field_schema\n\n def __eq__(self, other: Any) -> bool:\n return isinstance(other, self.__class__) and self.get_secret_value() == other.get_secret_value()\n\n def __hash__(self) -> int:\n return hash(self.get_secret_value())\n\n def __len__(self) -> int:\n return len(self._secret_value)\n\n @abc.abstractmethod\n def _display(self) -> SecretType:\n ...\n\n def __str__(self) -> str:\n return str(self._display())\n\n def __repr__(self) -> str:\n return f'{self.__class__.__name__}({self._display()!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_pydantic__pydantic/pydantic/types.py_secret_display_SecretFieldValidator.__init__.self.error_prefix._string_if_field_type_is": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_secret_display_SecretFieldValidator.__init__.self.error_prefix._string_if_field_type_is", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 493, "end_line": 506, "span_ids": ["SecretFieldValidator", "secret_display", "SecretFieldValidator.__init__"], "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 secret_display(secret_field: SecretField[Any]) -> str:\n return '**********' if secret_field.get_secret_value() else ''\n\n\nclass SecretFieldValidator(_fields.CustomValidator, Generic[SecretType]):\n __slots__ = 'field_type', 'min_length', 'max_length', 'error_prefix'\n\n def __init__(\n self, field_type: type[SecretField[SecretType]], min_length: int | None = None, max_length: int | None = None\n ) -> None:\n self.field_type: type[SecretField[SecretType]] = field_type\n self.min_length = min_length\n self.max_length = max_length\n self.error_prefix: Literal['string', 'bytes'] = 'string' if field_type is SecretStr else '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_pydantic__pydantic/pydantic/types.py_SecretFieldValidator.__call___SecretFieldValidator.__pydantic_update_schema__.self__update_attrs_constr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretFieldValidator.__call___SecretFieldValidator.__pydantic_update_schema__.self__update_attrs_constr", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 508, "end_line": 522, "span_ids": ["SecretFieldValidator.__pydantic_update_schema__", "SecretFieldValidator.__call__"], "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 SecretFieldValidator(_fields.CustomValidator, Generic[SecretType]):\n\n def __call__(self, __value: SecretField[SecretType] | SecretType, _: core_schema.ValidationInfo) -> Any:\n if self.min_length is not None and len(__value) < self.min_length:\n short_kind: core_schema.ErrorType = f'{self.error_prefix}_too_short' # type: ignore[assignment]\n raise PydanticKnownError(short_kind, {'min_length': self.min_length})\n if self.max_length is not None and len(__value) > self.max_length:\n long_kind: core_schema.ErrorType = f'{self.error_prefix}_too_long' # type: ignore[assignment]\n raise PydanticKnownError(long_kind, {'max_length': self.max_length})\n\n if isinstance(__value, self.field_type):\n return __value\n else:\n return self.field_type(__value) # type: ignore[arg-type]\n\n def __pydantic_update_schema__(self, schema: core_schema.CoreSchema, **constraints: Any) -> None:\n self._update_attrs(constraints, {'min_length', 'max_length'})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretStr_PaymentCardBrand.__str__.return.self_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretStr_PaymentCardBrand.__str__.return.self_value", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 525, "end_line": 559, "span_ids": ["SecretStr._pre_core_schema", "PaymentCardBrand", "SecretBytes._display", "SecretBytes._pre_core_schema", "SecretStr", "PaymentCardBrand.__str__", "SecretStr._display", "SecretBytes"], "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 SecretStr(SecretField[str]):\n _error_kind = 'string_type'\n\n @classmethod\n def _pre_core_schema(cls) -> core_schema.CoreSchema:\n return core_schema.str_schema()\n\n def _display(self) -> str:\n return secret_display(self)\n\n\nclass SecretBytes(SecretField[bytes]):\n _error_kind = 'bytes_type'\n\n @classmethod\n def _pre_core_schema(cls) -> core_schema.CoreSchema:\n return core_schema.bytes_schema()\n\n def _display(self) -> bytes:\n return secret_display(self).encode()\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PAYMENT CARD TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass PaymentCardBrand(str, Enum):\n # If you add another card type, please also add it to the\n # Hypothesis strategy in `pydantic._hypothesis_plugin`.\n amex = 'American Express'\n mastercard = 'Mastercard'\n visa = 'Visa'\n other = 'other'\n\n def __str__(self) -> str:\n return 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_pydantic__pydantic/pydantic/types.py_PaymentCardNumber_PaymentCardNumber.validate_digits.if_not_card_number_isdigi.raise_PydanticCustomError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber_PaymentCardNumber.validate_digits.if_not_card_number_isdigi.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 562, "end_line": 604, "span_ids": ["PaymentCardNumber.validate", "PaymentCardNumber.masked", "PaymentCardNumber.validate_digits", "PaymentCardNumber.__get_pydantic_core_schema__", "PaymentCardNumber", "PaymentCardNumber.__init__"], "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 PaymentCardNumber(str):\n \"\"\"\n Based on: https://en.wikipedia.org/wiki/Payment_card_number\n \"\"\"\n\n strip_whitespace: ClassVar[bool] = True\n min_length: ClassVar[int] = 12\n max_length: ClassVar[int] = 19\n bin: str\n last4: str\n brand: PaymentCardBrand\n\n def __init__(self, card_number: str):\n self.validate_digits(card_number)\n\n card_number = self.validate_luhn_check_digit(card_number)\n\n self.bin = card_number[:6]\n self.last4 = card_number[-4:]\n self.brand = self.validate_brand(card_number)\n\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.AfterValidatorFunctionSchema:\n return core_schema.general_after_validator_function(\n cls.validate,\n core_schema.str_schema(\n min_length=cls.min_length, max_length=cls.max_length, strip_whitespace=cls.strip_whitespace\n ),\n )\n\n @classmethod\n def validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> PaymentCardNumber:\n return cls(__input_value)\n\n @property\n def masked(self) -> str:\n num_masked = len(self) - 10 # len(bin) + len(last4) == 10\n return f'{self.bin}{\"*\" * num_masked}{self.last4}'\n\n @classmethod\n def validate_digits(cls, card_number: str) -> None:\n if not card_number.isdigit():\n raise PydanticCustomError('payment_card_number_digits', 'Card number is not all digits')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber.validate_luhn_check_digit_PaymentCardNumber.validate_luhn_check_digit.return.card_number": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber.validate_luhn_check_digit_PaymentCardNumber.validate_luhn_check_digit.return.card_number", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 606, "end_line": 624, "span_ids": ["PaymentCardNumber.validate_luhn_check_digit"], "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 PaymentCardNumber(str):\n\n @classmethod\n def validate_luhn_check_digit(cls, card_number: str) -> str:\n \"\"\"\n Based on: https://en.wikipedia.org/wiki/Luhn_algorithm\n \"\"\"\n sum_ = int(card_number[-1])\n length = len(card_number)\n parity = length % 2\n for i in range(length - 1):\n digit = int(card_number[i])\n if i % 2 == parity:\n digit *= 2\n if digit > 9:\n digit -= 9\n sum_ += digit\n valid = sum_ % 10 == 0\n if not valid:\n raise PydanticCustomError('payment_card_number_luhn', 'Card number is not luhn valid')\n return card_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_pydantic__pydantic/pydantic/types.py_PaymentCardNumber.validate_brand_PaymentCardNumber.validate_brand.return.brand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PaymentCardNumber.validate_brand_PaymentCardNumber.validate_brand.return.brand", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 626, "end_line": 660, "span_ids": ["PaymentCardNumber.validate_brand"], "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 PaymentCardNumber(str):\n\n @staticmethod\n def validate_brand(card_number: str) -> PaymentCardBrand:\n \"\"\"\n Validate length based on BIN for major brands:\n https://en.wikipedia.org/wiki/Payment_card_number#Issuer_identification_number_(IIN)\n \"\"\"\n if card_number[0] == '4':\n brand = PaymentCardBrand.visa\n elif 51 <= int(card_number[:2]) <= 55:\n brand = PaymentCardBrand.mastercard\n elif card_number[:2] in {'34', '37'}:\n brand = PaymentCardBrand.amex\n else:\n brand = PaymentCardBrand.other\n\n required_length: None | int | str = None\n if brand in PaymentCardBrand.mastercard:\n required_length = 16\n valid = len(card_number) == required_length\n elif brand == PaymentCardBrand.visa:\n required_length = '13, 16 or 19'\n valid = len(card_number) in {13, 16, 19}\n elif brand == PaymentCardBrand.amex:\n required_length = 15\n valid = len(card_number) == required_length\n else:\n valid = True\n\n if not valid:\n raise PydanticCustomError(\n 'payment_card_number_brand',\n 'Length for a {brand} card must be {required_length}',\n {'brand': brand, 'required_length': required_length},\n )\n return brand", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_13_byte_string_re.re_compile_r_s_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_13_byte_string_re.re_compile_r_s_d_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 663, "end_line": 681, "span_ids": ["PaymentCardNumber.validate_brand", "impl:61"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTE SIZE TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nBYTE_SIZES = {\n 'b': 1,\n 'kb': 10**3,\n 'mb': 10**6,\n 'gb': 10**9,\n 'tb': 10**12,\n 'pb': 10**15,\n 'eb': 10**18,\n 'kib': 2**10,\n 'mib': 2**20,\n 'gib': 2**30,\n 'tib': 2**40,\n 'pib': 2**50,\n 'eib': 2**60,\n}\nBYTE_SIZES.update({k.lower()[0]: v for k, v in BYTE_SIZES.items() if 'i' not in k})\nbyte_string_re = re.compile(r'^\\s*(\\d*\\.?\\d+)\\s*(\\w+)?', re.IGNORECASE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize_ByteSize.validate.return.cls_int_float_scalar_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize_ByteSize.validate.return.cls_int_float_scalar_u", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 684, "end_line": 710, "span_ids": ["ByteSize.validate", "ByteSize", "ByteSize.__get_pydantic_core_schema__"], "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 ByteSize(int):\n @classmethod\n def __get_pydantic_core_schema__(cls, **_kwargs: Any) -> core_schema.PlainValidatorFunctionSchema:\n # TODO better schema\n return core_schema.general_plain_validator_function(cls.validate)\n\n @classmethod\n def validate(cls, __input_value: Any, _: core_schema.ValidationInfo) -> ByteSize:\n try:\n return cls(int(__input_value))\n except ValueError:\n pass\n\n str_match = byte_string_re.match(str(__input_value))\n if str_match is None:\n raise PydanticCustomError('byte_size', 'could not parse value and unit from byte string')\n\n scalar, unit = str_match.groups()\n if unit is None:\n unit = 'b'\n\n try:\n unit_mult = BYTE_SIZES[unit.lower()]\n except KeyError:\n raise PydanticCustomError('byte_size_unit', 'could not interpret byte unit: {unit}', {'unit': unit})\n\n return cls(int(float(scalar) * unit_mult))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.human_readable_ByteSize.to.return.self_unit_div": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.human_readable_ByteSize.to.return.self_unit_div", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 712, "end_line": 739, "span_ids": ["ByteSize.human_readable", "ByteSize.to"], "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 ByteSize(int):\n\n def human_readable(self, decimal: bool = False) -> str:\n if decimal:\n divisor = 1000\n units = 'B', 'KB', 'MB', 'GB', 'TB', 'PB'\n final_unit = 'EB'\n else:\n divisor = 1024\n units = 'B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'\n final_unit = 'EiB'\n\n num = float(self)\n for unit in units:\n if abs(num) < divisor:\n if unit == 'B':\n return f'{num:0.0f}{unit}'\n else:\n return f'{num:0.1f}{unit}'\n num /= divisor\n\n return f'{num:0.1f}{final_unit}'\n\n def to(self, unit: str) -> float:\n try:\n unit_div = BYTE_SIZES[unit.lower()]\n except KeyError:\n raise PydanticCustomError('byte_size_unit', 'Could not interpret byte unit: {unit}', {'unit': unit})\n\n return self / unit_div", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_14_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_14_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 742, "end_line": 828, "span_ids": ["condate", "impl:66", "ByteSize.to", "impl:72"], "tokens": 661}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTES TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATE TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n PastDate = Annotated[date, ...]\n FutureDate = Annotated[date, ...]\nelse:\n\n class PastDate:\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n if schema is None:\n # used directly as a type\n return core_schema.date_schema(now_op='past')\n else:\n assert schema['type'] == 'date'\n schema['now_op'] = 'past'\n return schema\n\n def __repr__(self) -> str:\n return 'PastDate'\n\n class FutureDate:\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n if schema is None:\n # used directly as a type\n return core_schema.date_schema(now_op='future')\n else:\n assert schema['type'] == 'date'\n schema['now_op'] = 'future'\n return schema\n\n def __repr__(self) -> str:\n return 'FutureDate'\n\n\ndef condate(*, strict: bool = None, gt: date = None, ge: date = None, lt: date = None, le: date = None) -> type[date]:\n return Annotated[ # type: ignore[return-value]\n date,\n Strict(strict) if strict is not None else None,\n annotated_types.Interval(gt=gt, ge=ge, lt=lt, le=le),\n ]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATETIME TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n AwareDatetime = Annotated[datetime, ...]\n NaiveDatetime = Annotated[datetime, ...]\nelse:\n\n class AwareDatetime:\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n if schema is None:\n # used directly as a type\n return core_schema.datetime_schema(tz_constraint='aware')\n else:\n assert schema['type'] == 'datetime'\n schema['tz_constraint'] = 'aware'\n return schema\n\n def __repr__(self) -> str:\n return 'AwareDatetime'\n\n class NaiveDatetime:\n @classmethod\n def __get_pydantic_core_schema__(\n cls, schema: core_schema.CoreSchema | None = None, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n if schema is None:\n # used directly as a type\n return core_schema.datetime_schema(tz_constraint='naive')\n else:\n assert schema['type'] == 'datetime'\n schema['tz_constraint'] = 'naive'\n return schema\n\n def __repr__(self) -> str:\n return 'NaiveDatetime'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py___all___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py___all___", "embedding": null, "metadata": {"file_path": "pydantic/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["impl", "version_info"], "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": "__all__ = 'VERSION', 'version_info'\n\nVERSION = '2.0a1'\n\n\ndef version_info() -> str:\n import platform\n import sys\n from importlib import import_module\n from pathlib import Path\n\n optional_deps = []\n for p in 'devtools', 'email-validator', 'typing-extensions':\n try:\n import_module(p.replace('-', '_'))\n except ImportError:\n continue\n optional_deps.append(p)\n\n info = {\n 'pydantic version': VERSION,\n 'install path': Path(__file__).resolve().parent,\n 'python version': sys.version,\n 'platform': platform.platform(),\n 'optional deps. installed': optional_deps,\n }\n return '\\n'.join('{:>30} {}'.format(k + ':', str(v).replace('\\n', ' ')) for k, v in info.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_pydantic__pydantic/tests/conftest.py_importlib__create_module_file.return.name_str_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_importlib__create_module_file.return.name_str_path_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["imports", "pytest_addoption", "_extract_source_code_from_function", "_create_module_file"], "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": "import importlib\nimport inspect\nimport re\nimport secrets\nimport sys\nimport textwrap\nfrom dataclasses import dataclass\nfrom types import FunctionType\nfrom typing import Any, Optional\n\nimport pytest\nfrom _pytest.assertion.rewrite import AssertionRewritingHook\n\n\ndef pytest_addoption(parser):\n parser.addoption('--test-mypy', action='store_true', help='run mypy tests')\n\n\ndef _extract_source_code_from_function(function):\n if function.__code__.co_argcount:\n raise RuntimeError(f'function {function.__qualname__} cannot have any arguments')\n\n code_lines = ''\n body_started = False\n for line in textwrap.dedent(inspect.getsource(function)).split('\\n'):\n if line.startswith('def '):\n body_started = True\n continue\n elif body_started:\n code_lines += f'{line}\\n'\n\n return textwrap.dedent(code_lines)\n\n\ndef _create_module_file(code, tmp_path, name):\n name = f'{name}_{secrets.token_hex(5)}'\n path = tmp_path / f'{name}.py'\n path.write_text(code)\n return name, str(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_pydantic__pydantic/tests/conftest.py_create_module_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_create_module_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 87, "span_ids": ["create_module", "Err", "Err.message_escaped", "Err.__repr__"], "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": "@pytest.fixture\ndef create_module(tmp_path, request):\n def run(source_code_or_function, rewrite_assertions=True):\n \"\"\"\n Create module object, execute it and return\n Can be used as a decorator of the function from the source code of which the module will be constructed\n\n :param source_code_or_function string or function with body as a source code for created module\n :param rewrite_assertions: whether to rewrite assertions in module or not\n\n \"\"\"\n if isinstance(source_code_or_function, FunctionType):\n source_code = _extract_source_code_from_function(source_code_or_function)\n else:\n source_code = source_code_or_function\n\n module_name, filename = _create_module_file(source_code, tmp_path, request.node.name)\n\n if rewrite_assertions:\n loader = AssertionRewritingHook(config=request.config)\n loader.mark_rewrite(module_name)\n else:\n loader = None\n\n spec = importlib.util.spec_from_file_location(module_name, filename, loader=loader)\n sys.modules[module_name] = module = importlib.util.module_from_spec(spec)\n spec.loader.exec_module(module)\n return module\n\n return run\n\n\n@dataclass\nclass Err:\n message: str\n errors: Optional[Any] = None\n\n def __repr__(self):\n if self.errors:\n return f'Err({self.message!r}, errors={self.errors!r})'\n else:\n return f'Err({self.message!r})'\n\n def message_escaped(self):\n return re.escape(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_pydantic__pydantic/tests/mypy/modules/custom_constructor.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/custom_constructor.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/custom_constructor.py", "file_name": "custom_constructor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "Person", "Person.__init__", "impl"], "tokens": 74}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 pydantic import BaseModel\n\n\nclass Person(BaseModel):\n id: int\n name: str\n birth_year: int\n\n def __init__(self, id: int) -> None:\n super().__init__(id=id, name='Patrick', birth_year=1991)\n\n\nPerson(1)\nPerson(id=1)\nPerson(name='Patrick')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/dataclass_no_any.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/dataclass_no_any.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/dataclass_no_any.py", "file_name": "dataclass_no_any.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["Bar", "imports", "Foo"], "tokens": 39}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 pydantic.dataclasses import dataclass\n\n\n@dataclass\nclass Foo:\n foo: int\n\n\n@dataclass(config=dict(title='Bar Title'))\nclass Bar:\n bar: 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_pydantic__pydantic/tests/mypy/modules/fail1.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail1.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/fail1.py", "file_name": "fail1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["impl", "Model", "docstring"], "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": "\"\"\"\nTest mypy failure with missing attribute\n\"\"\"\nfrom datetime import datetime\nfrom typing import List, Optional\n\nfrom pydantic import BaseModel\nfrom pydantic.types import Json\n\n\nclass Model(BaseModel):\n age: int\n first_name = 'John'\n last_name: Optional[str] = None\n signup_ts: Optional[datetime] = None\n list_of_ints: List[int]\n json_list_of_ints: Json[List[int]]\n\n\nm = Model(age=42, list_of_ints=[1, '2', b'3'])\n\nprint(m.age + 'not integer')\nm.json_list_of_ints[0] + 'not integer'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail2.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail2.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/fail2.py", "file_name": "fail2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["impl", "Model", "docstring"], "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": "\"\"\"\nTest mypy failure with invalid types.\n\"\"\"\nfrom datetime import datetime\nfrom typing import List, Optional\n\nfrom pydantic import BaseModel\n\n\nclass Model(BaseModel):\n age: int\n first_name = 'John'\n last_name: Optional[str] = None\n signup_ts: Optional[datetime] = None\n list_of_ints: List[int]\n\n\nm = Model(age=42, list_of_ints=[1, '2', b'3'])\n\nprint(m.foobar)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail3.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/fail3.py", "file_name": "fail3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["impl:3", "WrapperModel", "Model", "docstring"], "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": "\"\"\"\nTest mypy failure with invalid types.\n\"\"\"\nfrom typing import Generic, List, TypeVar\n\nfrom pydantic import BaseModel\n\n# placeholder for removed line\nT = TypeVar('T')\n\n\nclass Model(BaseModel):\n list_of_ints: List[int]\n\n\nclass WrapperModel(BaseModel, Generic[T]):\n payload: T\n\n\nmodel_instance = Model(list_of_ints=[1])\nwrapper_instance = WrapperModel[Model](payload=model_instance)\nwrapper_instance.payload.list_of_ints.append('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_pydantic__pydantic/tests/mypy/modules/fail4.py_from_typing_import_Any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail4.py_from_typing_import_Any_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/fail4.py", "file_name": "fail4.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 47, "span_ids": ["Model.validate_3", "impl", "imports", "Model.validate_2", "Model.validate_1", "bar", "Model", "impl:8", "foo"], "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": "from typing import Any\n\nfrom pydantic import BaseModel, root_validator, validate_arguments\n\n\n@validate_arguments\ndef foo(a: int, *, c: str = 'x') -> str:\n return c * a\n\n\n# ok\nx: str = foo(1, c='hello')\n# fails\nfoo('x')\nfoo(1, c=1)\nfoo(1, 2)\nfoo(1, d=2)\n# mypy assumes foo is just a function\ncallable(foo.raw_function)\n\n\n@validate_arguments\ndef bar() -> str:\n return 'x'\n\n\n# return type should be a string\ny: int = bar()\n\n\n# Demonstrate type errors for root_validator signatures\nclass Model(BaseModel):\n @root_validator()\n @classmethod\n def validate_1(cls, values: Any) -> Any:\n return values\n\n @root_validator(pre=True, skip_on_failure=True)\n @classmethod\n def validate_2(cls, values: Any) -> Any:\n return values\n\n @root_validator(pre=False)\n @classmethod\n def validate_3(cls, values: Any) -> Any:\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_pydantic__pydantic/tests/mypy/modules/fail_defaults.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/fail_defaults.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/fail_defaults.py", "file_name": "fail_defaults.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["imports", "Model", "impl"], "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": "from pydantic import BaseModel, Field\n\n\nclass Model(BaseModel):\n # Required\n undefined_default_no_args: int = Field()\n undefined_default: int = Field(description='my desc')\n positional_ellipsis_default: int = Field(...)\n named_ellipsis_default: int = Field(default=...)\n\n # Not required\n positional_default: int = Field(1)\n named_default: int = Field(default=2)\n named_default_factory: int = Field(default_factory=lambda: 3)\n\n\nModel()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_default_factory.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_default_factory.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_default_factory.py", "file_name": "plugin_default_factory.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["new_list", "Model", "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": "\"\"\"\nSee https://github.com/pydantic/pydantic/issues/4457\n\"\"\"\n\nfrom typing import Dict, List\n\nfrom pydantic import BaseModel, Field\n\n\ndef new_list() -> List[int]:\n return []\n\n\nclass Model(BaseModel):\n l1: List[str] = Field(default_factory=list)\n l2: List[int] = Field(default_factory=new_list)\n l3: List[str] = Field(default_factory=lambda: list())\n l4: Dict[str, str] = Field(default_factory=dict)\n l5: int = Field(default_factory=lambda: 123)\n l6_error: List[str] = Field(default_factory=new_list)\n l7_error: int = Field(default_factory=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_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_from_typing_import_Generi_DynamicAliasModel.z": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_from_typing_import_Generi_DynamicAliasModel.z", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 153, "span_ids": ["DefaultTestingModel", "KwargsModel", "impl", "impl:29", "KwargsBadConfig2", "UndefinedAnnotationModel", "Model", "KwargsInheritingModel", "KwargsBadExtraModel", "impl:19", "InheritingModel", "impl:27", "impl:33", "KwargsModel.method", "impl:17", "AliasModel", "Response", "Model.method", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadExtraButIgnoredModel", "BadConfig2", "KwargsBadConfig1", "impl:20", "impl:9", "BadConfig1", "Blah", "DynamicAliasModel", "ForbidExtraModel", "impl:18"], "tokens": 824}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 Generic, List, Optional, Set, TypeVar, Union\n\nfrom pydantic import BaseModel, ConfigDict, Extra, Field, field_validator\nfrom pydantic.dataclasses import dataclass\n\n\n# placeholder for removed line\nclass Model(BaseModel):\n model_config = ConfigDict(alias_generator=None, frozen=True, extra=Extra.forbid)\n x: int\n y: str\n\n def method(self) -> None:\n pass\n\n\nmodel = Model(x=1, y='y', z='z')\nmodel = Model(x=1)\nmodel.y = 'a'\nModel.from_orm({})\nModel.from_orm({}) # type: ignore[pydantic-orm]\n\n\nclass KwargsModel(BaseModel, alias_generator=None, frozen=True, extra=Extra.forbid):\n x: int\n y: str\n\n def method(self) -> None:\n pass\n\n\nkwargs_model = KwargsModel(x=1, y='y', z='z')\nkwargs_model = KwargsModel(x=1)\nkwargs_model.y = 'a'\nKwargsModel.from_orm({})\nKwargsModel.from_orm({}) # type: ignore[pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra='forbid') # type: ignore[typeddict-item]\n\n\nForbidExtraModel(x=1)\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass BadExtraButIgnoredModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item,pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n pass\n\n\nclass InheritingModel(Model):\n model_config = ConfigDict(frozen=False)\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\n pass\n\n\nclass DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n j = 1\n\n\nDefaultTestingModel()\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n\n\nUndefinedAnnotationModel()\n\n\nModel.model_construct(x=1)\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\nModel(x='1', y='2')\n\n\nclass Blah(BaseModel):\n fields_set: Optional[Set[str]] = None\n\n\n# (comment to keep line numbers unchanged)\nT = TypeVar('T')\n\n\nclass Response(BaseModel, Generic[T]):\n data: T\n error: Optional[str]\n\n\nresponse = Response[Model](data=model, error=None)\nresponse = Response[Model](data=1, error=None)\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n z: 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_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_DynamicAliasModel_y_y__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_DynamicAliasModel_y_y__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 295, "span_ids": ["impl:49", "KwargsAliasGeneratorModel", "impl:54", "impl:44", "impl:46", "AddProject", "impl:39", "AliasGeneratorModel2", "CoverageTester", "_default_factory", "ModelWithAnnotatedValidator", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "impl:36", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:41", "DynamicAliasModel2", "KwargsAliasGeneratorModel2", "impl:51", "impl:58", "ModelWithAnnotatedValidator.instance_method", "impl:52", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:37", "KwargsDynamicAliasModel"], "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": "DynamicAliasModel(y='y', z='1')\n\n\nclass DynamicAliasModel2(BaseModel):\n x: str = Field(..., alias=x_alias)\n z: int\n\n model_config = ConfigDict(populate_by_name=True)\n\n\nDynamicAliasModel2(y='y', z=1)\nDynamicAliasModel2(x='y', z=1)\n\n\nclass KwargsDynamicAliasModel(BaseModel, populate_by_name=True):\n x: str = Field(..., alias=x_alias)\n z: int\n\n\nKwargsDynamicAliasModel(y='y', z=1)\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n x: int = Field(..., alias='y')\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_') # type: ignore[pydantic-alias]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\nAliasGeneratorModel2(y=1, z=1)\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n x: int\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n x: int = Field(..., alias='y')\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, z=1)\n\n\nclass CoverageTester(Missing): # noqa F821\n def from_orm(self) -> None:\n pass\n\n\nCoverageTester().from_orm()\n\n\n@dataclass(config={})\nclass AddProject:\n name: str\n slug: Optional[str]\n description: Optional[str]\n\n\np = AddProject(name='x', slug='y', description='z')\n\n\n# Same as Model, but with frozen = True\nclass FrozenModel(BaseModel):\n x: int\n y: str\n\n model_config = ConfigDict(alias_generator=None, frozen=True, extra=Extra.forbid)\n\n\nfrozenmodel = FrozenModel(x=1, y='b')\nfrozenmodel.y = 'a'\n\n\nclass InheritingModel2(FrozenModel):\n model_config = ConfigDict(frozen=False)\n\n\ninheriting2 = InheritingModel2(x=1, y='c')\ninheriting2.y = 'd'\n\n\ndef _default_factory() -> str:\n return 'x'\n\n\ntest: List[str] = []\n\n\nclass FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n f: int = None\n\n # Default factory\n g: str = Field(default_factory=set)\n h: int = Field(default_factory=_default_factory)\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n\n # Default and default factory\n m: int = Field(default=1, default_factory=list)\n\n\nclass ModelWithAnnotatedValidator(BaseModel):\n name: str\n\n @field_validator('name')\n def noop_validator_with_annotations(self, name: str) -> str:\n # This is a mistake: the first argument to a validator is the class itself,\n # like a classmethod.\n self.instance_method()\n return name\n\n def instance_method(self) -> 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_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_from_typing_import_Any_G_DynamicAliasModel_y_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_from_typing_import_Any_G_DynamicAliasModel_y_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 165, "span_ids": ["DefaultTestingModel", "KwargsModel", "impl", "impl:29", "KwargsBadConfig2", "UndefinedAnnotationModel", "Model.Config", "Model", "KwargsInheritingModel", "KwargsBadExtraModel", "impl:19", "InheritingModel", "impl:27", "impl:33", "KwargsModel.method", "BadConfig2.Config", "impl:17", "AliasModel", "Response", "Model.method", "ForbidExtraModel.Config", "impl:36", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "impl:20", "impl:9", "BadConfig1", "Blah", "BadExtraModel.Config", "BadConfig1.Config", "InheritingModel.Config", "DynamicAliasModel", "ForbidExtraModel", "impl:18", "Model.Config.config_method"], "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": "from typing import Any, Generic, List, Optional, Set, TypeVar, Union\n\nfrom pydantic import BaseModel, Extra, Field, field_validator\nfrom pydantic.dataclasses import dataclass\n\n\n# placeholder for removed line\nclass Model(BaseModel):\n x: int\n y: str\n\n def method(self) -> None:\n pass\n\n class Config:\n alias_generator = None\n frozen = True\n extra = Extra.forbid\n\n def config_method(self) -> None:\n ...\n\n\nmodel = Model(x=1, y='y', z='z')\nmodel = Model(x=1)\nmodel.y = 'a'\nModel.from_orm({})\nModel.from_orm({}) # type: ignore[pydantic-orm]\n\n\nclass KwargsModel(BaseModel, alias_generator=None, frozen=True, extra=Extra.forbid):\n x: int\n y: str\n\n def method(self) -> None:\n pass\n\n\nkwargs_model = KwargsModel(x=1, y='y', z='z')\nkwargs_model = KwargsModel(x=1)\nkwargs_model.y = 'a'\nKwargsModel.from_orm({})\nKwargsModel.from_orm({}) # type: ignore[pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n pass\n\n\nclass InheritingModel(Model):\n class Config:\n frozen = False\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\n pass\n\n\nclass DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n j = 1\n\n\nDefaultTestingModel()\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n\n\nUndefinedAnnotationModel()\n\n\nModel.model_construct(x=1)\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\nModel(x='1', y='2')\n\n\nclass Blah(BaseModel):\n fields_set: Optional[Set[str]] = None\n\n\n# (comment to keep line numbers unchanged)\nT = TypeVar('T')\n\n\nclass Response(BaseModel, Generic[T]):\n data: T\n error: Optional[str]\n\n\nresponse = Response[Model](data=model, error=None)\nresponse = Response[Model](data=1, error=None)\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n z: int\n\n\nDynamicAliasModel(y='y', z='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_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_DynamicAliasModel2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_DynamicAliasModel2_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 168, "end_line": 311, "span_ids": ["AliasGeneratorModel.Config", "impl:49", "KwargsAliasGeneratorModel", "impl:54", "DynamicAliasModel2.Config", "impl:44", "impl:46", "AliasGeneratorModel2.Config", "AddProject", "impl:39", "AliasGeneratorModel2", "CoverageTester", "_default_factory", "ModelWithAnnotatedValidator", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:41", "DynamicAliasModel2", "KwargsAliasGeneratorModel2", "impl:51", "impl:58", "ModelWithAnnotatedValidator.instance_method", "impl:52", "FrozenModel.Config", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:37", "InheritingModel2.Config", "KwargsDynamicAliasModel"], "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": "class DynamicAliasModel2(BaseModel):\n x: str = Field(..., alias=x_alias)\n z: int\n\n class Config:\n populate_by_name = True\n\n\nDynamicAliasModel2(y='y', z=1)\nDynamicAliasModel2(x='y', z=1)\n\n\nclass KwargsDynamicAliasModel(BaseModel, populate_by_name=True):\n x: str = Field(..., alias=x_alias)\n z: int\n\n\nKwargsDynamicAliasModel(y='y', z=1)\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n x: int\n\n class Config:\n alias_generator = lambda x: x + '_' # noqa E731\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n x: int = Field(..., alias='y')\n\n class Config: # type: ignore[pydantic-alias]\n alias_generator = lambda x: x + '_' # noqa E731\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\nAliasGeneratorModel2(y=1, z=1)\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n x: int\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n x: int = Field(..., alias='y')\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, z=1)\n\n\nclass CoverageTester(Missing): # noqa F821\n def from_orm(self) -> None:\n pass\n\n\nCoverageTester().from_orm()\n\n\n@dataclass(config={})\nclass AddProject:\n name: str\n slug: Optional[str]\n description: Optional[str]\n\n\np = AddProject(name='x', slug='y', description='z')\n\n\n# Same as Model, but with frozen = True\nclass FrozenModel(BaseModel):\n x: int\n y: str\n\n class Config:\n alias_generator = None\n frozen = True\n extra = Extra.forbid\n\n\nfrozenmodel = FrozenModel(x=1, y='b')\nfrozenmodel.y = 'a'\n\n\nclass InheritingModel2(FrozenModel):\n class Config:\n frozen = False\n\n\ninheriting2 = InheritingModel2(x=1, y='c')\ninheriting2.y = 'd'\n\n\ndef _default_factory() -> str:\n return 'x'\n\n\ntest: List[str] = []\n\n\nclass FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n f: int = None\n\n # Default factory\n g: str = Field(default_factory=set)\n h: int = Field(default_factory=_default_factory)\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n\n # Default and default factory\n m: int = Field(default=1, default_factory=list)\n\n\nclass ModelWithAnnotatedValidator(BaseModel):\n name: str\n\n @field_validator('name')\n def noop_validator_with_annotations(self, name: str) -> str:\n # This is a mistake: the first argument to a validator is the class itself,\n # like a classmethod.\n self.instance_method()\n return name\n\n def instance_method(self) -> 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_pydantic__pydantic/tests/mypy/modules/plugin_success.py_from_typing_import_ClassV_KwargsFrozenModel.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success.py_from_typing_import_ClassV_KwargsFrozenModel.x", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 176, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "impl:44", "MutationModel", "AddProject", "Model", "NotFrozenModel", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "FrozenModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "KwargsFrozenModel", "Mixin", "ClassVarModel", "ForwardReferencingModel", "impl:36", "OverrideModel", "imports", "impl:16", "KwargsNoMutationModel", "impl:28", "impl:34", "FutureModel", "NestedModel:2", "Mixin.f", "NestedModel.Model", "impl:10", "impl:25", "NoMutationModel", "SelfReferencingModel"], "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": "from typing import ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator\nfrom pydantic.dataclasses import dataclass\n\n\n# placeholder for removed line\nclass Model(BaseModel):\n x: float\n y: str\n\n model_config = ConfigDict(from_attributes=True)\n\n\nclass SelfReferencingModel(BaseModel):\n submodel: Optional['SelfReferencingModel']\n\n @property\n def prop(self) -> None:\n ...\n\n\nSelfReferencingModel.model_rebuild()\n\nmodel = Model(x=1, y='y')\nModel(x=1, y='y', z='z')\nmodel.x = 2\nmodel.model_validate(model.__dict__) # TODO: Change this to .model_validate(model) when possible\n\nself_referencing_model = SelfReferencingModel(submodel=SelfReferencingModel(submodel=None))\n\n\nclass KwargsModel(BaseModel, from_attributes=True):\n x: float\n y: str\n\n\nkwargs_model = KwargsModel(x=1, y='y')\nKwargsModel(x=1, y='y', z='z')\nkwargs_model.x = 2\nkwargs_model.model_validate(kwargs_model.__dict__)\n\n\nclass InheritingModel(Model):\n z: int = 1\n\n\nInheritingModel.model_validate(model.__dict__)\n\n\nclass ForwardReferencingModel(Model):\n model_config = dict(undefined_types_warning=False)\n\n future: 'FutureModel'\n\n\nclass FutureModel(Model):\n pass\n\n\nForwardReferencingModel.model_rebuild()\nfuture_model = FutureModel(x=1, y='a')\nforward_model = ForwardReferencingModel(x=1, y='a', future=future_model)\n\n\nclass NoMutationModel(BaseModel):\n x: int\n\n model_config = ConfigDict(frozen=True)\n\n\nclass MutationModel(NoMutationModel):\n a: int = 1\n\n model_config = ConfigDict(frozen=False, from_attributes=True)\n\n\nMutationModel(x=1).x = 2\nMutationModel.model_validate(model.__dict__)\n\n\nclass KwargsNoMutationModel(BaseModel, frozen=True):\n x: int\n\n\nclass KwargsMutationModel(KwargsNoMutationModel, frozen=False, from_attributes=True):\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\nKwargsMutationModel.model_validate(model.__dict__)\n\n\nclass OverrideModel(Model):\n x: int\n\n\nOverrideModel(x=1, y='b')\n\n\nclass Mixin:\n def f(self) -> None:\n pass\n\n\nclass MultiInheritanceModel(BaseModel, Mixin):\n pass\n\n\nMultiInheritanceModel().f()\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n\n\nalias_model = AliasModel(y='hello')\nassert alias_model.x == 'hello'\n\n\nclass ClassVarModel(BaseModel):\n x: int\n y: ClassVar[int] = 1\n\n\nClassVarModel(x=1)\n\n\n@dataclass(config={'validate_assignment': True})\nclass AddProject:\n name: str\n slug: Optional[str]\n description: Optional[str]\n\n\np = AddProject(name='x', slug='y', description='z')\n\n\nclass TypeAliasAsAttribute(BaseModel):\n __type_alias_attribute__ = Union[str, bytes]\n\n\nclass NestedModel(BaseModel):\n class Model(BaseModel):\n id: str\n\n model: Model\n\n\n_ = NestedModel.Model\n\n\nDynamicModel = create_model('DynamicModel', __base__=Model)\n\ndynamic_model = DynamicModel(x=1, y='y')\ndynamic_model.x = 2\n\n\nclass FrozenModel(BaseModel):\n x: int\n\n model_config = ConfigDict(frozen=True)\n\n\nclass NotFrozenModel(FrozenModel):\n a: int = 1\n\n model_config = ConfigDict(frozen=False, from_attributes=True)\n\n\nNotFrozenModel(x=1).x = 2\nNotFrozenModel.model_validate(model.__dict__)\n\n\nclass KwargsFrozenModel(BaseModel, frozen=True):\n x: 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_pydantic__pydantic/tests/mypy/modules/plugin_success.py_KwargsNotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success.py_KwargsNotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 279, "span_ids": ["impl:54", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "impl:47", "Response", "ModelWithSelfField", "ModelWithAllowReuseValidator", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "impl:69", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 527}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class KwargsNotFrozenModel(FrozenModel, frozen=False, from_attributes=True):\n a: int = 1\n\n\nKwargsNotFrozenModel(x=1).x = 2\nKwargsNotFrozenModel.model_validate(model.__dict__)\n\n\nclass ModelWithSelfField(BaseModel):\n self: str\n\n\ndef f(name: str) -> str:\n return name\n\n\nclass ModelWithAllowReuseValidator(BaseModel):\n name: str\n normalize_name = field_validator('name', allow_reuse=True)(f)\n\n\nmodel_with_allow_reuse_validator = ModelWithAllowReuseValidator(name='xyz')\n\n\nT = TypeVar('T')\n\n\nclass Response(BaseModel, Generic[T]):\n data: T\n error: Optional[str]\n\n\nresponse = Response[Model](data=model, error=None)\n\n\nclass ModelWithAnnotatedValidator(BaseModel):\n name: str\n\n @field_validator('name')\n def noop_validator_with_annotations(cls, name: str) -> str:\n return name\n\n\ndef _default_factory_str() -> str:\n return 'x'\n\n\ndef _default_factory_list() -> List[int]:\n return [1, 2, 3]\n\n\nclass FieldDefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = Field()\n c: int = Field(...)\n\n # Default\n d: int = Field(1)\n\n # Default factory\n g: List[int] = Field(default_factory=_default_factory_list)\n h: str = Field(default_factory=_default_factory_str)\n i: str = Field(default_factory=lambda: 'test')\n\n\n_TModel = TypeVar('_TModel')\n_TType = TypeVar('_TType')\n\n\nclass OrmMixin(Generic[_TModel, _TType]):\n @classmethod\n def from_orm(cls, model: _TModel) -> _TType:\n raise NotImplementedError\n\n @classmethod\n def from_orm_optional(cls, model: Optional[_TModel]) -> Optional[_TType]:\n if model is None:\n return None\n return cls.from_orm(model)\n\n\nimport sys # noqa E402\n\nif sys.version_info >= (3, 8):\n from dataclasses import InitVar # E402\n\n InitVarStr = InitVar[str]\nelse:\n # InitVar is not supported in 3.7 due to loss of type information\n InitVarStr = str\n\n\n@dataclass\nclass MyDataClass:\n foo: InitVarStr\n bar: str\n\n\nMyDataClass(foo='foo', 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_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel_model_vali": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel_model_vali", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 178, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "impl:44", "MutationModel", "AddProject", "Model", "NotFrozenModel", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "FrozenModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "Mixin", "ClassVarModel", "ForwardReferencingModel", "impl:36", "OverrideModel", "Model.NotConfig", "imports", "impl:16", "KwargsNoMutationModel", "impl:28", "impl:34", "KwargsModel.NotConfig", "FutureModel", "NestedModel:2", "Mixin.f", "NestedModel.Model", "impl:10", "impl:25", "NoMutationModel", "SelfReferencingModel"], "tokens": 824}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom pydantic import BaseModel, Field, create_model, field_validator\nfrom pydantic.dataclasses import dataclass\n\n\n# placeholder for removed line\nclass Model(BaseModel):\n x: float\n y: str\n\n model_config = dict(from_attributes=True)\n\n class NotConfig:\n frozen = True\n\n\nclass SelfReferencingModel(BaseModel):\n submodel: Optional['SelfReferencingModel']\n\n @property\n def prop(self) -> None:\n ...\n\n\nSelfReferencingModel.model_rebuild()\n\nmodel = Model(x=1, y='y')\nModel(x=1, y='y', z='z')\nmodel.x = 2\nmodel.model_validate(model.__dict__) # TODO: Change to .model_validate(model) when possible\n\nself_referencing_model = SelfReferencingModel(submodel=SelfReferencingModel(submodel=None))\n\n\nclass KwargsModel(BaseModel, from_attributes=True):\n x: float\n y: str\n\n class NotConfig:\n frozen = True\n\n\nkwargs_model = KwargsModel(x=1, y='y')\nKwargsModel(x=1, y='y', z='z')\nkwargs_model.x = 2\nkwargs_model.model_validate(kwargs_model.__dict__)\n\n\nclass InheritingModel(Model):\n z: int = 1\n\n\nInheritingModel.model_validate(model.__dict__)\n\n\nclass ForwardReferencingModel(Model):\n future: 'FutureModel'\n\n model_config = dict(undefined_types_warning=False)\n\n\nclass FutureModel(Model):\n pass\n\n\nForwardReferencingModel.model_rebuild()\nfuture_model = FutureModel(x=1, y='a')\nforward_model = ForwardReferencingModel(x=1, y='a', future=future_model)\n\n\nclass NoMutationModel(BaseModel):\n x: int\n\n model_config = dict(frozen=True)\n\n\nclass MutationModel(NoMutationModel):\n a: int = 1\n\n model_config = dict(frozen=False, from_attributes=True)\n\n\nMutationModel(x=1).x = 2\nMutationModel.model_validate(model.__dict__)\n\n\nclass KwargsNoMutationModel(BaseModel, frozen=True):\n x: int\n\n\nclass KwargsMutationModel(KwargsNoMutationModel, frozen=False, from_attributes=True):\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\nKwargsMutationModel.model_validate(model.__dict__)\n\n\nclass OverrideModel(Model):\n x: int\n\n\nOverrideModel(x=1, y='b')\n\n\nclass Mixin:\n def f(self) -> None:\n pass\n\n\nclass MultiInheritanceModel(BaseModel, Mixin):\n pass\n\n\nMultiInheritanceModel().f()\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n\n\nalias_model = AliasModel(y='hello')\nassert alias_model.x == 'hello'\n\n\nclass ClassVarModel(BaseModel):\n x: int\n y: ClassVar[int] = 1\n\n\nClassVarModel(x=1)\n\n\n@dataclass(config=dict(validate_assignment=True))\nclass AddProject:\n name: str\n slug: Optional[str]\n description: Optional[str]\n\n\np = AddProject(name='x', slug='y', description='z')\n\n\nclass TypeAliasAsAttribute(BaseModel):\n __type_alias_attribute__ = Union[str, bytes]\n\n\nclass NestedModel(BaseModel):\n class Model(BaseModel):\n id: str\n\n model: Model\n\n\n_ = NestedModel.Model\n\n\nDynamicModel = create_model('DynamicModel', __base__=Model)\n\ndynamic_model = DynamicModel(x=1, y='y')\ndynamic_model.x = 2\n\n\nclass FrozenModel(BaseModel):\n x: int\n\n model_config = dict(frozen=True)\n\n\nclass NotFrozenModel(FrozenModel):\n a: int = 1\n\n model_config = dict(frozen=False, from_attributes=True)\n\n\nNotFrozenModel(x=1).x = 2\nNotFrozenModel.model_validate(model.__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_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_KwargsFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_KwargsFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 249, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "KwargsNotFrozenModel", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "KwargsFrozenModel", "impl:47", "Response"], "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 KwargsFrozenModel(BaseModel, frozen=True):\n x: int\n\n\nclass KwargsNotFrozenModel(FrozenModel, frozen=False, from_attributes=True):\n a: int = 1\n\n\nKwargsNotFrozenModel(x=1).x = 2\nKwargsNotFrozenModel.model_validate(model.__dict__)\n\n\nclass ModelWithSelfField(BaseModel):\n self: str\n\n\ndef f(name: str) -> str:\n return name\n\n\nclass ModelWithAllowReuseValidator(BaseModel):\n name: str\n normalize_name = field_validator('name', allow_reuse=True)(f)\n\n\nmodel_with_allow_reuse_validator = ModelWithAllowReuseValidator(name='xyz')\n\n\nT = TypeVar('T')\n\n\nclass Response(BaseModel, Generic[T]):\n data: T\n error: Optional[str]\n\n\nresponse = Response[Model](data=model, error=None)\n\n\nclass ModelWithAnnotatedValidator(BaseModel):\n name: str\n\n @field_validator('name')\n def noop_validator_with_annotations(cls, name: str) -> str:\n return name\n\n\ndef _default_factory_str() -> str:\n return 'x'\n\n\ndef _default_factory_list() -> List[int]:\n return [1, 2, 3]\n\n\nclass FieldDefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = Field()\n c: int = Field(...)\n\n # Default\n d: int = Field(1)\n\n # Default factory\n g: List[int] = Field(default_factory=_default_factory_list)\n h: str = Field(default_factory=_default_factory_str)\n i: str = Field(default_factory=lambda: '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_pydantic__pydantic/tests/mypy/modules/success.py___Flags.__str__.return.f_flag_self_strict_bool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py___Flags.__str__.return.f_flag_self_strict_bool_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 54, "span_ids": ["Flags.__str__", "Flags", "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": "\"\"\"\nTest pydantic's compliance with mypy.\n\nDo a little skipping about with types to demonstrate its usage.\n\"\"\"\nimport os\nfrom datetime import date, datetime, timedelta, timezone\nfrom pathlib import Path, PurePath\nfrom typing import Any, Dict, ForwardRef, Generic, List, Optional, Type, TypeVar\nfrom uuid import UUID\n\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import (\n UUID1,\n AwareDatetime,\n BaseModel,\n ConfigDict,\n DirectoryPath,\n Extra,\n FilePath,\n FutureDate,\n ImportString,\n Json,\n NaiveDatetime,\n NegativeFloat,\n NegativeInt,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n PastDate,\n PositiveFloat,\n PositiveInt,\n StrictBool,\n StrictBytes,\n StrictFloat,\n StrictInt,\n StrictStr,\n UrlConstraints,\n field_validator,\n parse_obj_as,\n root_validator,\n validate_arguments,\n)\nfrom pydantic.fields import Field, PrivateAttr\nfrom pydantic.networks import AnyUrl\n\n\nclass Flags(BaseModel):\n strict_bool: StrictBool = False\n\n def __str__(self) -> str:\n return f'flag={self.strict_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_pydantic__pydantic/tests/mypy/modules/success.py_Model_Model.pre_root_check.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_Model_Model.pre_root_check.return.values", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 75, "span_ids": ["Model.check_age", "Model.pre_root_check", "Model", "Model.root_check"], "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 Model(BaseModel):\n age: int\n first_name: str = 'John'\n last_name: Optional[str] = None\n signup_ts: Optional[datetime] = None\n list_of_ints: List[int]\n\n @field_validator('age')\n def check_age(cls, value: int) -> int:\n assert value < 100, 'too old'\n return value\n\n @root_validator(skip_on_failure=True)\n def root_check(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n return values\n\n @root_validator(pre=True, allow_reuse=False)\n def pre_root_check(cls, values: Dict[str, Any]) -> Dict[str, Any]:\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_pydantic__pydantic/tests/mypy/modules/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 188, "span_ids": ["MyConf", "impl:52", "impl:38", "impl", "impl:54", "Foo", "dog_years", "WrapperModel", "bar", "impl:50", "day_of_week", "WithField", "foo"], "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 dog_years(age: int) -> int:\n return age * 7\n\n\ndef day_of_week(dt: datetime) -> int:\n return dt.date().isoweekday()\n\n\nm = Model(age=21, list_of_ints=[1, 2, 3])\n\nassert m.age == 21, m.age\nm.age = 42\nassert m.age == 42, m.age\nassert m.first_name == 'John', m.first_name\nassert m.last_name is None, m.last_name\nassert m.list_of_ints == [1, 2, 3], m.list_of_ints\n\ndog_age = dog_years(m.age)\nassert dog_age == 294, dog_age\n\n\nModel(age=2, first_name='Woof', last_name='Woof', signup_ts=datetime(2017, 6, 7), list_of_ints=[1, 2, 3])\nm = Model.model_validate(\n {\n 'age': 2,\n 'first_name': b'Woof',\n 'last_name': b'Woof',\n 'signup_ts': '2017-06-07 00:00',\n 'list_of_ints': [1, '2', b'3'],\n }\n)\n\nassert m.first_name == 'Woof', m.first_name\nassert m.last_name == 'Woof', m.last_name\nassert m.signup_ts == datetime(2017, 6, 7), m.signup_ts\nassert day_of_week(m.signup_ts) == 3\n\n\ndata = {'age': 10, 'first_name': 'Alena', 'last_name': 'Sousova', 'list_of_ints': [410]}\nm_from_obj = Model.model_validate(data)\n\nassert isinstance(m_from_obj, Model)\nassert m_from_obj.age == 10\nassert m_from_obj.first_name == data['first_name']\nassert m_from_obj.last_name == data['last_name']\nassert m_from_obj.list_of_ints == data['list_of_ints']\n\nm_copy = m_from_obj.model_copy()\n\nassert isinstance(m_copy, Model)\nassert m_copy.age == m_from_obj.age\nassert m_copy.first_name == m_from_obj.first_name\nassert m_copy.last_name == m_from_obj.last_name\nassert m_copy.list_of_ints == m_from_obj.list_of_ints\n\n\nT = TypeVar('T')\n\n\nclass WrapperModel(BaseModel, Generic[T]):\n payload: T\n\n\nint_instance = WrapperModel[int](payload=1)\nint_instance.payload += 1\nassert int_instance.payload == 2\n\nstr_instance = WrapperModel[str](payload='a')\nstr_instance.payload += 'a'\nassert str_instance.payload == 'aa'\n\nmodel_instance = WrapperModel[Model](payload=m)\nmodel_instance.payload.list_of_ints.append(4)\nassert model_instance.payload.list_of_ints == [1, 2, 3, 4]\n\n\nclass WithField(BaseModel):\n age: int\n first_name: str = Field('John', max_length=42)\n\n\n# simple decorator\n@validate_arguments\ndef foo(a: int, *, c: str = 'x') -> str:\n return c * a\n\n\nfoo(1, c='thing')\nfoo(1)\n\n\n# nested decorator should not produce an error\n@validate_arguments(config={'arbitrary_types_allowed': True})\ndef bar(a: int, *, c: str = 'x') -> str:\n return c * a\n\n\nbar(1, c='thing')\nbar(1)\n\n\nclass Foo(BaseModel):\n a: int\n\n\nFooRef = ForwardRef('Foo')\n\n\nclass MyConf(BaseModel):\n str_pyobject: ImportString[Type[date]] = Field(...)\n callable_pyobject: ImportString[Type[date]] = Field(default=date)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 241, "span_ids": ["impl:56", "PydanticTypes", "MyPrivateAttr"], "tokens": 622}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "conf = MyConf(str_pyobject='datetime.date')\nvar1: date = conf.str_pyobject(2020, 12, 20)\nvar2: date = conf.callable_pyobject(2111, 1, 1)\n\n\nclass MyPrivateAttr(BaseModel):\n _private_field: str = PrivateAttr()\n\n\nclass PydanticTypes(BaseModel):\n model_config = ConfigDict() # TODO: add validate_all=True or equivalent if/when possible\n\n # Boolean\n my_strict_bool: StrictBool = True\n # Integer\n my_positive_int: PositiveInt = 1\n my_negative_int: NegativeInt = -1\n my_non_positive_int: NonPositiveInt = -1\n my_non_negative_int: NonNegativeInt = 1\n my_strict_int: StrictInt = 1\n # Float\n my_positive_float: PositiveFloat = 1.1\n my_negative_float: NegativeFloat = -1.1\n my_non_positive_float: NonPositiveFloat = -1.1\n my_non_negative_float: NonNegativeFloat = 1.1\n my_strict_float: StrictFloat = 1.1\n # Bytes\n my_strict_bytes: StrictBytes = b'pika'\n # String\n my_strict_str: StrictStr = 'pika'\n # ImportString\n # TODO: Remove the parse_obj_as's below when we get `validate_all` (or similar) working\n import_string_str: ImportString[Any] = parse_obj_as(ImportString[Any], 'datetime.date') # type: ignore[misc]\n import_string_callable: ImportString[Any] = date\n # UUID\n my_uuid1: UUID1 = UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')\n my_uuid1_str: UUID1 = parse_obj_as(UUID1, 'a8098c1a-f86e-11da-bd1a-00112444be1e')\n # Path\n my_file_path: FilePath = Path(__file__)\n my_file_path_str: FilePath = parse_obj_as(Path, __file__)\n my_dir_path: DirectoryPath = Path('.')\n my_dir_path_str: DirectoryPath = parse_obj_as(DirectoryPath, '.')\n # Json\n my_json: Json[Dict[str, str]] = parse_obj_as(Json[Dict[str, str]], '{\"hello\": \"world\"}')\n my_json_list: Json[List[str]] = parse_obj_as(Json[List[str]], '[\"hello\", \"world\"]')\n # Date\n my_past_date: PastDate = date.today() - timedelta(1)\n my_future_date: FutureDate = date.today() + timedelta(1)\n # Datetime\n my_aware_datetime: AwareDatetime = datetime.now(tz=timezone.utc)\n my_naive_datetime: NaiveDatetime = datetime.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_pydantic__pydantic/tests/mypy/modules/success.py_validated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_validated_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 290, "span_ids": ["SomeDict", "CustomPath", "impl:73", "CustomPath.__fspath__", "impl:76", "UrlModel", "impl:62", "CustomPath.__init__"], "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": "validated = PydanticTypes()\nvalidated.import_string_str(2021, 1, 1)\nvalidated.import_string_callable(2021, 1, 1)\nvalidated.my_uuid1.hex\nvalidated.my_file_path.absolute()\nvalidated.my_file_path_str.absolute()\nvalidated.my_dir_path.absolute()\nvalidated.my_dir_path_str.absolute()\nvalidated.my_json['hello'].capitalize()\nvalidated.my_json_list[0].capitalize()\n\n\nclass UrlModel(BaseModel):\n x: Annotated[AnyUrl, UrlConstraints(allowed_schemes=['http'])] = Field(default=None)\n y: Annotated[AnyUrl, UrlConstraints(allowed_schemes=['http'])] = Field(default=None)\n z: Annotated[AnyUrl, UrlConstraints(allowed_schemes=['s3', 's3n', 's3a'])] = Field(default=None)\n\n\nurl_model = UrlModel(x='http://example.com')\nassert url_model.x.host == 'example.com'\n\n\nclass SomeDict(TypedDict):\n val: int\n name: str\n\n\nobj: SomeDict = {\n 'val': 12,\n 'name': 'John',\n}\n\n\nconfig = ConfigDict(title='Record', extra=Extra.ignore, str_max_length=1234)\n\n\nclass CustomPath(PurePath):\n def __init__(self, *args: str):\n self.path = os.path.join(*args)\n\n def __fspath__(self) -> str:\n return f'a/custom/{self.path}'\n\n\n# TODO:\n# DynamicModel = create_model('DynamicModel')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_importlib_os_chdir_Path___file___p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_importlib_os_chdir_Path___file___p", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 25, "span_ids": ["imports"], "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 importlib\nimport os\nimport re\nimport sys\nfrom pathlib import Path\n\nimport pytest\n\ntry:\n from mypy import api as mypy_api\n from mypy.version import __version__ as mypy_version\n\n from pydantic.mypy import parse_mypy_version\n\nexcept ImportError:\n mypy_api = None\n mypy_version = None\n parse_mypy_version = lambda _: (0,) # noqa: E731\n\nMYPY_VERSION_TUPLE = parse_mypy_version(mypy_version)\n\npytestmark = pytest.mark.skipif('--test-mypy' not in sys.argv, reason='Test only with \"--test-mypy\" flag')\n\n# This ensures mypy can find the test files, no matter where tests are run from:\nos.chdir(Path(__file__).parent.parent.parent)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_cases_cases._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_cases_cases._", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 76, "span_ids": ["imports"], "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": "cases = [\n ('mypy-plugin.ini', 'plugin_success.py', None),\n ('mypy-plugin.ini', 'plugin_fail.py', 'plugin-fail.txt'),\n ('mypy-plugin.ini', 'custom_constructor.py', 'custom_constructor.txt'),\n ('mypy-plugin-strict.ini', 'plugin_success.py', 'plugin-success-strict.txt'),\n ('mypy-plugin-strict.ini', 'plugin_fail.py', 'plugin-fail-strict.txt'),\n ('mypy-plugin-strict.ini', 'fail_defaults.py', 'fail_defaults.txt'),\n pytest.param(\n 'mypy-default.ini',\n 'success.py',\n None,\n marks=pytest.mark.skipif(\n MYPY_VERSION_TUPLE > (1, 0, 1), reason='Need to handle some more things for mypy >=1.1.1'\n ),\n ),\n ('mypy-default.ini', 'fail1.py', 'fail1.txt'),\n ('mypy-default.ini', 'fail2.py', 'fail2.txt'),\n ('mypy-default.ini', 'fail3.py', 'fail3.txt'),\n ('mypy-default.ini', 'fail4.py', 'fail4.txt'),\n ('mypy-default.ini', 'plugin_success.py', 'plugin_success.txt'),\n pytest.param('mypy-plugin-strict-no-any.ini', 'dataclass_no_any.py', None),\n pytest.param(\n 'pyproject-default.toml',\n 'success.py',\n None,\n marks=pytest.mark.skipif(\n MYPY_VERSION_TUPLE > (1, 0, 1), reason='Need to handle some more things for mypy >=1.1.1'\n ),\n ),\n ('pyproject-default.toml', 'fail1.py', 'fail1.txt'),\n ('pyproject-default.toml', 'fail2.py', 'fail2.txt'),\n ('pyproject-default.toml', 'fail3.py', 'fail3.txt'),\n ('pyproject-default.toml', 'fail4.py', 'fail4.txt'),\n ('pyproject-plugin.toml', 'plugin_success.py', None),\n ('pyproject-plugin.toml', 'plugin_fail.py', 'plugin-fail.txt'),\n ('pyproject-plugin-strict.toml', 'plugin_success.py', 'plugin-success-strict.txt'),\n ('pyproject-plugin-strict.toml', 'plugin_fail.py', 'plugin-fail-strict.txt'),\n ('pyproject-plugin-strict.toml', 'fail_defaults.py', 'fail_defaults.txt'),\n ('mypy-plugin-strict.ini', 'plugin_default_factory.py', 'plugin_default_factory.txt'),\n # with Config-Class\n ('mypy-plugin.ini', 'plugin_success_baseConfig.py', None),\n ('mypy-plugin.ini', 'plugin_fail_baseConfig.py', 'plugin-fail-baseConfig.txt'),\n ('mypy-plugin-strict.ini', 'plugin_success_baseConfig.py', 'plugin-success-strict-baseConfig.txt'),\n ('mypy-plugin-strict.ini', 'plugin_fail_baseConfig.py', 'plugin-fail-strict-baseConfig.txt'),\n ('mypy-default.ini', 'plugin_success_baseConfig.py', 'plugin_success_baseConfig.txt'),\n ('pyproject-plugin.toml', 'plugin_success_baseConfig.py', None),\n ('pyproject-plugin.toml', 'plugin_fail_baseConfig.py', 'plugin-fail-baseConfig.txt'),\n ('pyproject-plugin-strict.toml', 'plugin_success_baseConfig.py', 'plugin-success-strict-baseConfig.txt'),\n ('pyproject-plugin-strict.toml', 'plugin_fail_baseConfig.py', 'plugin-fail-strict-baseConfig.txt'),\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_pydantic__pydantic/tests/mypy/test_mypy.py_build_executable_modules_executable_modules.build_executable_modules_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_build_executable_modules_executable_modules.build_executable_modules_", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 112, "span_ids": ["impl:16", "build_executable_modules"], "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 build_executable_modules():\n \"\"\"\n Iterates over the test cases and returns a list of modules that should be executable.\n Specifically, we include any modules that are not expected to produce any typechecking errors.\n Currently, we do not skip/xfail executable modules, but I have included code below that could\n do so if uncommented.\n \"\"\"\n modules = set()\n for case in cases:\n if type(case) != tuple:\n # this means it is a pytest.param\n skip_this_case = False\n for mark in case.marks:\n # Uncomment the lines below to respect skipif:\n # if mark.markname == 'skipif' and mark.args[0]:\n # skip_this_case = True\n # break\n\n # Uncomment the lines below to respect xfail:\n # if mark.markname == 'xfail':\n # skip_this_case = True # don't attempt to execute xfail modules\n # break\n pass\n if skip_this_case:\n continue\n case = case.values\n _, fname, out_fname = case\n if out_fname is None:\n # no output file is present, so no errors should be produced; the module should be executable\n modules.add(fname[:-3])\n return sorted(modules)\n\n\nexecutable_modules = build_executable_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_pydantic__pydantic/tests/mypy/test_mypy.py_test_mypy_results_test_mypy_results.assert_actual_out_expe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_mypy_results_test_mypy_results.assert_actual_out_expe", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 115, "end_line": 171, "span_ids": ["test_mypy_results"], "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": "@pytest.mark.parametrize('config_filename,python_filename,output_filename', cases)\ndef test_mypy_results(config_filename: str, python_filename: str, output_filename: str) -> None:\n full_config_filename = f'tests/mypy/configs/{config_filename}'\n full_filename = f'tests/mypy/modules/{python_filename}'\n\n # Idea: tests/mypy/outputs/latest should have the latest version of the output files\n # Older mypy versions can have their own versions of expected output files in tests/mypy/outputs/v1.0.1, etc.\n # Only folders corresponding to mypy versions equal to or newer than the installed mypy version will be searched\n all_output_roots = [((1, 0, 1), Path('tests/mypy/outputs/v1.0.1')), ((9999,), Path('tests/mypy/outputs/latest'))]\n output_roots = [(v, p) for (v, p) in all_output_roots if v >= MYPY_VERSION_TUPLE]\n\n if output_filename is None:\n output_path = None\n else:\n for max_version, output_root in output_roots:\n maybe_output_path = output_root / output_filename\n if maybe_output_path.exists():\n output_path = maybe_output_path\n break\n else:\n raise FileNotFoundError(f'Could not find expected output file {output_filename} in any of {output_roots}')\n\n # Specifying a different cache dir for each configuration dramatically speeds up subsequent execution\n # It also prevents cache-invalidation-related bugs in the tests\n cache_dir = f'.mypy_cache/test-{os.path.splitext(config_filename)[0]}'\n command = [full_filename, '--config-file', full_config_filename, '--cache-dir', cache_dir, '--show-error-codes']\n if MYPY_VERSION_TUPLE >= (0, 990):\n command.append('--disable-recursive-aliases')\n print(f\"\\nExecuting: mypy {' '.join(command)}\") # makes it easier to debug as necessary\n actual_result = mypy_api.run(command)\n actual_out, actual_err, actual_returncode = actual_result\n # Need to strip filenames due to differences in formatting by OS\n actual_out = '\\n'.join(['.py:'.join(line.split('.py:')[1:]) for line in actual_out.split('\\n') if line]).strip()\n actual_out = re.sub(r'\\n\\s*\\n', r'\\n', actual_out)\n\n if actual_out:\n print('{0}\\n{1:^100}\\n{0}\\n{2}\\n{0}'.format('=' * 100, 'mypy output', actual_out))\n\n assert actual_err == ''\n expected_returncode = 0 if output_filename is None else 1\n assert actual_returncode == expected_returncode\n\n if output_path and not output_path.exists():\n output_path.write_text(actual_out)\n raise RuntimeError(f'wrote actual output to {output_path} since file did not exist')\n\n expected_out = Path(output_path).read_text().rstrip('\\n') if output_path else ''\n\n # fix for compatibility between mypy versions: (this can be dropped once we drop support for mypy<0.930)\n if actual_out and MYPY_VERSION_TUPLE < (0, 930):\n actual_out = actual_out.lower()\n expected_out = expected_out.lower()\n actual_out = actual_out.replace('variant:', 'variants:')\n actual_out = re.sub(r'^(\\d+: note: {4}).*', r'\\1...', actual_out, flags=re.M)\n expected_out = re.sub(r'^(\\d+: note: {4}).*', r'\\1...', expected_out, flags=re.M)\n\n assert actual_out == expected_out, actual_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_pydantic__pydantic/tests/mypy/test_mypy.py_test_bad_toml_config_test_bad_toml_config.assert_str_e_value_C": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_bad_toml_config_test_bad_toml_config.assert_str_e_value_C", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 174, "end_line": 188, "span_ids": ["test_bad_toml_config"], "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 test_bad_toml_config() -> None:\n full_config_filename = 'tests/mypy/configs/pyproject-plugin-bad-param.toml'\n full_filename = 'tests/mypy/modules/success.py'\n\n # Specifying a different cache dir for each configuration dramatically speeds up subsequent execution\n # It also prevents cache-invalidation-related bugs in the tests\n cache_dir = '.mypy_cache/test-pyproject-plugin-bad-param'\n command = [full_filename, '--config-file', full_config_filename, '--cache-dir', cache_dir, '--show-error-codes']\n if MYPY_VERSION_TUPLE >= (0, 990):\n command.append('--disable-recursive-aliases')\n print(f\"\\nExecuting: mypy {' '.join(command)}\") # makes it easier to debug as necessary\n with pytest.raises(ValueError) as e:\n mypy_api.run(command)\n\n assert str(e.value) == 'Configuration value must be a boolean for key: init_forbid_extra'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_success_cases_run_test_explicit_reexports.for_name_export_all_in_.for_export_in_export_all_.assert_export_in_root_all": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_success_cases_run_test_explicit_reexports.for_name_export_all_in_.for_export_in_export_all_.assert_export_in_root_all", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 191, "end_line": 208, "span_ids": ["test_success_cases_run", "test_explicit_reexports"], "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": "@pytest.mark.parametrize('module', sorted(executable_modules))\ndef test_success_cases_run(module: str) -> None:\n \"\"\"\n Ensure the \"success\" files can actually be executed\n \"\"\"\n importlib.import_module(f'tests.mypy.modules.{module}')\n\n\ndef test_explicit_reexports():\n from pydantic import __all__ as root_all\n from pydantic.main import __all__ as main\n from pydantic.networks import __all__ as networks\n from pydantic.tools import __all__ as tools\n from pydantic.types import __all__ as types\n\n for name, export_all in [('main', main), ('network', networks), ('tools', tools), ('types', types)]:\n for export in export_all:\n assert export in root_all, f'{export} is in {name}.__all__ but missing from re-export in __init__.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_pydantic__pydantic/tests/mypy/test_mypy.py_test_explicit_reexports_exist_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_explicit_reexports_exist_", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 228, "span_ids": ["test_explicit_reexports_exist", "test_parse_mypy_version"], "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 test_explicit_reexports_exist():\n import pydantic\n\n for name in pydantic.__all__:\n assert hasattr(pydantic, name), f'{name} is in pydantic.__all__ but missing from pydantic'\n\n\n@pytest.mark.parametrize(\n 'v_str,v_tuple',\n [\n ('0', (0,)),\n ('0.930', (0, 930)),\n ('0.940+dev.04cac4b5d911c4f9529e6ce86a27b44f28846f5d.dirty', (0, 940)),\n ],\n)\ndef test_parse_mypy_version(v_str, v_tuple):\n assert parse_mypy_version(v_str) == v_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_pydantic__pydantic/tests/pyright/pyright_example.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/pyright/pyright_example.py___", "embedding": null, "metadata": {"file_path": "tests/pyright/pyright_example.py", "file_name": "pyright_example.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["Knight", "MyModel", "impl", "impl:5", "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": "\"\"\"\nThis file is used to test pyright's ability to check pydantic code.\n\"\"\"\n\nfrom typing import List\n\nfrom pydantic import BaseModel, Field\n\n\nclass MyModel(BaseModel):\n x: str\n y: List[int]\n\n\nm1 = MyModel(x='hello', y=[1, 2, 3])\n\nm2 = MyModel(x='hello') # pyright: ignore\n\n\nclass Knight(BaseModel):\n title: str = Field(default='Sir Lancelot') # this is okay\n age: int = Field(23) # this works fine at runtime but will case an error for pyright\n\n\nk = Knight() # pyright: ignore", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_abc.py_abc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_abc.py_abc_", "embedding": null, "metadata": {"file_path": "tests/test_abc.py", "file_name": "test_abc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 47, "span_ids": ["imports", "test_model_subclassing_abstract_base_classes", "test_model_subclassing_abstract_base_classes_without_implementation_raises_exception"], "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": "import abc\n\nimport pytest\n\nfrom pydantic import BaseModel\n\n\ndef test_model_subclassing_abstract_base_classes():\n class Model(BaseModel, abc.ABC):\n some_field: str\n\n\ndef test_model_subclassing_abstract_base_classes_without_implementation_raises_exception():\n class Model(BaseModel, abc.ABC):\n some_field: str\n\n @abc.abstractmethod\n def my_abstract_method(self):\n pass\n\n @classmethod\n @abc.abstractmethod\n def my_abstract_classmethod(cls):\n pass\n\n @staticmethod\n @abc.abstractmethod\n def my_abstract_staticmethod():\n pass\n\n @property\n @abc.abstractmethod\n def my_abstract_property(self):\n pass\n\n @my_abstract_property.setter\n @abc.abstractmethod\n def my_abstract_property(self, val):\n pass\n\n with pytest.raises(TypeError) as excinfo:\n Model(some_field='some_value')\n assert str(excinfo.value) == (\n \"Can't instantiate abstract class Model with abstract methods \"\n \"my_abstract_classmethod, my_abstract_method, my_abstract_property, my_abstract_staticmethod\"\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_pydantic__pydantic/tests/test_aliases.py_from_contextlib_import_nu_test_alias_generator.assert_v_model_dump_by_al": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_from_contextlib_import_nu_test_alias_generator.assert_v_model_dump_by_al", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["imports", "test_alias_generator"], "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": "from contextlib import nullcontext as does_not_raise\nfrom typing import Any, ContextManager, List, Optional\n\nimport pytest\nfrom dirty_equals import IsStr\n\nfrom pydantic import BaseModel, ConfigDict, Extra, ValidationError\nfrom pydantic.fields import Field\n\n\ndef test_alias_generator():\n def to_camel(string: str):\n return ''.join(x.capitalize() for x in string.split('_'))\n\n class MyModel(BaseModel):\n model_config = ConfigDict(alias_generator=to_camel)\n a: List[str] = None\n foo_bar: str\n\n data = {'A': ['foo', 'bar'], 'FooBar': 'foobar'}\n v = MyModel(**data)\n assert v.a == ['foo', 'bar']\n assert v.foo_bar == 'foobar'\n assert v.model_dump(by_alias=True) == 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_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_wrong_type_error_test_basic_alias.assert_repr_Model_model_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_wrong_type_error_test_basic_alias.assert_repr_Model_model_f", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 48, "span_ids": ["test_alias_generator_wrong_type_error", "test_basic_alias"], "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 test_alias_generator_wrong_type_error():\n def return_bytes(string):\n return b'not a string'\n\n with pytest.raises(TypeError) as e:\n\n class MyModel(BaseModel):\n model_config = ConfigDict(alias_generator=return_bytes)\n bar: Any\n\n assert str(e.value) == IsStr(regex=\"alias_generator must return str, not \")\n\n\ndef test_basic_alias():\n class Model(BaseModel):\n a: str = Field('foobar', alias='_a')\n\n assert Model().a == 'foobar'\n assert Model(_a='different').a == 'different'\n assert repr(Model.model_fields['a']) == (\n \"FieldInfo(annotation=str, required=False, default='foobar', alias='_a', alias_priority=2)\"\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_pydantic__pydantic/tests/test_aliases.py_test_alias_error_test_alias_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_error_test_alias_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 66, "span_ids": ["test_alias_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": "def test_alias_error():\n class Model(BaseModel):\n a: int = Field(123, alias='_a')\n\n assert Model(_a='123').a == 123\n\n with pytest.raises(ValidationError) as exc_info:\n Model(_a='foo')\n assert exc_info.value.errors() == [\n {\n 'input': 'foo',\n 'loc': ('_a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_aliases.py_test_alias_error_loc_by_alias_test_annotation_config.assert_Model_foobar_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_error_loc_by_alias_test_annotation_config.assert_Model_foobar_123_", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 96, "span_ids": ["test_alias_error_loc_by_alias", "test_annotation_config"], "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 test_alias_error_loc_by_alias():\n class Model(BaseModel):\n model_config = dict(loc_by_alias=False)\n a: int = Field(123, alias='_a')\n\n assert Model(_a='123').a == 123\n\n with pytest.raises(ValidationError) as exc_info:\n Model(_a='foo')\n assert exc_info.value.errors() == [\n {\n 'input': 'foo',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'type': 'int_parsing',\n }\n ]\n\n\ndef test_annotation_config():\n class Model(BaseModel):\n b: float = Field(alias='foobar')\n a: int = 10\n _c: str\n\n assert list(Model.model_fields.keys()) == ['b', 'a']\n assert [f.alias for f in Model.model_fields.values()] == ['foobar', None]\n assert Model(foobar='123').b == 123.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_pydantic__pydantic/tests/test_aliases.py_test_pop_by_field_name_test_pop_by_field_name.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_pop_by_field_name_test_pop_by_field_name.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 115, "span_ids": ["test_pop_by_field_name"], "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 test_pop_by_field_name():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid, populate_by_name=True)\n last_updated_by: Optional[str] = Field(None, alias='lastUpdatedBy')\n\n assert Model(lastUpdatedBy='foo').model_dump() == {'last_updated_by': 'foo'}\n assert Model(last_updated_by='foo').model_dump() == {'last_updated_by': 'foo'}\n with pytest.raises(ValidationError) as exc_info:\n Model(lastUpdatedBy='foo', last_updated_by='bar')\n assert exc_info.value.errors() == [\n {\n 'input': 'bar',\n 'loc': ('last_updated_by',),\n 'msg': 'Extra inputs are not permitted',\n 'type': 'extra_forbidden',\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_pydantic__pydantic/tests/test_aliases.py_test_alias_override_behavior_test_alias_override_behavior.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_override_behavior_test_alias_override_behavior.None_5", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 160, "span_ids": ["test_alias_override_behavior"], "tokens": 422}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_alias_override_behavior():\n class Parent(BaseModel):\n # Use `gt` to demonstrate that using `Field` to override an alias does not preserve other attributes\n x: int = Field(alias='x1', gt=0)\n\n class Child(Parent):\n x: int = Field(..., alias='x2')\n y: int = Field(..., alias='y2')\n\n assert Parent.model_fields['x'].alias == 'x1'\n assert Child.model_fields['x'].alias == 'x2'\n assert Child.model_fields['y'].alias == 'y2'\n\n Parent(x1=1)\n with pytest.raises(ValidationError) as exc_info:\n Parent(x1=-1)\n assert exc_info.value.errors() == [\n {'ctx': {'gt': 0}, 'input': -1, 'loc': ('x1',), 'msg': 'Input should be greater than 0', 'type': 'greater_than'}\n ]\n\n Child(x2=1, y2=2)\n\n # Check the gt=0 is not preserved from Parent\n Child(x2=-1, y2=2)\n\n # Check the alias from Parent cannot be used\n with pytest.raises(ValidationError) as exc_info:\n Child(x1=1, y2=2)\n assert exc_info.value.errors() == [\n {'input': {'x1': 1, 'y2': 2}, 'loc': ('x2',), 'msg': 'Field required', 'type': 'missing'}\n ]\n\n # Check the type hint from Parent _is_ preserved\n with pytest.raises(ValidationError) as exc_info:\n Child(x2='a', y2=2)\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('x2',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_parent_test_alias_generator_on_parent.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_parent_test_alias_generator_on_parent.None_4", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 190, "span_ids": ["test_alias_generator_on_parent", "test_alias_generator_parent"], "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 test_alias_generator_parent():\n class Parent(BaseModel):\n model_config = ConfigDict(populate_by_name=True, alias_generator=lambda f_name: f_name + '1')\n x: int\n\n class Child(Parent):\n model_config = ConfigDict(alias_generator=lambda f_name: f_name + '2')\n y: int\n\n assert Child.model_fields['y'].alias == 'y2'\n assert Child.model_fields['x'].alias == 'x2'\n\n\ndef test_alias_generator_on_parent():\n class Parent(BaseModel):\n model_config = ConfigDict(alias_generator=lambda x: x.upper())\n x: bool = Field(..., alias='a_b_c')\n y: str\n\n class Child(Parent):\n y: str\n z: str\n\n assert Parent.model_fields['x'].alias == 'a_b_c'\n assert Parent.model_fields['y'].alias == 'Y'\n assert Child.model_fields['x'].alias == 'a_b_c'\n assert Child.model_fields['y'].alias == 'Y'\n assert Child.model_fields['z'].alias == '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_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_on_child_test_low_priority_alias.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_on_child_test_low_priority_alias.None_1", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 193, "end_line": 224, "span_ids": ["test_low_priority_alias", "test_alias_generator_on_child"], "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 test_alias_generator_on_child():\n class Parent(BaseModel):\n x: bool = Field(..., alias='abc')\n y: str\n\n class Child(Parent):\n model_config = ConfigDict(alias_generator=lambda x: x.upper())\n\n y: str\n z: str\n\n assert [f.alias for f in Parent.model_fields.values()] == ['abc', None]\n assert [f.alias for f in Child.model_fields.values()] == ['abc', 'Y', 'Z']\n\n\ndef test_low_priority_alias():\n # TODO:\n # Alternative 1: we could drop alias_priority and tell people to manually override aliases in child classes\n # Alternative 2: we could add a new argument `override_with_alias_generator=True` equivalent to `alias_priority=1`\n class Parent(BaseModel):\n w: bool = Field(..., alias='w_')\n x: bool = Field(..., alias='abc', alias_priority=1)\n y: str\n\n class Child(Parent):\n model_config = ConfigDict(alias_generator=lambda x: x.upper())\n\n y: str\n z: str\n\n assert [f.alias for f in Parent.model_fields.values()] == ['w_', 'abc', None]\n assert [f.alias for f in Child.model_fields.values()] == ['w_', 'X', 'Y', '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_pydantic__pydantic/tests/test_aliases.py_test_empty_string_alias_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_empty_string_alias_", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 227, "end_line": 269, "span_ids": ["test_empty_string_alias", "test_populate_by_name_config"], "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 test_empty_string_alias():\n class Model(BaseModel):\n empty_string_key: int = Field(alias='')\n\n data = {'': 123}\n m = Model(**data)\n assert m.empty_string_key == 123\n assert m.model_dump(by_alias=True) == data\n\n\n@pytest.mark.parametrize(\n 'use_construct, populate_by_name_config, arg_name, expectation',\n [\n [False, True, 'bar', does_not_raise()],\n [False, True, 'bar_', does_not_raise()],\n [False, False, 'bar', does_not_raise()],\n [False, False, 'bar_', pytest.raises(ValueError)],\n [True, True, 'bar', does_not_raise()],\n [True, True, 'bar_', does_not_raise()],\n [True, False, 'bar', does_not_raise()],\n [True, False, 'bar_', does_not_raise()],\n ],\n)\ndef test_populate_by_name_config(\n use_construct: bool,\n populate_by_name_config: bool,\n arg_name: str,\n expectation: ContextManager,\n):\n expected_value: int = 7\n\n class Foo(BaseModel):\n model_config = ConfigDict(populate_by_name=populate_by_name_config)\n bar_: int = Field(..., alias='bar')\n\n with expectation:\n if use_construct:\n f = Foo.model_construct(**{arg_name: expected_value})\n else:\n f = Foo(**{arg_name: expected_value})\n\n assert f.bar_ == expected_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_pydantic__pydantic/tests/test_annotated.py_sys_test_annotated.assert_repr_M_model_field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_sys_test_annotated.assert_repr_M_model_field", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 82, "span_ids": ["imports", "test_annotated"], "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": "import sys\nfrom typing import List\n\nimport pytest\nfrom annotated_types import Gt, Lt\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, Field\nfrom pydantic.fields import Undefined\n\nNO_VALUE = object()\n\n\n@pytest.mark.parametrize(\n 'hint_fn,value,expected_repr',\n [\n (\n lambda: Annotated[int, Gt(0)],\n 5,\n 'FieldInfo(annotation=int, required=False, default=5, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: Annotated[int, Field(gt=0)],\n 5,\n 'FieldInfo(annotation=int, required=False, default=5, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: int,\n Field(5, gt=0),\n 'FieldInfo(annotation=int, required=False, default=5, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: int,\n Field(default_factory=lambda: 5, gt=0),\n 'FieldInfo(annotation=int, required=False, default_factory=, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: Annotated[int, Lt(2)],\n Field(5, gt=0),\n 'FieldInfo(annotation=int, required=False, default=5, metadata=[Gt(gt=0), Lt(lt=2)])',\n ),\n (\n lambda: Annotated[int, Gt(0)],\n NO_VALUE,\n 'FieldInfo(annotation=int, required=True, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: Annotated[int, Gt(0)],\n Field(),\n 'FieldInfo(annotation=int, required=True, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: int,\n Field(gt=0),\n 'FieldInfo(annotation=int, required=True, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: Annotated[int, Gt(0)],\n Undefined,\n 'FieldInfo(annotation=int, required=True, metadata=[Gt(gt=0)])',\n ),\n (\n lambda: Annotated[int, Field(gt=0), Lt(2)],\n 5,\n 'FieldInfo(annotation=int, required=False, default=5, metadata=[Gt(gt=0), Lt(lt=2)])',\n ),\n ],\n)\ndef test_annotated(hint_fn, value, expected_repr):\n hint = hint_fn()\n\n if value is NO_VALUE:\n\n class M(BaseModel):\n x: hint\n\n else:\n\n class M(BaseModel):\n x: hint = value\n\n assert repr(M.model_fields['x']) == expected_repr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_model_exceptions_test_annotated_model_exceptions.with_exc_handler_.M.x.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_model_exceptions_test_annotated_model_exceptions.with_exc_handler_.M.x.value", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 105, "span_ids": ["test_annotated_model_exceptions"], "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": "@pytest.mark.parametrize(\n 'hint_fn,value,exc_handler',\n [\n (\n lambda: Annotated[int, Field(0)],\n Field(default=5, ge=0),\n pytest.raises(TypeError, match='Field may not be used twice on the same field'),\n ),\n (\n lambda: Annotated[int, Field(0)],\n 5,\n pytest.raises(TypeError, match='Default may not be specified twice on the same field'),\n ),\n ],\n)\ndef test_annotated_model_exceptions(hint_fn, value, exc_handler):\n hint = hint_fn()\n with exc_handler:\n\n class M(BaseModel):\n x: hint = 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_pydantic__pydantic/tests/test_annotated.py_test_annotated_allows_unknown_test_annotated_instance_exceptions.with_empty_init_ctx_.assert_M_x_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_allows_unknown_test_annotated_instance_exceptions.with_empty_init_ctx_.assert_M_x_5", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 108, "end_line": 141, "span_ids": ["test_annotated_instance_exceptions", "test_annotated_allows_unknown"], "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": "@pytest.mark.parametrize('metadata', [0, 'foo'])\ndef test_annotated_allows_unknown(metadata):\n class M(BaseModel):\n x: Annotated[int, metadata] = 5\n\n field_info = M.model_fields['x']\n assert len(field_info.metadata) == 1\n assert metadata in field_info.metadata, 'Records the unknown metadata'\n assert metadata in M.__annotations__['x'].__metadata__, 'Annotated type is recorded'\n\n\n@pytest.mark.parametrize(\n ['hint_fn', 'value', 'empty_init_ctx'],\n [\n (\n lambda: int,\n Undefined,\n pytest.raises(ValueError, match=r'Field required \\[type=missing,'),\n ),\n (\n lambda: Annotated[int, Field()],\n Undefined,\n pytest.raises(ValueError, match=r'Field required \\[type=missing,'),\n ),\n ],\n)\ndef test_annotated_instance_exceptions(hint_fn, value, empty_init_ctx):\n hint = hint_fn()\n\n class M(BaseModel):\n x: hint = value\n\n with empty_init_ctx:\n assert M().x == 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_pydantic__pydantic/tests/test_annotated.py_test_field_reuse_test_config_field_info.assert_Foo_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_field_reuse_test_config_field_info.assert_Foo_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 164, "span_ids": ["test_field_reuse", "test_config_field_info"], "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 test_field_reuse():\n field = Field(description='Long description')\n\n class Model(BaseModel):\n one: int = field\n\n assert Model(one=1).model_dump() == {'one': 1}\n\n class AnnotatedModel(BaseModel):\n one: Annotated[int, field]\n\n assert AnnotatedModel(one=1).model_dump() == {'one': 1}\n\n\ndef test_config_field_info():\n class Foo(BaseModel):\n a: Annotated[int, Field(description='descr', json_schema_extra={'foobar': 'hello'})]\n\n assert Foo.model_json_schema(by_alias=True)['properties'] == {\n 'a': {'title': 'A', 'description': 'descr', 'foobar': 'hello', 'type': 'integer'},\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_pydantic__pydantic/tests/test_annotated.py_test_annotated_alias_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_alias_", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 167, "end_line": 195, "span_ids": ["test_annotated_alias"], "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": "@pytest.mark.skipif(sys.version_info < (3, 10), reason='repr different on older versions')\ndef test_annotated_alias() -> None:\n # https://github.com/pydantic/pydantic/issues/2971\n\n StrAlias = Annotated[str, Field(max_length=3)]\n IntAlias = Annotated[int, Field(default_factory=lambda: 2)]\n\n Nested = Annotated[List[StrAlias], Field(description='foo')]\n\n class MyModel(BaseModel):\n a: StrAlias = 'abc'\n b: StrAlias\n c: IntAlias\n d: IntAlias\n e: Nested\n\n fields_repr = {k: repr(v) for k, v in MyModel.model_fields.items()}\n assert fields_repr == {\n 'a': \"FieldInfo(annotation=str, required=False, default='abc', metadata=[MaxLen(max_length=3)])\",\n 'b': 'FieldInfo(annotation=str, required=True, metadata=[MaxLen(max_length=3)])',\n 'c': 'FieldInfo(annotation=int, required=False, default_factory=)',\n 'd': 'FieldInfo(annotation=int, required=False, default_factory=)',\n 'e': (\n 'FieldInfo(annotation=List[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLe'\n \"n(max_length=3)])]], required=True, description='foo')\"\n ),\n }\n assert MyModel(b='def', e=['xyz']).model_dump() == dict(a='abc', b='def', c=2, d=2, e=['xyz'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_assert_in_validators.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_assert_in_validators.py___", "embedding": null, "metadata": {"file_path": "tests/test_assert_in_validators.py", "file_name": "test_assert_in_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["test_assert_raises_validation_error", "docstring"], "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": "\"\"\"\nPYTEST_DONT_REWRITE\n\"\"\"\nimport pytest\n\nfrom pydantic import BaseModel, ValidationError\nfrom pydantic.decorators import field_validator\n\n\ndef test_assert_raises_validation_error():\n class Model(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v):\n assert v == 'a', 'invalid a'\n return v\n\n assert Model(a='a').a == 'a'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n\n expected_errors = [\n {\n 'type': 'assertion_error',\n 'loc': ('a',),\n 'msg': 'Assertion failed, invalid a',\n 'input': 'snap',\n 'ctx': {'error': 'invalid a'},\n }\n ]\n actual_errors = exc_info.value.errors()\n if expected_errors != actual_errors:\n pytest.fail(f'Actual errors: {actual_errors}\\nExpected errors: {expected_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_pydantic__pydantic/tests/test_callable.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_callable.py_sys_", "embedding": null, "metadata": {"file_path": "tests/test_callable.py", "file_name": "test_callable.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "test_callable", "test_non_callable"], "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": "import sys\nfrom typing import Callable\n\nimport pytest\n\nfrom pydantic import BaseModel, ValidationError\n\ncollection_callable_types = [Callable, Callable[[int], int]]\nif sys.version_info >= (3, 9):\n from collections.abc import Callable as CollectionsCallable\n\n collection_callable_types += [CollectionsCallable, CollectionsCallable[[int], int]]\n\n\n@pytest.mark.parametrize('annotation', collection_callable_types)\ndef test_callable(annotation):\n class Model(BaseModel):\n callback: annotation\n\n m = Model(callback=lambda x: x)\n assert callable(m.callback)\n\n\n@pytest.mark.parametrize('annotation', collection_callable_types)\ndef test_non_callable(annotation):\n class Model(BaseModel):\n callback: annotation\n\n with pytest.raises(ValidationError):\n Model(callback=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_pydantic__pydantic/tests/test_color.py_from_datetime_import_date_test_color_success.assert_c_original_ra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_from_datetime_import_date_test_color_success.assert_c_original_ra", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 70, "span_ids": ["test_color_success", "imports"], "tokens": 1256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 datetime import datetime\n\nimport pytest\nfrom pydantic_core import PydanticCustomError\n\nfrom pydantic import BaseModel, ValidationError\nfrom pydantic.color import Color\n\n\n@pytest.mark.parametrize(\n 'raw_color, as_tuple',\n [\n # named colors\n ('aliceblue', (240, 248, 255)),\n ('Antiquewhite', (250, 235, 215)),\n ('#000000', (0, 0, 0)),\n ('#DAB', (221, 170, 187)),\n ('#dab', (221, 170, 187)),\n ('#000', (0, 0, 0)),\n ('0x797979', (121, 121, 121)),\n ('0x777', (119, 119, 119)),\n ('0x777777', (119, 119, 119)),\n ('0x777777cc', (119, 119, 119, 0.8)),\n ('777', (119, 119, 119)),\n ('777c', (119, 119, 119, 0.8)),\n (' 777', (119, 119, 119)),\n ('777 ', (119, 119, 119)),\n (' 777 ', (119, 119, 119)),\n ((0, 0, 128), (0, 0, 128)),\n ([0, 0, 128], (0, 0, 128)),\n ((0, 0, 205, 1.0), (0, 0, 205)),\n ((0, 0, 205, 0.5), (0, 0, 205, 0.5)),\n ('rgb(0, 0, 205)', (0, 0, 205)),\n ('rgb(0, 0, 205.2)', (0, 0, 205)),\n ('rgb(0, 0.2, 205)', (0, 0, 205)),\n ('rgba(0, 0, 128, 0.6)', (0, 0, 128, 0.6)),\n ('rgba(0, 0, 128, .6)', (0, 0, 128, 0.6)),\n ('rgba(0, 0, 128, 60%)', (0, 0, 128, 0.6)),\n (' rgba(0, 0, 128,0.6) ', (0, 0, 128, 0.6)),\n ('rgba(00,0,128,0.6 )', (0, 0, 128, 0.6)),\n ('rgba(0, 0, 128, 0)', (0, 0, 128, 0)),\n ('rgba(0, 0, 128, 1)', (0, 0, 128)),\n ('rgb(0 0.2 205)', (0, 0, 205)),\n ('rgb(0 0.2 205 / 0.6)', (0, 0, 205, 0.6)),\n ('rgb(0 0.2 205 / 60%)', (0, 0, 205, 0.6)),\n ('rgba(0 0 128)', (0, 0, 128)),\n ('rgba(0 0 128 / 0.6)', (0, 0, 128, 0.6)),\n ('rgba(0 0 128 / 60%)', (0, 0, 128, 0.6)),\n ('hsl(270, 60%, 70%)', (178, 133, 224)),\n ('hsl(180, 100%, 50%)', (0, 255, 255)),\n ('hsl(630, 60%, 70%)', (178, 133, 224)),\n ('hsl(270deg, 60%, 70%)', (178, 133, 224)),\n ('hsl(.75turn, 60%, 70%)', (178, 133, 224)),\n ('hsl(-.25turn, 60%, 70%)', (178, 133, 224)),\n ('hsl(-0.25turn, 60%, 70%)', (178, 133, 224)),\n ('hsl(4.71238rad, 60%, 70%)', (178, 133, 224)),\n ('hsl(10.9955rad, 60%, 70%)', (178, 133, 224)),\n ('hsl(270, 60%, 50%, .15)', (127, 51, 204, 0.15)),\n ('hsl(270.00deg, 60%, 50%, 15%)', (127, 51, 204, 0.15)),\n ('hsl(630 60% 70%)', (178, 133, 224)),\n ('hsl(270 60% 50% / .15)', (127, 51, 204, 0.15)),\n ('hsla(630, 60%, 70%)', (178, 133, 224)),\n ('hsla(630 60% 70%)', (178, 133, 224)),\n ('hsla(270 60% 50% / .15)', (127, 51, 204, 0.15)),\n ],\n)\ndef test_color_success(raw_color, as_tuple):\n c = Color(raw_color)\n assert c.as_rgb_tuple() == as_tuple\n assert c.original() == raw_color", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_color_fail_test_color_fail.assert_exc_info_value_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_color_fail_test_color_fail.assert_exc_info_value_typ", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 116, "span_ids": ["test_color_fail"], "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": "@pytest.mark.parametrize(\n 'color',\n [\n # named colors\n 'nosuchname',\n 'chucknorris',\n # hex\n '#0000000',\n 'x000',\n # rgb/rgba tuples\n (256, 256, 256),\n (128, 128, 128, 0.5, 128),\n (0, 0, 'x'),\n (0, 0, 0, 1.5),\n (0, 0, 0, 'x'),\n (0, 0, 1280),\n (0, 0, 1205, 0.1),\n (0, 0, 1128, 0.5),\n (0, 0, 1128, -0.5),\n (0, 0, 1128, 1.5),\n # rgb/rgba strings\n 'rgb(0, 0, 1205)',\n 'rgb(0, 0, 1128)',\n 'rgb(0, 0, 200 / 0.2)',\n 'rgb(72 122 18, 0.3)',\n 'rgba(0, 0, 11205, 0.1)',\n 'rgba(0, 0, 128, 11.5)',\n 'rgba(0, 0, 128 / 11.5)',\n 'rgba(72 122 18 0.3)',\n # hsl/hsla strings\n 'hsl(180, 101%, 50%)',\n 'hsl(72 122 18 / 0.3)',\n 'hsl(630 60% 70%, 0.3)',\n 'hsla(72 122 18 / 0.3)',\n # neither a tuple, not a string\n datetime(2017, 10, 5, 19, 47, 7),\n object,\n range(10),\n ],\n)\ndef test_color_fail(color):\n with pytest.raises(PydanticCustomError) as exc_info:\n Color(color)\n assert exc_info.value.type == 'color_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_pydantic__pydantic/tests/test_color.py_test_model_validation_test_as_rgb.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_model_validation_test_as_rgb.None_2", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 141, "span_ids": ["test_as_rgb", "test_model_validation"], "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 test_model_validation():\n class Model(BaseModel):\n color: Color\n\n assert Model(color='red').color.as_hex() == '#f00'\n assert Model(color=Color('red')).color.as_hex() == '#f00'\n with pytest.raises(ValidationError) as exc_info:\n Model(color='snot')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'color_error',\n 'loc': ('color',),\n 'msg': 'value is not a valid color: string not recognised as a valid color',\n 'input': 'snot',\n }\n ]\n\n\ndef test_as_rgb():\n assert Color('bad').as_rgb() == 'rgb(187, 170, 221)'\n assert Color((1, 2, 3, 0.123456)).as_rgb() == 'rgba(1, 2, 3, 0.12)'\n assert Color((1, 2, 3, 0.1)).as_rgb() == 'rgba(1, 2, 3, 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_pydantic__pydantic/tests/test_color.py_test_as_rgb_tuple_test_as_rgb_tuple.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_rgb_tuple_test_as_rgb_tuple.None_7", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 154, "span_ids": ["test_as_rgb_tuple"], "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 test_as_rgb_tuple():\n assert Color((1, 2, 3)).as_rgb_tuple(alpha=None) == (1, 2, 3)\n assert Color((1, 2, 3, 1)).as_rgb_tuple(alpha=None) == (1, 2, 3)\n assert Color((1, 2, 3, 0.3)).as_rgb_tuple(alpha=None) == (1, 2, 3, 0.3)\n assert Color((1, 2, 3, 0.3)).as_rgb_tuple(alpha=None) == (1, 2, 3, 0.3)\n\n assert Color((1, 2, 3)).as_rgb_tuple(alpha=False) == (1, 2, 3)\n assert Color((1, 2, 3, 0.3)).as_rgb_tuple(alpha=False) == (1, 2, 3)\n\n assert Color((1, 2, 3)).as_rgb_tuple(alpha=True) == (1, 2, 3, 1)\n assert Color((1, 2, 3, 0.3)).as_rgb_tuple(alpha=True) == (1, 2, 3, 0.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_pydantic__pydantic/tests/test_color.py_test_as_hsl_test_as_hsl.assert_Color_hsl_260_43": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hsl_test_as_hsl.assert_Color_hsl_260_43", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 157, "end_line": 160, "span_ids": ["test_as_hsl"], "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 test_as_hsl():\n assert Color('bad').as_hsl() == 'hsl(260, 43%, 77%)'\n assert Color((1, 2, 3, 0.123456)).as_hsl() == 'hsl(210, 50%, 1%, 0.12)'\n assert Color('hsl(260, 43%, 77%)').as_hsl() == 'hsl(260, 43%, 77%)'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hsl_tuple_test_as_hsl_tuple.assert_hsla_3_0_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hsl_tuple_test_as_hsl_tuple.assert_hsla_3_0_5", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 176, "span_ids": ["test_as_hsl_tuple"], "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 test_as_hsl_tuple():\n c = Color('016997')\n h, s, l_, a = c.as_hsl_tuple(alpha=True)\n assert h == pytest.approx(0.551, rel=0.01)\n assert s == pytest.approx(0.986, rel=0.01)\n assert l_ == pytest.approx(0.298, rel=0.01)\n assert a == 1\n\n assert c.as_hsl_tuple(alpha=False) == c.as_hsl_tuple(alpha=None) == (h, s, l_)\n\n c = Color((3, 40, 50, 0.5))\n hsla = c.as_hsl_tuple(alpha=None)\n assert len(hsla) == 4\n assert hsla[3] == 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_pydantic__pydantic/tests/test_color.py_test_as_hex_test_as_hex.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_hex_test_as_hex.None_5", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 179, "end_line": 185, "span_ids": ["test_as_hex"], "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 test_as_hex():\n assert Color((1, 2, 3)).as_hex() == '#010203'\n assert Color((119, 119, 119)).as_hex() == '#777'\n assert Color((119, 0, 238)).as_hex() == '#70e'\n assert Color('B0B').as_hex() == '#b0b'\n assert Color((1, 2, 3, 0.123456)).as_hex() == '#0102031f'\n assert Color((1, 2, 3, 0.1)).as_hex() == '#0102031a'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_named_test_as_named.assert_Color_1_2_3_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_as_named_test_as_named.assert_Color_1_2_3_0_", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 188, "end_line": 199, "span_ids": ["test_as_named"], "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 test_as_named():\n assert Color((0, 255, 255)).as_named() == 'cyan'\n assert Color('#808000').as_named() == 'olive'\n assert Color('hsl(180, 100%, 50%)').as_named() == 'cyan'\n\n assert Color((240, 248, 255)).as_named() == 'aliceblue'\n with pytest.raises(ValueError) as exc_info:\n Color((1, 2, 3)).as_named()\n assert exc_info.value.args[0] == 'no named color found, use fallback=True, as_hex() or as_rgb()'\n\n assert Color((1, 2, 3)).as_named(fallback=True) == '#010203'\n assert Color((1, 2, 3, 0.1)).as_named(fallback=True) == '#0102031a'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_str_repr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_color.py_test_str_repr_", "embedding": null, "metadata": {"file_path": "tests/test_color.py", "file_name": "test_color.py", "file_type": "text/x-python", "category": "test", "start_line": 202, "end_line": 222, "span_ids": ["test_color_hashable", "test_eq", "test_str_repr"], "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 test_str_repr():\n assert str(Color('red')) == 'red'\n assert repr(Color('red')) == \"Color('red', rgb=(255, 0, 0))\"\n assert str(Color((1, 2, 3))) == '#010203'\n assert repr(Color((1, 2, 3))) == \"Color('#010203', rgb=(1, 2, 3))\"\n\n\ndef test_eq():\n assert Color('red') == Color('red')\n assert Color('red') != Color('blue')\n assert Color('red') != 'red'\n\n assert Color('red') == Color((255, 0, 0))\n assert Color('red') != Color((0, 0, 255))\n\n\ndef test_color_hashable():\n assert hash(Color('red')) != hash(Color('blue'))\n assert hash(Color('red')) == hash(Color((255, 0, 0)))\n assert hash(Color('red')) != hash(Color((255, 0, 0, 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_pydantic__pydantic/tests/test_config.py_re_model_with_strict_config.return.ModelWithStrictConfig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_re_model_with_strict_config.return.ModelWithStrictConfig", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 47, "span_ids": ["imports", "model_with_strict_config"], "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 re\nimport sys\nfrom contextlib import nullcontext as does_not_raise\nfrom functools import partial\nfrom inspect import signature\nfrom typing import Any, ContextManager, Iterable, NamedTuple, Type, Union\n\nfrom dirty_equals import HasRepr\n\nfrom pydantic import (\n BaseConfig,\n BaseModel,\n Extra,\n Field,\n PrivateAttr,\n PydanticSchemaGenerationError,\n ValidationError,\n create_model,\n validate_arguments,\n)\nfrom pydantic.config import ConfigDict, _default_config, get_config\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\nfrom pydantic.errors import PydanticUserError\n\nif sys.version_info < (3, 9):\n from typing_extensions import Annotated\nelse:\n from typing import Annotated\n\nimport pytest\n\n\n@pytest.fixture(scope='session', name='BaseConfigModelWithStrictConfig')\ndef model_with_strict_config():\n class ModelWithStrictConfig(BaseModel):\n a: int\n # strict=False overrides the Config\n b: Annotated[int, Field(strict=False)]\n # strict=None or not including it is equivalent\n # lets this field be overridden by the Config\n c: Annotated[int, Field(strict=None)]\n d: Annotated[int, Field()]\n\n class Config:\n strict = True\n\n return ModelWithStrictConfig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py__equals_test_config_dict_missing_keys.with_pytest_raises_KeyErr.ConfigDict_missing_pro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py__equals_test_config_dict_missing_keys.with_pytest_raises_KeyErr.ConfigDict_missing_pro", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 50, "end_line": 66, "span_ids": ["test_config_dict_missing_keys", "_equals"], "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 _equals(a: Union[str, Iterable[str]], b: Union[str, Iterable[str]]) -> bool:\n \"\"\"\n Compare strings with spaces removed\n \"\"\"\n if isinstance(a, str) and isinstance(b, str):\n return a.replace(' ', '') == b.replace(' ', '')\n elif isinstance(a, Iterable) and isinstance(b, Iterable):\n return all(_equals(a_, b_) for a_, b_ in zip(a, b))\n else:\n raise TypeError(f'arguments must be both strings or both lists, not {type(a)}, {type(b)}')\n\n\ndef test_config_dict_missing_keys():\n assert ConfigDict().get('missing_property') is None\n\n with pytest.raises(KeyError, match=\"'missing_property'\"):\n ConfigDict()['missing_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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig_TestsBaseConfig.test_base_config_properly_converted_to_dict.for_k_v_in_expected_item.assert_MyModel_model_conf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig_TestsBaseConfig.test_base_config_properly_converted_to_dict.for_k_v_in_expected_item.assert_MyModel_model_conf", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 100, "span_ids": ["TestsBaseConfig.test_base_config_equality_defaults_of_config_dict_class", "TestsBaseConfig.test_config_and_module_config_cannot_be_used_together", "TestsBaseConfig.test_base_config_properly_converted_to_dict", "TestsBaseConfig"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n def test_base_config_equality_defaults_of_config_dict_class(self):\n for key, value in _default_config.items():\n assert getattr(BaseConfig, key) == value\n\n def test_config_and_module_config_cannot_be_used_together(self):\n with pytest.raises(PydanticUserError):\n\n class MyModel(BaseModel):\n model_config = ConfigDict(title='MyTitle')\n\n class Config:\n title = 'MyTitleConfig'\n\n def test_base_config_properly_converted_to_dict(self):\n class MyConfig(BaseConfig):\n title = 'MyTitle'\n frozen = True\n\n class MyBaseModel(BaseModel):\n class Config(MyConfig):\n ...\n\n class MyModel(MyBaseModel):\n ...\n\n expected = _default_config.copy()\n expected['title'] = 'MyTitle'\n expected['frozen'] = True\n for k, v in expected.items():\n assert MyModel.model_config[k] == 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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_custom_init_signature_TestsBaseConfig.test_base_config_custom_init_signature.assert__equals_str_sig_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_custom_init_signature_TestsBaseConfig.test_base_config_custom_init_signature.assert__equals_str_sig_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 121, "span_ids": ["TestsBaseConfig.test_base_config_custom_init_signature"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_base_config_custom_init_signature(self):\n class MyModel(BaseModel):\n id: int\n name: str = 'John Doe'\n f__: str = Field(..., alias='foo')\n\n class Config:\n extra = Extra.allow\n\n def __init__(self, id: int = 1, bar=2, *, baz: Any, **data):\n super().__init__(id=id, **data)\n self.bar = bar\n self.baz = baz\n\n sig = signature(MyModel)\n assert _equals(\n map(str, sig.parameters.values()),\n ('id: int = 1', 'bar=2', 'baz: Any', \"name: str = 'John Doe'\", 'foo: str', '**data'),\n )\n assert _equals(str(sig), \"(id: int = 1, bar=2, *, baz: Any, name: str = 'John Doe', foo: str, **data) -> 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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_custom_init_signature_with_no_var_kw_TestsBaseConfig.test_base_config_extra_allow_conflict_custom_signature.assert__equals_str_signat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_custom_init_signature_with_no_var_kw_TestsBaseConfig.test_base_config_extra_allow_conflict_custom_signature.assert__equals_str_signat", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 184, "span_ids": ["TestsBaseConfig.test_base_config_does_not_use_reserved_word", "TestsBaseConfig.test_base_config_extra_allow_no_conflict", "TestsBaseConfig.test_base_config_use_field_name", "TestsBaseConfig.test_base_config_custom_init_signature_with_no_var_kw", "TestsBaseConfig.test_base_config_extra_allow_conflict_twice", "TestsBaseConfig.test_base_config_extra_allow_conflict_custom_signature"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_base_config_custom_init_signature_with_no_var_kw(self):\n class Model(BaseModel):\n a: float\n b: int = 2\n c: int\n\n def __init__(self, a: float, b: int):\n super().__init__(a=a, b=b, c=1)\n\n class Config:\n extra = Extra.allow\n\n assert _equals(str(signature(Model)), '(a: float, b: int) -> None')\n\n def test_base_config_use_field_name(self):\n class Foo(BaseModel):\n foo: str = Field(..., alias='this is invalid')\n\n class Config:\n populate_by_name = True\n\n assert _equals(str(signature(Foo)), '(*, foo: str) -> None')\n\n def test_base_config_does_not_use_reserved_word(self):\n class Foo(BaseModel):\n from_: str = Field(..., alias='from')\n\n class Config:\n populate_by_name = True\n\n assert _equals(str(signature(Foo)), '(*, from_: str) -> None')\n\n def test_base_config_extra_allow_no_conflict(self):\n class Model(BaseModel):\n spam: str\n\n class Config:\n extra = Extra.allow\n\n assert _equals(str(signature(Model)), '(*, spam: str, **extra_data: Any) -> None')\n\n def test_base_config_extra_allow_conflict_twice(self):\n class Model(BaseModel):\n extra_data: str\n extra_data_: str\n\n class Config:\n extra = Extra.allow\n\n assert _equals(str(signature(Model)), '(*, extra_data: str, extra_data_: str, **extra_data__: Any) -> None')\n\n def test_base_config_extra_allow_conflict_custom_signature(self):\n class Model(BaseModel):\n extra_data: int\n\n def __init__(self, extra_data: int = 1, **foobar: Any):\n super().__init__(extra_data=extra_data, **foobar)\n\n class Config:\n extra = Extra.allow\n\n assert _equals(str(signature(Model)), '(extra_data: int = 1, **foobar: Any) -> 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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field.None_4", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 186, "end_line": 199, "span_ids": ["TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_base_config_private_attribute_intersection_with_extra_field(self):\n class Model(BaseModel):\n _foo = PrivateAttr('private_attribute')\n\n class Config:\n extra = Extra.allow\n\n assert Model.__slots__ == {'_foo'}\n m = Model(_foo='field')\n assert m._foo == 'private_attribute'\n assert m.__dict__ == m.model_dump() == {'_foo': 'field'}\n m._foo = 'still_private'\n assert m._foo == 'still_private'\n assert m.__dict__ == m.model_dump() == {'_foo': '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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled_TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled.assert_all_v_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled_TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled.assert_all_v_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 201, "end_line": 215, "span_ids": ["TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_base_config_parse_model_with_strict_config_disabled(\n self, BaseConfigModelWithStrictConfig: Type[BaseModel]\n ) -> None:\n class Model(BaseConfigModelWithStrictConfig):\n class Config:\n strict = False\n\n values = [\n Model(a='1', b=2, c=3, d=4),\n Model(a=1, b=2, c='3', d=4),\n Model(a=1, b=2, c=3, d='4'),\n Model(a=1, b='2', c=3, d=4),\n Model(a=1, b=2, c=3, d=4),\n ]\n assert all(v.model_dump() == {'a': 1, 'b': 2, 'c': 3, 'd': 4} for v in 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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_finite_float_config_TestsBaseConfig.test_finite_float_config.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_finite_float_config_TestsBaseConfig.test_finite_float_config.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 217, "end_line": 235, "span_ids": ["TestsBaseConfig.test_finite_float_config"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_finite_float_config(self):\n class Model(BaseModel):\n a: float\n\n class Config:\n allow_inf_nan = False\n\n assert Model(a=42).a == 42\n with pytest.raises(ValidationError) as exc_info:\n Model(a=float('nan'))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'finite_number',\n 'loc': ('a',),\n 'msg': 'Input should be a finite number',\n 'input': HasRepr('nan'),\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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_str_strip_whitespace_TestsBaseConfig.test_str_strip_whitespace.assert_m_str_check_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_str_strip_whitespace_TestsBaseConfig.test_str_strip_whitespace.assert_m_str_check_res", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 237, "end_line": 253, "span_ids": ["TestsBaseConfig.test_str_strip_whitespace"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n @pytest.mark.parametrize(\n 'enabled,str_check,result_str_check',\n [\n (True, ' 123 ', '123'),\n (True, ' 123\\t\\n', '123'),\n (False, ' 123 ', ' 123 '),\n ],\n )\n def test_str_strip_whitespace(self, enabled, str_check, result_str_check):\n class Model(BaseModel):\n str_check: str\n\n class Config:\n str_strip_whitespace = enabled\n\n m = Model(str_check=str_check)\n assert m.str_check == result_str_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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_str_to_upper_TestsBaseConfig.test_namedtuple_arbitrary_type.with_pytest_raises_Pydant.ModelNoArbitraryTypes.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_str_to_upper_TestsBaseConfig.test_namedtuple_arbitrary_type.with_pytest_raises_Pydant.ModelNoArbitraryTypes.x", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 255, "end_line": 304, "span_ids": ["TestsBaseConfig.test_namedtuple_arbitrary_type", "TestsBaseConfig.test_str_to_lower", "TestsBaseConfig.test_str_to_upper"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n @pytest.mark.parametrize(\n 'enabled,str_check,result_str_check',\n [(True, 'ABCDefG', 'ABCDEFG'), (False, 'ABCDefG', 'ABCDefG')],\n )\n def test_str_to_upper(self, enabled, str_check, result_str_check):\n class Model(BaseModel):\n str_check: str\n\n class Config:\n str_to_upper = enabled\n\n m = Model(str_check=str_check)\n\n assert m.str_check == result_str_check\n\n @pytest.mark.parametrize(\n 'enabled,str_check,result_str_check',\n [(True, 'ABCDefG', 'abcdefg'), (False, 'ABCDefG', 'ABCDefG')],\n )\n def test_str_to_lower(self, enabled, str_check, result_str_check):\n class Model(BaseModel):\n str_check: str\n\n class Config:\n str_to_lower = enabled\n\n m = Model(str_check=str_check)\n\n assert m.str_check == result_str_check\n\n def test_namedtuple_arbitrary_type(self):\n class CustomClass:\n pass\n\n class Tup(NamedTuple):\n c: CustomClass\n\n class Model(BaseModel):\n x: Tup\n\n class Config:\n arbitrary_types_allowed = True\n\n data = {'x': Tup(c=CustomClass())}\n model = Model.model_validate(data)\n assert isinstance(model.x.c, CustomClass)\n with pytest.raises(PydanticSchemaGenerationError):\n\n class ModelNoArbitraryTypes(BaseModel):\n x: Tup", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_populate_by_name_config_TestsBaseConfig.test_populate_by_name_config.with_expectation_.assert_f_bar__expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_populate_by_name_config_TestsBaseConfig.test_populate_by_name_config.with_expectation_.assert_f_bar__expected", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 306, "end_line": 339, "span_ids": ["TestsBaseConfig.test_populate_by_name_config"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n @pytest.mark.parametrize(\n 'use_construct, populate_by_name_config, arg_name, expectation',\n [\n [False, True, 'bar', does_not_raise()],\n [False, True, 'bar_', does_not_raise()],\n [False, False, 'bar', does_not_raise()],\n [False, False, 'bar_', pytest.raises(ValueError)],\n [True, True, 'bar', does_not_raise()],\n [True, True, 'bar_', does_not_raise()],\n [True, False, 'bar', does_not_raise()],\n [True, False, 'bar_', does_not_raise()],\n ],\n )\n def test_populate_by_name_config(\n self,\n use_construct: bool,\n populate_by_name_config: bool,\n arg_name: str,\n expectation: ContextManager,\n ):\n expected_value: int = 7\n\n class Foo(BaseModel):\n bar_: int = Field(..., alias='bar')\n\n class Config(BaseConfig):\n populate_by_name = populate_by_name_config\n\n with expectation:\n if use_construct:\n f = Foo.model_construct(**{arg_name: expected_value})\n else:\n f = Foo(**{arg_name: expected_value})\n assert f.bar_ == expected_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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_immutable_copy_with_frozen_TestsBaseConfig.test_config_class_attributes_are_deprecated.None_3.assert_Config_validate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_immutable_copy_with_frozen_TestsBaseConfig.test_config_class_attributes_are_deprecated.None_3.assert_Config_validate_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 341, "end_line": 386, "span_ids": ["TestsBaseConfig.test_config_class_attributes_are_deprecated", "TestsBaseConfig.test_config_class_is_deprecated", "TestsBaseConfig.test_immutable_copy_with_frozen"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_immutable_copy_with_frozen(self):\n class Model(BaseModel):\n a: int\n b: int\n\n class Config:\n frozen = True\n\n m = Model(a=40, b=10)\n assert m == m.model_copy()\n\n def test_config_class_is_deprecated(self):\n with pytest.warns(\n DeprecationWarning, match='`BaseConfig` is deprecated and will be removed in a future version'\n ):\n\n class Config(BaseConfig):\n pass\n\n def test_config_class_attributes_are_deprecated(self):\n with pytest.warns(\n DeprecationWarning,\n match='Support for \"config\" as \"BaseConfig\" is deprecated and will be removed in a future version\"',\n ):\n assert BaseConfig.validate_assignment is False\n\n with pytest.warns(\n DeprecationWarning,\n match='Support for \"config\" as \"BaseConfig\" is deprecated and will be removed in a future version\"',\n ):\n assert BaseConfig().validate_assignment is False\n\n class Config(BaseConfig):\n pass\n\n with pytest.warns(\n DeprecationWarning,\n match='Support for \"config\" as \"Config\" is deprecated and will be removed in a future version\"',\n ):\n assert Config.validate_assignment is False\n\n with pytest.warns(\n DeprecationWarning,\n match='Support for \"config\" as \"Config\" is deprecated and will be removed in a future version\"',\n ):\n assert Config().validate_assignment 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_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_config_class_missing_attributes_TestsBaseConfig.test_config_class_missing_attributes.None_3.Config_missing_attribut": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_TestsBaseConfig.test_config_class_missing_attributes_TestsBaseConfig.test_config_class_missing_attributes.None_3.Config_missing_attribut", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 388, "end_line": 402, "span_ids": ["TestsBaseConfig.test_config_class_missing_attributes"], "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": "@pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\nclass TestsBaseConfig:\n\n def test_config_class_missing_attributes(self):\n with pytest.raises(AttributeError, match=\"type object 'BaseConfig' has no attribute 'missing_attribute'\"):\n BaseConfig.missing_attribute\n\n with pytest.raises(AttributeError, match=\"'BaseConfig' object has no attribute 'missing_attribute'\"):\n BaseConfig().missing_attribute\n\n class Config(BaseConfig):\n pass\n\n with pytest.raises(AttributeError, match=\"type object 'Config' has no attribute 'missing_attribute'\"):\n Config.missing_attribute\n\n with pytest.raises(AttributeError, match=\"'Config' object has no attribute 'missing_attribute'\"):\n Config().missing_attribute", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_key_deprecation_test_config_key_deprecation.None_3.my_function.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_key_deprecation_test_config_key_deprecation.None_3.my_function.pass", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 405, "end_line": 463, "span_ids": ["test_config_key_deprecation"], "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": "def test_config_key_deprecation():\n config_dict = {\n 'allow_mutation': None,\n 'error_msg_templates': None,\n 'fields': None,\n 'getter_dict': None,\n 'schema_extra': None,\n 'smart_union': None,\n 'underscore_attrs_are_private': None,\n 'allow_population_by_field_name': None,\n 'anystr_lower': None,\n 'anystr_strip_whitespace': None,\n 'anystr_upper': None,\n 'keep_untouched': None,\n 'max_anystr_length': None,\n 'min_anystr_length': None,\n 'orm_mode': None,\n 'validate_all': None,\n }\n\n warning_message = \"\"\"\nValid config keys have changed in V2:\n* 'allow_population_by_field_name' has been renamed to 'populate_by_name'\n* 'anystr_lower' has been renamed to 'str_to_lower'\n* 'anystr_strip_whitespace' has been renamed to 'str_strip_whitespace'\n* 'anystr_upper' has been renamed to 'str_to_upper'\n* 'keep_untouched' has been renamed to 'ignored_types'\n* 'max_anystr_length' has been renamed to 'str_max_length'\n* 'min_anystr_length' has been renamed to 'str_min_length'\n* 'orm_mode' has been renamed to 'from_attributes'\n* 'validate_all' has been renamed to 'validate_default'\n* 'allow_mutation' has been removed\n* 'error_msg_templates' has been removed\n* 'fields' has been removed\n* 'getter_dict' has been removed\n* 'schema_extra' has been removed\n* 'smart_union' has been removed\n* 'underscore_attrs_are_private' has been removed\n \"\"\".strip()\n\n with pytest.warns(UserWarning, match=re.escape(warning_message)):\n\n class MyModel(BaseModel):\n model_config = config_dict\n\n with pytest.warns(UserWarning, match=re.escape(warning_message)):\n create_model('MyCreatedModel', __config__=config_dict)\n\n with pytest.warns(UserWarning, match=re.escape(warning_message)):\n\n @pydantic_dataclass(config=config_dict)\n class MyDataclass:\n pass\n\n with pytest.warns(UserWarning, match=re.escape(warning_message)):\n\n @validate_arguments(config=config_dict)\n def my_function():\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_pydantic__pydantic/tests/test_config.py_test_invalid_extra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_invalid_extra_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 466, "end_line": 516, "span_ids": ["test_invalid_config_keys", "test_invalid_extra"], "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 test_invalid_extra():\n error_message = \"'{label}': 'invalid-value' is not a valid value for config['extra']\"\n config_dict = {'extra': 'invalid-value'}\n\n with pytest.raises(ValueError, match=re.escape(error_message.format(label='MyModel'))):\n\n class MyModel(BaseModel):\n model_config = config_dict\n\n with pytest.raises(ValueError, match=re.escape(error_message.format(label='MyCreatedModel'))):\n create_model('MyCreatedModel', __config__=config_dict)\n\n with pytest.raises(ValueError, match=re.escape(error_message.format(label='MyDataclass'))):\n\n @pydantic_dataclass(config=config_dict)\n class MyDataclass:\n pass\n\n with pytest.raises(ValueError, match=re.escape(error_message.format(label='my_function'))):\n\n @validate_arguments(config=config_dict)\n def my_function():\n pass\n\n with pytest.raises(ValueError, match=re.escape(error_message.format(label='validate_arguments'))):\n # This case happens when the function passed to `validate_arguments` has no `__name__`.\n # This is a pretty exotic case, but it has caused issues in the past, so I wanted to add a test.\n def my_wrapped_function():\n pass\n\n my_partial_function = partial(my_wrapped_function)\n my_partial_function.__annotations__ = my_wrapped_function.__annotations__\n validate_arguments(config=config_dict)(my_partial_function)\n\n with pytest.raises(ValueError, match=re.escape(error_message.format(label='ConfigDict'))):\n get_config(config_dict)\n\n\ndef test_invalid_config_keys():\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n 'Setting the \"alias_generator\" property on custom Config for'\n ' @validate_arguments is not yet supported, please remove.'\n ),\n ):\n\n @validate_arguments(config={'alias_generator': None})\n def my_function():\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_pydantic__pydantic/tests/test_construction.py_pickle_test_large_any_str.assert_m_b_content_str": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_pickle_test_large_any_str.assert_m_b_content_str", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 71, "span_ids": ["test_construct_misuse", "test_construct_fields_set", "test_simple_construct", "imports", "test_construct_keep_order", "test_large_any_str", "Model", "test_construct_allow_extra"], "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": "import pickle\nfrom typing import Any, List, Optional\n\nimport pytest\n\nfrom pydantic import BaseModel, ConfigDict, Field, PrivateAttr\nfrom pydantic.fields import Undefined\n\n\nclass Model(BaseModel):\n a: float\n b: int = 10\n\n\ndef test_simple_construct():\n m = Model.model_construct(a=3.14)\n assert m.a == 3.14\n assert m.b == 10\n assert m.__fields_set__ == {'a'}\n assert m.model_dump() == {'a': 3.14, 'b': 10}\n\n\ndef test_construct_misuse():\n m = Model.model_construct(b='foobar')\n assert m.b == 'foobar'\n with pytest.warns(UserWarning, match='Expected `int` but got `str`'):\n assert m.model_dump() == {'b': 'foobar'}\n with pytest.raises(AttributeError, match=\"'Model' object has no attribute 'a'\"):\n print(m.a)\n\n\ndef test_construct_fields_set():\n m = Model.model_construct(a=3.0, b=-1, _fields_set={'a'})\n assert m.a == 3\n assert m.b == -1\n assert m.__fields_set__ == {'a'}\n assert m.model_dump() == {'a': 3, 'b': -1}\n\n\ndef test_construct_allow_extra():\n \"\"\"model_construct() should allow extra fields\"\"\"\n\n class Foo(BaseModel, extra='allow'):\n x: int\n\n assert Foo.model_construct(x=1, y=2).model_dump() == {'x': 1, 'y': 2}\n\n\ndef test_construct_keep_order():\n class Foo(BaseModel):\n a: int\n b: int = 42\n c: float\n\n instance = Foo(a=1, b=321, c=3.14)\n instance_construct = Foo.model_construct(**instance.model_dump())\n assert instance == instance_construct\n assert instance.model_dump() == instance_construct.model_dump()\n assert instance.model_dump_json() == instance_construct.model_dump_json()\n\n\ndef test_large_any_str():\n class Model(BaseModel):\n a: bytes\n b: str\n\n content_bytes = b'x' * (2**16 + 1)\n content_str = 'x' * (2**16 + 1)\n m = Model(a=content_bytes, b=content_str)\n assert m.a == content_bytes\n assert m.b == content_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_pydantic__pydantic/tests/test_construction.py_deprecated_copy_deprecated_copy.with_pytest_warns_.return.m_copy_include_include_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_deprecated_copy_deprecated_copy.with_pytest_warns_.return.m_copy_include_include_e", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 86, "span_ids": ["deprecated_copy"], "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 deprecated_copy(m: BaseModel, *, include=None, exclude=None, update=None, deep=False):\n \"\"\"\n This should only be used to make calls to the deprecated `copy` method with arguments\n that have been removed from `model_copy`. Otherwise, use the `copy_method` fixture below\n \"\"\"\n with pytest.warns(\n DeprecationWarning,\n match=(\n 'The `copy` method is deprecated; use `model_copy` instead. '\n 'See the docstring of `BaseModel.copy` for details about how to handle `include` and `exclude`.'\n ),\n ):\n return m.copy(include=include, exclude=exclude, update=update, deep=deep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_copy_method_model_two_fixture.return.ModelTwo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_copy_method_model_two_fixture.return.ModelTwo", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 124, "span_ids": ["model_two_fixture", "test_simple_copy", "copy_method"], "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": "@pytest.fixture(params=['copy', 'model_copy'])\ndef copy_method(request):\n \"\"\"\n Fixture to test both the old/deprecated `copy` and new `model_copy` methods.\n \"\"\"\n if request.param == 'copy':\n return deprecated_copy\n else:\n\n def new_copy_method(m, *, update=None, deep=False):\n return m.model_copy(update=update, deep=deep)\n\n return new_copy_method\n\n\ndef test_simple_copy(copy_method):\n m = Model(a=24)\n m2 = copy_method(m)\n\n assert m.a == m2.a == 24\n assert m.b == m2.b == 10\n assert m == m2\n assert m.model_fields == m2.model_fields\n\n\n@pytest.fixture(scope='session', name='ModelTwo')\ndef model_two_fixture():\n class ModelTwo(BaseModel):\n _foo_ = PrivateAttr({'private'})\n\n a: float\n b: int = 10\n c: str = 'foobar'\n d: Model\n\n return ModelTwo", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_deep_copy_test_deep_copy.assert_m__foo__is_not_m2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_deep_copy_test_deep_copy.assert_m__foo__is_not_m2_", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 127, "end_line": 139, "span_ids": ["test_deep_copy"], "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 test_deep_copy(ModelTwo, copy_method):\n m = ModelTwo(a=24, d=Model(a='12'))\n m._foo_ = {'new value'}\n m2 = copy_method(m, deep=True)\n\n assert m.a == m2.a == 24\n assert m.b == m2.b == 10\n assert m.c == m2.c == 'foobar'\n assert m.d is not m2.d\n assert m == m2\n assert m.model_fields == m2.model_fields\n assert m._foo_ == m2._foo_\n assert m._foo_ is not m2._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_pydantic__pydantic/tests/test_construction.py_test_copy_exclude_test_copy_exclude.assert_m_m2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_exclude_test_copy_exclude.assert_m_m2", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 142, "end_line": 155, "span_ids": ["test_copy_exclude"], "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 test_copy_exclude(ModelTwo):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = deprecated_copy(m, exclude={'b'})\n\n assert m.a == m2.a == 24\n assert isinstance(m2.d, Model)\n assert m2.d.a == 12\n\n assert hasattr(m2, 'c')\n assert not hasattr(m2, 'b')\n assert set(m.model_dump().keys()) == {'a', 'b', 'c', 'd'}\n assert set(m2.model_dump().keys()) == {'a', 'c', 'd'}\n\n assert m != m2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_include_test_copy_include_exclude.assert_set_m2_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_include_test_copy_include_exclude.assert_set_m2_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 158, "end_line": 174, "span_ids": ["test_copy_include", "test_copy_include_exclude"], "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 test_copy_include(ModelTwo):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = deprecated_copy(m, include={'a'})\n\n assert m.a == m2.a == 24\n assert set(m.model_dump().keys()) == {'a', 'b', 'c', 'd'}\n assert set(m2.model_dump().keys()) == {'a'}\n\n assert m != m2\n\n\ndef test_copy_include_exclude(ModelTwo):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = deprecated_copy(m, include={'a', 'b', 'c'}, exclude={'c'})\n\n assert set(m.model_dump().keys()) == {'a', 'b', 'c', 'd'}\n assert set(m2.model_dump().keys()) == {'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_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_exclude_test_copy_advanced_exclude.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_exclude_test_copy_advanced_exclude.None_3", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 197, "span_ids": ["test_copy_advanced_exclude"], "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 test_copy_advanced_exclude():\n class SubSubModel(BaseModel):\n a: str\n b: str\n\n class SubModel(BaseModel):\n c: str\n d: List[SubSubModel]\n\n class Model(BaseModel):\n e: str\n f: SubModel\n\n m = Model(e='e', f=SubModel(c='foo', d=[SubSubModel(a='a', b='b'), SubSubModel(a='c', b='e')]))\n m2 = deprecated_copy(m, exclude={'f': {'c': ..., 'd': {-1: {'a'}}}})\n assert hasattr(m.f, 'c')\n assert not hasattr(m2.f, 'c')\n\n assert m2.model_dump() == {'e': 'e', 'f': {'d': [{'a': 'a', 'b': 'b'}, {'b': 'e'}]}}\n m2 = deprecated_copy(m, exclude={'e': ..., 'f': {'d'}})\n assert m2.model_dump() == {'f': {'c': '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_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_include_test_copy_advanced_include.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_include_test_copy_advanced_include.None_3", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 200, "end_line": 220, "span_ids": ["test_copy_advanced_include"], "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 test_copy_advanced_include():\n class SubSubModel(BaseModel):\n a: str\n b: str\n\n class SubModel(BaseModel):\n c: str\n d: List[SubSubModel]\n\n class Model(BaseModel):\n e: str\n f: SubModel\n\n m = Model(e='e', f=SubModel(c='foo', d=[SubSubModel(a='a', b='b'), SubSubModel(a='c', b='e')]))\n m2 = deprecated_copy(m, include={'f': {'c'}})\n assert hasattr(m.f, 'c')\n assert hasattr(m2.f, 'c')\n assert m2.model_dump() == {'f': {'c': 'foo'}}\n\n m2 = deprecated_copy(m, include={'e': ..., 'f': {'d': {-1}}})\n assert m2.model_dump() == {'e': 'e', 'f': {'d': [{'a': 'c', 'b': '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_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_include_exclude_test_copy_advanced_include_exclude.assert_m2_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_advanced_include_exclude_test_copy_advanced_include_exclude.assert_m2_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 223, "end_line": 238, "span_ids": ["test_copy_advanced_include_exclude"], "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 test_copy_advanced_include_exclude():\n class SubSubModel(BaseModel):\n a: str\n b: str\n\n class SubModel(BaseModel):\n c: str\n d: List[SubSubModel]\n\n class Model(BaseModel):\n e: str\n f: SubModel\n\n m = Model(e='e', f=SubModel(c='foo', d=[SubSubModel(a='a', b='b'), SubSubModel(a='c', b='e')]))\n m2 = deprecated_copy(m, include={'e': ..., 'f': {'d'}}, exclude={'e': ..., 'f': {'d': {0}}})\n assert m2.model_dump() == {'f': {'d': [{'a': 'c', 'b': '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_pydantic__pydantic/tests/test_construction.py_test_copy_update_test_copy_update.assert_m_m2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_test_copy_update.assert_m_m2", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 241, "end_line": 251, "span_ids": ["test_copy_update"], "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": "def test_copy_update(ModelTwo, copy_method):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = copy_method(m, update={'a': 'different'})\n\n assert m.a == 24\n assert m2.a == 'different'\n m_keys = m.model_dump().keys()\n with pytest.warns(UserWarning, match='Expected `float` but got `str`'):\n m2_keys = m2.model_dump().keys()\n assert set(m_keys) == set(m2_keys) == {'a', 'b', 'c', 'd'}\n assert m != m2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_unset_test_copy_set_fields.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_unset_test_copy_set_fields.None_1", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 270, "span_ids": ["test_copy_set_fields", "test_copy_update_unset"], "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": "def test_copy_update_unset(copy_method):\n class Foo(BaseModel):\n foo: Optional[str] = None\n bar: Optional[str] = None\n\n assert (\n copy_method(Foo(foo='hello'), update={'bar': 'world'}).model_dump_json(exclude_unset=True)\n == '{\"foo\":\"hello\",\"bar\":\"world\"}'\n )\n\n\ndef test_copy_set_fields(ModelTwo, copy_method):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = copy_method(m)\n\n assert m.model_dump(exclude_unset=True) == {'a': 24.0, 'd': {'a': 12}}\n assert m.model_dump(exclude_unset=True) == m2.model_dump(exclude_unset=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_pydantic__pydantic/tests/test_construction.py_test_simple_pickle_test_simple_pickle.assert_m_model_fields_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_simple_pickle_test_simple_pickle.assert_m_model_fields_", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 273, "end_line": 283, "span_ids": ["test_simple_pickle"], "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 test_simple_pickle():\n m = Model(a='24')\n b = pickle.dumps(m)\n m2 = pickle.loads(b)\n assert m.a == m2.a == 24\n assert m.b == m2.b == 10\n assert m == m2\n assert m is not m2\n assert tuple(m) == (('a', 24.0), ('b', 10))\n assert tuple(m2) == (('a', 24.0), ('b', 10))\n assert m.model_fields == m2.model_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_pydantic__pydantic/tests/test_construction.py_test_recursive_pickle_test_recursive_pickle.assert_m__foo__m2__foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_recursive_pickle_test_recursive_pickle.assert_m__foo__m2__foo", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 286, "end_line": 310, "span_ids": ["test_recursive_pickle"], "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_recursive_pickle(create_module):\n @create_module\n def module():\n from pydantic import BaseModel, PrivateAttr\n\n class PickleModel(BaseModel):\n a: float\n b: int = 10\n\n class PickleModelTwo(BaseModel):\n _foo_ = PrivateAttr({'private'})\n\n a: float\n b: int = 10\n c: str = 'foobar'\n d: PickleModel\n\n m = module.PickleModelTwo(a=24, d=module.PickleModel(a='123.45'))\n m2 = pickle.loads(pickle.dumps(m))\n assert m == m2\n\n assert m.d.a == 123.45\n assert m2.d.a == 123.45\n assert m.model_fields == m2.model_fields\n assert m._foo_ == m2._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_pydantic__pydantic/tests/test_construction.py_test_pickle_undefined_test_pickle_undefined.assert_not_hasattr_m3__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_pickle_undefined_test_pickle_undefined.assert_not_hasattr_m3__", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 313, "end_line": 336, "span_ids": ["test_pickle_undefined"], "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 test_pickle_undefined(create_module):\n @create_module\n def module():\n from pydantic import BaseModel, PrivateAttr\n\n class PickleModel(BaseModel):\n a: float\n b: int = 10\n\n class PickleModelTwo(BaseModel):\n _foo_ = PrivateAttr({'private'})\n\n a: float\n b: int = 10\n c: str = 'foobar'\n d: PickleModel\n\n m = module.PickleModelTwo(a=24, d=module.PickleModel(a='123.45'))\n m2 = pickle.loads(pickle.dumps(m))\n assert m2._foo_ == {'private'}\n\n m._foo_ = Undefined\n m3 = pickle.loads(pickle.dumps(m))\n assert not hasattr(m3, '_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_pydantic__pydantic/tests/test_construction.py_test_copy_undefined_test_pickle_fields_set.assert_m2_model_dump_excl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_undefined_test_pickle_fields_set.assert_m2_model_dump_excl", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 339, "end_line": 368, "span_ids": ["test_copy_undefined", "test_pickle_fields_set", "test_immutable_copy_with_frozen"], "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 test_copy_undefined(ModelTwo, copy_method):\n m = ModelTwo(a=24, d=Model(a='123.45'))\n m2 = copy_method(m)\n assert m2._foo_ == {'private'}\n\n m._foo_ = Undefined\n m3 = copy_method(m)\n assert not hasattr(m3, '_foo_')\n\n\ndef test_immutable_copy_with_frozen(copy_method):\n class Model(BaseModel):\n model_config = ConfigDict(frozen=True)\n a: int\n b: int\n\n m = Model(a=40, b=10)\n assert m == copy_method(m)\n\n m2 = copy_method(m, update={'b': 12})\n assert repr(m2) == 'Model(a=40, b=12)'\n with pytest.raises(TypeError):\n m2.b = 13\n\n\ndef test_pickle_fields_set():\n m = Model(a=24)\n assert m.model_dump(exclude_unset=True) == {'a': 24}\n m2 = pickle.loads(pickle.dumps(m))\n assert m2.model_dump(exclude_unset=True) == {'a': 24}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_exclude_test_copy_update_exclude.with_pytest_warns_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_update_exclude_test_copy_update_exclude.with_pytest_warns_.None_1", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 371, "end_line": 393, "span_ids": ["test_copy_update_exclude"], "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 test_copy_update_exclude():\n class SubModel(BaseModel):\n a: str\n b: str\n\n class Model(BaseModel):\n c: str\n d: SubModel\n\n m = Model(c='ex', d=dict(a='ax', b='bx'))\n assert m.model_dump() == {'c': 'ex', 'd': {'a': 'ax', 'b': 'bx'}}\n assert deprecated_copy(m, exclude={'c'}).model_dump() == {'d': {'a': 'ax', 'b': 'bx'}}\n with pytest.warns(UserWarning, match='Expected `str` but got `int`'):\n assert deprecated_copy(m, exclude={'c'}, update={'c': 42}).model_dump() == {\n 'c': 42,\n 'd': {'a': 'ax', 'b': 'bx'},\n }\n\n with pytest.warns(\n DeprecationWarning, match='The private method `_calculate_keys` will be removed and should no longer be used.'\n ):\n assert m._calculate_keys(exclude={'x': ...}, include=None, exclude_unset=False) == {'c', 'd'}\n assert m._calculate_keys(exclude={'x': ...}, include=None, exclude_unset=False, update={'c': 42}) == {'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_pydantic__pydantic/tests/test_construction.py_test_shallow_copy_modify_test_shallow_copy_modify.assert_y_deep_deep_thing": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_shallow_copy_modify_test_shallow_copy_modify.assert_y_deep_deep_thing", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 396, "end_line": 411, "span_ids": ["test_shallow_copy_modify"], "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 test_shallow_copy_modify(copy_method):\n class X(BaseModel):\n val: int\n deep: Any\n\n x = X(val=1, deep={'deep_thing': [1, 2]})\n\n y = copy_method(x)\n y.val = 2\n y.deep['deep_thing'].append(3)\n\n assert x.val == 1\n assert y.val == 2\n # deep['deep_thing'] gets modified\n assert x.deep['deep_thing'] == [1, 2, 3]\n assert y.deep['deep_thing'] == [1, 2, 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_pydantic__pydantic/tests/test_construction.py_test_construct_default_factory_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_construct_default_factory_", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 414, "end_line": 477, "span_ids": ["test_dunder_copy", "test_construct_default_factory", "test_model_copy", "test_dunder_deepcopy", "test_copy_with_excluded_fields"], "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 test_construct_default_factory():\n class Model(BaseModel):\n foo: List[int] = Field(default_factory=list)\n bar: str = 'Baz'\n\n m = Model.model_construct()\n assert m.foo == []\n assert m.bar == 'Baz'\n\n\ndef test_copy_with_excluded_fields():\n class User(BaseModel):\n name: str\n age: int\n dob: str\n\n user = User(name='test_user', age=23, dob='01/01/2000')\n user_copy = deprecated_copy(user, exclude={'dob': ...})\n\n assert 'dob' in user.__fields_set__\n assert 'dob' not in user_copy.__fields_set__\n\n\ndef test_dunder_copy(ModelTwo):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = m.__copy__()\n assert m is not m2\n\n assert m.a == m2.a == 24\n assert isinstance(m2.d, Model)\n assert m.d is m2.d\n assert m.d.a == m2.d.a == 12\n\n m.a = 12\n assert m.a != m2.a\n\n\ndef test_dunder_deepcopy(ModelTwo):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = m.__copy__()\n assert m is not m2\n\n assert m.a == m2.a == 24\n assert isinstance(m2.d, Model)\n assert m.d is m2.d\n assert m.d.a == m2.d.a == 12\n\n m.a = 12\n assert m.a != m2.a\n\n\ndef test_model_copy(ModelTwo):\n m = ModelTwo(a=24, d=Model(a='12'))\n m2 = m.__copy__()\n assert m is not m2\n\n assert m.a == m2.a == 24\n assert isinstance(m2.d, Model)\n assert m.d is m2.d\n assert m.d.a == m2.d.a == 12\n\n m.a = 12\n assert m.a != m2.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_pydantic__pydantic/tests/test_create_model.py_from_typing_import_Option_test_create_model.assert_model___module___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_from_typing_import_Option_test_create_model.assert_model___module___", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "test_create_model"], "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": "from typing import Optional, Tuple\n\nimport pytest\n\nfrom pydantic import BaseModel, ConfigDict, Extra, Field, ValidationError, create_model, errors\nfrom pydantic.decorators import field_validator, validator\nfrom pydantic.fields import ModelPrivateAttr\n\n\ndef test_create_model():\n model = create_model('FooModel', foo=(str, ...), bar=(int, 123))\n assert issubclass(model, BaseModel)\n assert model.model_config == BaseModel.model_config\n assert model.__name__ == 'FooModel'\n assert model.model_fields.keys() == {'foo', 'bar'}\n\n assert not model.__pydantic_decorators__.validator\n assert not model.__pydantic_decorators__.root_validator\n assert not model.__pydantic_decorators__.field_validator\n assert not model.__pydantic_decorators__.field_serializer\n\n assert model.__module__ == 'pydantic.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_pydantic__pydantic/tests/test_create_model.py_test_create_model_usage_test_create_model_pickle.module.assert_m2_is_not_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_usage_test_create_model_pickle.module.assert_m2_is_not_m", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 56, "span_ids": ["test_create_model_pickle", "test_create_model_usage"], "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 test_create_model_usage():\n model = create_model('FooModel', foo=(str, ...), bar=(int, 123))\n m = model(foo='hello')\n assert m.foo == 'hello'\n assert m.bar == 123\n with pytest.raises(ValidationError):\n model()\n with pytest.raises(ValidationError):\n model(foo='hello', bar='xxx')\n\n\ndef test_create_model_pickle(create_module):\n \"\"\"\n Pickle will work for dynamically created model only if it was defined globally with its class name\n and module where it's defined was specified\n \"\"\"\n\n @create_module\n def module():\n import pickle\n\n from pydantic import create_model\n\n FooModel = create_model('FooModel', foo=(str, ...), bar=(int, 123), __module__=__name__)\n\n m = FooModel(foo='hello')\n d = pickle.dumps(m)\n m2 = pickle.loads(d)\n assert m2.foo == m.foo == 'hello'\n assert m2.bar == m.bar == 123\n assert m2 == m\n assert m2 is not 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_pydantic__pydantic/tests/test_create_model.py_test_invalid_name_test_config_and_base.with_pytest_raises_errors.create_model_FooModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_invalid_name_test_config_and_base.with_pytest_raises_errors.create_model_FooModel_", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 72, "span_ids": ["test_field_wrong_tuple", "test_config_and_base", "test_invalid_name"], "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 test_invalid_name():\n with pytest.warns(RuntimeWarning):\n model = create_model('FooModel', _foo=(str, ...))\n assert len(model.model_fields) == 0\n\n\ndef test_field_wrong_tuple():\n with pytest.raises(errors.PydanticUserError):\n create_model('FooModel', foo=(1, 2, 3))\n\n\ndef test_config_and_base():\n with pytest.raises(errors.PydanticUserError):\n create_model('FooModel', __config__=BaseModel.model_config, __base__=BaseModel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_test_inheritance.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_test_inheritance.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 83, "span_ids": ["test_inheritance"], "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 test_inheritance():\n class BarModel(BaseModel):\n x: int = 1\n y: int = 2\n\n model = create_model('FooModel', foo=(str, ...), bar=(int, 123), __base__=BarModel)\n assert model.model_fields.keys() == {'foo', 'bar', 'x', 'y'}\n m = model(foo='a', x=4)\n assert m.model_dump() == {'bar': 123, 'foo': 'a', 'x': 4, 'y': 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_pydantic__pydantic/tests/test_create_model.py_test_custom_config_test_custom_config_extras.with_pytest_raises_Valida.model_bar_654_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_custom_config_test_custom_config_extras.with_pytest_raises_Valida.model_bar_654_", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 121, "span_ids": ["test_custom_config_extras", "test_custom_config_inherits", "test_custom_config"], "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 test_custom_config():\n config = ConfigDict(frozen=True)\n expected_config = BaseModel.model_config.copy()\n expected_config['frozen'] = True\n\n model = create_model('FooModel', foo=(int, ...), __config__=config)\n m = model(**{'foo': '987'})\n assert m.foo == 987\n assert model.model_config == expected_config\n with pytest.raises(TypeError):\n m.foo = 654\n\n\ndef test_custom_config_inherits():\n class Config(ConfigDict):\n custom_config: bool\n\n config = Config(custom_config=True, validate_assignment=True)\n expected_config = Config(BaseModel.model_config)\n expected_config.update(config)\n\n model = create_model('FooModel', foo=(int, ...), __config__=config)\n m = model(**{'foo': '987'})\n assert m.foo == 987\n assert model.model_config == expected_config\n with pytest.raises(ValidationError):\n m.foo = ['123']\n\n\ndef test_custom_config_extras():\n config = ConfigDict(extra=Extra.forbid)\n\n model = create_model('FooModel', foo=(int, ...), __config__=config)\n assert model(foo=654)\n with pytest.raises(ValidationError):\n model(bar=654)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_test_inheritance_validators.with_pytest_raises_Valida.model_a_something_else_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_test_inheritance_validators.with_pytest_raises_Valida.model_a_something_else_", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 137, "span_ids": ["test_inheritance_validators"], "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 test_inheritance_validators():\n class BarModel(BaseModel):\n @field_validator('a', check_fields=False)\n @classmethod\n def check_a(cls, v):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n model = create_model('FooModel', a=(str, 'cake'), __base__=BarModel)\n assert model().a == 'cake'\n assert model(a='this is foobar good').a == 'this is foobar good'\n with pytest.raises(ValidationError):\n model(a='something 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_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_always_test_inheritance_validators_always.None_1.model_a_something_else_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_always_test_inheritance_validators_always.None_1.model_a_something_else_", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 140, "end_line": 154, "span_ids": ["test_inheritance_validators_always"], "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 test_inheritance_validators_always():\n class BarModel(BaseModel):\n @field_validator('a', check_fields=False)\n @classmethod\n def check_a(cls, v):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n model = create_model('FooModel', a=(str, Field('cake', validate_default=True)), __base__=BarModel)\n with pytest.raises(ValidationError):\n model()\n assert model(a='this is foobar good').a == 'this is foobar good'\n with pytest.raises(ValidationError):\n model(a='something 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_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_all_test_inheritance_validators_all.assert_model_a_2_b_6_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_validators_all_test_inheritance_validators_all.assert_model_a_2_b_6_mo", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 157, "end_line": 167, "span_ids": ["test_inheritance_validators_all"], "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 test_inheritance_validators_all():\n with pytest.warns(DeprecationWarning, match='Pydantic V1 style `@validator` validators are deprecated'):\n\n class BarModel(BaseModel):\n @validator('*')\n @classmethod\n def check_all(cls, v):\n return v * 2\n\n model = create_model('FooModel', a=(int, ...), b=(int, ...), __base__=BarModel)\n assert model(a=2, b=6).model_dump() == {'a': 4, 'b': 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_pydantic__pydantic/tests/test_create_model.py_test_funky_name_test_funky_name.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_funky_name_test_funky_name.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 178, "span_ids": ["test_funky_name"], "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 test_funky_name():\n model = create_model('FooModel', **{'this-is-funky': (int, ...)})\n m = model(**{'this-is-funky': '123'})\n assert m.model_dump() == {'this-is-funky': 123}\n with pytest.raises(ValidationError) as exc_info:\n model()\n assert exc_info.value.errors() == [\n {'input': {}, 'loc': ('this-is-funky',), 'msg': 'Field required', 'type': 'missing'}\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_pydantic__pydantic/tests/test_create_model.py_test_repeat_base_usage_test_repeat_base_usage.assert_model3_model_field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_repeat_base_usage_test_repeat_base_usage.assert_model3_model_field", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 203, "span_ids": ["test_repeat_base_usage"], "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 test_repeat_base_usage():\n class Model(BaseModel):\n a: str\n\n assert Model.model_fields.keys() == {'a'}\n\n model = create_model('FooModel', b=(int, 1), __base__=Model)\n\n assert Model.model_fields.keys() == {'a'}\n assert model.model_fields.keys() == {'a', 'b'}\n\n model2 = create_model('Foo2Model', c=(int, 1), __base__=Model)\n\n assert Model.model_fields.keys() == {'a'}\n assert model.model_fields.keys() == {'a', 'b'}\n assert model2.model_fields.keys() == {'a', 'c'}\n\n model3 = create_model('Foo2Model', d=(int, 1), __base__=model)\n\n assert Model.model_fields.keys() == {'a'}\n assert model.model_fields.keys() == {'a', 'b'}\n assert model2.model_fields.keys() == {'a', 'c'}\n assert model3.model_fields.keys() == {'a', 'b', '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_pydantic__pydantic/tests/test_create_model.py_test_dynamic_and_static_test_config_field_info_create_model.assert_m2_model_json_sche": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_dynamic_and_static_test_config_field_info_create_model.assert_m2_model_json_sche", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 206, "end_line": 238, "span_ids": ["test_config_field_info_create_model", "test_dynamic_and_static"], "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 test_dynamic_and_static():\n class A(BaseModel):\n x: int\n y: float\n z: str\n\n DynamicA = create_model('A', x=(int, ...), y=(float, ...), z=(str, ...))\n\n for field_name in ('x', 'y', 'z'):\n assert A.model_fields[field_name].default == DynamicA.model_fields[field_name].default\n\n\ndef test_config_field_info_create_model():\n # TODO fields doesn't exist anymore, remove test?\n # class Config:\n # fields = {'a': {'description': 'descr'}}\n ConfigDict()\n\n m1 = create_model('M1', __config__={'title': 'abc'}, a=(str, ...))\n assert m1.model_json_schema() == {\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'abc',\n 'type': 'object',\n }\n\n m2 = create_model('M2', __config__={}, a=(str, Field(description='descr')))\n assert m2.model_json_schema() == {\n 'properties': {'a': {'description': 'descr', 'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'M2',\n 'type': 'object',\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_pydantic__pydantic/tests/test_create_model.py_test_set_name_test_set_name.if_base_is_object_.assert_a__some_func_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_set_name_test_set_name.if_base_is_object_.assert_a__some_func_2", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 241, "end_line": 271, "span_ids": ["test_set_name"], "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": "@pytest.mark.parametrize('base', [ModelPrivateAttr, object])\ndef test_set_name(base):\n calls = []\n\n class class_deco(base):\n def __init__(self, fn):\n super().__init__()\n self.fn = fn\n\n def __set_name__(self, owner, name):\n calls.append((owner, name))\n\n def __get__(self, obj, type=None):\n return self.fn(obj) if obj else self\n\n class A(BaseModel):\n x: int\n\n @class_deco\n def _some_func(self):\n return self.x\n\n assert calls == [(A, '_some_func')]\n a = A(x=2)\n\n # we don't test whether calling the method on a PrivateAttr works:\n # attribute access on privateAttributes is more complicated, it doesn't\n # get added to the class namespace (and will also get set on the instance\n # with _init_private_attributes), so the descriptor protocol won't work.\n if base is object:\n assert a._some_func == 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_pydantic__pydantic/tests/test_create_model.py_test_create_model_with_slots_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_with_slots_", "embedding": null, "metadata": {"file_path": "tests/test_create_model.py", "file_name": "test_create_model.py", "file_type": "text/x-python", "category": "test", "start_line": 274, "end_line": 288, "span_ids": ["test_create_model_with_slots", "test_create_model_non_annotated"], "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 test_create_model_with_slots():\n field_definitions = {'__slots__': (Optional[Tuple[str, ...]], None), 'foobar': (Optional[int], None)}\n with pytest.warns(RuntimeWarning, match='__slots__ should not be passed to create_model'):\n model = create_model('PartialPet', **field_definitions)\n\n assert model.model_fields.keys() == {'foobar'}\n\n\ndef test_create_model_non_annotated():\n with pytest.raises(\n TypeError,\n match='A non-annotated attribute was detected: `bar = 123`. All model fields require a type annotation',\n ):\n create_model('FooModel', foo=(str, ...), bar=123)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_dataclasses_test_model_name.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_dataclasses_test_model_name.None_1", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["imports", "test_model_name", "test_simple"], "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": "import dataclasses\nimport pickle\nimport re\nimport sys\nfrom collections.abc import Hashable\nfrom datetime import datetime\nfrom pathlib import Path\nfrom typing import Any, Callable, ClassVar, Dict, FrozenSet, List, Optional, Set, Union\n\nimport pytest\nfrom typing_extensions import Literal\n\nimport pydantic\nfrom pydantic import BaseModel, ConfigDict, Extra, FieldValidationInfo, ValidationError\nfrom pydantic.decorators import field_validator\nfrom pydantic.fields import Field, FieldInfo\nfrom pydantic.json_schema import model_json_schema\n\n\ndef test_simple():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n b: float\n\n d = MyDataclass('1', '2.5')\n assert d.a == 1\n assert d.b == 2.5\n d = MyDataclass(b=10, a=20)\n assert d.a == 20\n assert d.b == 10\n\n\ndef test_model_name():\n @pydantic.dataclasses.dataclass\n class MyDataClass:\n model_name: str\n\n d = MyDataClass('foo')\n assert d.model_name == 'foo'\n d = MyDataClass(model_name='foo')\n assert d.model_name == '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_pydantic__pydantic/tests/test_dataclasses.py_test_value_error_test_value_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_value_error_test_value_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 62, "span_ids": ["test_value_error"], "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": "def test_value_error():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n b: int\n\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(1, 'wrong')\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': (1,),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'wrong',\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_pydantic__pydantic/tests/test_dataclasses.py_test_frozen_test_validate_assignment.assert_d_a_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_frozen_test_validate_assignment.assert_d_a_7", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 86, "span_ids": ["test_frozen", "test_validate_assignment"], "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": "def test_frozen():\n @pydantic.dataclasses.dataclass(frozen=True)\n class MyDataclass:\n a: int\n\n d = MyDataclass(1)\n assert d.a == 1\n\n with pytest.raises(AttributeError):\n d.a = 7\n\n\ndef test_validate_assignment():\n @pydantic.dataclasses.dataclass(config=ConfigDict(validate_assignment=True))\n class MyDataclass:\n a: int\n\n d = MyDataclass(1)\n assert d.a == 1\n\n d.a = '7'\n assert d.a == 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_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_error_test_validate_assignment_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_error_test_validate_assignment_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 105, "span_ids": ["test_validate_assignment_error"], "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 test_validate_assignment_error():\n @pydantic.dataclasses.dataclass(config=ConfigDict(validate_assignment=True))\n class MyDataclass:\n a: int\n\n d = MyDataclass(1)\n\n with pytest.raises(ValidationError) as exc_info:\n d.a = 'xxx'\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'xxx',\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_pydantic__pydantic/tests/test_dataclasses.py_test_not_validate_assignment_test_validate_assignment_value_change.assert_d_a_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_not_validate_assignment_test_validate_assignment_value_change.assert_d_a_6", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 108, "end_line": 134, "span_ids": ["test_validate_assignment_value_change", "test_not_validate_assignment"], "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 test_not_validate_assignment():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n\n d = MyDataclass(1)\n assert d.a == 1\n\n d.a = '7'\n assert d.a == '7'\n\n\ndef test_validate_assignment_value_change():\n @pydantic.dataclasses.dataclass(config=ConfigDict(validate_assignment=True), frozen=False)\n class MyDataclass:\n a: int\n\n @field_validator('a')\n @classmethod\n def double_a(cls, v: int) -> int:\n return v * 2\n\n d = MyDataclass(2)\n assert d.a == 4\n\n d.a = 3\n assert d.a == 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_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_extra_unknown_field_assigned_allowed_test_validate_assignment_extra_unknown_field_assigned_allowed.assert_d_extra_field_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_extra_unknown_field_assigned_allowed_test_validate_assignment_extra_unknown_field_assigned_allowed.assert_d_extra_field_1", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 160, "span_ids": ["test_validate_assignment_extra_unknown_field_assigned_allowed"], "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": "@pytest.mark.parametrize(\n 'config',\n [\n ConfigDict(validate_assignment=False),\n ConfigDict(extra=None),\n ConfigDict(extra=Extra.forbid),\n ConfigDict(extra=Extra.ignore),\n ConfigDict(validate_assignment=False, extra=None),\n ConfigDict(validate_assignment=False, extra=Extra.forbid),\n ConfigDict(validate_assignment=False, extra=Extra.ignore),\n ConfigDict(validate_assignment=False, extra=Extra.allow),\n ConfigDict(validate_assignment=True, extra=Extra.allow),\n ],\n)\ndef test_validate_assignment_extra_unknown_field_assigned_allowed(config: ConfigDict):\n @pydantic.dataclasses.dataclass(config=config)\n class MyDataclass:\n a: int\n\n d = MyDataclass(1)\n assert d.a == 1\n\n d.extra_field = 123\n assert d.extra_field == 123", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_extra_unknown_field_assigned_errors_test_validate_assignment_extra_unknown_field_assigned_errors.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_extra_unknown_field_assigned_errors_test_validate_assignment_extra_unknown_field_assigned_errors.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 191, "span_ids": ["test_validate_assignment_extra_unknown_field_assigned_errors"], "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": "@pytest.mark.parametrize(\n 'config',\n [\n ConfigDict(validate_assignment=True),\n ConfigDict(validate_assignment=True, extra=None),\n ConfigDict(validate_assignment=True, extra=Extra.forbid),\n ConfigDict(validate_assignment=True, extra=Extra.ignore),\n ],\n)\ndef test_validate_assignment_extra_unknown_field_assigned_errors(config: ConfigDict):\n @pydantic.dataclasses.dataclass(config=config)\n class MyDataclass:\n a: int\n\n d = MyDataclass(1)\n assert d.a == 1\n\n with pytest.raises(ValidationError) as exc_info:\n d.extra_field = 1.23\n\n assert exc_info.value.errors() == [\n {\n 'type': 'no_such_attribute',\n 'loc': ('extra_field',),\n 'msg': \"Object has no attribute 'extra_field'\",\n 'input': 1.23,\n 'ctx': {'attribute': 'extra_field'},\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_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_test_post_init_validation.assert_PydanticDC_a_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_test_post_init_validation.assert_PydanticDC_a_2_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 194, "end_line": 221, "span_ids": ["test_post_init", "test_post_init_validation"], "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_post_init():\n post_init_called = False\n\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n\n def __post_init__(self):\n nonlocal post_init_called\n post_init_called = True\n\n d = MyDataclass('1')\n assert d.a == 1\n assert post_init_called\n\n\ndef test_post_init_validation():\n @dataclasses.dataclass\n class DC:\n a: int\n\n def __post_init__(self):\n self.a *= 2\n\n assert DC(a='2').a == '22'\n PydanticDC = pydantic.dataclasses.dataclass(DC)\n assert DC(a='2').a == '22'\n assert PydanticDC(a='2').a == 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_pydantic__pydantic/tests/test_dataclasses.py_test_convert_vanilla_dc_test_convert_vanilla_dc.assert_py_dc_b_hello_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_convert_vanilla_dc_test_convert_vanilla_dc.assert_py_dc_b_hello_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 224, "end_line": 244, "span_ids": ["test_convert_vanilla_dc"], "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 test_convert_vanilla_dc():\n @dataclasses.dataclass\n class DC:\n a: int\n b: str = dataclasses.field(init=False)\n\n def __post_init__(self):\n self.a *= 2\n self.b = 'hello'\n\n dc1 = DC(a='2')\n assert dc1.a == '22'\n assert dc1.b == 'hello'\n PydanticDC = pydantic.dataclasses.dataclass(DC)\n dc2 = DC(a='2')\n assert dc2.a == '22'\n assert dc2.b == 'hello'\n\n py_dc = PydanticDC(a='2')\n assert py_dc.a == 4\n assert py_dc.b == 'hello'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_std_dataclass_with_parent_test_std_dataclass_with_parent.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_std_dataclass_with_parent_test_std_dataclass_with_parent.None_2", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 247, "end_line": 262, "span_ids": ["test_std_dataclass_with_parent"], "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 test_std_dataclass_with_parent():\n @dataclasses.dataclass\n class DCParent:\n a: int\n\n @dataclasses.dataclass\n class DC(DCParent):\n b: int\n\n def __post_init__(self):\n self.a *= 2\n\n assert dataclasses.asdict(DC(a='2', b='1')) == {'a': '22', 'b': '1'}\n PydanticDC = pydantic.dataclasses.dataclass(DC)\n assert dataclasses.asdict(DC(a='2', b='1')) == {'a': '22', 'b': '1'}\n assert dataclasses.asdict(PydanticDC(a='2', b='1')) == {'a': 4, 'b': 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_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_inheritance_chain_test_post_init_inheritance_chain.assert_post_init_called": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_inheritance_chain_test_post_init_inheritance_chain.assert_post_init_called", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 265, "end_line": 290, "span_ids": ["test_post_init_inheritance_chain"], "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 test_post_init_inheritance_chain():\n parent_post_init_called = False\n post_init_called = False\n\n @pydantic.dataclasses.dataclass\n class ParentDataclass:\n a: int\n\n def __post_init__(self):\n nonlocal parent_post_init_called\n parent_post_init_called = True\n\n @pydantic.dataclasses.dataclass\n class MyDataclass(ParentDataclass):\n b: int\n\n def __post_init__(self):\n super().__post_init__()\n nonlocal post_init_called\n post_init_called = True\n\n d = MyDataclass(a=1, b=2)\n assert d.a == 1\n assert d.b == 2\n assert parent_post_init_called\n assert post_init_called", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_post_parse_test_post_init_assignment.assert_c_c_0_300000000": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_post_parse_test_post_init_assignment.assert_c_c_0_300000000", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 293, "end_line": 320, "span_ids": ["test_post_init_assignment", "test_post_init_post_parse"], "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 test_post_init_post_parse():\n with pytest.warns(DeprecationWarning, match='Support for `__post_init_post_parse__` has been dropped'):\n\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n\n def __post_init_post_parse__(self):\n pass\n\n\ndef test_post_init_assignment():\n from dataclasses import field\n\n # Based on: https://docs.python.org/3/library/dataclasses.html#post-init-processing\n @pydantic.dataclasses.dataclass\n class C:\n a: float\n b: float\n c: float = field(init=False)\n\n def __post_init__(self):\n self.c = self.a + self.b\n\n c = C(0.1, 0.2)\n assert c.a == 0.1\n assert c.b == 0.2\n assert c.c == 0.30000000000000004", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_test_inheritance.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_test_inheritance.None_3", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 323, "end_line": 343, "span_ids": ["test_inheritance"], "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 test_inheritance():\n @pydantic.dataclasses.dataclass\n class A:\n a: str = None\n\n a_ = A(a=b'a')\n assert a_.a == 'a'\n\n @pydantic.dataclasses.dataclass\n class B(A):\n b: int = None\n\n b = B(a='a', b=12)\n assert b.a == 'a'\n assert b.b == 12\n\n with pytest.raises(ValidationError):\n B(a='a', b='b')\n\n a_ = A(a=b'a')\n assert a_.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_pydantic__pydantic/tests/test_dataclasses.py_test_validate_long_string_error_test_validate_long_string_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_long_string_error_test_validate_long_string_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 346, "end_line": 363, "span_ids": ["test_validate_long_string_error"], "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 test_validate_long_string_error():\n @pydantic.dataclasses.dataclass(config=dict(str_max_length=3))\n class MyDataclass:\n a: str\n\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass('xxxx')\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': (0,),\n 'msg': 'String should have at most 3 characters',\n 'input': 'xxxx',\n 'ctx': {'max_length': 3},\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_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_long_string_error_test_no_validate_assignment_long_string_error.assert_d_a_xxxx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_assignment_long_string_error_test_no_validate_assignment_long_string_error.assert_d_a_xxxx_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 366, "end_line": 394, "span_ids": ["test_validate_assignment_long_string_error", "test_no_validate_assignment_long_string_error"], "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 test_validate_assignment_long_string_error():\n @pydantic.dataclasses.dataclass(config=ConfigDict(str_max_length=3, validate_assignment=True))\n class MyDataclass:\n a: str\n\n d = MyDataclass('xxx')\n with pytest.raises(ValidationError) as exc_info:\n d.a = 'xxxx'\n\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': ('a',),\n 'msg': 'String should have at most 3 characters',\n 'input': 'xxxx',\n 'ctx': {'max_length': 3},\n }\n ]\n\n\ndef test_no_validate_assignment_long_string_error():\n @pydantic.dataclasses.dataclass(config=ConfigDict(str_max_length=3, validate_assignment=False))\n class MyDataclass:\n a: str\n\n d = MyDataclass('xxx')\n d.a = 'xxxx'\n\n assert d.a == 'xxxx'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_dataclass_test_nested_dataclass.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_dataclass_test_nested_dataclass.None_5", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 397, "end_line": 436, "span_ids": ["test_nested_dataclass"], "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 test_nested_dataclass():\n @pydantic.dataclasses.dataclass\n class Nested:\n number: int\n\n @pydantic.dataclasses.dataclass\n class Outer:\n n: Nested\n\n navbar = Outer(n=Nested(number='1'))\n assert isinstance(navbar.n, Nested)\n assert navbar.n.number == 1\n\n navbar = Outer(n={'number': '3'})\n assert isinstance(navbar.n, Nested)\n assert navbar.n.number == 3\n\n with pytest.raises(ValidationError) as exc_info:\n Outer(n='not nested')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'dataclass_type',\n 'loc': ('n',),\n 'msg': 'Input should be a dictionary or an instance of Nested',\n 'input': 'not nested',\n 'ctx': {'dataclass_name': 'Nested'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Outer(n={'number': 'x'})\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('n', 'number'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\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_pydantic__pydantic/tests/test_dataclasses.py_test_arbitrary_types_allowed_test_arbitrary_types_allowed.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_arbitrary_types_allowed_test_arbitrary_types_allowed.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 439, "end_line": 463, "span_ids": ["test_arbitrary_types_allowed"], "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 test_arbitrary_types_allowed():\n class Button:\n def __init__(self, href: str):\n self.href = href\n\n @pydantic.dataclasses.dataclass(config=dict(arbitrary_types_allowed=True))\n class Navbar:\n button: Button\n\n btn = Button(href='a')\n navbar = Navbar(button=btn)\n assert navbar.button.href == 'a'\n\n with pytest.raises(ValidationError) as exc_info:\n Navbar(button=('b',))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'is_instance_of',\n 'loc': ('button',),\n 'msg': 'Input should be an instance of test_arbitrary_types_allowed..Button',\n 'input': ('b',),\n 'ctx': {'class': 'test_arbitrary_types_allowed..Button'},\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_pydantic__pydantic/tests/test_dataclasses.py_test_nested_dataclass_model_test_fields.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_dataclass_model_test_fields.None_4", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 466, "end_line": 494, "span_ids": ["test_nested_dataclass_model", "test_fields"], "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 test_nested_dataclass_model():\n @pydantic.dataclasses.dataclass\n class Nested:\n number: int\n\n class Outer(BaseModel):\n n: Nested\n\n navbar = Outer(n=Nested(number='1'))\n assert navbar.n.number == 1\n\n\ndef test_fields():\n @pydantic.dataclasses.dataclass\n class User:\n id: int\n name: str = 'John Doe'\n signup_ts: datetime = None\n\n user = User(id=123)\n fields = user.__pydantic_fields__\n\n assert fields['id'].is_required() is True\n\n assert fields['name'].is_required() is False\n assert fields['name'].default == 'John Doe'\n\n assert fields['signup_ts'].is_required() is False\n assert fields['signup_ts'].default 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_pydantic__pydantic/tests/test_dataclasses.py_test_default_factory_field_test_default_factory_field.assert_fields_other_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_factory_field_test_default_factory_field.assert_fields_other_de", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 497, "end_line": 512, "span_ids": ["test_default_factory_field"], "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 test_default_factory_field():\n @pydantic.dataclasses.dataclass\n class User:\n id: int\n other: Dict[str, str] = dataclasses.field(default_factory=lambda: {'John': 'Joey'})\n\n user = User(id=123)\n assert user.id == 123\n # assert user.other == {'John': 'Joey'}\n fields = user.__pydantic_fields__\n\n assert fields['id'].is_required() is True\n assert repr(fields['id'].default) == 'PydanticUndefined'\n\n assert fields['other'].is_required() is False\n assert fields['other'].default_factory() == {'John': 'Joey'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_factory_singleton_field_test_schema.User.height.pydantic_Field_None_titl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_factory_singleton_field_test_schema.User.height.pydantic_Field_None_titl", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 515, "end_line": 539, "span_ids": ["test_schema", "test_default_factory_singleton_field"], "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 test_default_factory_singleton_field():\n class MySingleton:\n pass\n\n MY_SINGLETON = MySingleton()\n\n @pydantic.dataclasses.dataclass(config=dict(arbitrary_types_allowed=True))\n class Foo:\n singleton: MySingleton = dataclasses.field(default_factory=lambda: MY_SINGLETON)\n\n # Returning a singleton from a default_factory is supported\n assert Foo().singleton is Foo().singleton\n\n\ndef test_schema():\n @pydantic.dataclasses.dataclass\n class User:\n id: int\n name: str = 'John Doe'\n aliases: Dict[str, str] = dataclasses.field(default_factory=lambda: {'John': 'Joey'})\n signup_ts: datetime = None\n age: Optional[int] = dataclasses.field(\n default=None, metadata=dict(title='The age of the user', description='do not lie!')\n )\n height: Optional[int] = pydantic.Field(None, title='The height in cm', ge=50, le=300)\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_pydantic__pydantic/tests/test_dataclasses.py_test_schema.User_id_123__test_schema.assert_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_schema.User_id_123__test_schema.assert_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 541, "end_line": 568, "span_ids": ["test_schema"], "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 test_schema():\n # ... other code\n\n User(id=123)\n assert model_json_schema(User) == {\n 'properties': {\n 'age': {\n 'anyOf': [{'type': 'integer'}, {'type': 'null'}],\n 'default': None,\n 'title': 'The age of the user',\n 'description': 'do not lie!',\n },\n 'aliases': {\n 'additionalProperties': {'type': 'string'},\n 'default': {'John': 'Joey'},\n 'title': 'Aliases',\n 'type': 'object',\n },\n 'height': {\n 'anyOf': [{'maximum': 300, 'minimum': 50, 'type': 'integer'}, {'type': 'null'}],\n 'default': None,\n 'title': 'The height in cm',\n },\n 'id': {'title': 'Id', 'type': 'integer'},\n 'name': {'default': 'John Doe', 'title': 'Name', 'type': 'string'},\n 'signup_ts': {'default': None, 'format': 'date-time', 'title': 'Signup Ts', 'type': 'string'},\n },\n 'required': ['id'],\n 'title': 'User',\n 'type': 'object',\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_pydantic__pydantic/tests/test_dataclasses.py_test_nested_schema_test_nested_schema.assert_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_nested_schema_test_nested_schema.assert_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 571, "end_line": 593, "span_ids": ["test_nested_schema"], "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 test_nested_schema():\n @pydantic.dataclasses.dataclass\n class Nested:\n number: int\n\n @pydantic.dataclasses.dataclass\n class Outer:\n n: Nested\n\n assert model_json_schema(Outer) == {\n '$defs': {\n 'Nested': {\n 'properties': {'number': {'title': 'Number', 'type': 'integer'}},\n 'required': ['number'],\n 'title': 'Nested',\n 'type': 'object',\n }\n },\n 'properties': {'n': {'$ref': '#/$defs/Nested'}},\n 'required': ['n'],\n 'title': 'Outer',\n 'type': 'object',\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_pydantic__pydantic/tests/test_dataclasses.py_test_intvar_3_7_test_initvar.with_pytest_raises_Attrib.tiv_y": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_intvar_3_7_test_initvar.with_pytest_raises_Attrib.tiv_y", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 596, "end_line": 616, "span_ids": ["test_intvar_3_7", "test_initvar"], "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": "@pytest.mark.skipif(sys.version_info >= (3, 8), reason='InitVar not supported in python 3.7')\ndef test_intvar_3_7():\n with pytest.raises(RuntimeError, match=r'^InitVar is not supported in Python 3\\.7 as type information is lost$'):\n\n @pydantic.dataclasses.dataclass\n class TestInitVar:\n x: int\n y: dataclasses.InitVar\n\n\n@pytest.mark.skipif(sys.version_info < (3, 8), reason='InitVar not supported in python 3.7')\ndef test_initvar():\n @pydantic.dataclasses.dataclass\n class TestInitVar:\n x: int\n y: dataclasses.InitVar\n\n tiv = TestInitVar(1, 2)\n assert tiv.x == 1\n with pytest.raises(AttributeError):\n tiv.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_pydantic__pydantic/tests/test_dataclasses.py_test_derived_field_from_initvar_test_derived_field_from_initvar.with_pytest_raises_Valida.DerivedWithInitVar_Not_A": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_derived_field_from_initvar_test_derived_field_from_initvar.with_pytest_raises_Valida.DerivedWithInitVar_Not_A", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 619, "end_line": 632, "span_ids": ["test_derived_field_from_initvar"], "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": "@pytest.mark.skipif(sys.version_info < (3, 8), reason='InitVar not supported in python 3.7')\ndef test_derived_field_from_initvar():\n @pydantic.dataclasses.dataclass\n class DerivedWithInitVar:\n plusone: int = dataclasses.field(init=False)\n number: dataclasses.InitVar[int]\n\n def __post_init__(self, number):\n self.plusone = number + 1\n\n derived = DerivedWithInitVar('1')\n assert derived.plusone == 2\n with pytest.raises(ValidationError, match='Input should be a valid integer, unable to parse string as an integer'):\n DerivedWithInitVar('Not A 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_pydantic__pydantic/tests/test_dataclasses.py_test_initvars_post_init_test_initvars_post_init.assert_p_path_Path_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_initvars_post_init_test_initvars_post_init.assert_p_path_Path_h", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 635, "end_line": 652, "span_ids": ["test_initvars_post_init"], "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": "@pytest.mark.skipif(sys.version_info < (3, 8), reason='InitVar not supported in python 3.7')\ndef test_initvars_post_init():\n @pydantic.dataclasses.dataclass\n class PathDataPostInit:\n path: Path\n base_path: dataclasses.InitVar[Optional[Path]] = None\n\n def __post_init__(self, base_path):\n if base_path is not None:\n self.path = base_path / self.path\n\n path_data = PathDataPostInit('world')\n assert 'path' in path_data.__dict__\n assert 'base_path' not in path_data.__dict__\n assert path_data.path == Path('world')\n\n p = PathDataPostInit('world', base_path='/hello')\n assert p.path == Path('/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_pydantic__pydantic/tests/test_dataclasses.py_test_classvar_test_inheritance_post_init.assert_post_init_called": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_classvar_test_inheritance_post_init.assert_post_init_called", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 655, "end_line": 692, "span_ids": ["test_inheritance_post_init", "test_classvar", "test_frozenset_field"], "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 test_classvar():\n @pydantic.dataclasses.dataclass\n class TestClassVar:\n klassvar: ClassVar = \"I'm a Class variable\"\n x: int\n\n tcv = TestClassVar(2)\n assert tcv.klassvar == \"I'm a Class variable\"\n\n\ndef test_frozenset_field():\n @pydantic.dataclasses.dataclass\n class TestFrozenSet:\n set: FrozenSet[int]\n\n test_set = frozenset({1, 2, 3})\n object_under_test = TestFrozenSet(set=test_set)\n\n assert object_under_test.set == test_set\n\n\ndef test_inheritance_post_init():\n post_init_called = False\n\n @pydantic.dataclasses.dataclass\n class Base:\n a: int\n\n def __post_init__(self):\n nonlocal post_init_called\n post_init_called = True\n\n @pydantic.dataclasses.dataclass\n class Child(Base):\n b: int\n\n Child(a=1, b=2)\n assert post_init_called", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_hashable_required_test_hashable_optional.MyDataclass_v_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_hashable_required_test_hashable_optional.MyDataclass_v_None_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 695, "end_line": 720, "span_ids": ["test_hashable_optional", "test_hashable_required"], "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": "@pytest.mark.xfail(reason='support Hashable')\ndef test_hashable_required():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n v: Hashable\n\n MyDataclass(v=None)\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(v=[])\n assert exc_info.value.errors() == [\n {'loc': ('v',), 'msg': 'value is not a valid hashable', 'type': 'type_error.hashable'}\n ]\n with pytest.raises(TypeError) as exc_info:\n MyDataclass()\n assert \"__init__() missing 1 required positional argument: 'v'\" in str(exc_info.value)\n\n\n@pytest.mark.xfail(reason='support Hashable')\n@pytest.mark.parametrize('default', [1, None, ...])\ndef test_hashable_optional(default):\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n v: Hashable = default\n\n MyDataclass()\n MyDataclass(v=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_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_test_override_builtin_dataclass.assert_e_value_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_test_override_builtin_dataclass.assert_e_value_errors_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 723, "end_line": 755, "span_ids": ["test_override_builtin_dataclass"], "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 test_override_builtin_dataclass():\n @dataclasses.dataclass\n class File:\n hash: str\n name: Optional[str]\n size: int\n content: Optional[bytes] = None\n\n ValidFile = pydantic.dataclasses.dataclass(File)\n\n file = File(hash='xxx', name=b'whatever.txt', size='456')\n valid_file = ValidFile(hash='xxx', name=b'whatever.txt', size='456')\n\n assert file.name == b'whatever.txt'\n assert file.size == '456'\n\n assert valid_file.name == 'whatever.txt'\n assert valid_file.size == 456\n\n assert isinstance(valid_file, File)\n assert isinstance(valid_file, ValidFile)\n\n with pytest.raises(ValidationError) as e:\n ValidFile(hash=[1], name='name', size=3)\n\n assert e.value.errors() == [\n {\n 'type': 'string_type',\n 'loc': ('hash',),\n 'msg': 'Input should be a valid string',\n 'input': [1],\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_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_2_test_override_builtin_dataclass_2.assert_f_seen_count_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_2_test_override_builtin_dataclass_2.assert_f_seen_count_7", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 758, "end_line": 776, "span_ids": ["test_override_builtin_dataclass_2"], "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 test_override_builtin_dataclass_2():\n @dataclasses.dataclass\n class Meta:\n modified_date: Optional[datetime]\n seen_count: int\n\n Meta(modified_date='not-validated', seen_count=0)\n\n @pydantic.dataclasses.dataclass\n @dataclasses.dataclass\n class File(Meta):\n filename: str\n\n Meta(modified_date='still-not-validated', seen_count=0)\n\n f = File(filename=b'thefilename', modified_date='2020-01-01T00:00', seen_count='7')\n assert f.filename == 'thefilename'\n assert f.modified_date == datetime(2020, 1, 1, 0, 0)\n assert f.seen_count == 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_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_nested_test_override_builtin_dataclass_nested.assert_foo_file_meta_seen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_nested_test_override_builtin_dataclass_nested.assert_foo_file_meta_seen", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 779, "end_line": 816, "span_ids": ["test_override_builtin_dataclass_nested"], "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": "@pytest.mark.xfail(reason='TODO we need to optionally run validation even on exact types')\ndef test_override_builtin_dataclass_nested():\n @dataclasses.dataclass\n class Meta:\n modified_date: Optional[datetime]\n seen_count: int\n\n @dataclasses.dataclass\n class File:\n filename: str\n meta: Meta\n\n class Foo(BaseModel):\n file: File\n\n FileChecked = pydantic.dataclasses.dataclass(File)\n f = FileChecked(filename=b'thefilename', meta=Meta(modified_date='2020-01-01T00:00', seen_count='7'))\n assert f.filename == 'thefilename'\n assert f.meta.modified_date == datetime(2020, 1, 1, 0, 0)\n assert f.meta.seen_count == 7\n\n with pytest.raises(ValidationError) as e:\n FileChecked(filename=b'thefilename', meta=Meta(modified_date='2020-01-01T00:00', seen_count=['7']))\n assert e.value.errors() == [\n {'loc': ('meta', 'seen_count'), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}\n ]\n\n foo = Foo.model_validate(\n {\n 'file': {\n 'filename': b'thefilename',\n 'meta': {'modified_date': '2020-01-01T00:00', 'seen_count': '7'},\n },\n }\n )\n assert foo.file.filename == 'thefilename'\n assert foo.file.meta.modified_date == datetime(2020, 1, 1, 0, 0)\n assert foo.file.meta.seen_count == 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_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_nested_schema_test_override_builtin_dataclass_nested_schema.assert_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_override_builtin_dataclass_nested_schema_test_override_builtin_dataclass_nested_schema.assert_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 819, "end_line": 850, "span_ids": ["test_override_builtin_dataclass_nested_schema"], "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 test_override_builtin_dataclass_nested_schema():\n @dataclasses.dataclass\n class Meta:\n modified_date: Optional[datetime]\n seen_count: int\n\n @dataclasses.dataclass\n class File:\n filename: str\n meta: Meta\n\n FileChecked = pydantic.dataclasses.dataclass(File)\n assert model_json_schema(FileChecked) == {\n '$defs': {\n 'Meta': {\n 'properties': {\n 'modified_date': {\n 'anyOf': [{'format': 'date-time', 'type': 'string'}, {'type': 'null'}],\n 'title': 'Modified Date',\n },\n 'seen_count': {'title': 'Seen Count', 'type': 'integer'},\n },\n 'required': ['modified_date', 'seen_count'],\n 'title': 'Meta',\n 'type': 'object',\n }\n },\n 'properties': {'filename': {'title': 'Filename', 'type': 'string'}, 'meta': {'$ref': '#/$defs/Meta'}},\n 'required': ['filename', 'meta'],\n 'title': 'File',\n 'type': 'object',\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_pydantic__pydantic/tests/test_dataclasses.py_test_inherit_builtin_dataclass_test_forward_stdlib_dataclass_params.with_pytest_raises_datacl.e.item.name._pika2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inherit_builtin_dataclass_test_forward_stdlib_dataclass_params.with_pytest_raises_datacl.e.item.name._pika2_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 853, "end_line": 906, "span_ids": ["test_dataclass_arbitrary", "test_inherit_builtin_dataclass", "test_forward_stdlib_dataclass_params"], "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": "def test_inherit_builtin_dataclass():\n @dataclasses.dataclass\n class Z:\n z: int\n\n @dataclasses.dataclass\n class Y(Z):\n y: int\n\n @pydantic.dataclasses.dataclass\n class X(Y):\n x: int\n\n pika = X(x='2', y='4', z='3')\n assert pika.x == 2\n assert pika.y == 4\n assert pika.z == 3\n\n\n@pytest.mark.xfail(reason='cannot parse a tuple into a dataclass')\ndef test_dataclass_arbitrary():\n class ArbitraryType:\n def __init__(self):\n ...\n\n @dataclasses.dataclass\n class Test:\n foo: ArbitraryType\n bar: List[ArbitraryType]\n\n class TestModel(BaseModel):\n a: ArbitraryType\n b: Test\n\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n TestModel(a=ArbitraryType(), b=(ArbitraryType(), [ArbitraryType()]))\n\n\ndef test_forward_stdlib_dataclass_params():\n @dataclasses.dataclass(frozen=True)\n class Item:\n name: str\n\n class Example(BaseModel):\n item: Item\n other: str\n\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n e = Example(item=Item(name='pika'), other='bulbi')\n e.other = 'bulbi2'\n with pytest.raises(dataclasses.FrozenInstanceError):\n e.item.name = 'pika2'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_callable_field_test_pydantic_callable_field.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_callable_field_test_pydantic_callable_field.None_1", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 909, "end_line": 960, "span_ids": ["test_pydantic_callable_field"], "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 test_pydantic_callable_field():\n \"\"\"pydantic callable fields behaviour should be the same as stdlib dataclass\"\"\"\n\n def foo(arg1, arg2):\n return arg1, arg2\n\n def bar(x: int, y: float, z: str) -> bool:\n return str(x + y) == z\n\n class PydanticModel(BaseModel):\n required_callable: Callable\n required_callable_2: Callable[[int, float, str], bool]\n\n default_callable: Callable = foo\n default_callable_2: Callable[[int, float, str], bool] = bar\n\n @pydantic.dataclasses.dataclass\n class PydanticDataclass:\n required_callable: Callable\n required_callable_2: Callable[[int, float, str], bool]\n\n default_callable: Callable = foo\n default_callable_2: Callable[[int, float, str], bool] = bar\n\n @dataclasses.dataclass\n class StdlibDataclass:\n required_callable: Callable\n required_callable_2: Callable[[int, float, str], bool]\n\n default_callable: Callable = foo\n default_callable_2: Callable[[int, float, str], bool] = bar\n\n pyd_m = PydanticModel(required_callable=foo, required_callable_2=bar)\n pyd_dc = PydanticDataclass(required_callable=foo, required_callable_2=bar)\n std_dc = StdlibDataclass(required_callable=foo, required_callable_2=bar)\n\n assert (\n pyd_m.required_callable\n is pyd_m.default_callable\n is pyd_dc.required_callable\n is pyd_dc.default_callable\n is std_dc.required_callable\n is std_dc.default_callable\n )\n assert (\n pyd_m.required_callable_2\n is pyd_m.default_callable_2\n is pyd_dc.required_callable_2\n is pyd_dc.default_callable_2\n is std_dc.required_callable_2\n is std_dc.default_callable_2\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_pydantic__pydantic/tests/test_dataclasses.py_test_pickle_overridden_builtin_dataclass_test_pickle_overridden_builtin_dataclass.with_pytest_raises_Valida.restored_obj.value._value_of_a_wrong_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pickle_overridden_builtin_dataclass_test_pickle_overridden_builtin_dataclass.with_pytest_raises_Valida.restored_obj.value._value_of_a_wrong_type_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 963, "end_line": 988, "span_ids": ["test_pickle_overridden_builtin_dataclass"], "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 test_pickle_overridden_builtin_dataclass(create_module: Any):\n module = create_module(\n # language=Python\n \"\"\"\\\nimport dataclasses\nimport pydantic\n\n\n@pydantic.dataclasses.dataclass(\n config=pydantic.config.ConfigDict(validate_assignment=True)\n)\nclass BuiltInDataclassForPickle:\n value: int\n \"\"\"\n )\n obj = module.BuiltInDataclassForPickle(value=5)\n\n pickled_obj = pickle.dumps(obj)\n restored_obj = pickle.loads(pickled_obj)\n\n assert restored_obj.value == 5\n assert restored_obj == obj\n\n # ensure the restored dataclass is still a pydantic dataclass\n with pytest.raises(ValidationError):\n restored_obj.value = 'value of a wrong 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_pydantic__pydantic/tests/test_dataclasses.py_gen_2162_dataclasses_gen_2162_dataclasses.yield_foo_PydanticBaz_c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_gen_2162_dataclasses_gen_2162_dataclasses.yield_foo_PydanticBaz_c_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 991, "end_line": 1028, "span_ids": ["gen_2162_dataclasses"], "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_2162_dataclasses():\n @dataclasses.dataclass(frozen=True)\n class StdLibFoo:\n a: str\n b: int\n\n @pydantic.dataclasses.dataclass(frozen=True)\n class PydanticFoo:\n a: str\n b: int\n\n @dataclasses.dataclass(frozen=True)\n class StdLibBar:\n c: StdLibFoo\n\n @pydantic.dataclasses.dataclass(frozen=True)\n class PydanticBar:\n c: PydanticFoo\n\n @dataclasses.dataclass(frozen=True)\n class StdLibBaz:\n c: PydanticFoo\n\n @pydantic.dataclasses.dataclass(frozen=True)\n class PydanticBaz:\n c: StdLibFoo\n\n foo = StdLibFoo(a='Foo', b=1)\n yield foo, StdLibBar(c=foo)\n\n foo = PydanticFoo(a='Foo', b=1)\n yield foo, PydanticBar(c=foo)\n\n foo = PydanticFoo(a='Foo', b=1)\n yield foo, StdLibBaz(c=foo)\n\n foo = StdLibFoo(a='Foo', b=1)\n yield foo, PydanticBaz(c=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_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2162_test_issue_2424.assert_ValidatedThing_x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2162_test_issue_2424.assert_ValidatedThing_x_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1031, "end_line": 1089, "span_ids": ["test_issue_2398", "test_issue_2383", "test_issue_2424", "test_issue_2162"], "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": "@pytest.mark.parametrize('foo,bar', gen_2162_dataclasses())\ndef test_issue_2162(foo, bar):\n assert dataclasses.asdict(foo) == dataclasses.asdict(bar.c)\n assert dataclasses.astuple(foo) == dataclasses.astuple(bar.c)\n assert foo == bar.c\n\n\ndef test_issue_2383():\n @dataclasses.dataclass\n class A:\n s: str\n\n def __hash__(self):\n return 123\n\n class B(pydantic.BaseModel):\n a: A\n\n a = A('')\n b = B(a=a)\n\n assert hash(a) == 123\n assert hash(b.a) == 123\n\n\ndef test_issue_2398():\n @dataclasses.dataclass(order=True)\n class DC:\n num: int = 42\n\n class Model(pydantic.BaseModel):\n dc: DC\n\n real_dc = DC()\n model = Model(dc=real_dc)\n\n # This works as expected.\n assert real_dc <= real_dc\n assert model.dc <= model.dc\n assert real_dc <= model.dc\n\n\ndef test_issue_2424():\n @dataclasses.dataclass\n class Base:\n x: str\n\n @dataclasses.dataclass\n class Thing(Base):\n y: str = dataclasses.field(default_factory=str)\n\n assert Thing(x='hi').y == ''\n\n @pydantic.dataclasses.dataclass\n class ValidatedThing(Base):\n y: str = dataclasses.field(default_factory=str)\n\n assert Thing(x='hi').y == ''\n assert ValidatedThing(x='hi').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_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2541_test_issue_2541.with_pytest_raises_datacl.e.item.infos.id.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2541_test_issue_2541.with_pytest_raises_datacl.e.item.infos.id.2", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1092, "end_line": 1109, "span_ids": ["test_issue_2541"], "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 test_issue_2541():\n @dataclasses.dataclass(frozen=True)\n class Infos:\n id: int\n\n @dataclasses.dataclass(frozen=True)\n class Item:\n name: str\n infos: Infos\n\n class Example(BaseModel):\n item: Item\n\n e = Example.model_validate({'item': {'name': '123', 'infos': {'id': '1'}}})\n assert e.item.name == '123'\n assert e.item.infos.id == 1\n with pytest.raises(dataclasses.FrozenInstanceError):\n e.item.infos.id = 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_pydantic__pydantic/tests/test_dataclasses.py_test_complex_nested_vanilla_dataclass_test_complex_nested_vanilla_dataclass.assert_M_model_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_complex_nested_vanilla_dataclass_test_complex_nested_vanilla_dataclass.assert_M_model_json_schem", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1112, "end_line": 1168, "span_ids": ["test_complex_nested_vanilla_dataclass"], "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": "def test_complex_nested_vanilla_dataclass():\n @dataclasses.dataclass\n class Span:\n first: int\n last: int\n\n @dataclasses.dataclass\n class LabeledSpan(Span):\n label: str\n\n @dataclasses.dataclass\n class BinaryRelation:\n subject: LabeledSpan\n object: LabeledSpan\n label: str\n\n @dataclasses.dataclass\n class Sentence:\n relations: BinaryRelation\n\n class M(pydantic.BaseModel):\n s: Sentence\n\n assert M.model_json_schema() == {\n '$defs': {\n 'BinaryRelation': {\n 'properties': {\n 'label': {'title': 'Label', 'type': 'string'},\n 'object': {'$ref': '#/$defs/LabeledSpan'},\n 'subject': {'$ref': '#/$defs/LabeledSpan'},\n },\n 'required': ['subject', 'object', 'label'],\n 'title': 'BinaryRelation',\n 'type': 'object',\n },\n 'LabeledSpan': {\n 'properties': {\n 'first': {'title': 'First', 'type': 'integer'},\n 'label': {'title': 'Label', 'type': 'string'},\n 'last': {'title': 'Last', 'type': 'integer'},\n },\n 'required': ['first', 'last', 'label'],\n 'title': 'LabeledSpan',\n 'type': 'object',\n },\n 'Sentence': {\n 'properties': {'relations': {'$ref': '#/$defs/BinaryRelation'}},\n 'required': ['relations'],\n 'title': 'Sentence',\n 'type': 'object',\n },\n },\n 'properties': {'s': {'$ref': '#/$defs/Sentence'}},\n 'required': ['s'],\n 'title': 'M',\n 'type': 'object',\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_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2594_test_issue_3011.assert_c_thing_thing_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_2594_test_issue_3011.assert_c_thing_thing_a_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1171, "end_line": 1233, "span_ids": ["test_schema_description_set", "test_schema_description_unset", "test_issue_2594", "test_issue_3011"], "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 test_issue_2594():\n @dataclasses.dataclass\n class Empty:\n pass\n\n @pydantic.dataclasses.dataclass\n class M:\n e: Empty\n\n assert isinstance(M(e={}).e, Empty)\n\n\ndef test_schema_description_unset():\n @pydantic.dataclasses.dataclass\n class A:\n x: int\n\n assert 'description' not in model_json_schema(A)\n\n @pydantic.dataclasses.dataclass\n @dataclasses.dataclass\n class B:\n x: int\n\n assert 'description' not in model_json_schema(B)\n\n\ndef test_schema_description_set():\n @pydantic.dataclasses.dataclass\n class A:\n \"\"\"my description\"\"\"\n\n x: int\n\n assert model_json_schema(A)['description'] == 'my description'\n\n @pydantic.dataclasses.dataclass\n @dataclasses.dataclass\n class B:\n \"\"\"my description\"\"\"\n\n x: int\n\n assert model_json_schema(A)['description'] == 'my description'\n\n\ndef test_issue_3011():\n \"\"\"Validation of a subclass of a dataclass\"\"\"\n\n @dataclasses.dataclass\n class A:\n thing_a: str\n\n class B(A):\n thing_b: str\n\n @pydantic.dataclasses.dataclass\n class C:\n thing: A\n\n b = B('Thing A')\n c = C(thing=b)\n assert c.thing.thing_a == 'Thing 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_pydantic__pydantic/tests/test_dataclasses.py_test_issue_3162_test_issue_3162.assert_Users_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_issue_3162_test_issue_3162.assert_Users_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1236, "end_line": 1259, "span_ids": ["test_issue_3162"], "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 test_issue_3162():\n @dataclasses.dataclass\n class User:\n id: int\n name: str\n\n class Users(BaseModel):\n user: User\n other_user: User\n\n assert Users.model_json_schema() == {\n '$defs': {\n 'User': {\n 'properties': {'id': {'title': 'Id', 'type': 'integer'}, 'name': {'title': 'Name', 'type': 'string'}},\n 'required': ['id', 'name'],\n 'title': 'User',\n 'type': 'object',\n }\n },\n 'properties': {'other_user': {'$ref': '#/$defs/User'}, 'user': {'$ref': '#/$defs/User'}},\n 'required': ['user', 'other_user'],\n 'title': 'Users',\n 'type': 'object',\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_pydantic__pydantic/tests/test_dataclasses.py_test_discriminated_union_basemodel_instance_value_test_discriminated_union_basemodel_instance_value.assert_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_discriminated_union_basemodel_instance_value_test_discriminated_union_basemodel_instance_value.assert_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1262, "end_line": 1292, "span_ids": ["test_discriminated_union_basemodel_instance_value"], "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 test_discriminated_union_basemodel_instance_value():\n @pydantic.dataclasses.dataclass\n class A:\n l: Literal['a'] # noqa: E741\n\n @pydantic.dataclasses.dataclass\n class B:\n l: Literal['b'] # noqa: E741\n\n @pydantic.dataclasses.dataclass\n class Top:\n sub: Union[A, B] = dataclasses.field(metadata=dict(discriminator='l'))\n\n t = Top(sub=A(l='a'))\n assert isinstance(t, Top)\n assert model_json_schema(Top) == {\n 'title': 'Top',\n 'type': 'object',\n 'properties': {\n 'sub': {\n 'title': 'Sub',\n 'discriminator': {'mapping': {'a': '#/$defs/A', 'b': '#/$defs/B'}, 'propertyName': 'l'},\n 'oneOf': [{'$ref': '#/$defs/A'}, {'$ref': '#/$defs/B'}],\n }\n },\n 'required': ['sub'],\n '$defs': {\n 'A': {'properties': {'l': {'const': 'a', 'title': 'L'}}, 'required': ['l'], 'title': 'A', 'type': 'object'},\n 'B': {'properties': {'l': {'const': 'b', 'title': 'L'}}, 'required': ['l'], 'title': 'B', 'type': 'object'},\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_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_after_validation_test_post_init_after_validation.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_post_init_after_validation_test_post_init_after_validation.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1295, "end_line": 1310, "span_ids": ["test_post_init_after_validation"], "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 test_post_init_after_validation():\n @dataclasses.dataclass\n class SetWrapper:\n set: Set[int]\n\n def __post_init__(self):\n assert isinstance(\n self.set, set\n ), f\"self.set should be a set but it's {self.set!r} of type {type(self.set).__name__}\"\n\n class Model(pydantic.BaseModel):\n set_wrapper: SetWrapper\n\n model = Model(set_wrapper=SetWrapper({1, 2, 3}))\n json_text = model.model_dump_json()\n assert Model.model_validate_json(json_text).model_dump() == model.model_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_pydantic__pydantic/tests/test_dataclasses.py_test_keeps_custom_properties_test_keeps_custom_properties.for_cls_in_clases_to_test.assert_instance_a_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_keeps_custom_properties_test_keeps_custom_properties.for_cls_in_clases_to_test.assert_instance_a_test", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1313, "end_line": 1336, "span_ids": ["test_keeps_custom_properties"], "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": "@pytest.mark.xfail(reason='pydantic dataclasses currently do not preserve sunder attributes set in __new__')\ndef test_keeps_custom_properties():\n class StandardClass:\n \"\"\"Class which modifies instance creation.\"\"\"\n\n a: str\n\n def __new__(cls, *args, **kwargs):\n instance = super().__new__(cls)\n\n instance._special_property = 1\n\n return instance\n\n StandardLibDataclass = dataclasses.dataclass(StandardClass)\n PydanticDataclass = pydantic.dataclasses.dataclass(StandardClass)\n\n clases_to_test = [StandardLibDataclass, PydanticDataclass]\n\n test_string = 'string'\n for cls in clases_to_test:\n instance = cls(a=test_string)\n assert instance._special_property == 1\n assert instance.a == test_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_pydantic__pydantic/tests/test_dataclasses.py_test_ignore_extra_test_allow_extra.assert_foo___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_ignore_extra_test_allow_extra.assert_foo___dict___", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1339, "end_line": 1368, "span_ids": ["test_ignore_extra", "test_ignore_extra_subclass", "test_allow_extra"], "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": "@pytest.mark.xfail(reason='model_config[\"extra\"] is not respected')\ndef test_ignore_extra():\n @pydantic.dataclasses.dataclass(config=dict(extra=Extra.ignore))\n class Foo:\n x: int\n\n foo = Foo(**{'x': '1', 'y': '2'})\n assert foo.__dict__ == {'x': 1, '__pydantic_initialised__': True}\n\n\ndef test_ignore_extra_subclass():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.ignore))\n class Foo:\n x: int\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.ignore))\n class Bar(Foo):\n y: int\n\n bar = Bar(**{'x': '1', 'y': '2', 'z': '3'})\n assert bar.__dict__ == {'x': 1, 'y': 2}\n\n\ndef test_allow_extra():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.allow))\n class Foo:\n x: int\n\n foo = Foo(**{'x': '1', 'y': '2'})\n assert foo.__dict__ == {'x': 1, 'y': '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_pydantic__pydantic/tests/test_dataclasses.py_test_allow_extra_subclass_test_allow_extra_subclass.assert_bar___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_allow_extra_subclass_test_allow_extra_subclass.assert_bar___dict___", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1371, "end_line": 1381, "span_ids": ["test_allow_extra_subclass"], "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 test_allow_extra_subclass():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.allow))\n class Foo:\n x: int\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.allow))\n class Bar(Foo):\n y: int\n\n bar = Bar(**{'x': '1', 'y': '2', 'z': '3'})\n assert bar.__dict__ == {'x': 1, 'y': 2, 'z': '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_pydantic__pydantic/tests/test_dataclasses.py_test_forbid_extra_test_validator.assert_d_b_5_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_forbid_extra_test_validator.assert_d_b_5_0", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1384, "end_line": 1455, "span_ids": ["test_extra_forbid_list_no_error", "test_kw_only", "test_self_reference_dataclass", "test_extra_forbid_list_error", "test_validator", "test_forbid_extra"], "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 test_forbid_extra():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.forbid))\n class Foo:\n x: int\n\n msg = re.escape(\"Unexpected keyword argument [type=unexpected_keyword_argument, input_value='2', input_type=str]\")\n\n with pytest.raises(ValidationError, match=msg):\n Foo(**{'x': '1', 'y': '2'})\n\n\n@pytest.mark.xfail(reason='recursive references need rebuilding?')\ndef test_self_reference_dataclass():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n self_reference: 'MyDataclass'\n\n annotation = MyDataclass.__pydantic_fields__['self_reference'].annotation\n # Currently, this is true:\n # assert isinstance(MyDataclass, PydanticForwardRef)\n # TODO: Probably need a way to \"model_rebuild\" a dataclass\n assert annotation is MyDataclass\n\n\n@pytest.mark.skipif(sys.version_info < (3, 10), reason='kw_only is not available in python < 3.10')\ndef test_kw_only():\n @pydantic.dataclasses.dataclass(kw_only=True)\n class A:\n a: int | None = None\n b: str\n\n with pytest.raises(ValidationError):\n A(1, '')\n\n assert A(b='hi').b == 'hi'\n\n\ndef test_extra_forbid_list_no_error():\n @pydantic.dataclasses.dataclass(config=dict(extra=Extra.forbid))\n class Bar:\n ...\n\n @pydantic.dataclasses.dataclass\n class Foo:\n a: List[Bar]\n\n assert isinstance(Foo(a=[Bar()]).a[0], Bar)\n\n\ndef test_extra_forbid_list_error():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=Extra.forbid))\n class Bar:\n ...\n\n with pytest.raises(ValidationError, match=r'a\\s+Unexpected keyword argument'):\n Bar(a=1)\n\n\ndef test_validator():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n b: float\n\n @field_validator('b')\n @classmethod\n def double_b(cls, v, _):\n return v * 2\n\n d = MyDataclass('1', '2.5')\n assert d.a == 1\n assert d.b == 5.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_pydantic__pydantic/tests/test_dataclasses.py_test_parent_post_init_test_parent_post_init._1_3_2_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_parent_post_init_test_parent_post_init._1_3_2_8", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1458, "end_line": 1483, "span_ids": ["test_parent_post_init"], "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 test_parent_post_init():\n \"\"\"\n Test that the parent's __post_init__ gets called\n and the order in which it gets called relative to validation.\n\n In V1 we called it before validation, in V2 it gets called after.\n \"\"\"\n\n @dataclasses.dataclass\n class A:\n a: float\n\n def __post_init__(self):\n self.a *= 2\n\n assert A(a=1.2).a == 2.4\n\n @pydantic.dataclasses.dataclass\n class B(A):\n @field_validator('a')\n @classmethod\n def validate_a(cls, value, _):\n value += 3\n return value\n\n assert B(a=1).a == 8 # (1 + 3) * 2 = 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_pydantic__pydantic/tests/test_dataclasses.py_test_subclass_post_init_order_test_subclass_post_init_inheritance._1_3_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_subclass_post_init_order_test_subclass_post_init_inheritance._1_3_3", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1486, "end_line": 1526, "span_ids": ["test_subclass_post_init_inheritance", "test_subclass_post_init_order"], "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 test_subclass_post_init_order():\n @dataclasses.dataclass\n class A:\n a: float\n\n @pydantic.dataclasses.dataclass\n class B(A):\n def __post_init__(self):\n self.a *= 2\n\n @field_validator('a')\n @classmethod\n def validate_a(cls, value):\n value += 3\n return value\n\n assert B(a=1).a == 8 # (1 + 3) * 2 = 8\n\n\ndef test_subclass_post_init_inheritance():\n @dataclasses.dataclass\n class A:\n a: int\n\n @pydantic.dataclasses.dataclass\n class B(A):\n def __post_init__(self):\n self.a *= 2\n\n @field_validator('a')\n @classmethod\n def validate_a(cls, value):\n value += 3\n return value\n\n @pydantic.dataclasses.dataclass\n class C(B):\n def __post_init__(self):\n self.a *= 3\n\n assert C(1).a == 12 # (1 + 3) * 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_pydantic__pydantic/tests/test_dataclasses.py_test_config_as_type_deprecated_test_validator_info_field_name_data_before.assert_Model_a_b_your_foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_config_as_type_deprecated_test_validator_info_field_name_data_before.assert_Model_a_b_your_foo", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1529, "end_line": 1564, "span_ids": ["test_config_as_type_deprecated", "test_validator_info_field_name_data_before"], "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": "def test_config_as_type_deprecated():\n class Config:\n validate_assignment = True\n\n with pytest.warns(\n DeprecationWarning, match='Support for \"config\" as \"type\" is deprecated and will be removed in a future version'\n ):\n\n @pydantic.dataclasses.dataclass(config=Config)\n class MyDataclass:\n a: int\n\n assert MyDataclass.__pydantic_config__ == ConfigDict(validate_assignment=True)\n\n\ndef test_validator_info_field_name_data_before():\n \"\"\"\n Test accessing info.field_name and info.data\n We only test the `before` validator because they\n all share the same implementation.\n \"\"\"\n\n @pydantic.dataclasses.dataclass\n class Model:\n a: str\n b: str\n\n @field_validator('b', mode='before')\n @classmethod\n def check_a(cls, v: Any, info: FieldValidationInfo) -> Any:\n assert v == b'but my barbaz is better'\n assert info.field_name == 'b'\n assert info.data == {'a': 'your foobar is good'}\n return 'just kidding!'\n\n assert Model(a=b'your foobar is good', b=b'but my barbaz is better').b == 'just kidding!'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_replace_test_inheritance_replace.Parent.parent_val_after.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_replace_test_inheritance_replace.Parent.parent_val_after.return.v", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1567, "end_line": 1605, "span_ids": ["test_inheritance_replace"], "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": "@pytest.mark.parametrize(\n 'decorator1, expected_parent, expected_child',\n [\n (\n pydantic.dataclasses.dataclass,\n ['parent before', 'parent', 'parent after'],\n ['parent before', 'child', 'parent after', 'child before', 'child after'],\n ),\n (dataclasses.dataclass, [], ['child before', 'child', 'child after']),\n ],\n ids=['pydantic', 'stdlib'],\n)\ndef test_inheritance_replace(decorator1: Callable[[Any], Any], expected_parent: List[str], expected_child: List[str]):\n \"\"\"We promise that if you add a validator\n with the same _function_ name as an existing validator\n it replaces the existing validator and is run instead of it.\n \"\"\"\n\n @decorator1\n class Parent:\n a: List[str]\n\n @field_validator('a', allow_reuse=True)\n @classmethod\n def parent_val_before(cls, v: List[str]):\n v.append('parent before')\n return v\n\n @field_validator('a', allow_reuse=True)\n @classmethod\n def val(cls, v: List[str]):\n v.append('parent')\n return v\n\n @field_validator('a', allow_reuse=True)\n @classmethod\n def parent_val_after(cls, v: List[str]):\n v.append('parent after')\n return v\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_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_replace.Child_test_inheritance_replace.assert_Child_a_a_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inheritance_replace.Child_test_inheritance_replace.assert_Child_a_a_e", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1607, "end_line": 1628, "span_ids": ["test_inheritance_replace"], "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": "@pytest.mark.parametrize(\n 'decorator1, expected_parent, expected_child',\n [\n (\n pydantic.dataclasses.dataclass,\n ['parent before', 'parent', 'parent after'],\n ['parent before', 'child', 'parent after', 'child before', 'child after'],\n ),\n (dataclasses.dataclass, [], ['child before', 'child', 'child after']),\n ],\n ids=['pydantic', 'stdlib'],\n)\ndef test_inheritance_replace(decorator1: Callable[[Any], Any], expected_parent: List[str], expected_child: List[str]):\n # ... other code\n\n @pydantic.dataclasses.dataclass\n class Child(Parent):\n @field_validator('a', allow_reuse=True)\n @classmethod\n def child_val_before(cls, v: List[str]):\n v.append('child before')\n return v\n\n @field_validator('a', allow_reuse=True)\n @classmethod\n def val(cls, v: List[str]):\n v.append('child')\n return v\n\n @field_validator('a', allow_reuse=True)\n @classmethod\n def child_val_after(cls, v: List[str]):\n v.append('child after')\n return v\n\n assert Parent(a=[]).a == expected_parent\n assert Child(a=[]).a == expected_child", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclasses_inheritance_default_value_is_not_deleted_test_dataclasses_inheritance_default_value_is_not_deleted.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclasses_inheritance_default_value_is_not_deleted_test_dataclasses_inheritance_default_value_is_not_deleted.None_3", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1631, "end_line": 1662, "span_ids": ["test_dataclasses_inheritance_default_value_is_not_deleted"], "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": "@pytest.mark.parametrize(\n 'decorator1',\n [\n pydantic.dataclasses.dataclass,\n dataclasses.dataclass,\n ],\n ids=['pydantic', 'stdlib'],\n)\n@pytest.mark.parametrize(\n 'default',\n [1, dataclasses.field(default=1), Field(default=1)],\n ids=['1', 'dataclasses.field(default=1)', 'pydantic.Field(default=1)'],\n)\ndef test_dataclasses_inheritance_default_value_is_not_deleted(\n decorator1: Callable[[Any], Any], default: Literal[1]\n) -> None:\n if decorator1 is dataclasses.dataclass and isinstance(default, FieldInfo):\n pytest.skip(reason=\"stdlib dataclasses don't support Pydantic fields\")\n\n @decorator1\n class Parent:\n a: int = default\n\n assert Parent.a == 1\n assert Parent().a == 1\n\n @pydantic.dataclasses.dataclass\n class Child(Parent):\n pass\n\n assert Child.a == 1\n assert Child().a == 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_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_config_validate_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_config_validate_default_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1665, "end_line": 1693, "span_ids": ["test_dataclass_config_validate_default"], "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 test_dataclass_config_validate_default():\n @pydantic.dataclasses.dataclass\n class Model:\n x: int = -1\n\n @field_validator('x')\n @classmethod\n def force_x_positive(cls, v):\n assert v > 0\n return v\n\n assert Model().x == -1\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(validate_default=True))\n class ValidatingModel(Model):\n pass\n\n with pytest.raises(ValidationError) as exc_info:\n ValidatingModel()\n assert exc_info.value.errors() == [\n {\n 'ctx': {'error': 'assert -1 > 0'},\n 'input': -1,\n 'loc': ('x',),\n 'msg': 'Assertion failed, assert -1 > 0',\n 'type': 'assertion_error',\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_pydantic__pydantic/tests/test_datetime.py_re_test_date_parsing.if_isinstance_result_Err.else_.assert_DateModel_d_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_re_test_date_parsing.if_isinstance_result_Err.else_.assert_DateModel_d_value_", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 58, "span_ids": ["imports", "date_model_fixture", "create_tz", "test_date_parsing"], "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": "import re\nfrom datetime import date, datetime, time, timedelta, timezone\n\nimport pytest\nfrom dirty_equals import HasRepr\n\nfrom pydantic import AwareDatetime, BaseModel, FutureDate, NaiveDatetime, PastDate, ValidationError, condate\n\nfrom .conftest import Err\n\n\ndef create_tz(minutes):\n return timezone(timedelta(minutes=minutes))\n\n\n@pytest.fixture(scope='module', name='DateModel')\ndef date_model_fixture():\n class DateModel(BaseModel):\n d: date\n\n return DateModel\n\n\n@pytest.mark.parametrize(\n 'value,result',\n [\n # Valid inputs\n (1_493_942_400, date(2017, 5, 5)),\n (1_493_942_400_000, date(2017, 5, 5)),\n (0, date(1970, 1, 1)),\n ('2012-04-23', date(2012, 4, 23)),\n (b'2012-04-23', date(2012, 4, 23)),\n (date(2012, 4, 9), date(2012, 4, 9)),\n (datetime(2012, 4, 9, 0, 0), date(2012, 4, 9)),\n # Invalid inputs\n (datetime(2012, 4, 9, 12, 15), Err('Datetimes provided to dates should have zero time - e.g. be exact dates')),\n ('x20120423', Err('Input should be a valid date or datetime, input is too short')),\n ('2012-04-56', Err('Input should be a valid date or datetime, day value is outside expected range')),\n (19_999_958_400, date(2603, 10, 11)), # just before watershed\n (20000044800, Err('type=date_from_datetime_inexact,')), # just after watershed\n (1_549_238_400, date(2019, 2, 4)), # nowish in s\n (1_549_238_400_000, date(2019, 2, 4)), # nowish in ms\n (1_549_238_400_000_000, Err('Input should be a valid date or datetime, dates after 9999')), # nowish in \u03bcs\n (1_549_238_400_000_000_000, Err('Input should be a valid date or datetime, dates after 9999')), # nowish in ns\n ('infinity', Err('Input should be a valid date or datetime, input is too short')),\n (float('inf'), Err('Input should be a valid date or datetime, dates after 9999')),\n (int('1' + '0' * 100), Err('Input should be a valid date or datetime, dates after 9999')),\n (1e1000, Err('Input should be a valid date or datetime, dates after 9999')),\n (float('-infinity'), Err('Input should be a valid date or datetime, dates before 1600')),\n (float('nan'), Err('Input should be a valid date or datetime, NaN values not permitted')),\n ],\n)\ndef test_date_parsing(DateModel, value, result):\n if isinstance(result, Err):\n with pytest.raises(ValidationError, match=result.message_escaped()):\n DateModel(d=value)\n else:\n assert DateModel(d=value).d == 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_pydantic__pydantic/tests/test_datetime.py_time_model_fixture_datetime_model_fixture.return.DatetimeModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_time_model_fixture_datetime_model_fixture.return.DatetimeModel", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 112, "span_ids": ["datetime_model_fixture", "test_time_parsing", "time_model_fixture"], "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": "@pytest.fixture(scope='module', name='TimeModel')\ndef time_model_fixture():\n class TimeModel(BaseModel):\n d: time\n\n return TimeModel\n\n\n@pytest.mark.parametrize(\n 'value,result',\n [\n # Valid inputs\n ('09:15:00', time(9, 15)),\n ('10:10', time(10, 10)),\n ('10:20:30.400', time(10, 20, 30, 400_000)),\n (b'10:20:30.400', time(10, 20, 30, 400_000)),\n (time(4, 8, 16), time(4, 8, 16)),\n (3610, time(1, 0, 10)),\n (3600.5, time(1, 0, 0, 500000)),\n (86400 - 1, time(23, 59, 59)),\n # Invalid inputs\n ('4:8:16', Err('Input should be in a valid time format, invalid character in hour [type=time_parsing,')),\n (86400, Err('Input should be in a valid time format, numeric times may not exceed 86,399 seconds')),\n ('xxx', Err('Input should be in a valid time format, input is too short [type=time_parsing,')),\n ('091500', Err('Input should be in a valid time format, invalid time separator, expected `:`')),\n (b'091500', Err('Input should be in a valid time format, invalid time separator, expected `:`')),\n ('09:15:90', Err('Input should be in a valid time format, second value is outside expected range of 0-59')),\n ('11:05:00Y', Err('Input should be in a valid time format, unexpected extra characters at the end of the inp')),\n # # https://github.com/pydantic/speedate/issues/10\n # ('11:05:00-05:30', time(11, 5, 0, tzinfo=create_tz(-330))),\n # ('11:05:00-0530', time(11, 5, 0, tzinfo=create_tz(-330))),\n # ('11:05:00Z', time(11, 5, 0, tzinfo=timezone.utc)),\n # ('11:05:00+00', time(11, 5, 0, tzinfo=timezone.utc)),\n # ('11:05-06', time(11, 5, 0, tzinfo=create_tz(-360))),\n # ('11:05+06', time(11, 5, 0, tzinfo=create_tz(360))),\n # ('11:05:00-25:00', errors.TimeError),\n ],\n)\ndef test_time_parsing(TimeModel, value, result):\n if isinstance(result, Err):\n with pytest.raises(ValidationError, match=result.message_escaped()):\n TimeModel(d=value)\n else:\n assert TimeModel(d=value).d == result\n\n\n@pytest.fixture(scope='module', name='DatetimeModel')\ndef datetime_model_fixture():\n class DatetimeModel(BaseModel):\n dt: datetime\n\n return DatetimeModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_datetime_parsing_test_datetime_parsing.if_isinstance_result_Err.else_.assert_DatetimeModel_dt_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_datetime_parsing_test_datetime_parsing.if_isinstance_result_Err.else_.assert_DatetimeModel_dt_v", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 115, "end_line": 160, "span_ids": ["test_datetime_parsing"], "tokens": 1096}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'value,result',\n [\n # Valid inputs\n # values in seconds\n (1_494_012_444.883_309, datetime(2017, 5, 5, 19, 27, 24, 883_309)),\n (1_494_012_444, datetime(2017, 5, 5, 19, 27, 24)),\n # values in ms\n (1_494_012_444_000, datetime(2017, 5, 5, 19, 27, 24)),\n ('2012-04-23T09:15:00', datetime(2012, 4, 23, 9, 15)),\n ('2012-04-23T09:15:00Z', datetime(2012, 4, 23, 9, 15, 0, 0, timezone.utc)),\n ('2012-04-23T10:20:30.400+02:30', datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(150))),\n ('2012-04-23T10:20:30.400+02:00', datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(120))),\n ('2012-04-23T10:20:30.400-02:00', datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))),\n (b'2012-04-23T10:20:30.400-02:00', datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))),\n (datetime(2017, 5, 5), datetime(2017, 5, 5)),\n (0, datetime(1970, 1, 1, 0, 0, 0)),\n # # Invalid inputs\n ('1494012444.883309', Err('Input should be a valid datetime, invalid date separator')),\n ('1494012444', Err('Input should be a valid datetime, invalid date separator')),\n (b'1494012444', Err('Input should be a valid datetime, invalid date separator')),\n ('1494012444000.883309', Err('Input should be a valid datetime, invalid date separator')),\n ('-1494012444000.883309', Err('Input should be a valid datetime, invalid character in year')),\n ('2012-4-9 4:8:16', Err('Input should be a valid datetime, invalid character in month')),\n ('x20120423091500', Err('Input should be a valid datetime, invalid character in year')),\n ('2012-04-56T09:15:90', Err('Input should be a valid datetime, day value is outside expected range')),\n ('2012-04-23T11:05:00-25:00', Err('Input should be a valid datetime, timezone offset must be less than 24 ho')),\n (19_999_999_999, datetime(2603, 10, 11, 11, 33, 19)), # just before watershed\n (20_000_000_001, datetime(1970, 8, 20, 11, 33, 20, 1000)), # just after watershed\n (1_549_316_052, datetime(2019, 2, 4, 21, 34, 12, 0)), # nowish in s\n (1_549_316_052_104, datetime(2019, 2, 4, 21, 34, 12, 104_000)), # nowish in ms\n (1_549_316_052_104_324, Err('Input should be a valid datetime, dates after 9999')), # nowish in \u03bcs\n (1_549_316_052_104_324_096, Err('Input should be a valid datetime, dates after 9999')), # nowish in ns\n ('infinity', Err('Input should be a valid datetime, input is too short')),\n (float('inf'), Err('Input should be a valid datetime, dates after 9999')),\n (float('-inf'), Err('Input should be a valid datetime, dates before 1600')),\n (1e50, Err('Input should be a valid datetime, dates after 9999')),\n (float('nan'), Err('Input should be a valid datetime, NaN values not permitted')),\n ],\n)\ndef test_datetime_parsing(DatetimeModel, value, result):\n if isinstance(result, Err):\n with pytest.raises(ValidationError, match=result.message_escaped()):\n DatetimeModel(dt=value)\n else:\n assert DatetimeModel(dt=value).dt == 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_pydantic__pydantic/tests/test_datetime.py_test_aware_datetime_validation_success_timedelta_model_fixture.return.TimedeltaModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_aware_datetime_validation_success_timedelta_model_fixture.return.TimedeltaModel", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 224, "span_ids": ["test_aware_datetime_validation_fails", "test_naive_datetime_validation_fails", "test_aware_datetime_validation_success", "test_naive_datetime_validation_success", "timedelta_model_fixture"], "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": "def test_aware_datetime_validation_success():\n class Model(BaseModel):\n foo: AwareDatetime\n\n value = datetime.now(tz=timezone.utc)\n\n assert Model(foo=value).foo == value\n\n\ndef test_aware_datetime_validation_fails():\n class Model(BaseModel):\n foo: AwareDatetime\n\n value = datetime.now()\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n\n assert exc_info.value.errors() == [\n {\n 'type': 'datetime_aware',\n 'loc': ('foo',),\n 'msg': 'Datetime should have timezone info',\n 'input': value,\n }\n ]\n\n\ndef test_naive_datetime_validation_success():\n class Model(BaseModel):\n foo: NaiveDatetime\n\n value = datetime.now()\n\n assert Model(foo=value).foo == value\n\n\ndef test_naive_datetime_validation_fails():\n class Model(BaseModel):\n foo: NaiveDatetime\n\n value = datetime.now(tz=timezone.utc)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n\n assert exc_info.value.errors() == [\n {\n 'type': 'datetime_naive',\n 'loc': ('foo',),\n 'msg': 'Datetime should not have timezone info',\n 'input': value,\n }\n ]\n\n\n@pytest.fixture(scope='module', name='TimedeltaModel')\ndef timedelta_model_fixture():\n class TimedeltaModel(BaseModel):\n d: timedelta\n\n return TimedeltaModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_parse_python_format_test_parse_python_format._assert_TimedeltaModel_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_parse_python_format_test_parse_python_format._assert_TimedeltaModel_d", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 227, "end_line": 241, "span_ids": ["test_parse_python_format"], "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": "@pytest.mark.parametrize(\n 'delta',\n [\n timedelta(days=4, minutes=15, seconds=30, milliseconds=100), # fractions of seconds\n timedelta(hours=10, minutes=15, seconds=30), # hours, minutes, seconds\n timedelta(days=4, minutes=15, seconds=30), # multiple days\n timedelta(days=1, minutes=00, seconds=00), # single day\n timedelta(days=-4, minutes=15, seconds=30), # negative durations\n timedelta(minutes=15, seconds=30), # minute & seconds\n timedelta(seconds=30), # seconds\n ],\n)\ndef test_parse_python_format(TimedeltaModel, delta):\n assert TimedeltaModel(d=delta).d == delta\n # assert TimedeltaModel(d=str(delta)).d == delta", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_parse_durations_test_parse_durations.if_isinstance_result_Err.else_.assert_TimedeltaModel_d_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_parse_durations_test_parse_durations.if_isinstance_result_Err.else_.assert_TimedeltaModel_d_v", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 244, "end_line": 295, "span_ids": ["test_parse_durations"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n # seconds\n (timedelta(seconds=30), timedelta(seconds=30)),\n (30, timedelta(seconds=30)),\n (30.1, timedelta(seconds=30, milliseconds=100)),\n (9.9e-05, timedelta(microseconds=99)),\n # minutes seconds\n ('00:15:30', timedelta(minutes=15, seconds=30)),\n ('00:05:30', timedelta(minutes=5, seconds=30)),\n # hours minutes seconds\n ('10:15:30', timedelta(hours=10, minutes=15, seconds=30)),\n ('01:15:30', timedelta(hours=1, minutes=15, seconds=30)),\n # ('100:200:300', timedelta(hours=100, minutes=200, seconds=300)),\n # days\n ('4d,00:15:30', timedelta(days=4, minutes=15, seconds=30)),\n ('4d,10:15:30', timedelta(days=4, hours=10, minutes=15, seconds=30)),\n # fractions of seconds\n ('00:15:30.1', timedelta(minutes=15, seconds=30, milliseconds=100)),\n ('00:15:30.01', timedelta(minutes=15, seconds=30, milliseconds=10)),\n ('00:15:30.001', timedelta(minutes=15, seconds=30, milliseconds=1)),\n ('00:15:30.0001', timedelta(minutes=15, seconds=30, microseconds=100)),\n ('00:15:30.00001', timedelta(minutes=15, seconds=30, microseconds=10)),\n ('00:15:30.000001', timedelta(minutes=15, seconds=30, microseconds=1)),\n (b'00:15:30.000001', timedelta(minutes=15, seconds=30, microseconds=1)),\n # negative\n ('-4d,00:15:30', timedelta(days=-4, minutes=-15, seconds=-30)),\n (-172800, timedelta(days=-2)),\n ('-00:15:30', timedelta(minutes=-15, seconds=-30)),\n ('-01:15:30', timedelta(hours=-1, minutes=-15, seconds=-30)),\n (-30.1, timedelta(seconds=-30, milliseconds=-100)),\n # iso_8601\n ('30', Err('Input should be a valid timedelta, \"day\" identifier')),\n ('P4Y', timedelta(days=1460)),\n ('P4M', timedelta(days=120)),\n ('P4W', timedelta(days=28)),\n ('P4D', timedelta(days=4)),\n ('P0.5D', timedelta(hours=12)),\n ('PT5H', timedelta(hours=5)),\n ('PT5M', timedelta(minutes=5)),\n ('PT5S', timedelta(seconds=5)),\n ('PT0.000005S', timedelta(microseconds=5)),\n (b'PT0.000005S', timedelta(microseconds=5)),\n ],\n)\ndef test_parse_durations(TimedeltaModel, value, result):\n if isinstance(result, Err):\n with pytest.raises(ValidationError, match=result.message_escaped()):\n TimedeltaModel(d=value)\n else:\n assert TimedeltaModel(d=value).d == 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_pydantic__pydantic/tests/test_datetime.py_test_model_type_errors_test_model_type_errors.assert_error_msg_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_model_type_errors_test_model_type_errors.assert_error_msg_er", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 298, "end_line": 326, "span_ids": ["test_model_type_errors"], "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": "@pytest.mark.parametrize(\n 'field, value, error_message',\n [\n ('dt', [], 'Input should be a valid datetime'),\n ('dt', {}, 'Input should be a valid datetime'),\n ('dt', object, 'Input should be a valid datetime'),\n ('d', [], 'Input should be a valid date'),\n ('d', {}, 'Input should be a valid date'),\n ('d', object, 'Input should be a valid date'),\n ('t', [], 'Input should be a valid time'),\n ('t', {}, 'Input should be a valid time'),\n ('t', object, 'Input should be a valid time'),\n ('td', [], 'Input should be a valid timedelta'),\n ('td', {}, 'Input should be a valid timedelta'),\n ('td', object, 'Input should be a valid timedelta'),\n ],\n)\ndef test_model_type_errors(field, value, error_message):\n class Model(BaseModel):\n dt: datetime = None\n d: date = None\n t: time = None\n td: timedelta = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(**{field: value})\n assert len(exc_info.value.errors()) == 1\n error = exc_info.value.errors()[0]\n assert error['msg'] == error_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_pydantic__pydantic/tests/test_datetime.py_test_unicode_decode_error_test_nan.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_unicode_decode_error_test_nan.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 329, "end_line": 366, "span_ids": ["test_unicode_decode_error", "test_nan"], "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": "@pytest.mark.parametrize('field', ['dt', 'd', 't', 'dt'])\ndef test_unicode_decode_error(field):\n class Model(BaseModel):\n dt: datetime = None\n d: date = None\n t: time = None\n td: timedelta = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(**{field: b'\\x81\\x81\\x81\\x81\\x81\\x81\\x81\\x81'})\n assert exc_info.value.error_count() == 1\n # errors vary\n\n\ndef test_nan():\n class Model(BaseModel):\n dt: datetime\n d: date\n\n with pytest.raises(ValidationError) as exc_info:\n Model(dt=float('nan'), d=float('nan'))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'datetime_parsing',\n 'loc': ('dt',),\n 'msg': 'Input should be a valid datetime, NaN values not permitted',\n 'input': HasRepr('nan'),\n 'ctx': {'error': 'NaN values not permitted'},\n },\n {\n 'type': 'date_from_datetime_parsing',\n 'loc': ('d',),\n 'msg': 'Input should be a valid date or datetime, NaN values not permitted',\n 'input': HasRepr('nan'),\n 'ctx': {'error': 'NaN values not permitted'},\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_pydantic__pydantic/tests/test_datetime.py_test_date_constraints_test_date_constraints.with_pytest_raises_Valida.Model_a_error_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_date_constraints_test_date_constraints.with_pytest_raises_Valida.Model_a_error_value_", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 369, "end_line": 389, "span_ids": ["test_date_constraints"], "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": "@pytest.mark.parametrize(\n 'constraint,msg,ok_value,error_value',\n [\n ('gt', 'greater than', date(2020, 1, 2), date(2019, 12, 31)),\n ('gt', 'greater than', date(2020, 1, 2), date(2020, 1, 1)),\n ('ge', 'greater than or equal to', date(2020, 1, 2), date(2019, 12, 31)),\n ('ge', 'greater than or equal to', date(2020, 1, 1), date(2019, 12, 31)),\n ('lt', 'less than', date(2019, 12, 31), date(2020, 1, 2)),\n ('lt', 'less than', date(2019, 12, 31), date(2020, 1, 1)),\n ('le', 'less than or equal to', date(2019, 12, 31), date(2020, 1, 2)),\n ('le', 'less than or equal to', date(2020, 1, 1), date(2020, 1, 2)),\n ],\n)\ndef test_date_constraints(constraint, msg, ok_value, error_value):\n class Model(BaseModel):\n a: condate(**{constraint: date(2020, 1, 1)})\n\n assert Model(a=ok_value).model_dump() == {'a': ok_value}\n\n with pytest.raises(ValidationError, match=re.escape(f'Input should be {msg} 2020-01-01')):\n Model(a=error_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_pydantic__pydantic/tests/test_datetime.py_test_past_date_validation_success_test_past_date_validation_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_past_date_validation_success_test_past_date_validation_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 392, "end_line": 428, "span_ids": ["test_past_date_validation_fails", "test_past_date_validation_success"], "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": "@pytest.mark.parametrize(\n 'value,result',\n (\n ('1996-01-22', date(1996, 1, 22)),\n (date(1996, 1, 22), date(1996, 1, 22)),\n ),\n)\ndef test_past_date_validation_success(value, result):\n class Model(BaseModel):\n foo: PastDate\n\n assert Model(foo=value).foo == result\n\n\n@pytest.mark.parametrize(\n 'value',\n (\n date.today(),\n date.today() + timedelta(1),\n '2064-06-01',\n ),\n)\ndef test_past_date_validation_fails(value):\n class Model(BaseModel):\n foo: PastDate\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'date_past',\n 'loc': ('foo',),\n 'msg': 'Date should be in the past',\n 'input': value,\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_pydantic__pydantic/tests/test_datetime.py_test_future_date_validation_success_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_future_date_validation_success_", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 431, "end_line": 468, "span_ids": ["test_future_date_validation_success", "test_future_date_validation_fails"], "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": "@pytest.mark.parametrize(\n 'value,result',\n (\n (date.today() + timedelta(1), date.today() + timedelta(1)),\n ('2064-06-01', date(2064, 6, 1)),\n ),\n)\ndef test_future_date_validation_success(value, result):\n class Model(BaseModel):\n foo: FutureDate\n\n assert Model(foo=value).foo == result\n\n\n@pytest.mark.parametrize(\n 'value',\n (\n date.today(),\n date.today() - timedelta(1),\n '1996-01-22',\n ),\n)\ndef test_future_date_validation_fails(value):\n class Model(BaseModel):\n foo: FutureDate\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'date_future',\n 'loc': ('foo',),\n 'msg': 'Date should be in the future',\n 'input': value,\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_pydantic__pydantic/tests/test_decorator.py_asyncio_skip_pre_38.pytest_mark_skipif_sys_ve": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_asyncio_skip_pre_38.pytest_mark_skipif_sys_ve", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports"], "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": "import asyncio\nimport inspect\nimport sys\nfrom datetime import datetime, timezone\nfrom pathlib import Path\nfrom typing import List\n\nimport pytest\nfrom dirty_equals import IsInstance\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import BaseModel, Extra, Field, ValidationError, validate_arguments\nfrom pydantic.decorator import ValidatedFunction\nfrom pydantic.errors import PydanticUserError\n\nskip_pre_38 = pytest.mark.skipif(sys.version_info < (3, 8), reason='testing >= 3.8 behaviour 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_pydantic__pydantic/tests/test_decorator.py_test_args_test_args.None_5.foo_1_2_a_3_b_4_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_args_test_args.None_5.foo_1_2_a_3_b_4_", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 57, "span_ids": ["test_args"], "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 test_args():\n @validate_arguments\n def foo(a: int, b: int):\n return f'{a}, {b}'\n\n assert foo(1, 2) == '1, 2'\n assert foo(*[1, 2]) == '1, 2'\n assert foo(*(1, 2)) == '1, 2'\n assert foo(*[1], 2) == '1, 2'\n\n with pytest.raises(ValidationError) as exc_info:\n foo()\n assert exc_info.value.errors() == [\n {'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {}, 'loc': ('b',), 'msg': 'Field required', 'type': 'missing'},\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n foo(1, 'x')\n assert exc_info.value.errors() == [\n {\n 'input': 'x',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n }\n ]\n\n with pytest.raises(TypeError, match='2 positional arguments expected but 3 given'):\n foo(1, 2, 3)\n\n with pytest.raises(TypeError, match=\"unexpected keyword argument: 'apple'\"):\n foo(1, 2, apple=3)\n\n with pytest.raises(TypeError, match=\"multiple values for argument: 'a'\"):\n foo(1, 2, a=3)\n\n with pytest.raises(TypeError, match=\"multiple values for arguments: 'a', 'b'\"):\n foo(1, 2, a=3, b=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_pydantic__pydantic/tests/test_decorator.py_test_wrap_test_wrap.assert_repr_inspect_signa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_wrap_test_wrap.assert_repr_inspect_signa", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 60, "end_line": 78, "span_ids": ["test_wrap"], "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 test_wrap():\n @validate_arguments\n def foo_bar(a: int, b: int):\n \"\"\"This is the foo_bar method.\"\"\"\n return f'{a}, {b}'\n\n assert foo_bar.__doc__ == 'This is the foo_bar method.'\n assert foo_bar.__name__ == 'foo_bar'\n assert foo_bar.__module__ == 'tests.test_decorator'\n assert foo_bar.__qualname__ == 'test_wrap..foo_bar'\n assert isinstance(foo_bar.vd, ValidatedFunction)\n assert callable(foo_bar.raw_function)\n assert foo_bar.vd.arg_mapping == {0: 'a', 1: 'b'}\n assert foo_bar.vd.positional_only_args == set()\n assert issubclass(foo_bar.model, BaseModel)\n assert foo_bar.model.model_fields.keys() == {'a', 'b', 'args', 'kwargs', 'v__duplicate_kwargs'}\n assert foo_bar.model.__name__ == 'FooBar'\n assert foo_bar.model.model_json_schema()['title'] == 'FooBar'\n assert repr(inspect.signature(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_pydantic__pydantic/tests/test_decorator.py_test_kwargs_test_untyped.assert_foo_1_x_2_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_kwargs_test_untyped.assert_foo_1_x_2_c", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 111, "span_ids": ["test_untyped", "test_kwargs"], "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 test_kwargs():\n @validate_arguments\n def foo(*, a: int, b: int):\n return a + b\n\n assert foo.model.model_fields.keys() == {'a', 'b', 'args', 'kwargs'}\n assert foo(a=1, b=3) == 4\n\n with pytest.raises(ValidationError) as exc_info:\n foo(a=1, b='x')\n\n assert exc_info.value.errors() == [\n {\n 'input': 'x',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n }\n ]\n\n with pytest.raises(TypeError, match='0 positional arguments expected but 2 given'):\n foo(1, 'x')\n\n\ndef test_untyped():\n @validate_arguments\n def foo(a, b, c='x', *, d='y'):\n return ', '.join(str(arg) for arg in [a, b, c, d])\n\n assert foo(1, 2) == '1, 2, x, y'\n assert foo(1, {'x': 2}, c='3', d='4') == \"1, {'x': 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_pydantic__pydantic/tests/test_decorator.py_test_var_args_kwargs_test_var_args_kwargs.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_var_args_kwargs_test_var_args_kwargs.None_7", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 114, "end_line": 129, "span_ids": ["test_var_args_kwargs"], "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": "@pytest.mark.parametrize('validated', (True, False))\ndef test_var_args_kwargs(validated):\n def foo(a, b, *args, d=3, **kwargs):\n return f'a={a!r}, b={b!r}, args={args!r}, d={d!r}, kwargs={kwargs!r}'\n\n if validated:\n foo = validate_arguments(foo)\n\n assert foo(1, 2) == 'a=1, b=2, args=(), d=3, kwargs={}'\n assert foo(1, 2, 3, d=4) == 'a=1, b=2, args=(3,), d=4, kwargs={}'\n assert foo(*[1, 2, 3], d=4) == 'a=1, b=2, args=(3,), d=4, kwargs={}'\n assert foo(1, 2, args=(10, 11)) == \"a=1, b=2, args=(), d=3, kwargs={'args': (10, 11)}\"\n assert foo(1, 2, 3, args=(10, 11)) == \"a=1, b=2, args=(3,), d=3, kwargs={'args': (10, 11)}\"\n assert foo(1, 2, 3, e=10) == \"a=1, b=2, args=(3,), d=3, kwargs={'e': 10}\"\n assert foo(1, 2, kwargs=4) == \"a=1, b=2, args=(), d=3, kwargs={'kwargs': 4}\"\n assert foo(1, 2, kwargs=4, e=5) == \"a=1, b=2, args=(), d=3, kwargs={'kwargs': 4, 'e': 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_pydantic__pydantic/tests/test_decorator.py_test_field_can_provide_factory_test_annotated_field_can_provide_factory.assert_foo2_1_100": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_field_can_provide_factory_test_annotated_field_can_provide_factory.assert_foo2_1_100", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 149, "span_ids": ["test_annotated_field_can_provide_factory", "test_field_can_provide_factory"], "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 test_field_can_provide_factory() -> None:\n @validate_arguments\n def foo(a: int, b: int = Field(default_factory=lambda: 99), *args: int) -> int:\n \"\"\"mypy is happy with this\"\"\"\n return a + b + sum(args)\n\n assert foo(3) == 102\n assert foo(1, 2, 3) == 6\n\n\n@pytest.mark.xfail(reason='Using Annotated to get a field default is not working properly yet')\ndef test_annotated_field_can_provide_factory() -> None:\n @validate_arguments\n def foo2(a: int, b: Annotated[int, Field(default_factory=lambda: 99)], *args: int) -> int:\n \"\"\"mypy reports Incompatible default for argument \"b\" if we don't supply ANY as default\"\"\"\n return a + b + sum(args)\n\n assert foo2(1) == 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_pydantic__pydantic/tests/test_decorator.py_test_positional_only_test_positional_only.None_1.module_foo_a_1_b_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_positional_only_test_positional_only.None_1.module_foo_a_1_b_2_", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 152, "end_line": 170, "span_ids": ["test_positional_only"], "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": "@skip_pre_38\ndef test_positional_only(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import validate_arguments\n\n@validate_arguments\ndef foo(a, b, /, c=None):\n return f'{a}, {b}, {c}'\n\"\"\"\n )\n assert module.foo(1, 2) == '1, 2, None'\n assert module.foo(1, 2, 44) == '1, 2, 44'\n assert module.foo(1, 2, c=44) == '1, 2, 44'\n with pytest.raises(TypeError, match=\"positional-only argument passed as keyword argument: 'b'\"):\n module.foo(1, b=2)\n with pytest.raises(TypeError, match=\"positional-only arguments passed as keyword arguments: 'a', 'b'\"):\n module.foo(a=1, b=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_pydantic__pydantic/tests/test_decorator.py_test_args_name_test_args_name.None_2.foo_1_2_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_args_name_test_args_name.None_2.foo_1_2_3_", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 188, "span_ids": ["test_args_name"], "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 test_args_name():\n @validate_arguments\n def foo(args: int, kwargs: int):\n return f'args={args!r}, kwargs={kwargs!r}'\n\n assert foo.model.model_fields.keys() == {'args', 'kwargs', 'v__args', 'v__kwargs', 'v__duplicate_kwargs'}\n assert foo(1, 2) == 'args=1, kwargs=2'\n\n with pytest.raises(TypeError, match=\"unexpected keyword argument: 'apple'\"):\n foo(1, 2, apple=4)\n\n with pytest.raises(TypeError, match=\"unexpected keyword arguments: 'apple', 'banana'\"):\n foo(1, 2, apple=4, banana=5)\n\n with pytest.raises(TypeError, match='2 positional arguments expected but 3 given'):\n foo(1, 2, 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_pydantic__pydantic/tests/test_decorator.py_test_v_args_test_v_args.None_3.foo4.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_v_args_test_v_args.None_3.foo4.pass", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 191, "end_line": 226, "span_ids": ["test_v_args"], "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 test_v_args():\n with pytest.raises(\n PydanticUserError,\n match='\"v__args\", \"v__kwargs\", \"v__positional_only\" and \"v__duplicate_kwargs\" are not permitted',\n ):\n\n @validate_arguments\n def foo1(v__args: int):\n pass\n\n with pytest.raises(\n PydanticUserError,\n match='\"v__args\", \"v__kwargs\", \"v__positional_only\" and \"v__duplicate_kwargs\" are not permitted',\n ):\n\n @validate_arguments\n def foo2(v__kwargs: int):\n pass\n\n with pytest.raises(\n PydanticUserError,\n match='\"v__args\", \"v__kwargs\", \"v__positional_only\" and \"v__duplicate_kwargs\" are not permitted',\n ):\n\n @validate_arguments\n def foo3(v__positional_only: int):\n pass\n\n with pytest.raises(\n PydanticUserError,\n match='\"v__args\", \"v__kwargs\", \"v__positional_only\" and \"v__duplicate_kwargs\" are not permitted',\n ):\n\n @validate_arguments\n def foo4(v__duplicate_kwargs: int):\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_pydantic__pydantic/tests/test_decorator.py_test_async_test_async.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_async_test_async.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 241, "span_ids": ["test_async"], "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 test_async():\n @validate_arguments\n async def foo(a, b):\n return f'a={a} b={b}'\n\n async def run():\n v = await foo(1, 2)\n assert v == 'a=1 b=2'\n\n asyncio.run(run())\n with pytest.raises(ValidationError) as exc_info:\n asyncio.run(foo('x'))\n assert exc_info.value.errors() == [{'input': {'a': 'x'}, 'loc': ('b',), 'msg': 'Field required', 'type': '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_pydantic__pydantic/tests/test_decorator.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 244, "end_line": 261, "span_ids": ["test_string_annotation"], "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 test_string_annotation():\n @validate_arguments\n def foo(a: 'List[int]', b: 'Path'):\n return f'a={a!r} b={b!r}'\n\n assert foo([1, 2, 3], '/')\n\n with pytest.raises(ValidationError) as exc_info:\n foo(['x'])\n assert exc_info.value.errors() == [\n {\n 'input': 'x',\n 'loc': ('a', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {'input': {'a': ['x']}, 'loc': ('b',), 'msg': 'Field required', 'type': 'missing'},\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_pydantic__pydantic/tests/test_decorator.py_test_item_method_test_item_method.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_item_method_test_item_method.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 284, "span_ids": ["test_item_method"], "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 test_item_method():\n class X:\n def __init__(self, v):\n self.v = v\n\n @validate_arguments\n def foo(self, a: int, b: int):\n assert self.v == a\n return f'{a}, {b}'\n\n x = X(4)\n assert x.foo(4, 2) == '4, 2'\n assert x.foo(*[4, 2]) == '4, 2'\n\n with pytest.raises(ValidationError) as exc_info:\n x.foo()\n\n assert exc_info.value.errors() == [\n {'input': {'self': IsInstance(X)}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {'self': IsInstance(X)}, 'loc': ('b',), 'msg': 'Field required', 'type': 'missing'},\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_pydantic__pydantic/tests/test_decorator.py_test_class_method_test_class_method.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_class_method_test_class_method.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 305, "span_ids": ["test_class_method"], "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 test_class_method():\n class X:\n @classmethod\n @validate_arguments\n def foo(cls, a: int, b: int):\n assert cls == X\n return f'{a}, {b}'\n\n x = X()\n assert x.foo(4, 2) == '4, 2'\n assert x.foo(*[4, 2]) == '4, 2'\n\n with pytest.raises(ValidationError) as exc_info:\n x.foo()\n\n assert exc_info.value.errors() == [\n {'input': {'cls': X}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {'cls': X}, 'loc': ('b',), 'msg': 'Field required', 'type': 'missing'},\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_pydantic__pydantic/tests/test_decorator.py_test_config_title_test_config_fields.with_pytest_raises_Pydant.foo.return.f_a_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_config_title_test_config_fields.with_pytest_raises_Pydant.foo.return.f_a_b_", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 308, "end_line": 336, "span_ids": ["test_config_fields", "test_config_title", "test_config_title_cls"], "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 test_config_title():\n @validate_arguments(config=dict(title='Testing'))\n def foo(a: int, b: int):\n return f'{a}, {b}'\n\n assert foo(1, 2) == '1, 2'\n assert foo(1, b=2) == '1, 2'\n assert foo.model.model_json_schema()['title'] == 'Testing'\n\n\ndef test_config_title_cls():\n class Config:\n title = 'Testing'\n\n @validate_arguments(config={'title': 'Testing'})\n def foo(a: int, b: int):\n return f'{a}, {b}'\n\n assert foo(1, 2) == '1, 2'\n assert foo(1, b=2) == '1, 2'\n assert foo.model.model_json_schema()['title'] == 'Testing'\n\n\ndef test_config_fields():\n with pytest.raises(PydanticUserError, match='Setting the \"alias_generator\" property on custom Config for @'):\n\n @validate_arguments(config=dict(alias_generator=lambda x: x))\n def foo(a: int, b: int):\n return f'{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_pydantic__pydantic/tests/test_decorator.py_test_config_arbitrary_types_allowed_test_validate.stub_assert_not_called_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_config_arbitrary_types_allowed_test_validate.stub_assert_not_called_", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 339, "end_line": 374, "span_ids": ["test_validate", "test_config_arbitrary_types_allowed"], "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 test_config_arbitrary_types_allowed():\n class EggBox:\n def __str__(self) -> str:\n return 'EggBox()'\n\n @validate_arguments(config=dict(arbitrary_types_allowed=True))\n def foo(a: int, b: EggBox):\n return f'{a}, {b}'\n\n assert foo(1, EggBox()) == '1, EggBox()'\n with pytest.raises(ValidationError) as exc_info:\n assert foo(1, 2) == '1, 2'\n\n assert exc_info.value.errors() == [\n {\n 'ctx': {'class': 'test_config_arbitrary_types_allowed..EggBox'},\n 'input': 2,\n 'loc': ('b',),\n 'msg': 'Input should be an instance of ' 'test_config_arbitrary_types_allowed..EggBox',\n 'type': 'is_instance_of',\n }\n ]\n\n\ndef test_validate(mocker):\n stub = mocker.stub(name='on_something_stub')\n\n @validate_arguments\n def func(s: str, count: int, *, separator: bytes = b''):\n stub(s, count, separator)\n\n func.validate('qwe', 2)\n with pytest.raises(ValidationError):\n func.validate(['qwe'], 2)\n\n stub.assert_not_called()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_annotated_use_of_alias_test_annotated_use_of_alias.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_annotated_use_of_alias_test_annotated_use_of_alias.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 377, "end_line": 393, "span_ids": ["test_annotated_use_of_alias"], "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": "@pytest.mark.xfail(reason='Annotated does not seem to be respected')\ndef test_annotated_use_of_alias():\n @validate_arguments\n def foo(a: Annotated[int, Field(alias='b')], c: Annotated[int, Field()], d: Annotated[int, Field(alias='')]):\n return a + c + d\n\n assert foo(**{'b': 10, 'c': 12, '': 1}) == 23\n\n with pytest.raises(ValidationError) as exc_info:\n assert foo(a=10, c=12, d=1) == 10\n\n assert exc_info.value.errors() == [\n {'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'},\n {'loc': ('',), 'msg': 'field required', 'type': 'value_error.missing'},\n {'loc': ('a',), 'msg': 'extra fields not permitted', 'type': 'value_error.extra'},\n {'loc': ('d',), 'msg': 'extra fields not permitted', 'type': 'value_error.extra'},\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_pydantic__pydantic/tests/test_decorator.py_test_use_of_alias_test_validate_all.assert_foo_0_datetime": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_use_of_alias_test_validate_all.assert_foo_0_datetime", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 396, "end_line": 422, "span_ids": ["test_use_of_alias", "test_validate_all", "test_populate_by_name"], "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 test_use_of_alias():\n @validate_arguments\n def foo(c: int = Field(default_factory=lambda: 20), a: int = Field(default_factory=lambda: 10, alias='b')):\n return a + c\n\n assert foo(b=10) == 30\n\n\ndef test_populate_by_name():\n @validate_arguments(config=dict(populate_by_name=True))\n def foo(a: Annotated[int, Field(alias='b')], c: Annotated[int, Field(alias='d')]):\n return a + c\n\n assert foo(a=10, d=1) == 11\n assert foo(b=10, c=1) == 11\n assert foo(a=10, c=1) == 11\n\n\n@pytest.mark.xfail(reason='validate_all')\ndef test_validate_all():\n # TODO remove or rename, validate_all doesn't exist anymore\n @validate_arguments(config=dict(validate_all=True))\n def foo(dt: datetime = Field(default_factory=lambda: 946684800)):\n return dt\n\n assert foo() == datetime(2000, 1, 1, tzinfo=timezone.utc)\n assert foo(0) == datetime(1970, 1, 1, tzinfo=timezone.utc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_validate_all_positional_test_validate_all_positional.assert_module_foo_0_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_validate_all_positional_test_validate_all_positional.assert_module_foo_0_d", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 425, "end_line": 442, "span_ids": ["test_validate_all_positional"], "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": "@pytest.mark.xfail(reason='validate_all')\n@skip_pre_38\ndef test_validate_all_positional(create_module):\n # TODO remove or rename, validate_all doesn't exist anymore\n module = create_module(\n # language=Python\n \"\"\"\nfrom datetime import datetime\n\nfrom pydantic import Field, validate_arguments\n\n@validate_arguments(config=dict(validate_all=True))\ndef foo(dt: datetime = Field(default_factory=lambda: 946684800), /):\n return dt\n\"\"\"\n )\n assert module.foo() == datetime(2000, 1, 1, tzinfo=timezone.utc)\n assert module.foo(0) == datetime(1970, 1, 1, tzinfo=timezone.utc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_validate_extra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorator.py_test_validate_extra_", "embedding": null, "metadata": {"file_path": "tests/test_decorator.py", "file_name": "test_decorator.py", "file_type": "text/x-python", "category": "test", "start_line": 445, "end_line": 461, "span_ids": ["test_validate_extra"], "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": "@pytest.mark.xfail(reason='config[\"extra\"] does not seem to be respected')\ndef test_validate_extra():\n class TypedTest(TypedDict):\n y: str\n\n @validate_arguments(config={'extra': Extra.allow})\n def test(other: TypedTest):\n return other\n\n assert test(other={'y': 'b', 'z': 'a'}) == {'y': 'b', 'z': 'a'}\n\n @validate_arguments(config={'extra': Extra.ignore})\n def test(other: TypedTest):\n return other\n\n assert test(other={'y': 'b', 'z': 'a'}) == {'y': '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_pydantic__pydantic/tests/test_deprecated.py_platform_deprecated_from_orm.with_pytest_warns_.return.model_type_from_orm_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_platform_deprecated_from_orm.with_pytest_warns_.return.model_type_from_orm_obj_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 19, "span_ids": ["imports", "deprecated_from_orm"], "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": "import platform\nimport re\nfrom types import SimpleNamespace\nfrom typing import Dict, List\n\nimport pytest\n\nfrom pydantic import BaseModel, ConfigDict, PydanticUserError, ValidationError, model_serializer, root_validator\n\n\ndef deprecated_from_orm(model_type, obj):\n with pytest.warns(\n DeprecationWarning,\n match=re.escape(\n 'The `from_orm` method is deprecated; set model_config[\"from_attributes\"]=True '\n 'and use `model_validate` instead.'\n ),\n ):\n return model_type.from_orm(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_pydantic__pydantic/tests/test_deprecated.py_test_getdict_test_getdict.assert_repr_gd_Gette": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_getdict_test_getdict.assert_repr_gd_Gette", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 22, "end_line": 62, "span_ids": ["test_getdict"], "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": "@pytest.mark.xfail(reason='working on V2')\ndef test_getdict():\n class TestCls:\n a = 1\n b: int\n\n def __init__(self):\n self.c = 3\n\n @property\n def d(self):\n return 4\n\n def __getattr__(self, key):\n if key == 'e':\n return 5\n else:\n raise AttributeError()\n\n t = TestCls()\n # gd = GetterDict(t)\n gd = object(t)\n assert gd.keys() == ['a', 'c', 'd']\n assert gd.get('a') == 1\n assert gd['a'] == 1\n with pytest.raises(KeyError):\n assert gd['foobar']\n assert gd.get('b', None) is None\n assert gd.get('b', 1234) == 1234\n assert gd.get('c', None) == 3\n assert gd.get('d', None) == 4\n assert gd.get('e', None) == 5\n assert gd.get('f', 'missing') == 'missing'\n assert list(gd.values()) == [1, 3, 4]\n assert list(gd.items()) == [('a', 1), ('c', 3), ('d', 4)]\n assert list(gd) == ['a', 'c', 'd']\n assert gd == {'a': 1, 'c': 3, 'd': 4}\n assert 'a' in gd\n assert len(gd) == 3\n assert str(gd) == \"{'a': 1, 'c': 3, 'd': 4}\"\n assert repr(gd) == \"GetterDict[TestCls]({'a': 1, 'c': 3, 'd': 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_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root_test_from_attributes_root.PokemonList.model_config.ConfigDict_from_attribute": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root_test_from_attributes_root.PokemonList.model_config.ConfigDict_from_attribute", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 96, "span_ids": ["test_from_attributes_root"], "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 test_from_attributes_root():\n class PokemonCls:\n def __init__(self, *, en_name: str, jp_name: str):\n self.en_name = en_name\n self.jp_name = jp_name\n\n class Pokemon(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n en_name: str\n jp_name: str\n\n class PokemonList(BaseModel):\n root: List[Pokemon]\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n model_config = ConfigDict(from_attributes=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_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root.pika_test_from_attributes_root.assert_pokemons_root_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root.pika_test_from_attributes_root.assert_pokemons_root_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 105, "span_ids": ["test_from_attributes_root"], "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": "def test_from_attributes_root():\n # ... other code\n\n pika = PokemonCls(en_name='Pikachu', jp_name='\u30d4\u30ab\u30c1\u30e5\u30a6')\n bulbi = PokemonCls(en_name='Bulbasaur', jp_name='\u30d5\u30b7\u30ae\u30c0\u30cd')\n\n pokemons = deprecated_from_orm(PokemonList, [pika, bulbi])\n assert pokemons.root == [\n Pokemon(en_name='Pikachu', jp_name='\u30d4\u30ab\u30c1\u30e5\u30a6'),\n Pokemon(en_name='Bulbasaur', jp_name='\u30d5\u30b7\u30ae\u30c0\u30cd'),\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_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root.PokemonDict_test_from_attributes_root.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root.PokemonDict_test_from_attributes_root.None_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 132, "span_ids": ["test_from_attributes_root"], "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 test_from_attributes_root():\n # ... other code\n\n class PokemonDict(BaseModel):\n root: Dict[str, Pokemon]\n model_config = ConfigDict(from_attributes=True)\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n pokemons = deprecated_from_orm(PokemonDict, {'pika': pika, 'bulbi': bulbi})\n assert pokemons.root == {\n 'pika': Pokemon(en_name='Pikachu', jp_name='\u30d4\u30ab\u30c1\u30e5\u30a6'),\n 'bulbi': Pokemon(en_name='Bulbasaur', jp_name='\u30d5\u30b7\u30ae\u30c0\u30cd'),\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_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_test_from_attributes.assert_anna_model_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_test_from_attributes.assert_anna_model_model_d", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 135, "end_line": 168, "span_ids": ["test_from_attributes"], "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 test_from_attributes():\n class PetCls:\n def __init__(self, *, name: str, species: str):\n self.name = name\n self.species = species\n\n class PersonCls:\n def __init__(self, *, name: str, age: float = None, pets: List[PetCls]):\n self.name = name\n self.age = age\n self.pets = pets\n\n class Pet(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n name: str\n species: str\n\n class Person(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n name: str\n age: float = None\n pets: List[Pet]\n\n bones = PetCls(name='Bones', species='dog')\n orion = PetCls(name='Orion', species='cat')\n anna = PersonCls(name='Anna', age=20, pets=[bones, orion])\n\n anna_model = deprecated_from_orm(Person, anna)\n\n assert anna_model.model_dump() == {\n 'name': 'Anna',\n 'pets': [{'name': 'Bones', 'species': 'dog'}, {'name': 'Orion', 'species': 'cat'}],\n 'age': 20.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_pydantic__pydantic/tests/test_deprecated.py_test_not_from_attributes_test_object_with_getattr.with_pytest_raises_Valida.deprecated_from_orm_Model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_not_from_attributes_test_object_with_getattr.with_pytest_raises_Valida.deprecated_from_orm_Model", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 171, "end_line": 204, "span_ids": ["test_object_with_getattr", "test_not_from_attributes"], "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 test_not_from_attributes():\n class Pet(BaseModel):\n name: str\n species: str\n\n with pytest.raises(PydanticUserError):\n deprecated_from_orm(Pet, None)\n\n\ndef test_object_with_getattr():\n class FooGetAttr:\n def __getattr__(self, key: str):\n if key == 'foo':\n return 'Foo'\n else:\n raise AttributeError\n\n class Model(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n foo: str\n bar: int = 1\n\n class ModelInvalid(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n foo: str\n bar: int\n\n foo = FooGetAttr()\n model = deprecated_from_orm(Model, foo)\n assert model.foo == 'Foo'\n assert model.bar == 1\n assert model.model_dump(exclude_unset=True) == {'foo': 'Foo'}\n with pytest.raises(ValidationError):\n deprecated_from_orm(ModelInvalid, 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_pydantic__pydantic/tests/test_deprecated.py_test_properties_test_extra_forbid.assert_model_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_properties_test_extra_forbid.assert_model_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 207, "end_line": 250, "span_ids": ["test_extra_allow", "test_properties", "test_extra_forbid"], "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 test_properties():\n class XyProperty:\n x = 4\n\n @property\n def y(self):\n return '5'\n\n class Model(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n x: int\n y: int\n\n model = deprecated_from_orm(Model, XyProperty())\n assert model.x == 4\n assert model.y == 5\n\n\n@pytest.mark.xfail(reason='working on V2')\ndef test_extra_allow():\n class TestCls:\n x = 1\n y = 2\n\n class Model(BaseModel):\n model_config = ConfigDict(from_attributes=True, extra='allow')\n x: int\n\n model = deprecated_from_orm(Model, TestCls())\n assert model.model_dump() == {'x': 1}\n\n\n@pytest.mark.xfail(reason='working on V2')\ndef test_extra_forbid():\n class TestCls:\n x = 1\n y = 2\n\n class Model(BaseModel):\n model_config = ConfigDict(from_attributes=True, extra='forbid')\n x: int\n\n model = deprecated_from_orm(Model, TestCls())\n assert model.model_dump() == {'x': 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_pydantic__pydantic/tests/test_deprecated.py_test_root_validator_test_root_validator.assert_validator_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_root_validator_test_root_validator.assert_validator_value_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 253, "end_line": 276, "span_ids": ["test_root_validator"], "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": "@pytest.mark.xfail(reason='working on V2')\ndef test_root_validator():\n validator_value = None\n\n class TestCls:\n x = 1\n y = 2\n\n class Model(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n x: int\n y: int\n z: int\n\n @root_validator(pre=True)\n def change_input_data(cls, value):\n nonlocal validator_value\n validator_value = value\n return {**value, 'z': value['x'] + value['y']}\n\n model = deprecated_from_orm(Model, TestCls())\n assert model.model_dump() == {'x': 1, 'y': 2, 'z': 3}\n # assert isinstance(validator_value, GetterDict)\n assert validator_value == {'x': 1, 'y': 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_pydantic__pydantic/tests/test_deprecated.py_test_custom_getter_dict_test_custom_getter_dict.assert_model_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_custom_getter_dict_test_custom_getter_dict.assert_model_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 279, "end_line": 298, "span_ids": ["test_custom_getter_dict"], "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": "@pytest.mark.xfail(reason='working on V2')\ndef test_custom_getter_dict():\n class TestCls:\n x = 1\n y = 2\n\n def custom_getter_dict(obj):\n assert isinstance(obj, TestCls)\n return {'x': 42, 'y': 24}\n\n class Model(BaseModel):\n x: int\n y: int\n\n class Config:\n from_attributes = True\n getter_dict = custom_getter_dict\n\n model = deprecated_from_orm(Model, TestCls())\n assert model.model_dump() == {'x': 42, 'y': 24}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_recursive_parsing_test_recursive_parsing.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_recursive_parsing_test_recursive_parsing.None_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 301, "end_line": 333, "span_ids": ["test_recursive_parsing"], "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": "@pytest.mark.xfail(reason='working on V2')\ndef test_recursive_parsing():\n class Getter: # GetterDict\n # try to read the modified property name\n # either as an attribute or as a key\n def get(self, key, default):\n key = key + key\n try:\n v = self._obj[key]\n return Getter(v) if isinstance(v, dict) else v\n except TypeError:\n return getattr(self._obj, key, default)\n except KeyError:\n return default\n\n class Model(BaseModel):\n class Config:\n from_attributes = True\n getter_dict = Getter\n\n class ModelA(Model):\n a: int\n\n class ModelB(Model):\n b: ModelA\n\n # test recursive parsing with object attributes\n dct = dict(bb=SimpleNamespace(aa=1))\n assert deprecated_from_orm(ModelB, dct) == ModelB(b=ModelA(a=1))\n\n # test recursive parsing with dict keys\n obj = dict(bb=dict(aa=1))\n assert deprecated_from_orm(ModelB, obj) == ModelB(b=ModelA(a=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_pydantic__pydantic/tests/test_deprecated.py_test_nested_orm_test_parse_raw_pass.assert_model_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_nested_orm_test_parse_raw_pass.assert_model_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 336, "end_line": 360, "span_ids": ["test_nested_orm", "test_parse_raw_pass"], "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 test_nested_orm():\n class User(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n first_name: str\n last_name: str\n\n class State(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n user: User\n\n # Pass an \"orm instance\"\n deprecated_from_orm(State, SimpleNamespace(user=SimpleNamespace(first_name='John', last_name='Appleseed')))\n\n # Pass dictionary data directly\n State(**{'user': {'first_name': 'John', 'last_name': 'Appleseed'}})\n\n\ndef test_parse_raw_pass():\n class Model(BaseModel):\n x: int\n y: int\n\n with pytest.warns(DeprecationWarning, match='The `parse_raw` method is deprecated'):\n model = Model.parse_raw('{\"x\": 1, \"y\": 2}')\n assert model.model_dump() == {'x': 1, 'y': 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_pydantic__pydantic/tests/test_deprecated.py_test_parse_raw_pass_fail_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_parse_raw_pass_fail_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 363, "end_line": 382, "span_ids": ["test_parse_raw_pass_fail"], "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": "@pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason='Different error str on PyPy')\ndef test_parse_raw_pass_fail():\n class Model(BaseModel):\n x: int\n y: int\n\n with pytest.warns(DeprecationWarning, match='The `parse_raw` method is deprecated'):\n with pytest.raises(ValidationError, match='1 validation error for Model') as exc_info:\n Model.parse_raw('invalid')\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error.jsondecode',\n 'loc': ('__root__',),\n 'msg': 'Expecting value: line 1 column 1 (char 0)',\n 'input': 'invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_re_test_discriminated_union_literal_discriminator.with_pytest_raises_Pydant.Model.number": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_re_test_discriminated_union_literal_discriminator.with_pytest_raises_Pydant.Model.number", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 71, "span_ids": ["test_discriminated_union_literal_discriminator", "imports", "test_discriminated_union_single_variant", "test_discriminated_union_invalid_type", "test_discriminated_union_only_union", "test_discriminated_union_defined_discriminator"], "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": "import re\nimport sys\nfrom enum import Enum, IntEnum\nfrom typing import Generic, Optional, TypeVar, Union\n\nimport pytest\nfrom dirty_equals import HasRepr, IsStr\nfrom pydantic_core import SchemaValidator, core_schema\nfrom typing_extensions import Annotated, Literal\n\nfrom pydantic import AnalyzedType, BaseModel, ConfigDict, Field, ValidationError\nfrom pydantic._internal._discriminated_union import apply_discriminator\nfrom pydantic.errors import PydanticUserError\n\n\ndef test_discriminated_union_only_union():\n with pytest.raises(\n TypeError, match='`discriminator` can only be used with `Union` type with more than one variant'\n ):\n\n class Model(BaseModel):\n x: str = Field(..., discriminator='qwe')\n\n\ndef test_discriminated_union_single_variant():\n with pytest.raises(\n TypeError, match='`discriminator` can only be used with `Union` type with more than one variant'\n ):\n\n class Model(BaseModel):\n x: Union[str] = Field(..., discriminator='qwe')\n\n\ndef test_discriminated_union_invalid_type():\n with pytest.raises(\n TypeError, match=\"'str' is not a valid discriminated union variant; should be a `BaseModel` or `dataclass`\"\n ):\n\n class Model(BaseModel):\n x: Union[str, int] = Field(..., discriminator='qwe')\n\n\ndef test_discriminated_union_defined_discriminator():\n class Cat(BaseModel):\n c: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n d: str\n\n with pytest.raises(PydanticUserError, match=\"Model 'Cat' needs a discriminator field for key 'pet_type'\"):\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(..., discriminator='pet_type')\n number: int\n\n\ndef test_discriminated_union_literal_discriminator():\n class Cat(BaseModel):\n pet_type: int\n c: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n d: str\n\n with pytest.raises(PydanticUserError, match=\"Model 'Cat' needs field 'pet_type' to be of type `Literal`\"):\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(..., discriminator='pet_type')\n number: 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_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_root_same_discriminator_test_discriminated_union_root_same_discriminator.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_root_same_discriminator_test_discriminated_union_root_same_discriminator.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 101, "span_ids": ["test_discriminated_union_root_same_discriminator"], "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": "def test_discriminated_union_root_same_discriminator():\n class BlackCat(BaseModel):\n pet_type: Literal['blackcat']\n\n class WhiteCat(BaseModel):\n pet_type: Literal['whitecat']\n\n Cat = Union[BlackCat, WhiteCat]\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n\n CatDog = AnalyzedType(Annotated[Union[Cat, Dog], Field(..., discriminator='pet_type')]).validate_python\n CatDog({'pet_type': 'blackcat'})\n CatDog({'pet_type': 'whitecat'})\n CatDog({'pet_type': 'dog'})\n with pytest.raises(ValidationError) as exc_info:\n CatDog({'pet_type': 'llama'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\", 'expected_tags': \"'blackcat', 'whitecat', 'dog'\", 'tag': 'llama'},\n 'input': {'pet_type': 'llama'},\n 'loc': (),\n 'msg': \"Input tag 'llama' found using 'pet_type' does not match any of the \"\n \"expected tags: 'blackcat', 'whitecat', 'dog'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_validation_test_discriminated_union_validation.None_4.Model_model_validate_pe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_validation_test_discriminated_union_validation.None_4.Model_model_validate_pe", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 182, "span_ids": ["test_discriminated_union_validation"], "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": "def test_discriminated_union_validation():\n class BlackCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['black']\n black_infos: str\n\n class WhiteCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['white']\n white_infos: str\n\n Cat = Annotated[Union[BlackCat, WhiteCat], Field(discriminator='color')]\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n d: str\n\n class Lizard(BaseModel):\n pet_type: Literal['reptile', 'lizard']\n m: str\n\n class Model(BaseModel):\n pet: Annotated[Union[Cat, Dog, Lizard], Field(discriminator='pet_type')]\n number: int\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_typ': 'cat'}, 'number': 'x'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\"},\n 'input': {'pet_typ': 'cat'},\n 'loc': ('pet',),\n 'msg': \"Unable to extract tag using discriminator 'pet_type'\",\n 'type': 'union_tag_not_found',\n },\n {\n 'input': 'x',\n 'loc': ('number',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': 'fish', 'number': 2})\n assert exc_info.value.errors() == [\n {\n 'input': 'fish',\n 'loc': ('pet',),\n 'msg': 'Input should be a valid dictionary or instance to extract fields ' 'from',\n 'type': 'dict_attributes_type',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'fish'}, 'number': 2})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\", 'expected_tags': \"'cat', 'dog', 'reptile', 'lizard'\", 'tag': 'fish'},\n 'input': {'pet_type': 'fish'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'fish' found using 'pet_type' does not match any of the \"\n \"expected tags: 'cat', 'dog', 'reptile', 'lizard'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'lizard'}, 'number': 2})\n assert exc_info.value.errors() == [\n {'input': {'pet_type': 'lizard'}, 'loc': ('pet', 'lizard', 'm'), 'msg': 'Field required', 'type': 'missing'}\n ]\n\n m = Model.model_validate({'pet': {'pet_type': 'lizard', 'm': 'pika'}, 'number': 2})\n assert isinstance(m.pet, Lizard)\n assert m.model_dump() == {'pet': {'pet_type': 'lizard', 'm': 'pika'}, 'number': 2}\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'cat', 'color': 'white'}, 'number': 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_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_validation.None_6_test_discriminated_union_validation.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_validation.None_6_test_discriminated_union_validation.None_7", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 183, "end_line": 192, "span_ids": ["test_discriminated_union_validation"], "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 test_discriminated_union_validation():\n # ... other code\n assert exc_info.value.errors() == [\n {\n 'input': {'color': 'white', 'pet_type': 'cat'},\n 'loc': ('pet', 'cat', 'white', 'white_infos'),\n 'msg': 'Field required',\n 'type': 'missing',\n }\n ]\n m = Model.model_validate({'pet': {'pet_type': 'cat', 'color': 'white', 'white_infos': 'pika'}, 'number': 2})\n assert isinstance(m.pet, WhiteCat)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_annotated_union_test_discriminated_annotated_union.None_4.Model_model_validate_pe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_annotated_union_test_discriminated_annotated_union.None_4.Model_model_validate_pe", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 269, "span_ids": ["test_discriminated_annotated_union"], "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": "def test_discriminated_annotated_union():\n class BlackCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['black']\n black_infos: str\n\n class WhiteCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['white']\n white_infos: str\n\n Cat = Annotated[Union[BlackCat, WhiteCat], Field(discriminator='color')]\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n dog_name: str\n\n Pet = Annotated[Union[Cat, Dog], Field(discriminator='pet_type')]\n\n class Model(BaseModel):\n pet: Pet\n number: int\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_typ': 'cat'}, 'number': 'x'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\"},\n 'input': {'pet_typ': 'cat'},\n 'loc': ('pet',),\n 'msg': \"Unable to extract tag using discriminator 'pet_type'\",\n 'type': 'union_tag_not_found',\n },\n {\n 'input': 'x',\n 'loc': ('number',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'fish'}, 'number': 2})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\", 'expected_tags': \"'cat', 'dog'\", 'tag': 'fish'},\n 'input': {'pet_type': 'fish'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'fish' found using 'pet_type' does not match any of the \" \"expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'dog'}, 'number': 2})\n assert exc_info.value.errors() == [\n {'input': {'pet_type': 'dog'}, 'loc': ('pet', 'dog', 'dog_name'), 'msg': 'Field required', 'type': 'missing'}\n ]\n m = Model.model_validate({'pet': {'pet_type': 'dog', 'dog_name': 'milou'}, 'number': 2})\n assert isinstance(m.pet, Dog)\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'cat', 'color': 'red'}, 'number': 2})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'color'\", 'expected_tags': \"'black', 'white'\", 'tag': 'red'},\n 'input': {'color': 'red', 'pet_type': 'cat'},\n 'loc': ('pet', 'cat'),\n 'msg': \"Input tag 'red' found using 'color' does not match any of the \" \"expected tags: 'black', 'white'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'pet': {'pet_type': 'cat', 'color': 'white'}, 'number': 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_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_annotated_union.None_5_test_discriminated_union_basemodel_instance_value.assert_isinstance_t_Top_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_annotated_union.None_5_test_discriminated_union_basemodel_instance_value.assert_isinstance_t_Top_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 270, "end_line": 293, "span_ids": ["test_discriminated_union_basemodel_instance_value", "test_discriminated_annotated_union"], "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 test_discriminated_annotated_union():\n # ... other code\n assert exc_info.value.errors() == [\n {\n 'input': {'color': 'white', 'pet_type': 'cat'},\n 'loc': ('pet', 'cat', 'white', 'white_infos'),\n 'msg': 'Field required',\n 'type': 'missing',\n }\n ]\n m = Model.model_validate({'pet': {'pet_type': 'cat', 'color': 'white', 'white_infos': 'pika'}, 'number': 2})\n assert isinstance(m.pet, WhiteCat)\n\n\ndef test_discriminated_union_basemodel_instance_value():\n class A(BaseModel):\n foo: Literal['a']\n\n class B(BaseModel):\n foo: Literal['b']\n\n class Top(BaseModel):\n sub: Union[A, B] = Field(..., discriminator='foo')\n\n t = Top(sub=A(foo='a'))\n assert isinstance(t, Top)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_basemodel_instance_value_with_alias_test_discriminated_union_basemodel_instance_value_with_alias.assert_Top_sub_B_literal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_basemodel_instance_value_with_alias_test_discriminated_union_basemodel_instance_value_with_alias.assert_Top_sub_B_literal_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 296, "end_line": 317, "span_ids": ["test_discriminated_union_basemodel_instance_value_with_alias"], "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 test_discriminated_union_basemodel_instance_value_with_alias():\n class A(BaseModel):\n literal: Literal['a'] = Field(alias='lit')\n\n class B(BaseModel):\n model_config = ConfigDict(populate_by_name=True)\n literal: Literal['b'] = Field(alias='lit')\n\n class Top(BaseModel):\n sub: Union[A, B] = Field(..., discriminator='literal')\n\n with pytest.raises(ValidationError) as exc_info:\n Top(sub=A(literal='a'))\n # TODO: Adding this note here that we should make sure the produced error messages for DiscriminatedUnion\n # have the same behavior as elsewhere when aliases are involved.\n # (I.e., possibly using the alias value as the 'loc')\n assert exc_info.value.errors() == [\n {'input': {'literal': 'a'}, 'loc': ('lit',), 'msg': 'Field required', 'type': 'missing'}\n ]\n assert Top(sub=A(lit='a')).sub.literal == 'a'\n assert Top(sub=B(lit='b')).sub.literal == 'b'\n assert Top(sub=B(literal='b')).sub.literal == '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_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_int_test_discriminated_union_int.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_int_test_discriminated_union_int.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 320, "end_line": 341, "span_ids": ["test_discriminated_union_int"], "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 test_discriminated_union_int():\n class A(BaseModel):\n m: Literal[1]\n\n class B(BaseModel):\n m: Literal[2]\n\n class Top(BaseModel):\n sub: Union[A, B] = Field(..., discriminator='m')\n\n assert isinstance(Top.model_validate({'sub': {'m': 2}}).sub, B)\n with pytest.raises(ValidationError) as exc_info:\n Top.model_validate({'sub': {'m': 3}})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'m'\", 'expected_tags': '1, 2', 'tag': '3'},\n 'input': {'m': 3},\n 'loc': ('sub',),\n 'msg': \"Input tag '3' found using 'm' does not match any of the expected \" \"tags: 1, 2\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_FooIntEnum_if_sys_version_info_3.ENUM_TEST_CASES_append_S": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_FooIntEnum_if_sys_version_info_3.ENUM_TEST_CASES_append_S", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 344, "end_line": 362, "span_ids": ["FooStrEnum", "impl", "FooIntEnum"], "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 FooIntEnum(int, Enum):\n pass\n\n\nclass FooStrEnum(str, Enum):\n pass\n\n\nENUM_TEST_CASES = [\n pytest.param(Enum, {'a': 1, 'b': 2}, marks=pytest.mark.xfail(reason='Plain Enum not yet supported')),\n pytest.param(Enum, {'a': 'v_a', 'b': 'v_b'}, marks=pytest.mark.xfail(reason='Plain Enum not yet supported')),\n (FooIntEnum, {'a': 1, 'b': 2}),\n (IntEnum, {'a': 1, 'b': 2}),\n (FooStrEnum, {'a': 'v_a', 'b': 'v_b'}),\n]\nif sys.version_info >= (3, 11):\n from enum import StrEnum\n\n ENUM_TEST_CASES.append((StrEnum, {'a': 'v_a', 'b': 'v_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_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_enum_test_discriminated_union_enum.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_enum_test_discriminated_union_enum.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 365, "end_line": 392, "span_ids": ["test_discriminated_union_enum"], "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": "@pytest.mark.parametrize('base_class,choices', ENUM_TEST_CASES)\ndef test_discriminated_union_enum(base_class, choices):\n EnumValue = base_class('EnumValue', choices)\n\n class A(BaseModel):\n m: Literal[EnumValue.a]\n\n class B(BaseModel):\n m: Literal[EnumValue.b]\n\n class Top(BaseModel):\n sub: Union[A, B] = Field(..., discriminator='m')\n\n assert isinstance(Top.model_validate({'sub': {'m': EnumValue.b}}).sub, B)\n assert isinstance(Top.model_validate({'sub': {'m': EnumValue.b.value}}).sub, B)\n with pytest.raises(ValidationError) as exc_info:\n Top.model_validate({'sub': {'m': 3}})\n\n expected_tags = f'{EnumValue.a.value!r}, {EnumValue.b.value!r}'\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'m'\", 'expected_tags': expected_tags, 'tag': '3'},\n 'input': {'m': 3},\n 'loc': ('sub',),\n 'msg': f\"Input tag '3' found using 'm' does not match any of the expected tags: {expected_tags}\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_alias_different_test_alias_same.assert_Model_pet_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_alias_different_test_alias_same.assert_Model_pet_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 395, "end_line": 422, "span_ids": ["test_alias_different", "test_alias_same"], "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 test_alias_different():\n class Cat(BaseModel):\n pet_type: Literal['cat'] = Field(alias='U')\n c: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='T')\n d: str\n\n with pytest.raises(TypeError, match=re.escape(\"Aliases for discriminator 'pet_type' must be the same (got T, U)\")):\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(discriminator='pet_type')\n\n\ndef test_alias_same():\n class Cat(BaseModel):\n pet_type: Literal['cat'] = Field(alias='typeOfPet')\n c: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='typeOfPet')\n d: str\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(discriminator='pet_type')\n\n assert Model(**{'pet': {'typeOfPet': 'dog', 'd': 'milou'}}).pet.pet_type == 'dog'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_test_nested.assert_isinstance_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_test_nested.assert_isinstance_Model_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 425, "end_line": 444, "span_ids": ["test_nested"], "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 test_nested():\n class Cat(BaseModel):\n pet_type: Literal['cat']\n name: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n name: str\n\n CommonPet = Annotated[Union[Cat, Dog], Field(discriminator='pet_type')]\n\n class Lizard(BaseModel):\n pet_type: Literal['reptile', 'lizard']\n name: str\n\n class Model(BaseModel):\n pet: Union[CommonPet, Lizard] = Field(..., discriminator='pet_type')\n n: int\n\n assert isinstance(Model(**{'pet': {'pet_type': 'dog', 'name': 'Milou'}, 'n': 5}).pet, Dog)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_generic_test_generic.assert_Container_str_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_generic_test_generic.assert_Container_str_mod", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 447, "end_line": 495, "span_ids": ["test_generic"], "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 test_generic():\n T = TypeVar('T')\n\n class Success(BaseModel, Generic[T]):\n type: Literal['Success'] = 'Success'\n data: T\n\n class Failure(BaseModel):\n type: Literal['Failure'] = 'Failure'\n error_message: str\n\n class Container(BaseModel, Generic[T]):\n result: Union[Success[T], Failure] = Field(discriminator='type')\n\n with pytest.raises(ValidationError, match=\"Unable to extract tag using discriminator 'type'\"):\n Container[str].model_validate({'result': {}})\n\n with pytest.raises(\n ValidationError,\n match=re.escape(\n \"Input tag 'Other' found using 'type' does not match any of the expected tags: 'Success', 'Failure'\"\n ),\n ):\n Container[str].model_validate({'result': {'type': 'Other'}})\n\n # See https://github.com/pydantic/pydantic-core/issues/425 for why this is set weirdly; this is an unrelated issue\n # If/when the issue is fixed, the following line should replace the current title = 'Failure' line\n # title = 'Container[str]'\n title = 'Failure'\n\n with pytest.raises(ValidationError, match=f'{title}\\nresult -> Success -> data') as exc_info:\n Container[str].model_validate({'result': {'type': 'Success'}})\n assert exc_info.value.errors() == [\n {'input': {'type': 'Success'}, 'loc': ('result', 'Success', 'data'), 'msg': 'Field required', 'type': 'missing'}\n ]\n\n # invalid types error\n with pytest.raises(ValidationError) as exc_info:\n Container[str].model_validate({'result': {'type': 'Success', 'data': 1}})\n assert exc_info.value.errors() == [\n {\n 'input': 1,\n 'loc': ('result', 'Success', 'data'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n }\n ]\n\n assert Container[str].model_validate({'result': {'type': 'Success', 'data': '1'}}).result.data == '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_pydantic__pydantic/tests/test_discriminated_union.py_test_optional_union_test_optional_union.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_optional_union_test_optional_union.None_5", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 498, "end_line": 540, "span_ids": ["test_optional_union"], "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": "def test_optional_union():\n class Cat(BaseModel):\n pet_type: Literal['cat']\n name: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n name: str\n\n class Pet(BaseModel):\n pet: Optional[Union[Cat, Dog]] = Field(discriminator='pet_type')\n\n assert Pet(pet={'pet_type': 'cat', 'name': 'Milo'}).model_dump() == {'pet': {'name': 'Milo', 'pet_type': 'cat'}}\n assert Pet(pet={'pet_type': 'dog', 'name': 'Otis'}).model_dump() == {'pet': {'name': 'Otis', 'pet_type': 'dog'}}\n assert Pet(pet=None).model_dump() == {'pet': None}\n\n with pytest.raises(ValidationError) as exc_info:\n Pet()\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('pet',), 'msg': 'Field required', 'type': 'missing'}]\n\n with pytest.raises(ValidationError) as exc_info:\n Pet(pet={'name': 'Benji'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\"},\n 'input': {'name': 'Benji'},\n 'loc': ('pet',),\n 'msg': \"Unable to extract tag using discriminator 'pet_type'\",\n 'type': 'union_tag_not_found',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Pet(pet={'pet_type': 'lizard'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\", 'expected_tags': \"'cat', 'dog'\", 'tag': 'lizard'},\n 'input': {'pet_type': 'lizard'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'lizard' found using 'pet_type' does not match any of the \" \"expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_optional_union_with_defaults_test_optional_union_with_defaults.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_optional_union_with_defaults_test_optional_union_with_defaults.None_5", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 543, "end_line": 582, "span_ids": ["test_optional_union_with_defaults"], "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": "def test_optional_union_with_defaults():\n class Cat(BaseModel):\n pet_type: Literal['cat'] = 'cat'\n name: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = 'dog'\n name: str\n\n class Pet(BaseModel):\n pet: Optional[Union[Cat, Dog]] = Field(default=None, discriminator='pet_type')\n\n assert Pet(pet={'pet_type': 'cat', 'name': 'Milo'}).model_dump() == {'pet': {'name': 'Milo', 'pet_type': 'cat'}}\n assert Pet(pet={'pet_type': 'dog', 'name': 'Otis'}).model_dump() == {'pet': {'name': 'Otis', 'pet_type': 'dog'}}\n assert Pet(pet=None).model_dump() == {'pet': None}\n assert Pet().model_dump() == {'pet': None}\n\n with pytest.raises(ValidationError) as exc_info:\n Pet(pet={'name': 'Benji'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\"},\n 'input': {'name': 'Benji'},\n 'loc': ('pet',),\n 'msg': \"Unable to extract tag using discriminator 'pet_type'\",\n 'type': 'union_tag_not_found',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Pet(pet={'pet_type': 'lizard'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\", 'expected_tags': \"'cat', 'dog'\", 'tag': 'lizard'},\n 'input': {'pet_type': 'lizard'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'lizard' found using 'pet_type' does not match any of the \" \"expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_aliases_matching_is_not_sufficient_test_aliases_matching_is_not_sufficient.with_pytest_raises_Pydant.TaggedParent.tagged.Field_discriminator_kind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_aliases_matching_is_not_sufficient_test_aliases_matching_is_not_sufficient.with_pytest_raises_Pydant.TaggedParent.tagged.Field_discriminator_kind", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 585, "end_line": 595, "span_ids": ["test_aliases_matching_is_not_sufficient"], "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 test_aliases_matching_is_not_sufficient() -> None:\n class Case1(BaseModel):\n kind_one: Literal['1'] = Field(alias='kind')\n\n class Case2(BaseModel):\n kind_two: Literal['2'] = Field(alias='kind')\n\n with pytest.raises(PydanticUserError, match=\"Model 'Case1' needs a discriminator field for key 'kind'\"):\n\n class TaggedParent(BaseModel):\n tagged: Union[Case1, Case2] = Field(discriminator='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_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_optional_unions_test_nested_optional_unions.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_optional_unions_test_nested_optional_unions.None_1", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 598, "end_line": 637, "span_ids": ["test_nested_optional_unions"], "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": "def test_nested_optional_unions() -> None:\n class Cat(BaseModel):\n pet_type: Literal['cat'] = 'cat'\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = 'dog'\n\n class Lizard(BaseModel):\n pet_type: Literal['lizard', 'reptile'] = 'lizard'\n\n MaybeCatDog = Annotated[Optional[Union[Cat, Dog]], Field(discriminator='pet_type')]\n MaybeDogLizard = Annotated[Union[Dog, Lizard, None], Field(discriminator='pet_type')]\n\n class Pet(BaseModel):\n pet: Union[MaybeCatDog, MaybeDogLizard] = Field(discriminator='pet_type')\n\n Pet.model_validate({'pet': {'pet_type': 'dog'}})\n Pet.model_validate({'pet': {'pet_type': 'cat'}})\n Pet.model_validate({'pet': {'pet_type': 'lizard'}})\n Pet.model_validate({'pet': {'pet_type': 'reptile'}})\n Pet.model_validate({'pet': None})\n\n with pytest.raises(ValidationError) as exc_info:\n Pet.model_validate({'pet': {'pet_type': None}})\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('pet',), 'msg': 'Input should be a valid string', 'type': 'string_type'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Pet.model_validate({'pet': {'pet_type': 'fox'}})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type'\", 'expected_tags': \"'cat', 'dog', 'lizard', 'reptile'\", 'tag': 'fox'},\n 'input': {'pet_type': 'fox'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'fox' found using 'pet_type' does not match any of the \"\n \"expected tags: 'cat', 'dog', 'lizard', 'reptile'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminated_union_test_nested_discriminated_union.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminated_union_test_nested_discriminated_union.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 640, "end_line": 675, "span_ids": ["test_nested_discriminated_union"], "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 test_nested_discriminated_union() -> None:\n class Cat(BaseModel):\n pet_type: Literal['cat', 'CAT']\n\n class Dog(BaseModel):\n pet_type: Literal['dog', 'DOG']\n\n class Lizard(BaseModel):\n pet_type: Literal['lizard', 'LIZARD']\n\n CatDog = Annotated[Union[Cat, Dog], Field(discriminator='pet_type')]\n CatDogLizard = Annotated[Union[CatDog, Lizard], Field(discriminator='pet_type')]\n\n class Pet(BaseModel):\n pet: CatDogLizard\n\n Pet.model_validate({'pet': {'pet_type': 'dog'}})\n Pet.model_validate({'pet': {'pet_type': 'cat'}})\n Pet.model_validate({'pet': {'pet_type': 'lizard'}})\n\n with pytest.raises(ValidationError) as exc_info:\n Pet.model_validate({'pet': {'pet_type': 'reptile'}})\n assert exc_info.value.errors() == [\n {\n 'ctx': {\n 'discriminator': \"'pet_type'\",\n 'expected_tags': \"'cat', 'dog', 'lizard', 'CAT', 'DOG', 'LIZARD'\",\n 'tag': 'reptile',\n },\n 'input': {'pet_type': 'reptile'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'reptile' found using 'pet_type' does not match any of the \"\n \"expected tags: 'cat', 'dog', 'lizard', 'CAT', 'DOG', 'LIZARD'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_unions_of_optionals_test_unions_of_optionals.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_unions_of_optionals_test_unions_of_optionals.None_2", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 678, "end_line": 698, "span_ids": ["test_unions_of_optionals"], "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 test_unions_of_optionals() -> None:\n class Cat(BaseModel):\n pet_type: Literal['cat'] = Field(alias='typeOfPet')\n c: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='typeOfPet')\n d: str\n\n class Lizard(BaseModel):\n pet_type: Literal['lizard'] = Field(alias='typeOfPet')\n\n MaybeCat = Annotated[Union[Cat, None], 'some annotation']\n MaybeDogLizard = Annotated[Optional[Union[Dog, Lizard]], 'some other annotation']\n\n class Model(BaseModel):\n maybe_pet: Union[MaybeCat, MaybeDogLizard] = Field(discriminator='pet_type')\n\n assert Model(**{'maybe_pet': None}).maybe_pet is None\n assert Model(**{'maybe_pet': {'typeOfPet': 'dog', 'd': 'milou'}}).maybe_pet.pet_type == 'dog'\n assert Model(**{'maybe_pet': {'typeOfPet': 'lizard'}}).maybe_pet.pet_type == 'lizard'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_discriminator_literals_test_union_discriminator_literals.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_discriminator_literals_test_union_discriminator_literals.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 701, "end_line": 725, "span_ids": ["test_union_discriminator_literals"], "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 test_union_discriminator_literals() -> None:\n class Cat(BaseModel):\n pet_type: Union[Literal['cat'], Literal['CAT']] = Field(alias='typeOfPet')\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='typeOfPet')\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(discriminator='pet_type')\n\n assert Model(**{'pet': {'typeOfPet': 'dog'}}).pet.pet_type == 'dog'\n assert Model(**{'pet': {'typeOfPet': 'cat'}}).pet.pet_type == 'cat'\n assert Model(**{'pet': {'typeOfPet': 'CAT'}}).pet.pet_type == 'CAT'\n with pytest.raises(ValidationError) as exc_info:\n Model(**{'pet': {'typeOfPet': 'Cat'}})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'pet_type' | 'typeOfPet'\", 'expected_tags': \"'cat', 'dog', 'CAT'\", 'tag': 'Cat'},\n 'input': {'typeOfPet': 'Cat'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'Cat' found using 'pet_type' | 'typeOfPet' does not match \"\n \"any of the expected tags: 'cat', 'dog', 'CAT'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_none_schema_test_none_schema.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_none_schema_test_none_schema.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 728, "end_line": 749, "span_ids": ["test_none_schema"], "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 test_none_schema() -> None:\n cat_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']))}\n dog_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['dog']))}\n cat = core_schema.typed_dict_schema(cat_fields)\n dog = core_schema.typed_dict_schema(dog_fields)\n schema = core_schema.union_schema([cat, dog, core_schema.none_schema()])\n schema = apply_discriminator(schema, 'kind')\n validator = SchemaValidator(schema)\n assert validator.validate_python({'kind': 'cat'})['kind'] == 'cat'\n assert validator.validate_python({'kind': 'dog'})['kind'] == 'dog'\n assert validator.validate_python(None) is None\n with pytest.raises(ValidationError) as exc_info:\n validator.validate_python({'kind': 'lizard'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'kind'\", 'expected_tags': \"'cat', 'dog'\", 'tag': 'lizard'},\n 'input': {'kind': 'lizard'},\n 'loc': (),\n 'msg': \"Input tag 'lizard' found using 'kind' does not match any of the \" \"expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_unwrapping_test_nested_unwrapping.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_unwrapping_test_nested_unwrapping.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 752, "end_line": 780, "span_ids": ["test_nested_unwrapping"], "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 test_nested_unwrapping() -> None:\n cat_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']))}\n dog_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['dog']))}\n cat = core_schema.typed_dict_schema(cat_fields)\n dog = core_schema.typed_dict_schema(dog_fields)\n schema = core_schema.union_schema([cat, dog])\n for _ in range(3):\n schema = core_schema.nullable_schema(schema)\n schema = core_schema.nullable_schema(schema)\n schema = core_schema.definitions_schema(schema, [])\n schema = core_schema.definitions_schema(schema, [])\n\n schema = apply_discriminator(schema, 'kind')\n\n validator = SchemaValidator(schema)\n assert validator.validate_python({'kind': 'cat'})['kind'] == 'cat'\n assert validator.validate_python({'kind': 'dog'})['kind'] == 'dog'\n assert validator.validate_python(None) is None\n with pytest.raises(ValidationError) as exc_info:\n validator.validate_python({'kind': 'lizard'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'kind'\", 'expected_tags': \"'cat', 'dog'\", 'tag': 'lizard'},\n 'input': {'kind': 'lizard'},\n 'loc': (),\n 'msg': \"Input tag 'lizard' found using 'kind' does not match any of the \" \"expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_distinct_choices_test_invalid_discriminated_union_type.with_pytest_raises_.Model.pet.Field_discriminator_pet_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_distinct_choices_test_invalid_discriminated_union_type.with_pytest_raises_.Model.pet.Field_discriminator_pet_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 783, "end_line": 808, "span_ids": ["test_invalid_discriminated_union_type", "test_distinct_choices"], "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 test_distinct_choices() -> None:\n class Cat(BaseModel):\n pet_type: Literal['cat', 'dog'] = Field(alias='typeOfPet')\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='typeOfPet')\n\n with pytest.raises(TypeError, match=\"Value 'dog' for discriminator 'pet_type' mapped to multiple choices\"):\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(discriminator='pet_type')\n\n\ndef test_invalid_discriminated_union_type() -> None:\n class Cat(BaseModel):\n pet_type: Literal['cat'] = Field(alias='typeOfPet')\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='typeOfPet')\n\n with pytest.raises(\n TypeError, match=\"'str' is not a valid discriminated union variant; should be a `BaseModel` or `dataclass`\"\n ):\n\n class Model(BaseModel):\n pet: Union[Cat, Dog, str] = Field(discriminator='pet_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_pydantic__pydantic/tests/test_discriminated_union.py_test_single_item_union_error_test_invalid_alias.with_pytest_raises_TypeEr.apply_discriminator_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_single_item_union_error_test_invalid_alias.with_pytest_raises_TypeEr.apply_discriminator_schem", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 811, "end_line": 830, "span_ids": ["test_single_item_union_error", "test_invalid_alias"], "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 test_single_item_union_error() -> None:\n fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['only_choice']))}\n schema = core_schema.union_schema([core_schema.typed_dict_schema(fields=fields)])\n with pytest.raises(\n TypeError, match='`discriminator` can only be used with `Union` type with more than one variant'\n ):\n apply_discriminator(schema, 'kind')\n\n\ndef test_invalid_alias() -> None:\n cat_fields = {\n 'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']), validation_alias=['cat', 'CAT'])\n }\n dog_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['dog']))}\n cat = core_schema.typed_dict_schema(cat_fields)\n dog = core_schema.typed_dict_schema(dog_fields)\n schema = core_schema.union_schema([cat, dog])\n\n with pytest.raises(TypeError, match=re.escape(\"Alias ['cat', 'CAT'] is not supported in a discriminated union\")):\n apply_discriminator(schema, '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_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_discriminator_type_test_missing_discriminator_field.with_pytest_raises_TypeEr.apply_discriminator_core_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_discriminator_type_test_missing_discriminator_field.with_pytest_raises_TypeEr.apply_discriminator_core_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 833, "end_line": 850, "span_ids": ["test_invalid_discriminator_type", "test_missing_discriminator_field"], "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 test_invalid_discriminator_type() -> None:\n cat_fields = {'kind': core_schema.typed_dict_field(core_schema.int_schema())}\n dog_fields = {'kind': core_schema.typed_dict_field(core_schema.str_schema())}\n cat = core_schema.typed_dict_schema(cat_fields)\n dog = core_schema.typed_dict_schema(dog_fields)\n\n with pytest.raises(TypeError, match=re.escape(\"TypedDict needs field 'kind' to be of type `Literal`\")):\n apply_discriminator(core_schema.union_schema([cat, dog]), 'kind')\n\n\ndef test_missing_discriminator_field() -> None:\n cat_fields = {'kind': core_schema.typed_dict_field(core_schema.int_schema())}\n dog_fields = {}\n cat = core_schema.typed_dict_schema(cat_fields)\n dog = core_schema.typed_dict_schema(dog_fields)\n\n with pytest.raises(TypeError, match=re.escape(\"TypedDict needs a discriminator field for key 'kind'\")):\n apply_discriminator(core_schema.union_schema([dog, cat]), '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_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_discriminator_value_test_invalid_discriminator_value.None_1.apply_discriminator_core_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_discriminator_value_test_invalid_discriminator_value.None_1.apply_discriminator_core_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 853, "end_line": 863, "span_ids": ["test_invalid_discriminator_value"], "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 test_invalid_discriminator_value() -> None:\n cat_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema([None]))}\n dog_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema([1.5]))}\n cat = core_schema.typed_dict_schema(cat_fields)\n dog = core_schema.typed_dict_schema(dog_fields)\n\n with pytest.raises(TypeError, match=re.escape('Unsupported value for discriminator field: None')):\n apply_discriminator(core_schema.union_schema([cat, dog]), 'kind')\n\n with pytest.raises(TypeError, match=re.escape('Unsupported value for discriminator field: 1.5')):\n apply_discriminator(core_schema.union_schema([dog, cat]), '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_pydantic__pydantic/tests/test_discriminated_union.py_test_wrap_function_schema_test_wrap_function_schema.assert_apply_discriminato": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_wrap_function_schema_test_wrap_function_schema.assert_apply_discriminato", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 866, "end_line": 897, "span_ids": ["test_wrap_function_schema"], "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 test_wrap_function_schema() -> None:\n cat_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']))}\n dog_fields = {'kind': core_schema.typed_dict_field(core_schema.literal_schema(['dog']))}\n cat = core_schema.general_wrap_validator_function(lambda x, y, z: None, core_schema.typed_dict_schema(cat_fields))\n dog = core_schema.typed_dict_schema(dog_fields)\n schema = core_schema.union_schema([cat, dog])\n\n assert apply_discriminator(schema, 'kind') == {\n 'choices': {\n 'cat': {\n 'function': {\n 'type': 'general',\n 'function': HasRepr(IsStr(regex=r'\\. at 0x[0-9a-fA-F]+>')),\n },\n 'schema': {\n 'fields': {\n 'kind': {'schema': {'expected': ['cat'], 'type': 'literal'}, 'type': 'typed-dict-field'}\n },\n 'type': 'typed-dict',\n },\n 'type': 'function-wrap',\n },\n 'dog': {\n 'fields': {'kind': {'schema': {'expected': ['dog'], 'type': 'literal'}, 'type': 'typed-dict-field'}},\n 'type': 'typed-dict',\n },\n },\n 'discriminator': 'kind',\n 'from_attributes': True,\n 'strict': False,\n 'type': 'tagged-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_pydantic__pydantic/tests/test_discriminated_union.py_test_plain_function_schema_is_invalid_test_invalid_str_choice_discriminator_values.with_pytest_raises_.apply_discriminator_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_plain_function_schema_is_invalid_test_invalid_str_choice_discriminator_values.with_pytest_raises_.apply_discriminator_schem", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 900, "end_line": 930, "span_ids": ["test_invalid_str_choice_discriminator_values", "test_plain_function_schema_is_invalid"], "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 test_plain_function_schema_is_invalid() -> None:\n with pytest.raises(\n TypeError,\n match=\"'function-plain' is not a valid discriminated union variant; \" \"should be a `BaseModel` or `dataclass`\",\n ):\n apply_discriminator(\n core_schema.union_schema(\n [core_schema.general_plain_validator_function(lambda x, y: None), core_schema.int_schema()]\n ),\n 'kind',\n )\n\n\ndef test_invalid_str_choice_discriminator_values() -> None:\n cat = core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']))})\n dog = core_schema.str_schema()\n\n schema = core_schema.union_schema(\n [\n cat,\n # NOTE: Wrapping the union with a validator results in failure to more thoroughly decompose the tagged\n # union. I think this would be difficult to avoid in the general case, and I would suggest that we not\n # attempt to do more than this until presented with scenarios where it is helpful/necessary.\n core_schema.general_wrap_validator_function(lambda x, y, z: x, dog),\n ]\n )\n\n with pytest.raises(\n TypeError, match=\"'str' is not a valid discriminated union variant; should be a `BaseModel` or `dataclass`\"\n ):\n apply_discriminator(schema, '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_pydantic__pydantic/tests/test_discriminated_union.py_test_lax_or_strict_definitions_test_lax_or_strict_definitions.assert_discriminated_sche": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_lax_or_strict_definitions_test_lax_or_strict_definitions.assert_discriminated_sche", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 933, "end_line": 982, "span_ids": ["test_lax_or_strict_definitions"], "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": "def test_lax_or_strict_definitions() -> None:\n cat = core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']))})\n lax_dog = core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['DOG']))})\n strict_dog = core_schema.definitions_schema(\n core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['dog']))}),\n [core_schema.int_schema(ref='my-int-definition')],\n )\n dog = core_schema.definitions_schema(\n core_schema.lax_or_strict_schema(lax_schema=lax_dog, strict_schema=strict_dog),\n [core_schema.str_schema(ref='my-str-definition')],\n )\n discriminated_schema = apply_discriminator(core_schema.union_schema([cat, dog]), 'kind')\n assert discriminated_schema == {\n 'definitions': [{'ref': 'my-str-definition', 'type': 'str'}],\n 'schema': {\n 'choices': {\n 'DOG': {\n 'lax_schema': {\n 'fields': {\n 'kind': {'schema': {'expected': ['DOG'], 'type': 'literal'}, 'type': 'typed-dict-field'}\n },\n 'type': 'typed-dict',\n },\n 'strict_schema': {\n 'definitions': [{'ref': 'my-int-definition', 'type': 'int'}],\n 'schema': {\n 'fields': {\n 'kind': {'schema': {'expected': ['dog'], 'type': 'literal'}, 'type': 'typed-dict-field'}\n },\n 'type': 'typed-dict',\n },\n 'type': 'definitions',\n },\n 'type': 'lax-or-strict',\n },\n 'cat': {\n 'fields': {\n 'kind': {'schema': {'expected': ['cat'], 'type': 'literal'}, 'type': 'typed-dict-field'}\n },\n 'type': 'typed-dict',\n },\n 'dog': 'DOG',\n },\n 'discriminator': 'kind',\n 'from_attributes': True,\n 'strict': False,\n 'type': 'tagged-union',\n },\n 'type': 'definitions',\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_pydantic__pydantic/tests/test_discriminated_union.py_test_wrapped_nullable_union_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_wrapped_nullable_union_", "embedding": null, "metadata": {"file_path": "tests/test_discriminated_union.py", "file_name": "test_discriminated_union.py", "file_type": "text/x-python", "category": "test", "start_line": 985, "end_line": 1070, "span_ids": ["test_wrapped_nullable_union"], "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 test_wrapped_nullable_union() -> None:\n cat = core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['cat']))})\n dog = core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['dog']))})\n ant = core_schema.typed_dict_schema({'kind': core_schema.typed_dict_field(core_schema.literal_schema(['ant']))})\n\n schema = core_schema.union_schema(\n [\n ant,\n # NOTE: Wrapping the union with a validator results in failure to more thoroughly decompose the tagged\n # union. I think this would be difficult to avoid in the general case, and I would suggest that we not\n # attempt to do more than this until presented with scenarios where it is helpful/necessary.\n core_schema.general_wrap_validator_function(\n lambda x, y, z: x, core_schema.nullable_schema(core_schema.union_schema([cat, dog]))\n ),\n ]\n )\n discriminated_schema = apply_discriminator(schema, 'kind')\n validator = SchemaValidator(discriminated_schema)\n assert validator.validate_python({'kind': 'ant'})['kind'] == 'ant'\n assert validator.validate_python({'kind': 'cat'})['kind'] == 'cat'\n assert validator.validate_python(None) is None\n with pytest.raises(ValidationError) as exc_info:\n validator.validate_python({'kind': 'armadillo'})\n assert exc_info.value.errors() == [\n {\n 'ctx': {'discriminator': \"'kind'\", 'expected_tags': \"'ant', 'cat', 'dog'\", 'tag': 'armadillo'},\n 'input': {'kind': 'armadillo'},\n 'loc': (),\n 'msg': \"Input tag 'armadillo' found using 'kind' does not match any of the \"\n \"expected tags: 'ant', 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n assert discriminated_schema == {\n 'schema': {\n 'choices': {\n 'ant': {\n 'fields': {\n 'kind': {'schema': {'expected': ['ant'], 'type': 'literal'}, 'type': 'typed-dict-field'}\n },\n 'type': 'typed-dict',\n },\n 'cat': {\n 'function': {\n 'function': HasRepr(IsStr(regex=r'\\. at 0x[0-9a-fA-F]+>')),\n 'type': 'general',\n },\n 'schema': {\n 'schema': {\n 'choices': [\n {\n 'fields': {\n 'kind': {\n 'schema': {'expected': ['cat'], 'type': 'literal'},\n 'type': 'typed-dict-field',\n }\n },\n 'type': 'typed-dict',\n },\n {\n 'fields': {\n 'kind': {\n 'schema': {'expected': ['dog'], 'type': 'literal'},\n 'type': 'typed-dict-field',\n }\n },\n 'type': 'typed-dict',\n },\n ],\n 'type': 'union',\n },\n 'type': 'nullable',\n },\n 'type': 'function-wrap',\n },\n 'dog': 'cat',\n },\n 'discriminator': 'kind',\n 'from_attributes': True,\n 'strict': False,\n 'type': 'tagged-union',\n },\n 'type': 'nullable',\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_pydantic__pydantic/tests/test_docs.py_from___future___import_an_skip_docs_tests.None_3.except_ImportError_.return._ansi2html_not_installed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_from___future___import_an_skip_docs_tests.None_3.except_ImportError_.return._ansi2html_not_installed_", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 44, "span_ids": ["imports", "skip_docs_tests"], "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 __future__ import annotations as _annotations\n\nimport os\nimport platform\nimport re\nimport subprocess\nimport sys\nfrom datetime import datetime\nfrom pathlib import Path\nfrom tempfile import NamedTemporaryFile\n\nimport pytest\nfrom pytest_examples import CodeExample, EvalExample, find_examples\n\nINDEX_MAIN = None\nDOCS_ROOT = Path(__file__).parent.parent / 'docs'\n\n\ndef skip_docs_tests():\n if sys.platform not in {'linux', 'darwin'}:\n return 'not in linux or macos'\n\n if platform.python_implementation() != 'CPython':\n return 'not cpython'\n\n try:\n import hypothesis # noqa: F401\n except ImportError:\n return 'hypothesis not installed'\n\n try:\n import devtools # noqa: F401\n except ImportError:\n return 'devtools not installed'\n\n try:\n import sqlalchemy # noqa: F401\n except ImportError:\n return 'sqlalchemy not installed'\n\n try:\n import ansi2html # noqa: F401\n except ImportError:\n return 'ansi2html not installed'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_GroupModuleGlobals_skip_reason.skip_docs_tests_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_GroupModuleGlobals_skip_reason.skip_docs_tests_", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 73, "span_ids": ["GroupModuleGlobals", "MockedDatetime", "impl:7", "GroupModuleGlobals.set", "MockedDatetime.now", "impl:5", "GroupModuleGlobals.__init__", "GroupModuleGlobals.get"], "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 GroupModuleGlobals:\n def __init__(self) -> None:\n self.name = None\n self.module_dict: dict[str, str] = {}\n\n def get(self, name: str | None):\n if name is not None and name == self.name:\n return self.module_dict\n\n def set(self, name: str | None, module_dict: dict[str, str]):\n self.name = name\n if self.name is None:\n self.module_dict = None\n else:\n self.module_dict = module_dict\n\n\ngroup_globals = GroupModuleGlobals()\n\n\nclass MockedDatetime(datetime):\n @classmethod\n def now(cls, *args, **kwargs):\n return datetime(2032, 1, 2, 3, 4, 5, 6)\n\n\nskip_reason = skip_docs_tests()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_examples_test_docs_examples.try_.else_.group_globals_set_group_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_examples_test_docs_examples.try_.else_.group_globals_set_group_n", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 144, "span_ids": ["test_docs_examples"], "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": "@pytest.mark.skipif(bool(skip_reason), reason=skip_reason or 'not skipping')\n@pytest.mark.parametrize('example', find_examples(str(DOCS_ROOT), skip=sys.platform == 'win32'), ids=str)\ndef test_docs_examples(example: CodeExample, eval_example: EvalExample, tmp_path: Path, mocker): # noqa: C901\n global INDEX_MAIN\n if example.path.name == 'index.md':\n if INDEX_MAIN is None:\n INDEX_MAIN = example.source\n else:\n (tmp_path / 'index_main.py').write_text(INDEX_MAIN)\n sys.path.append(str(tmp_path))\n\n if example.path.name == 'devtools.md':\n pytest.skip('tested below')\n\n prefix_settings = example.prefix_settings()\n test_settings = prefix_settings.get('test')\n lint_settings = prefix_settings.get('lint')\n if test_settings == 'skip' and lint_settings == 'skip':\n pytest.skip('both test and lint skipped')\n\n requires_settings = prefix_settings.get('requires')\n if requires_settings:\n major, minor = map(int, requires_settings.split('.'))\n if sys.version_info < (major, minor):\n pytest.skip(f'requires python {requires_settings}')\n\n group_name = prefix_settings.get('group')\n\n if '# ignore-above' in example.source:\n eval_example.set_config(ruff_ignore=['E402'])\n if group_name:\n eval_example.set_config(ruff_ignore=['F821'])\n\n if lint_settings != 'skip':\n if eval_example.update_examples:\n eval_example.format(example)\n else:\n eval_example.lint(example)\n\n if test_settings == 'skip':\n return\n\n group_name = prefix_settings.get('group')\n d = group_globals.get(group_name)\n\n mocker.patch('datetime.datetime', MockedDatetime)\n mocker.patch('random.randint', return_value=3)\n\n xfail = None\n if test_settings and test_settings.startswith('xfail'):\n xfail = test_settings[5:].lstrip(' -')\n\n rewrite_assertions = prefix_settings.get('rewrite_assert', 'true') == 'true'\n\n try:\n if test_settings == 'no-print-intercept':\n d2 = eval_example.run(example, module_globals=d, rewrite_assertions=rewrite_assertions)\n elif eval_example.update_examples:\n d2 = eval_example.run_print_update(example, module_globals=d, rewrite_assertions=rewrite_assertions)\n else:\n d2 = eval_example.run_print_check(example, module_globals=d, rewrite_assertions=rewrite_assertions)\n except BaseException as e: # run_print_check raises a BaseException\n if xfail:\n pytest.xfail(f'{xfail}, {type(e).__name__}: {e}')\n raise\n else:\n if xfail:\n pytest.fail('expected xfail')\n group_globals.set(group_name, d2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_devtools_example_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_devtools_example_", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 147, "end_line": 183, "span_ids": ["test_docs_devtools_example"], "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": "@pytest.mark.skipif(bool(skip_reason), reason=skip_reason or 'not skipping')\n@pytest.mark.parametrize(\n 'example', find_examples(str(DOCS_ROOT / 'integrations/devtools.md'), skip=sys.platform == 'win32'), ids=str\n)\ndef test_docs_devtools_example(example: CodeExample, eval_example: EvalExample, tmp_path: Path):\n from ansi2html import Ansi2HTMLConverter\n\n if eval_example.update_examples:\n eval_example.format(example)\n else:\n eval_example.lint(example)\n\n with NamedTemporaryFile(mode='w', suffix='.py') as f:\n f.write(example.source)\n f.flush()\n os.environ['PY_DEVTOOLS_HIGHLIGHT'] = 'true'\n p = subprocess.run((sys.executable, f.name), stdout=subprocess.PIPE, check=True, encoding='utf8')\n\n conv = Ansi2HTMLConverter()\n\n # replace ugly file path with \"devtools_example.py\"\n output = re.sub(r'/.+?\\.py', 'devtools_example.py', p.stdout)\n output_html = conv.convert(output, full=False)\n output_html = (\n '\\n'\n f'{output_html}'\n )\n output_file = DOCS_ROOT / 'plugins/devtools_output.html'\n\n if eval_example.update_examples:\n output_file.write_text(output_html)\n elif not output_file.exists():\n pytest.fail(f'output file {output_file} does not exist')\n else:\n assert output_html == output_file.read_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_pydantic__pydantic/tests/test_edge_cases.py_importlib.util_from_pydantic_fields_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_importlib.util_from_pydantic_fields_impo", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["imports"], "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": "import importlib.util\nimport re\nimport sys\nfrom collections.abc import Hashable\nfrom decimal import Decimal\nfrom enum import Enum\nfrom typing import Any, Dict, FrozenSet, Generic, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union\n\nimport pytest\nfrom dirty_equals import HasRepr, IsStr\nfrom pydantic_core import core_schema\nfrom typing_extensions import get_args\n\nfrom pydantic import (\n AnalyzedType,\n BaseModel,\n ConfigDict,\n Extra,\n PydanticSchemaGenerationError,\n ValidationError,\n constr,\n errors,\n)\nfrom pydantic._internal._fields import PydanticGeneralMetadata\nfrom pydantic.config import get_config\nfrom pydantic.decorators import field_validator\nfrom pydantic.fields import 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_pydantic__pydantic/tests/test_edge_cases.py_test_str_bytes_test_str_bytes_none.assert_m_v_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_str_bytes_test_str_bytes_none.assert_m_v_is_None", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 61, "span_ids": ["test_str_bytes", "test_str_bytes_none"], "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 test_str_bytes():\n class Model(BaseModel):\n v: Union[str, bytes] = ...\n\n m = Model(v='s')\n assert m.v == 's'\n assert repr(m.model_fields['v']) == 'FieldInfo(annotation=Union[str, bytes], required=True)'\n\n m = Model(v=b'b')\n assert m.v == b'b'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=None)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'string_type', 'loc': ('v', 'str'), 'msg': 'Input should be a valid string', 'input': None},\n {'type': 'bytes_type', 'loc': ('v', 'bytes'), 'msg': 'Input should be a valid bytes', 'input': None},\n ]\n\n\ndef test_str_bytes_none():\n class Model(BaseModel):\n v: Union[None, str, bytes] = ...\n\n m = Model(v='s')\n assert m.v == 's'\n\n m = Model(v=b'b')\n assert m.v == b'b'\n\n m = Model(v=None)\n assert m.v 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_pydantic__pydantic/tests/test_edge_cases.py_test_union_int_str_test_union_int_any.assert_m_v_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_union_int_str_test_union_int_any.assert_m_v_is_None", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 108, "span_ids": ["test_union_int_any", "test_union_int_str"], "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 test_union_int_str():\n class Model(BaseModel):\n v: Union[int, str] = ...\n\n m = Model(v=123)\n assert m.v == 123\n\n m = Model(v='123')\n assert m.v == '123'\n\n m = Model(v=b'foobar')\n assert m.v == 'foobar'\n\n m = Model(v=12.0)\n assert m.v == 12\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=None)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('v', 'int'), 'msg': 'Input should be a valid integer', 'input': None},\n {\n 'type': 'string_type',\n 'loc': ('v', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': None,\n },\n ]\n\n\ndef test_union_int_any():\n class Model(BaseModel):\n v: Union[int, Any]\n\n m = Model(v=123)\n assert m.v == 123\n\n m = Model(v='123')\n assert m.v == '123'\n\n m = Model(v='foobar')\n assert m.v == 'foobar'\n\n m = Model(v=None)\n assert m.v 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_pydantic__pydantic/tests/test_edge_cases.py_test_typed_list_test_typed_list.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_list_test_typed_list.None_2", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 141, "span_ids": ["test_typed_list"], "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 test_typed_list():\n class Model(BaseModel):\n v: List[int] = ...\n\n m = Model(v=[1, 2, '3'])\n assert m.v == [1, 2, 3]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[1, 'x', 'y'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'y',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'list_type', 'loc': ('v',), 'msg': 'Input should be a valid list', 'input': 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_pydantic__pydantic/tests/test_edge_cases.py_test_typed_set_test_typed_set.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_set_test_typed_set.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 161, "span_ids": ["test_typed_set"], "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 test_typed_set():\n class Model(BaseModel):\n v: Set[int] = ...\n\n assert Model(v={1, 2, '3'}).v == {1, 2, 3}\n assert Model(v=[1, 2, '3']).v == {1, 2, 3}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[1, 'x'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\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_pydantic__pydantic/tests/test_edge_cases.py_test_dict_dict_test_none_list.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_dict_test_none_list.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 164, "end_line": 179, "span_ids": ["test_none_list", "test_dict_dict"], "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 test_dict_dict():\n class Model(BaseModel):\n v: Dict[str, int] = ...\n\n assert Model(v={'foo': 1}).model_dump() == {'v': {'foo': 1}}\n\n\ndef test_none_list():\n class Model(BaseModel):\n v: List[None] = [None]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'v': {'title': 'V', 'default': [None], 'type': 'array', 'items': {'type': 'null'}}},\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_pydantic__pydantic/tests/test_edge_cases.py_test_typed_dict_test_typed_dict.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_dict_test_typed_dict.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 182, "end_line": 194, "span_ids": ["test_typed_dict"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n ({'a': 2, 'b': 4}, {'a': 2, 'b': 4}),\n ({b'a': '2', 'b': 4}, {'a': 2, 'b': 4}),\n # ([('a', 2), ('b', 4)], {'a': 2, 'b': 4}),\n ],\n)\ndef test_typed_dict(value, result):\n class Model(BaseModel):\n v: Dict[str, int] = ...\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_edge_cases.py_test_typed_dict_error_test_typed_dict_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_typed_dict_error_test_typed_dict_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 197, "end_line": 224, "span_ids": ["test_typed_dict_error"], "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": "@pytest.mark.parametrize(\n 'value,errors',\n [\n (1, [{'type': 'dict_type', 'loc': ('v',), 'msg': 'Input should be a valid dictionary', 'input': 1}]),\n (\n {'a': 'b'},\n [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 'a'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'b',\n }\n ],\n ),\n (\n [1, 2, 3],\n [{'type': 'dict_type', 'loc': ('v',), 'msg': 'Input should be a valid dictionary', 'input': [1, 2, 3]}],\n ),\n ],\n)\ndef test_typed_dict_error(value, errors):\n class Model(BaseModel):\n v: Dict[str, int] = ...\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n assert exc_info.value.errors() == 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_pydantic__pydantic/tests/test_edge_cases.py_test_dict_key_error_test_tuple.assert_m_v_1_2_2_Tr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_key_error_test_tuple.assert_m_v_1_2_2_Tr", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 227, "end_line": 251, "span_ids": ["test_dict_key_error", "test_tuple"], "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": "def test_dict_key_error():\n class Model(BaseModel):\n v: Dict[int, int] = ...\n\n assert Model(v={1: 2, '3': '4'}).v == {1: 2, 3: 4}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v={'foo': 2, '3': '4'})\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 'foo', '[key]'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'foo',\n }\n ]\n\n\ndef test_tuple():\n class Model(BaseModel):\n v: Tuple[int, float, bool]\n\n m = Model(v=['1.0', '2.2', 'true'])\n assert m.v == (1, 2.2, 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_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_more_test_tuple_more.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_more_test_tuple_more.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 272, "span_ids": ["test_tuple_more"], "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_tuple_more():\n class Model(BaseModel):\n empty_tuple: Tuple[()]\n simple_tuple: tuple = None\n tuple_of_different_types: Tuple[int, float, str, bool] = None\n tuple_of_single_tuples: Tuple[Tuple[int], ...] = ()\n\n m = Model(\n empty_tuple=[],\n simple_tuple=[1, 2, 3, 4],\n tuple_of_different_types=[4, 3.1, 'str', 1],\n tuple_of_single_tuples=(('1',), (2,)),\n )\n assert m.model_dump() == {\n 'empty_tuple': (),\n 'simple_tuple': (1, 2, 3, 4),\n 'tuple_of_different_types': (4, 3.1, 'str', True),\n 'tuple_of_single_tuples': ((1,), (2,)),\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_pydantic__pydantic/tests/test_edge_cases.py_test_pep585_generic_types_test_pep585_generic_types.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_pep585_generic_types_test_pep585_generic_types.None_15", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 275, "end_line": 365, "span_ids": ["test_pep585_generic_types"], "tokens": 740}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'dict_cls,frozenset_cls,list_cls,set_cls,tuple_cls,type_cls',\n [\n (Dict, FrozenSet, List, Set, Tuple, Type),\n (dict, frozenset, list, set, tuple, type),\n ],\n)\n@pytest.mark.skipif(sys.version_info < (3, 9), reason='PEP585 generics only supported for python 3.9 and above')\ndef test_pep585_generic_types(dict_cls, frozenset_cls, list_cls, set_cls, tuple_cls, type_cls):\n class Type1:\n pass\n\n class Type2:\n pass\n\n class Model(BaseModel, arbitrary_types_allowed=True):\n a: dict_cls\n a1: dict_cls[str, int]\n b: frozenset_cls\n b1: frozenset_cls[int]\n c: list_cls\n c1: list_cls[int]\n d: set_cls\n d1: set_cls[int]\n e: tuple_cls\n e1: tuple_cls[int]\n e2: tuple_cls[int, ...]\n e3: tuple_cls[()]\n f: type_cls\n f1: type_cls[Type1]\n\n default_model_kwargs = dict(\n a={},\n a1={'a': '1'},\n b=[],\n b1=('1',),\n c=[],\n c1=('1',),\n d=[],\n d1=['1'],\n e=[],\n e1=['1'],\n e2=['1', '2'],\n e3=[],\n f=Type1,\n f1=Type1,\n )\n\n m = Model(**default_model_kwargs)\n assert m.a == {}\n assert m.a1 == {'a': 1}\n assert m.b == frozenset()\n assert m.b1 == frozenset({1})\n assert m.c == []\n assert m.c1 == [1]\n assert m.d == set()\n assert m.d1 == {1}\n assert m.e == ()\n assert m.e1 == (1,)\n assert m.e2 == (1, 2)\n assert m.e3 == ()\n assert m.f == Type1\n assert m.f1 == Type1\n\n with pytest.raises(ValidationError) as exc_info:\n Model(**(default_model_kwargs | {'e3': (1,)}))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_long',\n 'loc': ('e3',),\n 'msg': 'Tuple should have at most 0 items after validation, not 1',\n 'input': (1,),\n 'ctx': {'field_type': 'Tuple', 'max_length': 0, 'actual_length': 1},\n }\n ]\n\n Model(**(default_model_kwargs | {'f': Type2}))\n\n with pytest.raises(ValidationError) as exc_info:\n Model(**(default_model_kwargs | {'f1': Type2}))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'is_subclass_of',\n 'loc': ('f1',),\n 'msg': 'Input should be a subclass of test_pep585_generic_types..Type1',\n 'input': HasRepr(IsStr(regex=r\".+\\.Type2'>\")),\n 'ctx': {'class': 'test_pep585_generic_types..Type1'},\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_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_length_error_test_tuple_invalid.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_length_error_test_tuple_invalid.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 368, "end_line": 396, "span_ids": ["test_tuple_length_error", "test_tuple_invalid"], "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 test_tuple_length_error():\n class Model(BaseModel):\n v: Tuple[int, float, bool]\n w: Tuple[()]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[1, 2], w=[1])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'missing', 'loc': ('v', 2), 'msg': 'Field required', 'input': [1, 2]},\n {\n 'type': 'too_long',\n 'loc': ('w',),\n 'msg': 'Tuple should have at most 0 items after validation, not 1',\n 'input': [1],\n 'ctx': {'field_type': 'Tuple', 'max_length': 0, 'actual_length': 1},\n },\n ]\n\n\ndef test_tuple_invalid():\n class Model(BaseModel):\n v: Tuple[int, float, bool]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='xxx')\n assert exc_info.value.errors() == [\n {'type': 'tuple_type', 'loc': ('v',), 'msg': 'Input should be a valid tuple', 'input': 'xxx'}\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_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_value_error_test_tuple_value_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_tuple_value_error_test_tuple_value_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 399, "end_line": 419, "span_ids": ["test_tuple_value_error"], "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 test_tuple_value_error():\n class Model(BaseModel):\n v: Tuple[int, float, Decimal]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=['x', 'y', 'x'])\n assert exc_info.value.errors() == [\n {\n 'input': 'x',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {\n 'input': 'y',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid number, unable to parse string as an number',\n 'type': 'float_parsing',\n },\n {'input': 'x', 'loc': ('v', 2), 'msg': 'Input should be a valid decimal', 'type': 'decimal_parsing'},\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_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_list_test_recursive_list.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_list_test_recursive_list.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 422, "end_line": 443, "span_ids": ["test_recursive_list"], "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 test_recursive_list():\n class SubModel(BaseModel):\n name: str = ...\n count: int = None\n\n class Model(BaseModel):\n v: List[SubModel] = []\n\n m = Model(v=[])\n assert m.v == []\n\n m = Model(v=[{'name': 'testing', 'count': 4}])\n assert repr(m) == \"Model(v=[SubModel(name='testing', count=4)])\"\n assert m.v[0].name == 'testing'\n assert m.v[0].count == 4\n assert m.model_dump() == {'v': [{'count': 4, 'name': 'testing'}]}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=['x'])\n assert exc_info.value.errors() == [\n {'input': 'x', 'loc': ('v', 0), 'msg': 'Input should be a valid dictionary', 'type': 'dict_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_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_list_error_test_list_unions.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_list_error_test_list_unions.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 446, "end_line": 473, "span_ids": ["test_recursive_list_error", "test_list_unions"], "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 test_recursive_list_error():\n class SubModel(BaseModel):\n name: str = ...\n count: int = None\n\n class Model(BaseModel):\n v: List[SubModel] = []\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[{}])\n assert exc_info.value.errors() == [\n {'input': {}, 'loc': ('v', 0, 'name'), 'msg': 'Field required', 'type': 'missing'}\n ]\n\n\ndef test_list_unions():\n class Model(BaseModel):\n v: List[Union[int, str]] = ...\n\n assert Model(v=[123, '456', 'foobar']).v == [123, '456', 'foobar']\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[1, 2, None])\n\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('v', 2, 'int'), 'msg': 'Input should be a valid integer', 'type': 'int_type'},\n {'input': None, 'loc': ('v', 2, 'str'), 'msg': 'Input should be a valid string', 'type': 'string_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_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_lists_test_any_dict.assert_Model_v_2_1_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_lists_test_any_dict.assert_Model_v_2_1_2_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 476, "end_line": 506, "span_ids": ["test_str_enum", "test_any_dict", "StrEnum", "test_recursive_lists"], "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": "def test_recursive_lists():\n class Model(BaseModel):\n v: List[List[Union[int, float]]] = ...\n\n assert Model(v=[[1, 2], [3, '4', '4.1']]).v == [[1, 2], [3, 4, 4.1]]\n assert Model.model_fields['v'].annotation == List[List[Union[int, float]]]\n assert Model.model_fields['v'].is_required()\n\n\nclass StrEnum(str, Enum):\n a = 'a10'\n b = 'b10'\n\n\ndef test_str_enum():\n class Model(BaseModel):\n v: StrEnum = ...\n\n assert Model(v='a10').v is StrEnum.a\n\n with pytest.raises(ValidationError):\n Model(v='different')\n\n\ndef test_any_dict():\n class Model(BaseModel):\n v: Dict[int, Any] = ...\n\n assert Model(v={1: 'foobar'}).model_dump() == {'v': {1: 'foobar'}}\n assert Model(v={123: 456}).model_dump() == {'v': {123: 456}}\n assert Model(v={2: [1, 2, 3]}).model_dump() == {'v': {2: [1, 2, 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_pydantic__pydantic/tests/test_edge_cases.py_test_success_values_include_test_success_values_include.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_success_values_include_test_success_values_include.None_3", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 509, "end_line": 519, "span_ids": ["test_success_values_include"], "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 test_success_values_include():\n class Model(BaseModel):\n a: int = 1\n b: int = 2\n c: int = 3\n\n m = Model()\n assert m.model_dump() == {'a': 1, 'b': 2, 'c': 3}\n assert m.model_dump(include={'a'}) == {'a': 1}\n assert m.model_dump(exclude={'a'}) == {'b': 2, 'c': 3}\n assert m.model_dump(include={'a', 'b'}, exclude={'a'}) == {'b': 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_pydantic__pydantic/tests/test_edge_cases.py_test_include_exclude_unset_test_include_exclude_unset.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_include_exclude_unset_test_include_exclude_unset.None_8", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 522, "end_line": 543, "span_ids": ["test_include_exclude_unset"], "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": "def test_include_exclude_unset():\n class Model(BaseModel):\n a: int\n b: int\n c: int = 3\n d: int = 4\n e: int = 5\n f: int = 6\n\n m = Model(a=1, b=2, e=5, f=7)\n assert m.model_dump() == {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 7}\n assert m.__fields_set__ == {'a', 'b', 'e', 'f'}\n assert m.model_dump(exclude_unset=True) == {'a': 1, 'b': 2, 'e': 5, 'f': 7}\n\n assert m.model_dump(include={'a'}, exclude_unset=True) == {'a': 1}\n assert m.model_dump(include={'c'}, exclude_unset=True) == {}\n\n assert m.model_dump(exclude={'a'}, exclude_unset=True) == {'b': 2, 'e': 5, 'f': 7}\n assert m.model_dump(exclude={'c'}, exclude_unset=True) == {'a': 1, 'b': 2, 'e': 5, 'f': 7}\n\n assert m.model_dump(include={'a', 'b', 'c'}, exclude={'b'}, exclude_unset=True) == {'a': 1}\n assert m.model_dump(include={'a', 'b', 'c'}, exclude={'a', 'c'}, exclude_unset=True) == {'b': 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_pydantic__pydantic/tests/test_edge_cases.py_test_include_exclude_defaults_test_include_exclude_defaults.None_16": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_include_exclude_defaults_test_include_exclude_defaults.None_16", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 546, "end_line": 579, "span_ids": ["test_include_exclude_defaults"], "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 test_include_exclude_defaults():\n class Model(BaseModel):\n a: int\n b: int\n c: int = 3\n d: int = 4\n e: int = 5\n f: int = 6\n\n m = Model(a=1, b=2, e=5, f=7)\n assert m.model_dump() == {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 7}\n assert m.__fields_set__ == {'a', 'b', 'e', 'f'}\n assert m.model_dump(exclude_defaults=True) == {'a': 1, 'b': 2, 'f': 7}\n\n assert m.model_dump(include={'a'}, exclude_defaults=True) == {'a': 1}\n assert m.model_dump(include={'c'}, exclude_defaults=True) == {}\n\n assert m.model_dump(exclude={'a'}, exclude_defaults=True) == {'b': 2, 'f': 7}\n assert m.model_dump(exclude={'c'}, exclude_defaults=True) == {'a': 1, 'b': 2, 'f': 7}\n\n assert m.model_dump(include={'a', 'b', 'c'}, exclude={'b'}, exclude_defaults=True) == {'a': 1}\n assert m.model_dump(include={'a', 'b', 'c'}, exclude={'a', 'c'}, exclude_defaults=True) == {'b': 2}\n\n assert m.model_dump(include={'a': 1}.keys()) == {'a': 1}\n assert m.model_dump(exclude={'a': 1}.keys()) == {'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 7}\n\n assert m.model_dump(include={'a': 1}.keys(), exclude_unset=True) == {'a': 1}\n assert m.model_dump(exclude={'a': 1}.keys(), exclude_unset=True) == {'b': 2, 'e': 5, 'f': 7}\n\n assert m.model_dump(include=['a']) == {'a': 1}\n assert m.model_dump(exclude=['a']) == {'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 7}\n\n assert m.model_dump(include=['a'], exclude_unset=True) == {'a': 1}\n assert m.model_dump(exclude=['a'], exclude_unset=True) == {'b': 2, 'e': 5, 'f': 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_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_test_advanced_exclude.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_test_advanced_exclude.None_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 582, "end_line": 602, "span_ids": ["test_advanced_exclude"], "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": "@pytest.mark.xfail(reason='pydantic-core include/exclude does not wrap negative ints')\ndef test_advanced_exclude():\n class SubSubModel(BaseModel):\n a: str\n b: str\n\n class SubModel(BaseModel):\n c: str\n d: List[SubSubModel]\n\n class Model(BaseModel):\n e: str\n f: SubModel\n\n m = Model(e='e', f=SubModel(c='foo', d=[SubSubModel(a='a', b='b'), SubSubModel(a='c', b='e')]))\n\n assert m.model_dump(exclude={'f': {'c': ..., 'd': {-1: {'a'}}}}) == {\n 'e': 'e',\n 'f': {'d': [{'a': 'a', 'b': 'b'}, {'b': 'e'}]},\n }\n assert m.model_dump(exclude={'e': ..., 'f': {'d'}}) == {'f': {'c': '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_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_by_alias_test_advanced_exclude_by_alias.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_by_alias_test_advanced_exclude_by_alias.None_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 605, "end_line": 631, "span_ids": ["test_advanced_exclude_by_alias"], "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": "@pytest.mark.xfail(reason='pydantic-core include/exclude does not wrap negative ints')\ndef test_advanced_exclude_by_alias():\n class SubSubModel(BaseModel):\n a: str\n aliased_b: str = Field(..., alias='b_alias')\n\n class SubModel(BaseModel):\n aliased_c: str = Field(..., alias='c_alias')\n aliased_d: List[SubSubModel] = Field(..., alias='d_alias')\n\n class Model(BaseModel):\n aliased_e: str = Field(..., alias='e_alias')\n aliased_f: SubModel = Field(..., alias='f_alias')\n\n m = Model(\n e_alias='e',\n f_alias=SubModel(c_alias='foo', d_alias=[SubSubModel(a='a', b_alias='b'), SubSubModel(a='c', b_alias='e')]),\n )\n\n excludes = {'aliased_f': {'aliased_c': ..., 'aliased_d': {-1: {'a'}}}}\n assert m.model_dump(exclude=excludes, by_alias=True) == {\n 'e_alias': 'e',\n 'f_alias': {'d_alias': [{'a': 'a', 'b_alias': 'b'}, {'b_alias': 'e'}]},\n }\n\n excludes = {'aliased_e': ..., 'aliased_f': {'aliased_d'}}\n assert m.model_dump(exclude=excludes, by_alias=True) == {'f_alias': {'c_alias': '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_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_value_include_test_advanced_value_include.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_value_include_test_advanced_value_include.None_2", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 634, "end_line": 652, "span_ids": ["test_advanced_value_include"], "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": "@pytest.mark.xfail(reason='pydantic-core include/exclude does not wrap negative ints')\ndef test_advanced_value_include():\n class SubSubModel(BaseModel):\n a: str\n b: str\n\n class SubModel(BaseModel):\n c: str\n d: List[SubSubModel]\n\n class Model(BaseModel):\n e: str\n f: SubModel\n\n m = Model(e='e', f=SubModel(c='foo', d=[SubSubModel(a='a', b='b'), SubSubModel(a='c', b='e')]))\n\n assert m.model_dump(include={'f'}) == {'f': {'c': 'foo', 'd': [{'a': 'a', 'b': 'b'}, {'a': 'c', 'b': 'e'}]}}\n assert m.model_dump(include={'e'}) == {'e': 'e'}\n assert m.model_dump(include={'f': {'d': {0: ..., -1: {'b'}}}}) == {'f': {'d': [{'a': 'a', 'b': 'b'}, {'b': '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_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_value_exclude_include_test_advanced_value_exclude_include.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_value_exclude_include_test_advanced_value_exclude_include.None_2", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 655, "end_line": 678, "span_ids": ["test_advanced_value_exclude_include"], "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": "@pytest.mark.xfail(reason='pydantic-core include/exclude does not wrap negative ints')\ndef test_advanced_value_exclude_include():\n class SubSubModel(BaseModel):\n a: str\n b: str\n\n class SubModel(BaseModel):\n c: str\n d: List[SubSubModel]\n\n class Model(BaseModel):\n e: str\n f: SubModel\n\n m = Model(e='e', f=SubModel(c='foo', d=[SubSubModel(a='a', b='b'), SubSubModel(a='c', b='e')]))\n\n assert m.model_dump(exclude={'f': {'c': ..., 'd': {-1: {'a'}}}}, include={'f'}) == {\n 'f': {'d': [{'a': 'a', 'b': 'b'}, {'b': 'e'}]}\n }\n assert m.model_dump(exclude={'e': ..., 'f': {'d'}}, include={'e', 'f'}) == {'f': {'c': 'foo'}}\n\n assert m.model_dump(exclude={'f': {'d': {-1: {'a'}}}}, include={'f': {'d'}}) == {\n 'f': {'d': [{'a': 'a', 'b': 'b'}, {'b': '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_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_nested_lists_test_advanced_exclude_nested_lists.assert_m_model_dump_exclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_exclude_nested_lists_test_advanced_exclude_nested_lists.assert_m_model_dump_exclu", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 681, "end_line": 768, "span_ids": ["test_advanced_exclude_nested_lists"], "tokens": 1226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'exclude,expected',\n [\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}}}}},\n {'subs': [{'k': 1, 'subsubs': [{'j': 1}, {'j': 2}]}, {'k': 2, 'subsubs': [{'j': 3}]}]},\n id='Normal nested __all__',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}}}, 0: {'subsubs': {'__all__': {'j'}}}}},\n {'subs': [{'k': 1, 'subsubs': [{}, {}]}, {'k': 2, 'subsubs': [{'j': 3}]}]},\n id='Merge sub dicts 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': ...}, 0: {'subsubs': {'__all__': {'j'}}}}},\n {'subs': [{'k': 1, 'subsubs': [{'i': 1}, {'i': 2}]}, {'k': 2}]},\n # {'subs': [{'k': 1 }, {'k': 2}]}\n id='Merge sub sets 2',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'j'}}}, 0: {'subsubs': ...}}},\n {'subs': [{'k': 1}, {'k': 2, 'subsubs': [{'i': 3}]}]},\n id='Merge sub sets 3',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {0}}, 0: {'subsubs': {1}}}},\n {'subs': [{'k': 1, 'subsubs': []}, {'k': 2, 'subsubs': []}]},\n id='Merge sub sets 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {0: {'i'}}}, 0: {'subsubs': {1}}}},\n {'subs': [{'k': 1, 'subsubs': [{'j': 1}]}, {'k': 2, 'subsubs': [{'j': 3}]}]},\n id='Merge sub dict-set',\n ),\n pytest.param({'subs': {'__all__': {'subsubs'}, 0: {'k'}}}, {'subs': [{}, {'k': 2}]}, id='Different keys 1'),\n pytest.param(\n {'subs': {'__all__': {'subsubs': ...}, 0: {'k'}}}, {'subs': [{}, {'k': 2}]}, id='Different keys 2'\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs'}, 0: {'k': ...}}}, {'subs': [{}, {'k': 2}]}, id='Different keys 3'\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}, 0: {'j'}}}}},\n {'subs': [{'k': 1, 'subsubs': [{}, {'j': 2}]}, {'k': 2, 'subsubs': [{}]}]},\n id='Nested different keys 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i': ...}, 0: {'j'}}}}},\n {'subs': [{'k': 1, 'subsubs': [{}, {'j': 2}]}, {'k': 2, 'subsubs': [{}]}]},\n id='Nested different keys 2',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}, 0: {'j': ...}}}}},\n {'subs': [{'k': 1, 'subsubs': [{}, {'j': 2}]}, {'k': 2, 'subsubs': [{}]}]},\n id='Nested different keys 3',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs'}, 0: {'subsubs': {'__all__': {'j'}}}}},\n {'subs': [{'k': 1, 'subsubs': [{'i': 1}, {'i': 2}]}, {'k': 2}]},\n id='Ignore __all__ for index with defined exclude 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'j'}}}, 0: ...}},\n {'subs': [{'k': 2, 'subsubs': [{'i': 3}]}]},\n id='Ignore __all__ for index with defined exclude 2',\n ),\n pytest.param(\n {'subs': {'__all__': ..., 0: {'subsubs'}}},\n {'subs': [{'k': 1}]},\n id='Ignore __all__ for index with defined exclude 3',\n ),\n ],\n)\ndef test_advanced_exclude_nested_lists(exclude, expected):\n class SubSubModel(BaseModel):\n i: int\n j: int\n\n class SubModel(BaseModel):\n k: int\n subsubs: List[SubSubModel]\n\n class Model(BaseModel):\n subs: List[SubModel]\n\n m = Model(subs=[dict(k=1, subsubs=[dict(i=1, j=1), dict(i=2, j=2)]), dict(k=2, subsubs=[dict(i=3, j=3)])])\n\n assert m.model_dump(exclude=exclude) == 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_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_include_nested_lists_test_advanced_include_nested_lists.assert_m_model_dump_inclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_advanced_include_nested_lists_test_advanced_include_nested_lists.assert_m_model_dump_inclu", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 771, "end_line": 865, "span_ids": ["test_advanced_include_nested_lists"], "tokens": 1492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'include,expected',\n [\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}}}}},\n {'subs': [{'subsubs': [{'i': 1}, {'i': 2}]}, {'subsubs': [{'i': 3}]}]},\n id='Normal nested __all__',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}}}, 0: {'subsubs': {'__all__': {'j'}}}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'i': 3}]}]},\n id='Merge sub dicts 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': ...}, 0: {'subsubs': {'__all__': {'j'}}}}},\n {'subs': [{'subsubs': [{'j': 1}, {'j': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Merge sub dicts 2',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'j'}}}, 0: {'subsubs': ...}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'j': 3}]}]},\n id='Merge sub dicts 3',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {0}}, 0: {'subsubs': {1}}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Merge sub sets',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {0: {'i'}}}, 0: {'subsubs': {1}}}},\n {'subs': [{'subsubs': [{'i': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'i': 3}]}]},\n id='Merge sub dict-set',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs'}, 0: {'k'}}},\n {'subs': [{'k': 1, 'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Nested different keys 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': ...}, 0: {'k'}}},\n {'subs': [{'k': 1, 'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Nested different keys 2',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs'}, 0: {'k': ...}}},\n {'subs': [{'k': 1, 'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Nested different keys 3',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}, 0: {'j'}}}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Nested different keys 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i': ...}, 0: {'j'}}}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Nested different keys 2',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'i'}, 0: {'j': ...}}}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Nested different keys 3',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs'}, 0: {'subsubs': {'__all__': {'j'}}}}},\n {'subs': [{'subsubs': [{'j': 1}, {'j': 2}]}, {'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Ignore __all__ for index with defined include 1',\n ),\n pytest.param(\n {'subs': {'__all__': {'subsubs': {'__all__': {'j'}}}, 0: ...}},\n {'subs': [{'k': 1, 'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'subsubs': [{'j': 3}]}]},\n id='Ignore __all__ for index with defined include 2',\n ),\n pytest.param(\n {'subs': {'__all__': ..., 0: {'subsubs'}}},\n {'subs': [{'subsubs': [{'i': 1, 'j': 1}, {'i': 2, 'j': 2}]}, {'k': 2, 'subsubs': [{'i': 3, 'j': 3}]}]},\n id='Ignore __all__ for index with defined include 3',\n ),\n ],\n)\ndef test_advanced_include_nested_lists(include, expected):\n class SubSubModel(BaseModel):\n i: int\n j: int\n\n class SubModel(BaseModel):\n k: int\n subsubs: List[SubSubModel]\n\n class Model(BaseModel):\n subs: List[SubModel]\n\n m = Model(subs=[dict(k=1, subsubs=[dict(i=1, j=1), dict(i=2, j=2)]), dict(k=2, subsubs=[dict(i=3, j=3)])])\n\n assert m.model_dump(include=include) == 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_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_ignore_extra_test_field_set_ignore_extra.assert_m2_model_dump_excl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_ignore_extra_test_field_set_ignore_extra.assert_m2_model_dump_excl", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 868, "end_line": 883, "span_ids": ["test_field_set_ignore_extra"], "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 test_field_set_ignore_extra():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.ignore)\n a: int\n b: int\n c: int = 3\n\n m = Model(a=1, b=2)\n assert m.model_dump() == {'a': 1, 'b': 2, 'c': 3}\n assert m.__fields_set__ == {'a', 'b'}\n assert m.model_dump(exclude_unset=True) == {'a': 1, 'b': 2}\n\n m2 = Model(a=1, b=2, d=4)\n assert m2.model_dump() == {'a': 1, 'b': 2, 'c': 3}\n assert m2.__fields_set__ == {'a', 'b'}\n assert m2.model_dump(exclude_unset=True) == {'a': 1, 'b': 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_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_allow_extra_test_field_set_allow_extra.assert_m2_model_dump_excl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_allow_extra_test_field_set_allow_extra.assert_m2_model_dump_excl", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 886, "end_line": 901, "span_ids": ["test_field_set_allow_extra"], "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 test_field_set_allow_extra():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.allow)\n a: int\n b: int\n c: int = 3\n\n m = Model(a=1, b=2)\n assert m.model_dump() == {'a': 1, 'b': 2, 'c': 3}\n assert m.__fields_set__ == {'a', 'b'}\n assert m.model_dump(exclude_unset=True) == {'a': 1, 'b': 2}\n\n m2 = Model(a=1, b=2, d=4)\n assert m2.model_dump() == {'a': 1, 'b': 2, 'c': 3, 'd': 4}\n assert m2.__fields_set__ == {'a', 'b', 'd'}\n assert m2.model_dump(exclude_unset=True) == {'a': 1, 'b': 2, 'd': 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_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_field_name_test_values_order.assert_list_m_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_set_field_name_test_values_order.assert_list_m_a_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 904, "end_line": 922, "span_ids": ["test_values_order", "test_field_set_field_name"], "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 test_field_set_field_name():\n class Model(BaseModel):\n a: int\n field_set: int\n b: int = 3\n\n assert Model(a=1, field_set=2).model_dump() == {'a': 1, 'field_set': 2, 'b': 3}\n assert Model(a=1, field_set=2).model_dump(exclude_unset=True) == {'a': 1, 'field_set': 2}\n assert Model.model_construct(a=1, field_set=3).model_dump() == {'a': 1, 'field_set': 3, 'b': 3}\n\n\ndef test_values_order():\n class Model(BaseModel):\n a: int = 1\n b: int = 2\n c: int = 3\n\n m = Model(c=30, b=20, a=10)\n assert list(m) == [('a', 10), ('b', 20), ('c', 30)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_inheritance_test_inheritance.assert_Bar3_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_inheritance_test_inheritance.assert_Bar3_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 925, "end_line": 951, "span_ids": ["test_inheritance"], "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 test_inheritance():\n class Foo(BaseModel):\n a: float = ...\n\n with pytest.raises(\n TypeError,\n match=(\n \"Field 'a' defined on a base class was overridden by a non-annotated attribute. \"\n 'All field definitions, including overrides, require a type annotation.'\n ),\n ):\n\n class Bar(Foo):\n x: float = 12.3\n a = 123.0\n\n class Bar2(Foo):\n x: float = 12.3\n a: float = 123.0\n\n assert Bar2().model_dump() == {'x': 12.3, 'a': 123.0}\n\n class Bar3(Foo):\n x: float = 12.3\n a: float = Field(default=123.0)\n\n assert Bar3().model_dump() == {'x': 12.3, 'a': 123.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_pydantic__pydantic/tests/test_edge_cases.py_test_inheritance_subclass_default_test_inheritance_subclass_default.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_inheritance_subclass_default_test_inheritance_subclass_default.None_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 954, "end_line": 976, "span_ids": ["test_inheritance_subclass_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": "def test_inheritance_subclass_default():\n class MyStr(str):\n pass\n\n # Confirm hint supports a subclass default\n class Simple(BaseModel):\n x: str = MyStr('test')\n\n model_config = dict(arbitrary_types_allowed=True)\n\n # Confirm hint on a base can be overridden with a subclass default on a subclass\n class Base(BaseModel):\n x: str\n y: str\n\n class Sub(Base):\n x: str = MyStr('test')\n y: MyStr = MyStr('test') # force subtype\n\n model_config = dict(arbitrary_types_allowed=True)\n\n assert Sub.model_fields['x'].annotation == str\n assert Sub.model_fields['y'].annotation == MyStr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_type_test_valid_string_types.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_type_test_valid_string_types.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 979, "end_line": 1007, "span_ids": ["CustomStr", "CustomStr.foobar", "test_invalid_type", "test_valid_string_types"], "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 test_invalid_type():\n with pytest.raises(PydanticSchemaGenerationError) as exc_info:\n\n class Model(BaseModel):\n x: 43 = 123\n\n assert 'Unable to generate pydantic-core schema for 43' in exc_info.value.args[0]\n\n\nclass CustomStr(str):\n def foobar(self):\n return 7\n\n\n@pytest.mark.parametrize(\n 'value,expected',\n [\n ('a string', 'a string'),\n (b'some bytes', 'some bytes'),\n (bytearray('foobar', encoding='utf8'), 'foobar'),\n (StrEnum.a, 'a10'),\n (CustomStr('whatever'), 'whatever'),\n ],\n)\ndef test_valid_string_types(value, expected):\n class Model(BaseModel):\n v: str\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_string_types_test_inheritance_config.assert_repr_m2_Child": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_string_types_test_inheritance_config.assert_repr_m2_Child", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1010, "end_line": 1043, "span_ids": ["test_invalid_string_types", "test_inheritance_config"], "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": "@pytest.mark.parametrize(\n 'value,errors',\n [\n (\n {'foo': 'bar'},\n [{'input': {'foo': 'bar'}, 'loc': ('v',), 'msg': 'Input should be a valid string', 'type': 'string_type'}],\n ),\n (\n [1, 2, 3],\n [{'input': [1, 2, 3], 'loc': ('v',), 'msg': 'Input should be a valid string', 'type': 'string_type'}],\n ),\n ],\n)\ndef test_invalid_string_types(value, errors):\n class Model(BaseModel):\n v: str\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n assert exc_info.value.errors() == errors\n\n\ndef test_inheritance_config():\n class Parent(BaseModel):\n a: str\n\n class Child(Parent):\n model_config = ConfigDict(str_to_lower=True)\n b: str\n\n m1 = Parent(a='A')\n m2 = Child(a='A', b='B')\n assert repr(m1) == \"Parent(a='A')\"\n assert repr(m2) == \"Child(a='a', 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_pydantic__pydantic/tests/test_edge_cases.py_test_partial_inheritance_config_test_partial_inheritance_config.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_partial_inheritance_config_test_partial_inheritance_config.None_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1046, "end_line": 1076, "span_ids": ["test_partial_inheritance_config"], "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 test_partial_inheritance_config():\n class Parent(BaseModel):\n a: int = Field(ge=0)\n\n class Child(Parent):\n b: int = Field(ge=0)\n\n Child(a=0, b=0)\n with pytest.raises(ValidationError) as exc_info:\n Child(a=-1, b=0)\n assert exc_info.value.errors() == [\n {\n 'ctx': {'ge': 0},\n 'input': -1,\n 'loc': ('a',),\n 'msg': 'Input should be greater than or equal to 0',\n 'type': 'greater_than_equal',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Child(a=0, b=-1)\n assert exc_info.value.errors() == [\n {\n 'ctx': {'ge': 0},\n 'input': -1,\n 'loc': ('b',),\n 'msg': 'Input should be greater than or equal to 0',\n 'type': 'greater_than_equal',\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_pydantic__pydantic/tests/test_edge_cases.py_test_annotation_inheritance_test_annotation_inheritance.with_pytest_raises_.D.integer._G_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_annotation_inheritance_test_annotation_inheritance.with_pytest_raises_.D.integer._G_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1079, "end_line": 1103, "span_ids": ["test_annotation_inheritance"], "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 test_annotation_inheritance():\n class A(BaseModel):\n integer: int = 1\n\n class B(A):\n integer: int = 2\n\n assert B.model_fields['integer'].annotation == int\n\n class C(A):\n integer: str = 'G'\n\n assert C.__annotations__['integer'] == str\n assert C.model_fields['integer'].annotation == str\n\n with pytest.raises(\n TypeError,\n match=(\n \"Field 'integer' defined on a base class was overridden by a non-annotated attribute. \"\n \"All field definitions, including overrides, require a type annotation.\"\n ),\n ):\n\n class D(A):\n integer = '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_pydantic__pydantic/tests/test_edge_cases.py_test_string_none_test_optional_required.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_string_none_test_optional_required.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1106, "end_line": 1159, "span_ids": ["test_string_none", "test_optional_required"], "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": "def test_string_none():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.ignore)\n a: constr(min_length=20, max_length=1000) = ...\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=None)\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('a',), 'msg': 'Input should be a valid string', 'type': 'string_type'}\n ]\n\n\n# def test_return_errors_ok():\n# class Model(BaseModel):\n# foo: int\n# bar: List[int]\n#\n# assert validate_model(Model, {'foo': '123', 'bar': (1, 2, 3)}) == (\n# {'foo': 123, 'bar': [1, 2, 3]},\n# {'foo', 'bar'},\n# None,\n# )\n# d, f, e = validate_model(Model, {'foo': '123', 'bar': (1, 2, 3)}, False)\n# assert d == {'foo': 123, 'bar': [1, 2, 3]}\n# assert f == {'foo', 'bar'}\n# assert e is None\n\n\n# def test_return_errors_error():\n# class Model(BaseModel):\n# foo: int\n# bar: List[int]\n#\n# d, f, e = validate_model(Model, {'foo': '123', 'bar': (1, 2, 'x')}, False)\n# assert d == {'foo': 123}\n# assert f == {'foo', 'bar'}\n# assert e.errors() == [{'loc': ('bar', 2), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}]\n#\n# d, f, e = validate_model(Model, {'bar': (1, 2, 3)}, False)\n# assert d == {'bar': [1, 2, 3]}\n# assert f == {'bar'}\n# assert e.errors() == [{'loc': ('foo',), 'msg': 'field required', 'type': 'value_error.missing'}]\n\n\ndef test_optional_required():\n class Model(BaseModel):\n bar: Optional[int]\n\n assert Model(bar=123).model_dump() == {'bar': 123}\n assert Model(bar=None).model_dump() == {'bar': None}\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('bar',), 'msg': 'Field required', 'type': '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_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_validator_test_invalid_validator.with_pytest_raises_errors.InvalidValidatorModel.x._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_validator_test_invalid_validator.with_pytest_raises_errors.InvalidValidatorModel.x._", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1162, "end_line": 1177, "span_ids": ["test_invalid_validator"], "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": "@pytest.mark.xfail(reason='items yielded by __get_validators__ are not inspected for valid signatures')\ndef test_invalid_validator():\n class InvalidValidator:\n @classmethod\n def __get_validators__(cls):\n yield cls.has_wrong_arguments\n\n @classmethod\n def has_wrong_arguments(cls, value, bar):\n pass\n\n with pytest.raises(errors.PydanticUserError, match='Invalid signature for validator'):\n\n class InvalidValidatorModel(BaseModel):\n model_config = dict(arbitrary_types_allowed=True)\n x: InvalidValidator = ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_unable_to_infer_test_unable_to_infer.with_pytest_raises_.InvalidDefinitionModel.x.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_unable_to_infer_test_unable_to_infer.with_pytest_raises_.InvalidDefinitionModel.x.None", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1180, "end_line": 1191, "span_ids": ["test_unable_to_infer"], "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 test_unable_to_infer():\n with pytest.raises(\n errors.PydanticUserError,\n match=re.escape(\n \"A non-annotated attribute was detected: `x = None`. All model fields require a type annotation; \"\n \"if 'x' is not meant to be a field, you may be able to resolve this error by annotating it as a \"\n \"ClassVar or updating model_config[\\\"ignored_types\\\"]\"\n ),\n ):\n\n class InvalidDefinitionModel(BaseModel):\n x = 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_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_errors_test_multiple_errors.assert_Model_a_None_a_is": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_errors_test_multiple_errors.assert_Model_a_None_a_is", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1194, "end_line": 1226, "span_ids": ["test_multiple_errors"], "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 test_multiple_errors():\n class Model(BaseModel):\n a: Union[None, int, float, Decimal]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foobar')\n\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a', 'int'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'foobar',\n },\n {\n 'type': 'float_parsing',\n 'loc': ('a', 'float'),\n 'msg': 'Input should be a valid number, unable to parse string as an number',\n 'input': 'foobar',\n },\n {\n 'type': 'decimal_parsing',\n 'loc': (\n 'a',\n 'lax-or-strict[lax=function-after[DecimalValidator(allow_inf_nan=False, check_digits=False, strict=False)(), union[is-instance[Decimal],int,float,constrained-str]],strict=custom-error[function-after[DecimalValidator(allow_inf_nan=False, check_digits=False, strict=False)(), is-instance[Decimal]]]]', # noqa: E501\n ),\n 'msg': 'Input should be a valid decimal',\n 'input': 'foobar',\n },\n ]\n\n assert Model(a=1.5).a == 1.5\n assert Model(a=None).a 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_pydantic__pydantic/tests/test_edge_cases.py_test_validate_default_test_illegal_extra_value.with_pytest_raises_ValueE.Model.foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_validate_default_test_illegal_extra_value.with_pytest_raises_ValueE.Model.foo", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1229, "end_line": 1256, "span_ids": ["test_illegal_extra_value", "test_force_extra", "test_validate_default"], "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 test_validate_default():\n class Model(BaseModel):\n model_config = ConfigDict(validate_default=True)\n a: int\n b: int\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [\n {'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {}, 'loc': ('b',), 'msg': 'Field required', 'type': 'missing'},\n ]\n\n\ndef test_force_extra():\n class Model(BaseModel):\n model_config = ConfigDict(extra='ignore')\n foo: int\n\n assert Model.model_config['extra'] is Extra.ignore\n\n\ndef test_illegal_extra_value():\n with pytest.raises(ValueError, match=re.escape(\"is not a valid value for config['extra']\")):\n\n class Model(BaseModel):\n model_config = ConfigDict(extra='foo')\n foo: 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_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_inheritance_config_test_multiple_inheritance_config.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_inheritance_config_test_multiple_inheritance_config.None_15", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1259, "end_line": 1287, "span_ids": ["test_multiple_inheritance_config"], "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 test_multiple_inheritance_config():\n class Parent(BaseModel):\n model_config = ConfigDict(frozen=True, extra=Extra.forbid)\n\n class Mixin(BaseModel):\n model_config = ConfigDict(use_enum_values=True)\n\n class Child(Mixin, Parent):\n model_config = ConfigDict(populate_by_name=True)\n\n assert BaseModel.model_config['frozen'] is False\n assert BaseModel.model_config['populate_by_name'] is False\n assert BaseModel.model_config['extra'] is None\n assert BaseModel.model_config['use_enum_values'] is False\n\n assert Parent.model_config['frozen'] is True\n assert Parent.model_config['populate_by_name'] is False\n assert Parent.model_config['extra'] is Extra.forbid\n assert Parent.model_config['use_enum_values'] is False\n\n assert Mixin.model_config['frozen'] is False\n assert Mixin.model_config['populate_by_name'] is False\n assert Mixin.model_config['extra'] is None\n assert Mixin.model_config['use_enum_values'] is True\n\n assert Child.model_config['frozen'] is True\n assert Child.model_config['populate_by_name'] is True\n assert Child.model_config['extra'] is Extra.forbid\n assert Child.model_config['use_enum_values'] is 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_pydantic__pydantic/tests/test_edge_cases.py_test_submodel_different_type_test_submodel_different_type.None_1.Spam_c_Bar_b_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_submodel_different_type_test_submodel_different_type.None_1.Spam_c_Bar_b_123_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1290, "end_line": 1306, "span_ids": ["test_submodel_different_type"], "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 test_submodel_different_type():\n class Foo(BaseModel):\n a: int\n\n class Bar(BaseModel):\n b: int\n\n class Spam(BaseModel):\n c: Foo\n\n assert Spam(c={'a': '123'}).model_dump() == {'c': {'a': 123}}\n with pytest.raises(ValidationError):\n Spam(c={'b': '123'})\n\n assert Spam(c=Foo(a='123')).model_dump() == {'c': {'a': 123}}\n with pytest.raises(ValidationError):\n Spam(c=Bar(b='123'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_self_test_self_recursive.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_self_test_self_recursive.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1309, "end_line": 1332, "span_ids": ["test_self_recursive", "test_self"], "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 test_self():\n class Model(BaseModel):\n self: str\n\n m = Model.model_validate(dict(self='some value'))\n assert m.model_dump() == {'self': 'some value'}\n assert m.self == 'some value'\n assert m.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'self': {'title': 'Self', 'type': 'string'}},\n 'required': ['self'],\n }\n\n\ndef test_self_recursive():\n class SubModel(BaseModel):\n self: int\n\n class Model(BaseModel):\n sm: SubModel\n\n m = Model.model_validate({'sm': {'self': '123'}})\n assert m.model_dump() == {'sm': {'self': 123}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_nested_init_test_nested_init.assert_m_nest_modified_nu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_nested_init_test_nested_init.assert_m_nest_modified_nu", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1335, "end_line": 1358, "span_ids": ["test_nested_init"], "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": "@pytest.mark.xfail(reason='need to detect and error if you override __init__; need to suggest a migration path')\ndef test_nested_init():\n class NestedModel(BaseModel):\n self: str\n modified_number: int = 1\n\n def __init__(someinit, **kwargs):\n super().__init__(**kwargs)\n someinit.modified_number += 1\n\n class TopModel(BaseModel):\n self: str\n nest: NestedModel\n\n # TODO: Do we want any changes to this behavior in v2? (Currently the __init__-override is not called)\n # \"I guess this should be an error or warning. If you want to do stuff on init, you should use model_post_init\"\n # https://github.com/pydantic/pydantic/pull/5151#discussion_r1130684097\n # -\n # I think we can detect and warn/error if you override `__init__`. If we do that,\n # we'll need to add a note to the migration guide about it.\n m = TopModel.model_validate(dict(self='Top Model', nest=dict(self='Nested Model', modified_number=0)))\n assert m.self == 'Top Model'\n assert m.nest.self == 'Nested Model'\n assert m.nest.modified_number == 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_pydantic__pydantic/tests/test_edge_cases.py_test_init_inspection_test_type_on_annotation.assert_Model_model_fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_init_inspection_test_type_on_annotation.assert_Model_model_fields", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1361, "end_line": 1390, "span_ids": ["test_type_on_annotation", "test_init_inspection"], "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 test_init_inspection():\n class Foobar(BaseModel):\n x: int\n\n def __init__(self, **data) -> None:\n with pytest.raises(AttributeError):\n assert self.x\n super().__init__(**data)\n\n Foobar(x=1)\n\n\ndef test_type_on_annotation():\n class FooBar:\n pass\n\n class Model(BaseModel):\n a: int = int\n b: Type[int]\n c: Type[int] = int\n d: FooBar = FooBar\n e: Type[FooBar]\n f: Type[FooBar] = FooBar\n g: Sequence[Type[FooBar]] = [FooBar]\n h: Union[Type[FooBar], Sequence[Type[FooBar]]] = FooBar\n i: Union[Type[FooBar], Sequence[Type[FooBar]]] = [FooBar]\n\n model_config = dict(arbitrary_types_allowed=True)\n\n assert Model.model_fields.keys() == set('abcdefghi')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_assign_type_test_assign_type.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_assign_type_test_assign_type.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1393, "end_line": 1422, "span_ids": ["test_assign_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": "def test_assign_type():\n class Parent:\n def echo(self):\n return 'parent'\n\n class Child(Parent):\n def echo(self):\n return 'child'\n\n class Different:\n def echo(self):\n return 'different'\n\n class Model(BaseModel):\n v: Type[Parent] = Parent\n\n assert Model(v=Parent).v().echo() == 'parent'\n assert Model().v().echo() == 'parent'\n assert Model(v=Child).v().echo() == 'child'\n with pytest.raises(ValidationError) as exc_info:\n Model(v=Different)\n assert exc_info.value.errors() == [\n {\n 'ctx': {'class': 'test_assign_type..Parent'},\n 'input': HasRepr(\".Different'>\"),\n 'loc': ('v',),\n 'msg': 'Input should be a subclass of test_assign_type..Parent',\n 'type': 'is_subclass_of',\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_pydantic__pydantic/tests/test_edge_cases.py_test_optional_subfields_test_optional_subfields.assert_Model_a_12_a_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_optional_subfields_test_optional_subfields.assert_Model_a_12_a_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1425, "end_line": 1447, "span_ids": ["test_optional_subfields"], "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 test_optional_subfields():\n class Model(BaseModel):\n a: Optional[int]\n\n assert Model.model_fields['a'].annotation == Optional[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foobar')\n assert exc_info.value.errors() == [\n {\n 'input': 'foobar',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}]\n\n assert Model(a=None).a is None\n assert Model(a=12).a == 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_pydantic__pydantic/tests/test_edge_cases.py_test_validated_optional_subfields_test_validated_optional_subfields.assert_Model_a_12_a_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_validated_optional_subfields_test_validated_optional_subfields.assert_Model_a_12_a_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1450, "end_line": 1477, "span_ids": ["test_validated_optional_subfields"], "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 test_validated_optional_subfields():\n class Model(BaseModel):\n a: Optional[int]\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v):\n return v\n\n assert Model.model_fields['a'].annotation == Optional[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foobar')\n assert exc_info.value.errors() == [\n {\n 'input': 'foobar',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}]\n\n assert Model(a=None).a is None\n assert Model(a=12).a == 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_pydantic__pydantic/tests/test_edge_cases.py_test_optional_field_constraints_test_optional_field_constraints.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_optional_field_constraints_test_optional_field_constraints.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1480, "end_line": 1494, "span_ids": ["test_optional_field_constraints"], "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 test_optional_field_constraints():\n class MyModel(BaseModel):\n my_int: Optional[int] = Field(..., ge=3)\n\n with pytest.raises(ValidationError) as exc_info:\n MyModel(my_int=2)\n assert exc_info.value.errors() == [\n {\n 'ctx': {'ge': 3},\n 'input': 2,\n 'loc': ('my_int',),\n 'msg': 'Input should be greater than or equal to 3',\n 'type': 'greater_than_equal',\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_pydantic__pydantic/tests/test_edge_cases.py_test_field_str_shape_DisplayGen.__get_validators__.yield_validator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_str_shape_DisplayGen.__get_validators__.yield_validator", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1497, "end_line": 1519, "span_ids": ["DisplayGen.__init__", "test_field_str_shape", "impl", "DisplayGen", "DisplayGen.__get_validators__"], "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 test_field_str_shape():\n class Model(BaseModel):\n a: List[int]\n\n assert repr(Model.model_fields['a']) == 'FieldInfo(annotation=List[int], required=True)'\n assert str(Model.model_fields['a']) == 'annotation=List[int] required=True'\n\n\nT1 = TypeVar('T1')\nT2 = TypeVar('T2')\n\n\nclass DisplayGen(Generic[T1, T2]):\n def __init__(self, t1: T1, t2: T2):\n self.t1 = t1\n self.t2 = t2\n\n @classmethod\n def __get_validators__(cls):\n def validator(v):\n return v\n\n yield validator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_type_display_test_field_type_display.assert_re_search_fr_ann": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_field_type_display_test_field_type_display.assert_re_search_fr_ann", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1522, "end_line": 1556, "span_ids": ["test_field_type_display"], "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": "@pytest.mark.parametrize(\n 'type_,expected',\n [\n (int, 'int'),\n (Optional[int], 'Union[int, NoneType]'),\n (Union[None, int, str], 'Union[NoneType, int, str]'),\n (Union[int, str, bytes], 'Union[int, str, bytes]'),\n (List[int], 'List[int]'),\n (Tuple[int, str, bytes], 'Tuple[int, str, bytes]'),\n (Union[List[int], Set[bytes]], 'Union[List[int], Set[bytes]]'),\n (List[Tuple[int, int]], 'List[Tuple[int, int]]'),\n (Dict[int, str], 'Dict[int, str]'),\n (FrozenSet[int], 'FrozenSet[int]'),\n (Tuple[int, ...], 'Tuple[int, ...]'),\n (Optional[List[int]], 'Union[List[int], NoneType]'),\n (dict, 'dict'),\n pytest.param(\n DisplayGen[bool, str],\n 'DisplayGen[bool, str]',\n marks=pytest.mark.skipif(sys.version_info[:2] <= (3, 9), reason='difference in __name__ between versions'),\n ),\n pytest.param(\n DisplayGen[bool, str],\n 'tests.test_edge_cases.DisplayGen[bool, str]',\n marks=pytest.mark.skipif(sys.version_info[:2] > (3, 9), reason='difference in __name__ between versions'),\n ),\n ],\n)\ndef test_field_type_display(type_, expected):\n class Model(BaseModel):\n a: type_\n\n model_config = dict(arbitrary_types_allowed=True)\n\n assert re.search(fr'\\(annotation={re.escape(expected)},', str(Model.model_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_pydantic__pydantic/tests/test_edge_cases.py_test_any_none_test_type_var_any.assert_MyModel_foo_123_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_any_none_test_type_var_any.assert_MyModel_foo_123_f", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1559, "end_line": 1581, "span_ids": ["test_type_var_any", "test_any_none"], "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 test_any_none():\n class MyModel(BaseModel):\n foo: Any\n\n m = MyModel(foo=None)\n assert dict(m) == {'foo': None}\n\n\ndef test_type_var_any():\n Foobar = TypeVar('Foobar')\n\n class MyModel(BaseModel):\n foo: Foobar\n\n assert MyModel.model_json_schema() == {\n 'properties': {'foo': {'title': 'Foo'}},\n 'required': ['foo'],\n 'title': 'MyModel',\n 'type': 'object',\n }\n assert MyModel(foo=None).foo is None\n assert MyModel(foo='x').foo == 'x'\n assert MyModel(foo=123).foo == 123", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_var_constraint_test_type_var_constraint.assert_MyModel_foo_123_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_var_constraint_test_type_var_constraint.assert_MyModel_foo_123_f", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1584, "end_line": 1611, "span_ids": ["test_type_var_constraint"], "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 test_type_var_constraint():\n Foobar = TypeVar('Foobar', int, str)\n\n class MyModel(BaseModel):\n foo: Foobar\n\n assert MyModel.model_json_schema() == {\n 'title': 'MyModel',\n 'type': 'object',\n 'properties': {'foo': {'title': 'Foo', 'anyOf': [{'type': 'integer'}, {'type': 'string'}]}},\n 'required': ['foo'],\n }\n with pytest.raises(ValidationError) as exc_info:\n MyModel(foo=None)\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('foo', 'int'), 'msg': 'Input should be a valid integer', 'type': 'int_type'},\n {'input': None, 'loc': ('foo', 'str'), 'msg': 'Input should be a valid string', 'type': 'string_type'},\n ]\n\n with pytest.raises(ValidationError):\n MyModel(foo=[1, 2, 3])\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('foo', 'int'), 'msg': 'Input should be a valid integer', 'type': 'int_type'},\n {'input': None, 'loc': ('foo', 'str'), 'msg': 'Input should be a valid string', 'type': 'string_type'},\n ]\n\n assert MyModel(foo='x').foo == 'x'\n assert MyModel(foo=123).foo == 123", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_var_bound_test_type_var_bound.assert_MyModel_foo_123_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_var_bound_test_type_var_bound.assert_MyModel_foo_123_f", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1614, "end_line": 1637, "span_ids": ["test_type_var_bound"], "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 test_type_var_bound():\n Foobar = TypeVar('Foobar', bound=int)\n\n class MyModel(BaseModel):\n foo: Foobar\n\n assert MyModel.model_json_schema() == {\n 'title': 'MyModel',\n 'type': 'object',\n 'properties': {'foo': {'title': 'Foo', 'type': 'integer'}},\n 'required': ['foo'],\n }\n with pytest.raises(ValidationError) as exc_info:\n MyModel(foo=None)\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('foo',), 'msg': 'Input should be a valid integer', 'type': 'int_type'}\n ]\n\n with pytest.raises(ValidationError):\n MyModel(foo='x')\n assert exc_info.value.errors() == [\n {'input': None, 'loc': ('foo',), 'msg': 'Input should be a valid integer', 'type': 'int_type'}\n ]\n assert MyModel(foo=123).foo == 123", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_bare_test_dict_any.assert_m_foo_x_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_dict_bare_test_dict_any.assert_m_foo_x_a_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1640, "end_line": 1661, "span_ids": ["test_list_bare", "test_dict_bare", "test_dict_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 test_dict_bare():\n class MyModel(BaseModel):\n foo: Dict\n\n m = MyModel(foo={'x': 'a', 'y': None})\n assert m.foo == {'x': 'a', 'y': None}\n\n\ndef test_list_bare():\n class MyModel(BaseModel):\n foo: List\n\n m = MyModel(foo=[1, 2, None])\n assert m.foo == [1, 2, None]\n\n\ndef test_dict_any():\n class MyModel(BaseModel):\n foo: Dict[str, Any]\n\n m = MyModel(foo={'x': 'a', 'y': None})\n assert m.foo == {'x': 'a', 'y': 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_pydantic__pydantic/tests/test_edge_cases.py_test_modify_fields_test_exclude_none.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_modify_fields_test_exclude_none.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1664, "end_line": 1692, "span_ids": ["test_modify_fields", "test_exclude_none"], "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 test_modify_fields():\n class Foo(BaseModel):\n foo: List[List[int]]\n\n @field_validator('foo')\n @classmethod\n def check_something(cls, value):\n return value\n\n class Bar(Foo):\n pass\n\n assert repr(Foo.model_fields['foo']) == 'FieldInfo(annotation=List[List[int]], required=True)'\n assert repr(Bar.model_fields['foo']) == 'FieldInfo(annotation=List[List[int]], required=True)'\n assert Foo(foo=[[0, 1]]).foo == [[0, 1]]\n assert Bar(foo=[[0, 1]]).foo == [[0, 1]]\n\n\ndef test_exclude_none():\n class MyModel(BaseModel):\n a: Optional[int] = None\n b: int = 2\n\n m = MyModel(a=5)\n assert m.model_dump(exclude_none=True) == {'a': 5, 'b': 2}\n\n m = MyModel(b=3)\n assert m.model_dump(exclude_none=True) == {'b': 3}\n assert m.model_dump_json(exclude_none=True) == '{\"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_pydantic__pydantic/tests/test_edge_cases.py_test_exclude_none_recursive_test_exclude_none_recursive.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_exclude_none_recursive_test_exclude_none_recursive.None_5", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1695, "end_line": 1714, "span_ids": ["test_exclude_none_recursive"], "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 test_exclude_none_recursive():\n class ModelA(BaseModel):\n a: Optional[int] = None\n b: int = 1\n\n class ModelB(BaseModel):\n c: int\n d: int = 2\n e: ModelA\n f: Optional[str] = None\n\n m = ModelB(c=5, e={'a': 0})\n assert m.model_dump() == {'c': 5, 'd': 2, 'e': {'a': 0, 'b': 1}, 'f': None}\n assert m.model_dump(exclude_none=True) == {'c': 5, 'd': 2, 'e': {'a': 0, 'b': 1}}\n assert dict(m) == {'c': 5, 'd': 2, 'e': ModelA(a=0), 'f': None}\n\n m = ModelB(c=5, e={'b': 20}, f='test')\n assert m.model_dump() == {'c': 5, 'd': 2, 'e': {'a': None, 'b': 20}, 'f': 'test'}\n assert m.model_dump(exclude_none=True) == {'c': 5, 'd': 2, 'e': {'b': 20}, 'f': 'test'}\n assert dict(m) == {'c': 5, 'd': 2, 'e': ModelA(b=20), 'f': '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_pydantic__pydantic/tests/test_edge_cases.py_test_exclude_none_with_extra_test_exclude_none_with_extra.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_exclude_none_with_extra_test_exclude_none_with_extra.None_3", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1717, "end_line": 1731, "span_ids": ["test_exclude_none_with_extra"], "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 test_exclude_none_with_extra():\n class MyModel(BaseModel):\n model_config = ConfigDict(extra='allow')\n a: str = 'default'\n b: Optional[str] = None\n\n m = MyModel(a='a', c='c')\n\n assert m.model_dump(exclude_none=True) == {'a': 'a', 'c': 'c'}\n assert m.model_dump() == {'a': 'a', 'b': None, 'c': 'c'}\n\n m = MyModel(a='a', b='b', c=None)\n\n assert m.model_dump(exclude_none=True) == {'a': 'a', 'b': 'b'}\n assert m.model_dump() == {'a': 'a', 'b': 'b', 'c': 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_pydantic__pydantic/tests/test_edge_cases.py_test_str_method_inheritance_test_repr_method_inheritance.assert_repr_Bar_7_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_str_method_inheritance_test_repr_method_inheritance.assert_repr_Bar_7_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1734, "end_line": 1765, "span_ids": ["test_repr_method_inheritance", "test_str_method_inheritance"], "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 test_str_method_inheritance():\n import pydantic\n\n class Foo(pydantic.BaseModel):\n x: int = 3\n y: int = 4\n\n def __str__(self):\n return str(self.y + self.x)\n\n class Bar(Foo):\n z: bool = False\n\n assert str(Foo()) == '7'\n assert str(Bar()) == '7'\n\n\ndef test_repr_method_inheritance():\n import pydantic\n\n class Foo(pydantic.BaseModel):\n x: int = 3\n y: int = 4\n\n def __repr__(self):\n return repr(self.y + self.x)\n\n class Bar(Foo):\n z: bool = False\n\n assert repr(Foo()) == '7'\n assert repr(Bar()) == '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_pydantic__pydantic/tests/test_edge_cases.py_test_optional_validator_test_optional_validator.assert_val_calls_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_optional_validator_test_optional_validator.assert_val_calls_None", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1768, "end_line": 1786, "span_ids": ["test_optional_validator"], "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 test_optional_validator():\n val_calls = []\n\n class Model(BaseModel):\n something: Optional[str]\n\n @field_validator('something')\n @classmethod\n def check_something(cls, v):\n val_calls.append(v)\n return v\n\n with pytest.raises(ValidationError) as exc_info:\n assert Model().model_dump() == {'something': None}\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('something',), 'msg': 'Field required', 'type': 'missing'}]\n\n assert Model(something=None).model_dump() == {'something': None}\n assert Model(something='hello').model_dump() == {'something': 'hello'}\n assert val_calls == [None, 'hello']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_required_optional_test_required_optional.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_required_optional_test_required_optional.None_5", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1789, "end_line": 1822, "span_ids": ["test_required_optional"], "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": "def test_required_optional():\n class Model(BaseModel):\n nullable1: Optional[int] = ...\n nullable2: Optional[int] = Field(...)\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [\n {'input': {}, 'loc': ('nullable1',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {}, 'loc': ('nullable2',), 'msg': 'Field required', 'type': 'missing'},\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(nullable1=1)\n assert exc_info.value.errors() == [\n {'input': {'nullable1': 1}, 'loc': ('nullable2',), 'msg': 'Field required', 'type': 'missing'}\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(nullable2=2)\n assert exc_info.value.errors() == [\n {'input': {'nullable2': 2}, 'loc': ('nullable1',), 'msg': 'Field required', 'type': 'missing'}\n ]\n assert Model(nullable1=None, nullable2=None).model_dump() == {'nullable1': None, 'nullable2': None}\n assert Model(nullable1=1, nullable2=2).model_dump() == {'nullable1': 1, 'nullable2': 2}\n with pytest.raises(ValidationError) as exc_info:\n Model(nullable1='some text')\n assert exc_info.value.errors() == [\n {\n 'input': 'some text',\n 'loc': ('nullable1',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {'input': {'nullable1': 'some text'}, 'loc': ('nullable2',), 'msg': 'Field required', 'type': 'missing'},\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_pydantic__pydantic/tests/test_edge_cases.py_test_required_any_test_required_any.assert_Model_optional1_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_required_any_test_required_any.assert_Model_optional1_o", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1825, "end_line": 1892, "span_ids": ["test_required_any"], "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": "def test_required_any():\n class Model(BaseModel):\n optional1: Any\n optional2: Any = None\n optional3: Optional[Any] = None\n nullable1: Any = ...\n nullable2: Any = Field(...)\n nullable3: Optional[Any]\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [\n {'input': {}, 'loc': ('optional1',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {}, 'loc': ('nullable1',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {}, 'loc': ('nullable2',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {}, 'loc': ('nullable3',), 'msg': 'Field required', 'type': 'missing'},\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(nullable1='a')\n assert exc_info.value.errors() == [\n {'input': {'nullable1': 'a'}, 'loc': ('optional1',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {'nullable1': 'a'}, 'loc': ('nullable2',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {'nullable1': 'a'}, 'loc': ('nullable3',), 'msg': 'Field required', 'type': 'missing'},\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(nullable2=False)\n assert exc_info.value.errors() == [\n {'input': {'nullable2': False}, 'loc': ('optional1',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {'nullable2': False}, 'loc': ('nullable1',), 'msg': 'Field required', 'type': 'missing'},\n {'input': {'nullable2': False}, 'loc': ('nullable3',), 'msg': 'Field required', 'type': 'missing'},\n ]\n with pytest.raises(ValidationError) as exc_info:\n assert Model(nullable1=None, nullable2=None).model_dump() == {\n 'optional1': None,\n 'optional2': None,\n 'nullable1': None,\n 'nullable2': None,\n }\n assert exc_info.value.errors() == [\n {\n 'input': {'nullable1': None, 'nullable2': None},\n 'loc': ('optional1',),\n 'msg': 'Field required',\n 'type': 'missing',\n },\n {\n 'input': {'nullable1': None, 'nullable2': None},\n 'loc': ('nullable3',),\n 'msg': 'Field required',\n 'type': 'missing',\n },\n ]\n assert Model(optional1=None, nullable1=1, nullable2='two', nullable3=None).model_dump() == {\n 'optional1': None,\n 'optional2': None,\n 'optional3': None,\n 'nullable1': 1,\n 'nullable2': 'two',\n 'nullable3': None,\n }\n assert Model(optional1='op1', optional2=False, nullable1=1, nullable2='two', nullable3='three').model_dump() == {\n 'optional1': 'op1',\n 'optional2': False,\n 'optional3': None,\n 'nullable1': 1,\n 'nullable2': 'two',\n 'nullable3': 'three',\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_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.return.core_schema_general_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.return.core_schema_general_after", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1895, "end_line": 1924, "span_ids": ["test_custom_generic_validators"], "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": "@pytest.mark.xfail(reason='need to modify loc of ValidationError')\ndef test_custom_generic_validators():\n T1 = TypeVar('T1')\n T2 = TypeVar('T2')\n\n class MyGen(Generic[T1, T2]):\n def __init__(self, t1: T1, t2: T2):\n self.t1 = t1\n self.t2 = t2\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source, **kwargs):\n schema = core_schema.is_instance_schema(cls)\n\n args = get_args(source)\n if not args:\n return schema\n\n t1_f = AnalyzedType(args[0]).validate_python\n t2_f = AnalyzedType(args[1]).validate_python\n\n def validate(v, info):\n if not args:\n return v\n # TODO: Collect these errors, rather than stopping early, and modify the loc to make the test pass\n t1_f(v.t1)\n t2_f(v.t2)\n return v\n\n return core_schema.general_after_validator_function(validate, schema)\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_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators.Model_test_custom_generic_validators.assert_m_gen2_t2_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators.Model_test_custom_generic_validators.assert_m_gen2_t2_2", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1926, "end_line": 1968, "span_ids": ["test_custom_generic_validators"], "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": "@pytest.mark.xfail(reason='need to modify loc of ValidationError')\ndef test_custom_generic_validators():\n # ... other code\n\n class Model(BaseModel):\n a: str\n gen: MyGen[str, bool]\n gen2: MyGen\n\n model_config = dict(arbitrary_types_allowed=True)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foo', gen='invalid', gen2='invalid')\n assert exc_info.value.errors() == [\n {\n 'ctx': {'class': 'test_custom_generic_validators..MyGen'},\n 'input': 'invalid',\n 'loc': ('gen',),\n 'msg': 'Input should be an instance of test_custom_generic_validators..MyGen',\n 'type': 'is_instance_of',\n },\n {\n 'ctx': {'class': 'test_custom_generic_validators..MyGen'},\n 'input': 'invalid',\n 'loc': ('gen2',),\n 'msg': 'Input should be an instance of test_custom_generic_validators..MyGen',\n 'type': 'is_instance_of',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foo', gen=MyGen(t1='bar', t2='baz'), gen2=MyGen(t1='bar', t2='baz'))\n assert exc_info.value.errors() == [\n {\n 'input': 'baz',\n 'loc': ('gen', 't2'),\n 'msg': 'Input should be a valid boolean, unable to interpret input',\n 'type': 'bool_parsing',\n }\n ]\n\n m = Model(a='foo', gen=MyGen(t1='bar', t2=True), gen2=MyGen(t1=1, t2=2))\n assert m.a == 'foo'\n assert m.gen.t1 == 'bar'\n assert m.gen.t2 is True\n assert m.gen2.t1 == 1\n assert m.gen2.t2 == 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_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_arbitrary_allowed_test_custom_generic_arbitrary_allowed.assert_m_gen_t2_is_True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_arbitrary_allowed_test_custom_generic_arbitrary_allowed.assert_m_gen_t2_is_True", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 1971, "end_line": 2007, "span_ids": ["test_custom_generic_arbitrary_allowed"], "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 test_custom_generic_arbitrary_allowed():\n T1 = TypeVar('T1')\n T2 = TypeVar('T2')\n\n class MyGen(Generic[T1, T2]):\n def __init__(self, t1: T1, t2: T2):\n self.t1 = t1\n self.t2 = t2\n\n class Model(BaseModel):\n a: str\n gen: MyGen[str, bool]\n\n model_config = dict(arbitrary_types_allowed=True)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foo', gen='invalid')\n assert exc_info.value.errors() == [\n {\n 'ctx': {'class': 'test_custom_generic_arbitrary_allowed..MyGen'},\n 'input': 'invalid',\n 'loc': ('gen',),\n 'msg': 'Input should be an instance of ' 'test_custom_generic_arbitrary_allowed..MyGen',\n 'type': 'is_instance_of',\n }\n ]\n\n # No validation, no exception\n m = Model(a='foo', gen=MyGen(t1='bar', t2='baz'))\n assert m.a == 'foo'\n assert m.gen.t1 == 'bar'\n assert m.gen.t2 == 'baz'\n\n m = Model(a='foo', gen=MyGen(t1='bar', t2=True))\n assert m.a == 'foo'\n assert m.gen.t1 == 'bar'\n assert m.gen.t2 is 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_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_disallowed_test_custom_generic_disallowed.with_pytest_raises_TypeEr.Model.gen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_disallowed_test_custom_generic_disallowed.with_pytest_raises_TypeEr.Model.gen", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2010, "end_line": 2027, "span_ids": ["test_custom_generic_disallowed"], "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 test_custom_generic_disallowed():\n T1 = TypeVar('T1')\n T2 = TypeVar('T2')\n\n class MyGen(Generic[T1, T2]):\n def __init__(self, t1: T1, t2: T2):\n self.t1 = t1\n self.t2 = t2\n\n match = (\n r'Unable to generate pydantic-core schema for (.*)MyGen\\[str, bool\\](.*). '\n r'Setting `arbitrary_types_allowed=True` in the model_config may prevent this error.'\n )\n with pytest.raises(TypeError, match=match):\n\n class Model(BaseModel):\n a: str\n gen: MyGen[str, 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_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_required_test_hashable_required.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_required_test_hashable_required.None_1", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2030, "end_line": 2053, "span_ids": ["test_hashable_required"], "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 test_hashable_required():\n class Model(BaseModel):\n v: Hashable\n\n # TODO: Should arbitrary_types_allowed be necessary for Hashable?\n # \"ideally I guess we should have a validator for this.\"\n # https://github.com/pydantic/pydantic/pull/5151#discussion_r1130684977\n model_config = dict(arbitrary_types_allowed=True)\n\n Model(v=None)\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[])\n assert exc_info.value.errors() == [\n {\n 'ctx': {'class': 'Hashable'},\n 'input': [],\n 'loc': ('v',),\n 'msg': 'Input should be an instance of Hashable',\n 'type': 'is_instance_of',\n }\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('v',), 'msg': 'Field required', 'type': '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_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_optional_test_default_factory_called_once.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_optional_test_default_factory_called_once.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2056, "end_line": 2093, "span_ids": ["test_default_factory_called_once", "test_hashable_optional"], "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": "@pytest.mark.parametrize('default', [1, None])\ndef test_hashable_optional(default):\n class Model(BaseModel):\n v: Hashable = default\n\n model_config = dict(arbitrary_types_allowed=True)\n\n Model(v=None)\n Model()\n\n\ndef test_default_factory_called_once():\n \"\"\"It should never call `default_factory` more than once even when `validate_all` is set\"\"\"\n\n v = 0\n\n def factory() -> int:\n nonlocal v\n v += 1\n return v\n\n class MyModel(BaseModel):\n model_config = ConfigDict(validate_default=True)\n id: int = Field(default_factory=factory)\n\n m1 = MyModel()\n assert m1.id == 1\n\n class MyBadModel(BaseModel):\n model_config = ConfigDict(validate_default=True)\n id: List[str] = Field(default_factory=factory)\n\n with pytest.raises(ValidationError) as exc_info:\n MyBadModel()\n assert v == 2 # `factory` has been called to run validation\n assert exc_info.value.errors() == [\n {'input': 2, 'loc': ('id',), 'msg': 'Input should be a valid list', 'type': 'list_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_pydantic__pydantic/tests/test_edge_cases.py_test_default_factory_validator_child_test_default_factory_validator_child.assert_Child_foo_a_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_default_factory_validator_child_test_default_factory_validator_child.assert_Child_foo_a_b", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2096, "end_line": 2110, "span_ids": ["test_default_factory_validator_child"], "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 test_default_factory_validator_child():\n class Parent(BaseModel):\n foo: List[str] = Field(default_factory=list)\n\n @field_validator('foo', mode='before')\n @classmethod\n def mutate_foo(cls, v):\n return [f'{x}-1' for x in v]\n\n assert Parent(foo=['a', 'b']).foo == ['a-1', 'b-1']\n\n class Child(Parent):\n pass\n\n assert Child(foo=['a', 'b']).foo == ['a-1', 'b-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_pydantic__pydantic/tests/test_edge_cases.py_test_resolve_annotations_module_missing_test_iter_coverage.with_pytest_warns_.assert_list_MyModel__it": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_resolve_annotations_module_missing_test_iter_coverage.with_pytest_warns_.assert_list_MyModel__it", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2113, "end_line": 2140, "span_ids": ["test_resolve_annotations_module_missing", "test_iter_coverage"], "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 test_resolve_annotations_module_missing(tmp_path):\n # see https://github.com/pydantic/pydantic/issues/2363\n file_path = tmp_path / 'module_to_load.py'\n # language=Python\n file_path.write_text(\n \"\"\"\nfrom pydantic import BaseModel\nclass User(BaseModel):\n id: int\n name: str = 'Jane Doe'\n\"\"\"\n )\n\n spec = importlib.util.spec_from_file_location('my_test_module', file_path)\n module = importlib.util.module_from_spec(spec)\n spec.loader.exec_module(module)\n assert module.User(id=12).model_dump() == {'id': 12, 'name': 'Jane Doe'}\n\n\ndef test_iter_coverage():\n class MyModel(BaseModel):\n x: int = 1\n y: str = 'a'\n\n with pytest.warns(\n DeprecationWarning, match='The private method `_iter` will be removed and should no longer be used.'\n ):\n assert list(MyModel()._iter(by_alias=True)) == [('x', 1), ('y', '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_pydantic__pydantic/tests/test_edge_cases.py_test_frozen_config_and_field_test_frozen_config_and_field.assert_b_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_frozen_config_and_field_test_frozen_config_and_field.assert_b_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2143, "end_line": 2164, "span_ids": ["test_frozen_config_and_field"], "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": "@pytest.mark.xfail(reason='field frozen')\ndef test_frozen_config_and_field():\n class Foo(BaseModel):\n model_config = ConfigDict(frozen=False, validate_assignment=True)\n a: str = Field(...)\n\n assert Foo.model_fields['a'].metadata == []\n\n f = Foo(a='x')\n f.a = 'y'\n assert f.model_dump() == {'a': 'y'}\n\n class Bar(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n a: str = Field(..., frozen=True)\n\n assert PydanticGeneralMetadata(frozen=True) in Bar.model_fields['a'].metadata\n\n b = Bar(a='x')\n with pytest.raises(TypeError):\n b.a = 'y'\n assert b.model_dump() == {'a': '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_pydantic__pydantic/tests/test_edge_cases.py_test_arbitrary_types_allowed_custom_eq_test_bytes_subclass.assert_m_my_bytes___class": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_arbitrary_types_allowed_custom_eq_test_bytes_subclass.assert_m_my_bytes___class", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2167, "end_line": 2191, "span_ids": ["test_bytes_subclass", "test_arbitrary_types_allowed_custom_eq"], "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 test_arbitrary_types_allowed_custom_eq():\n class Foo:\n def __eq__(self, other):\n if other.__class__ is not Foo:\n raise TypeError(f'Cannot interpret {other.__class__.__name__!r} as a valid type')\n return True\n\n class Model(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n x: Foo = Foo()\n\n assert Model().x == Foo()\n\n\ndef test_bytes_subclass():\n class MyModel(BaseModel):\n my_bytes: bytes\n\n class BytesSubclass(bytes):\n def __new__(cls, data: bytes):\n self = bytes.__new__(cls, data)\n return self\n\n m = MyModel(my_bytes=BytesSubclass(b'foobar'))\n assert m.my_bytes.__class__ == BytesSubclass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_int_subclass_test_model_issubclass.assert_not_issubclass_Cus": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_int_subclass_test_model_issubclass.assert_not_issubclass_Cus", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2194, "end_line": 2222, "span_ids": ["test_model_issubclass", "test_int_subclass"], "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": "@pytest.mark.xfail(reason='subclass not preserved for field of type int')\ndef test_int_subclass():\n class MyModel(BaseModel):\n my_int: int\n\n class IntSubclass(int):\n def __new__(cls, data: int):\n self = int.__new__(cls, data)\n return self\n\n m = MyModel(my_int=IntSubclass(123))\n # TODO: Is this still the behavior we want in v2? (Currently m.my_int.__class__ is int)\n # \"yes, because in pydantic-core we cast the value to a rust i64, so the sub-type information is lost.\"\n # (more detail about how to handle this in: https://github.com/pydantic/pydantic/pull/5151#discussion_r1130691036)\n assert m.my_int.__class__ == IntSubclass\n\n\ndef test_model_issubclass():\n assert not issubclass(int, BaseModel)\n\n class MyModel(BaseModel):\n x: int\n\n assert issubclass(MyModel, BaseModel)\n\n class Custom:\n __fields__ = True\n\n assert not issubclass(Custom, BaseModel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_long_int_test_long_int.None_3.Model_x_1_10_7_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_long_int_test_long_int.None_3.Model_x_1_10_7_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2225, "end_line": 2272, "span_ids": ["test_long_int"], "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": "@pytest.mark.xfail(reason='\"long int\", see details below')\ndef test_long_int():\n \"\"\"\n see https://github.com/pydantic/pydantic/issues/1477 and in turn, https://github.com/python/cpython/issues/95778\n \"\"\"\n\n class Model(BaseModel):\n x: int\n\n # TODO: The next line now raises the following error:\n # E pydantic_core._pydantic_core.ValidationError: 1 validation error for Model\n # E x\n # E Input should be a finite number [type=finite_number,\n # input_value='111111111111111111111111...11111111111111111111111', input_type=str]\n # Do we need to resolve this? How hard would that be in pydantic_core? Is it worth it?\n # -\n # \"in pydantic-core we use an i64, which constrains the max and min values. Since that's massively more\n # performant, and there are very few real world uses for int > i64:MAX, the error is correct.\"\n # https://github.com/pydantic/pydantic/pull/5151#discussion_r1130693762\n # -\n # I think before modifying this test and removing the xfail, we should create a new test\n # that handles the following line without failure using the is-instance approach described in the comment\n # linked above.\n assert Model(x='1' * 4_300).x == int('1' * 4_300)\n assert Model(x=b'1' * 4_300).x == int('1' * 4_300)\n assert Model(x=bytearray(b'1' * 4_300)).x == int('1' * 4_300)\n\n too_long = '1' * 4_301\n with pytest.raises(ValidationError) as exc_info:\n Model(x=too_long)\n\n assert exc_info.value.errors() == [\n {\n 'loc': ('x',),\n 'msg': 'value is not a valid integer',\n 'type': 'type_error.integer',\n },\n ]\n\n too_long_b = too_long.encode('utf-8')\n with pytest.raises(ValidationError):\n Model(x=too_long_b)\n with pytest.raises(ValidationError):\n Model(x=bytearray(too_long_b))\n\n # this used to hang indefinitely\n with pytest.raises(ValidationError):\n Model(x='1' * (10**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_pydantic__pydantic/tests/test_edge_cases.py_test_parent_field_with_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_parent_field_with_default_", "embedding": null, "metadata": {"file_path": "tests/test_edge_cases.py", "file_name": "test_edge_cases.py", "file_type": "text/x-python", "category": "test", "start_line": 2275, "end_line": 2307, "span_ids": ["test_parent_field_with_default", "test_get_config"], "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 test_parent_field_with_default():\n class Parent(BaseModel):\n a: int = 1\n b: int = Field(2)\n\n class Child(Parent):\n c: int = 3\n\n c = Child()\n assert c.a == 1\n assert c.b == 2\n assert c.c == 3\n\n\ndef test_get_config():\n ret = get_config(None)\n assert ret == {}\n assert isinstance(ret, ConfigDict)\n\n ret = get_config(ConfigDict(title='1234', extra=Extra.allow))\n assert ret == {'title': '1234', 'extra': Extra.allow}\n assert isinstance(ret, ConfigDict)\n\n class Config:\n title = '1234'\n random_option = True\n strict = True\n\n with pytest.warns(DeprecationWarning, match='is deprecated'):\n ret = get_config(Config)\n assert ret == {'title': '1234', 'random_option': True, 'strict': True}\n assert isinstance(ret, ConfigDict)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py____ErrorKey.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py____ErrorKey.pass", "embedding": null, "metadata": {"file_path": "tests/test_fastapi_json_schema.py", "file_name": "test_fastapi_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["_ErrorKey", "docstring"], "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": "\"\"\"\nThis file contains an initial proposal that can be scrapped and reworked if/when appropriate.\nEither way, this test file should probably be removed once the actual FastAPI implementation\nis complete and has integration tests with pydantic v2. However, we are including it here for now\nto get an early warning if this approach would require modification for compatibility with\nany future changes to the JSON schema generation logic, etc.\n\nSee the original PR for more details: https://github.com/pydantic/pydantic/pull/5094\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Any\n\nfrom dirty_equals import HasRepr, IsInstance, IsStr\nfrom pydantic_core import CoreSchema\nfrom pydantic_core.core_schema import TypedDictField\n\nfrom pydantic import BaseModel, ConfigDict\nfrom pydantic._internal._core_metadata import CoreMetadataHandler\nfrom pydantic.errors import PydanticInvalidForJsonSchema\nfrom pydantic.json_schema import GenerateJsonSchema, JsonSchemaValue\n\n\nclass _ErrorKey(str):\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_pydantic__pydantic/tests/test_fastapi_json_schema.py_FastAPIGenerateJsonSchema_FastAPIGenerateJsonSchema._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_FastAPIGenerateJsonSchema_FastAPIGenerateJsonSchema._", "embedding": null, "metadata": {"file_path": "tests/test_fastapi_json_schema.py", "file_name": "test_fastapi_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 47, "span_ids": ["FastAPIGenerateJsonSchema"], "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 FastAPIGenerateJsonSchema(GenerateJsonSchema):\n \"\"\"\n Idea: This class would be exported from FastAPI, and if users want to modify the way JSON schema is generated\n in FastAPI, they should inherit from it and override it as appropriate.\n\n In the JSON schema generation logic, FastAPI _could_ also attempt to work with classes that inherit directly from\n GenerateJsonSchema by doing something like:\n\n if UserGenerateJsonSchema.handle_invalid_for_json_schema is GenerateJsonSchema.handle_invalid_for_json_schema:\n # The method has not been overridden; inherit from FastAPIGenerateJsonSchema\n UserGenerateJsonSchema = type(\n \"UserGenerateJsonSchema\", (FastAPIGenerateJsonSchema, UserGenerateJsonSchema), {}\n )\n else:\n raise TypeError(f\"{UserGenerateJsonSchema.__name__} should inherit from FastAPIGenerateJsonSchema\")\n\n I'm not sure which approach is better.\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_pydantic__pydantic/tests/test_fastapi_json_schema.py_FastAPIGenerateJsonSchema.handle_invalid_for_json_schema_FastAPIGenerateJsonSchema.handle_invalid_for_json_schema.if_CoreMetadataHandler_sc.else_.return.__ErrorKey_error_erro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_FastAPIGenerateJsonSchema.handle_invalid_for_json_schema_FastAPIGenerateJsonSchema.handle_invalid_for_json_schema.if_CoreMetadataHandler_sc.else_.return.__ErrorKey_error_erro", "embedding": null, "metadata": {"file_path": "tests/test_fastapi_json_schema.py", "file_name": "test_fastapi_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 58, "span_ids": ["FastAPIGenerateJsonSchema.handle_invalid_for_json_schema"], "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 FastAPIGenerateJsonSchema(GenerateJsonSchema):\n\n def handle_invalid_for_json_schema(self, schema: CoreSchema | TypedDictField, error_info: str) -> JsonSchemaValue:\n # NOTE: I think it may be a good idea to rework this method to either not use CoreMetadataHandler,\n # and/or to make CoreMetadataHandler a public API.\n if CoreMetadataHandler(schema).metadata.get('pydantic_js_modify_function') is not None:\n # Since there is a json schema modify function, assume that this type is meant to be handled,\n # and the modify function will set all properties as appropriate\n return {}\n else:\n error = PydanticInvalidForJsonSchema(f'Cannot generate a JsonSchema for {error_info}')\n return {_ErrorKey('error'): 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_pydantic__pydantic/tests/test_fastapi_json_schema.py_ErrorDetails_collect_errors.return.errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_ErrorDetails_collect_errors.return.errors", "embedding": null, "metadata": {"file_path": "tests/test_fastapi_json_schema.py", "file_name": "test_fastapi_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 81, "span_ids": ["ErrorDetails", "collect_errors"], "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": "@dataclass\nclass ErrorDetails:\n path: list[Any]\n error: PydanticInvalidForJsonSchema\n\n\ndef collect_errors(schema: JsonSchemaValue) -> list[ErrorDetails]:\n errors: list[ErrorDetails] = []\n\n def _collect_errors(schema: JsonSchemaValue, path: list[Any]) -> None:\n if isinstance(schema, dict):\n for k, v in schema.items():\n if isinstance(k, _ErrorKey):\n errors.append(ErrorDetails(path, schema[k]))\n _collect_errors(v, list(path) + [k])\n elif isinstance(schema, list):\n for i, v in enumerate(schema):\n _collect_errors(v, list(path) + [i])\n\n _collect_errors(schema, [])\n return 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_pydantic__pydantic/tests/test_fastapi_json_schema.py_test_inheritance_detection_test_inheritance_detection.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_test_inheritance_detection_test_inheritance_detection.assert_", "embedding": null, "metadata": {"file_path": "tests/test_fastapi_json_schema.py", "file_name": "test_fastapi_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 84, "end_line": 94, "span_ids": ["test_inheritance_detection"], "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 test_inheritance_detection() -> None:\n class GenerateJsonSchema2(GenerateJsonSchema):\n pass\n\n assert GenerateJsonSchema2.handle_invalid_for_json_schema is GenerateJsonSchema.handle_invalid_for_json_schema\n # this is just a quick proof of the note above indicating that you can detect whether a specific method\n # is overridden, for the purpose of allowing direct inheritance from GenerateJsonSchema.\n assert (\n FastAPIGenerateJsonSchema.handle_invalid_for_json_schema\n is not GenerateJsonSchema.handle_invalid_for_json_schema\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_pydantic__pydantic/tests/test_fastapi_json_schema.py_test_collect_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fastapi_json_schema.py_test_collect_errors_", "embedding": null, "metadata": {"file_path": "tests/test_fastapi_json_schema.py", "file_name": "test_fastapi_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 97, "end_line": 131, "span_ids": ["test_collect_errors"], "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 test_collect_errors() -> None:\n class Car:\n def __init__(self, make: str, model: str, year: int):\n self.make = make\n self.model = model\n self.year = year\n\n class Model(BaseModel):\n f1: int = 1\n f2: Car\n\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n schema = Model.model_json_schema(schema_generator=FastAPIGenerateJsonSchema)\n assert schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'f1': {'type': 'integer', 'default': 1, 'title': 'F1'},\n 'f2': {\n 'error': HasRepr(IsStr(regex=r'PydanticInvalidForJsonSchema\\(.*\\)')),\n 'title': 'F2',\n },\n },\n 'required': ['f2'],\n }\n\n collected_errors = collect_errors(schema)\n assert collected_errors == [\n ErrorDetails(\n path=['properties', 'f2'],\n error=IsInstance(PydanticInvalidForJsonSchema),\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_pydantic__pydantic/tests/test_forward_ref.py_dataclasses_test_postponed_annotations_auto_model_rebuild.assert_module_Model_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_dataclasses_test_postponed_annotations_auto_model_rebuild.assert_module_Model_model", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["imports", "test_postponed_annotations", "test_postponed_annotations_auto_model_rebuild"], "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": "import dataclasses\nimport re\nimport sys\nfrom typing import Optional, Tuple\n\nimport pytest\n\nfrom pydantic import BaseModel, PydanticUserError, ValidationError\n\n\ndef test_postponed_annotations(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\nclass Model(BaseModel):\n a: int\n\"\"\"\n )\n m = module.Model(a='123')\n assert m.model_dump() == {'a': 123}\n\n\ndef test_postponed_annotations_auto_model_rebuild(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\nclass Model(BaseModel):\n a: Model\n\"\"\"\n )\n assert module.Model.model_fields['a'].annotation.__name__ == 'Model'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_auto_update_no_model_test_forward_ref_auto_update_no_model.assert_f_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_auto_update_no_model_test_forward_ref_auto_update_no_model.assert_f_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 75, "span_ids": ["test_forward_ref_auto_update_no_model"], "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_forward_ref_auto_update_no_model(create_module):\n @create_module\n def module():\n from typing import Optional\n\n from pydantic import BaseModel\n\n class Foo(BaseModel, undefined_types_warning=False):\n a: Optional['Bar'] = None\n\n class Bar(BaseModel):\n b: 'Foo'\n\n assert module.Foo.__pydantic_model_complete__ is False\n assert module.Bar.__pydantic_model_complete__ is True\n assert repr(module.Bar.model_fields['b']) == 'FieldInfo(annotation=Foo, required=True)'\n\n # Bar should be complete and ready to use\n b = module.Bar(b={'a': {'b': {}}})\n assert b.model_dump() == {'b': {'a': {'b': {'a': None}}}}\n\n # model_fields is complete on Foo\n assert repr(module.Foo.model_fields['a']) == (\n \"FieldInfo(annotation=Union[ForwardRef('Bar'), NoneType], required=False)\"\n )\n\n # but Foo is not ready to use\n with pytest.raises(PydanticUserError, match='`Foo` is not fully defined; you should define `Bar`,'):\n module.Foo(a={'b': {'a': {}}})\n\n assert module.Foo.model_rebuild() is True\n assert module.Foo.__pydantic_model_complete__ is True\n\n # now Foo is ready to use\n f = module.Foo(a={'b': {'a': {'b': {'a': None}}}})\n assert f.model_dump() == {'a': {'b': {'a': {'b': {'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_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_one_of_fields_not_defined_test_basic_forward_ref.assert_module_Bar_b_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_one_of_fields_not_defined_test_basic_forward_ref.assert_module_Bar_b_a_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 110, "span_ids": ["test_basic_forward_ref", "test_forward_ref_one_of_fields_not_defined"], "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 test_forward_ref_one_of_fields_not_defined(create_module):\n @create_module\n def module():\n from pydantic import BaseModel, ConfigDict\n\n class Foo(BaseModel):\n model_config = ConfigDict(undefined_types_warning=False)\n foo: 'Foo'\n bar: 'Bar'\n\n assert {k: repr(v) for k, v in module.Foo.model_fields.items()} == {\n 'foo': 'FieldInfo(annotation=Foo, required=True)',\n 'bar': \"FieldInfo(annotation=ForwardRef('Bar'), required=True)\",\n }\n\n\ndef test_basic_forward_ref(create_module):\n @create_module\n def module():\n from typing import ForwardRef, Optional\n\n from pydantic import BaseModel\n\n class Foo(BaseModel):\n a: int\n\n FooRef = ForwardRef('Foo')\n\n class Bar(BaseModel):\n b: Optional[FooRef] = None\n\n assert module.Bar().model_dump() == {'b': None}\n assert module.Bar(b={'a': '123'}).model_dump() == {'b': {'a': 123}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_module_test_self_forward_ref_module.assert_module_Foo_b_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_module_test_self_forward_ref_module.assert_module_Foo_b_a_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 127, "span_ids": ["test_self_forward_ref_module"], "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 test_self_forward_ref_module(create_module):\n @create_module\n def module():\n from typing import ForwardRef, Optional\n\n from pydantic import BaseModel\n\n FooRef = ForwardRef('Foo')\n\n class Foo(BaseModel):\n a: int = 123\n b: Optional[FooRef] = None\n\n assert module.Foo().model_dump() == {'a': 123, 'b': None}\n assert module.Foo(b={'a': '321'}).model_dump() == {'a': 123, 'b': {'a': 321, 'b': 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_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_collection_test_self_forward_ref_collection.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_collection_test_self_forward_ref_collection.None_6", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 130, "end_line": 163, "span_ids": ["test_self_forward_ref_collection"], "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 test_self_forward_ref_collection(create_module):\n @create_module\n def module():\n from typing import Dict, List\n\n from pydantic import BaseModel\n\n class Foo(BaseModel):\n a: int = 123\n b: 'Foo' = None\n c: 'List[Foo]' = []\n d: 'Dict[str, Foo]' = {}\n\n assert module.Foo().model_dump() == {'a': 123, 'b': None, 'c': [], 'd': {}}\n assert module.Foo(b={'a': '321'}, c=[{'a': 234}], d={'bar': {'a': 345}}).model_dump() == {\n 'a': 123,\n 'b': {'a': 321, 'b': None, 'c': [], 'd': {}},\n 'c': [{'a': 234, 'b': None, 'c': [], 'd': {}}],\n 'd': {'bar': {'a': 345, 'b': None, 'c': [], 'd': {}}},\n }\n\n with pytest.raises(ValidationError) as exc_info:\n module.Foo(b={'a': '321'}, c=[{'b': 234}], d={'bar': {'a': 345}})\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'dict_type', 'loc': ('c', 0, 'b'), 'msg': 'Input should be a valid dictionary', 'input': 234}\n ]\n\n assert repr(module.Foo.model_fields['a']) == 'FieldInfo(annotation=int, required=False, default=123)'\n assert repr(module.Foo.model_fields['b']) == 'FieldInfo(annotation=Foo, required=False)'\n if sys.version_info < (3, 10):\n return\n assert repr(module.Foo.model_fields['c']) == ('FieldInfo(annotation=List[Foo], required=False, ' 'default=[])')\n assert repr(module.Foo.model_fields['d']) == ('FieldInfo(annotation=Dict[str, Foo], required=False, 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_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_local_test_self_forward_ref_local.assert_Foo_b_a_321_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_forward_ref_local_test_self_forward_ref_local.assert_Foo_b_a_321_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 184, "span_ids": ["test_self_forward_ref_local"], "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 test_self_forward_ref_local(create_module):\n @create_module\n def module():\n from typing import ForwardRef\n\n from pydantic import BaseModel\n\n def main():\n Foo = ForwardRef('Foo')\n\n class Foo(BaseModel):\n a: int = 123\n b: Foo = None\n\n return Foo\n\n Foo = module.main()\n assert Foo().model_dump() == {'a': 123, 'b': None}\n assert Foo(b={'a': '321'}).model_dump() == {'a': 123, 'b': {'a': 321, 'b': 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_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_dataclass_test_forward_ref_dataclass.assert_dataclasses_asdict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_dataclass_test_forward_ref_dataclass.assert_dataclasses_asdict", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 200, "span_ids": ["test_forward_ref_dataclass"], "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 test_forward_ref_dataclass(create_module):\n @create_module\n def module():\n from typing import Optional\n\n from pydantic.dataclasses import dataclass\n\n @dataclass\n class MyDataclass:\n a: int\n b: Optional['MyDataclass'] = None\n\n dc = module.MyDataclass(a=1, b={'a': 2, 'b': {'a': 3}})\n assert dataclasses.asdict(dc) == {'a': 1, 'b': {'a': 2, 'b': {'a': 3, 'b': 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_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_sub_types_test_forward_ref_sub_types.assert_isinstance_node_ri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_sub_types_test_forward_ref_sub_types.assert_isinstance_node_ri", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 203, "end_line": 226, "span_ids": ["test_forward_ref_sub_types"], "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 test_forward_ref_sub_types(create_module):\n @create_module\n def module():\n from typing import ForwardRef, Union\n\n from pydantic import BaseModel\n\n class Leaf(BaseModel):\n a: str\n\n TreeType = Union[ForwardRef('Node'), Leaf]\n\n class Node(BaseModel):\n value: int\n left: TreeType\n right: TreeType\n\n Node = module.Node\n Leaf = module.Leaf\n data = {'value': 3, 'left': {'a': 'foo'}, 'right': {'value': 5, 'left': {'a': 'bar'}, 'right': {'a': 'buzz'}}}\n\n node = Node(**data)\n assert isinstance(node.left, Leaf)\n assert isinstance(node.right, 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_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_nested_sub_types_test_forward_ref_nested_sub_types.assert_isinstance_node_ri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_nested_sub_types_test_forward_ref_nested_sub_types.assert_isinstance_node_ri", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 256, "span_ids": ["test_forward_ref_nested_sub_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": "def test_forward_ref_nested_sub_types(create_module):\n @create_module\n def module():\n from typing import ForwardRef, Tuple, Union\n\n from pydantic import BaseModel\n\n class Leaf(BaseModel):\n a: str\n\n TreeType = Union[Union[Tuple[ForwardRef('Node'), str], int], Leaf]\n\n class Node(BaseModel):\n value: int\n left: TreeType\n right: TreeType\n\n Node = module.Node\n Leaf = module.Leaf\n data = {\n 'value': 3,\n 'left': {'a': 'foo'},\n 'right': [{'value': 5, 'left': {'a': 'bar'}, 'right': {'a': 'buzz'}}, 'test'],\n }\n\n node = Node(**data)\n assert isinstance(node.left, Leaf)\n assert isinstance(node.right[0], 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_pydantic__pydantic/tests/test_forward_ref.py_test_self_reference_json_schema_test_self_reference_json_schema.assert_Account_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_reference_json_schema_test_self_reference_json_schema.assert_Account_model_json", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 289, "span_ids": ["test_self_reference_json_schema"], "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_self_reference_json_schema(create_module):\n @create_module\n def module():\n from typing import List\n\n from pydantic import BaseModel\n\n class Account(BaseModel):\n name: str\n subaccounts: List['Account'] = []\n\n Account = module.Account\n assert Account.model_json_schema() == {\n 'allOf': [{'$ref': '#/$defs/Account'}],\n '$defs': {\n 'Account': {\n 'title': 'Account',\n 'type': 'object',\n 'properties': {\n 'name': {'title': 'Name', 'type': 'string'},\n 'subaccounts': {\n 'title': 'Subaccounts',\n 'default': [],\n 'type': 'array',\n 'items': {'$ref': '#/$defs/Account'},\n },\n },\n 'required': ['name'],\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_pydantic__pydantic/tests/test_forward_ref.py_test_self_reference_json_schema_with_future_annotations_test_self_reference_json_schema_with_future_annotations.assert_Account_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_self_reference_json_schema_with_future_annotations_test_self_reference_json_schema_with_future_annotations.assert_Account_model_json", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 292, "end_line": 324, "span_ids": ["test_self_reference_json_schema_with_future_annotations"], "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 test_self_reference_json_schema_with_future_annotations(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom typing import List\nfrom pydantic import BaseModel\n\nclass Account(BaseModel):\n name: str\n subaccounts: List[Account] = []\n \"\"\"\n )\n Account = module.Account\n assert Account.model_json_schema() == {\n 'allOf': [{'$ref': '#/$defs/Account'}],\n '$defs': {\n 'Account': {\n 'title': 'Account',\n 'type': 'object',\n 'properties': {\n 'name': {'title': 'Name', 'type': 'string'},\n 'subaccounts': {\n 'title': 'Subaccounts',\n 'default': [],\n 'type': 'array',\n 'items': {'$ref': '#/$defs/Account'},\n },\n },\n 'required': ['name'],\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_pydantic__pydantic/tests/test_forward_ref.py_test_circular_reference_json_schema_test_circular_reference_json_schema.assert_Account_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_circular_reference_json_schema_test_circular_reference_json_schema.assert_Account_model_json", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 327, "end_line": 370, "span_ids": ["test_circular_reference_json_schema"], "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 test_circular_reference_json_schema(create_module):\n @create_module\n def module():\n from typing import List\n\n from pydantic import BaseModel\n\n class Owner(BaseModel):\n account: 'Account'\n\n model_config = dict(undefined_types_warning=False)\n\n class Account(BaseModel):\n name: str\n owner: 'Owner'\n subaccounts: List['Account'] = []\n\n Account = module.Account\n assert Account.model_json_schema() == {\n 'allOf': [{'$ref': '#/$defs/Account'}],\n '$defs': {\n 'Account': {\n 'title': 'Account',\n 'type': 'object',\n 'properties': {\n 'name': {'title': 'Name', 'type': 'string'},\n 'owner': {'$ref': '#/$defs/Owner'},\n 'subaccounts': {\n 'title': 'Subaccounts',\n 'default': [],\n 'type': 'array',\n 'items': {'$ref': '#/$defs/Account'},\n },\n },\n 'required': ['name', 'owner'],\n },\n 'Owner': {\n 'title': 'Owner',\n 'type': 'object',\n 'properties': {'account': {'$ref': '#/$defs/Account'}},\n 'required': ['account'],\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_pydantic__pydantic/tests/test_forward_ref.py_test_circular_reference_json_schema_with_future_annotations_test_circular_reference_json_schema_with_future_annotations.assert_Account_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_circular_reference_json_schema_with_future_annotations_test_circular_reference_json_schema_with_future_annotations.assert_Account_model_json", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 373, "end_line": 419, "span_ids": ["test_circular_reference_json_schema_with_future_annotations"], "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 test_circular_reference_json_schema_with_future_annotations(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom typing import List\nfrom pydantic import BaseModel\n\nclass Owner(BaseModel):\n account: Account\n\n model_config=dict(undefined_types_warning=False)\n\nclass Account(BaseModel):\n name: str\n owner: Owner\n subaccounts: List[Account] = []\n\n \"\"\"\n )\n Account = module.Account\n assert Account.model_json_schema() == {\n 'allOf': [{'$ref': '#/$defs/Account'}],\n '$defs': {\n 'Account': {\n 'title': 'Account',\n 'type': 'object',\n 'properties': {\n 'name': {'title': 'Name', 'type': 'string'},\n 'owner': {'$ref': '#/$defs/Owner'},\n 'subaccounts': {\n 'title': 'Subaccounts',\n 'default': [],\n 'type': 'array',\n 'items': {'$ref': '#/$defs/Account'},\n },\n },\n 'required': ['name', 'owner'],\n },\n 'Owner': {\n 'title': 'Owner',\n 'type': 'object',\n 'properties': {'account': {'$ref': '#/$defs/Account'}},\n 'required': ['account'],\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_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_with_field_test_forward_ref_optional.assert_isinstance_Filter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_with_field_test_forward_ref_optional.assert_isinstance_Filter_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 422, "end_line": 472, "span_ids": ["test_forward_ref_with_field", "test_forward_ref_optional"], "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": "def test_forward_ref_with_field(create_module):\n @create_module\n def module():\n from typing import ForwardRef, List\n\n import pytest\n from pydantic_core import SchemaError\n\n from pydantic import BaseModel, Field\n\n Foo = ForwardRef('Foo')\n\n with pytest.raises(SchemaError, match=r'Extra inputs are not permitted \\[type=extra_forbidden,'):\n\n class Foo(BaseModel):\n c: List[Foo] = Field(..., gt=0)\n\n\ndef test_forward_ref_optional(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel, Field, ConfigDict\nfrom typing import List, Optional\n\n\nclass Spec(BaseModel):\n spec_fields: List[str] = Field(..., alias=\"fields\")\n filter: Optional[str] = None\n sort: Optional[str]\n\n\nclass PSpec(Spec):\n model_config = ConfigDict(undefined_types_warning = False)\n # FIXME investigate why this wasn't causing errors before\n g: Optional[GSpec] = None\n\n\nclass GSpec(Spec):\n p: Optional[PSpec]\n\n# PSpec.model_rebuild()\n\nclass Filter(BaseModel):\n g: Optional[GSpec] = None\n p: Optional[PSpec]\n \"\"\"\n )\n Filter = module.Filter\n assert isinstance(Filter(p={'sort': 'some_field:asc', 'fields': []}), Filter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_with_create_model_test_forward_ref_with_create_model.module.assert_instance_sub_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_with_create_model_test_forward_ref_with_create_model.module.assert_instance_sub_model", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 475, "end_line": 484, "span_ids": ["test_forward_ref_with_create_model"], "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 test_forward_ref_with_create_model(create_module):\n @create_module\n def module():\n import pydantic\n\n Sub = pydantic.create_model('Sub', foo=(str, 'bar'), __module__=__name__)\n assert Sub # get rid of \"local variable 'Sub' is assigned to but never used\"\n Main = pydantic.create_model('Main', sub=('Sub', ...), __module__=__name__)\n instance = Main(sub={})\n assert instance.sub.model_dump() == {'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_pydantic__pydantic/tests/test_forward_ref.py_test_resolve_forward_ref_dataclass_test_nested_forward_ref.assert_obj_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_resolve_forward_ref_dataclass_test_nested_forward_ref.assert_obj_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 487, "end_line": 516, "span_ids": ["test_nested_forward_ref", "test_resolve_forward_ref_dataclass"], "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 test_resolve_forward_ref_dataclass(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\n\nfrom pydantic import BaseModel\nfrom typing_extensions import Literal\n\n@dataclass\nclass Base:\n literal: Literal[1, 2]\n\nclass What(BaseModel):\n base: Base\n \"\"\"\n )\n\n m = module.What(base=module.Base(literal=1))\n assert m.base.literal == 1\n\n\ndef test_nested_forward_ref():\n class NestedTuple(BaseModel):\n x: Tuple[int, Optional['NestedTuple']]\n\n obj = NestedTuple.model_validate({'x': ('1', {'x': ('2', {'x': ('3', None)})})})\n assert obj.model_dump() == {'x': (1, {'x': (2, {'x': (3, 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_pydantic__pydantic/tests/test_forward_ref.py_test_discriminated_union_forward_ref_test_discriminated_union_forward_ref.assert_module_Pet_model_j": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_discriminated_union_forward_ref_test_discriminated_union_forward_ref.assert_module_Pet_model_j", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 519, "end_line": 575, "span_ids": ["test_discriminated_union_forward_ref"], "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 test_discriminated_union_forward_ref(create_module):\n @create_module\n def module():\n from typing import Union\n\n from typing_extensions import Literal\n\n from pydantic import BaseModel, Field\n\n class Pet(BaseModel):\n pet: Union['Cat', 'Dog'] = Field(discriminator='type')\n\n model_config = dict(undefined_types_warning=False)\n\n class Cat(BaseModel):\n type: Literal['cat']\n\n class Dog(BaseModel):\n type: Literal['dog']\n\n with pytest.raises(PydanticUserError, match='`Pet` is not fully defined; you should define `Cat`'):\n module.Pet.model_validate({'pet': {'type': 'pika'}})\n\n module.Pet.model_rebuild()\n\n with pytest.raises(\n ValidationError,\n match=\"Input tag 'pika' found using 'type' does not match any of the expected tags: 'cat', 'dog'\",\n ):\n module.Pet.model_validate({'pet': {'type': 'pika'}})\n\n assert module.Pet.model_json_schema() == {\n 'title': 'Pet',\n 'required': ['pet'],\n 'type': 'object',\n 'properties': {\n 'pet': {\n 'title': 'Pet',\n 'discriminator': {'mapping': {'cat': '#/$defs/Cat', 'dog': '#/$defs/Dog'}, 'propertyName': 'type'},\n 'oneOf': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}],\n }\n },\n '$defs': {\n 'Cat': {\n 'title': 'Cat',\n 'type': 'object',\n 'properties': {'type': {'const': 'cat', 'title': 'Type'}},\n 'required': ['type'],\n },\n 'Dog': {\n 'title': 'Dog',\n 'type': 'object',\n 'properties': {'type': {'const': 'dog', 'title': 'Type'}},\n 'required': ['type'],\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_pydantic__pydantic/tests/test_forward_ref.py_test_class_var_as_string_test_json_encoder_str.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_class_var_as_string_test_json_encoder_str.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 578, "end_line": 623, "span_ids": ["test_json_encoder_str", "test_class_var_as_string"], "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_class_var_as_string(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom typing import ClassVar\nfrom pydantic import BaseModel\n\nclass Model(BaseModel):\n a: ClassVar[int]\n\"\"\"\n )\n\n assert module.Model.__class_vars__ == {'a'}\n\n\n@pytest.mark.xfail(reason='json encoder stuff')\ndef test_json_encoder_str(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import BaseModel, ConfigDict\n\n\nclass User(BaseModel):\n x: str\n\n\nFooUser = User\n\n\nclass User(BaseModel):\n y: str\n\n\nclass Model(BaseModel):\n model_config=ConfigDict(json_encoders={'User': lambda v: f'User({v.y})'})\n foo_user: FooUser\n user: User\n\n\"\"\"\n )\n\n m = module.Model(foo_user={'x': 'user1'}, user={'y': 'user2'})\n # TODO: How can we replicate this custom-encoder functionality without affecting the serialization of `User`?\n assert m.model_dump_json(models_as_dict=False) == '{\"foo_user\": {\"x\": \"user1\"}, \"user\": \"User(user2)\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_json_encoder_forward_ref_test_json_encoder_forward_ref.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_json_encoder_forward_ref_test_json_encoder_forward_ref.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 626, "end_line": 647, "span_ids": ["test_json_encoder_forward_ref"], "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": "@pytest.mark.xfail(reason='json encoder stuff')\ndef test_json_encoder_forward_ref(create_module):\n # TODO: Replace the use of json_encoders with a root_serializer\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import BaseModel, ConfigDict\nfrom typing import ForwardRef, List, Optional\n\nclass User(BaseModel):\n name: str\n friends: Optional[List['User']] = None\n\n model_config = ConfigDict(\n json_encoders = {\n ForwardRef('User'): lambda v: f'User({v.name})',\n })\n\"\"\"\n )\n\n m = module.User(name='anne', friends=[{'name': 'ben'}, {'name': 'charlie'}])\n assert m.model_dump_json(models_as_dict=False) == '{\"name\": \"anne\", \"friends\": [\"User(ben)\", \"User(charlie)\"]}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_skip_pep585_test_pep585_self_referencing_generics.assert_obj_names_Self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_skip_pep585_test_pep585_self_referencing_generics.assert_obj_names_Self", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 650, "end_line": 676, "span_ids": ["test_pep585_self_referencing_generics", "impl"], "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": "skip_pep585 = pytest.mark.skipif(\n sys.version_info < (3, 9), reason='PEP585 generics only supported for python 3.9 and above'\n)\n\n\n@skip_pep585\ndef test_pep585_self_referencing_generics(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\nclass SelfReferencing(BaseModel):\n names: list[SelfReferencing] # noqa: F821\n\"\"\"\n )\n\n SelfReferencing = module.SelfReferencing\n if sys.version_info >= (3, 10):\n assert (\n repr(SelfReferencing.model_fields['names']) == 'FieldInfo(annotation=list[SelfReferencing], required=True)'\n )\n\n # test that object creation works\n obj = SelfReferencing(names=[SelfReferencing(names=[])])\n assert obj.names == [SelfReferencing(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_pydantic__pydantic/tests/test_forward_ref.py_test_pep585_recursive_generics_test_pep585_recursive_generics.assert_h_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_pep585_recursive_generics_test_pep585_recursive_generics.assert_h_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 679, "end_line": 706, "span_ids": ["test_pep585_recursive_generics"], "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": "@skip_pep585\ndef test_pep585_recursive_generics(create_module):\n @create_module\n def module():\n from typing import ForwardRef\n\n from pydantic import BaseModel, ConfigDict\n\n HeroRef = ForwardRef('Hero')\n\n class Team(BaseModel):\n model_config = ConfigDict(undefined_types_warning=False)\n\n name: str\n heroes: list[HeroRef]\n\n class Hero(BaseModel):\n name: str\n teams: list[Team]\n\n Team.model_rebuild()\n\n assert repr(module.Team.model_fields['heroes']) == \"FieldInfo(annotation=list[ForwardRef('Hero')], required=True)\"\n assert repr(module.Hero.model_fields['teams']) == 'FieldInfo(annotation=list[Team], required=True)'\n\n h = module.Hero(name='Ivan', teams=[module.Team(name='TheBest', heroes=[])])\n # insert_assert(h.model_dump())\n assert h.model_dump() == {'name': 'Ivan', 'teams': [{'name': 'TheBest', 'heroes': []}]}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_class_var_forward_ref_test_recursive_model.assert_f_y___fields_set__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_class_var_forward_ref_test_recursive_model.assert_f_y___fields_set__", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 709, "end_line": 741, "span_ids": ["test_class_var_forward_ref", "test_recursive_model"], "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": "@pytest.mark.skipif(sys.version_info < (3, 9), reason='needs 3.9 or newer')\ndef test_class_var_forward_ref(create_module):\n # see #3679\n create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom typing import ClassVar\nfrom pydantic import BaseModel\n\nclass WithClassVar(BaseModel):\n Instances: ClassVar[dict[str, WithClassVar]] = {}\n\"\"\"\n )\n\n\ndef test_recursive_model(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom typing import Optional\nfrom pydantic import BaseModel\n\nclass Foobar(BaseModel):\n x: int\n y: Optional[Foobar] = None\n\"\"\"\n )\n f = module.Foobar(x=1, y={'x': 2})\n assert f.model_dump() == {'x': 1, 'y': {'x': 2, 'y': None}}\n assert f.__fields_set__ == {'x', 'y'}\n assert f.y.__fields_set__ == {'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_pydantic__pydantic/tests/test_forward_ref.py_test_force_rebuild_test_rebuild_subclass_of_built_model.assert_FutureReferencingM": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_force_rebuild_test_rebuild_subclass_of_built_model.assert_FutureReferencingM", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 744, "end_line": 766, "span_ids": ["test_force_rebuild", "test_rebuild_subclass_of_built_model"], "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 test_force_rebuild():\n class Foobar(BaseModel):\n b: int\n\n assert Foobar.__pydantic_model_complete__ is True\n assert Foobar.model_rebuild() is None\n assert Foobar.model_rebuild(force=True) is True\n\n\ndef test_rebuild_subclass_of_built_model():\n class Model(BaseModel):\n x: int\n\n class FutureReferencingModel(Model):\n y: 'FutureModel'\n model_config = dict(undefined_types_warning=False)\n\n class FutureModel(BaseModel):\n pass\n\n FutureReferencingModel.model_rebuild()\n\n assert FutureReferencingModel(x=1, y=FutureModel()).model_dump() == {'x': 1, '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_pydantic__pydantic/tests/test_forward_ref.py_test_nested_annotation_test_nested_more_annotation.assert_bar_model___pydant": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_nested_annotation_test_nested_more_annotation.assert_bar_model___pydant", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 769, "end_line": 812, "span_ids": ["test_nested_annotation", "test_nested_more_annotation"], "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 test_nested_annotation(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\ndef nested():\n class Foo(BaseModel):\n a: int\n\n class Bar(BaseModel):\n b: Foo\n\n return Bar\n\"\"\"\n )\n\n bar_model = module.nested()\n assert bar_model.__pydantic_model_complete__ is True\n assert bar_model(b={'a': 1}).model_dump() == {'b': {'a': 1}}\n\n\ndef test_nested_more_annotation(create_module):\n @create_module\n def module():\n from pydantic import BaseModel, ConfigDict\n\n def nested():\n class Foo(BaseModel):\n a: int\n\n def more_nested():\n class Bar(BaseModel):\n model_config = ConfigDict(undefined_types_warning=False)\n b: 'Foo'\n\n return Bar\n\n return more_nested()\n\n bar_model = module.nested()\n # this does not work because Foo is in a parent scope\n assert bar_model.__pydantic_model_complete__ 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_pydantic__pydantic/tests/test_forward_ref.py_test_nested_annotation_priority_test_nested_annotation_priority.with_pytest_raises_Valida.bar_model_b_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_nested_annotation_priority_test_nested_annotation_priority.with_pytest_raises_Valida.bar_model_b_1_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 815, "end_line": 837, "span_ids": ["test_nested_annotation_priority"], "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 test_nested_annotation_priority(create_module):\n @create_module\n def module():\n from annotated_types import Gt\n from typing_extensions import Annotated\n\n from pydantic import BaseModel\n\n Foobar = Annotated[int, Gt(0)] # noqa: F841\n\n def nested():\n Foobar = Annotated[int, Gt(10)]\n\n class Bar(BaseModel):\n b: 'Foobar'\n\n return Bar\n\n bar_model = module.nested()\n assert bar_model.model_fields['b'].metadata[0].gt == 10\n assert bar_model(b=11).model_dump() == {'b': 11}\n with pytest.raises(ValidationError, match=r'Input should be greater than 10 \\[type=greater_than,'):\n bar_model(b=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_pydantic__pydantic/tests/test_forward_ref.py_test_nested_model_rebuild_test_nested_model_rebuild.assert_bar_model_b_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_nested_model_rebuild_test_nested_model_rebuild.assert_bar_model_b_a_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 840, "end_line": 859, "span_ids": ["test_nested_model_rebuild"], "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 test_nested_model_rebuild(create_module):\n @create_module\n def module():\n from pydantic import BaseModel, ConfigDict\n\n def nested():\n class Bar(BaseModel):\n model_config = ConfigDict(undefined_types_warning=False)\n b: 'Foo'\n\n class Foo(BaseModel):\n a: int\n\n assert Bar.__pydantic_model_complete__ is False\n Bar.model_rebuild()\n return Bar\n\n bar_model = module.nested()\n assert bar_model.__pydantic_model_complete__ is True\n assert bar_model(b={'a': 1}).model_dump() == {'b': {'a': 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_pydantic__pydantic/tests/test_forward_ref.py_pytest_raises_undefined_types_warning_pytest_raises_undefined_types_warning.return.pytest_raises_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_pytest_raises_undefined_types_warning_pytest_raises_undefined_types_warning.return.pytest_raises_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 862, "end_line": 874, "span_ids": ["pytest_raises_undefined_types_warning"], "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 pytest_raises_undefined_types_warning(defining_class_name, missing_type_name):\n \"\"\"Returns a pytest.raises context manager that checks for the correct undefined types warning message.\n usage: `with pytest_raises_undefined_types_warning(class_name='Foobar', missing_class_name='UndefinedType'):`\n \"\"\"\n\n return pytest.raises(\n UserWarning,\n match=re.escape(\n f'`{defining_class_name}` has an undefined annotation: `{missing_type_name}`. '\n 'It may be possible to resolve this by setting undefined_types_warning=False '\n f'in the config for `{defining_class_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_pydantic__pydantic/tests/test_forward_ref.py__NOTE_the_undefined__test_undefined_types_warning_1a_raised_by_default_2b_forward_ref.with_pytest_raises_undefi.module.Foobar.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py__NOTE_the_undefined__test_undefined_types_warning_1a_raised_by_default_2b_forward_ref.with_pytest_raises_undefi.module.Foobar.a", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 877, "end_line": 915, "span_ids": ["pytest_raises_undefined_types_warning", "test_undefined_types_warning_1a_raised_by_default_2b_forward_ref", "test_undefined_types_warning_1a_raised_by_default_2a_future_annotations"], "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": "# NOTE: the `undefined_types_warning` tests below are \"statically parameterized\" (i.e. have Duplicate Code).\n# The initial attempt to refactor them into a single parameterized test was not strateforward, due to the use of the\n# `create_module` fixture and the need for `from __future__ import annotations` be the first line in a module.\n#\n# Test Parameters:\n# 1. config setting: (1a) default behavior vs (1b) overriding with Config setting:\n# 2. type checking approach: (2a) `from __future__ import annotations` vs (2b) `ForwardRef`\n#\n# The parameter tags \"1a\", \"1b\", \"2a\", and \"2b\" are used in the test names below, to indicate which combination\n# of conditions the test is covering.\n\n\ndef test_undefined_types_warning_1a_raised_by_default_2a_future_annotations(create_module):\n with pytest_raises_undefined_types_warning(defining_class_name='Foobar', missing_type_name='UndefinedType'):\n create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\nclass Foobar(BaseModel):\n a: UndefinedType\n\"\"\"\n )\n\n\ndef test_undefined_types_warning_1a_raised_by_default_2b_forward_ref(create_module):\n with pytest_raises_undefined_types_warning(defining_class_name='Foobar', missing_type_name='UndefinedType'):\n\n @create_module\n def module():\n from typing import ForwardRef\n\n from pydantic import BaseModel\n\n UndefinedType = ForwardRef('UndefinedType')\n\n class Foobar(BaseModel):\n a: UndefinedType", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations_test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations.assert_module_Foobar___py": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations_test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations.assert_module_Foobar___py", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 918, "end_line": 932, "span_ids": ["test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations"], "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 test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\n# Suppress the undefined_types_warning\nclass Foobar(BaseModel, undefined_types_warning=False):\n a: UndefinedType\n\"\"\"\n )\n # Since we're testing the absence of a warning, it's important to confirm pydantic was actually run.\n # The presence of the `__pydantic_model_complete__` is a good indicator of this.\n assert module.Foobar.__pydantic_model_complete__ 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_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref.assert_module_Foobar___py": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref.assert_module_Foobar___py", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 935, "end_line": 950, "span_ids": ["test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref"], "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 test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref(create_module):\n @create_module\n def module():\n from typing import ForwardRef\n\n from pydantic import BaseModel\n\n UndefinedType = ForwardRef('UndefinedType')\n\n # Suppress the undefined_types_warning\n class Foobar(BaseModel, undefined_types_warning=False):\n a: UndefinedType\n\n # Since we're testing the absence of a warning, it's important to confirm pydantic was actually run.\n # The presence of the `__pydantic_model_complete__` is a good indicator of this.\n assert module.Foobar.__pydantic_model_complete__ 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_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_raised_by_usage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_raised_by_usage_", "embedding": null, "metadata": {"file_path": "tests/test_forward_ref.py", "file_name": "test_forward_ref.py", "file_type": "text/x-python", "category": "test", "start_line": 953, "end_line": 976, "span_ids": ["test_undefined_types_warning_raised_by_usage"], "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 test_undefined_types_warning_raised_by_usage(create_module):\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n '`Foobar` is not fully defined; you should define `UndefinedType`, '\n 'then call `Foobar.model_rebuild()` before the first `Foobar` instance is created.',\n ),\n ):\n\n @create_module\n def module():\n from typing import ForwardRef\n\n from pydantic import BaseModel\n\n UndefinedType = ForwardRef('UndefinedType')\n\n class Foobar(BaseModel):\n a: UndefinedType\n\n model_config = {'undefined_types_warning': False}\n\n Foobar(a=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_pydantic__pydantic/tests/test_generics.py_gc_test_double_parameterize_error.assert_str_exc_info_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_gc_test_double_parameterize_error.assert_str_exc_info_value", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 88, "span_ids": ["imports", "test_double_parameterize_error", "test_generic_name", "clean_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": "import gc\nimport itertools\nimport json\nimport platform\nimport sys\nfrom collections import deque\nfrom enum import Enum, IntEnum\nfrom typing import (\n Any,\n Callable,\n ClassVar,\n Counter,\n DefaultDict,\n Deque,\n Dict,\n FrozenSet,\n Generic,\n Iterable,\n List,\n Mapping,\n Optional,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\n\nimport pytest\nfrom dirty_equals import HasRepr\nfrom pydantic_core import core_schema\nfrom typing_extensions import Annotated, Literal, OrderedDict\n\nfrom pydantic import (\n BaseModel,\n Field,\n Json,\n PositiveInt,\n PydanticUserError,\n ValidationError,\n ValidationInfo,\n root_validator,\n)\nfrom pydantic._internal._core_utils import collect_invalid_schemas\nfrom pydantic._internal._generics import (\n _GENERIC_TYPES_CACHE,\n _LIMITED_DICT_SIZE,\n LimitedDict,\n generic_recursion_self_type,\n iter_contained_typevars,\n recursively_defined_type_refs,\n replace_types,\n)\nfrom pydantic.decorators import field_validator\n\n\n@pytest.fixture()\ndef clean_cache():\n # cleans up _GENERIC_TYPES_CACHE for checking item counts in the cache\n _GENERIC_TYPES_CACHE.clear()\n gc.collect(0)\n gc.collect(1)\n gc.collect(2)\n\n\ndef test_generic_name():\n data_type = TypeVar('data_type')\n\n class Result(BaseModel, Generic[data_type]):\n data: data_type\n\n if sys.version_info >= (3, 9):\n assert Result[list[int]].__name__ == 'Result[list[int]]'\n assert Result[List[int]].__name__ == 'Result[List[int]]'\n assert Result[int].__name__ == 'Result[int]'\n\n\ndef test_double_parameterize_error():\n data_type = TypeVar('data_type')\n\n class Result(BaseModel, Generic[data_type]):\n data: data_type\n\n with pytest.raises(TypeError) as exc_info:\n Result[int][int]\n\n assert str(exc_info.value) == \" is not a generic 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_pydantic__pydantic/tests/test_generics.py_test_value_validation_test_value_validation.Response.validate_sum.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_value_validation_test_value_validation.Response.validate_sum.return.values", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 110, "span_ids": ["test_value_validation"], "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 test_value_validation():\n T = TypeVar('T')\n\n class Response(BaseModel, Generic[T]):\n data: T\n\n @field_validator('data')\n @classmethod\n def validate_value_nonzero(cls, v: Any):\n if any(x == 0 for x in v.values()):\n raise ValueError('some value is zero')\n return v\n\n @root_validator(skip_on_failure=True)\n @classmethod\n def validate_sum(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n data = values.get('data', {})\n if sum(data.values()) > 5:\n raise ValueError('sum too large')\n return values\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_pydantic__pydantic/tests/test_generics.py_test_value_validation.assert_Response_Dict_int__test_value_validation.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_value_validation.assert_Response_Dict_int__test_value_validation.None_3", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 146, "span_ids": ["test_value_validation"], "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 test_value_validation():\n # ... other code\n\n assert Response[Dict[int, int]](data={1: '4'}).model_dump() == {'data': {1: 4}}\n with pytest.raises(ValidationError) as exc_info:\n Response[Dict[int, int]](data={1: 'a'})\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('data', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Response[Dict[int, int]](data={1: 0})\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('data',),\n 'msg': 'Value error, some value is zero',\n 'input': {1: 0},\n 'ctx': {'error': 'some value is zero'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Response[Dict[int, int]](data={1: 3, 2: 6})\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': (),\n 'msg': 'Value error, sum too large',\n 'input': {'data': {1: 3, 2: 6}},\n 'ctx': {'error': 'sum too large'},\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_pydantic__pydantic/tests/test_generics.py_test_methods_are_inherited_test_subclass_can_be_genericized.Result_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_methods_are_inherited_test_subclass_can_be_genericized.Result_T_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 280, "span_ids": ["test_subclass_can_be_genericized", "test_default_argument", "test_parameters_placed_on_generic", "test_default_argument_for_typevar", "test_methods_are_inherited", "test_non_annotated_field", "test_must_inherit_from_generic", "test_config_is_inherited", "test_non_generic_field", "test_parameters_must_be_typevar", "test_classvar"], "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_methods_are_inherited():\n class CustomModel(BaseModel):\n def method(self):\n return self.data\n\n T = TypeVar('T')\n\n class Model(CustomModel, Generic[T]):\n data: T\n\n instance = Model[int](data=1)\n\n assert instance.method() == 1\n\n\ndef test_config_is_inherited():\n class CustomGenericModel(BaseModel, frozen=True):\n ...\n\n T = TypeVar('T')\n\n class Model(CustomGenericModel, Generic[T]):\n data: T\n\n instance = Model[int](data=1)\n\n with pytest.raises(TypeError) as exc_info:\n instance.data = 2\n\n assert str(exc_info.value) == '\"Model[int]\" is frozen and does not support item assignment'\n\n\ndef test_default_argument():\n T = TypeVar('T')\n\n class Result(BaseModel, Generic[T]):\n data: T\n other: bool = True\n\n result = Result[int](data=1)\n assert result.other is True\n\n\ndef test_default_argument_for_typevar():\n T = TypeVar('T')\n\n class Result(BaseModel, Generic[T]):\n data: T = 4\n\n result = Result[int]()\n assert result.data == 4\n\n result = Result[float]()\n assert result.data == 4\n\n result = Result[int](data=1)\n assert result.data == 1\n\n\ndef test_classvar():\n T = TypeVar('T')\n\n class Result(BaseModel, Generic[T]):\n data: T\n other: ClassVar[int] = 1\n\n assert Result.other == 1\n assert Result[int].other == 1\n assert Result[int](data=1).other == 1\n assert 'other' not in Result.model_fields\n\n\ndef test_non_annotated_field():\n T = TypeVar('T')\n\n with pytest.raises(PydanticUserError, match='A non-annotated attribute was detected: `other = True`'):\n\n class Result(BaseModel, Generic[T]):\n data: T\n other = True\n\n\ndef test_non_generic_field():\n T = TypeVar('T')\n\n class Result(BaseModel, Generic[T]):\n data: T\n other: bool = True\n\n assert 'other' in Result.model_fields\n assert 'other' in Result[int].model_fields\n\n result = Result[int](data=1)\n assert result.other is True\n\n\ndef test_must_inherit_from_generic():\n with pytest.raises(TypeError) as exc_info:\n\n class Result(BaseModel):\n pass\n\n Result[int]\n\n assert str(exc_info.value) == (\n \".Result'> cannot be \"\n \"parametrized because it does not inherit from typing.Generic\"\n )\n\n\ndef test_parameters_placed_on_generic():\n T = TypeVar('T')\n with pytest.raises(TypeError, match='Type parameters should be placed on typing.Generic, not BaseModel'):\n\n class Result(BaseModel[T]):\n pass\n\n\ndef test_parameters_must_be_typevar():\n with pytest.raises(TypeError, match='Type parameters should be placed on typing.Generic, not BaseModel'):\n\n class Result(BaseModel[int]):\n pass\n\n\ndef test_subclass_can_be_genericized():\n T = TypeVar('T')\n\n class Result(BaseModel, Generic[T]):\n pass\n\n 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_pydantic__pydantic/tests/test_generics.py_test_parameter_count_test_parameter_count.assert_error_message_ends": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parameter_count_test_parameter_count.assert_error_message_ends", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 283, "end_line": 299, "span_ids": ["test_parameter_count"], "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 test_parameter_count():\n T = TypeVar('T')\n S = TypeVar('S')\n\n class Model(BaseModel, Generic[T, S]):\n x: T\n y: S\n\n with pytest.raises(TypeError) as exc_info:\n Model[int, int, int]\n\n # This error message, which comes from `typing`, changed 'parameters' to 'arguments' in 3.11\n error_message = str(exc_info.value)\n assert error_message.startswith('Too many parameters') or error_message.startswith('Too many arguments')\n assert error_message.endswith(\n \" for .Model'>; actual 3, expected 2\"\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_pydantic__pydantic/tests/test_generics.py_test_cover_cache_test_cover_cache.del_models": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_cover_cache_test_cover_cache.del_models", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 315, "span_ids": ["test_cover_cache"], "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 test_cover_cache(clean_cache):\n cache_size = len(_GENERIC_TYPES_CACHE)\n T = TypeVar('T')\n\n class Model(BaseModel, Generic[T]):\n x: T\n\n models = [] # keep references to models to get cache size\n\n models.append(Model[int]) # adds both with-tuple and without-tuple version to cache\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 3\n models.append(Model[int]) # uses the cache\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 3\n del models", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_cache_keys_are_hashable_test_cache_keys_are_hashable.del_models": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_cache_keys_are_hashable_test_cache_keys_are_hashable.del_models", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 318, "end_line": 346, "span_ids": ["test_cache_keys_are_hashable"], "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 test_cache_keys_are_hashable(clean_cache):\n cache_size = len(_GENERIC_TYPES_CACHE)\n T = TypeVar('T')\n C = Callable[[str, Dict[str, Any]], Iterable[str]]\n\n class MyGenericModel(BaseModel, Generic[T]):\n t: T\n\n # Callable's first params get converted to a list, which is not hashable.\n # Make sure we can handle that special case\n Simple = MyGenericModel[Callable[[int], str]]\n models = [] # keep references to models to get cache size\n models.append(Simple)\n\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 3\n # Nested Callables\n models.append(MyGenericModel[Callable[[C], Iterable[str]]])\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 6\n models.append(MyGenericModel[Callable[[Simple], Iterable[int]]])\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 9\n models.append(MyGenericModel[Callable[[MyGenericModel[C]], Iterable[int]]])\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 15\n\n class Model(BaseModel):\n x: MyGenericModel[Callable[[C], Iterable[str]]] = Field(...)\n\n models.append(Model)\n assert len(_GENERIC_TYPES_CACHE) == cache_size + 15\n del models", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_caches_get_cleaned_up_test_caches_get_cleaned_up.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_caches_get_cleaned_up_test_caches_get_cleaned_up.None_1", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 349, "end_line": 373, "span_ids": ["test_caches_get_cleaned_up"], "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": "@pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason='PyPy does not play nice with PyO3 gc')\ndef test_caches_get_cleaned_up(clean_cache):\n initial_types_cache_size = len(_GENERIC_TYPES_CACHE)\n T = TypeVar('T')\n\n class MyGenericModel(BaseModel, Generic[T]):\n x: T\n\n model_config = dict(arbitrary_types_allowed=True)\n\n n_types = 200\n types = []\n for i in range(n_types):\n\n class MyType(int):\n pass\n\n types.append(MyGenericModel[MyType]) # retain a reference\n\n assert len(_GENERIC_TYPES_CACHE) == initial_types_cache_size + 3 * n_types\n types.clear()\n gc.collect(0)\n gc.collect(1)\n gc.collect(2)\n assert len(_GENERIC_TYPES_CACHE) < initial_types_cache_size + _LIMITED_DICT_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_pydantic__pydantic/tests/test_generics.py_test_caches_get_cleaned_up_with_aliased_parametrized_bases_test_caches_get_cleaned_up_with_aliased_parametrized_bases.assert_len__GENERIC_TYPES": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_caches_get_cleaned_up_with_aliased_parametrized_bases_test_caches_get_cleaned_up_with_aliased_parametrized_bases.assert_len__GENERIC_TYPES", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 376, "end_line": 400, "span_ids": ["test_caches_get_cleaned_up_with_aliased_parametrized_bases"], "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": "@pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason='PyPy does not play nice with PyO3 gc')\ndef test_caches_get_cleaned_up_with_aliased_parametrized_bases(clean_cache):\n types_cache_size = len(_GENERIC_TYPES_CACHE)\n\n def run() -> None: # Run inside nested function to get classes in local vars cleaned also\n T1 = TypeVar('T1')\n T2 = TypeVar('T2')\n\n class A(BaseModel, Generic[T1, T2]):\n x: T1\n y: T2\n\n B = A[int, T2]\n C = B[str]\n assert len(_GENERIC_TYPES_CACHE) == types_cache_size + 5\n del C\n del B\n gc.collect()\n\n run()\n\n gc.collect(0)\n gc.collect(1)\n gc.collect(2)\n assert len(_GENERIC_TYPES_CACHE) < types_cache_size + _LIMITED_DICT_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_pydantic__pydantic/tests/test_generics.py_test_generics_work_with_many_parametrized_base_models_test_generics_work_with_many_parametrized_base_models.del_generics": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generics_work_with_many_parametrized_base_models_test_generics_work_with_many_parametrized_base_models.del_generics", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 403, "end_line": 433, "span_ids": ["test_generics_work_with_many_parametrized_base_models"], "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 test_generics_work_with_many_parametrized_base_models(clean_cache):\n cache_size = len(_GENERIC_TYPES_CACHE)\n count_create_models = 1000\n T = TypeVar('T')\n C = TypeVar('C')\n\n class A(BaseModel, Generic[T, C]):\n x: T\n y: C\n\n class B(A[int, C], BaseModel, Generic[C]):\n pass\n\n models = []\n for i in range(count_create_models):\n\n class M(BaseModel):\n pass\n\n M.__name__ = f'M{i}'\n models.append(M)\n\n generics = []\n for m in models:\n Working = B[m]\n generics.append(Working)\n\n target_size = cache_size + count_create_models * 3 + 2\n assert len(_GENERIC_TYPES_CACHE) < target_size + _LIMITED_DICT_SIZE\n del models\n del generics", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_config_test_enum_generic.Model_MyEnum_enum_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_config_test_enum_generic.Model_MyEnum_enum_2_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 436, "end_line": 459, "span_ids": ["test_enum_generic", "test_generic_config"], "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 test_generic_config():\n data_type = TypeVar('data_type')\n\n class Result(BaseModel, Generic[data_type], frozen=True):\n data: data_type\n\n result = Result[int](data=1)\n assert result.data == 1\n with pytest.raises(TypeError):\n result.data = 2\n\n\ndef test_enum_generic():\n T = TypeVar('T')\n\n class MyEnum(IntEnum):\n x = 1\n y = 2\n\n class Model(BaseModel, Generic[T]):\n enum: T\n\n Model[MyEnum](enum=MyEnum.x)\n Model[MyEnum](enum=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_pydantic__pydantic/tests/test_generics.py_test_generic_test_generic.Result.validate_positive_number.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_test_generic.Result.validate_positive_number.return.v", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 462, "end_line": 486, "span_ids": ["test_generic"], "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 test_generic():\n data_type = TypeVar('data_type')\n error_type = TypeVar('error_type')\n\n class Result(BaseModel, Generic[data_type, error_type]):\n data: Optional[List[data_type]] = None\n error: Optional[error_type] = None\n positive_number: int\n\n @field_validator('error')\n @classmethod\n def validate_error(cls, v: Optional[error_type], info: ValidationInfo) -> Optional[error_type]:\n values = info.data\n if values.get('data', None) is None and v is None:\n raise ValueError('Must provide data or error')\n if values.get('data', None) is not None and v is not None:\n raise ValueError('Must not provide both data and error')\n return v\n\n @field_validator('positive_number')\n @classmethod\n def validate_positive_number(cls, v: int) -> int:\n if v < 0:\n raise ValueError\n return v\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_pydantic__pydantic/tests/test_generics.py_test_generic.Error_test_generic.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic.Error_test_generic.None_5", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 488, "end_line": 530, "span_ids": ["test_generic"], "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": "def test_generic():\n # ... other code\n\n class Error(BaseModel):\n message: str\n\n class Data(BaseModel):\n number: int\n text: str\n\n success1 = Result[Data, Error](data=[Data(number=1, text='a')], positive_number=1)\n assert success1.model_dump() == {'data': [{'number': 1, 'text': 'a'}], 'error': None, 'positive_number': 1}\n assert repr(success1) == (\n 'Result[test_generic..Data,'\n \" test_generic..Error](data=[Data(number=1, text='a')], error=None, positive_number=1)\"\n )\n\n success2 = Result[Data, Error](error=Error(message='error'), positive_number=1)\n assert success2.model_dump() == {'data': None, 'error': {'message': 'error'}, 'positive_number': 1}\n assert repr(success2) == (\n 'Result[test_generic..Data, test_generic..Error]'\n \"(data=None, error=Error(message='error'), positive_number=1)\"\n )\n with pytest.raises(ValidationError) as exc_info:\n Result[Data, Error](error=Error(message='error'), positive_number=-1)\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('positive_number',),\n 'msg': 'Value error, Unknown error',\n 'input': -1,\n 'ctx': {'error': 'Unknown error'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Result[Data, Error](data=[Data(number=1, text='a')], error=Error(message='error'), positive_number=1)\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('error',),\n 'msg': 'Value error, Must not provide both data and error',\n 'input': Error(message='error'),\n 'ctx': {'error': 'Must not provide both data and error'},\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_pydantic__pydantic/tests/test_generics.py_test_alongside_concrete_generics_test_child_schema.assert_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_alongside_concrete_generics_test_child_schema.assert_schema_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 533, "end_line": 602, "span_ids": ["test_required_value", "test_child_schema", "test_complex_nesting", "test_optional_value", "test_alongside_concrete_generics", "test_custom_schema"], "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 test_alongside_concrete_generics():\n T = TypeVar('T')\n\n class MyModel(BaseModel, Generic[T]):\n item: T\n metadata: Dict[str, Any]\n\n model = MyModel[int](item=1, metadata={})\n assert model.item == 1\n assert model.metadata == {}\n\n\ndef test_complex_nesting():\n T = TypeVar('T')\n\n class MyModel(BaseModel, Generic[T]):\n item: List[Dict[Union[int, T], str]]\n\n item = [{1: 'a', 'a': 'a'}]\n model = MyModel[str](item=item)\n assert model.item == item\n\n\ndef test_required_value():\n T = TypeVar('T')\n\n class MyModel(BaseModel, Generic[T]):\n a: int\n\n with pytest.raises(ValidationError) as exc_info:\n MyModel[int]()\n assert exc_info.value.errors() == [{'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}]\n\n\ndef test_optional_value():\n T = TypeVar('T')\n\n class MyModel(BaseModel, Generic[T]):\n a: Optional[int] = 1\n\n model = MyModel[int]()\n assert model.model_dump() == {'a': 1}\n\n\ndef test_custom_schema():\n T = TypeVar('T')\n\n class MyModel(BaseModel, Generic[T]):\n a: int = Field(1, description='Custom')\n\n schema = MyModel[int].model_json_schema()\n assert schema['properties']['a'].get('description') == 'Custom'\n\n\ndef test_child_schema():\n T = TypeVar('T')\n\n class Model(BaseModel, Generic[T]):\n a: T\n\n class Child(Model[T], Generic[T]):\n pass\n\n schema = Child[int].model_json_schema()\n assert schema == {\n 'title': 'Child[int]',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_generics.py_test_custom_generic_naming_test_custom_generic_naming.assert_repr_MyModel_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_custom_generic_naming_test_custom_generic_naming.assert_repr_MyModel_str_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 605, "end_line": 618, "span_ids": ["test_custom_generic_naming"], "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 test_custom_generic_naming():\n T = TypeVar('T')\n\n class MyModel(BaseModel, Generic[T]):\n value: Optional[T]\n\n @classmethod\n def model_parametrized_name(cls, params: Tuple[Type[Any], ...]) -> str:\n param_names = [param.__name__ if hasattr(param, '__name__') else str(param) for param in params]\n title = param_names[0].title()\n return f'Optional{title}Wrapper'\n\n assert repr(MyModel[int](value=1)) == 'OptionalIntWrapper(value=1)'\n assert repr(MyModel[str](value=None)) == 'OptionalStrWrapper(value=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_pydantic__pydantic/tests/test_generics.py_test_nested_test_nested.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_nested_test_nested.None_7", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 621, "end_line": 670, "span_ids": ["test_nested"], "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": "def test_nested():\n AT = TypeVar('AT')\n\n class InnerT(BaseModel, Generic[AT]):\n a: AT\n\n inner_int = InnerT[int](a=8)\n inner_str = InnerT[str](a='ate')\n inner_dict_any = InnerT[Any](a={})\n inner_int_any = InnerT[Any](a=7)\n\n class OuterT_SameType(BaseModel, Generic[AT]):\n i: InnerT[AT]\n\n OuterT_SameType[int](i={'a': 8})\n OuterT_SameType[int](i=inner_int)\n OuterT_SameType[str](i=inner_str)\n # TODO: The next line is failing, but passes in v1.\n # Might need to do something smart for Any, or re-parse-from-dict if the __pydantic_generic_origin__ is the same..\n # OuterT_SameType[str](i=inner_int_any)\n OuterT_SameType[int](i=inner_int_any.model_dump())\n\n with pytest.raises(ValidationError) as exc_info:\n OuterT_SameType[int](i=inner_str.model_dump())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('i', 'a'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'ate',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n OuterT_SameType[int](i=inner_str)\n assert exc_info.value.errors() == [\n {'input': InnerT[str](a='ate'), 'loc': ('i',), 'msg': 'Input should be a valid dictionary', 'type': 'dict_type'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n OuterT_SameType[int](i=inner_dict_any.model_dump())\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('i', 'a'), 'msg': 'Input should be a valid integer', 'input': {}}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n OuterT_SameType[int](i=inner_dict_any)\n assert exc_info.value.errors() == [\n {'input': InnerT[Any](a={}), 'loc': ('i',), 'msg': 'Input should be a valid dictionary', 'type': 'dict_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_pydantic__pydantic/tests/test_generics.py_test_partial_specification_test_partial_specification.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_test_partial_specification.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 673, "end_line": 694, "span_ids": ["test_partial_specification"], "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_partial_specification():\n AT = TypeVar('AT')\n BT = TypeVar('BT')\n\n class Model(BaseModel, Generic[AT, BT]):\n a: AT\n b: BT\n\n partial_model = Model[int, BT]\n concrete_model = partial_model[str]\n concrete_model(a=1, b='abc')\n with pytest.raises(ValidationError) as exc_info:\n concrete_model(a='abc', b=None)\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'abc',\n },\n {'type': 'string_type', 'loc': ('b',), 'msg': 'Input should be a valid string', 'input': 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_pydantic__pydantic/tests/test_generics.py_test_partial_specification_with_inner_typevar_test_partial_specification_name.assert_concrete_model___n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_with_inner_typevar_test_partial_specification_name.assert_concrete_model___n", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 697, "end_line": 728, "span_ids": ["test_partial_specification_name", "test_partial_specification_with_inner_typevar"], "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 test_partial_specification_with_inner_typevar():\n AT = TypeVar('AT')\n BT = TypeVar('BT')\n\n class Model(BaseModel, Generic[AT, BT]):\n a: List[AT]\n b: List[BT]\n\n partial_model = Model[int, BT]\n assert partial_model.__pydantic_generic_parameters__\n concrete_model = partial_model[int]\n\n assert not concrete_model.__pydantic_generic_parameters__\n\n # nested resolution of partial models should work as expected\n nested_resolved = concrete_model(a=['123'], b=['456'])\n assert nested_resolved.a == [123]\n assert nested_resolved.b == [456]\n\n\ndef test_partial_specification_name():\n AT = TypeVar('AT')\n BT = TypeVar('BT')\n\n class Model(BaseModel, Generic[AT, BT]):\n a: AT\n b: BT\n\n partial_model = Model[int, BT]\n assert partial_model.__name__ == 'Model[int, ~BT]'\n concrete_model = partial_model[str]\n assert concrete_model.__name__ == 'Model[int, 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_pydantic__pydantic/tests/test_generics.py_test_partial_specification_instantiation_test_partial_specification_instantiation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_instantiation_test_partial_specification_instantiation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 731, "end_line": 753, "span_ids": ["test_partial_specification_instantiation"], "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 test_partial_specification_instantiation():\n AT = TypeVar('AT')\n BT = TypeVar('BT')\n\n class Model(BaseModel, Generic[AT, BT]):\n a: AT\n b: BT\n\n partial_model = Model[int, BT]\n partial_model(a=1, b=2)\n\n partial_model(a=1, b='a')\n\n with pytest.raises(ValidationError) as exc_info:\n partial_model(a='a', b=2)\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\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_pydantic__pydantic/tests/test_generics.py_test_partial_specification_instantiation_bounded_test_partial_specification_instantiation_bounded.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_instantiation_bounded_test_partial_specification_instantiation_bounded.None_1", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 756, "end_line": 787, "span_ids": ["test_partial_specification_instantiation_bounded"], "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 test_partial_specification_instantiation_bounded():\n AT = TypeVar('AT')\n BT = TypeVar('BT', bound=int)\n\n class Model(BaseModel, Generic[AT, BT]):\n a: AT\n b: BT\n\n Model(a=1, b=1)\n with pytest.raises(ValidationError) as exc_info:\n Model(a=1, b='a')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n }\n ]\n\n partial_model = Model[int, BT]\n partial_model(a=1, b=1)\n with pytest.raises(ValidationError) as exc_info:\n partial_model(a=1, b='a')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\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_pydantic__pydantic/tests/test_generics.py_test_typevar_parametrization_test_typevar_parametrization.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_typevar_parametrization_test_typevar_parametrization.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 790, "end_line": 816, "span_ids": ["test_typevar_parametrization"], "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 test_typevar_parametrization():\n AT = TypeVar('AT')\n BT = TypeVar('BT')\n\n class Model(BaseModel, Generic[AT, BT]):\n a: AT\n b: BT\n\n CT = TypeVar('CT', bound=int)\n DT = TypeVar('DT', bound=int)\n\n with pytest.raises(ValidationError) as exc_info:\n Model[CT, DT](a='a', b='b')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'b',\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_pydantic__pydantic/tests/test_generics.py_test_multiple_specification_test_multiple_specification.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_multiple_specification_test_multiple_specification.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 819, "end_line": 836, "span_ids": ["test_multiple_specification"], "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 test_multiple_specification():\n AT = TypeVar('AT')\n BT = TypeVar('BT')\n\n class Model(BaseModel, Generic[AT, BT]):\n a: AT\n b: BT\n\n CT = TypeVar('CT')\n partial_model = Model[CT, CT]\n concrete_model = partial_model[str]\n\n with pytest.raises(ValidationError) as exc_info:\n concrete_model(a=None, b=None)\n assert exc_info.value.errors() == [\n {'type': 'string_type', 'loc': ('a',), 'msg': 'Input should be a valid string', 'input': None},\n {'type': 'string_type', 'loc': ('b',), 'msg': 'Input should be a valid string', 'input': 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_pydantic__pydantic/tests/test_generics.py_test_generic_subclass_of_concrete_generic_test_generic_subclass_of_concrete_generic.ConcreteSub_data_2_extra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_subclass_of_concrete_generic_test_generic_subclass_of_concrete_generic.ConcreteSub_data_2_extra", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 839, "end_line": 857, "span_ids": ["test_generic_subclass_of_concrete_generic"], "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 test_generic_subclass_of_concrete_generic():\n T = TypeVar('T')\n U = TypeVar('U')\n\n class GenericBaseModel(BaseModel, Generic[T]):\n data: T\n\n class GenericSub(GenericBaseModel[int], Generic[U]):\n extra: U\n\n ConcreteSub = GenericSub[int]\n\n with pytest.raises(ValidationError):\n ConcreteSub(data=2, extra='wrong')\n\n with pytest.raises(ValidationError):\n ConcreteSub(data='wrong', extra=2)\n\n ConcreteSub(data=2, extra=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_pydantic__pydantic/tests/test_generics.py_test_generic_model_pickle_test_generic_model_pickle.module.assert_loaded_original": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_pickle_test_generic_model_pickle.module.assert_loaded_original", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 860, "end_line": 884, "span_ids": ["test_generic_model_pickle"], "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 test_generic_model_pickle(create_module):\n # Using create_module because pickle doesn't support\n # objects with in their __qualname__ (e.g. defined in function)\n @create_module\n def module():\n import pickle\n from typing import Generic, TypeVar\n\n from pydantic import BaseModel\n\n t = TypeVar('t')\n\n class Model(BaseModel):\n a: float\n b: int = 10\n\n class MyGeneric(BaseModel, Generic[t]):\n value: t\n\n original = MyGeneric[Model](value=Model(a='24'))\n dumped = pickle.dumps(original)\n loaded = pickle.loads(dumped)\n assert loaded.value.a == original.value.a == 24\n assert loaded.value.b == original.value.b == 10\n assert loaded == original", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_from_function_pickle_fail_test_generic_model_from_function_pickle_fail.module.with_pytest_raises_pickle.pickle_dumps_original_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_from_function_pickle_fail_test_generic_model_from_function_pickle_fail.module.with_pytest_raises_pickle.pickle_dumps_original_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 887, "end_line": 911, "span_ids": ["test_generic_model_from_function_pickle_fail"], "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 test_generic_model_from_function_pickle_fail(create_module):\n @create_module\n def module():\n import pickle\n from typing import Generic, TypeVar\n\n import pytest\n\n from pydantic import BaseModel\n\n t = TypeVar('t')\n\n class Model(BaseModel):\n a: float\n b: int = 10\n\n class MyGeneric(BaseModel, Generic[t]):\n value: t\n\n def get_generic(t):\n return MyGeneric[t]\n\n original = get_generic(Model)(value=Model(a='24'))\n with pytest.raises(pickle.PicklingError):\n pickle.dumps(original)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_redefined_without_cache_fail_test_generic_model_redefined_without_cache_fail.module.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_redefined_without_cache_fail_test_generic_model_redefined_without_cache_fail.module.None_5", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 914, "end_line": 946, "span_ids": ["test_generic_model_redefined_without_cache_fail"], "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 test_generic_model_redefined_without_cache_fail(create_module, monkeypatch):\n # match identity checker otherwise we never get to the redefinition check\n monkeypatch.setattr('pydantic._internal._utils.all_identical', lambda left, right: False)\n\n @create_module\n def module():\n from typing import Generic, TypeVar\n\n from pydantic import BaseModel\n from pydantic._internal._generics import _GENERIC_TYPES_CACHE\n\n t = TypeVar('t')\n\n class MyGeneric(BaseModel, Generic[t]):\n value: t\n\n class Model(BaseModel):\n ...\n\n concrete = MyGeneric[Model]\n _GENERIC_TYPES_CACHE.clear()\n second_concrete = MyGeneric[Model]\n\n class Model(BaseModel): # same name, but type different, so it's not in cache\n ...\n\n third_concrete = MyGeneric[Model]\n assert concrete is not second_concrete\n assert concrete is not third_concrete\n assert second_concrete is not third_concrete\n assert globals()['MyGeneric[Model]'] is concrete\n assert globals()['MyGeneric[Model]_'] is second_concrete\n assert globals()['MyGeneric[Model]__'] is third_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_pydantic__pydantic/tests/test_generics.py_test_generic_model_caching_detect_order_of_union_args_basic_test_generic_model_caching_detect_order_of_union_args_basic.module.assert_type_float_or_int_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_caching_detect_order_of_union_args_basic_test_generic_model_caching_detect_order_of_union_args_basic.module.assert_type_float_or_int_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 949, "end_line": 966, "span_ids": ["test_generic_model_caching_detect_order_of_union_args_basic"], "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 test_generic_model_caching_detect_order_of_union_args_basic(create_module):\n # Basic variant of https://github.com/pydantic/pydantic/issues/4474\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n t = TypeVar('t')\n\n class Model(BaseModel, Generic[t]):\n data: t\n\n int_or_float_model = Model[Union[int, float]]\n float_or_int_model = Model[Union[float, int]]\n\n assert type(int_or_float_model(data='1').data) is int\n assert type(float_or_int_model(data='1').data) is float", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_caching_detect_order_of_union_args_nested_test_generic_model_caching_detect_order_of_union_args_nested.module.assert_type_float_or_int_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_caching_detect_order_of_union_args_nested_test_generic_model_caching_detect_order_of_union_args_nested.module.assert_type_float_or_int_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 969, "end_line": 992, "span_ids": ["test_generic_model_caching_detect_order_of_union_args_nested"], "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": "@pytest.mark.skip(\n reason=\"\"\"\nDepends on similar issue in CPython itself: https://github.com/python/cpython/issues/86483\nDocumented and skipped for possible fix later.\n\"\"\"\n)\ndef test_generic_model_caching_detect_order_of_union_args_nested(create_module):\n # Nested variant of https://github.com/pydantic/pydantic/issues/4474\n @create_module\n def module():\n from typing import Generic, List, TypeVar, Union\n\n from pydantic import BaseModel\n\n t = TypeVar('t')\n\n class Model(BaseModel, Generic[t]):\n data: t\n\n int_or_float_model = Model[List[Union[int, float]]]\n float_or_int_model = Model[List[Union[float, int]]]\n\n assert type(int_or_float_model(data=['1']).data[0]) is int\n assert type(float_or_int_model(data=['1']).data[0]) is float", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_get_caller_frame_info_test_get_caller_frame_info_when_sys_getframe_undefined.try_.finally_just_to_make_.sys._getframe.getframe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_get_caller_frame_info_test_get_caller_frame_info_when_sys_getframe_undefined.try_.finally_just_to_make_.sys._getframe.getframe", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 995, "end_line": 1037, "span_ids": ["test_get_caller_frame_info_when_sys_getframe_undefined", "test_get_caller_frame_info_called_from_module", "test_get_caller_frame_info"], "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 test_get_caller_frame_info(create_module):\n @create_module\n def module():\n from pydantic._internal._generics import _get_caller_frame_info\n\n def function():\n assert _get_caller_frame_info() == (__name__, True)\n\n another_function()\n\n def another_function():\n assert _get_caller_frame_info() == (__name__, False)\n third_function()\n\n def third_function():\n assert _get_caller_frame_info() == (__name__, False)\n\n function()\n\n\ndef test_get_caller_frame_info_called_from_module(create_module):\n @create_module\n def module():\n from unittest.mock import patch\n\n import pytest\n\n from pydantic._internal._generics import _get_caller_frame_info\n\n with pytest.raises(RuntimeError, match='This function must be used inside another function'):\n with patch('sys._getframe', side_effect=ValueError('getframe_exc')):\n _get_caller_frame_info()\n\n\ndef test_get_caller_frame_info_when_sys_getframe_undefined():\n from pydantic._internal._generics import _get_caller_frame_info\n\n getframe = sys._getframe\n del sys._getframe\n try:\n assert _get_caller_frame_info() == (None, False)\n finally: # just to make sure we always setting original attribute back\n sys._getframe = getframe", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_iter_contained_typevars_test_nested_identity_parameterization.assert_Model_T2_is_not_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_iter_contained_typevars_test_nested_identity_parameterization.assert_Model_T2_is_not_M", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1040, "end_line": 1062, "span_ids": ["test_nested_identity_parameterization", "test_iter_contained_typevars"], "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 test_iter_contained_typevars():\n T = TypeVar('T')\n T2 = TypeVar('T2')\n\n class Model(BaseModel, Generic[T]):\n a: T\n\n assert list(iter_contained_typevars(Model[T])) == [T]\n assert list(iter_contained_typevars(Optional[List[Union[str, Model[T]]]])) == [T]\n assert list(iter_contained_typevars(Optional[List[Union[str, Model[int]]]])) == []\n assert list(iter_contained_typevars(Optional[List[Union[str, Model[T], Callable[[T2, T], str]]]])) == [T, T2, T]\n\n\ndef test_nested_identity_parameterization():\n T = TypeVar('T')\n T2 = TypeVar('T2')\n\n class Model(BaseModel, Generic[T]):\n a: T\n\n assert Model[T][T][T] is Model\n assert Model[T] is Model\n assert Model[T2] is not Model", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_test_replace_types.None_1.assert_replace_types_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_test_replace_types.None_1.assert_replace_types_str_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1065, "end_line": 1095, "span_ids": ["test_replace_types"], "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": "def test_replace_types():\n T = TypeVar('T')\n\n class Model(BaseModel, Generic[T]):\n a: T\n\n assert replace_types(T, {T: int}) is int\n assert replace_types(List[Union[str, list, T]], {T: int}) == List[Union[str, list, int]]\n assert replace_types(Callable, {T: int}) == Callable\n assert replace_types(Callable[[int, str, T], T], {T: int}) == Callable[[int, str, int], int]\n assert replace_types(T, {}) is T\n assert replace_types(Model[List[T]], {T: int}) == Model[List[int]]\n assert replace_types(Model[List[T]], {T: int}) == Model[List[T]][int]\n assert (\n replace_types(Model[List[T]], {T: int}).model_fields['a'].annotation\n == Model[List[T]][int].model_fields['a'].annotation\n )\n assert replace_types(T, {}) is T\n assert replace_types(Type[T], {T: int}) == Type[int]\n assert replace_types(Model[T], {T: T}) == Model[T]\n assert replace_types(Json[T], {T: int}) == Json[int]\n\n if sys.version_info >= (3, 9):\n # Check generic aliases (subscripted builtin types) to make sure they\n # resolve correctly (don't get translated to typing versions for\n # example)\n assert replace_types(list[Union[str, list, T]], {T: int}) == list[Union[str, list, int]]\n\n if sys.version_info >= (3, 10):\n # Check that types.UnionType gets handled properly\n assert replace_types(str | list[T] | float, {T: int}) == str | list[int] | float", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field_test_replace_types_with_user_defined_generic_type_field.CustomTuple.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field_test_replace_types_with_user_defined_generic_type_field.CustomTuple.pass", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1098, "end_line": 1139, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "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 test_replace_types_with_user_defined_generic_type_field():\n \"\"\"Test that using user defined generic types as generic model fields are handled correctly.\"\"\"\n\n T = TypeVar('T')\n KT = TypeVar('KT')\n VT = TypeVar('VT')\n\n class CustomCounter(Counter[T]):\n pass\n\n class CustomDefaultDict(DefaultDict[KT, VT]):\n pass\n\n class CustomDeque(Deque[T]):\n pass\n\n class CustomDict(Dict[KT, VT]):\n pass\n\n class CustomFrozenset(FrozenSet[T]):\n pass\n\n class CustomIterable(Iterable[T]):\n pass\n\n class CustomList(List[T]):\n pass\n\n class CustomMapping(Mapping[KT, VT]):\n pass\n\n class CustomOrderedDict(OrderedDict[KT, VT]):\n pass\n\n class CustomSequence(Sequence[T]):\n pass\n\n class CustomSet(Set[T]):\n pass\n\n class CustomTuple(Tuple[T]):\n pass\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_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.Model_test_replace_types_with_user_defined_generic_type_field.Model.tuple_field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.Model_test_replace_types_with_user_defined_generic_type_field.Model.tuple_field", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1141, "end_line": 1153, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "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 test_replace_types_with_user_defined_generic_type_field():\n # ... other code\n\n class Model(BaseModel, Generic[T, KT, VT]):\n counter_field: CustomCounter[T]\n default_dict_field: CustomDefaultDict[KT, VT]\n deque_field: CustomDeque[T]\n dict_field: CustomDict[KT, VT]\n frozenset_field: CustomFrozenset[T]\n iterable_field: CustomIterable[T]\n list_field: CustomList[T]\n mapping_field: CustomMapping[KT, VT]\n ordered_dict_field: CustomOrderedDict[KT, VT]\n sequence_field: CustomSequence[T]\n set_field: CustomSet[T]\n tuple_field: CustomTuple[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_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.assert_replace_types_Mode_test_replace_types_with_user_defined_generic_type_field.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.assert_replace_types_Mode_test_replace_types_with_user_defined_generic_type_field.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1155, "end_line": 1205, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "tokens": 602}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_replace_types_with_user_defined_generic_type_field():\n # ... other code\n\n assert replace_types(Model, {T: bool, KT: str, VT: int}) == Model[bool, str, int]\n assert replace_types(Model[T, KT, VT], {T: bool, KT: str, VT: int}) == Model[bool, str, int]\n assert replace_types(Model[T, VT, KT], {T: bool, KT: str, VT: int}) == Model[T, VT, KT][bool, int, str]\n\n m = Model[bool, str, int](\n counter_field=Counter([True, False]),\n default_dict_field={'a': 1},\n deque_field=[True, False],\n dict_field={'a': 1},\n frozenset_field=frozenset([True, False]),\n iterable_field=[True, False],\n list_field=[True, False],\n mapping_field={'a': 2},\n ordered_dict_field=OrderedDict([('a', 1)]),\n sequence_field=[True, False],\n set_field={True, False},\n tuple_field=(True,),\n )\n\n # The following assertions are just to document the current behavior, and should\n # be updated if/when we do a better job of respecting the exact annotated type\n assert type(m.counter_field) is Counter.__origin__\n assert type(m.default_dict_field) is dict\n assert type(m.deque_field) is deque\n assert type(m.dict_field) is dict\n assert type(m.frozenset_field) is CustomFrozenset\n assert type(m.iterable_field).__name__ == 'ValidatorIterator'\n assert type(m.list_field) is CustomList\n assert type(m.mapping_field) is dict\n assert type(m.ordered_dict_field) is OrderedDict.__origin__\n assert type(m.sequence_field) is list\n assert type(m.set_field) is CustomSet\n assert type(m.tuple_field) is tuple\n\n assert m.model_dump() == {\n 'counter_field': {False: 1, True: 1},\n 'default_dict_field': {'a': 1},\n 'deque_field': deque([True, False]),\n 'dict_field': {'a': 1},\n 'frozenset_field': frozenset({False, True}),\n 'iterable_field': HasRepr(\n 'SerializationIterator(index=0, '\n 'iterator=ValidatorIterator(index=0, schema=Some(Bool(BoolValidator { strict: false }))))'\n ),\n 'list_field': [True, False],\n 'mapping_field': {'a': 2},\n 'ordered_dict_field': {'a': 1},\n 'sequence_field': [True, False],\n 'set_field': {False, True},\n 'tuple_field': (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_pydantic__pydantic/tests/test_generics.py_test_replace_types_identity_on_unchanged_test_deep_generic._i_e_inner_model_is_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_identity_on_unchanged_test_deep_generic._i_e_inner_model_is_co", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1208, "end_line": 1244, "span_ids": ["test_replace_types_identity_on_unchanged", "test_deep_generic"], "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 test_replace_types_identity_on_unchanged():\n T = TypeVar('T')\n U = TypeVar('U')\n\n type_ = List[Union[str, Callable[[list], Optional[str]], U]]\n assert replace_types(type_, {T: int}) is type_\n\n\ndef test_deep_generic():\n T = TypeVar('T')\n S = TypeVar('S')\n R = TypeVar('R')\n\n class OuterModel(BaseModel, Generic[T, S, R]):\n a: Dict[R, Optional[List[T]]]\n b: Optional[Union[S, R]]\n c: R\n d: float\n\n class InnerModel(BaseModel, Generic[T, R]):\n c: T\n d: R\n\n class NormalModel(BaseModel):\n e: int\n f: str\n\n inner_model = InnerModel[int, str]\n generic_model = OuterModel[inner_model, NormalModel, int]\n\n inner_models = [inner_model(c=1, d='a')]\n generic_model(a={1: inner_models, 2: None}, b=None, c=1, d=1.5)\n generic_model(a={}, b=NormalModel(e=1, f='a'), c=1, d=1.5)\n generic_model(a={}, b=1, c=1, d=1.5)\n\n assert InnerModel.__pydantic_generic_parameters__ # i.e., InnerModel is not concrete\n assert not inner_model.__pydantic_generic_parameters__ # i.e., inner_model is 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_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_inner_typevar_test_deep_generic_with_inner_typevar.assert_InnerModel_int_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_inner_typevar_test_deep_generic_with_inner_typevar.assert_InnerModel_int_a_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1247, "end_line": 1261, "span_ids": ["test_deep_generic_with_inner_typevar"], "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 test_deep_generic_with_inner_typevar():\n T = TypeVar('T')\n\n class OuterModel(BaseModel, Generic[T]):\n a: List[T]\n\n class InnerModel(OuterModel[T], Generic[T]):\n pass\n\n assert not InnerModel[int].__pydantic_generic_parameters__ # i.e., InnerModel[int] is concrete\n assert InnerModel.__pydantic_generic_parameters__ # i.e., InnerModel is not concrete\n\n with pytest.raises(ValidationError):\n InnerModel[int](a=['wrong'])\n assert InnerModel[int](a=['1']).a == [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_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_referenced_generic_test_deep_generic_with_referenced_generic.assert_InnerModel_int_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_referenced_generic_test_deep_generic_with_referenced_generic.assert_InnerModel_int_a_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1264, "end_line": 1282, "span_ids": ["test_deep_generic_with_referenced_generic"], "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 test_deep_generic_with_referenced_generic():\n T = TypeVar('T')\n R = TypeVar('R')\n\n class ReferencedModel(BaseModel, Generic[R]):\n a: R\n\n class OuterModel(BaseModel, Generic[T]):\n a: ReferencedModel[T]\n\n class InnerModel(OuterModel[T], Generic[T]):\n pass\n\n assert not InnerModel[int].__pydantic_generic_parameters__\n assert InnerModel.__pydantic_generic_parameters__\n\n with pytest.raises(ValidationError):\n InnerModel[int](a={'a': 'wrong'})\n assert InnerModel[int](a={'a': 1}).a.a == 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_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_referenced_inner_generic_test_deep_generic_with_referenced_inner_generic.assert_InnerModel_int_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_referenced_inner_generic_test_deep_generic_with_referenced_inner_generic.assert_InnerModel_int_mo", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1285, "end_line": 1304, "span_ids": ["test_deep_generic_with_referenced_inner_generic"], "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 test_deep_generic_with_referenced_inner_generic():\n T = TypeVar('T')\n\n class ReferencedModel(BaseModel, Generic[T]):\n a: T\n\n class OuterModel(BaseModel, Generic[T]):\n a: Optional[List[Union[ReferencedModel[T], str]]]\n\n class InnerModel(OuterModel[T], Generic[T]):\n pass\n\n assert not InnerModel[int].__pydantic_generic_parameters__\n assert InnerModel.__pydantic_generic_parameters__\n\n with pytest.raises(ValidationError):\n InnerModel[int](a=['s', {'a': 'wrong'}])\n assert InnerModel[int](a=['s', {'a': 1}]).a[1].a == 1\n\n assert InnerModel[int].model_fields['a'].annotation == Optional[List[Union[ReferencedModel[int], 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_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_multiple_typevars_test_deep_generic_with_multiple_typevars.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_multiple_typevars_test_deep_generic_with_multiple_typevars.None_2", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1307, "end_line": 1322, "span_ids": ["test_deep_generic_with_multiple_typevars"], "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": "def test_deep_generic_with_multiple_typevars():\n T = TypeVar('T')\n U = TypeVar('U')\n\n class OuterModel(BaseModel, Generic[T]):\n data: List[T]\n\n class InnerModel(OuterModel[T], Generic[U, T]):\n extra: U\n\n ConcreteInnerModel = InnerModel[int, float]\n\n assert ConcreteInnerModel.model_fields['data'].annotation == List[float]\n assert ConcreteInnerModel.model_fields['extra'].annotation == int\n\n assert ConcreteInnerModel(data=['1'], extra='2').model_dump() == {'data': [1.0], 'extra': 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_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_multiple_inheritance_test_deep_generic_with_multiple_inheritance.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_with_multiple_inheritance_test_deep_generic_with_multiple_inheritance.None_4", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1325, "end_line": 1361, "span_ids": ["test_deep_generic_with_multiple_inheritance"], "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 test_deep_generic_with_multiple_inheritance():\n K = TypeVar('K')\n V = TypeVar('V')\n T = TypeVar('T')\n\n class OuterModelA(BaseModel, Generic[K, V]):\n data: Dict[K, V]\n\n class OuterModelB(BaseModel, Generic[T]):\n stuff: List[T]\n\n class InnerModel(OuterModelA[K, V], OuterModelB[T], Generic[K, V, T]):\n extra: int\n\n ConcreteInnerModel = InnerModel[int, float, str]\n\n assert ConcreteInnerModel.model_fields['data'].annotation == Dict[int, float]\n assert ConcreteInnerModel.model_fields['stuff'].annotation == List[str]\n assert ConcreteInnerModel.model_fields['extra'].annotation == int\n\n with pytest.raises(ValidationError) as exc_info:\n ConcreteInnerModel(data={1.1: '5'}, stuff=[123], extra=5)\n assert exc_info.value.errors() == [\n {'input': 123, 'loc': ('stuff', 0), 'msg': 'Input should be a valid string', 'type': 'string_type'},\n {\n 'input': 1.1,\n 'loc': ('data', '1.1', '[key]'),\n 'msg': 'Input should be a valid integer, got a number with a fractional part',\n 'type': 'int_from_float',\n },\n ]\n\n assert ConcreteInnerModel(data={1: 5}, stuff=['123'], extra=5).model_dump() == {\n 'data': {1: 5},\n 'stuff': ['123'],\n 'extra': 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_pydantic__pydantic/tests/test_generics.py_test_generic_with_referenced_generic_type_1_test_generic_with_partial_callable.assert_not_Model_str_int": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_referenced_generic_type_1_test_generic_with_partial_callable.assert_not_Model_str_int", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1364, "end_line": 1415, "span_ids": ["test_generic_with_referenced_nested_typevar", "test_generic_with_referenced_generic_type_1", "test_generic_with_callable", "test_generic_with_partial_callable"], "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 test_generic_with_referenced_generic_type_1():\n T = TypeVar('T')\n\n class ModelWithType(BaseModel, Generic[T]):\n # Type resolves to type origin of \"type\" which is non-subscriptible for\n # python < 3.9 so we want to make sure it works for other versions\n some_type: Type[T]\n\n class ReferenceModel(BaseModel, Generic[T]):\n abstract_base_with_type: ModelWithType[T]\n\n ReferenceModel[int]\n\n\ndef test_generic_with_referenced_nested_typevar():\n T = TypeVar('T')\n\n class ModelWithType(BaseModel, Generic[T]):\n # Type resolves to type origin of \"collections.abc.Sequence\" which is\n # non-subscriptible for\n # python < 3.9 so we want to make sure it works for other versions\n some_type: Sequence[T]\n\n class ReferenceModel(BaseModel, Generic[T]):\n abstract_base_with_type: ModelWithType[T]\n\n ReferenceModel[int]\n\n\ndef test_generic_with_callable():\n T = TypeVar('T')\n\n class Model(BaseModel, Generic[T]):\n # Callable is a test for any type that accepts a list as an argument\n some_callable: Callable[[Optional[int], T], None]\n\n assert not Model[str].__pydantic_generic_parameters__\n assert Model.__pydantic_generic_parameters__\n\n\ndef test_generic_with_partial_callable():\n T = TypeVar('T')\n U = TypeVar('U')\n\n class Model(BaseModel, Generic[T, U]):\n t: T\n u: U\n # Callable is a test for any type that accepts a list as an argument\n some_callable: Callable[[Optional[int], str], None]\n\n assert Model[str, U].__pydantic_generic_parameters__ == (U,)\n assert not Model[str, int].__pydantic_generic_parameters__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_test_generic_recursive_models.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_test_generic_recursive_models.None_2", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1418, "end_line": 1468, "span_ids": ["test_generic_recursive_models"], "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 test_generic_recursive_models(create_module):\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n T = TypeVar('T')\n\n class Model1(BaseModel, Generic[T]):\n ref: 'Model2[T]'\n\n model_config = dict(undefined_types_warning=False)\n\n class Model2(BaseModel, Generic[T]):\n ref: Union[T, Model1[T]]\n\n model_config = dict(undefined_types_warning=False)\n\n Model1.model_rebuild()\n\n Model1 = module.Model1\n Model2 = module.Model2\n\n with pytest.raises(ValidationError) as exc_info:\n Model1[str].model_validate(dict(ref=dict(ref=dict(ref=dict(ref=123)))))\n assert exc_info.value.errors() == [\n {\n 'input': {'ref': {'ref': 123}},\n 'loc': ('ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 123,\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 123,\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'Model1[str]'),\n 'msg': 'Input should be a valid dictionary',\n 'type': 'dict_type',\n },\n ]\n result = Model1(ref=Model2(ref=Model1(ref=Model2(ref='123'))))\n assert result.model_dump() == {'ref': {'ref': {'ref': {'ref': '123'}}}}\n\n result = Model1[str].model_validate(dict(ref=dict(ref=dict(ref=dict(ref='123')))))\n assert result.model_dump() == {'ref': {'ref': {'ref': {'ref': '123'}}}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_separate_parameters_test_generic_recursive_models_separate_parameters.assert_result_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_separate_parameters_test_generic_recursive_models_separate_parameters.assert_result_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1471, "end_line": 1532, "span_ids": ["test_generic_recursive_models_separate_parameters"], "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 test_generic_recursive_models_separate_parameters(create_module):\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n T = TypeVar('T')\n\n class Model1(BaseModel, Generic[T]):\n ref: 'Model2[T]'\n\n model_config = dict(undefined_types_warning=False)\n\n S = TypeVar('S')\n\n class Model2(BaseModel, Generic[S]):\n ref: Union[S, Model1[S]]\n\n model_config = dict(undefined_types_warning=False)\n\n Model1.model_rebuild()\n\n Model1 = module.Model1\n # Model2 = module.Model2\n\n with pytest.raises(ValidationError) as exc_info:\n Model1[str].model_validate(dict(ref=dict(ref=dict(ref=dict(ref=123)))))\n assert exc_info.value.errors() == [\n {\n 'input': {'ref': {'ref': 123}},\n 'loc': ('ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 123,\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 123,\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'Model1[str]'),\n 'msg': 'Input should be a valid dictionary',\n 'type': 'dict_type',\n },\n ]\n # TODO: Unlike in the previous test, the following (commented) line currently produces this error:\n # > result = Model1(ref=Model2(ref=Model1(ref=Model2(ref='123'))))\n # E pydantic_core._pydantic_core.ValidationError: 1 validation error for Model2[~T]\n # E ref\n # E Input should be a valid dictionary [type=dict_type, input_value=Model2(ref='123'), input_type=Model2]\n # The root of this problem is that Model2[T] ends up being a proper subclass of Model2 since T != S.\n # I am sure we can solve this problem, just need to put a bit more effort in.\n # While I don't think we should block merging this functionality on getting the next line to pass,\n # I think we should come back and resolve this at some point.\n # result = Model1(ref=Model2(ref=Model1(ref=Model2(ref='123'))))\n # assert result.model_dump() == {'ref': {'ref': {'ref': {'ref': '123'}}}}\n\n result = Model1[str].model_validate(dict(ref=dict(ref=dict(ref=dict(ref='123')))))\n assert result.model_dump() == {'ref': {'ref': {'ref': {'ref': '123'}}}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_repeated_separate_parameters_test_generic_recursive_models_repeated_separate_parameters.module.Model1_model_rebuild_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_repeated_separate_parameters_test_generic_recursive_models_repeated_separate_parameters.module.Model1_model_rebuild_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1535, "end_line": 1558, "span_ids": ["test_generic_recursive_models_repeated_separate_parameters"], "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 test_generic_recursive_models_repeated_separate_parameters(create_module):\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n T = TypeVar('T')\n\n class Model1(BaseModel, Generic[T]):\n ref: 'Model2[T]'\n ref2: Union['Model2[T]', None] = None\n\n model_config = dict(undefined_types_warning=False)\n\n S = TypeVar('S')\n\n class Model2(BaseModel, Generic[S]):\n ref: Union[S, Model1[S]]\n ref2: Union[S, Model1[S], None] = None\n\n model_config = dict(undefined_types_warning=False)\n\n Model1.model_rebuild()\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_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_repeated_separate_parameters.Model1_test_generic_recursive_models_repeated_separate_parameters.assert_result_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_repeated_separate_parameters.Model1_test_generic_recursive_models_repeated_separate_parameters.assert_result_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1560, "end_line": 1590, "span_ids": ["test_generic_recursive_models_repeated_separate_parameters"], "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 test_generic_recursive_models_repeated_separate_parameters(create_module):\n # ... other code\n\n Model1 = module.Model1\n # Model2 = module.Model2\n\n with pytest.raises(ValidationError) as exc_info:\n Model1[str].model_validate(dict(ref=dict(ref=dict(ref=dict(ref=123)))))\n assert exc_info.value.errors() == [\n {\n 'input': {'ref': {'ref': 123}},\n 'loc': ('ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 123,\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 123,\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'Model1[str]'),\n 'msg': 'Input should be a valid dictionary',\n 'type': 'dict_type',\n },\n ]\n\n result = Model1[str].model_validate(dict(ref=dict(ref=dict(ref=dict(ref='123')))))\n assert result.model_dump() == {\n 'ref': {'ref': {'ref': {'ref': '123', 'ref2': None}, 'ref2': None}, 'ref2': None},\n 'ref2': 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_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_triple_test_generic_recursive_models_triple.module.A1_model_rebuild_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_triple_test_generic_recursive_models_triple.module.A1_model_rebuild_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1593, "end_line": 1619, "span_ids": ["test_generic_recursive_models_triple"], "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 test_generic_recursive_models_triple(create_module):\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n T1 = TypeVar('T1')\n T2 = TypeVar('T2')\n T3 = TypeVar('T3')\n\n class A1(BaseModel, Generic[T1]):\n a1: 'A2[T1]'\n\n model_config = dict(undefined_types_warning=False)\n\n class A2(BaseModel, Generic[T2]):\n a2: 'A3[T2]'\n\n model_config = dict(undefined_types_warning=False)\n\n class A3(BaseModel, Generic[T3]):\n a3: Union['A1[T3]', T3]\n\n model_config = dict(undefined_types_warning=False)\n\n A1.model_rebuild()\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_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_triple.A1_test_generic_recursive_models_triple.A1_int_model_validate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_triple.A1_test_generic_recursive_models_triple.A1_int_model_validate_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1621, "end_line": 1635, "span_ids": ["test_generic_recursive_models_triple"], "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 test_generic_recursive_models_triple(create_module):\n # ... other code\n\n A1 = module.A1\n\n with pytest.raises(ValidationError) as exc_info:\n A1[str].model_validate({'a1': {'a2': {'a3': 1}}})\n assert exc_info.value.errors() == [\n {\n 'input': 1,\n 'loc': ('a1', 'a2', 'a3', 'A1[str]'),\n 'msg': 'Input should be a valid dictionary',\n 'type': 'dict_type',\n },\n {'input': 1, 'loc': ('a1', 'a2', 'a3', 'str'), 'msg': 'Input should be a valid string', 'type': 'string_type'},\n ]\n\n A1[int].model_validate({'a1': {'a2': {'a3': 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_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_with_a_concrete_parameter_test_generic_recursive_models_with_a_concrete_parameter.assert_collect_invalid_sc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_with_a_concrete_parameter_test_generic_recursive_models_with_a_concrete_parameter.assert_collect_invalid_sc", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1638, "end_line": 1665, "span_ids": ["test_generic_recursive_models_with_a_concrete_parameter"], "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 test_generic_recursive_models_with_a_concrete_parameter(create_module):\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n V1 = TypeVar('V1')\n V2 = TypeVar('V2')\n V3 = TypeVar('V3')\n\n class M1(BaseModel, Generic[V1, V2]):\n a: V1\n m: 'M2[V2]'\n\n model_config = dict(undefined_types_warning=False)\n\n class M2(BaseModel, Generic[V3]):\n m: Union[M1[int, V3], V3]\n\n model_config = dict(undefined_types_warning=False)\n\n M1.model_rebuild()\n\n M1 = module.M1\n\n # assert M1.__pydantic_core_schema__ == {}\n assert collect_invalid_schemas(M1.__pydantic_core_schema__) == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_complicated_test_generic_recursive_models_complicated.assert_collect_invalid_sc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_complicated_test_generic_recursive_models_complicated.assert_collect_invalid_sc", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1668, "end_line": 1739, "span_ids": ["test_generic_recursive_models_complicated"], "tokens": 503}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_generic_recursive_models_complicated(create_module):\n \"\"\"\n TODO: If we drop the use of LimitedDict and use WeakValueDictionary only, this test will fail if run by itself.\n This is due to weird behavior with the WeakValueDictionary used for caching.\n As part of the next batch of generics work, we should attempt to fix this if possible.\n In the meantime, if this causes issues, or the test otherwise starts failing, please make it xfail\n with strict=False\n \"\"\"\n\n @create_module\n def module():\n from typing import Generic, TypeVar, Union\n\n from pydantic import BaseModel\n\n T1 = TypeVar('T1')\n T2 = TypeVar('T2')\n T3 = TypeVar('T3')\n\n class A1(BaseModel, Generic[T1]):\n a1: 'A2[T1]'\n\n model_config = dict(undefined_types_warning=False)\n\n class A2(BaseModel, Generic[T2]):\n a2: 'A3[T2]'\n\n model_config = dict(undefined_types_warning=False)\n\n class A3(BaseModel, Generic[T3]):\n a3: Union[A1[T3], T3]\n\n model_config = dict(undefined_types_warning=False)\n\n A1.model_rebuild()\n\n S1 = TypeVar('S1')\n S2 = TypeVar('S2')\n\n class B1(BaseModel, Generic[S1]):\n a1: 'B2[S1]'\n\n model_config = dict(undefined_types_warning=False)\n\n class B2(BaseModel, Generic[S2]):\n a2: 'B1[S2]'\n\n model_config = dict(undefined_types_warning=False)\n\n B1.model_rebuild()\n\n V1 = TypeVar('V1')\n V2 = TypeVar('V2')\n V3 = TypeVar('V3')\n\n class M1(BaseModel, Generic[V1, V2]):\n a: int\n b: B1[V2]\n m: 'M2[V1]'\n\n model_config = dict(undefined_types_warning=False)\n\n class M2(BaseModel, Generic[V3]):\n m: Union[M1[V3, int], V3]\n\n model_config = dict(undefined_types_warning=False)\n\n M1.model_rebuild()\n\n M1 = module.M1\n\n assert collect_invalid_schemas(M1.__pydantic_core_schema__) == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_in_container_test_generic_recursive_models_in_container.assert_type_instance_foob": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursive_models_in_container_test_generic_recursive_models_in_container.assert_type_instance_foob", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1742, "end_line": 1757, "span_ids": ["test_generic_recursive_models_in_container"], "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 test_generic_recursive_models_in_container(create_module):\n @create_module\n def module():\n from typing import Generic, List, Optional, TypeVar\n\n from pydantic import BaseModel\n\n T = TypeVar('T')\n\n class MyGenericModel(BaseModel, Generic[T]):\n foobar: Optional[List['MyGenericModel[T]']]\n spam: T\n\n MyGenericModel = module.MyGenericModel\n instance = MyGenericModel[int](foobar=[{'foobar': [], 'spam': 1}], spam=1)\n assert type(instance.foobar[0]) == MyGenericModel[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_pydantic__pydantic/tests/test_generics.py_test_schema_is_valid_test_generic_literal.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_schema_is_valid_test_generic_literal.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1760, "end_line": 1791, "span_ids": ["test_schema_is_valid", "test_generic_enum", "test_generic_literal"], "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 test_schema_is_valid():\n assert not collect_invalid_schemas(core_schema.none_schema())\n assert collect_invalid_schemas(core_schema.nullable_schema(core_schema.int_schema(metadata={'invalid': True})))\n\n\ndef test_generic_enum():\n T = TypeVar('T')\n\n class SomeGenericModel(BaseModel, Generic[T]):\n some_field: T\n\n class SomeStringEnum(str, Enum):\n A = 'A'\n B = 'B'\n\n class MyModel(BaseModel):\n my_gen: SomeGenericModel[SomeStringEnum]\n\n m = MyModel.model_validate({'my_gen': {'some_field': 'A'}})\n assert m.my_gen.some_field is SomeStringEnum.A\n\n\ndef test_generic_literal():\n FieldType = TypeVar('FieldType')\n ValueType = TypeVar('ValueType')\n\n class GModel(BaseModel, Generic[FieldType, ValueType]):\n field: Dict[FieldType, ValueType]\n\n Fields = Literal['foo', 'bar']\n m = GModel[Fields, str](field={'foo': 'x'})\n assert m.model_dump() == {'field': {'foo': '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_pydantic__pydantic/tests/test_generics.py_test_generic_enums_test_generic_enums.assert_set_Model_model_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_enums_test_generic_enums.assert_set_Model_model_js", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1794, "end_line": 1810, "span_ids": ["test_generic_enums"], "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 test_generic_enums():\n T = TypeVar('T')\n\n class GModel(BaseModel, Generic[T]):\n x: T\n\n class EnumA(str, Enum):\n a = 'a'\n\n class EnumB(str, Enum):\n b = 'b'\n\n class Model(BaseModel):\n g_a: GModel[EnumA]\n g_b: GModel[EnumB]\n\n assert set(Model.model_json_schema()['$defs']) == {'EnumA', 'EnumB', 'GModel_EnumA_', 'GModel_EnumB_'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_user_defined_generic_field_test_multi_inheritance_generic_binding.assert_not_issubclass_B_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_user_defined_generic_field_test_multi_inheritance_generic_binding.assert_not_issubclass_B_f", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1813, "end_line": 1914, "span_ids": ["test_generic_annotated", "test_generic_subclass", "test_generic_subclass_with_extra_type", "test_generic_subclass_with_partial_application", "test_multi_inheritance_generic_binding", "test_multilevel_generic_binding", "test_generic_with_user_defined_generic_field"], "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 test_generic_with_user_defined_generic_field():\n T = TypeVar('T')\n\n class GenericList(List[T]):\n pass\n\n class Model(BaseModel, Generic[T]):\n field: GenericList[T]\n\n model = Model[int](field=[5])\n assert model.field[0] == 5\n\n with pytest.raises(ValidationError):\n model = Model[int](field=['a'])\n\n\ndef test_generic_annotated():\n T = TypeVar('T')\n\n class SomeGenericModel(BaseModel, Generic[T]):\n some_field: Annotated[T, Field(alias='the_alias')]\n\n SomeGenericModel[str](the_alias='qwe')\n\n\ndef test_generic_subclass():\n T = TypeVar('T')\n\n class A(BaseModel, Generic[T]):\n ...\n\n class B(A[T], Generic[T]):\n ...\n\n class C(B[T], Generic[T]):\n ...\n\n assert B[int].__name__ == 'B[int]'\n assert issubclass(B[int], B)\n assert issubclass(B[int], A)\n assert not issubclass(B[int], C)\n\n\ndef test_generic_subclass_with_partial_application():\n T = TypeVar('T')\n S = TypeVar('S')\n\n class A(BaseModel, Generic[T]):\n ...\n\n class B(A[S], Generic[T, S]):\n ...\n\n PartiallyAppliedB = B[str, T]\n assert issubclass(PartiallyAppliedB[int], A)\n\n\ndef test_multilevel_generic_binding():\n T = TypeVar('T')\n S = TypeVar('S')\n\n class A(BaseModel, Generic[T, S]):\n ...\n\n class B(A[str, T], Generic[T]):\n ...\n\n assert B[int].__name__ == 'B[int]'\n assert issubclass(B[int], A)\n\n\ndef test_generic_subclass_with_extra_type():\n T = TypeVar('T')\n S = TypeVar('S')\n\n class A(BaseModel, Generic[T]):\n ...\n\n class B(A[S], Generic[T, S]):\n ...\n\n assert B[int, str].__name__ == 'B[int, str]', B[int, str].__name__\n assert issubclass(B[str, int], B)\n assert issubclass(B[str, int], A)\n\n\ndef test_multi_inheritance_generic_binding():\n T = TypeVar('T')\n\n class A(BaseModel, Generic[T]):\n ...\n\n class B(A[int], Generic[T]):\n ...\n\n class C(B[str], Generic[T]):\n ...\n\n assert C[float].__name__ == 'C[float]'\n assert issubclass(C[float], B)\n assert issubclass(C[float], A)\n assert not issubclass(B[float], 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_pydantic__pydantic/tests/test_generics.py_test_parent_field_parametrization_test_parent_field_parametrization.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parent_field_parametrization_test_parent_field_parametrization.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1917, "end_line": 1935, "span_ids": ["test_parent_field_parametrization"], "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 test_parent_field_parametrization():\n T = TypeVar('T')\n\n class A(BaseModel, Generic[T]):\n a: T\n\n class B(A, Generic[T]):\n b: T\n\n with pytest.raises(ValidationError) as exc_info:\n B[int](a='a', b=1)\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_generics.py_test_multi_inheritance_generic_defaults_test_multi_inheritance_generic_defaults.assert_C_a_1_c_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_multi_inheritance_generic_defaults_test_multi_inheritance_generic_defaults.assert_C_a_1_c_mode", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1938, "end_line": 1953, "span_ids": ["test_multi_inheritance_generic_defaults"], "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 test_multi_inheritance_generic_defaults():\n T = TypeVar('T')\n\n class A(BaseModel, Generic[T]):\n a: T\n x: str = 'a'\n\n class B(A[int], Generic[T]):\n b: Optional[T] = None\n y: str = 'b'\n\n class C(B[str], Generic[T]):\n c: T\n z: str = 'c'\n\n assert C(a=1, c=...).model_dump() == {'a': 1, 'b': None, 'c': ..., 'x': 'a', 'y': 'b', 'z': '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_pydantic__pydantic/tests/test_generics.py_test_parse_generic_json_memray_limit_memory.if_memray_in_sys_argv.else_.return.pytest_mark_skip_reason_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parse_generic_json_memray_limit_memory.if_memray_in_sys_argv.else_.return.pytest_mark_skip_reason_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1956, "end_line": 1986, "span_ids": ["memray_limit_memory", "test_parse_generic_json"], "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": "@pytest.mark.xfail(reason=\"'Json type's JSON schema; see issue #5072\")\ndef test_parse_generic_json():\n T = TypeVar('T')\n\n class MessageWrapper(BaseModel, Generic[T]):\n message: Json[T]\n\n class Payload(BaseModel):\n payload_field: str\n\n raw = json.dumps({'payload_field': 'payload'})\n record = MessageWrapper[Payload](message=raw)\n assert isinstance(record.message, Payload)\n\n schema = record.model_json_schema()\n # This seems appropriate if the goal is to represent the \"serialization\" schema, not the validation schema.\n # We may need a better approach for types with different inputs and outputs; I opened an issue for this in #5072\n assert schema['properties'] == {'message': {'$ref': '#/definitions/Payload'}}\n assert schema['definitions']['Payload'] == {\n 'title': 'Payload',\n 'type': 'object',\n 'properties': {'payload_field': {'title': 'Payload Field', 'type': 'string'}},\n 'required': ['payload_field'],\n }\n\n\ndef memray_limit_memory(limit):\n if '--memray' in sys.argv:\n return pytest.mark.limit_memory(limit)\n else:\n return pytest.mark.skip(reason='memray not enabled')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generics_memory_use_test_generics_memory_use.for_t1_t2_t3_in_total_._.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generics_memory_use_test_generics_memory_use.for_t1_t2_t3_in_total_._.pass", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1989, "end_line": 2033, "span_ids": ["test_generics_memory_use"], "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": "@memray_limit_memory('100 MB')\ndef test_generics_memory_use():\n \"\"\"See:\n - https://github.com/pydantic/pydantic/issues/3829\n - https://github.com/pydantic/pydantic/pull/4083\n - https://github.com/pydantic/pydantic/pull/5052\n \"\"\"\n\n T = TypeVar('T')\n U = TypeVar('U')\n V = TypeVar('V')\n\n class MyModel(BaseModel, Generic[T, U, V]):\n message: Json[T]\n field: Dict[U, V]\n\n class Outer(BaseModel, Generic[T]):\n inner: T\n\n types = [\n int,\n str,\n float,\n bool,\n bytes,\n ]\n\n containers = [\n List,\n Tuple,\n Set,\n FrozenSet,\n ]\n\n all = [*types, *[container[tp] for container in containers for tp in types]]\n\n total = list(itertools.product(all, all, all))\n\n for t1, t2, t3 in total:\n\n class Foo(MyModel[t1, t2, t3]):\n pass\n\n class _(Outer[Foo]):\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_pydantic__pydantic/tests/test_generics.py_test_generic_model_as_parameter_to_generic_type_alias_ensure_contextvar_gets_reset.assert_not_recursively_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_model_as_parameter_to_generic_type_alias_ensure_contextvar_gets_reset.assert_not_recursively_de", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2036, "end_line": 2059, "span_ids": ["test_generic_model_as_parameter_to_generic_type_alias", "test_double_typevar_substitution", "ensure_contextvar_gets_reset"], "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": "@pytest.mark.xfail(reason='Generic models are not type aliases', raises=TypeError)\ndef test_generic_model_as_parameter_to_generic_type_alias() -> None:\n T = TypeVar('T')\n\n class GenericPydanticModel(BaseModel, Generic[T]):\n x: T\n\n GenericPydanticModelList = List[GenericPydanticModel[T]]\n GenericPydanticModelList[int]\n\n\ndef test_double_typevar_substitution() -> None:\n T = TypeVar('T')\n\n class GenericPydanticModel(BaseModel, Generic[T]):\n x: T = []\n\n assert GenericPydanticModel[List[T]](x=[1, 2, 3]).model_dump() == {'x': [1, 2, 3]}\n\n\n@pytest.fixture(autouse=True)\ndef ensure_contextvar_gets_reset():\n # Ensure that the generic recursion contextvar is empty at the start of every test\n assert not recursively_defined_type_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_pydantic__pydantic/tests/test_generics.py_test_generic_recursion_contextvar_test_generic_recursion_contextvar.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_recursion_contextvar_test_generic_recursion_contextvar.None_1", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2062, "end_line": 2082, "span_ids": ["test_generic_recursion_contextvar"], "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 test_generic_recursion_contextvar():\n T = TypeVar('T')\n\n class TestingException(Exception):\n pass\n\n class Model(BaseModel, Generic[T]):\n pass\n\n # Make sure that the contextvar-managed recursive types cache begins empty\n assert not recursively_defined_type_refs()\n try:\n with generic_recursion_self_type(Model, (int,)):\n # Make sure that something has been added to the contextvar-managed recursive types cache\n assert recursively_defined_type_refs()\n raise TestingException\n except TestingException:\n pass\n\n # Make sure that an exception causes the contextvar-managed recursive types cache to be reset\n assert not recursively_defined_type_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_pydantic__pydantic/tests/test_generics.py_test_limited_dict_test_limited_dict.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_limited_dict_test_limited_dict.None_10", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2085, "end_line": 2122, "span_ids": ["test_limited_dict"], "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 test_limited_dict():\n d = LimitedDict(10)\n d[1] = '1'\n d[2] = '2'\n assert list(d.items()) == [(1, '1'), (2, '2')]\n for no in '34567890':\n d[int(no)] = no\n assert list(d.items()) == [\n (1, '1'),\n (2, '2'),\n (3, '3'),\n (4, '4'),\n (5, '5'),\n (6, '6'),\n (7, '7'),\n (8, '8'),\n (9, '9'),\n (0, '0'),\n ]\n d[11] = '11'\n\n # reduce size to 9 after setting 11\n assert len(d) == 9\n assert list(d.items()) == [\n (3, '3'),\n (4, '4'),\n (5, '5'),\n (6, '6'),\n (7, '7'),\n (8, '8'),\n (9, '9'),\n (0, '0'),\n (11, '11'),\n ]\n d[12] = '12'\n assert len(d) == 10\n d[13] = '13'\n assert len(d) == 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_pydantic__pydantic/tests/test_generics.py_test_construct_generic_model_with_validation_test_construct_generic_model_with_validation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_construct_generic_model_with_validation_test_construct_generic_model_with_validation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2125, "end_line": 2150, "span_ids": ["test_construct_generic_model_with_validation"], "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 test_construct_generic_model_with_validation():\n T = TypeVar('T')\n\n class Page(BaseModel, Generic[T]):\n page: int = Field(ge=42)\n items: Sequence[T]\n unenforced: PositiveInt = Field(..., lt=10)\n\n with pytest.raises(ValidationError) as exc_info:\n Page[int](page=41, items=[], unenforced=11)\n assert exc_info.value.errors() == [\n {\n 'ctx': {'ge': 42},\n 'input': 41,\n 'loc': ('page',),\n 'msg': 'Input should be greater than or equal to 42',\n 'type': 'greater_than_equal',\n },\n {\n 'ctx': {'lt': 10},\n 'input': 11,\n 'loc': ('unenforced',),\n 'msg': 'Input should be less than 10',\n 'type': 'less_than',\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_pydantic__pydantic/tests/test_generics.py_test_construct_other_generic_model_with_validation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_construct_other_generic_model_with_validation_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2153, "end_line": 2181, "span_ids": ["test_construct_other_generic_model_with_validation"], "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 test_construct_other_generic_model_with_validation():\n # based on the test-case from https://github.com/samuelcolvin/pydantic/issues/2581\n T = TypeVar('T')\n\n class Page(BaseModel, Generic[T]):\n page: int = Field(ge=42)\n items: Sequence[T]\n\n # Check we can perform this assignment, this is the actual test\n concrete_model = Page[str]\n print(concrete_model)\n assert concrete_model.__name__ == 'Page[str]'\n\n # Sanity check the resulting type works as expected\n valid = concrete_model(page=42, items=[])\n assert valid.page == 42\n\n with pytest.raises(ValidationError) as exc_info:\n concrete_model(page=41, items=[])\n assert exc_info.value.errors() == [\n {\n 'ctx': {'ge': 42},\n 'input': 41,\n 'loc': ('page',),\n 'msg': 'Input should be greater than or equal to 42',\n 'type': 'greater_than_equal',\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_pydantic__pydantic/tests/test_hypothesis_plugin.py_typing_gen_models.JsonModel.json_pydantic_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_typing_gen_models.JsonModel.json_pydantic_model", "embedding": null, "metadata": {"file_path": "tests/test_hypothesis_plugin.py", "file_name": "test_hypothesis_plugin.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 75, "span_ids": ["imports", "gen_models"], "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": "import typing\nfrom datetime import date\n\nimport pytest\n\nimport pydantic\nfrom pydantic.networks import import_email_validator\n\ntry:\n from hypothesis import HealthCheck, given, settings\n from hypothesis import strategies as st\nexcept ImportError:\n from unittest import mock\n\n # pass-through decorator\n given = settings = lambda *a, **kw: (lambda f: f)\n HealthCheck = st = mock.Mock()\n\n pytestmark = pytest.mark.skipif(True, reason='\"hypothesis\" not installed')\n\n\ndef gen_models():\n # TODO fix and remove this return\n return\n\n class MiscModel(pydantic.BaseModel):\n # Each of these models contains a few related fields; the idea is that\n # if there's a bug we have neither too many fields to dig through nor\n # too many models to read.\n color: pydantic.color.Color\n json_any: pydantic.Json\n\n class StringsModel(pydantic.BaseModel):\n card: pydantic.PaymentCardNumber\n secbytes: pydantic.SecretBytes\n secstr: pydantic.SecretStr\n\n class UUIDsModel(pydantic.BaseModel):\n uuid1: pydantic.UUID1\n uuid3: pydantic.UUID3\n uuid4: pydantic.UUID4\n uuid5: pydantic.UUID5\n\n class IPvAnyAddress(pydantic.BaseModel):\n address: pydantic.IPvAnyAddress\n\n class IPvAnyInterface(pydantic.BaseModel):\n interface: pydantic.IPvAnyInterface\n\n class IPvAnyNetwork(pydantic.BaseModel):\n network: pydantic.IPvAnyNetwork\n\n class StrictNumbersModel(pydantic.BaseModel):\n strictbool: pydantic.StrictBool\n strictint: pydantic.StrictInt\n strictfloat: pydantic.StrictFloat\n strictstr: pydantic.StrictStr\n\n class NumbersModel(pydantic.BaseModel):\n posint: pydantic.PositiveInt\n negint: pydantic.NegativeInt\n posfloat: pydantic.PositiveFloat\n negfloat: pydantic.NegativeFloat\n nonposint: pydantic.NonPositiveInt\n nonnegint: pydantic.NonNegativeInt\n nonposfloat: pydantic.NonPositiveFloat\n nonnegfloat: pydantic.NonNegativeFloat\n\n class JsonModel(pydantic.BaseModel):\n json_int: pydantic.Json[int]\n json_float: pydantic.Json[float]\n json_str: pydantic.Json[str]\n json_int_or_str: pydantic.Json[typing.Union[int, str]]\n json_list_of_float: pydantic.Json[typing.List[float]]\n json_pydantic_model: pydantic.Json[pydantic.BaseModel]\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_pydantic__pydantic/tests/test_hypothesis_plugin.py_gen_models.ConstrainedNumbersModel_gen_models.ConstrainedNumbersModel.condecimaleplc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_gen_models.ConstrainedNumbersModel_gen_models.ConstrainedNumbersModel.condecimaleplc", "embedding": null, "metadata": {"file_path": "tests/test_hypothesis_plugin.py", "file_name": "test_hypothesis_plugin.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 88, "span_ids": ["gen_models"], "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 gen_models():\n # ... other code\n\n class ConstrainedNumbersModel(pydantic.BaseModel):\n conintt: pydantic.conint(gt=10, lt=100)\n coninte: pydantic.conint(ge=10, le=100)\n conintmul: pydantic.conint(ge=10, le=100, multiple_of=7)\n confloatt: pydantic.confloat(gt=10, lt=100)\n confloate: pydantic.confloat(ge=10, le=100)\n confloatemul: pydantic.confloat(ge=10, le=100, multiple_of=4.2)\n confloattmul: pydantic.confloat(gt=10, lt=100, multiple_of=10)\n condecimalt: pydantic.condecimal(gt=10, lt=100)\n condecimale: pydantic.condecimal(ge=10, le=100)\n condecimaltplc: pydantic.condecimal(gt=10, lt=100, decimal_places=5)\n condecimaleplc: pydantic.condecimal(ge=10, le=100, decimal_places=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_pydantic__pydantic/tests/test_hypothesis_plugin.py_gen_models.ConstrainedDateModel_gen_models.try_.else_.yield_EmailsModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_gen_models.ConstrainedDateModel_gen_models.try_.else_.yield_EmailsModel", "embedding": null, "metadata": {"file_path": "tests/test_hypothesis_plugin.py", "file_name": "test_hypothesis_plugin.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 118, "span_ids": ["gen_models"], "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 gen_models():\n # ... other code\n\n class ConstrainedDateModel(pydantic.BaseModel):\n condatet: pydantic.condate(gt=date(1980, 1, 1), lt=date(2180, 12, 31))\n condatee: pydantic.condate(ge=date(1980, 1, 1), le=date(2180, 12, 31))\n\n yield from (\n MiscModel,\n StringsModel,\n UUIDsModel,\n IPvAnyAddress,\n IPvAnyInterface,\n IPvAnyNetwork,\n StrictNumbersModel,\n NumbersModel,\n JsonModel,\n ConstrainedNumbersModel,\n ConstrainedDateModel,\n )\n\n try:\n import_email_validator()\n except ImportError:\n pass\n else:\n\n class EmailsModel(pydantic.BaseModel):\n email: pydantic.EmailStr\n name_email: pydantic.NameEmail\n\n yield EmailsModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_test_can_construct_models_with_all_fields_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_hypothesis_plugin.py_test_can_construct_models_with_all_fields_", "embedding": null, "metadata": {"file_path": "tests/test_hypothesis_plugin.py", "file_name": "test_hypothesis_plugin.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 133, "span_ids": ["test_can_construct_models_with_all_fields"], "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": "@pytest.mark.parametrize('model', gen_models())\n@settings(suppress_health_check={HealthCheck.too_slow}, deadline=None)\n@given(data=st.data())\ndef test_can_construct_models_with_all_fields(data, model):\n # The value of this test is to confirm that Hypothesis knows how to provide\n # valid values for each field - otherwise, this would raise ValidationError.\n instance = data.draw(st.from_type(model))\n\n # We additionally check that the instance really is of type `model`, because\n # an evil implementation could avoid ValidationError by means of e.g.\n # `st.register_type_strategy(model, st.none())`, skipping the constructor.\n assert isinstance(instance, model)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_json_MyModel.c._d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_json_MyModel.c._d_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["imports", "MyEnum", "MyModel"], "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 json\nimport re\nimport sys\nfrom dataclasses import dataclass as vanilla_dataclass\nfrom datetime import date, datetime, time, timedelta, timezone\nfrom decimal import Decimal\nfrom enum import Enum\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom pathlib import Path\nfrom typing import Generator, Optional, Pattern\nfrom uuid import UUID\n\nimport pytest\nfrom pydantic_core import SchemaSerializer\n\nfrom pydantic import BaseModel, ConfigDict, NameEmail, field_serializer\nfrom pydantic._internal._generate_schema import GenerateSchema\nfrom pydantic.color import Color\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\nfrom pydantic.deprecated.json import pydantic_encoder, timedelta_isoformat\nfrom pydantic.types import DirectoryPath, FilePath, SecretBytes, SecretStr, condecimal\n\ntry:\n import email_validator\nexcept ImportError:\n email_validator = None\n\n\nclass MyEnum(Enum):\n foo = 'bar'\n snap = 'crackle'\n\n\nclass MyModel(BaseModel):\n a: str = 'b'\n c: str = '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_pydantic__pydantic/tests/test_json.py_test_json_serialization_test_json_serialization.assert_serializer_to_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_serialization_test_json_serialization.assert_serializer_to_json", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 39, "end_line": 75, "span_ids": ["test_json_serialization"], "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": "@pytest.mark.parametrize(\n 'ser_type,gen_value,json_output',\n [\n (UUID, lambda: 'ebcdab58-6eb8-46fb-a190-d07a33e9eac8', b'\"ebcdab58-6eb8-46fb-a190-d07a33e9eac8\"'),\n (IPv4Address, lambda: '192.168.0.1', b'\"192.168.0.1\"'),\n (Color, lambda: Color('#000'), b'\"black\"'),\n (Color, lambda: Color((1, 12, 123)), b'\"#010c7b\"'),\n (SecretStr, lambda: SecretStr('abcd'), b'\"**********\"'),\n (SecretStr, lambda: SecretStr(''), b'\"\"'),\n (SecretBytes, lambda: SecretBytes(b'xyz'), b'\"**********\"'),\n (SecretBytes, lambda: SecretBytes(b''), b'\"\"'),\n (IPv6Address, lambda: IPv6Address('::1:0:1'), b'\"::1:0:1\"'),\n (IPv4Interface, lambda: IPv4Interface('192.168.0.0/24'), b'\"192.168.0.0/24\"'),\n (IPv6Interface, lambda: IPv6Interface('2001:db00::/120'), b'\"2001:db00::/120\"'),\n (IPv4Network, lambda: IPv4Network('192.168.0.0/24'), b'\"192.168.0.0/24\"'),\n (IPv6Network, lambda: IPv6Network('2001:db00::/120'), b'\"2001:db00::/120\"'),\n (datetime, lambda: datetime(2032, 1, 1, 1, 1), b'\"2032-01-01T01:01:00\"'),\n (datetime, lambda: datetime(2032, 1, 1, 1, 1, tzinfo=timezone.utc), b'\"2032-01-01T01:01:00Z\"'),\n (datetime, lambda: datetime(2032, 1, 1), b'\"2032-01-01T00:00:00\"'),\n (time, lambda: time(12, 34, 56), b'\"12:34:56\"'),\n (timedelta, lambda: timedelta(days=12, seconds=34, microseconds=56), b'\"P12DT34.000056S\"'),\n (timedelta, lambda: timedelta(seconds=-1), b'\"-PT1S\"'),\n (set, lambda: {1, 2, 3}, b'[1,2,3]'),\n (frozenset, lambda: frozenset([1, 2, 3]), b'[1,2,3]'),\n (Generator[int, None, None], lambda: (v for v in range(4)), b'[0,1,2,3]'),\n (bytes, lambda: b'this is bytes', b'\"this is bytes\"'),\n (Decimal, lambda: Decimal('12.34'), b'\"12.34\"'),\n (MyModel, lambda: MyModel(), b'{\"a\":\"b\",\"c\":\"d\"}'),\n (MyEnum, lambda: MyEnum.foo, b'\"bar\"'),\n (Pattern, lambda: re.compile('^regex$'), b'\"^regex$\"'),\n ],\n)\ndef test_json_serialization(ser_type, gen_value, json_output):\n gen = GenerateSchema(False, None)\n schema = gen.generate_schema(ser_type)\n serializer = SchemaSerializer(schema)\n assert serializer.to_json(gen_value()) == json_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_pydantic__pydantic/tests/test_json.py_test_json_serialization_email_test_path_encoding.assert_json_dumps_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_serialization_email_test_path_encoding.assert_json_dumps_model_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 100, "span_ids": ["test_path_encoding", "test_json_serialization_email"], "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": "@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\ndef test_json_serialization_email():\n gen = GenerateSchema(False, None)\n schema = gen.generate_schema(NameEmail)\n serializer = SchemaSerializer(schema)\n assert serializer.to_json(NameEmail('foo bar', 'foobaR@example.com')) == b'\"foo bar \"'\n\n\n@pytest.mark.skipif(sys.platform.startswith('win'), reason='paths look different on windows')\ndef test_path_encoding(tmpdir):\n class PathModel(BaseModel):\n path: Path\n file_path: FilePath\n dir_path: DirectoryPath\n\n tmpdir = Path(tmpdir)\n file_path = tmpdir / 'bar'\n file_path.touch()\n dir_path = tmpdir / 'baz'\n dir_path.mkdir()\n model = PathModel(path=Path('/path/test/example/'), file_path=file_path, dir_path=dir_path)\n expected = f'{{\"path\": \"/path/test/example\", \"file_path\": \"{file_path}\", \"dir_path\": \"{dir_path}\"}}'\n assert json.dumps(model, default=pydantic_encoder) == 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_pydantic__pydantic/tests/test_json.py_test_model_encoding_test_model_encoding.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_model_encoding_test_model_encoding.None_2", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 117, "span_ids": ["test_model_encoding"], "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 test_model_encoding():\n class ModelA(BaseModel):\n x: int\n y: str\n\n class Model(BaseModel):\n a: float\n b: bytes\n c: Decimal\n d: ModelA\n\n m = Model(a=10.2, b='foobar', c=10.2, d={'x': 123, 'y': '123'})\n assert m.model_dump() == {'a': 10.2, 'b': b'foobar', 'c': Decimal('10.2'), 'd': {'x': 123, 'y': '123'}}\n assert m.model_dump_json() == '{\"a\":10.2,\"b\":\"foobar\",\"c\":\"10.2\",\"d\":{\"x\":123,\"y\":\"123\"}}'\n assert m.model_dump_json(exclude={'b'}) == '{\"a\":10.2,\"c\":\"10.2\",\"d\":{\"x\":123,\"y\":\"123\"}}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_subclass_encoding_test_subclass_encoding.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_subclass_encoding_test_subclass_encoding.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 130, "span_ids": ["test_subclass_encoding"], "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 test_subclass_encoding():\n class SubDate(datetime):\n pass\n\n class Model(BaseModel):\n a: datetime\n b: SubDate\n\n m = Model(a=datetime(2032, 1, 1, 1, 1), b=SubDate(2020, 2, 29, 12, 30))\n assert m.model_dump() == {'a': datetime(2032, 1, 1, 1, 1), 'b': SubDate(2020, 2, 29, 12, 30)}\n assert m.model_dump_json() == '{\"a\":\"2032-01-01T01:01:00\",\"b\":\"2020-02-29T12:30:00\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_subclass_custom_encoding_test_subclass_custom_encoding.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_subclass_custom_encoding_test_subclass_custom_encoding.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 133, "end_line": 153, "span_ids": ["test_subclass_custom_encoding"], "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 test_subclass_custom_encoding():\n class SubDt(datetime):\n pass\n\n class SubDelta(timedelta):\n pass\n\n class Model(BaseModel):\n a: SubDt\n b: SubDelta\n\n @field_serializer('a', when_used='json')\n def serialize_a(self, v: SubDt, _info):\n return v.strftime('%a, %d %b %C %H:%M:%S')\n\n model_config = ConfigDict(ser_json_timedelta='float')\n\n m = Model(a=SubDt(2032, 1, 1, 1, 1), b=SubDelta(hours=100))\n assert m.model_dump() == {'a': SubDt(2032, 1, 1, 1, 1), 'b': SubDelta(days=4, seconds=14400)}\n assert m.model_dump(mode='json') == {'a': 'Thu, 01 Jan 20 01:01:00', 'b': 360000.0}\n assert m.model_dump_json() == '{\"a\":\"Thu, 01 Jan 20 01:01:00\",\"b\":360000.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_pydantic__pydantic/tests/test_json.py_test_invalid_model_test_iso_timedelta.assert_output_timedelt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_invalid_model_test_iso_timedelta.assert_output_timedelt", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 156, "end_line": 174, "span_ids": ["test_invalid_model", "test_iso_timedelta"], "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 test_invalid_model():\n class Foo:\n pass\n\n with pytest.raises(TypeError):\n json.dumps(Foo, default=pydantic_encoder)\n\n\n@pytest.mark.parametrize(\n 'input,output',\n [\n (timedelta(days=12, seconds=34, microseconds=56), 'P12DT0H0M34.000056S'),\n (timedelta(days=1001, hours=1, minutes=2, seconds=3, microseconds=654_321), 'P1001DT1H2M3.654321S'),\n (timedelta(seconds=-1), '-P1DT23H59M59.000000S'),\n (timedelta(), 'P0DT0H0M0.000000S'),\n ],\n)\ndef test_iso_timedelta(input, output):\n assert output == timedelta_isoformat(input)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_encoder_test_custom_encoder.assert_Model_x_123_y_5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_encoder_test_custom_encoder.assert_Model_x_123_y_5_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 191, "span_ids": ["test_custom_encoder"], "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 test_custom_encoder():\n class Model(BaseModel):\n x: timedelta\n y: Decimal\n z: date\n\n @field_serializer('x')\n def serialize_x(self, v: timedelta, _info):\n return f'{v.total_seconds():0.3f}s'\n\n @field_serializer('y')\n def serialize_y(self, v: Decimal, _info):\n return 'a decimal'\n\n assert Model(x=123, y=5, z='2032-06-01').model_dump_json() == '{\"x\":\"123.000s\",\"y\":\"a decimal\",\"z\":\"2032-06-01\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_iso_timedelta_simple_test_con_decimal_encode.assert_Obj_model_validate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_iso_timedelta_simple_test_con_decimal_encode.assert_Obj_model_validate", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 194, "end_line": 216, "span_ids": ["test_con_decimal_encode", "test_iso_timedelta_simple"], "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 test_iso_timedelta_simple():\n class Model(BaseModel):\n x: timedelta\n\n m = Model(x=123)\n json_data = m.model_dump_json()\n assert json_data == '{\"x\":\"PT123S\"}'\n assert Model.model_validate_json(json_data).x == timedelta(seconds=123)\n\n\ndef test_con_decimal_encode() -> None:\n \"\"\"\n Makes sure a decimal with decimal_places = 0, as well as one with places\n can handle a encode/decode roundtrip.\n \"\"\"\n\n class Obj(BaseModel):\n id: condecimal(gt=0, max_digits=22, decimal_places=0)\n price: Decimal = Decimal('0.01')\n\n json_data = '{\"id\":\"1\",\"price\":\"0.01\"}'\n assert Obj(id=1).model_dump_json() == json_data\n assert Obj.model_validate_json(json_data) == Obj(id=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_pydantic__pydantic/tests/test_json.py_test_json_encoder_simple_inheritance_test_json_encoder_simple_inheritance.assert_Child_model_dump": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoder_simple_inheritance_test_json_encoder_simple_inheritance.assert_Child_model_dump", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 219, "end_line": 233, "span_ids": ["test_json_encoder_simple_inheritance"], "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 test_json_encoder_simple_inheritance():\n class Parent(BaseModel):\n dt: datetime = datetime.now()\n timedt: timedelta = timedelta(hours=100)\n\n @field_serializer('dt')\n def serialize_dt(self, _v: datetime, _info):\n return 'parent_encoder'\n\n class Child(Parent):\n @field_serializer('timedt')\n def serialize_timedt(self, _v: timedelta, _info):\n return 'child_encoder'\n\n assert Child().model_dump_json() == '{\"dt\":\"parent_encoder\",\"timedt\":\"child_encoder\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoder_inheritance_override_test_encode_pydantic_dataclass.assert_json_dumps_f_defa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoder_inheritance_override_test_encode_pydantic_dataclass.assert_json_dumps_f_defa", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 236, "end_line": 269, "span_ids": ["test_encode_dataclass", "test_encode_pydantic_dataclass", "test_json_encoder_inheritance_override"], "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 test_json_encoder_inheritance_override():\n class Parent(BaseModel):\n dt: datetime = datetime.now()\n\n @field_serializer('dt')\n def serialize_dt(self, _v: datetime, _info):\n return 'parent_encoder'\n\n class Child(Parent):\n @field_serializer('dt')\n def serialize_dt(self, _v: datetime, _info):\n return 'child_encoder'\n\n assert Child().model_dump_json() == '{\"dt\":\"child_encoder\"}'\n\n\ndef test_encode_dataclass():\n @vanilla_dataclass\n class Foo:\n bar: int\n spam: str\n\n f = Foo(bar=123, spam='apple pie')\n assert '{\"bar\": 123, \"spam\": \"apple pie\"}' == json.dumps(f, default=pydantic_encoder)\n\n\ndef test_encode_pydantic_dataclass():\n @pydantic_dataclass\n class Foo:\n bar: int\n spam: str\n\n f = Foo(bar=123, spam='apple pie')\n assert json.dumps(f, default=pydantic_encoder) == '{\"bar\": 123, \"spam\": \"apple pie\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_nested_encode_models_test_json_nested_encode_models.User.serialize_user.return.v_SSN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_nested_encode_models_test_json_nested_encode_models.User.serialize_user.return.v_SSN", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 272, "end_line": 294, "span_ids": ["test_json_nested_encode_models"], "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 test_json_nested_encode_models():\n class Phone(BaseModel):\n manufacturer: str\n number: int\n\n class User(BaseModel):\n name: str\n SSN: int\n birthday: datetime\n phone: Phone\n friend: Optional['User'] = None\n\n @field_serializer('birthday')\n def serialize_birthday(self, v: datetime, _info):\n return v.timestamp()\n\n @field_serializer('phone', when_used='unless-none')\n def serialize_phone(self, v: Phone, _info):\n return v.number\n\n @field_serializer('friend', when_used='unless-none')\n def serialize_user(self, v, _info):\n return v.SSN\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_pydantic__pydantic/tests/test_json.py_test_json_nested_encode_models.User_model_rebuild__test_json_nested_encode_models.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_nested_encode_models.User_model_rebuild__test_json_nested_encode_models.None_2", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 296, "end_line": 313, "span_ids": ["test_json_nested_encode_models"], "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 test_json_nested_encode_models():\n # ... other code\n\n User.model_rebuild()\n\n iphone = Phone(manufacturer='Apple', number=18002752273)\n galaxy = Phone(manufacturer='Samsung', number=18007267864)\n\n timon = User(name='Timon', SSN=123, birthday=datetime(1993, 6, 1, tzinfo=timezone.utc), phone=iphone)\n pumbaa = User(name='Pumbaa', SSN=234, birthday=datetime(1993, 5, 15, tzinfo=timezone.utc), phone=galaxy)\n\n timon.friend = pumbaa\n\n assert iphone.model_dump_json() == '{\"manufacturer\":\"Apple\",\"number\":18002752273}'\n assert (\n pumbaa.model_dump_json()\n == '{\"name\":\"Pumbaa\",\"SSN\":234,\"birthday\":737424000.0,\"phone\":18007267864,\"friend\":null}'\n )\n assert (\n timon.model_dump_json() == '{\"name\":\"Timon\",\"SSN\":123,\"birthday\":738892800.0,\"phone\":18002752273,\"friend\":234}'\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_pydantic__pydantic/tests/test_json.py_test_custom_encode_fallback_basemodel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_encode_fallback_basemodel_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 316, "end_line": 351, "span_ids": ["test_custom_encode_fallback_basemodel", "test_recursive"], "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 test_custom_encode_fallback_basemodel():\n class MyExoticType:\n pass\n\n class Foo(BaseModel):\n x: MyExoticType\n\n @field_serializer('x')\n def serialize_x(self, _v: MyExoticType, _info):\n return 'exo'\n\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n class Bar(BaseModel):\n foo: Foo\n\n assert Bar(foo=Foo(x=MyExoticType())).model_dump_json() == '{\"foo\":{\"x\":\"exo\"}}'\n\n\ndef test_recursive(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom typing import Optional\nfrom pydantic import BaseModel\n\nclass Model(BaseModel):\n value: int\n nested: Optional[Model] = None\n\"\"\"\n )\n M = module.Model\n\n assert M(value=1, nested=M(value=2)).model_dump_json(exclude_none=True) == '{\"value\":1,\"nested\":{\"value\":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_pydantic__pydantic/tests/test_json_schema.py_json_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_json_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 91, "span_ids": ["imports"], "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": "import json\nimport math\nimport re\nfrom datetime import date, datetime, time, timedelta\nfrom decimal import Decimal\nfrom enum import Enum, IntEnum\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom pathlib import Path\nfrom typing import (\n Any,\n Callable,\n Deque,\n Dict,\n FrozenSet,\n Generic,\n Iterable,\n List,\n NamedTuple,\n NewType,\n Optional,\n Pattern,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\nfrom uuid import UUID\n\nimport pytest\nfrom pydantic_core import core_schema\nfrom typing_extensions import Annotated, Literal\n\nfrom pydantic import (\n BaseModel,\n Extra,\n Field,\n ImportString,\n ValidationError,\n field_validator,\n)\nfrom pydantic._internal._core_metadata import build_metadata_dict\nfrom pydantic._internal._generate_schema import GenerateSchema\nfrom pydantic.color import Color\nfrom pydantic.config import ConfigDict\nfrom pydantic.dataclasses import dataclass\nfrom pydantic.errors import PydanticInvalidForJsonSchema\nfrom pydantic.fields import FieldInfo\nfrom pydantic.json_schema import (\n DEFAULT_REF_TEMPLATE,\n GenerateJsonSchema,\n PydanticJsonSchemaWarning,\n model_json_schema,\n models_json_schema,\n)\nfrom pydantic.networks import AnyUrl, EmailStr, IPvAnyAddress, IPvAnyInterface, IPvAnyNetwork, NameEmail\nfrom pydantic.types import (\n UUID1,\n UUID3,\n UUID4,\n UUID5,\n DirectoryPath,\n FilePath,\n Json,\n NegativeFloat,\n NegativeInt,\n NewPath,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n PositiveFloat,\n PositiveInt,\n SecretBytes,\n SecretStr,\n StrictBool,\n StrictStr,\n conbytes,\n condate,\n condecimal,\n confloat,\n conint,\n constr,\n)\n\ntry:\n import email_validator\nexcept ImportError:\n email_validator = None\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_pydantic__pydantic/tests/test_json_schema.py_test_by_alias_test_by_alias.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_by_alias_test_by_alias.None_2", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 94, "end_line": 110, "span_ids": ["test_by_alias"], "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 test_by_alias():\n class ApplePie(BaseModel):\n model_config = ConfigDict(title='Apple Pie')\n a: float = Field(alias='Snap')\n b: int = Field(10, alias='Crackle')\n\n assert ApplePie.model_json_schema() == {\n 'type': 'object',\n 'title': 'Apple Pie',\n 'properties': {\n 'Snap': {'type': 'number', 'title': 'Snap'},\n 'Crackle': {'type': 'integer', 'title': 'Crackle', 'default': 10},\n },\n 'required': ['Snap'],\n }\n assert list(ApplePie.model_json_schema(by_alias=True)['properties'].keys()) == ['Snap', 'Crackle']\n assert list(ApplePie.model_json_schema(by_alias=False)['properties'].keys()) == ['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_pydantic__pydantic/tests/test_json_schema.py_test_ref_template_test_ref_template.assert_defs_KeyLimePi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ref_template_test_ref_template.assert_defs_KeyLimePi", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 146, "span_ids": ["test_ref_template"], "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 test_ref_template():\n class KeyLimePie(BaseModel):\n x: str = None\n\n class ApplePie(BaseModel):\n model_config = ConfigDict(title='Apple Pie')\n a: float = None\n key_lime: Optional[KeyLimePie] = None\n\n assert ApplePie.model_json_schema(ref_template='foobar/{model}.json') == {\n 'title': 'Apple Pie',\n 'type': 'object',\n 'properties': {\n 'a': {'default': None, 'title': 'A', 'type': 'number'},\n 'key_lime': {\n 'anyOf': [{'$ref': 'foobar/KeyLimePie.json'}, {'type': 'null'}],\n 'default': None,\n },\n },\n '$defs': {\n 'KeyLimePie': {\n 'title': 'KeyLimePie',\n 'type': 'object',\n 'properties': {'x': {'default': None, 'title': 'X', 'type': 'string'}},\n }\n },\n }\n assert ApplePie.model_json_schema()['properties']['key_lime'] == {\n 'anyOf': [{'$ref': '#/$defs/KeyLimePie'}, {'type': 'null'}],\n 'default': None,\n }\n json_schema = json.dumps(ApplePie.model_json_schema(ref_template='foobar/{model}.json'))\n assert 'foobar/KeyLimePie.json' in json_schema\n assert '#/$defs/KeyLimePie' not in json_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_by_alias_generator_test_by_alias_generator.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_by_alias_generator_test_by_alias_generator.None_1", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 161, "span_ids": ["test_by_alias_generator"], "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 test_by_alias_generator():\n class ApplePie(BaseModel):\n model_config = ConfigDict(alias_generator=lambda x: x.upper())\n a: float\n b: int = 10\n\n assert ApplePie.model_json_schema() == {\n 'title': 'ApplePie',\n 'type': 'object',\n 'properties': {'A': {'title': 'A', 'type': 'number'}, 'B': {'title': 'B', 'default': 10, 'type': 'integer'}},\n 'required': ['A'],\n }\n assert ApplePie.model_json_schema(by_alias=False)['properties'].keys() == {'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_pydantic__pydantic/tests/test_json_schema.py_test_sub_model_test_sub_model.assert_Bar_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_sub_model_test_sub_model.assert_Bar_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 164, "end_line": 191, "span_ids": ["test_sub_model"], "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 test_sub_model():\n class Foo(BaseModel):\n \"\"\"hello\"\"\"\n\n b: float\n\n class Bar(BaseModel):\n a: int\n b: Optional[Foo] = None\n\n assert Bar.model_json_schema() == {\n 'type': 'object',\n 'title': 'Bar',\n '$defs': {\n 'Foo': {\n 'type': 'object',\n 'title': 'Foo',\n 'description': 'hello',\n 'properties': {'b': {'type': 'number', 'title': 'B'}},\n 'required': ['b'],\n }\n },\n 'properties': {\n 'a': {'type': 'integer', 'title': 'A'},\n 'b': {'anyOf': [{'$ref': '#/$defs/Foo'}, {'type': 'null'}], 'default': None},\n },\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_class_test_schema_class.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_class_test_schema_class.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 194, "end_line": 213, "span_ids": ["test_schema_class"], "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 test_schema_class():\n class Model(BaseModel):\n foo: int = Field(4, title='Foo is Great')\n bar: str = Field(..., description='this description of bar')\n\n with pytest.raises(ValidationError):\n Model()\n\n m = Model(bar='123')\n assert m.model_dump() == {'foo': 4, 'bar': '123'}\n\n assert Model.model_json_schema() == {\n 'type': 'object',\n 'title': 'Model',\n 'properties': {\n 'foo': {'type': 'integer', 'title': 'Foo is Great', 'default': 4},\n 'bar': {'type': 'string', 'title': 'Bar', 'description': 'this description of bar'},\n },\n 'required': ['bar'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_repr_test_schema_class_by_alias.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_repr_test_schema_class_by_alias.None_1", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 227, "span_ids": ["test_schema_repr", "test_schema_class_by_alias"], "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 test_schema_repr():\n s = Field(4, title='Foo is Great')\n assert str(s) == \"annotation=NoneType required=False default=4 title='Foo is Great'\"\n assert repr(s) == \"FieldInfo(annotation=NoneType, required=False, default=4, title='Foo is Great')\"\n\n\ndef test_schema_class_by_alias():\n class Model(BaseModel):\n foo: int = Field(4, alias='foofoo')\n\n assert list(Model.model_json_schema()['properties'].keys()) == ['foofoo']\n assert list(Model.model_json_schema(by_alias=False)['properties'].keys()) == ['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_pydantic__pydantic/tests/test_json_schema.py_test_choices_test_choices.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_choices_test_choices.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 257, "span_ids": ["test_choices"], "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 test_choices():\n FooEnum = Enum('FooEnum', {'foo': 'f', 'bar': 'b'})\n BarEnum = IntEnum('BarEnum', {'foo': 1, 'bar': 2})\n\n class SpamEnum(str, Enum):\n foo = 'f'\n bar = 'b'\n\n class Model(BaseModel):\n foo: FooEnum\n bar: BarEnum\n spam: SpamEnum = Field(None)\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'foo': {'$ref': '#/$defs/FooEnum'},\n 'bar': {'$ref': '#/$defs/BarEnum'},\n 'spam': {'allOf': [{'$ref': '#/$defs/SpamEnum'}], 'default': None},\n },\n 'required': ['foo', 'bar'],\n '$defs': {\n 'FooEnum': {'title': 'FooEnum', 'enum': ['f', 'b']},\n 'BarEnum': {'title': 'BarEnum', 'type': 'integer', 'enum': [1, 2]},\n 'SpamEnum': {'title': 'SpamEnum', 'type': 'string', 'enum': ['f', 'b']},\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_pydantic__pydantic/tests/test_json_schema.py_test_enum_modify_schema_test_enum_modify_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_modify_schema_test_enum_modify_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 260, "end_line": 294, "span_ids": ["test_enum_modify_schema"], "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 test_enum_modify_schema():\n class SpamEnum(str, Enum):\n \"\"\"\n Spam enum.\n \"\"\"\n\n foo = 'f'\n bar = 'b'\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema):\n existing_comment = field_schema.get('$comment', '')\n field_schema['$comment'] = existing_comment + 'comment' # make sure this function is only called once\n\n field_schema['tsEnumNames'] = [e.name for e in cls]\n return field_schema\n\n class Model(BaseModel):\n spam: Optional[SpamEnum] = Field(None)\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'SpamEnum': {\n '$comment': 'comment',\n 'description': 'Spam enum.',\n 'enum': ['f', 'b'],\n 'title': 'SpamEnum',\n 'tsEnumNames': ['foo', 'bar'],\n 'type': 'string',\n }\n },\n 'properties': {'spam': {'anyOf': [{'$ref': '#/$defs/SpamEnum'}, {'type': 'null'}], 'default': None}},\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_enum_schema_custom_field_test_enum_schema_custom_field.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_schema_custom_field_test_enum_schema_custom_field.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 297, "end_line": 332, "span_ids": ["test_enum_schema_custom_field"], "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": "def test_enum_schema_custom_field():\n class FooBarEnum(str, Enum):\n foo = 'foo'\n bar = 'bar'\n\n class Model(BaseModel):\n pika: FooBarEnum = Field(alias='pikalias', title='Pikapika!', description='Pika is definitely the best!')\n bulbi: FooBarEnum = Field('foo', alias='bulbialias', title='Bulbibulbi!', description='Bulbi is not...')\n cara: FooBarEnum\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'FooBarEnum': {\n 'enum': ['foo', 'bar'],\n 'title': 'FooBarEnum',\n 'type': 'string',\n }\n },\n 'properties': {\n 'pikalias': {\n 'allOf': [{'$ref': '#/$defs/FooBarEnum'}],\n 'description': 'Pika is definitely the best!',\n 'title': 'Pikapika!',\n },\n 'bulbialias': {\n 'allOf': [{'$ref': '#/$defs/FooBarEnum'}],\n 'description': 'Bulbi is not...',\n 'title': 'Bulbibulbi!',\n 'default': 'foo',\n },\n 'cara': {'$ref': '#/$defs/FooBarEnum'},\n },\n 'required': ['pikalias', 'cara'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_enum_and_model_have_same_behaviour_test_enum_and_model_have_same_behaviour.assert_Foo_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_and_model_have_same_behaviour_test_enum_and_model_have_same_behaviour.assert_Foo_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 335, "end_line": 389, "span_ids": ["test_enum_and_model_have_same_behaviour"], "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 test_enum_and_model_have_same_behaviour():\n class Names(str, Enum):\n rick = 'Rick'\n morty = 'Morty'\n summer = 'Summer'\n\n class Pika(BaseModel):\n a: str\n\n class Foo(BaseModel):\n enum: Names\n titled_enum: Names = Field(\n ...,\n title='Title of enum',\n description='Description of enum',\n )\n model: Pika\n titled_model: Pika = Field(\n ...,\n title='Title of model',\n description='Description of model',\n )\n\n assert Foo.model_json_schema() == {\n '$defs': {\n 'Pika': {\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'Pika',\n 'type': 'object',\n },\n 'Names': {\n 'enum': ['Rick', 'Morty', 'Summer'],\n 'title': 'Names',\n 'type': 'string',\n },\n },\n 'properties': {\n 'enum': {'$ref': '#/$defs/Names'},\n 'model': {'$ref': '#/$defs/Pika'},\n 'titled_enum': {\n 'allOf': [{'$ref': '#/$defs/Names'}],\n 'description': 'Description of enum',\n 'title': 'Title of enum',\n },\n 'titled_model': {\n 'allOf': [{'$ref': '#/$defs/Pika'}],\n 'description': 'Description of model',\n 'title': 'Title of model',\n },\n },\n 'required': ['enum', 'titled_enum', 'model', 'titled_model'],\n 'title': 'Foo',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_enum_includes_extra_without_other_params_test_enum_includes_extra_without_other_params.assert_Foo_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_includes_extra_without_other_params_test_enum_includes_extra_without_other_params.assert_Foo_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 392, "end_line": 417, "span_ids": ["test_enum_includes_extra_without_other_params"], "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 test_enum_includes_extra_without_other_params():\n class Names(str, Enum):\n rick = 'Rick'\n morty = 'Morty'\n summer = 'Summer'\n\n class Foo(BaseModel):\n enum: Names\n extra_enum: Names = Field(..., json_schema_extra={'extra': 'Extra field'})\n\n assert Foo.model_json_schema() == {\n '$defs': {\n 'Names': {\n 'enum': ['Rick', 'Morty', 'Summer'],\n 'title': 'Names',\n 'type': 'string',\n },\n },\n 'properties': {\n 'enum': {'$ref': '#/$defs/Names'},\n 'extra_enum': {'allOf': [{'$ref': '#/$defs/Names'}], 'extra': 'Extra field'},\n },\n 'required': ['enum', 'extra_enum'],\n 'title': 'Foo',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_list_enum_schema_extras_test_list_enum_schema_extras.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_enum_schema_extras_test_list_enum_schema_extras.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 420, "end_line": 448, "span_ids": ["test_list_enum_schema_extras"], "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 test_list_enum_schema_extras():\n class FoodChoice(str, Enum):\n spam = 'spam'\n egg = 'egg'\n chips = 'chips'\n\n class Model(BaseModel):\n foods: List[FoodChoice] = Field(examples=[['spam', 'egg']])\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'FoodChoice': {\n 'enum': ['spam', 'egg', 'chips'],\n 'title': 'FoodChoice',\n 'type': 'string',\n }\n },\n 'properties': {\n 'foods': {\n 'title': 'Foods',\n 'type': 'array',\n 'items': {'$ref': '#/$defs/FoodChoice'},\n 'examples': [['spam', 'egg']],\n },\n },\n 'required': ['foods'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_enum_schema_cleandoc_test_enum_schema_cleandoc.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_schema_cleandoc_test_enum_schema_cleandoc.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 451, "end_line": 476, "span_ids": ["test_enum_schema_cleandoc"], "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 test_enum_schema_cleandoc():\n class FooBar(str, Enum):\n \"\"\"\n This is docstring which needs to be cleaned up\n \"\"\"\n\n foo = 'foo'\n bar = 'bar'\n\n class Model(BaseModel):\n enum: FooBar\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'enum': {'$ref': '#/$defs/FooBar'}},\n 'required': ['enum'],\n '$defs': {\n 'FooBar': {\n 'title': 'FooBar',\n 'description': 'This is docstring which needs to be cleaned up',\n 'enum': ['foo', 'bar'],\n 'type': 'string',\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_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_test_json_schema.assert_json_loads_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_test_json_schema.assert_json_loads_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 479, "end_line": 500, "span_ids": ["test_json_schema"], "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 test_json_schema():\n class Model(BaseModel):\n a: bytes = b'foobar'\n b: Decimal = Decimal('12.34')\n\n # TODO: What do we want the generated schema to be for Decimal? I'm thinking 'integer', 'number', _or_ 'str'\n # Decision: What we have in v1 is not bad enough to be worth changing\n # (i.e., keep it as only 'number'; maybe add a comment that other things could be okay)\n\n with pytest.warns(\n DeprecationWarning,\n match=re.escape('The `schema_json` method is deprecated; use `model_json_schema` and json.dumps instead.'),\n ):\n schema_json = Model.schema_json(indent=2)\n assert json.loads(schema_json) == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A', 'default': 'foobar', 'type': 'string', 'format': 'binary'},\n 'b': {'title': 'B', 'default': '12.34', 'type': 'number'},\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_pydantic__pydantic/tests/test_json_schema.py_test_list_sub_model_test_list_sub_model.assert_Bar_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_sub_model_test_list_sub_model.assert_Bar_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 503, "end_line": 523, "span_ids": ["test_list_sub_model"], "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 test_list_sub_model():\n class Foo(BaseModel):\n a: float\n\n class Bar(BaseModel):\n b: List[Foo]\n\n assert Bar.model_json_schema() == {\n 'title': 'Bar',\n 'type': 'object',\n '$defs': {\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'type': 'number', 'title': 'A'}},\n 'required': ['a'],\n }\n },\n 'properties': {'b': {'type': 'array', 'items': {'$ref': '#/$defs/Foo'}, 'title': 'B'}},\n 'required': ['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_pydantic__pydantic/tests/test_json_schema.py_test_optional_test_any.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_test_any.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 526, "end_line": 551, "span_ids": ["test_optional", "test_any"], "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_optional():\n class Model(BaseModel):\n a: Optional[str]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'A'}},\n 'required': ['a'],\n }\n\n\ndef test_any():\n class Model(BaseModel):\n a: Any\n b: object\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A'},\n 'b': {'title': 'B'},\n },\n 'required': ['a', '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_pydantic__pydantic/tests/test_json_schema.py_test_set_test_set.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_set_test_set.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 554, "end_line": 569, "span_ids": ["test_set"], "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_set():\n class Model(BaseModel):\n a: Set[int]\n b: set\n c: set = {1}\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A', 'type': 'array', 'uniqueItems': True, 'items': {'type': 'integer'}},\n 'b': {'title': 'B', 'type': 'array', 'items': {}, 'uniqueItems': True},\n 'c': {'title': 'C', 'type': 'array', 'items': {}, 'default': [1], 'uniqueItems': True},\n },\n 'required': ['a', '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_pydantic__pydantic/tests/test_json_schema.py_test_tuple_test_tuple.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_tuple_test_tuple.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 572, "end_line": 606, "span_ids": ["test_tuple"], "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": "@pytest.mark.parametrize(\n 'field_type,extra_props',\n [\n (tuple, {'items': {}}),\n (\n Tuple[str, int, Union[str, int, float], float],\n {\n 'prefixItems': [\n {'type': 'string'},\n {'type': 'integer'},\n {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'number'}]},\n {'type': 'number'},\n ],\n 'minItems': 4,\n 'maxItems': 4,\n },\n ),\n (Tuple[str], {'prefixItems': [{'type': 'string'}], 'minItems': 1, 'maxItems': 1}),\n (Tuple[()], {'maxItems': 0, 'minItems': 0}),\n (\n Tuple[str, ...],\n {'items': {'type': 'string'}, 'title': 'A', 'type': 'array'},\n ),\n ],\n)\ndef test_tuple(field_type, extra_props):\n class Model(BaseModel):\n a: field_type\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'array', **extra_props}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_deque_Foo.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deque_Foo.a", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 609, "end_line": 670, "span_ids": ["Foo", "test_deque", "test_dict", "test_bool", "test_list", "test_strict_bool"], "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": "def test_deque():\n class Model(BaseModel):\n a: Deque[str]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'array', 'items': {'type': 'string'}}},\n 'required': ['a'],\n }\n\n\ndef test_bool():\n class Model(BaseModel):\n a: bool\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'boolean'}},\n 'required': ['a'],\n }\n\n\ndef test_strict_bool():\n class Model(BaseModel):\n a: StrictBool\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'boolean'}},\n 'required': ['a'],\n }\n\n\ndef test_dict():\n class Model(BaseModel):\n a: dict\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'object'}},\n 'required': ['a'],\n }\n\n\ndef test_list():\n class Model(BaseModel):\n a: list\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'array', 'items': {}}},\n 'required': ['a'],\n }\n\n\nclass Foo(BaseModel):\n a: float", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_union_dict_test_list_union_dict.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_list_union_dict_test_list_union_dict.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 673, "end_line": 729, "span_ids": ["test_list_union_dict"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (\n Union[int, str],\n {\n 'properties': {'a': {'title': 'A', 'anyOf': [{'type': 'integer'}, {'type': 'string'}]}},\n 'required': ['a'],\n },\n ),\n (\n List[int],\n {'properties': {'a': {'title': 'A', 'type': 'array', 'items': {'type': 'integer'}}}, 'required': ['a']},\n ),\n (\n Dict[str, Foo],\n {\n '$defs': {\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'number'}},\n 'required': ['a'],\n }\n },\n 'properties': {'a': {'title': 'A', 'type': 'object', 'additionalProperties': {'$ref': '#/$defs/Foo'}}},\n 'required': ['a'],\n },\n ),\n (\n Union[None, Foo],\n {\n '$defs': {\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'number'}},\n 'required': ['a'],\n }\n },\n 'properties': {'a': {'anyOf': [{'$ref': '#/$defs/Foo'}, {'type': 'null'}]}},\n 'required': ['a'],\n 'title': 'Model',\n 'type': 'object',\n },\n ),\n (Dict[str, Any], {'properties': {'a': {'title': 'A', 'type': 'object'}}, 'required': ['a']}),\n ],\n)\ndef test_list_union_dict(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {'title': 'Model', 'type': 'object'}\n base_schema.update(expected_schema)\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_date_types_test_date_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_date_types_test_date_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 732, "end_line": 750, "span_ids": ["test_date_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (datetime, {'type': 'string', 'format': 'date-time'}),\n (date, {'type': 'string', 'format': 'date'}),\n (time, {'type': 'string', 'format': 'time'}),\n (timedelta, {'type': 'number', 'format': 'time-delta'}),\n ],\n)\ndef test_date_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n attribute_schema = {'title': 'A'}\n attribute_schema.update(expected_schema)\n\n base_schema = {'title': 'Model', 'type': 'object', 'properties': {'a': attribute_schema}, 'required': ['a']}\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_date_constrained_types_test_date_constrained_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_date_constrained_types_test_date_constrained_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 753, "end_line": 773, "span_ids": ["test_date_constrained_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (condate(), {}),\n (\n condate(gt=date(2010, 1, 1), lt=date(2021, 2, 2)),\n {'exclusiveMinimum': date(2010, 1, 1), 'exclusiveMaximum': date(2021, 2, 2)},\n ),\n (condate(ge=date(2010, 1, 1), le=date(2021, 2, 2)), {'minimum': date(2010, 1, 1), 'maximum': date(2021, 2, 2)}),\n ],\n)\ndef test_date_constrained_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string', 'format': 'date', **expected_schema}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_str_basic_types_test_str_basic_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_str_basic_types_test_str_basic_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 776, "end_line": 811, "span_ids": ["test_str_basic_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (Optional[str], {'properties': {'a': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'A'}}}),\n (\n Optional[bytes],\n {'properties': {'a': {'title': 'A', 'anyOf': [{'type': 'string', 'format': 'binary'}, {'type': 'null'}]}}},\n ),\n (\n Union[str, bytes],\n {\n 'properties': {\n 'a': {'title': 'A', 'anyOf': [{'type': 'string'}, {'type': 'string', 'format': 'binary'}]}\n },\n },\n ),\n (\n Union[None, str, bytes],\n {\n 'properties': {\n 'a': {\n 'title': 'A',\n 'anyOf': [{'type': 'string'}, {'type': 'string', 'format': 'binary'}, {'type': 'null'}],\n }\n }\n },\n ),\n ],\n)\ndef test_str_basic_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {'title': 'Model', 'type': 'object', 'required': ['a']}\n base_schema.update(expected_schema)\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_pattern_test_pattern.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_pattern_test_pattern.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 814, "end_line": 828, "span_ids": ["test_pattern"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (Pattern, {'type': 'string', 'format': 'regex'}),\n (Pattern[str], {'type': 'string', 'format': 'regex'}),\n (Pattern[bytes], {'type': 'string', 'format': 'regex'}),\n ],\n)\ndef test_pattern(field_type, expected_schema) -> None:\n class Model(BaseModel):\n a: field_type\n\n expected_schema.update({'title': 'A'})\n full_schema = {'title': 'Model', 'type': 'object', 'required': ['a'], 'properties': {'a': expected_schema}}\n assert Model.model_json_schema() == full_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_str_constrained_types_test_str_constrained_types.assert_model_schema_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_str_constrained_types_test_str_constrained_types.assert_model_schema_ba", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 831, "end_line": 851, "span_ids": ["test_str_constrained_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (StrictStr, {'title': 'A', 'type': 'string'}),\n # (ConstrainedStr, {'title': 'A', 'type': 'string'}),\n (\n constr(min_length=3, max_length=5, pattern='^text$'),\n {'title': 'A', 'type': 'string', 'minLength': 3, 'maxLength': 5, 'pattern': '^text$'},\n ),\n ],\n)\ndef test_str_constrained_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n model_schema = Model.model_json_schema()\n assert model_schema['properties']['a'] == expected_schema\n\n base_schema = {'title': 'Model', 'type': 'object', 'properties': {'a': expected_schema}, 'required': ['a']}\n\n assert model_schema == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_str_types_test_special_str_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_str_types_test_special_str_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 854, "end_line": 871, "span_ids": ["test_special_str_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n (AnyUrl, {'title': 'A', 'type': 'string', 'format': 'uri', 'minLength': 1}),\n (\n Annotated[AnyUrl, Field(max_length=2**16)],\n {'title': 'A', 'type': 'string', 'format': 'uri', 'minLength': 1, 'maxLength': 2**16},\n ),\n ],\n)\ndef test_special_str_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {'title': 'Model', 'type': 'object', 'properties': {'a': {}}, 'required': ['a']}\n base_schema['properties']['a'] = expected_schema\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_email_str_types_test_email_str_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_email_str_types_test_email_str_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 874, "end_line": 888, "span_ids": ["test_email_str_types"], "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": "@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\n@pytest.mark.parametrize('field_type,expected_schema', [(EmailStr, 'email'), (NameEmail, 'name-email')])\ndef test_email_str_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n }\n base_schema['properties']['a']['format'] = expected_schema\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_secret_types_test_secret_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_secret_types_test_secret_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 891, "end_line": 903, "span_ids": ["test_secret_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": "@pytest.mark.parametrize('field_type,inner_type', [(SecretBytes, 'string'), (SecretStr, 'string')])\ndef test_secret_types(field_type, inner_type):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': inner_type, 'writeOnly': True, 'format': 'password'}},\n 'required': ['a'],\n }\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_int_types_test_special_int_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_int_types_test_special_int_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 906, "end_line": 931, "span_ids": ["test_special_int_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n # (ConstrainedInt, {}),\n (conint(gt=5, lt=10), {'exclusiveMinimum': 5, 'exclusiveMaximum': 10}),\n (conint(ge=5, le=10), {'minimum': 5, 'maximum': 10}),\n (conint(multiple_of=5), {'multipleOf': 5}),\n (PositiveInt, {'exclusiveMinimum': 0}),\n (NegativeInt, {'exclusiveMaximum': 0}),\n (NonNegativeInt, {'minimum': 0}),\n (NonPositiveInt, {'maximum': 0}),\n ],\n)\ndef test_special_int_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\n }\n base_schema['properties']['a'].update(expected_schema)\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_float_types_test_special_float_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_float_types_test_special_float_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 934, "end_line": 966, "span_ids": ["test_special_float_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n # (ConstrainedFloat, {}),\n (confloat(gt=5, lt=10), {'exclusiveMinimum': 5, 'exclusiveMaximum': 10}),\n (confloat(ge=5, le=10), {'minimum': 5, 'maximum': 10}),\n (confloat(multiple_of=5), {'multipleOf': 5}),\n (PositiveFloat, {'exclusiveMinimum': 0}),\n (NegativeFloat, {'exclusiveMaximum': 0}),\n (NonNegativeFloat, {'minimum': 0}),\n (NonPositiveFloat, {'maximum': 0}),\n # (ConstrainedDecimal, {}),\n (\n condecimal(gt=5, lt=10),\n {'exclusiveMinimum': 5, 'exclusiveMaximum': 10},\n ),\n (condecimal(ge=5, le=10), {'minimum': 5, 'maximum': 10}),\n (condecimal(multiple_of=5), {'multipleOf': 5}),\n ],\n)\ndef test_special_float_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'number'}},\n 'required': ['a'],\n }\n base_schema['properties']['a'].update(expected_schema)\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_uuid_types_test_uuid_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_uuid_types_test_uuid_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 969, "end_line": 985, "span_ids": ["test_uuid_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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [(UUID, 'uuid'), (UUID1, 'uuid1'), (UUID3, 'uuid3'), (UUID4, 'uuid4'), (UUID5, 'uuid5')],\n)\ndef test_uuid_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string', 'format': 'uuid'}},\n 'required': ['a'],\n }\n base_schema['properties']['a']['format'] = expected_schema\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_path_types_test_path_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_path_types_test_path_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 988, "end_line": 1004, "span_ids": ["test_path_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [(FilePath, 'file-path'), (DirectoryPath, 'directory-path'), (NewPath, 'path'), (Path, 'path')],\n)\ndef test_path_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string', 'format': ''}},\n 'required': ['a'],\n }\n base_schema['properties']['a']['format'] = expected_schema\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_type_test_json_type.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_type_test_json_type.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1007, "end_line": 1022, "span_ids": ["test_json_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": "def test_json_type():\n class Model(BaseModel):\n a: Json\n b: Json[int]\n c: Json[Any]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A', 'type': 'string', 'format': 'json-string'},\n 'b': {'title': 'B', 'type': 'string', 'format': 'json-string'},\n 'c': {'title': 'C', 'type': 'string', 'format': 'json-string'},\n },\n 'required': ['a', 'b', 'c'],\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_pydantic__pydantic/tests/test_json_schema.py_test_ipv4address_type_test_ipv6network_type.assert_model_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ipv4address_type_test_ipv6network_type.assert_model_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1025, "end_line": 1126, "span_ids": ["test_ipv6network_type", "test_ipvanyinterface_type", "test_ipv4address_type", "test_ipvanyaddress_type", "test_ipv6interface_type", "test_ipv4network_type", "test_ipv4interface_type", "test_ipv6address_type"], "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_ipv4address_type():\n class Model(BaseModel):\n ip_address: IPv4Address\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_address': {'title': 'Ip Address', 'type': 'string', 'format': 'ipv4'}},\n 'required': ['ip_address'],\n }\n\n\ndef test_ipv6address_type():\n class Model(BaseModel):\n ip_address: IPv6Address\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_address': {'title': 'Ip Address', 'type': 'string', 'format': 'ipv6'}},\n 'required': ['ip_address'],\n }\n\n\ndef test_ipvanyaddress_type():\n class Model(BaseModel):\n ip_address: IPvAnyAddress\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_address': {'title': 'Ip Address', 'type': 'string', 'format': 'ipvanyaddress'}},\n 'required': ['ip_address'],\n }\n\n\ndef test_ipv4interface_type():\n class Model(BaseModel):\n ip_interface: IPv4Interface\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_interface': {'title': 'Ip Interface', 'type': 'string', 'format': 'ipv4interface'}},\n 'required': ['ip_interface'],\n }\n\n\ndef test_ipv6interface_type():\n class Model(BaseModel):\n ip_interface: IPv6Interface\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_interface': {'title': 'Ip Interface', 'type': 'string', 'format': 'ipv6interface'}},\n 'required': ['ip_interface'],\n }\n\n\ndef test_ipvanyinterface_type():\n class Model(BaseModel):\n ip_interface: IPvAnyInterface\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_interface': {'title': 'Ip Interface', 'type': 'string', 'format': 'ipvanyinterface'}},\n 'required': ['ip_interface'],\n }\n\n\ndef test_ipv4network_type():\n class Model(BaseModel):\n ip_network: IPv4Network\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_network': {'title': 'Ip Network', 'type': 'string', 'format': 'ipv4network'}},\n 'required': ['ip_network'],\n }\n\n\ndef test_ipv6network_type():\n class Model(BaseModel):\n ip_network: IPv6Network\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_network': {'title': 'Ip Network', 'type': 'string', 'format': 'ipv6network'}},\n 'required': ['ip_network'],\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_pydantic__pydantic/tests/test_json_schema.py_test_ipvanynetwork_type_test_callable_type.with_pytest_raises_Pydant.assert_callback_not_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ipvanynetwork_type_test_callable_type.with_pytest_raises_Pydant.assert_callback_not_in_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1129, "end_line": 1168, "span_ids": ["test_ipvanynetwork_type", "test_callable_type"], "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 test_ipvanynetwork_type():\n class Model(BaseModel):\n ip_network: IPvAnyNetwork\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'ip_network': {'title': 'Ip Network', 'type': 'string', 'format': 'ipvanynetwork'}},\n 'required': ['ip_network'],\n }\n\n\n@pytest.mark.parametrize(\n 'type_,default_value',\n (\n (Callable, ...),\n (Callable, lambda x: x),\n (Callable[[int], int], ...),\n (Callable[[int], int], lambda x: x),\n ),\n)\ndef test_callable_type(type_, default_value):\n # TODO: Is this still how we want to handle this?\n # With my current changes, it raises\n # InvalidForJsonSchema('Cannot generate a JsonSchema for core_schema.CallableSchema')\n # We could continue the practice of just not creating such fields,\n # but producing a UserWarning when a field is ignored\n # TODO: If the default value is not JSON encodable, should we just not include it in the schema?\n # This seems preferable to me over erroring, but maybe we should also produce a UserWarning for that?\n\n # Decision: Different user warning depending on if there's a default or not\n\n class Model(BaseModel):\n callback: type_ = default_value\n foo: int\n\n with pytest.raises(PydanticInvalidForJsonSchema):\n model_schema = Model.model_json_schema()\n assert 'callback' not in model_schema['properties']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_type_with_fallback_test_callable_type_with_fallback.assert_model_schema_prop": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_type_with_fallback_test_callable_type_with_fallback.assert_model_schema_prop", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1171, "end_line": 1190, "span_ids": ["test_callable_type_with_fallback"], "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": "@pytest.mark.parametrize(\n 'default_value,properties',\n (\n (Field(...), {'callback': {'title': 'Callback', 'type': 'integer'}}),\n (1, {'callback': {'default': 1, 'title': 'Callback', 'type': 'integer'}}),\n ),\n)\ndef test_callable_type_with_fallback(default_value, properties):\n class Model(BaseModel):\n callback: Union[int, Callable[[int], int]] = default_value\n\n class MyGenerator(GenerateJsonSchema):\n ignored_warning_kinds = ()\n\n with pytest.warns(\n PydanticJsonSchemaWarning,\n match=re.escape('Cannot generate a JsonSchema for core_schema.CallableSchema [skipped-choice]'),\n ):\n model_schema = Model.model_json_schema(schema_generator=MyGenerator)\n assert model_schema['properties'] == properties", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_non_serializable_default_test_non_serializable_default.assert_model_schema_get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_non_serializable_default_test_non_serializable_default.assert_model_schema_get_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1193, "end_line": 1221, "span_ids": ["test_non_serializable_default"], "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": "@pytest.mark.parametrize(\n 'type_,default_value,properties',\n (\n (\n Dict[Any, Any],\n {(lambda x: x): 1},\n {'callback': {'title': 'Callback', 'type': 'object'}},\n ),\n (\n Union[int, Callable[[int], int]],\n lambda x: x,\n {'callback': {'title': 'Callback', 'type': 'integer'}},\n ),\n ),\n)\ndef test_non_serializable_default(type_, default_value, properties):\n class Model(BaseModel):\n callback: type_ = default_value\n\n with pytest.warns(\n PydanticJsonSchemaWarning,\n match=(\n 'Default value .* is not JSON serializable; excluding default from JSON schema '\n r'\\[non-serializable-default\\]'\n ),\n ):\n model_schema = Model.model_json_schema()\n assert model_schema['properties'] == properties\n assert model_schema.get('required') 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_pydantic__pydantic/tests/test_json_schema.py_test_callable_fallback_with_non_serializable_default_test_error_non_supported_types.with_pytest_raises_Pydant.Model_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_fallback_with_non_serializable_default_test_error_non_supported_types.with_pytest_raises_Pydant.Model_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1224, "end_line": 1252, "span_ids": ["test_error_non_supported_types", "test_callable_fallback_with_non_serializable_default"], "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": "@pytest.mark.parametrize(\n 'warning_match',\n (\n r'Cannot generate a JsonSchema for core_schema.CallableSchema \\[skipped-choice\\]',\n r'Default value .* is not JSON serializable; excluding default from JSON schema \\[non-serializable-default\\]',\n ),\n)\ndef test_callable_fallback_with_non_serializable_default(warning_match):\n class Model(BaseModel):\n callback: Union[int, Callable[[int], int]] = lambda x: x # noqa E731\n\n class MyGenerator(GenerateJsonSchema):\n ignored_warning_kinds = ()\n\n with pytest.warns(PydanticJsonSchemaWarning, match=warning_match):\n model_schema = Model.model_json_schema(schema_generator=MyGenerator)\n assert model_schema == {\n 'properties': {'callback': {'title': 'Callback', 'type': 'integer'}},\n 'title': 'Model',\n 'type': 'object',\n }\n\n\ndef test_error_non_supported_types():\n class Model(BaseModel):\n a: ImportString\n\n with pytest.raises(PydanticInvalidForJsonSchema):\n Model.model_json_schema()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_overrides_test_schema_overrides.assert_model_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_overrides_test_schema_overrides.assert_model_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1255, "end_line": 1293, "span_ids": ["test_schema_overrides"], "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 test_schema_overrides():\n class Foo(BaseModel):\n a: str\n\n class Bar(BaseModel):\n b: Foo = Foo(a='foo')\n\n class Baz(BaseModel):\n c: Optional[Bar]\n\n class Model(BaseModel):\n d: Baz\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n '$defs': {\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n },\n 'Bar': {\n 'title': 'Bar',\n 'type': 'object',\n 'properties': {'b': {'allOf': [{'$ref': '#/$defs/Foo'}], 'default': {'a': 'foo'}}},\n },\n 'Baz': {\n 'title': 'Baz',\n 'type': 'object',\n 'properties': {'c': {'anyOf': [{'$ref': '#/$defs/Bar'}, {'type': 'null'}]}},\n 'required': ['c'],\n },\n },\n 'properties': {'d': {'$ref': '#/$defs/Baz'}},\n 'required': ['d'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_overrides_w_union_test_schema_overrides_w_union.assert_Spam_model_json_sc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_overrides_w_union_test_schema_overrides_w_union.assert_Spam_model_json_sc", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1296, "end_line": 1312, "span_ids": ["test_schema_overrides_w_union"], "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 test_schema_overrides_w_union():\n class Foo(BaseModel):\n pass\n\n class Bar(BaseModel):\n pass\n\n class Spam(BaseModel):\n a: Union[Foo, Bar] = Field(..., description='xxx')\n\n assert Spam.model_json_schema()['properties'] == {\n 'a': {\n 'title': 'A',\n 'description': 'xxx',\n 'anyOf': [{'$ref': '#/$defs/Foo'}, {'$ref': '#/$defs/Bar'}],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_from_models_test_schema_from_models.assert_model_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_from_models_test_schema_from_models.assert_model_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1315, "end_line": 1386, "span_ids": ["test_schema_from_models"], "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 test_schema_from_models():\n class Foo(BaseModel):\n a: str\n\n class Bar(BaseModel):\n b: Foo\n\n class Baz(BaseModel):\n c: Bar\n\n class Model(BaseModel):\n d: Baz\n\n class Ingredient(BaseModel):\n name: str\n\n class Pizza(BaseModel):\n name: str\n ingredients: List[Ingredient]\n\n model_schema = models_json_schema(\n [Model, Pizza], title='Multi-model schema', description='Single JSON Schema with multiple definitions'\n )\n assert model_schema == {\n 'title': 'Multi-model schema',\n 'description': 'Single JSON Schema with multiple definitions',\n '$defs': {\n 'Pizza': {\n 'title': 'Pizza',\n 'type': 'object',\n 'properties': {\n 'name': {'title': 'Name', 'type': 'string'},\n 'ingredients': {\n 'title': 'Ingredients',\n 'type': 'array',\n 'items': {'$ref': '#/$defs/Ingredient'},\n },\n },\n 'required': ['name', 'ingredients'],\n },\n 'Ingredient': {\n 'title': 'Ingredient',\n 'type': 'object',\n 'properties': {'name': {'title': 'Name', 'type': 'string'}},\n 'required': ['name'],\n },\n 'Model': {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'d': {'$ref': '#/$defs/Baz'}},\n 'required': ['d'],\n },\n 'Baz': {\n 'title': 'Baz',\n 'type': 'object',\n 'properties': {'c': {'$ref': '#/$defs/Bar'}},\n 'required': ['c'],\n },\n 'Bar': {\n 'title': 'Bar',\n 'type': 'object',\n 'properties': {'b': {'$ref': '#/$defs/Foo'}},\n 'required': ['b'],\n },\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_refs_test_schema_with_refs.assert_model_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_refs_test_schema_with_refs.assert_model_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1389, "end_line": 1423, "span_ids": ["test_schema_with_refs"], "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 test_schema_with_refs():\n ref_template = '#/components/schemas/{model}'\n\n class Foo(BaseModel):\n a: str\n\n class Bar(BaseModel):\n b: Foo\n\n class Baz(BaseModel):\n c: Bar\n\n model_schema = models_json_schema([Bar, Baz], ref_template=ref_template)\n assert model_schema == {\n '$defs': {\n 'Baz': {\n 'title': 'Baz',\n 'type': 'object',\n 'properties': {'c': {'$ref': '#/components/schemas/Bar'}},\n 'required': ['c'],\n },\n 'Bar': {\n 'title': 'Bar',\n 'type': 'object',\n 'properties': {'b': {'$ref': '#/components/schemas/Foo'}},\n 'required': ['b'],\n },\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_custom_ref_template_test_schema_with_custom_ref_template.assert_model_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_custom_ref_template_test_schema_with_custom_ref_template.assert_model_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1426, "end_line": 1458, "span_ids": ["test_schema_with_custom_ref_template"], "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 test_schema_with_custom_ref_template():\n class Foo(BaseModel):\n a: str\n\n class Bar(BaseModel):\n b: Foo\n\n class Baz(BaseModel):\n c: Bar\n\n model_schema = models_json_schema([Bar, Baz], ref_template='/schemas/{model}.json#/')\n assert model_schema == {\n '$defs': {\n 'Baz': {\n 'title': 'Baz',\n 'type': 'object',\n 'properties': {'c': {'$ref': '/schemas/Bar.json#/'}},\n 'required': ['c'],\n },\n 'Bar': {\n 'title': 'Bar',\n 'type': 'object',\n 'properties': {'b': {'$ref': '/schemas/Foo.json#/'}},\n 'required': ['b'],\n },\n 'Foo': {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_ref_template_key_error_test_enum_int_default.assert_UserModel_model_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_ref_template_key_error_test_enum_int_default.assert_UserModel_model_js", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1461, "end_line": 1508, "span_ids": ["test_list_default", "test_schema_no_definitions", "test_schema_ref_template_key_error", "test_enum_int_default", "test_enum_str_default"], "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 test_schema_ref_template_key_error():\n class Foo(BaseModel):\n a: str\n\n class Bar(BaseModel):\n b: Foo\n\n class Baz(BaseModel):\n c: Bar\n\n with pytest.raises(KeyError):\n models_json_schema([Bar, Baz], ref_template='/schemas/{bad_name}.json#/')\n\n\ndef test_schema_no_definitions():\n model_schema = models_json_schema([], title='Schema without definitions')\n assert model_schema == {'title': 'Schema without definitions'}\n\n\ndef test_list_default():\n class UserModel(BaseModel):\n friends: List[int] = [1]\n\n assert UserModel.model_json_schema() == {\n 'title': 'UserModel',\n 'type': 'object',\n 'properties': {'friends': {'title': 'Friends', 'default': [1], 'type': 'array', 'items': {'type': 'integer'}}},\n }\n\n\ndef test_enum_str_default():\n class MyEnum(str, Enum):\n FOO = 'foo'\n\n class UserModel(BaseModel):\n friends: MyEnum = MyEnum.FOO\n\n assert UserModel.model_json_schema()['properties']['friends']['default'] is MyEnum.FOO.value\n\n\ndef test_enum_int_default():\n class MyEnum(IntEnum):\n FOO = 1\n\n class UserModel(BaseModel):\n friends: MyEnum = MyEnum.FOO\n\n assert UserModel.model_json_schema()['properties']['friends']['default'] is MyEnum.FOO.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_pydantic__pydantic/tests/test_json_schema.py_test_dict_default_test_dict_default.assert_UserModel_model_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dict_default_test_dict_default.assert_UserModel_model_js", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1511, "end_line": 1526, "span_ids": ["test_dict_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": "def test_dict_default():\n class UserModel(BaseModel):\n friends: Dict[str, float] = {'a': 1.1, 'b': 2.2}\n\n assert UserModel.model_json_schema() == {\n 'title': 'UserModel',\n 'type': 'object',\n 'properties': {\n 'friends': {\n 'title': 'Friends',\n 'default': {'a': 1.1, 'b': 2.2},\n 'type': 'object',\n 'additionalProperties': {'type': 'number'},\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_pydantic__pydantic/tests/test_json_schema.py_test_model_default_test_model_default.assert_Outer_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_default_test_model_default.assert_Outer_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1529, "end_line": 1556, "span_ids": ["test_model_default"], "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 test_model_default():\n \"\"\"Make sure inner model types are encoded properly\"\"\"\n\n class Inner(BaseModel):\n a: Dict[Path, str] = {Path(): ''}\n\n class Outer(BaseModel):\n inner: Inner = Inner()\n\n assert Outer.model_json_schema() == {\n '$defs': {\n 'Inner': {\n 'properties': {\n 'a': {\n 'additionalProperties': {'type': 'string'},\n 'default': {'.': ''},\n 'title': 'A',\n 'type': 'object',\n }\n },\n 'title': 'Inner',\n 'type': 'object',\n }\n },\n 'properties': {'inner': {'allOf': [{'$ref': '#/$defs/Inner'}], 'default': {'a': {'.': ''}}}},\n 'title': 'Outer',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_test_constraints_schema.assert_Foo_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_test_constraints_schema.assert_Foo_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1559, "end_line": 1599, "span_ids": ["test_constraints_schema"], "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": "@pytest.mark.parametrize(\n 'kwargs,type_,expected_extra',\n [\n ({'max_length': 5}, str, {'type': 'string', 'maxLength': 5}),\n ({}, constr(max_length=6), {'type': 'string', 'maxLength': 6}),\n ({'min_length': 2}, str, {'type': 'string', 'minLength': 2}),\n ({'max_length': 5}, bytes, {'type': 'string', 'maxLength': 5, 'format': 'binary'}),\n ({'pattern': '^foo$'}, str, {'type': 'string', 'pattern': '^foo$'}),\n ({'gt': 2}, int, {'type': 'integer', 'exclusiveMinimum': 2}),\n ({'lt': 5}, int, {'type': 'integer', 'exclusiveMaximum': 5}),\n ({'ge': 2}, int, {'type': 'integer', 'minimum': 2}),\n ({'le': 5}, int, {'type': 'integer', 'maximum': 5}),\n ({'multiple_of': 5}, int, {'type': 'integer', 'multipleOf': 5}),\n ({'gt': 2}, float, {'type': 'number', 'exclusiveMinimum': 2}),\n ({'lt': 5}, float, {'type': 'number', 'exclusiveMaximum': 5}),\n ({'ge': 2}, float, {'type': 'number', 'minimum': 2}),\n ({'le': 5}, float, {'type': 'number', 'maximum': 5}),\n ({'gt': -math.inf}, float, {'type': 'number'}),\n ({'lt': math.inf}, float, {'type': 'number'}),\n ({'ge': -math.inf}, float, {'type': 'number'}),\n ({'le': math.inf}, float, {'type': 'number'}),\n ({'multiple_of': 5}, float, {'type': 'number', 'multipleOf': 5}),\n ({'gt': 2}, Decimal, {'type': 'number', 'exclusiveMinimum': 2}),\n ({'lt': 5}, Decimal, {'type': 'number', 'exclusiveMaximum': 5}),\n ({'ge': 2}, Decimal, {'type': 'number', 'minimum': 2}),\n ({'le': 5}, Decimal, {'type': 'number', 'maximum': 5}),\n ({'multiple_of': 5}, Decimal, {'type': 'number', 'multipleOf': 5}),\n ],\n)\ndef test_constraints_schema(kwargs, type_, expected_extra):\n class Foo(BaseModel):\n a: type_ = Field('foo', title='A title', description='A description', **kwargs)\n\n expected_schema = {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'title': 'A title', 'description': 'A description', 'default': 'foo'}},\n }\n\n expected_schema['properties']['a'].update(expected_extra)\n assert Foo.model_json_schema() == expected_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_test_constraints_schema_validation.assert_Foo_a_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_test_constraints_schema_validation.assert_Foo_a_value_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1602, "end_line": 1638, "span_ids": ["test_constraints_schema_validation"], "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": "@pytest.mark.parametrize(\n 'kwargs,type_,value',\n [\n ({'max_length': 5}, str, 'foo'),\n ({'min_length': 2}, str, 'foo'),\n ({'max_length': 5}, bytes, b'foo'),\n ({'pattern': '^foo$'}, str, 'foo'),\n ({'gt': 2}, int, 3),\n ({'lt': 5}, int, 3),\n ({'ge': 2}, int, 3),\n ({'ge': 2}, int, 2),\n ({'gt': 2}, int, '3'),\n ({'le': 5}, int, 3),\n ({'le': 5}, int, 5),\n ({'gt': 2}, float, 3.0),\n ({'gt': 2}, float, 2.1),\n ({'lt': 5}, float, 3.0),\n ({'lt': 5}, float, 4.9),\n ({'ge': 2}, float, 3.0),\n ({'ge': 2}, float, 2.0),\n ({'le': 5}, float, 3.0),\n ({'le': 5}, float, 5.0),\n ({'gt': 2}, float, 3),\n ({'gt': 2}, float, '3'),\n ({'gt': 2}, Decimal, Decimal(3)),\n ({'lt': 5}, Decimal, Decimal(3)),\n ({'ge': 2}, Decimal, Decimal(3)),\n ({'ge': 2}, Decimal, Decimal(2)),\n ({'le': 5}, Decimal, Decimal(3)),\n ({'le': 5}, Decimal, Decimal(5)),\n ],\n)\ndef test_constraints_schema_validation(kwargs, type_, value):\n class Foo(BaseModel):\n a: type_ = Field('foo', title='A title', description='A description', **kwargs)\n\n assert Foo(a=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_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_raises_test_constraints_schema_validation_raises.with_pytest_raises_Valida.Foo_a_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_raises_test_constraints_schema_validation_raises.with_pytest_raises_Valida.Foo_a_value_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1641, "end_line": 1666, "span_ids": ["test_constraints_schema_validation_raises"], "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": "@pytest.mark.parametrize(\n 'kwargs,type_,value',\n [\n ({'max_length': 5}, str, 'foobar'),\n ({'min_length': 2}, str, 'f'),\n ({'pattern': '^foo$'}, str, 'bar'),\n ({'gt': 2}, int, 2),\n ({'lt': 5}, int, 5),\n ({'ge': 2}, int, 1),\n ({'le': 5}, int, 6),\n ({'gt': 2}, float, 2.0),\n ({'lt': 5}, float, 5.0),\n ({'ge': 2}, float, 1.9),\n ({'le': 5}, float, 5.1),\n ({'gt': 2}, Decimal, Decimal(2)),\n ({'lt': 5}, Decimal, Decimal(5)),\n ({'ge': 2}, Decimal, Decimal(1)),\n ({'le': 5}, Decimal, Decimal(6)),\n ],\n)\ndef test_constraints_schema_validation_raises(kwargs, type_, value):\n class Foo(BaseModel):\n a: type_ = Field('foo', title='A title', description='A description', **kwargs)\n\n with pytest.raises(ValidationError):\n Foo(a=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_pydantic__pydantic/tests/test_json_schema.py_test_schema_kwargs_test_schema_dict_constr.assert_Foo_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_kwargs_test_schema_dict_constr.assert_Foo_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1669, "end_line": 1694, "span_ids": ["test_schema_dict_constr", "test_schema_kwargs"], "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 test_schema_kwargs():\n class Foo(BaseModel):\n a: str = Field('foo', examples=['bar'])\n\n assert Foo.model_json_schema() == {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {'a': {'type': 'string', 'title': 'A', 'default': 'foo', 'examples': ['bar']}},\n }\n\n\ndef test_schema_dict_constr():\n regex_str = r'^([a-zA-Z_][a-zA-Z0-9_]*)$'\n ConStrType = constr(pattern=regex_str)\n ConStrKeyDict = Dict[ConStrType, str]\n\n class Foo(BaseModel):\n a: ConStrKeyDict = {}\n\n assert Foo.model_json_schema() == {\n 'title': 'Foo',\n 'type': 'object',\n 'properties': {\n 'a': {'type': 'object', 'title': 'A', 'default': {}, 'patternProperties': {regex_str: {'type': 'string'}}}\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_pydantic__pydantic/tests/test_json_schema.py_test_bytes_constrained_types_test_bytes_constrained_types.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_bytes_constrained_types_test_bytes_constrained_types.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1697, "end_line": 1714, "span_ids": ["test_bytes_constrained_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\n # (ConstrainedBytes, {'title': 'A', 'type': 'string', 'format': 'binary'}),\n (\n conbytes(min_length=3, max_length=5),\n {'title': 'A', 'type': 'string', 'format': 'binary', 'minLength': 3, 'maxLength': 5},\n ),\n ],\n)\ndef test_bytes_constrained_types(field_type, expected_schema):\n class Model(BaseModel):\n a: field_type\n\n base_schema = {'title': 'Model', 'type': 'object', 'properties': {'a': {}}, 'required': ['a']}\n base_schema['properties']['a'] = expected_schema\n\n assert Model.model_json_schema() == base_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_dict_test_optional_dict.assert_Model_something_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_dict_test_optional_dict.assert_Model_something_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1717, "end_line": 1730, "span_ids": ["test_optional_dict"], "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 test_optional_dict():\n class Model(BaseModel):\n something: Optional[Dict[str, Any]] = None\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'something': {'anyOf': [{'type': 'object'}, {'type': 'null'}], 'default': None, 'title': 'Something'}\n },\n }\n\n assert Model().model_dump() == {'something': None}\n assert Model(something={'foo': 'Bar'}).model_dump() == {'something': {'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_pydantic__pydantic/tests/test_json_schema.py_test_optional_validator_test_field_with_validator.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_validator_test_field_with_validator.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1733, "end_line": 1785, "span_ids": ["test_optional_validator", "test_field_with_validator"], "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": "def test_optional_validator():\n class Model(BaseModel):\n something: Optional[str] = None\n\n @field_validator('something')\n def check_something(cls, v):\n if v is not None and 'x' in v:\n raise ValueError('should not contain x')\n return v\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'something': {\n 'title': 'Something',\n 'anyOf': [{'type': 'string'}, {'type': 'null'}],\n 'default': None,\n }\n },\n }\n\n assert Model().model_dump() == {'something': None}\n assert Model(something=None).model_dump() == {'something': None}\n assert Model(something='hello').model_dump() == {'something': 'hello'}\n with pytest.raises(ValidationError) as exc_info:\n Model(something='hellox')\n assert exc_info.value.errors() == [\n {\n 'ctx': {'error': 'should not contain x'},\n 'input': 'hellox',\n 'loc': ('something',),\n 'msg': 'Value error, should not contain x',\n 'type': 'value_error',\n }\n ]\n\n\ndef test_field_with_validator():\n class Model(BaseModel):\n something: Optional[int] = None\n\n @field_validator('something')\n def check_field(cls, v, info):\n return v\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'something': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': None, 'title': 'Something'}\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_pydantic__pydantic/tests/test_json_schema.py_test_unparameterized_schema_generation_test_unparameterized_schema_generation.assert_foo_dict_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_unparameterized_schema_generation_test_unparameterized_schema_generation.assert_foo_dict_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1788, "end_line": 1824, "span_ids": ["test_unparameterized_schema_generation"], "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 test_unparameterized_schema_generation():\n class FooList(BaseModel):\n d: List\n\n class BarList(BaseModel):\n d: list\n\n assert model_json_schema(FooList) == {\n 'title': 'FooList',\n 'type': 'object',\n 'properties': {'d': {'items': {}, 'title': 'D', 'type': 'array'}},\n 'required': ['d'],\n }\n\n foo_list_schema = model_json_schema(FooList)\n bar_list_schema = model_json_schema(BarList)\n bar_list_schema['title'] = 'FooList' # to check for equality\n assert foo_list_schema == bar_list_schema\n\n class FooDict(BaseModel):\n d: Dict\n\n class BarDict(BaseModel):\n d: dict\n\n model_json_schema(Foo)\n assert model_json_schema(FooDict) == {\n 'title': 'FooDict',\n 'type': 'object',\n 'properties': {'d': {'title': 'D', 'type': 'object'}},\n 'required': ['d'],\n }\n\n foo_dict_schema = model_json_schema(FooDict)\n bar_dict_schema = model_json_schema(BarDict)\n bar_dict_schema['title'] = 'FooDict' # to check for equality\n assert foo_dict_schema == bar_dict_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_known_model_optimization_test_known_model_optimization.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_known_model_optimization_test_known_model_optimization.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1827, "end_line": 1853, "span_ids": ["test_known_model_optimization"], "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 test_known_model_optimization():\n class Dep(BaseModel):\n number: int\n\n class Model(BaseModel):\n dep: Dep\n dep_l: List[Dep]\n\n expected = {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'dep': {'$ref': '#/$defs/Dep'},\n 'dep_l': {'title': 'Dep L', 'type': 'array', 'items': {'$ref': '#/$defs/Dep'}},\n },\n 'required': ['dep', 'dep_l'],\n '$defs': {\n 'Dep': {\n 'title': 'Dep',\n 'type': 'object',\n 'properties': {'number': {'title': 'Number', 'type': 'integer'}},\n 'required': ['number'],\n }\n },\n }\n\n assert Model.model_json_schema() == 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_pydantic__pydantic/tests/test_json_schema.py_test_new_type_schema_test_new_type_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_new_type_schema_test_new_type_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1856, "end_line": 1875, "span_ids": ["test_new_type_schema"], "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 test_new_type_schema():\n a_type = NewType('a_type', int)\n b_type = NewType('b_type', a_type)\n c_type = NewType('c_type', str)\n\n class Model(BaseModel):\n a: a_type\n b: b_type\n c: c_type\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'a': {'title': 'A', 'type': 'integer'},\n 'b': {'title': 'B', 'type': 'integer'},\n 'c': {'title': 'C', 'type': 'string'},\n },\n 'required': ['a', 'b', 'c'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_literal_schema_test_literal_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_literal_schema_test_literal_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1878, "end_line": 1895, "span_ids": ["test_literal_schema"], "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 test_literal_schema():\n class Model(BaseModel):\n a: Literal[1]\n b: Literal['a']\n c: Literal['a', 1]\n d: Literal['a', Literal['b'], 1, 2]\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'a': {'const': 1, 'title': 'A'},\n 'b': {'const': 'a', 'title': 'B'},\n 'c': {'enum': ['a', 1], 'title': 'C'},\n 'd': {'enum': ['a', 'b', 1, 2], 'title': 'D'},\n },\n 'required': ['a', 'b', 'c', 'd'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_literal_enum_test_literal_enum.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_literal_enum_test_literal_enum.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1898, "end_line": 1912, "span_ids": ["test_literal_enum"], "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 test_literal_enum():\n class MyEnum(str, Enum):\n FOO = 'foo'\n BAR = 'bar'\n\n class Model(BaseModel):\n kind: Literal[MyEnum.FOO]\n other: Literal[MyEnum.FOO, MyEnum.BAR]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'kind': {'const': 'foo', 'title': 'Kind'}, 'other': {'enum': ['foo', 'bar'], 'title': 'Other'}},\n 'required': ['kind', 'other'],\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_pydantic__pydantic/tests/test_json_schema.py_test_color_type_test_model_with_extra_forbidden.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_color_type_test_model_with_extra_forbidden.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1915, "end_line": 1939, "span_ids": ["test_color_type", "test_model_with_extra_forbidden"], "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 test_color_type():\n class Model(BaseModel):\n color: Color\n\n model_schema = Model.model_json_schema()\n assert model_schema == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'color': {'title': 'Color', 'type': 'string', 'format': 'color'}},\n 'required': ['color'],\n }\n\n\ndef test_model_with_extra_forbidden():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n a: str\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'additionalProperties': 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_pydantic__pydantic/tests/test_json_schema.py_test_enforced_constraints_test_enforced_constraints.assert_schema_properties": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enforced_constraints_test_enforced_constraints.assert_schema_properties", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 1942, "end_line": 2006, "span_ids": ["test_enforced_constraints"], "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": "@pytest.mark.parametrize(\n 'annotation,kwargs,field_schema',\n [\n (int, dict(gt=0), {'title': 'A', 'exclusiveMinimum': 0, 'type': 'integer'}),\n (\n Optional[int],\n dict(gt=0),\n {'title': 'A', 'anyOf': [{'exclusiveMinimum': 0, 'type': 'integer'}, {'type': 'null'}]},\n ),\n (\n Tuple[Annotated[int, Field(gt=0)], ...],\n {},\n {'items': {'exclusiveMinimum': 0, 'type': 'integer'}, 'title': 'A', 'type': 'array'},\n ),\n (\n Tuple[Annotated[int, Field(gt=0)], Annotated[int, Field(gt=0)], Annotated[int, Field(gt=0)]],\n {},\n {\n 'title': 'A',\n 'type': 'array',\n 'prefixItems': [\n {'exclusiveMinimum': 0, 'type': 'integer'},\n {'exclusiveMinimum': 0, 'type': 'integer'},\n {'exclusiveMinimum': 0, 'type': 'integer'},\n ],\n 'minItems': 3,\n 'maxItems': 3,\n },\n ),\n (\n Union[Annotated[int, Field(gt=0)], Annotated[float, Field(gt=0)]],\n {},\n {\n 'title': 'A',\n 'anyOf': [{'exclusiveMinimum': 0, 'type': 'integer'}, {'exclusiveMinimum': 0, 'type': 'number'}],\n },\n ),\n (\n List[Annotated[int, Field(gt=0)]],\n {},\n {'title': 'A', 'type': 'array', 'items': {'exclusiveMinimum': 0, 'type': 'integer'}},\n ),\n (\n Dict[str, Annotated[int, Field(gt=0)]],\n {},\n {\n 'title': 'A',\n 'type': 'object',\n 'additionalProperties': {'exclusiveMinimum': 0, 'type': 'integer'},\n },\n ),\n (\n Union[Annotated[str, Field(max_length=5)], Annotated[int, Field(gt=0)]],\n {},\n {'title': 'A', 'anyOf': [{'maxLength': 5, 'type': 'string'}, {'exclusiveMinimum': 0, 'type': 'integer'}]},\n ),\n ],\n)\ndef test_enforced_constraints(annotation, kwargs, field_schema):\n class Model(BaseModel):\n a: annotation = Field(..., **kwargs)\n\n schema = Model.model_json_schema()\n # debug(schema['properties']['a'])\n assert schema['properties']['a'] == field_schema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_real_constraints_test_real_constraints.assert_Model1_model_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_real_constraints_test_real_constraints.assert_Model1_model_json_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2009, "end_line": 2024, "span_ids": ["test_real_constraints"], "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 test_real_constraints():\n class Model1(BaseModel):\n model_config = ConfigDict(title='Test Model')\n foo: int = Field(..., gt=123)\n\n with pytest.raises(ValidationError, match='should be greater than 123'):\n Model1(foo=123)\n\n assert Model1(foo=124).model_dump() == {'foo': 124}\n\n assert Model1.model_json_schema() == {\n 'title': 'Test Model',\n 'type': 'object',\n 'properties': {'foo': {'title': 'Foo', 'exclusiveMinimum': 123, 'type': 'integer'}},\n 'required': ['foo'],\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_pydantic__pydantic/tests/test_json_schema.py_test_subfield_field_info_test_subfield_field_info.assert_MyModel_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_subfield_field_info_test_subfield_field_info.assert_MyModel_model_json", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2027, "end_line": 2042, "span_ids": ["test_subfield_field_info"], "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": "def test_subfield_field_info():\n class MyModel(BaseModel):\n entries: Dict[str, List[int]]\n\n assert MyModel.model_json_schema() == {\n 'title': 'MyModel',\n 'type': 'object',\n 'properties': {\n 'entries': {\n 'title': 'Entries',\n 'type': 'object',\n 'additionalProperties': {'type': 'array', 'items': {'type': 'integer'}},\n }\n },\n 'required': ['entries'],\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_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_test_dataclass.assert_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_test_dataclass.assert_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2045, "end_line": 2066, "span_ids": ["test_dataclass"], "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 test_dataclass():\n @dataclass\n class Model:\n a: bool\n\n assert models_json_schema([Model]) == {\n '$defs': {\n 'Model': {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'boolean'}},\n 'required': ['a'],\n }\n }\n }\n\n assert model_json_schema(Model) == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'boolean'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_attributes_test_schema_attributes.assert_Example_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_attributes_test_schema_attributes.assert_Example_model_json", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2069, "end_line": 2096, "span_ids": ["test_schema_attributes"], "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 test_schema_attributes():\n class ExampleEnum(Enum):\n \"\"\"This is a test description.\"\"\"\n\n gt = 'GT'\n lt = 'LT'\n ge = 'GE'\n le = 'LE'\n max_length = 'ML'\n multiple_of = 'MO'\n regex = 'RE'\n\n class Example(BaseModel):\n example: ExampleEnum\n\n assert Example.model_json_schema() == {\n 'title': 'Example',\n 'type': 'object',\n 'properties': {'example': {'$ref': '#/$defs/ExampleEnum'}},\n 'required': ['example'],\n '$defs': {\n 'ExampleEnum': {\n 'title': 'ExampleEnum',\n 'description': 'This is a test description.',\n 'enum': ['GT', 'LT', 'GE', 'LE', 'ML', 'MO', 'RE'],\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_pydantic__pydantic/tests/test_json_schema.py_test_path_modify_schema_test_path_modify_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_path_modify_schema_test_path_modify_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2099, "end_line": 2120, "span_ids": ["test_path_modify_schema"], "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 test_path_modify_schema():\n class MyPath(Path):\n @classmethod\n def __pydantic_modify_json_schema__(cls, schema):\n schema.update(foobar=123)\n return schema\n\n class Model(BaseModel):\n path1: Path\n path2: MyPath\n path3: List[MyPath]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'path1': {'title': 'Path1', 'type': 'string', 'format': 'path'},\n 'path2': {'title': 'Path2', 'type': 'string', 'format': 'path', 'foobar': 123},\n 'path3': {'title': 'Path3', 'type': 'array', 'items': {'type': 'string', 'format': 'path', 'foobar': 123}},\n },\n 'required': ['path1', 'path2', 'path3'],\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_pydantic__pydantic/tests/test_json_schema.py_test_frozen_set_test_frozen_set.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_frozen_set_test_frozen_set.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2123, "end_line": 2146, "span_ids": ["test_frozen_set"], "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 test_frozen_set():\n class Model(BaseModel):\n a: FrozenSet[int] = frozenset({1, 2, 3})\n b: FrozenSet = frozenset({1, 2, 3})\n c: frozenset = frozenset({1, 2, 3})\n d: frozenset = ...\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'a': {\n 'title': 'A',\n 'default': [1, 2, 3],\n 'type': 'array',\n 'items': {'type': 'integer'},\n 'uniqueItems': True,\n },\n 'b': {'title': 'B', 'default': [1, 2, 3], 'type': 'array', 'items': {}, 'uniqueItems': True},\n 'c': {'title': 'C', 'default': [1, 2, 3], 'type': 'array', 'items': {}, 'uniqueItems': True},\n 'd': {'title': 'D', 'type': 'array', 'items': {}, 'uniqueItems': True},\n },\n 'required': ['d'],\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_pydantic__pydantic/tests/test_json_schema.py_test_iterable_test_new_type.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_iterable_test_new_type.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2149, "end_line": 2172, "span_ids": ["test_new_type", "test_iterable"], "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 test_iterable():\n class Model(BaseModel):\n a: Iterable[int]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'array', 'items': {'type': 'integer'}}},\n 'required': ['a'],\n }\n\n\ndef test_new_type():\n new_type = NewType('NewStr', str)\n\n class Model(BaseModel):\n a: new_type\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_json_schema.py_test_multiple_models_with_same_name_test_multiple_models_with_same_name.assert_model_names_exp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_multiple_models_with_same_name_test_multiple_models_with_same_name.assert_model_names_exp", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2175, "end_line": 2210, "span_ids": ["test_multiple_models_with_same_name"], "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": "def test_multiple_models_with_same_name(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import BaseModel\n\n\nclass ModelOne(BaseModel):\n class NestedModel(BaseModel):\n a: float\n\n nested: NestedModel\n\n\nclass ModelTwo(BaseModel):\n class NestedModel(BaseModel):\n b: float\n\n nested: NestedModel\n\n\nclass NestedModel(BaseModel):\n c: float\n \"\"\"\n )\n\n models = [module.ModelOne, module.ModelTwo, module.NestedModel]\n model_names = set(models_json_schema(models)['$defs'].keys())\n expected_model_names = {\n 'ModelOne',\n 'ModelTwo',\n f'{module.__name__}__ModelOne__NestedModel',\n f'{module.__name__}__ModelTwo__NestedModel',\n f'{module.__name__}__NestedModel',\n }\n assert model_names == expected_model_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_pydantic__pydantic/tests/test_json_schema.py_test_multiple_enums_with_same_name_test_multiple_enums_with_same_name.assert_set_Model_model_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_multiple_enums_with_same_name_test_multiple_enums_with_same_name.assert_set_Model_model_js", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2213, "end_line": 2262, "span_ids": ["test_multiple_enums_with_same_name"], "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 test_multiple_enums_with_same_name(create_module):\n module_1 = create_module(\n # language=Python\n \"\"\"\nfrom enum import Enum\n\nfrom pydantic import BaseModel\n\n\nclass MyEnum(str, Enum):\n a = 'a'\n b = 'b'\n c = 'c'\n\n\nclass MyModel(BaseModel):\n my_enum_1: MyEnum\n \"\"\"\n )\n\n module_2 = create_module(\n # language=Python\n \"\"\"\nfrom enum import Enum\n\nfrom pydantic import BaseModel\n\n\nclass MyEnum(str, Enum):\n d = 'd'\n e = 'e'\n f = 'f'\n\n\nclass MyModel(BaseModel):\n my_enum_2: MyEnum\n \"\"\"\n )\n\n class Model(BaseModel):\n my_model_1: module_1.MyModel\n my_model_2: module_2.MyModel\n\n assert len(Model.model_json_schema()['$defs']) == 4\n assert set(Model.model_json_schema()['$defs']) == {\n f'{module_1.__name__}__MyEnum',\n f'{module_1.__name__}__MyModel',\n f'{module_2.__name__}__MyEnum',\n f'{module_2.__name__}__MyModel',\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_for_generic_field_test_schema_for_generic_field.GenModel.__get_pydantic_core_schema__.return.core_schema_general_plain": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_for_generic_field_test_schema_for_generic_field.GenModel.__get_pydantic_core_schema__.return.core_schema_general_plain", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2265, "end_line": 2290, "span_ids": ["test_schema_for_generic_field"], "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 test_schema_for_generic_field():\n T = TypeVar('T')\n\n class GenModel(Generic[T]):\n def __init__(self, data: Any):\n self.data = data\n\n @classmethod\n def __get_validators__(cls):\n yield cls.validate\n\n @classmethod\n def validate(cls, v: Any):\n return v\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: Any, gen_schema: GenerateSchema, **_kwargs: Any\n ) -> core_schema.PlainValidatorFunctionSchema:\n source_args = getattr(source, '__args__', [Any])\n param = source_args[0]\n metadata = build_metadata_dict(js_cs_override=gen_schema.generate_schema(param))\n return core_schema.general_plain_validator_function(\n GenModel,\n metadata=metadata,\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_for_generic_field.Model_test_schema_for_generic_field.assert_ModelModified_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_for_generic_field.Model_test_schema_for_generic_field.assert_ModelModified_mode", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2292, "end_line": 2332, "span_ids": ["test_schema_for_generic_field"], "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 test_schema_for_generic_field():\n # ... other code\n\n class Model(BaseModel):\n data: GenModel[str]\n data1: GenModel\n\n model_config = dict(arbitrary_types_allowed=True)\n\n # assert Model.__pydantic_core_schema__ == {}\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'data': {'type': 'string', 'title': 'Data'},\n 'data1': {\n 'title': 'Data1',\n },\n },\n 'required': ['data', 'data1'],\n }\n\n class GenModelModified(GenModel, Generic[T]):\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema):\n type = field_schema.pop('type', 'other')\n field_schema.update(anyOf=[{'type': type}, {'type': 'array', 'items': {'type': type}}])\n return field_schema\n\n class ModelModified(BaseModel):\n data: GenModelModified[str]\n data1: GenModelModified\n\n model_config = dict(arbitrary_types_allowed=True)\n\n assert ModelModified.model_json_schema() == {\n 'title': 'ModelModified',\n 'type': 'object',\n 'properties': {\n 'data': {'title': 'Data', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]},\n 'data1': {'title': 'Data1', 'anyOf': [{'type': 'other'}, {'type': 'array', 'items': {'type': 'other'}}]},\n },\n 'required': ['data', 'data1'],\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_pydantic__pydantic/tests/test_json_schema.py_test_namedtuple_default_test_namedtuple_default.assert_LocationBase_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_namedtuple_default_test_namedtuple_default.assert_LocationBase_model", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2335, "end_line": 2358, "span_ids": ["test_namedtuple_default"], "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 test_namedtuple_default():\n class Coordinates(NamedTuple):\n x: float\n y: float\n\n class LocationBase(BaseModel):\n coords: Coordinates = Coordinates(34, 42)\n\n assert LocationBase(coords=Coordinates(1, 2)).coords == Coordinates(1, 2)\n\n assert LocationBase.model_json_schema() == {\n 'title': 'LocationBase',\n 'type': 'object',\n 'properties': {\n 'coords': {\n 'title': 'Coords',\n 'default': [34, 42],\n 'type': 'array',\n 'prefixItems': [{'title': 'X', 'type': 'number'}, {'title': 'Y', 'type': 'number'}],\n 'minItems': 2,\n 'maxItems': 2,\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_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema_test_advanced_generic_schema.Gen.__pydantic_modify_json_schema__.return.field_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema_test_advanced_generic_schema.Gen.__pydantic_modify_json_schema__.return.field_schema", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2361, "end_line": 2393, "span_ids": ["test_advanced_generic_schema"], "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": "def test_advanced_generic_schema():\n T = TypeVar('T')\n K = TypeVar('K')\n\n class Gen(Generic[T]):\n def __init__(self, data: Any):\n self.data = data\n\n @classmethod\n def __get_validators__(cls):\n yield cls.validate\n\n @classmethod\n def validate(cls, v: Any):\n return v\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: Any, gen_schema: GenerateSchema, **_kwargs: Any\n ) -> core_schema.PlainValidatorFunctionSchema:\n if hasattr(source, '__args__'):\n param = source.__args__[0]\n metadata = build_metadata_dict(js_cs_override=gen_schema.generate_schema(Optional[param]))\n return core_schema.general_plain_validator_function(\n Gen,\n metadata=metadata,\n )\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema):\n the_type = field_schema.pop('anyOf', [{'type': 'string'}])[0]\n field_schema.update(title='Gen title', anyOf=[the_type, {'type': 'array', 'items': the_type}])\n return field_schema\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_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.GenTwoParams_test_advanced_generic_schema.GenTwoParams.__pydantic_modify_json_schema__.return.field_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.GenTwoParams_test_advanced_generic_schema.GenTwoParams.__pydantic_modify_json_schema__.return.field_schema", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2395, "end_line": 2424, "span_ids": ["test_advanced_generic_schema"], "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 test_advanced_generic_schema():\n # ... other code\n\n class GenTwoParams(Generic[T, K]):\n def __init__(self, x: str, y: Any):\n self.x = x\n self.y = y\n\n @classmethod\n def __get_validators__(cls):\n yield cls.validate\n\n @classmethod\n def validate(cls, v: Any):\n return cls(*v)\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: Any, gen_schema: GenerateSchema, **_kwargs: Any\n ) -> core_schema.PlainValidatorFunctionSchema:\n if hasattr(source, '__args__'):\n metadata = build_metadata_dict(js_cs_override=gen_schema.generate_schema(Tuple[source.__args__]))\n return core_schema.general_plain_validator_function(\n GenTwoParams,\n metadata=metadata,\n )\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema):\n field_schema.pop('minItems')\n field_schema.pop('maxItems')\n field_schema.update(examples='examples')\n return field_schema\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_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.CustomType_test_advanced_generic_schema.Model.model_config._arbitrary_types_allowed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.CustomType_test_advanced_generic_schema.Model.model_config._arbitrary_types_allowed", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2426, "end_line": 2444, "span_ids": ["test_advanced_generic_schema"], "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 test_advanced_generic_schema():\n # ... other code\n\n class CustomType(Enum):\n A = 'a'\n B = 'b'\n\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema):\n field_schema.update(title='CustomType title', type='string')\n return field_schema\n\n class Model(BaseModel):\n data0: Gen\n data1: Gen[CustomType] = Field(title='Data1 title', description='Data 1 description')\n data2: GenTwoParams[CustomType, UUID4] = Field(title='Data2 title', description='Data 2')\n # check Tuple because changes in code touch that type\n data3: Tuple\n data4: Tuple[CustomType]\n data5: Tuple[CustomType, str]\n\n model_config = {'arbitrary_types_allowed': 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_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.assert_Model_model_json_s_test_advanced_generic_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.assert_Model_model_json_s_test_advanced_generic_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2446, "end_line": 2493, "span_ids": ["test_advanced_generic_schema"], "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": "def test_advanced_generic_schema():\n # ... other code\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'data0': {\n 'anyOf': [{'type': 'string'}, {'items': {'type': 'string'}, 'type': 'array'}],\n 'title': 'Gen title',\n },\n 'data1': {\n 'title': 'Data1 title',\n 'description': 'Data 1 description',\n 'anyOf': [\n {'$ref': '#/$defs/CustomType'},\n {'type': 'array', 'items': {'$ref': '#/$defs/CustomType'}},\n ],\n },\n 'data2': {\n 'description': 'Data 2',\n 'examples': 'examples',\n 'prefixItems': [{'$ref': '#/$defs/CustomType'}, {'format': 'uuid4', 'type': 'string'}],\n 'title': 'Data2 title',\n 'type': 'array',\n },\n 'data3': {'title': 'Data3', 'type': 'array', 'items': {}},\n 'data4': {\n 'title': 'Data4',\n 'type': 'array',\n 'prefixItems': [{'$ref': '#/$defs/CustomType'}],\n 'minItems': 1,\n 'maxItems': 1,\n },\n 'data5': {\n 'title': 'Data5',\n 'type': 'array',\n 'prefixItems': [{'$ref': '#/$defs/CustomType'}, {'type': 'string'}],\n 'minItems': 2,\n 'maxItems': 2,\n },\n },\n 'required': ['data0', 'data1', 'data2', 'data3', 'data4', 'data5'],\n '$defs': {\n 'CustomType': {\n 'title': 'CustomType title',\n 'enum': ['a', 'b'],\n 'type': 'string',\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_pydantic__pydantic/tests/test_json_schema.py_test_nested_generic_test_nested_generic.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_generic_test_nested_generic.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2496, "end_line": 2527, "span_ids": ["test_nested_generic"], "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 test_nested_generic():\n \"\"\"\n Test a nested BaseModel that is also a Generic\n \"\"\"\n\n class Ref(BaseModel, Generic[T]):\n uuid: str\n\n def resolve(self) -> T:\n ...\n\n class Model(BaseModel):\n ref: Ref['Model']\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n '$defs': {\n 'Ref_Model_': {\n 'title': 'Ref[Model]',\n 'type': 'object',\n 'properties': {\n 'uuid': {'title': 'Uuid', 'type': 'string'},\n },\n 'required': ['uuid'],\n },\n },\n 'properties': {\n 'ref': {'$ref': '#/$defs/Ref_Model_'},\n },\n 'required': ['ref'],\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_pydantic__pydantic/tests/test_json_schema.py_test_nested_generic_model_test_nested_generic_model.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_generic_model_test_nested_generic_model.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2530, "end_line": 2555, "span_ids": ["test_nested_generic_model"], "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 test_nested_generic_model():\n \"\"\"\n Test a nested generic model\n \"\"\"\n\n class Box(BaseModel, Generic[T]):\n uuid: str\n data: T\n\n class Model(BaseModel):\n box_str: Box[str]\n box_int: Box[int]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n '$defs': {\n 'Box_str_': Box[str].model_json_schema(),\n 'Box_int_': Box[int].model_json_schema(),\n },\n 'properties': {\n 'box_str': {'$ref': '#/$defs/Box_str_'},\n 'box_int': {'$ref': '#/$defs/Box_int_'},\n },\n 'required': ['box_str', 'box_int'],\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_pydantic__pydantic/tests/test_json_schema.py_test_complex_nested_generic_test_complex_nested_generic.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_complex_nested_generic_test_complex_nested_generic.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2558, "end_line": 2603, "span_ids": ["test_complex_nested_generic"], "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": "def test_complex_nested_generic():\n \"\"\"\n Handle a union of a generic.\n \"\"\"\n\n class Ref(BaseModel, Generic[T]):\n uuid: str\n\n def resolve(self) -> T:\n ...\n\n class Model(BaseModel):\n uuid: str\n model: Union[Ref['Model'], 'Model']\n\n def resolve(self) -> 'Model':\n ...\n\n Model.model_rebuild()\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'Model': {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'uuid': {'title': 'Uuid', 'type': 'string'},\n 'model': {\n 'title': 'Model',\n 'anyOf': [\n {'$ref': '#/$defs/Ref_Model_'},\n {'$ref': '#/$defs/Model'},\n ],\n },\n },\n 'required': ['uuid', 'model'],\n },\n 'Ref_Model_': {\n 'title': 'Ref[Model]',\n 'type': 'object',\n 'properties': {'uuid': {'title': 'Uuid', 'type': 'string'}},\n 'required': ['uuid'],\n },\n },\n 'allOf': [{'$ref': '#/$defs/Model'}],\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_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_field_parameter_test_schema_with_field_parameter.assert_MyModel_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_schema_with_field_parameter_test_schema_with_field_parameter.assert_MyModel_model_json", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2606, "end_line": 2630, "span_ids": ["test_schema_with_field_parameter"], "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": "@pytest.mark.xfail(reason='__pydantic_modify_json_schema__ does not receive FieldInfo')\ndef test_schema_with_field_parameter():\n # TODO: Update so that __pydantic_modify_json_schema__ gets called with the FieldInfo when handling fields\n class RestrictedAlphabetStr(str):\n @classmethod\n def __pydantic_modify_json_schema__(cls, field_schema, field: Optional[FieldInfo]):\n assert isinstance(field, FieldInfo)\n alphabet = field.json_schema_extra['alphabet']\n field_schema['examples'] = [c * 3 for c in alphabet]\n field_schema['title'] = field.title.lower()\n return field_schema\n\n class MyModel(BaseModel):\n value: RestrictedAlphabetStr = Field(title='RESTRICTED_ALPHABET', json_schema_extra={'alphabet': 'ABC'})\n\n model_config = {'arbitrary_types_allowed': True}\n\n assert MyModel.model_json_schema() == {\n 'title': 'MyModel',\n 'type': 'object',\n 'properties': {\n 'value': {'title': 'Value', 'alphabet': 'ABC', 'examples': ['AAA', 'BBB', 'CCC'], 'type': 'string'}\n },\n 'required': ['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_pydantic__pydantic/tests/test_json_schema.py_test_modify_schema_dict_keys_test_modify_schema_dict_keys.assert_MyModel_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_modify_schema_dict_keys_test_modify_schema_dict_keys.assert_MyModel_model_json", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2633, "end_line": 2652, "span_ids": ["test_modify_schema_dict_keys"], "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 test_modify_schema_dict_keys() -> None:\n class MyType:\n @classmethod\n def __pydantic_modify_json_schema__(cls, schema):\n schema['test'] = 'passed'\n return schema\n\n class MyModel(BaseModel):\n my_field: Dict[str, MyType]\n\n model_config = dict(arbitrary_types_allowed=True)\n\n assert MyModel.model_json_schema() == {\n 'properties': {\n 'my_field': {'additionalProperties': {'test': 'passed'}, 'title': 'My Field', 'type': 'object'} # <----\n },\n 'required': ['my_field'],\n 'title': 'MyModel',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_union_test_discriminated_union.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_union_test_discriminated_union.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2655, "end_line": 2711, "span_ids": ["test_discriminated_union"], "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 test_discriminated_union():\n class Cat(BaseModel):\n pet_type: Literal['cat']\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n\n class Lizard(BaseModel):\n pet_type: Literal['reptile', 'lizard']\n\n class Model(BaseModel):\n pet: Union[Cat, Dog, Lizard] = Field(..., discriminator='pet_type')\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'Cat': {\n 'properties': {'pet_type': {'const': 'cat', 'title': 'Pet Type'}},\n 'required': ['pet_type'],\n 'title': 'Cat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {'pet_type': {'const': 'dog', 'title': 'Pet Type'}},\n 'required': ['pet_type'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'Lizard': {\n 'properties': {'pet_type': {'enum': ['reptile', 'lizard'], 'title': 'Pet Type'}},\n 'required': ['pet_type'],\n 'title': 'Lizard',\n 'type': 'object',\n },\n },\n 'properties': {\n 'pet': {\n 'discriminator': {\n 'mapping': {\n 'cat': '#/$defs/Cat',\n 'dog': '#/$defs/Dog',\n 'lizard': '#/$defs/Lizard',\n 'reptile': '#/$defs/Lizard',\n },\n 'propertyName': 'pet_type',\n },\n 'oneOf': [\n {'$ref': '#/$defs/Cat'},\n {'$ref': '#/$defs/Dog'},\n {'$ref': '#/$defs/Lizard'},\n ],\n 'title': 'Pet',\n }\n },\n 'required': ['pet'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_test_discriminated_annotated_union.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_test_discriminated_annotated_union.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2714, "end_line": 2770, "span_ids": ["test_discriminated_annotated_union"], "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": "def test_discriminated_annotated_union():\n class Cat(BaseModel):\n pet_type: Literal['cat']\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n\n class Lizard(BaseModel):\n pet_type: Literal['reptile', 'lizard']\n\n class Model(BaseModel):\n pet: Annotated[Union[Cat, Dog, Lizard], Field(..., discriminator='pet_type')]\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'Cat': {\n 'properties': {'pet_type': {'const': 'cat', 'title': 'Pet Type'}},\n 'required': ['pet_type'],\n 'title': 'Cat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {'pet_type': {'const': 'dog', 'title': 'Pet Type'}},\n 'required': ['pet_type'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'Lizard': {\n 'properties': {'pet_type': {'enum': ['reptile', 'lizard'], 'title': 'Pet Type'}},\n 'required': ['pet_type'],\n 'title': 'Lizard',\n 'type': 'object',\n },\n },\n 'properties': {\n 'pet': {\n 'discriminator': {\n 'mapping': {\n 'cat': '#/$defs/Cat',\n 'dog': '#/$defs/Dog',\n 'lizard': '#/$defs/Lizard',\n 'reptile': '#/$defs/Lizard',\n },\n 'propertyName': 'pet_type',\n },\n 'oneOf': [\n {'$ref': '#/$defs/Cat'},\n {'$ref': '#/$defs/Dog'},\n {'$ref': '#/$defs/Lizard'},\n ],\n 'title': 'Pet',\n }\n },\n 'required': ['pet'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_nested_discriminated_union_test_nested_discriminated_union.assert_Cat_model_json_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_discriminated_union_test_nested_discriminated_union.assert_Cat_model_json_sch", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2773, "end_line": 2859, "span_ids": ["test_nested_discriminated_union"], "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": "def test_nested_discriminated_union():\n class BlackCatWithHeight(BaseModel):\n color: Literal['black']\n info: Literal['height']\n height: float\n\n class BlackCatWithWeight(BaseModel):\n color: Literal['black']\n info: Literal['weight']\n weight: float\n\n BlackCat = Annotated[Union[BlackCatWithHeight, BlackCatWithWeight], Field(discriminator='info')]\n\n class WhiteCat(BaseModel):\n color: Literal['white']\n white_cat_info: str\n\n class Cat(BaseModel):\n pet: Annotated[Union[BlackCat, WhiteCat], Field(discriminator='color')]\n\n assert Cat.model_json_schema() == {\n '$defs': {\n 'BlackCatWithHeight': {\n 'properties': {\n 'color': {'const': 'black', 'title': 'Color'},\n 'height': {'title': 'Height', 'type': 'number'},\n 'info': {'const': 'height', 'title': 'Info'},\n },\n 'required': ['color', 'info', 'height'],\n 'title': 'BlackCatWithHeight',\n 'type': 'object',\n },\n 'BlackCatWithWeight': {\n 'properties': {\n 'color': {'const': 'black', 'title': 'Color'},\n 'info': {'const': 'weight', 'title': 'Info'},\n 'weight': {'title': 'Weight', 'type': 'number'},\n },\n 'required': ['color', 'info', 'weight'],\n 'title': 'BlackCatWithWeight',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'title': 'Color'},\n 'white_cat_info': {'title': 'White Cat Info', 'type': 'string'},\n },\n 'required': ['color', 'white_cat_info'],\n 'title': 'WhiteCat',\n 'type': 'object',\n },\n },\n 'properties': {\n 'pet': {\n 'discriminator': {\n 'mapping': {\n 'black': {\n 'discriminator': {\n 'mapping': {\n 'height': '#/$defs/BlackCatWithHeight',\n 'weight': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [{'$ref': '#/$defs/BlackCatWithHeight'}, {'$ref': '#/$defs/BlackCatWithWeight'}],\n },\n 'white': '#/$defs/WhiteCat',\n },\n 'propertyName': 'color',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {'height': '#/$defs/BlackCatWithHeight', 'weight': '#/$defs/BlackCatWithWeight'},\n 'propertyName': 'info',\n },\n 'oneOf': [{'$ref': '#/$defs/BlackCatWithHeight'}, {'$ref': '#/$defs/BlackCatWithWeight'}],\n },\n {'$ref': '#/$defs/WhiteCat'},\n ],\n 'title': 'Pet',\n }\n },\n 'required': ['pet'],\n 'title': 'Cat',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_deeper_nested_discriminated_annotated_union_test_deeper_nested_discriminated_annotated_union.Model.number": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deeper_nested_discriminated_annotated_union_test_deeper_nested_discriminated_annotated_union.Model.number", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2862, "end_line": 2892, "span_ids": ["test_deeper_nested_discriminated_annotated_union"], "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 test_deeper_nested_discriminated_annotated_union():\n class BlackCatWithHeight(BaseModel):\n pet_type: Literal['cat']\n color: Literal['black']\n info: Literal['height']\n black_infos: str\n\n class BlackCatWithWeight(BaseModel):\n pet_type: Literal['cat']\n color: Literal['black']\n info: Literal['weight']\n black_infos: str\n\n BlackCat = Annotated[Union[BlackCatWithHeight, BlackCatWithWeight], Field(discriminator='info')]\n\n class WhiteCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['white']\n white_infos: str\n\n Cat = Annotated[Union[BlackCat, WhiteCat], Field(discriminator='color')]\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n dog_name: str\n\n Pet = Annotated[Union[Cat, Dog], Field(discriminator='pet_type')]\n\n class Model(BaseModel):\n pet: Pet\n number: 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_pydantic__pydantic/tests/test_json_schema.py_test_deeper_nested_discriminated_annotated_union.assert_Model_model_json_s_test_deeper_nested_discriminated_annotated_union.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deeper_nested_discriminated_annotated_union.assert_Model_model_json_s_test_deeper_nested_discriminated_annotated_union.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 2894, "end_line": 3030, "span_ids": ["test_deeper_nested_discriminated_annotated_union"], "tokens": 1046}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_deeper_nested_discriminated_annotated_union():\n # ... other code\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'BlackCatWithHeight': {\n 'properties': {\n 'black_infos': {'title': 'Black ' 'Infos', 'type': 'string'},\n 'color': {'const': 'black', 'title': 'Color'},\n 'info': {'const': 'height', 'title': 'Info'},\n 'pet_type': {'const': 'cat', 'title': 'Pet ' 'Type'},\n },\n 'required': ['pet_type', 'color', 'info', 'black_infos'],\n 'title': 'BlackCatWithHeight',\n 'type': 'object',\n },\n 'BlackCatWithWeight': {\n 'properties': {\n 'black_infos': {'title': 'Black ' 'Infos', 'type': 'string'},\n 'color': {'const': 'black', 'title': 'Color'},\n 'info': {'const': 'weight', 'title': 'Info'},\n 'pet_type': {'const': 'cat', 'title': 'Pet ' 'Type'},\n },\n 'required': ['pet_type', 'color', 'info', 'black_infos'],\n 'title': 'BlackCatWithWeight',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {\n 'dog_name': {'title': 'Dog Name', 'type': 'string'},\n 'pet_type': {'const': 'dog', 'title': 'Pet Type'},\n },\n 'required': ['pet_type', 'dog_name'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'title': 'Color'},\n 'pet_type': {'const': 'cat', 'title': 'Pet Type'},\n 'white_infos': {'title': 'White Infos', 'type': 'string'},\n },\n 'required': ['pet_type', 'color', 'white_infos'],\n 'title': 'WhiteCat',\n 'type': 'object',\n },\n },\n 'properties': {\n 'number': {'title': 'Number', 'type': 'integer'},\n 'pet': {\n 'discriminator': {\n 'mapping': {\n 'cat': {\n 'discriminator': {\n 'mapping': {\n 'black': {\n 'discriminator': {\n 'mapping': {\n 'height': '#/$defs/BlackCatWithHeight',\n 'weight': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n 'white': '#/$defs/WhiteCat',\n },\n 'propertyName': 'color',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {\n 'height': '#/$defs/BlackCatWithHeight',\n 'weight': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n {'$ref': '#/$defs/WhiteCat'},\n ],\n },\n 'dog': '#/$defs/Dog',\n },\n 'propertyName': 'pet_type',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {\n 'black': {\n 'discriminator': {\n 'mapping': {\n 'height': '#/$defs/BlackCatWithHeight',\n 'weight': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n 'white': '#/$defs/WhiteCat',\n },\n 'propertyName': 'color',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {\n 'height': '#/$defs/BlackCatWithHeight',\n 'weight': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n {'$ref': '#/$defs/WhiteCat'},\n ],\n },\n {'$ref': '#/$defs/Dog'},\n ],\n 'title': 'Pet',\n },\n },\n 'required': ['pet', 'number'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_literal_enum_test_discriminated_annotated_union_literal_enum.Model.number": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_literal_enum_test_discriminated_annotated_union_literal_enum.Model.number", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3033, "end_line": 3075, "span_ids": ["test_discriminated_annotated_union_literal_enum"], "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 test_discriminated_annotated_union_literal_enum():\n class PetType(Enum):\n cat = 'cat'\n dog = 'dog'\n\n class PetColor(str, Enum):\n black = 'black'\n white = 'white'\n\n class PetInfo(Enum):\n height = 0\n weight = 1\n\n class BlackCatWithHeight(BaseModel):\n pet_type: Literal[PetType.cat]\n color: Literal[PetColor.black]\n info: Literal[PetInfo.height]\n black_infos: str\n\n class BlackCatWithWeight(BaseModel):\n pet_type: Literal[PetType.cat]\n color: Literal[PetColor.black]\n info: Literal[PetInfo.weight]\n black_infos: str\n\n BlackCat = Annotated[Union[BlackCatWithHeight, BlackCatWithWeight], Field(discriminator='info')]\n\n class WhiteCat(BaseModel):\n pet_type: Literal[PetType.cat]\n color: Literal[PetColor.white]\n white_infos: str\n\n Cat = Annotated[Union[BlackCat, WhiteCat], Field(discriminator='color')]\n\n class Dog(BaseModel):\n pet_type: Literal[PetType.dog]\n dog_name: str\n\n Pet = Annotated[Union[Cat, Dog], Field(discriminator='pet_type')]\n\n class Model(BaseModel):\n pet: Pet\n number: 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_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_literal_enum.assert_Model_model_json_s_test_discriminated_annotated_union_literal_enum.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_annotated_union_literal_enum.assert_Model_model_json_s_test_discriminated_annotated_union_literal_enum.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3077, "end_line": 3210, "span_ids": ["test_discriminated_annotated_union_literal_enum"], "tokens": 1040}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_discriminated_annotated_union_literal_enum():\n # ... other code\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'BlackCatWithHeight': {\n 'properties': {\n 'black_infos': {'title': 'Black ' 'Infos', 'type': 'string'},\n 'color': {'const': 'black', 'title': 'Color'},\n 'info': {'const': 0, 'title': 'Info'},\n 'pet_type': {'const': 'cat', 'title': 'Pet ' 'Type'},\n },\n 'required': ['pet_type', 'color', 'info', 'black_infos'],\n 'title': 'BlackCatWithHeight',\n 'type': 'object',\n },\n 'BlackCatWithWeight': {\n 'properties': {\n 'black_infos': {'title': 'Black ' 'Infos', 'type': 'string'},\n 'color': {'const': 'black', 'title': 'Color'},\n 'info': {'const': 1, 'title': 'Info'},\n 'pet_type': {'const': 'cat', 'title': 'Pet ' 'Type'},\n },\n 'required': ['pet_type', 'color', 'info', 'black_infos'],\n 'title': 'BlackCatWithWeight',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {\n 'dog_name': {'title': 'Dog Name', 'type': 'string'},\n 'pet_type': {'const': 'dog', 'title': 'Pet Type'},\n },\n 'required': ['pet_type', 'dog_name'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'title': 'Color'},\n 'pet_type': {'const': 'cat', 'title': 'Pet Type'},\n 'white_infos': {'title': 'White Infos', 'type': 'string'},\n },\n 'required': ['pet_type', 'color', 'white_infos'],\n 'title': 'WhiteCat',\n 'type': 'object',\n },\n },\n 'properties': {\n 'number': {'title': 'Number', 'type': 'integer'},\n 'pet': {\n 'discriminator': {\n 'mapping': {\n 'cat': {\n 'discriminator': {\n 'mapping': {\n 'black': {\n 'discriminator': {\n 'mapping': {\n '0': '#/$defs/BlackCatWithHeight',\n '1': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n 'white': '#/$defs/WhiteCat',\n },\n 'propertyName': 'color',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {\n '0': '#/$defs/BlackCatWithHeight',\n '1': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n {'$ref': '#/$defs/WhiteCat'},\n ],\n },\n 'dog': '#/$defs/Dog',\n },\n 'propertyName': 'pet_type',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {\n 'black': {\n 'discriminator': {\n 'mapping': {\n '0': '#/$defs/BlackCatWithHeight',\n '1': '#/$defs/BlackCatWithWeight',\n },\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n 'white': '#/$defs/WhiteCat',\n },\n 'propertyName': 'color',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {'0': '#/$defs/BlackCatWithHeight', '1': '#/$defs/BlackCatWithWeight'},\n 'propertyName': 'info',\n },\n 'oneOf': [\n {'$ref': '#/$defs/BlackCatWithHeight'},\n {'$ref': '#/$defs/BlackCatWithWeight'},\n ],\n },\n {'$ref': '#/$defs/WhiteCat'},\n ],\n },\n {'$ref': '#/$defs/Dog'},\n ],\n 'title': 'Pet',\n },\n },\n 'required': ['pet', 'number'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_alias_same_test_alias_same.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_alias_same_test_alias_same.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3213, "end_line": 3261, "span_ids": ["test_alias_same"], "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": "def test_alias_same():\n class Cat(BaseModel):\n pet_type: Literal['cat'] = Field(alias='typeOfPet')\n c: str\n\n class Dog(BaseModel):\n pet_type: Literal['dog'] = Field(alias='typeOfPet')\n d: str\n\n class Model(BaseModel):\n pet: Union[Cat, Dog] = Field(discriminator='pet_type')\n number: int\n\n assert Model.model_json_schema() == {\n 'type': 'object',\n 'title': 'Model',\n 'properties': {\n 'number': {'title': 'Number', 'type': 'integer'},\n 'pet': {\n 'discriminator': {\n 'mapping': {'cat': '#/$defs/Cat', 'dog': '#/$defs/Dog'},\n 'propertyName': 'typeOfPet',\n },\n 'oneOf': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}],\n 'title': 'Pet',\n },\n },\n '$defs': {\n 'Cat': {\n 'properties': {\n 'c': {'title': 'C', 'type': 'string'},\n 'typeOfPet': {'const': 'cat', 'title': 'Typeofpet'},\n },\n 'required': ['typeOfPet', 'c'],\n 'title': 'Cat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {\n 'd': {'title': 'D', 'type': 'string'},\n 'typeOfPet': {'const': 'dog', 'title': 'Typeofpet'},\n },\n 'required': ['typeOfPet', 'd'],\n 'title': 'Dog',\n 'type': 'object',\n },\n },\n 'required': ['pet', 'number'],\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_pydantic__pydantic/tests/test_json_schema.py_test_nested_python_dataclasses_test_nested_python_dataclasses.assert_model_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_python_dataclasses_test_nested_python_dataclasses.assert_model_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3264, "end_line": 3298, "span_ids": ["test_nested_python_dataclasses"], "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 test_nested_python_dataclasses():\n \"\"\"\n Test schema generation for nested python dataclasses\n \"\"\"\n\n from dataclasses import dataclass as python_dataclass\n\n @python_dataclass\n class ChildModel:\n name: str\n\n @python_dataclass\n class NestedModel:\n \"\"\"\n Custom description\n \"\"\"\n\n # Note: the Custom description will not be preserved as this is a vanilla dataclass\n # This is the same behavior as in v1\n child: List[ChildModel]\n\n assert model_json_schema(dataclass(NestedModel)) == {\n '$defs': {\n 'ChildModel': {\n 'properties': {'name': {'title': 'Name', 'type': 'string'}},\n 'required': ['name'],\n 'title': 'ChildModel',\n 'type': 'object',\n }\n },\n 'properties': {'child': {'items': {'$ref': '#/$defs/ChildModel'}, 'title': 'Child', 'type': 'array'}},\n 'required': ['child'],\n 'title': 'NestedModel',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_union_in_list_test_discriminated_union_in_list.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_discriminated_union_in_list_test_discriminated_union_in_list.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3301, "end_line": 3388, "span_ids": ["test_discriminated_union_in_list"], "tokens": 686}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_discriminated_union_in_list():\n class BlackCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['black']\n black_name: str\n\n class WhiteCat(BaseModel):\n pet_type: Literal['cat']\n color: Literal['white']\n white_name: str\n\n Cat = Annotated[Union[BlackCat, WhiteCat], Field(discriminator='color')]\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n name: str\n\n Pet = Annotated[Union[Cat, Dog], Field(discriminator='pet_type')]\n\n class Model(BaseModel):\n pets: Pet\n n: int\n\n assert Model.model_json_schema() == {\n '$defs': {\n 'BlackCat': {\n 'properties': {\n 'black_name': {'title': 'Black Name', 'type': 'string'},\n 'color': {'const': 'black', 'title': 'Color'},\n 'pet_type': {'const': 'cat', 'title': 'Pet Type'},\n },\n 'required': ['pet_type', 'color', 'black_name'],\n 'title': 'BlackCat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {\n 'name': {'title': 'Name', 'type': 'string'},\n 'pet_type': {'const': 'dog', 'title': 'Pet Type'},\n },\n 'required': ['pet_type', 'name'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'title': 'Color'},\n 'pet_type': {'const': 'cat', 'title': 'Pet Type'},\n 'white_name': {'title': 'White Name', 'type': 'string'},\n },\n 'required': ['pet_type', 'color', 'white_name'],\n 'title': 'WhiteCat',\n 'type': 'object',\n },\n },\n 'properties': {\n 'n': {'title': 'N', 'type': 'integer'},\n 'pets': {\n 'discriminator': {\n 'mapping': {\n 'cat': {\n 'discriminator': {\n 'mapping': {'black': '#/$defs/BlackCat', 'white': '#/$defs/WhiteCat'},\n 'propertyName': 'color',\n },\n 'oneOf': [{'$ref': '#/$defs/BlackCat'}, {'$ref': '#/$defs/WhiteCat'}],\n },\n 'dog': '#/$defs/Dog',\n },\n 'propertyName': 'pet_type',\n },\n 'oneOf': [\n {\n 'discriminator': {\n 'mapping': {'black': '#/$defs/BlackCat', 'white': '#/$defs/WhiteCat'},\n 'propertyName': 'color',\n },\n 'oneOf': [{'$ref': '#/$defs/BlackCat'}, {'$ref': '#/$defs/WhiteCat'}],\n },\n {'$ref': '#/$defs/Dog'},\n ],\n 'title': 'Pets',\n },\n },\n 'required': ['pets', 'n'],\n 'title': 'Model',\n 'type': 'object',\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_pydantic__pydantic/tests/test_json_schema.py_test_model_with_type_attributes_test_secrets_schema.assert_Foobar_model_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_with_type_attributes_test_secrets_schema.assert_Foobar_model_json_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3391, "end_line": 3432, "span_ids": ["test_secrets_schema", "test_model_with_type_attributes"], "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 test_model_with_type_attributes():\n class Foo:\n a: float\n\n class Bar(BaseModel):\n b: int\n\n class Baz(BaseModel):\n a: Type[Foo]\n b: Type[Bar]\n\n assert Baz.model_json_schema() == {\n 'title': 'Baz',\n 'type': 'object',\n 'properties': {'a': {'title': 'A'}, 'b': {'title': 'B'}},\n 'required': ['a', 'b'],\n }\n\n\n@pytest.mark.parametrize('secret_cls', [SecretStr, SecretBytes])\n@pytest.mark.parametrize(\n 'field_kw,schema_kw',\n [\n # [{}, {}],\n [{'min_length': 6}, {'minLength': 6}],\n [{'max_length': 10}, {'maxLength': 10}],\n [{'min_length': 6, 'max_length': 10}, {'minLength': 6, 'maxLength': 10}],\n ],\n ids=['min-constraint', 'max-constraint', 'min-max-constraints'],\n)\ndef test_secrets_schema(secret_cls, field_kw, schema_kw):\n class Foobar(BaseModel):\n password: secret_cls = Field(**field_kw)\n\n assert Foobar.model_json_schema() == {\n 'title': 'Foobar',\n 'type': 'object',\n 'properties': {\n 'password': {'title': 'Password', 'type': 'string', 'writeOnly': True, 'format': 'password', **schema_kw}\n },\n 'required': ['password'],\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_pydantic__pydantic/tests/test_json_schema.py_test_override_generate_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_override_generate_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_json_schema.py", "file_name": "test_json_schema.py", "file_type": "text/x-python", "category": "test", "start_line": 3435, "end_line": 3462, "span_ids": ["test_override_generate_json_schema"], "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 test_override_generate_json_schema():\n class MyGenerateJsonSchema(GenerateJsonSchema):\n def generate(self, schema):\n json_schema = super().generate(schema)\n json_schema['$schema'] = self.schema_dialect\n return json_schema\n\n class MyBaseModel(BaseModel):\n @classmethod\n def model_json_schema(\n cls,\n by_alias: bool = True,\n ref_template: str = DEFAULT_REF_TEMPLATE,\n schema_generator: Type[GenerateJsonSchema] = MyGenerateJsonSchema,\n ) -> Dict[str, Any]:\n return super().model_json_schema(by_alias, ref_template, schema_generator)\n\n class MyModel(MyBaseModel):\n x: int\n\n assert MyModel.model_json_schema() == {\n '$schema': 'https://json-schema.org/draft/2020-12/schema',\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'MyModel',\n 'type': 'object',\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_pydantic__pydantic/tests/test_main.py_json_ultra_simple_model_fixture.return.UltraSimpleModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_json_ultra_simple_model_fixture.return.UltraSimpleModel", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 61, "span_ids": ["test_success", "imports", "ultra_simple_model_fixture"], "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 json\nimport platform\nimport re\nimport sys\nfrom collections import defaultdict\nfrom copy import deepcopy\nfrom enum import Enum\nfrom typing import (\n Any,\n Callable,\n ClassVar,\n Counter,\n DefaultDict,\n Dict,\n Generic,\n List,\n Mapping,\n Optional,\n Set,\n Type,\n TypeVar,\n get_type_hints,\n)\nfrom uuid import UUID, uuid4\n\nimport pytest\nfrom typing_extensions import Final, Literal\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n Extra,\n Field,\n PrivateAttr,\n PydanticUserError,\n SecretStr,\n ValidationError,\n ValidationInfo,\n constr,\n)\nfrom pydantic.decorators import field_validator\n\n\ndef test_success():\n # same as below but defined here so class definition occurs inside the test\n class Model(BaseModel):\n a: float\n b: int = 10\n\n m = Model(a=10.2)\n assert m.a == 10.2\n assert m.b == 10\n\n\n@pytest.fixture(name='UltraSimpleModel', scope='session')\ndef ultra_simple_model_fixture():\n class UltraSimpleModel(BaseModel):\n a: float\n b: int = 10\n\n return UltraSimpleModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_missing_test_ultra_simple_missing.assert_str_exc_info_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_missing_test_ultra_simple_missing.assert_str_exc_info_value", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 72, "span_ids": ["test_ultra_simple_missing"], "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 test_ultra_simple_missing(UltraSimpleModel):\n with pytest.raises(ValidationError) as exc_info:\n UltraSimpleModel()\n assert exc_info.value.errors() == [{'loc': ('a',), 'msg': 'Field required', 'type': 'missing', 'input': {}}]\n assert str(exc_info.value) == (\n '1 validation error for UltraSimpleModel\\n'\n 'a\\n'\n ' Field required [type=missing, input_value={}, input_type=dict]'\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_pydantic__pydantic/tests/test_main.py_test_ultra_simple_failed_test_ultra_simple_failed.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_failed_test_ultra_simple_failed.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 91, "span_ids": ["test_ultra_simple_failed"], "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 test_ultra_simple_failed(UltraSimpleModel):\n with pytest.raises(ValidationError) as exc_info:\n UltraSimpleModel(a='x', b='x')\n assert exc_info.value.errors() == [\n {\n 'type': 'float_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid number, unable to parse string as an number',\n 'input': 'x',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\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_pydantic__pydantic/tests/test_main.py_test_ultra_simple_repr_test_ultra_simple_repr.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_ultra_simple_repr_test_ultra_simple_repr.None_7", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 94, "end_line": 103, "span_ids": ["test_ultra_simple_repr"], "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 test_ultra_simple_repr(UltraSimpleModel):\n m = UltraSimpleModel(a=10.2)\n assert str(m) == 'a=10.2 b=10'\n assert repr(m) == 'UltraSimpleModel(a=10.2, b=10)'\n assert repr(m.model_fields['a']) == 'FieldInfo(annotation=float, required=True)'\n assert repr(m.model_fields['b']) == 'FieldInfo(annotation=int, required=False, default=10)'\n assert dict(m) == {'a': 10.2, 'b': 10}\n assert m.model_dump() == {'a': 10.2, 'b': 10}\n assert m.model_dump_json() == '{\"a\":10.2,\"b\":10}'\n assert str(m) == 'a=10.2 b=10'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_field_test_nullable_strings_success.assert_m_required_bytes_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_field_test_nullable_strings_success.assert_m_required_bytes_n", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 106, "end_line": 147, "span_ids": ["test_comparing", "test_nullable_strings_success", "test_default_factory_field", "none_check_model_fix"], "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 test_default_factory_field():\n def myfunc():\n return 1\n\n class Model(BaseModel):\n a: int = Field(default_factory=myfunc)\n\n m = Model()\n assert str(m) == 'a=1'\n assert repr(m.model_fields['a']) == 'FieldInfo(annotation=int, required=False, default_factory=myfunc)'\n assert dict(m) == {'a': 1}\n assert m.model_dump_json() == '{\"a\":1}'\n\n\ndef test_comparing(UltraSimpleModel):\n m = UltraSimpleModel(a=10.2, b='100')\n assert m.model_dump() == {'a': 10.2, 'b': 100}\n assert m != {'a': 10.2, 'b': 100}\n assert m == UltraSimpleModel(a=10.2, b=100)\n\n\n@pytest.fixture(scope='session', name='NoneCheckModel')\ndef none_check_model_fix():\n class NoneCheckModel(BaseModel):\n existing_str_value: str = 'foo'\n required_str_value: str = ...\n required_str_none_value: Optional[str] = ...\n existing_bytes_value: bytes = b'foo'\n required_bytes_value: bytes = ...\n required_bytes_none_value: Optional[bytes] = ...\n\n return NoneCheckModel\n\n\ndef test_nullable_strings_success(NoneCheckModel):\n m = NoneCheckModel(\n required_str_value='v1', required_str_none_value=None, required_bytes_value='v2', required_bytes_none_value=None\n )\n assert m.required_str_value == 'v1'\n assert m.required_str_none_value is None\n assert m.required_bytes_value == b'v2'\n assert m.required_bytes_none_value 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_pydantic__pydantic/tests/test_main.py_test_nullable_strings_fails_test_nullable_strings_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_nullable_strings_fails_test_nullable_strings_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 150, "end_line": 171, "span_ids": ["test_nullable_strings_fails"], "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 test_nullable_strings_fails(NoneCheckModel):\n with pytest.raises(ValidationError) as exc_info:\n NoneCheckModel(\n required_str_value=None,\n required_str_none_value=None,\n required_bytes_value=None,\n required_bytes_none_value=None,\n )\n assert exc_info.value.errors() == [\n {\n 'type': 'string_type',\n 'loc': ('required_str_value',),\n 'msg': 'Input should be a valid string',\n 'input': None,\n },\n {\n 'type': 'bytes_type',\n 'loc': ('required_bytes_value',),\n 'msg': 'Input should be a valid bytes',\n 'input': None,\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_pydantic__pydantic/tests/test_main.py_parent_sub_model_fixture_test_forbidden_extra_success.assert_m_foo_whatever": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_parent_sub_model_fixture_test_forbidden_extra_success.assert_m_foo_whatever", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 174, "end_line": 240, "span_ids": ["test_parent_sub_model_fails", "test_parent_sub_model", "test_allow_extra_repr", "test_not_required", "test_forbidden_extra_success", "parent_sub_model_fixture", "test_allow_extra"], "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": "@pytest.fixture(name='ParentModel', scope='session')\ndef parent_sub_model_fixture():\n class UltraSimpleModel(BaseModel):\n a: float\n b: int = 10\n\n class ParentModel(BaseModel):\n grape: bool\n banana: UltraSimpleModel\n\n return ParentModel\n\n\ndef test_parent_sub_model(ParentModel):\n m = ParentModel(grape=1, banana={'a': 1})\n assert m.grape is True\n assert m.banana.a == 1.0\n assert m.banana.b == 10\n assert repr(m) == 'ParentModel(grape=True, banana=UltraSimpleModel(a=1.0, b=10))'\n\n\ndef test_parent_sub_model_fails(ParentModel):\n with pytest.raises(ValidationError):\n ParentModel(grape=1, banana=123)\n\n\ndef test_not_required():\n class Model(BaseModel):\n a: float = None\n\n assert Model(a=12.2).a == 12.2\n assert Model().a is None\n with pytest.raises(ValidationError) as exc_info:\n Model(a=None)\n assert exc_info.value.errors() == [\n {\n 'type': 'float_type',\n 'loc': ('a',),\n 'msg': 'Input should be a valid number',\n 'input': None,\n },\n ]\n\n\ndef test_allow_extra():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.allow)\n a: float = ...\n\n assert Model(a='10.2', b=12).model_dump() == {'a': 10.2, 'b': 12}\n\n\ndef test_allow_extra_repr():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.allow)\n a: float = ...\n\n assert str(Model(a='10.2', b=12)) == 'a=10.2 b=12'\n\n\ndef test_forbidden_extra_success():\n class ForbiddenExtra(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n foo: str = 'whatever'\n\n m = ForbiddenExtra()\n assert m.foo == 'whatever'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_forbidden_extra_fails_test_forbidden_extra_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_forbidden_extra_fails_test_forbidden_extra_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 243, "end_line": 263, "span_ids": ["test_forbidden_extra_fails"], "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 test_forbidden_extra_fails():\n class ForbiddenExtra(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n foo: str = 'whatever'\n\n with pytest.raises(ValidationError) as exc_info:\n ForbiddenExtra(foo='ok', bar='wrong', spam='xx')\n assert exc_info.value.errors() == [\n {\n 'type': 'extra_forbidden',\n 'loc': ('bar',),\n 'msg': 'Extra inputs are not permitted',\n 'input': 'wrong',\n },\n {\n 'type': 'extra_forbidden',\n 'loc': ('spam',),\n 'msg': 'Extra inputs are not permitted',\n 'input': 'xx',\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_pydantic__pydantic/tests/test_main.py_test_assign_extra_no_validate_test_field_order.assert_list_Model_model_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_assign_extra_no_validate_test_field_order.assert_list_Model_model_f", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 266, "end_line": 364, "span_ids": ["test_field_order", "test_set_attr_invalid", "test_any", "test_assign_extra_validate", "test_population_by_field_name", "test_extra_ignored", "test_set_attr", "test_extra_allowed", "test_assign_extra_no_validate"], "tokens": 686}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_assign_extra_no_validate():\n class Model(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n a: float\n\n model = Model(a=0.2)\n with pytest.raises(ValidationError, match=r\"b\\s+Object has no attribute 'b'\"):\n model.b = 2\n\n\ndef test_assign_extra_validate():\n class Model(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n a: float\n\n model = Model(a=0.2)\n with pytest.raises(ValidationError, match=r\"b\\s+Object has no attribute 'b'\"):\n model.b = 2\n\n\ndef test_extra_allowed():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.allow)\n a: float\n\n model = Model(a=0.2, b=0.1)\n assert model.b == 0.1\n\n assert not hasattr(model, 'c')\n model.c = 1\n assert hasattr(model, 'c')\n assert model.c == 1\n\n\ndef test_extra_ignored():\n class Model(BaseModel):\n model_config = ConfigDict(extra=Extra.ignore)\n a: float\n\n model = Model(a=0.2, b=0.1)\n assert not hasattr(model, 'b')\n\n with pytest.raises(ValueError, match='\"Model\" object has no field \"c\"'):\n model.c = 1\n\n\ndef test_set_attr(UltraSimpleModel):\n m = UltraSimpleModel(a=10.2)\n assert m.model_dump() == {'a': 10.2, 'b': 10}\n\n m.b = 20\n assert m.model_dump() == {'a': 10.2, 'b': 20}\n\n\ndef test_set_attr_invalid():\n class UltraSimpleModel(BaseModel):\n a: float = ...\n b: int = 10\n\n m = UltraSimpleModel(a=10.2)\n assert m.model_dump() == {'a': 10.2, 'b': 10}\n\n with pytest.raises(ValueError) as exc_info:\n m.c = 20\n assert '\"UltraSimpleModel\" object has no field \"c\"' in exc_info.value.args[0]\n\n\ndef test_any():\n class AnyModel(BaseModel):\n a: Any = 10\n b: object = 20\n\n m = AnyModel()\n assert m.a == 10\n assert m.b == 20\n\n m = AnyModel(a='foobar', b='barfoo')\n assert m.a == 'foobar'\n assert m.b == 'barfoo'\n\n\ndef test_population_by_field_name():\n class Model(BaseModel):\n model_config = ConfigDict(populate_by_name=True)\n a: str = Field(alias='_a')\n\n assert Model(a='different').a == 'different'\n assert Model(a='different').model_dump() == {'a': 'different'}\n assert Model(a='different').model_dump(by_alias=True) == {'_a': 'different'}\n\n\ndef test_field_order():\n class Model(BaseModel):\n c: float\n b: int = 10\n a: str\n d: dict = {}\n\n assert list(Model.model_fields.keys()) == ['c', 'b', 'a', '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_pydantic__pydantic/tests/test_main.py_test_required_test_required.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_required_test_required.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 367, "end_line": 378, "span_ids": ["test_required"], "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 test_required():\n # same as below but defined here so class definition occurs inside the test\n class Model(BaseModel):\n a: float\n b: int = 10\n\n m = Model(a=10.2)\n assert m.model_dump() == dict(a=10.2, b=10)\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors() == [{'type': 'missing', 'loc': ('a',), 'msg': 'Field required', 'input': {}}]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mutability_test_frozen_with_unhashable_fields_are_not_hashable.assert_unhashable_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mutability_test_frozen_with_unhashable_fields_are_not_hashable.assert_unhashable_type_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 381, "end_line": 458, "span_ids": ["test_with_declared_hash", "test_frozen_with_hashable_fields_are_hashable", "test_frozen_model", "test_mutability", "test_not_frozen_are_not_hashable", "test_frozen_with_unhashable_fields_are_not_hashable"], "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 test_mutability():\n class TestModel(BaseModel):\n a: int = 10\n\n model_config = ConfigDict(extra=Extra.forbid, frozen=False)\n\n m = TestModel()\n\n assert m.a == 10\n m.a = 11\n assert m.a == 11\n\n\ndef test_frozen_model():\n class FrozenModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid, frozen=True)\n\n a: int = 10\n\n m = FrozenModel()\n\n assert m.a == 10\n with pytest.raises(TypeError) as exc_info:\n m.a = 11\n assert '\"FrozenModel\" is frozen and does not support item assignment' in exc_info.value.args[0]\n\n\ndef test_not_frozen_are_not_hashable():\n class TestModel(BaseModel):\n a: int = 10\n\n m = TestModel()\n with pytest.raises(TypeError) as exc_info:\n hash(m)\n assert \"unhashable type: 'TestModel'\" in exc_info.value.args[0]\n\n\ndef test_with_declared_hash():\n class Foo(BaseModel):\n x: int\n\n def __hash__(self):\n return self.x**2\n\n class Bar(Foo):\n y: int\n\n def __hash__(self):\n return self.y**3\n\n class Buz(Bar):\n z: int\n\n assert hash(Foo(x=2)) == 4\n assert hash(Bar(x=2, y=3)) == 27\n assert hash(Buz(x=2, y=3, z=4)) == 27\n\n\ndef test_frozen_with_hashable_fields_are_hashable():\n class TestModel(BaseModel):\n model_config = ConfigDict(frozen=True)\n a: int = 10\n\n m = TestModel()\n assert m.__hash__ is not None\n assert isinstance(hash(m), int)\n\n\ndef test_frozen_with_unhashable_fields_are_not_hashable():\n class TestModel(BaseModel):\n model_config = ConfigDict(frozen=True)\n a: int = 10\n y: List[int] = [1, 2, 3]\n\n m = TestModel()\n with pytest.raises(TypeError) as exc_info:\n hash(m)\n assert \"unhashable type: 'list'\" in exc_info.value.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_pydantic__pydantic/tests/test_main.py_test_hash_function_give_different_result_for_different_object_test_hash_function_give_different_result_for_different_object.assert_hash_m_hash_m4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_hash_function_give_different_result_for_different_object_test_hash_function_give_different_result_for_different_object.assert_hash_m_hash_m4", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 461, "end_line": 479, "span_ids": ["test_hash_function_give_different_result_for_different_object"], "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 test_hash_function_give_different_result_for_different_object():\n class TestModel(BaseModel):\n model_config = ConfigDict(frozen=True)\n\n a: int = 10\n\n m = TestModel()\n m2 = TestModel()\n m3 = TestModel(a=11)\n assert hash(m) == hash(m2)\n assert hash(m) != hash(m3)\n\n # Redefined `TestModel`\n class TestModel(BaseModel):\n model_config = ConfigDict(frozen=True)\n a: int = 10\n\n m4 = TestModel()\n assert hash(m) != hash(m4)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_validate_assignment_fixture_test_validating_assignment_pass.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_validate_assignment_fixture_test_validating_assignment_pass.None_3", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 482, "end_line": 499, "span_ids": ["test_validating_assignment_pass", "validate_assignment_fixture"], "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": "@pytest.fixture(name='ValidateAssignmentModel', scope='session')\ndef validate_assignment_fixture():\n class ValidateAssignmentModel(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n a: int = 2\n b: constr(min_length=1)\n\n return ValidateAssignmentModel\n\n\ndef test_validating_assignment_pass(ValidateAssignmentModel):\n p = ValidateAssignmentModel(a=5, b='hello')\n p.a = 2\n assert p.a == 2\n assert p.model_dump() == {'a': 2, 'b': 'hello'}\n p.b = 'hi'\n assert p.b == 'hi'\n assert p.model_dump() == {'a': 2, 'b': 'hi'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validating_assignment_fail_test_enum_values.assert_isinstance_m_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validating_assignment_fail_test_enum_values.assert_isinstance_m_foo_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 502, "end_line": 539, "span_ids": ["test_validating_assignment_fail", "test_enum_values"], "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 test_validating_assignment_fail(ValidateAssignmentModel):\n p = ValidateAssignmentModel(a=5, b='hello')\n\n with pytest.raises(ValidationError) as exc_info:\n p.a = 'b'\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'b',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n p.b = ''\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_short',\n 'loc': ('b',),\n 'msg': 'String should have at least 1 characters',\n 'input': '',\n 'ctx': {'min_length': 1},\n }\n ]\n\n\ndef test_enum_values():\n FooEnum = Enum('FooEnum', {'foo': 'foo', 'bar': 'bar'})\n\n class Model(BaseModel):\n model_config = ConfigDict(use_enum_values=True)\n foo: FooEnum\n\n m = Model(foo='foo')\n # this is the actual value, so has not \"values\" field\n assert m.foo == FooEnum.foo\n assert isinstance(m.foo, FooEnum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_literal_enum_values_test_literal_enum_values.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_literal_enum_values_test_literal_enum_values.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 542, "end_line": 567, "span_ids": ["test_literal_enum_values"], "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 test_literal_enum_values():\n FooEnum = Enum('FooEnum', {'foo': 'foo_value', 'bar': 'bar_value'})\n\n class Model(BaseModel):\n baz: Literal[FooEnum.foo]\n boo: str = 'hoo'\n model_config = ConfigDict(use_enum_values=True)\n\n m = Model(baz=FooEnum.foo)\n assert m.model_dump() == {'baz': FooEnum.foo, 'boo': 'hoo'}\n assert m.model_dump(mode='json') == {'baz': 'foo_value', 'boo': 'hoo'}\n assert m.baz.value == 'foo_value'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(baz=FooEnum.bar)\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'literal_error',\n 'loc': ('baz',),\n 'msg': \"Input should be \",\n 'input': FooEnum.bar,\n 'ctx': {'expected': \"\"},\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_pydantic__pydantic/tests/test_main.py_test_enum_raw_OtherClass.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_enum_raw_OtherClass.pass", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 570, "end_line": 617, "span_ids": ["ArbitraryType", "OtherClass", "test_set_tuple_values", "test_enum_raw", "test_default_copy", "test_arbitrary_type_allowed_validation_success"], "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 test_enum_raw():\n FooEnum = Enum('FooEnum', {'foo': 'foo', 'bar': 'bar'})\n\n class Model(BaseModel):\n foo: FooEnum = None\n\n m = Model(foo='foo')\n assert isinstance(m.foo, FooEnum)\n assert m.foo != 'foo'\n assert m.foo.value == 'foo'\n\n\ndef test_set_tuple_values():\n class Model(BaseModel):\n foo: set\n bar: tuple\n\n m = Model(foo=['a', 'b'], bar=['c', 'd'])\n assert m.foo == {'a', 'b'}\n assert m.bar == ('c', 'd')\n assert m.model_dump() == {'foo': {'a', 'b'}, 'bar': ('c', 'd')}\n\n\ndef test_default_copy():\n class User(BaseModel):\n friends: List[int] = Field(default_factory=lambda: [])\n\n u1 = User()\n u2 = User()\n assert u1.friends is not u2.friends\n\n\nclass ArbitraryType:\n pass\n\n\ndef test_arbitrary_type_allowed_validation_success():\n class ArbitraryTypeAllowedModel(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n t: ArbitraryType\n\n arbitrary_type_instance = ArbitraryType()\n m = ArbitraryTypeAllowedModel(t=arbitrary_type_instance)\n assert m.t == arbitrary_type_instance\n\n\nclass OtherClass:\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_pydantic__pydantic/tests/test_main.py_test_arbitrary_type_allowed_validation_fails_test_arbitrary_type_allowed_validation_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_arbitrary_type_allowed_validation_fails_test_arbitrary_type_allowed_validation_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 620, "end_line": 637, "span_ids": ["test_arbitrary_type_allowed_validation_fails"], "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 test_arbitrary_type_allowed_validation_fails():\n class ArbitraryTypeAllowedModel(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n t: ArbitraryType\n\n input_value = OtherClass()\n with pytest.raises(ValidationError) as exc_info:\n ArbitraryTypeAllowedModel(t=input_value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'is_instance_of',\n 'loc': ('t',),\n 'msg': 'Input should be an instance of ArbitraryType',\n 'input': input_value,\n 'ctx': {'class': 'ArbitraryType'},\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_pydantic__pydantic/tests/test_main.py_test_arbitrary_types_not_allowed_test_type_type_subclass_validation_success.assert_m_t_arbitrary_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_arbitrary_types_not_allowed_test_type_type_subclass_validation_success.assert_m_t_arbitrary_t", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 640, "end_line": 667, "span_ids": ["test_type_type_subclass_validation_success", "test_arbitrary_types_not_allowed", "type_type_model_fixture", "test_type_type_validation_success"], "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 test_arbitrary_types_not_allowed():\n with pytest.raises(TypeError, match='Unable to generate pydantic-core schema for str:\n return cls.__name__\n\n assert Model.class_name == 'Model'\n assert Model().class_name == 'Model'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_iteration_test_model_iteration.assert_dict_m_c_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_iteration_test_model_iteration.assert_dict_m_c_3", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 888, "end_line": 900, "span_ids": ["test_model_iteration"], "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 test_model_iteration():\n class Foo(BaseModel):\n a: int = 1\n b: int = 2\n\n class Bar(BaseModel):\n c: int\n d: Foo\n\n m = Bar(c=3, d={})\n assert m.model_dump() == {'c': 3, 'd': {'a': 1, 'b': 2}}\n assert list(m) == [('c', 3), ('d', Foo())]\n assert dict(m) == {'c': 3, 'd': 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_pydantic__pydantic/tests/test_main.py_test_model_export_nested_list_test_model_export_nested_list.if_raises_match_is_not_No.else_.assert_exclude_origina": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_nested_list_test_model_export_nested_list.if_raises_match_is_not_No.else_.assert_exclude_origina", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 903, "end_line": 991, "span_ids": ["test_model_export_nested_list"], "tokens": 821}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'exclude,expected,raises_match',\n [\n pytest.param(\n None,\n {'c': 3, 'foos': [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]},\n None,\n id='exclude nothing',\n ),\n pytest.param(\n {'foos': {0: {'a'}, 1: {'a'}}},\n {'c': 3, 'foos': [{'b': 2}, {'b': 4}]},\n None,\n id='excluding fields of indexed list items',\n ),\n pytest.param(\n {'foos': {'a'}},\n {'c': 3, 'foos': [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]},\n None,\n id='Trying to exclude string keys on list field should be ignored (1)',\n ),\n pytest.param(\n {'foos': {0: ..., 'a': ...}},\n {'c': 3, 'foos': [{'a': 3, 'b': 4}]},\n None,\n id='Trying to exclude string keys on list field should be ignored (2)',\n ),\n pytest.param(\n {'foos': {0: 1}},\n TypeError,\n '`exclude` argument must be a set or dict',\n id='value as int should be an error',\n ),\n pytest.param(\n {'foos': {'__all__': {1}}},\n {'c': 3, 'foos': [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]},\n None,\n id='excluding int in dict should have no effect',\n ),\n pytest.param(\n {'foos': {'__all__': {'a'}}},\n {'c': 3, 'foos': [{'b': 2}, {'b': 4}]},\n None,\n id='using \"__all__\" to exclude specific nested field',\n ),\n pytest.param(\n {'foos': {0: {'b'}, '__all__': {'a'}}},\n {'c': 3, 'foos': [{}, {'b': 4}]},\n None,\n id='using \"__all__\" to exclude specific nested field in combination with more specific exclude',\n ),\n pytest.param(\n {'foos': {'__all__'}},\n {'c': 3, 'foos': []},\n None,\n id='using \"__all__\" to exclude all list items',\n ),\n pytest.param(\n {'foos': {1, '__all__'}},\n {'c': 3, 'foos': []},\n None,\n id='using \"__all__\" and other items should get merged together, still excluding all list items',\n ),\n pytest.param(\n {'foos': {-1: {'b'}}},\n {'c': 3, 'foos': [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]},\n None,\n id='negative indexes are ignored',\n ),\n ],\n)\ndef test_model_export_nested_list(exclude, expected, raises_match):\n class Foo(BaseModel):\n a: int = 1\n b: int = 2\n\n class Bar(BaseModel):\n c: int\n foos: List[Foo]\n\n m = Bar(c=3, foos=[Foo(a=1, b=2), Foo(a=3, b=4)])\n\n if raises_match is not None:\n with pytest.raises(expected, match=raises_match):\n m.model_dump(exclude=exclude)\n else:\n original_exclude = deepcopy(exclude)\n assert m.model_dump(exclude=exclude) == expected\n assert exclude == original_exclude", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_dict_exclusion_test_model_export_dict_exclusion.assert_excludes_origin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_dict_exclusion_test_model_export_dict_exclusion.assert_excludes_origin", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 994, "end_line": 1019, "span_ids": ["test_model_export_dict_exclusion"], "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": "@pytest.mark.parametrize(\n 'excludes,expected',\n [\n pytest.param(\n {'bars': {0}},\n {'a': 1, 'bars': [{'y': 2}, {'w': -1, 'z': 3}]},\n id='excluding first item from list field using index',\n ),\n pytest.param({'bars': {'__all__'}}, {'a': 1, 'bars': []}, id='using \"__all__\" to exclude all list items'),\n pytest.param(\n {'bars': {'__all__': {'w'}}},\n {'a': 1, 'bars': [{'x': 1}, {'y': 2}, {'z': 3}]},\n id='exclude single dict key from all list items',\n ),\n ],\n)\ndef test_model_export_dict_exclusion(excludes, expected):\n class Foo(BaseModel):\n a: int = 1\n bars: List[Dict[str, int]]\n\n m = Foo(a=1, bars=[{'w': 0, 'x': 1}, {'y': 2}, {'w': -1, 'z': 3}])\n\n original_excludes = deepcopy(excludes)\n assert m.model_dump(exclude=excludes) == expected\n assert excludes == original_excludes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_field_exclude_test_field_exclude.assert_my_user_model_dump": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_field_exclude_test_field_exclude.assert_my_user_model_dump", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1022, "end_line": 1035, "span_ids": ["test_field_exclude"], "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 test_field_exclude():\n class User(BaseModel):\n _priv: int = PrivateAttr()\n id: int\n username: str\n password: SecretStr = Field(exclude=True)\n hobbies: List[str]\n\n my_user = User(id=42, username='JohnDoe', password='hashedpassword', hobbies=['scuba diving'])\n\n my_user._priv = 13\n assert my_user.id == 42\n assert my_user.password.get_secret_value() == 'hashedpassword'\n assert my_user.model_dump() == {'id': 42, 'username': 'JohnDoe', 'hobbies': ['scuba diving']}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_never_test_revalidate_instances_never.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_never_test_revalidate_instances_never.None_3", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1038, "end_line": 1060, "span_ids": ["test_revalidate_instances_never"], "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": "def test_revalidate_instances_never():\n class User(BaseModel):\n hobbies: List[str]\n\n my_user = User(hobbies=['scuba diving'])\n\n class Transaction(BaseModel):\n user: User\n\n t = Transaction(user=my_user)\n\n assert t.user is my_user\n assert t.user.hobbies is my_user.hobbies\n\n class SubUser(User):\n sins: List[str]\n\n my_sub_user = SubUser(hobbies=['scuba diving'], sins=['lying'])\n\n t = Transaction(user=my_sub_user)\n\n assert t.user is my_sub_user\n assert t.user.hobbies is my_sub_user.hobbies", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_sub_instances_test_revalidate_instances_sub_instances.assert_not_hasattr_t_user": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_sub_instances_test_revalidate_instances_sub_instances.assert_not_hasattr_t_user", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1063, "end_line": 1086, "span_ids": ["test_revalidate_instances_sub_instances"], "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 test_revalidate_instances_sub_instances():\n class User(BaseModel, revalidate_instances='subclass-instances'):\n hobbies: List[str]\n\n my_user = User(hobbies=['scuba diving'])\n\n class Transaction(BaseModel):\n user: User\n\n t = Transaction(user=my_user)\n\n assert t.user is my_user\n assert t.user.hobbies is my_user.hobbies\n\n class SubUser(User):\n sins: List[str]\n\n my_sub_user = SubUser(hobbies=['scuba diving'], sins=['lying'])\n\n t = Transaction(user=my_sub_user)\n\n assert t.user is not my_sub_user\n assert t.user.hobbies is not my_sub_user.hobbies\n assert not hasattr(t.user, 'sins')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_always_test_revalidate_instances_always.assert_not_hasattr_t_user": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_revalidate_instances_always_test_revalidate_instances_always.assert_not_hasattr_t_user", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1089, "end_line": 1112, "span_ids": ["test_revalidate_instances_always"], "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 test_revalidate_instances_always():\n class User(BaseModel, revalidate_instances='always'):\n hobbies: List[str]\n\n my_user = User(hobbies=['scuba diving'])\n\n class Transaction(BaseModel):\n user: User\n\n t = Transaction(user=my_user)\n\n assert t.user is not my_user\n assert t.user.hobbies is not my_user.hobbies\n\n class SubUser(User):\n sins: List[str]\n\n my_sub_user = SubUser(hobbies=['scuba diving'], sins=['lying'])\n\n t = Transaction(user=my_sub_user)\n\n assert t.user is not my_sub_user\n assert t.user.hobbies is not my_sub_user.hobbies\n assert not hasattr(t.user, 'sins')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_copy_on_model_validation_warning_test_copy_on_model_validation_warning.assert_t_user_hobbies_is_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_copy_on_model_validation_warning_test_copy_on_model_validation_warning.assert_t_user_hobbies_is_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1115, "end_line": 1136, "span_ids": ["test_copy_on_model_validation_warning"], "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": "@pytest.mark.skip(reason='not implemented')\n@pytest.mark.parametrize('comv_value', [True, False])\ndef test_copy_on_model_validation_warning(comv_value):\n class User(BaseModel):\n # True interpreted as 'shallow', False interpreted as 'none'\n model_config = ConfigDict(copy_on_model_validation=comv_value)\n\n hobbies: List[str]\n\n my_user = User(hobbies=['scuba diving'])\n\n class Transaction(BaseModel):\n user: User\n\n with pytest.warns(DeprecationWarning, match=\"`copy_on_model_validation` should be a string: 'deep', 'shallow' or\"):\n t = Transaction(user=my_user)\n\n if comv_value:\n assert t.user is not my_user\n else:\n assert t.user is my_user\n assert t.user.hobbies is my_user.hobbies", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validation_deep_copy_test_validation_deep_copy.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validation_deep_copy_test_validation_deep_copy.None_1", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1139, "end_line": 1154, "span_ids": ["test_validation_deep_copy"], "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": "@pytest.mark.skip(reason='not implemented')\ndef test_validation_deep_copy():\n \"\"\"By default, Config.copy_on_model_validation should do a deep copy\"\"\"\n\n class A(BaseModel):\n model_config = ConfigDict(copy_on_model_validation='deep')\n name: str\n\n class B(BaseModel):\n list_a: List[A]\n\n a = A(name='a')\n b = B(list_a=[a])\n assert b.list_a == [A(name='a')]\n a.name = 'b'\n assert b.list_a == [A(name='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_pydantic__pydantic/tests/test_main.py_test_model_export_exclusion_with_fields_and_config_test_model_export_exclusion_with_fields_and_config.assert_m_model_dump_exclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_exclusion_with_fields_and_config_test_model_export_exclusion_with_fields_and_config.assert_m_model_dump_exclu", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1157, "end_line": 1216, "span_ids": ["test_model_export_exclusion_with_fields_and_config"], "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": "@pytest.mark.skip(reason='not implemented')\n@pytest.mark.parametrize(\n 'kinds',\n [\n {'sub_fields', 'model_fields', 'model_config', 'sub_config', 'combined_config'},\n {'sub_fields', 'model_fields', 'combined_config'},\n {'sub_fields', 'model_fields'},\n {'combined_config'},\n {'model_config', 'sub_config'},\n {'model_config', 'sub_fields'},\n {'model_fields', 'sub_config'},\n ],\n)\n@pytest.mark.parametrize(\n 'exclude,expected',\n [\n (None, {'a': 0, 'c': {'a': [3, 5], 'c': 'foobar'}, 'd': {'c': 'foobar'}}),\n ({'c', 'd'}, {'a': 0}),\n ({'a': ..., 'c': ..., 'd': {'a': ..., 'c': ...}}, {'d': {}}),\n ],\n)\ndef test_model_export_exclusion_with_fields_and_config(kinds, exclude, expected):\n \"\"\"Test that exporting models with fields using the export parameter works.\"\"\"\n\n class ChildConfig:\n pass\n\n if 'sub_config' in kinds:\n ChildConfig.fields = {'b': {'exclude': ...}, 'a': {'exclude': {1}}}\n\n class ParentConfig:\n pass\n\n if 'combined_config' in kinds:\n ParentConfig.fields = {\n 'b': {'exclude': ...},\n 'c': {'exclude': {'b': ..., 'a': {1}}},\n 'd': {'exclude': {'a': ..., 'b': ...}},\n }\n\n elif 'model_config' in kinds:\n ParentConfig.fields = {'b': {'exclude': ...}, 'd': {'exclude': {'a'}}}\n\n class Sub(BaseModel):\n a: List[int] = Field([3, 4, 5], exclude={1} if 'sub_fields' in kinds else None)\n b: int = Field(4, exclude=... if 'sub_fields' in kinds else None)\n c: str = 'foobar'\n\n Config = ChildConfig\n\n class Model(BaseModel):\n a: int = 0\n b: int = Field(2, exclude=... if 'model_fields' in kinds else None)\n c: Sub = Sub()\n d: Sub = Field(Sub(), exclude={'a'} if 'model_fields' in kinds else None)\n\n Config = ParentConfig\n\n m = Model()\n assert m.model_dump(exclude=exclude) == expected, 'Unexpected model export 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_pydantic__pydantic/tests/test_main.py_test_model_export_exclusion_inheritance_test_model_export_exclusion_inheritance.assert_actual_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_exclusion_inheritance_test_model_export_exclusion_inheritance.assert_actual_expected", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1219, "end_line": 1240, "span_ids": ["test_model_export_exclusion_inheritance"], "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": "@pytest.mark.skip(reason='not implemented')\ndef test_model_export_exclusion_inheritance():\n class Sub(BaseModel):\n s1: str = 'v1'\n s2: str = 'v2'\n s3: str = 'v3'\n s4: str = Field('v4', exclude=...)\n\n class Parent(BaseModel):\n model_config = ConfigDict(fields={'a': {'exclude': ...}, 's': {'exclude': {'s1'}}})\n a: int\n b: int = Field(..., exclude=...)\n c: int\n d: int\n s: Sub = Sub()\n\n class Child(Parent):\n model_config = ConfigDict(fields={'c': {'exclude': ...}, 's': {'exclude': {'s2'}}})\n\n actual = Child(a=0, b=1, c=2, d=3).model_dump()\n expected = {'d': 3, 's': {'s3': 'v3'}}\n assert actual == expected, 'Unexpected model export 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_pydantic__pydantic/tests/test_main.py_test_model_export_with_true_instead_of_ellipsis_test_model_export_with_true_instead_of_ellipsis.assert_m_model_dump_exclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_with_true_instead_of_ellipsis_test_model_export_with_true_instead_of_ellipsis.assert_m_model_dump_exclu", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1243, "end_line": 1256, "span_ids": ["test_model_export_with_true_instead_of_ellipsis"], "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": "@pytest.mark.skip(reason='not implemented')\ndef test_model_export_with_true_instead_of_ellipsis():\n class Sub(BaseModel):\n s1: int = 1\n\n class Model(BaseModel):\n model_config = ConfigDict(fields={'c': {'exclude': True}})\n a: int = 2\n b: int = Field(3, exclude=True)\n c: int = Field(4)\n s: Sub = Sub()\n\n m = Model()\n assert m.model_dump(exclude={'s': True}) == {'a': 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_pydantic__pydantic/tests/test_main.py_test_model_export_inclusion_test_model_export_inclusion.assert_actual_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_inclusion_test_model_export_inclusion.assert_actual_expected", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1259, "end_line": 1283, "span_ids": ["test_model_export_inclusion"], "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": "@pytest.mark.skip(reason='not implemented')\ndef test_model_export_inclusion():\n class Sub(BaseModel):\n s1: str = 'v1'\n s2: str = 'v2'\n s3: str = 'v3'\n s4: str = 'v4'\n\n class Model(BaseModel):\n model_config = ConfigDict(\n fields={'a': {'include': {'s2', 's1', 's3'}}, 'b': {'include': {'s1', 's2', 's3', 's4'}}}\n )\n a: Sub = Sub()\n b: Sub = Field(Sub(), include={'s1'})\n c: Sub = Field(Sub(), include={'s1', 's2'})\n\n Model.model_fields['a'].field_info.include == {'s1': ..., 's2': ..., 's3': ...}\n Model.model_fields['b'].field_info.include == {'s1': ...}\n Model.model_fields['c'].field_info.include == {'s1': ..., 's2': ...}\n\n actual = Model().model_dump(include={'a': {'s3', 's4'}, 'b': ..., 'c': ...})\n # s1 included via field, s2 via config and s3 via .dict call:\n expected = {'a': {'s3': 'v3'}, 'b': {'s1': 'v1'}, 'c': {'s1': 'v1', 's2': 'v2'}}\n\n assert actual == expected, 'Unexpected model export 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_pydantic__pydantic/tests/test_main.py_test_model_export_inclusion_inheritance_test_model_export_inclusion_inheritance.assert_actual_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_export_inclusion_inheritance_test_model_export_inclusion_inheritance.assert_actual_expected", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1286, "end_line": 1310, "span_ids": ["test_model_export_inclusion_inheritance"], "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": "@pytest.mark.skip(reason='not implemented')\ndef test_model_export_inclusion_inheritance():\n class Sub(BaseModel):\n s1: str = Field('v1', include=...)\n s2: str = Field('v2', include=...)\n s3: str = Field('v3', include=...)\n s4: str = 'v4'\n\n class Parent(BaseModel):\n # b will be included since fields are set idependently\n model_config = ConfigDict(fields={'b': {'include': ...}})\n a: int\n b: int\n c: int\n s: Sub = Field(Sub(), include={'s1', 's2'}) # overrides includes set in Sub model\n\n class Child(Parent):\n # b is still included even if it doesn't occur here since fields\n # are still considered separately.\n # s however, is merged, resulting in only s1 being included.\n model_config = ConfigDict(fields={'a': {'include': ...}, 's': {'include': {'s1'}}})\n\n actual = Child(a=0, b=1, c=2).model_dump()\n expected = {'a': 0, 'b': 1, 's': {'s1': 'v1'}}\n assert actual == expected, 'Unexpected model export 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_pydantic__pydantic/tests/test_main.py_test_untyped_fields_warning_test_untyped_fields_warning.NonWarningModel.x.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_untyped_fields_warning_test_untyped_fields_warning.NonWarningModel.x.1", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1313, "end_line": 1328, "span_ids": ["test_untyped_fields_warning"], "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 test_untyped_fields_warning():\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n \"A non-annotated attribute was detected: `x = 1`. All model fields require a type annotation; \"\n \"if 'x' is not meant to be a field, you may be able to resolve this error by annotating it \"\n \"as a ClassVar or updating model_config[\\\"ignored_types\\\"].\"\n ),\n ):\n\n class WarningModel(BaseModel):\n x = 1\n\n # Prove that annotating with ClassVar prevents the warning\n class NonWarningModel(BaseModel):\n x: ClassVar = 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_pydantic__pydantic/tests/test_main.py_test_untyped_fields_error_test_two_defaults.with_pytest_raises_ValueE.Model.a.Field_default_3_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_untyped_fields_error_test_two_defaults.with_pytest_raises_ValueE.Model.a.Field_default_3_default_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1331, "end_line": 1366, "span_ids": ["test_two_defaults", "test_custom_init_subclass_params", "test_untyped_fields_error", "test_recursive_model"], "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 test_untyped_fields_error():\n with pytest.raises(TypeError, match=\"Field 'a' requires a type annotation\"):\n\n class Model(BaseModel):\n a = Field('foobar')\n\n\ndef test_custom_init_subclass_params():\n class DerivedModel(BaseModel):\n def __init_subclass__(cls, something):\n cls.something = something\n\n # if this raises a TypeError, then there is a regression of issue 867:\n # pydantic.main.MetaModel.__new__ should include **kwargs at the end of the\n # method definition and pass them on to the super call at the end in order\n # to allow the special method __init_subclass__ to be defined with custom\n # parameters on extended BaseModel classes.\n class NewModel(DerivedModel, something=2):\n something: ClassVar = 1\n\n assert NewModel.something == 2\n\n\ndef test_recursive_model():\n class MyModel(BaseModel):\n field: Optional['MyModel']\n\n m = MyModel(field={'field': {'field': None}})\n assert m.model_dump() == {'field': {'field': {'field': None}}}\n\n\ndef test_two_defaults():\n with pytest.raises(ValueError, match='^cannot specify both default and default_factory$'):\n\n class Model(BaseModel):\n a: int = Field(default=3, default_factory=lambda: 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_pydantic__pydantic/tests/test_main.py_test_default_factory_test_default_factory.assert_SingletonFieldMode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_test_default_factory.assert_SingletonFieldMode", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1369, "end_line": 1403, "span_ids": ["test_default_factory"], "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 test_default_factory():\n class ValueModel(BaseModel):\n uid: UUID = uuid4()\n\n m1 = ValueModel()\n m2 = ValueModel()\n assert m1.uid == m2.uid\n\n class DynamicValueModel(BaseModel):\n uid: UUID = Field(default_factory=uuid4)\n\n m1 = DynamicValueModel()\n m2 = DynamicValueModel()\n assert isinstance(m1.uid, UUID)\n assert m1.uid != m2.uid\n\n # With a callable: we still should be able to set callables as defaults\n class FunctionModel(BaseModel):\n a: int = 1\n uid: Callable[[], UUID] = Field(uuid4)\n\n m = FunctionModel()\n assert m.uid is uuid4\n\n # Returning a singleton from a default_factory is supported\n class MySingleton:\n pass\n\n MY_SINGLETON = MySingleton()\n\n class SingletonFieldModel(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n singleton: MySingleton = Field(default_factory=lambda: MY_SINGLETON)\n\n assert SingletonFieldModel().singleton is SingletonFieldModel().singleton", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_called_once_test_default_factory_called_once_2.assert_m2_id_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_called_once_test_default_factory_called_once_2.assert_m2_id_2", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1406, "end_line": 1443, "span_ids": ["test_default_factory_called_once_2", "test_default_factory_called_once"], "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 test_default_factory_called_once():\n \"\"\"It should call only once the given factory by default\"\"\"\n\n class Seq:\n def __init__(self):\n self.v = 0\n\n def __call__(self):\n self.v += 1\n return self.v\n\n class MyModel(BaseModel):\n id: int = Field(default_factory=Seq())\n\n m1 = MyModel()\n assert m1.id == 1\n m2 = MyModel()\n assert m2.id == 2\n assert m1.id == 1\n\n\ndef test_default_factory_called_once_2():\n \"\"\"It should call only once the given factory by default\"\"\"\n\n v = 0\n\n def factory():\n nonlocal v\n v += 1\n return v\n\n class MyModel(BaseModel):\n id: int = Field(default_factory=factory)\n\n m1 = MyModel()\n assert m1.id == 1\n m2 = MyModel()\n assert m2.id == 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_pydantic__pydantic/tests/test_main.py_test_default_factory_validate_children_test_default_factory_validate_children.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_validate_children_test_default_factory_validate_children.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1446, "end_line": 1460, "span_ids": ["test_default_factory_validate_children"], "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 test_default_factory_validate_children():\n class Child(BaseModel):\n x: int\n\n class Parent(BaseModel):\n children: List[Child] = Field(default_factory=list)\n\n Parent(children=[{'x': 1}, {'x': 2}])\n with pytest.raises(ValidationError) as exc_info:\n Parent(children=[{'x': 1}, {'y': 2}])\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'missing', 'loc': ('children', 1, 'x'), 'msg': 'Field required', 'input': {'y': 2}}\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_pydantic__pydantic/tests/test_main.py_test_default_factory_parse_test_base_config_type_hinting.get_type_hints_type_M_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_factory_parse_test_base_config_type_hinting.get_type_hints_type_M_mod", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1463, "end_line": 1496, "span_ids": ["test_default_factory_parse", "test_reuse_same_field", "test_base_config_type_hinting"], "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 test_default_factory_parse():\n class Inner(BaseModel):\n val: int = Field(0)\n\n class Outer(BaseModel):\n inner_1: Inner = Field(default_factory=Inner)\n inner_2: Inner = Field(Inner())\n\n default = Outer().model_dump()\n parsed = Outer.model_validate(default)\n assert parsed.model_dump() == {'inner_1': {'val': 0}, 'inner_2': {'val': 0}}\n assert repr(parsed) == 'Outer(inner_1=Inner(val=0), inner_2=Inner(val=0))'\n\n\ndef test_reuse_same_field():\n required_field = Field(...)\n\n class Model1(BaseModel):\n required: str = required_field\n\n class Model2(BaseModel):\n required: str = required_field\n\n with pytest.raises(ValidationError):\n Model1.model_validate({})\n with pytest.raises(ValidationError):\n Model2.model_validate({})\n\n\ndef test_base_config_type_hinting():\n class M(BaseModel):\n a: int\n\n get_type_hints(type(M.model_config))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_field_test_frozen_field.with_pytest_raises_TypeEr.r.id.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_field_test_frozen_field.with_pytest_raises_TypeEr.r.id.2", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1499, "end_line": 1514, "span_ids": ["test_frozen_field"], "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": "@pytest.mark.xfail(reason='frozen field; https://github.com/pydantic/pydantic-core/pull/237')\ndef test_frozen_field():\n \"\"\"assigning a frozen=True field should raise a TypeError\"\"\"\n\n class Entry(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n id: float = Field(frozen=True)\n val: float\n\n r = Entry(id=1, val=100)\n assert r.val == 100\n r.val = 101\n assert r.val == 101\n assert r.id == 1\n with pytest.raises(TypeError, match='\"id\" has frozen set to True and cannot be assigned'):\n r.id = 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_pydantic__pydantic/tests/test_main.py_test_repr_field_test_repr_field.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_repr_field_test_repr_field.None_3", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1517, "end_line": 1527, "span_ids": ["test_repr_field"], "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 test_repr_field():\n class Model(BaseModel):\n a: int = Field()\n b: float = Field(repr=True)\n c: bool = Field(repr=False)\n\n m = Model(a=1, b=2.5, c=True)\n assert repr(m) == 'Model(a=1, b=2.5)'\n assert repr(m.model_fields['a']) == 'FieldInfo(annotation=int, required=True)'\n assert repr(m.model_fields['b']) == 'FieldInfo(annotation=float, required=True)'\n assert repr(m.model_fields['c']) == 'FieldInfo(annotation=bool, required=True, repr=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_pydantic__pydantic/tests/test_main.py_test_inherited_model_field_copy_test_inherited_model_field_copy.assert_id_image_2_in_id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_inherited_model_field_copy_test_inherited_model_field_copy.assert_id_image_2_in_id", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1530, "end_line": 1549, "span_ids": ["test_inherited_model_field_copy"], "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 test_inherited_model_field_copy():\n \"\"\"It should copy models used as fields by default\"\"\"\n\n class Image(BaseModel):\n path: str\n\n def __hash__(self):\n return id(self)\n\n class Item(BaseModel):\n images: Set[Image]\n\n image_1 = Image(path='my_image1.png')\n image_2 = Image(path='my_image2.png')\n\n item = Item(images={image_1, image_2})\n assert image_1 in item.images\n\n assert id(image_1) in {id(image) for image in item.images}\n assert id(image_2) in {id(image) for image in item.images}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mapping_retains_type_subclass_test_typing_coercion_counter.assert_repr_m_x_Coun": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mapping_retains_type_subclass_test_typing_coercion_counter.assert_repr_m_x_Coun", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1552, "end_line": 1646, "span_ids": ["impl", "test_mapping_retains_type_subclass", "test_dict_subclasses_bare", "MyDict", "test_mapping_retains_type_fallback_error", "test_typing_coercion_dict", "test_dict_subclasses_typed", "test_typing_coercion_defaultdict", "test_mapping_retains_type_defaultdict", "MyDict.__repr__", "test_typing_coercion_counter"], "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": "def test_mapping_retains_type_subclass():\n class CustomMap(dict):\n pass\n\n class Model(BaseModel):\n x: Mapping[str, Mapping[str, int]]\n\n m = Model(x=CustomMap(outer=CustomMap(inner=42)))\n assert isinstance(m.x, CustomMap)\n assert isinstance(m.x['outer'], CustomMap)\n assert m.x['outer']['inner'] == 42\n\n\ndef test_mapping_retains_type_defaultdict():\n class Model(BaseModel):\n x: Mapping[str, int]\n\n d = defaultdict(int)\n d['foo'] = '2'\n d['bar']\n\n m = Model(x=d)\n assert isinstance(m.x, defaultdict)\n assert m.x['foo'] == 2\n assert m.x['bar'] == 0\n\n\ndef test_mapping_retains_type_fallback_error():\n class CustomMap(dict):\n def __init__(self, *args, **kwargs):\n if args or kwargs:\n raise TypeError('test')\n super().__init__(*args, **kwargs)\n\n class Model(BaseModel):\n x: Mapping[str, int]\n\n d = CustomMap()\n d['one'] = 1\n d['two'] = 2\n\n with pytest.raises(TypeError, match='test'):\n Model(x=d)\n\n\ndef test_typing_coercion_dict():\n class Model(BaseModel):\n x: Dict[str, int]\n\n m = Model(x={'one': 1, 'two': 2})\n assert repr(m) == \"Model(x={'one': 1, 'two': 2})\"\n\n\nKT = TypeVar('KT')\nVT = TypeVar('VT')\n\n\nclass MyDict(Dict[KT, VT]):\n def __repr__(self):\n return f'MyDict({super().__repr__()})'\n\n\ndef test_dict_subclasses_bare():\n class Model(BaseModel):\n a: MyDict\n\n assert repr(Model(a=MyDict({'a': 1})).a) == \"MyDict({'a': 1})\"\n assert repr(Model(a=MyDict({b'x': (1, 2)})).a) == \"MyDict({b'x': (1, 2)})\"\n\n\ndef test_dict_subclasses_typed():\n class Model(BaseModel):\n a: MyDict[str, int]\n\n assert repr(Model(a=MyDict({'a': 1})).a) == \"MyDict({'a': 1})\"\n\n\ndef test_typing_coercion_defaultdict():\n class Model(BaseModel):\n x: DefaultDict[int, str]\n\n d = defaultdict(str)\n d['1']\n m = Model(x=d)\n assert isinstance(m.x, defaultdict)\n assert repr(m.x) == \"defaultdict(, {1: ''})\"\n\n\ndef test_typing_coercion_counter():\n class Model(BaseModel):\n x: Counter[str]\n\n m = Model(x={'a': 10})\n assert isinstance(m.x, Counter)\n assert repr(m.x) == \"Counter({'a': 10})\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_typing_counter_value_validation_test_typing_counter_value_validation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_typing_counter_value_validation_test_typing_counter_value_validation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1649, "end_line": 1664, "span_ids": ["test_typing_counter_value_validation"], "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 test_typing_counter_value_validation():\n class Model(BaseModel):\n x: Counter[str]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x={'a': 'a'})\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('x', 'a'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\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_pydantic__pydantic/tests/test_main.py_test_class_kwargs_config_test_class_kwargs_config._assert_Model_model_fiel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_class_kwargs_config_test_class_kwargs_config._assert_Model_model_fiel", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1667, "end_line": 1680, "span_ids": ["test_class_kwargs_config"], "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 test_class_kwargs_config():\n class Base(BaseModel, extra='forbid', alias_generator=str.upper):\n a: int\n\n assert Base.model_config['extra'] is Extra.forbid\n assert Base.model_config['alias_generator'] is str.upper\n # assert Base.model_fields['a'].alias == 'A'\n\n class Model(Base, extra='allow'):\n b: int\n\n assert Model.model_config['extra'] is Extra.allow # overwritten as intended\n assert Model.model_config['alias_generator'] is str.upper # inherited as intended\n # assert Model.model_fields['b'].alias == 'B' # alias_generator still 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_pydantic__pydantic/tests/test_main.py_test_class_kwargs_config_and_attr_conflict_test_class_kwargs_custom_config.with_pytest_raises_TypeEr.Model.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_class_kwargs_config_and_attr_conflict_test_class_kwargs_custom_config.with_pytest_raises_TypeEr.Model.a", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1683, "end_line": 1701, "span_ids": ["test_class_kwargs_custom_config", "test_class_kwargs_config_and_attr_conflict"], "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 test_class_kwargs_config_and_attr_conflict():\n class Model(BaseModel, extra='allow', alias_generator=str.upper):\n model_config = ConfigDict(extra='forbid', title='Foobar')\n b: int\n\n assert Model.model_config['extra'] is Extra.allow\n assert Model.model_config['alias_generator'] is str.upper\n assert Model.model_config['title'] == 'Foobar'\n\n\ndef test_class_kwargs_custom_config():\n if platform.python_implementation() == 'PyPy':\n msg = r\"__init_subclass__\\(\\) got an unexpected keyword argument 'some_config'\"\n else:\n msg = r'__init_subclass__\\(\\) takes no keyword arguments'\n with pytest.raises(TypeError, match=msg):\n\n class Model(BaseModel, some_config='new_value'):\n a: 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_pydantic__pydantic/tests/test_main.py_test_new_union_origin_test_new_union_origin._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_new_union_origin_test_new_union_origin._", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1704, "end_line": 1719, "span_ids": ["test_new_union_origin"], "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": "@pytest.mark.skipif(sys.version_info < (3, 10), reason='need 3.10 version')\ndef test_new_union_origin():\n \"\"\"On 3.10+, origin of `int | str` is `types.UnionType`, not `typing.Union`\"\"\"\n\n class Model(BaseModel):\n x: int | str\n\n assert Model(x=3).x == 3\n assert Model(x='3').x == '3'\n assert Model(x='pika').x == 'pika'\n # assert Model.model_json_schema() == {\n # 'title': 'Model',\n # 'type': 'object',\n # 'properties': {'x': {'title': 'X', 'anyOf': [{'type': 'integer'}, {'type': 'string'}]}},\n # 'required': ['x'],\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_pydantic__pydantic/tests/test_main.py_test_final_field_decl_without_default_val_test_final_field_decl_without_default_val.assert_Model_model_fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_final_field_decl_without_default_val_test_final_field_decl_without_default_val.assert_Model_model_fields", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1722, "end_line": 1745, "span_ids": ["test_final_field_decl_without_default_val"], "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": "@pytest.mark.xfail(reason='implement final')\n@pytest.mark.parametrize(\n 'ann',\n [Final, Final[int]],\n ids=['no-arg', 'with-arg'],\n)\n@pytest.mark.parametrize(\n 'value',\n [None, Field(...)],\n ids=['none', 'field'],\n)\ndef test_final_field_decl_without_default_val(ann, value):\n class Model(BaseModel):\n a: ann\n\n if value is not None:\n a = value\n\n Model.model_rebuild(ann=ann)\n\n assert 'a' not in Model.__class_vars__\n assert 'a' in Model.model_fields\n\n assert Model.model_fields['a'].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_pydantic__pydantic/tests/test_main.py_test_final_field_decl_with_default_val_test_final_field_decl_with_default_val.assert_a_not_in_Model_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_final_field_decl_with_default_val_test_final_field_decl_with_default_val.assert_a_not_in_Model_m", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1748, "end_line": 1761, "span_ids": ["test_final_field_decl_with_default_val"], "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": "@pytest.mark.xfail(reason='waiting for https://github.com/pydantic/pydantic-core/pull/237')\n@pytest.mark.parametrize(\n 'ann',\n [Final, Final[int]],\n ids=['no-arg', 'with-arg'],\n)\ndef test_final_field_decl_with_default_val(ann):\n class Model(BaseModel):\n a: ann = 10\n\n Model.model_rebuild(ann=ann)\n\n assert 'a' in Model.__class_vars__\n assert 'a' not in Model.model_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_pydantic__pydantic/tests/test_main.py_test_final_field_reassignment_test_field_by_default_is_not_final.assert_not_Model_model_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_final_field_reassignment_test_field_by_default_is_not_final.assert_not_Model_model_fi", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1764, "end_line": 1783, "span_ids": ["test_final_field_reassignment", "test_field_by_default_is_not_final"], "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": "@pytest.mark.xfail(reason='waiting for https://github.com/pydantic/pydantic-core/pull/237')\ndef test_final_field_reassignment():\n class Model(BaseModel):\n a: Final[int]\n\n obj = Model(a=10)\n\n with pytest.raises(\n TypeError,\n match=r'^\"Model\" object \"a\" field is final and does not support reassignment$',\n ):\n obj.a = 20\n\n\n@pytest.mark.xfail(reason='waiting for https://github.com/pydantic/pydantic-core/pull/237')\ndef test_field_by_default_is_not_final():\n class Model(BaseModel):\n a: int\n\n assert not Model.model_fields['a'].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_pydantic__pydantic/tests/test_main.py_test_post_init_test_post_init.assert_calls_submode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_test_post_init.assert_calls_submode", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1786, "end_line": 1808, "span_ids": ["test_post_init"], "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 test_post_init():\n calls = []\n\n class SubModel(BaseModel):\n a: int\n b: int\n\n def model_post_init(self, _context) -> None:\n assert self.model_dump() == {'a': 3, 'b': 4}\n calls.append('submodel_post_init')\n\n class Model(BaseModel):\n c: int\n d: int\n sub: SubModel\n\n def model_post_init(self, _context) -> None:\n assert self.model_dump() == {'c': 1, 'd': 2, 'sub': {'a': 3, 'b': 4}}\n calls.append('model_post_init')\n\n m = Model(c=1, d='2', sub={'a': 3, 'b': '4'})\n assert m.model_dump() == {'c': 1, 'd': 2, 'sub': {'a': 3, 'b': 4}}\n assert calls == ['submodel_post_init', 'model_post_init']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_args_to_field_type_error_test_model_equality_fields_set.assert_m1_m2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_args_to_field_type_error_test_model_equality_fields_set.assert_m1_m2", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1811, "end_line": 1893, "span_ids": ["inner_equality_fixture", "test_model_equality_dump", "test_model_equality_type", "test_model_equality", "equality_fixture", "test_model_equality_fields_set", "test_deeper_recursive_model", "test_extra_args_to_field_type_error"], "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 test_extra_args_to_field_type_error():\n with pytest.raises(TypeError, match='unexpected keyword argument'):\n\n class Model(BaseModel):\n a: int = Field(thing=1)\n\n\ndef test_deeper_recursive_model():\n class A(BaseModel, undefined_types_warning=False):\n b: 'B'\n\n class B(BaseModel, undefined_types_warning=False):\n c: 'C'\n\n class C(BaseModel, undefined_types_warning=False):\n a: Optional['A']\n\n A.model_rebuild()\n B.model_rebuild()\n C.model_rebuild()\n\n m = A(b=B(c=C(a=None)))\n assert m.model_dump() == {'b': {'c': {'a': None}}}\n\n\n@pytest.fixture(scope='session', name='InnerEqualityModel')\ndef inner_equality_fixture():\n class InnerEqualityModel(BaseModel):\n iw: int\n ix: int = 0\n _iy: int = PrivateAttr()\n _iz: int = PrivateAttr(0)\n\n return InnerEqualityModel\n\n\n@pytest.fixture(scope='session', name='EqualityModel')\ndef equality_fixture(InnerEqualityModel):\n class EqualityModel(BaseModel):\n w: int\n x: int = 0\n _y: int = PrivateAttr()\n _z: int = PrivateAttr(0)\n\n model: InnerEqualityModel\n\n return EqualityModel\n\n\ndef test_model_equality(EqualityModel, InnerEqualityModel):\n m1 = EqualityModel(w=0, x=0, model=InnerEqualityModel(iw=0))\n m2 = EqualityModel(w=0, x=0, model=InnerEqualityModel(iw=0))\n assert m1 == m2\n\n\ndef test_model_equality_type(EqualityModel, InnerEqualityModel):\n class Model1(BaseModel):\n x: int\n\n class Model2(BaseModel):\n x: int\n\n m1 = Model1(x=1)\n m2 = Model2(x=1)\n\n assert m1.model_dump() == m2.model_dump()\n assert m1 != m2\n\n\ndef test_model_equality_dump(EqualityModel, InnerEqualityModel):\n inner_model = InnerEqualityModel(iw=0)\n assert inner_model != inner_model.model_dump()\n\n model = EqualityModel(w=0, x=0, model=inner_model)\n assert model != dict(model)\n assert dict(model) != model.model_dump() # Due to presence of inner model\n\n\ndef test_model_equality_fields_set(InnerEqualityModel):\n m1 = InnerEqualityModel(iw=0)\n m2 = InnerEqualityModel(iw=0, ix=0)\n assert m1.__fields_set__ != m2.__fields_set__\n assert m1 == m2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_equality_private_attrs_test_model_equality_private_attrs.assert_m3_m3_equal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_equality_private_attrs_test_model_equality_private_attrs.assert_m3_m3_equal", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1896, "end_line": 1920, "span_ids": ["test_model_equality_private_attrs"], "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 test_model_equality_private_attrs(InnerEqualityModel):\n m = InnerEqualityModel(iw=0, ix=0)\n\n m1 = m.model_copy()\n m2 = m.model_copy()\n m3 = m.model_copy()\n\n m2._iy = 1\n m3._iz = 1\n\n models = [m1, m2, m3]\n for i, first_model in enumerate(models):\n for j, second_model in enumerate(models):\n if i == j:\n assert first_model == second_model\n else:\n assert first_model != second_model\n\n m2_equal = m.model_copy()\n m2_equal._iy = 1\n assert m2 == m2_equal\n\n m3_equal = m.model_copy()\n m3_equal._iz = 1\n assert m3 == m3_equal", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_equality_generics_test_model_equality_generics.assert_nested_any_nest": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_equality_generics_test_model_equality_generics.assert_nested_any_nest", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1923, "end_line": 1952, "span_ids": ["test_model_equality_generics"], "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": "def test_model_equality_generics():\n T = TypeVar('T')\n\n class GenericModel(BaseModel, Generic[T]):\n x: T\n\n class ConcreteModel(BaseModel):\n x: int\n\n assert ConcreteModel(x=1) != GenericModel(x=1)\n assert ConcreteModel(x=1) != GenericModel[Any](x=1)\n assert ConcreteModel(x=1) != GenericModel[int](x=1)\n\n assert GenericModel(x=1) != GenericModel(x=2)\n\n S = TypeVar('S')\n assert GenericModel(x=1) == GenericModel(x=1)\n assert GenericModel(x=1) == GenericModel[S](x=1)\n assert GenericModel(x=1) == GenericModel[Any](x=1)\n assert GenericModel(x=1) == GenericModel[float](x=1)\n\n assert GenericModel[int](x=1) == GenericModel[int](x=1)\n assert GenericModel[int](x=1) == GenericModel[S](x=1)\n assert GenericModel[int](x=1) == GenericModel[Any](x=1)\n assert GenericModel[int](x=1) == GenericModel[float](x=1)\n\n # Test that it works with nesting as well\n nested_any = GenericModel[GenericModel[Any]](x=GenericModel[Any](x=1))\n nested_int = GenericModel[GenericModel[int]](x=GenericModel[int](x=1))\n assert nested_any == nested_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_pydantic__pydantic/tests/test_main.py_test_model_validate_strict_test_model_validate_strict.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_strict_test_model_validate_strict.None_5", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1955, "end_line": 1996, "span_ids": ["test_model_validate_strict"], "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 test_model_validate_strict() -> None:\n class LaxModel(BaseModel):\n x: int\n\n model_config = ConfigDict(strict=False)\n\n class StrictModel(BaseModel):\n x: int\n\n model_config = ConfigDict(strict=True)\n\n assert LaxModel.model_validate({'x': '1'}, strict=None) == LaxModel(x=1)\n assert LaxModel.model_validate({'x': '1'}, strict=False) == LaxModel(x=1)\n with pytest.raises(ValidationError) as exc_info:\n LaxModel.model_validate({'x': '1'}, strict=True)\n assert exc_info.value.errors() == [\n {\n 'type': 'model_class_type',\n 'loc': (),\n 'msg': 'Input should be an instance of LaxModel',\n 'input': {'x': '1'},\n 'ctx': {'class_name': 'LaxModel'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n StrictModel.model_validate({'x': '1'})\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n assert StrictModel.model_validate({'x': '1'}, strict=False) == StrictModel(x=1)\n with pytest.raises(ValidationError) as exc_info:\n LaxModel.model_validate({'x': '1'}, strict=True)\n assert exc_info.value.errors() == [\n {\n 'type': 'model_class_type',\n 'loc': (),\n 'msg': 'Input should be an instance of LaxModel',\n 'input': {'x': '1'},\n 'ctx': {'class_name': 'LaxModel'},\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_pydantic__pydantic/tests/test_main.py_test_model_validate_json_strict_test_model_validate_json_strict.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_json_strict_test_model_validate_json_strict.None_5", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1999, "end_line": 2028, "span_ids": ["test_model_validate_json_strict"], "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 test_model_validate_json_strict() -> None:\n class LaxModel(BaseModel):\n x: int\n\n model_config = ConfigDict(strict=False)\n\n class StrictModel(BaseModel):\n x: int\n\n model_config = ConfigDict(strict=True)\n\n assert LaxModel.model_validate_json(json.dumps({'x': '1'}), strict=None) == LaxModel(x=1)\n assert LaxModel.model_validate_json(json.dumps({'x': '1'}), strict=False) == LaxModel(x=1)\n with pytest.raises(ValidationError) as exc_info:\n LaxModel.model_validate_json(json.dumps({'x': '1'}), strict=True)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n StrictModel.model_validate_json(json.dumps({'x': '1'}), strict=None)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n assert StrictModel.model_validate_json(json.dumps({'x': '1'}), strict=False) == StrictModel(x=1)\n with pytest.raises(ValidationError) as exc_info:\n StrictModel.model_validate_json(json.dumps({'x': '1'}), strict=True)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '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_pydantic__pydantic/tests/test_main.py_test_validate_python_context_test_validate_python_context.assert_contexts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_python_context_test_validate_python_context.assert_contexts_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2031, "end_line": 2045, "span_ids": ["test_validate_python_context"], "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 test_validate_python_context() -> None:\n contexts: List[Any] = [None, None, {'foo': 'bar'}]\n\n class Model(BaseModel):\n x: int\n\n @field_validator('x')\n def val_x(cls, v: int, info: ValidationInfo) -> int:\n assert info.context == contexts.pop(0)\n return v\n\n Model.model_validate({'x': 1})\n Model.model_validate({'x': 1}, context=None)\n Model.model_validate({'x': 1}, context={'foo': 'bar'})\n assert contexts == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_json_context_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_json_context_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2048, "end_line": 2063, "span_ids": ["test_validate_json_context"], "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 test_validate_json_context() -> None:\n contexts: List[Any] = [None, None, {'foo': 'bar'}]\n\n class Model(BaseModel):\n x: int\n\n @field_validator('x')\n def val_x(cls, v: int, info: ValidationInfo) -> int:\n assert info.context == contexts.pop(0)\n return v\n\n Model.model_validate_json(json.dumps({'x': 1}))\n Model.model_validate_json(json.dumps({'x': 1}), context=None)\n Model.model_validate_json(json.dumps({'x': 1}), context={'foo': 'bar'})\n assert contexts == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_sys_test_model_signature.assert__equals_str_sig_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_sys_test_model_signature.assert__equals_str_sig_", "embedding": null, "metadata": {"file_path": "tests/test_model_signature.py", "file_name": "test_model_signature.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "test_model_signature", "_equals"], "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": "import sys\nfrom inspect import Parameter, Signature, signature\nfrom typing import Any, Iterable, Optional, Union\n\nimport pytest\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, ConfigDict, Extra, Field, create_model\nfrom pydantic._internal._typing_extra import is_annotated\n\n\ndef _equals(a: Union[str, Iterable[str]], b: Union[str, Iterable[str]]) -> bool:\n \"\"\"\n compare strings with spaces removed\n \"\"\"\n if isinstance(a, str) and isinstance(b, str):\n return a.replace(' ', '') == b.replace(' ', '')\n elif isinstance(a, Iterable) and isinstance(b, Iterable):\n return all(_equals(a_, b_) for a_, b_ in zip(a, b))\n else:\n raise TypeError(f'arguments must be both strings or both lists, not {type(a)}, {type(b)}')\n\n\ndef test_model_signature():\n class Model(BaseModel):\n a: float = Field(..., title='A')\n b: int = Field(10)\n\n sig = signature(Model)\n assert sig != signature(BaseModel)\n assert _equals(map(str, sig.parameters.values()), ('a: float', 'b: int = 10'))\n assert _equals(str(sig), '(*, a: float, b: int = 10) -> 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_pydantic__pydantic/tests/test_model_signature.py_test_custom_init_signature_test_custom_init_signature.assert__equals_str_sig_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_custom_init_signature_test_custom_init_signature.assert__equals_str_sig_", "embedding": null, "metadata": {"file_path": "tests/test_model_signature.py", "file_name": "test_model_signature.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 54, "span_ids": ["test_custom_init_signature"], "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 test_custom_init_signature():\n class MyModel(BaseModel):\n id: int\n name: str = 'John Doe'\n f__: str = Field(..., alias='foo')\n\n model_config = ConfigDict(extra=Extra.allow)\n\n def __init__(self, id: int = 1, bar=2, *, baz: Any, **data):\n super().__init__(id=id, **data)\n self.bar = bar\n self.baz = baz\n\n sig = signature(MyModel)\n assert _equals(\n map(str, sig.parameters.values()),\n ('id: int = 1', 'bar=2', 'baz: Any', \"name: str = 'John Doe'\", 'foo: str', '**data'),\n )\n\n assert _equals(str(sig), \"(id: int = 1, bar=2, *, baz: Any, name: str = 'John Doe', foo: str, **data) -> 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_pydantic__pydantic/tests/test_model_signature.py_test_custom_init_signature_with_no_var_kw_test_invalid_identifiers_signature.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_custom_init_signature_with_no_var_kw_test_invalid_identifiers_signature.None_1", "embedding": null, "metadata": {"file_path": "tests/test_model_signature.py", "file_name": "test_model_signature.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 78, "span_ids": ["test_custom_init_signature_with_no_var_kw", "test_invalid_identifiers_signature"], "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": "def test_custom_init_signature_with_no_var_kw():\n class Model(BaseModel):\n a: float\n b: int = 2\n c: int\n\n def __init__(self, a: float, b: int):\n super().__init__(a=a, b=b, c=1)\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert _equals(str(signature(Model)), '(a: float, b: int) -> None')\n\n\ndef test_invalid_identifiers_signature():\n model = create_model(\n 'Model',\n **{'123 invalid identifier!': (int, Field(123, alias='valid_identifier')), '!': (int, Field(0, alias='yeah'))},\n )\n assert _equals(str(signature(model)), '(*, valid_identifier: int = 123, yeah: int = 0) -> None')\n model = create_model('Model', **{'123 invalid identifier!': (int, 123), '!': (int, Field(0, alias='yeah'))})\n assert _equals(str(signature(model)), '(*, yeah: int = 0, **extra_data: Any) -> 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_pydantic__pydantic/tests/test_model_signature.py_test_use_field_name_test_optional_field.assert_signature_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_use_field_name_test_optional_field.assert_signature_Model_", "embedding": null, "metadata": {"file_path": "tests/test_model_signature.py", "file_name": "test_model_signature.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 157, "span_ids": ["test_use_field_name", "test_signature_is_class_only", "test_extra_allow_conflict_custom_signature", "test_extra_allow_no_conflict", "test_optional_field", "test_extra_allow_conflict_twice", "test_extra_allow_conflict", "test_does_not_use_reserved_word"], "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": "def test_use_field_name():\n class Foo(BaseModel):\n foo: str = Field(..., alias='this is invalid')\n\n model_config = ConfigDict(populate_by_name=True)\n\n assert _equals(str(signature(Foo)), '(*, foo: str) -> None')\n\n\ndef test_does_not_use_reserved_word():\n class Foo(BaseModel):\n from_: str = Field(..., alias='from')\n\n model_config = ConfigDict(populate_by_name=True)\n\n assert _equals(str(signature(Foo)), '(*, from_: str) -> None')\n\n\ndef test_extra_allow_no_conflict():\n class Model(BaseModel):\n spam: str\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert _equals(str(signature(Model)), '(*, spam: str, **extra_data: Any) -> None')\n\n\ndef test_extra_allow_conflict():\n class Model(BaseModel):\n extra_data: str\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert _equals(str(signature(Model)), '(*, extra_data: str, **extra_data_: Any) -> None')\n\n\ndef test_extra_allow_conflict_twice():\n class Model(BaseModel):\n extra_data: str\n extra_data_: str\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert _equals(str(signature(Model)), '(*, extra_data: str, extra_data_: str, **extra_data__: Any) -> None')\n\n\ndef test_extra_allow_conflict_custom_signature():\n class Model(BaseModel):\n extra_data: int\n\n def __init__(self, extra_data: int = 1, **foobar: Any):\n super().__init__(extra_data=extra_data, **foobar)\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert _equals(str(signature(Model)), '(extra_data: int = 1, **foobar: Any) -> None')\n\n\ndef test_signature_is_class_only():\n class Model(BaseModel):\n foo: int = 123\n\n def __call__(self, a: int) -> bool:\n pass\n\n assert _equals(str(signature(Model)), '(*, foo: int = 123) -> None')\n assert _equals(str(signature(Model())), '(a: int) -> bool')\n assert not hasattr(Model(), '__signature__')\n\n\ndef test_optional_field():\n class Model(BaseModel):\n foo: Optional[int] = None\n\n assert signature(Model) == Signature(\n [Parameter('foo', Parameter.KEYWORD_ONLY, default=None, annotation=Optional[int])], return_annotation=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_pydantic__pydantic/tests/test_model_signature.py_test_annotated_field_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_annotated_field_", "embedding": null, "metadata": {"file_path": "tests/test_model_signature.py", "file_name": "test_model_signature.py", "file_type": "text/x-python", "category": "test", "start_line": 160, "end_line": 181, "span_ids": ["test_annotated_field", "test_annotated_optional_field"], "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": "@pytest.mark.skipif(sys.version_info < (3, 10), reason='repr different on older versions')\ndef test_annotated_field():\n from annotated_types import Gt\n\n class Model(BaseModel):\n foo: Annotated[int, Gt(1)] = 1\n\n sig = signature(Model)\n assert str(sig) == '(*, foo: typing.Annotated[int, Gt(gt=1)] = 1) -> None'\n # check that the `Annotated` we created is a valid `Annotated`\n assert is_annotated(sig.parameters['foo'].annotation)\n\n\n@pytest.mark.skipif(sys.version_info < (3, 10), reason='repr different on older versions')\ndef test_annotated_optional_field():\n from annotated_types import Gt\n\n class Model(BaseModel):\n foo: Annotated[Optional[int], Gt(1)] = None\n\n assert str(signature(Model)) == '(*, foo: Annotated[Optional[int], Gt(gt=1)] = 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_pydantic__pydantic/tests/test_networks.py_pytest_try_.except_ImportError_.email_validator.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_pytest_try_.except_ImportError_.email_validator.None", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["imports"], "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": "import pytest\nfrom pydantic_core import PydanticCustomError, Url\nfrom typing_extensions import Annotated\n\nfrom pydantic import (\n AmqpDsn,\n AnyUrl,\n BaseModel,\n CockroachDsn,\n FileUrl,\n HttpUrl,\n KafkaDsn,\n MariaDBDsn,\n MongoDsn,\n MySQLDsn,\n NameEmail,\n PostgresDsn,\n RedisDsn,\n Strict,\n UrlConstraints,\n ValidationError,\n)\nfrom pydantic.networks import validate_email\n\ntry:\n import email_validator\nexcept ImportError:\n email_validator = 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_pydantic__pydantic/tests/test_networks.py_test_any_url_success_test_any_url_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_any_url_success_test_any_url_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 107, "span_ids": ["test_any_url_success"], "tokens": 899}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'value',\n [\n 'http://example.org',\n 'http://test',\n 'http://localhost',\n 'https://example.org/whatever/next/',\n 'postgres://user:pass@localhost:5432/app',\n 'postgres://just-user@localhost:5432/app',\n 'postgresql+asyncpg://user:pass@localhost:5432/app',\n 'postgresql+pg8000://user:pass@localhost:5432/app',\n 'postgresql+psycopg://postgres:postgres@localhost:5432/hatch',\n 'postgresql+psycopg2://postgres:postgres@localhost:5432/hatch',\n 'postgresql+psycopg2cffi://user:pass@localhost:5432/app',\n 'postgresql+py-postgresql://user:pass@localhost:5432/app',\n 'postgresql+pygresql://user:pass@localhost:5432/app',\n 'mysql://user:pass@localhost:3306/app',\n 'mysql+mysqlconnector://user:pass@localhost:3306/app',\n 'mysql+aiomysql://user:pass@localhost:3306/app',\n 'mysql+asyncmy://user:pass@localhost:3306/app',\n 'mysql+mysqldb://user:pass@localhost:3306/app',\n 'mysql+pymysql://user:pass@localhost:3306/app?charset=utf8mb4',\n 'mysql+cymysql://user:pass@localhost:3306/app',\n 'mysql+pyodbc://user:pass@localhost:3306/app',\n 'mariadb://user:pass@localhost:3306/app',\n 'mariadb+mariadbconnector://user:pass@localhost:3306/app',\n 'mariadb+pymysql://user:pass@localhost:3306/app',\n 'foo-bar://example.org',\n 'foo.bar://example.org',\n 'foo0bar://example.org',\n 'https://example.org',\n 'http://localhost',\n 'http://localhost/',\n 'http://localhost:8000',\n 'http://localhost:8000/',\n 'https://foo_bar.example.com/',\n 'ftp://example.org',\n 'ftps://example.org',\n 'http://example.co.jp',\n 'http://www.example.com/a%C2%B1b',\n 'http://www.example.com/~username/',\n 'http://info.example.com?fred',\n 'http://info.example.com/?fred',\n 'http://xn--mgbh0fb.xn--kgbechtv/',\n 'http://example.com/blue/red%3Fand+green',\n 'http://www.example.com/?array%5Bkey%5D=value',\n 'http://xn--rsum-bpad.example.org/',\n 'http://123.45.67.8/',\n 'http://123.45.67.8:8329/',\n 'http://[2001:db8::ff00:42]:8329',\n 'http://[2001::1]:8329',\n 'http://[2001:db8::1]/',\n 'http://www.example.com:8000/foo',\n 'http://www.cwi.nl:80/%7Eguido/Python.html',\n 'https://www.python.org/\u043f\u0443\u0442\u044c',\n 'http://\u0430\u043d\u0434\u0440\u0435\u0439@example.com',\n # AnyUrl('https://example.com', scheme='https', host='example.com'),\n 'https://exam_ple.com/',\n 'http://twitter.com/@handle/',\n 'http://11.11.11.11.example.com/action',\n 'http://abc.11.11.11.11.example.com/action',\n 'http://example#',\n 'http://example/#',\n 'http://example/#fragment',\n 'http://example/?#',\n 'http://example.org/path#',\n 'http://example.org/path#fragment',\n 'http://example.org/path?query#',\n 'http://example.org/path?query#fragment',\n 'file://localhost/foo/bar',\n ],\n)\ndef test_any_url_success(value):\n class Model(BaseModel):\n v: AnyUrl\n\n assert Model(v=value).v, 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_pydantic__pydantic/tests/test_networks.py_test_any_url_invalid_test_any_url_invalid.assert_type_error_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_any_url_invalid_test_any_url_invalid.assert_type_error_ty", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 110, "end_line": 148, "span_ids": ["test_any_url_invalid"], "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": "@pytest.mark.parametrize(\n 'value,err_type,err_msg',\n [\n ('http:///', 'url_parsing', 'Input should be a valid URL, empty host'),\n ('http://??', 'url_parsing', 'Input should be a valid URL, empty host'),\n (\n 'https://example.org more',\n 'url_parsing',\n 'Input should be a valid URL, invalid domain character',\n ),\n ('$https://example.org', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('../icons/logo.gif', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('abc', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('..', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('/', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('+http://example.com/', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('ht*tp://example.com/', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n (' ', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n ('', 'url_parsing', 'Input should be a valid URL, relative URL without a base'),\n (None, 'url_type', 'URL input should be a string or URL'),\n (\n 'http://2001:db8::ff00:42:8329',\n 'url_parsing',\n 'Input should be a valid URL, invalid port number',\n ),\n ('http://[192.168.1.1]:8329', 'url_parsing', 'Input should be a valid URL, invalid IPv6 address'),\n ('http://example.com:99999', 'url_parsing', 'Input should be a valid URL, invalid port number'),\n ],\n)\ndef test_any_url_invalid(value, err_type, err_msg):\n class Model(BaseModel):\n v: AnyUrl\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n assert len(exc_info.value.errors()) == 1, exc_info.value.errors()\n error = exc_info.value.errors()[0]\n # debug(error)\n assert {'type': error['type'], 'msg': error['msg']} == {'type': err_type, 'msg': err_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_pydantic__pydantic/tests/test_networks.py_validate_url_test_url_repr.assert_url_fragment_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_validate_url_test_url_repr.assert_url_fragment_f", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 151, "end_line": 178, "span_ids": ["validate_url", "test_url_repr", "test_any_url_parts"], "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 validate_url(s):\n class Model(BaseModel):\n v: AnyUrl\n\n return Model(v=s).v\n\n\ndef test_any_url_parts():\n url = validate_url('http://example.org')\n assert str(url) == 'http://example.org/'\n assert repr(url) == \"Url('http://example.org/')\"\n assert url.scheme == 'http'\n assert url.host == 'example.org'\n assert url.port == 80\n\n\ndef test_url_repr():\n url = validate_url('http://user:password@example.org:1234/the/path/?query=here#fragment=is;this=bit')\n assert str(url) == 'http://user:password@example.org:1234/the/path/?query=here#fragment=is;this=bit'\n assert repr(url) == \"Url('http://user:password@example.org:1234/the/path/?query=here#fragment=is;this=bit')\"\n assert url.scheme == 'http'\n assert url.username == 'user'\n assert url.password == 'password'\n assert url.host == 'example.org'\n assert url.port == 1234\n assert url.path == '/the/path/'\n assert url.query == 'query=here'\n assert url.fragment == 'fragment=is;this=bit'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_ipv4_port_test_fragment_without_query.assert_url_fragment_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_ipv4_port_test_fragment_without_query.assert_url_fragment_c", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 248, "span_ids": ["test_user_no_password", "test_ipv4_port", "test_int_domain", "test_at_in_path", "test_ipv6_port", "test_fragment_without_query", "test_co_uk", "test_ipv4_no_port", "test_user_info_no_user"], "tokens": 517}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_ipv4_port():\n url = validate_url('ftp://123.45.67.8:8329/')\n assert url.scheme == 'ftp'\n assert url.host == '123.45.67.8'\n assert url.port == 8329\n assert url.username is None\n assert url.password is None\n\n\ndef test_ipv4_no_port():\n url = validate_url('ftp://123.45.67.8')\n assert url.scheme == 'ftp'\n assert url.host == '123.45.67.8'\n assert url.port == 21\n assert url.username is None\n assert url.password is None\n\n\ndef test_ipv6_port():\n url = validate_url('wss://[2001:db8::ff00:42]:8329')\n assert url.scheme == 'wss'\n assert url.host == '[2001:db8::ff00:42]'\n assert url.port == 8329\n\n\ndef test_int_domain():\n url = validate_url('https://\u00a3\u00a3\u00a3.org')\n assert url.host == 'xn--9aaa.org'\n assert str(url) == 'https://xn--9aaa.org/'\n\n\ndef test_co_uk():\n url = validate_url('http://example.co.uk')\n assert str(url) == 'http://example.co.uk/'\n assert url.scheme == 'http'\n assert url.host == 'example.co.uk'\n\n\ndef test_user_no_password():\n url = validate_url('http://user:@example.org')\n assert url.username == 'user'\n assert url.password is None\n assert url.host == 'example.org'\n\n\ndef test_user_info_no_user():\n url = validate_url('http://:password@example.org')\n assert url.username is None\n assert url.password == 'password'\n assert url.host == 'example.org'\n\n\ndef test_at_in_path():\n url = validate_url('https://twitter.com/@handle')\n assert url.scheme == 'https'\n assert url.host == 'twitter.com'\n assert url.username is None\n assert url.password is None\n assert url.path == '/@handle'\n\n\ndef test_fragment_without_query():\n url = validate_url('https://docs.pydantic.dev/usage/types/#constrained-types')\n assert url.scheme == 'https'\n assert url.host == 'docs.pydantic.dev'\n assert url.path == '/usage/types/'\n assert url.query is None\n assert url.fragment == 'constrained-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_pydantic__pydantic/tests/test_networks.py_test_http_url_success_test_http_url_success.assert_str_Model_v_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_http_url_success_test_http_url_success.assert_str_Model_v_value_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 251, "end_line": 273, "span_ids": ["test_http_url_success"], "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": "@pytest.mark.parametrize(\n 'value,expected',\n [\n ('http://example.org', 'http://example.org/'),\n ('http://example.org/foobar', 'http://example.org/foobar'),\n ('http://example.org.', 'http://example.org./'),\n ('http://example.org./foobar', 'http://example.org./foobar'),\n ('HTTP://EXAMPLE.ORG', 'http://example.org/'),\n ('https://example.org', 'https://example.org/'),\n ('https://example.org?a=1&b=2', 'https://example.org/?a=1&b=2'),\n ('https://example.org#a=3;b=3', 'https://example.org/#a=3;b=3'),\n ('https://foo_bar.example.com/', 'https://foo_bar.example.com/'),\n ('https://exam_ple.com/', 'https://exam_ple.com/'),\n ('https://example.xn--p1ai', 'https://example.xn--p1ai/'),\n ('https://example.xn--vermgensberatung-pwb', 'https://example.xn--vermgensberatung-pwb/'),\n ('https://example.xn--zfr164b', 'https://example.xn--zfr164b/'),\n ],\n)\ndef test_http_url_success(value, expected):\n class Model(BaseModel):\n v: HttpUrl\n\n assert str(Model(v=value).v) == 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_pydantic__pydantic/tests/test_networks.py_test_http_url_invalid_test_http_url_invalid.assert_type_error_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_http_url_invalid_test_http_url_invalid.assert_type_error_ty", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 276, "end_line": 299, "span_ids": ["test_http_url_invalid"], "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": "@pytest.mark.parametrize(\n 'value,err_type,err_msg',\n [\n (\n 'ftp://example.com/',\n 'url_scheme',\n \"URL scheme should be 'http' or 'https'\",\n ),\n (\n 'x' * 2084,\n 'url_too_long',\n 'URL should have at most 2083 characters',\n ),\n ],\n)\ndef test_http_url_invalid(value, err_type, err_msg):\n class Model(BaseModel):\n v: HttpUrl\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n assert len(exc_info.value.errors()) == 1, exc_info.value.errors()\n error = exc_info.value.errors()[0]\n assert {'type': error['type'], 'msg': error['msg']} == {'type': err_type, 'msg': err_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_pydantic__pydantic/tests/test_networks.py_test_coerce_url_test_coerce_url.assert_str_Model_v_input_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_coerce_url_test_coerce_url.assert_str_Model_v_input_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 320, "span_ids": ["test_coerce_url"], "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": "@pytest.mark.parametrize(\n 'input,output',\n [\n (' https://www.example.com \\n', 'https://www.example.com/'),\n (b'https://www.example.com', 'https://www.example.com/'),\n # https://www.xudongz.com/blog/2017/idn-phishing/ accepted but converted\n ('https://www.\u0430\u0440\u0440\u04cf\u0435.com/', 'https://www.xn--80ak6aa92e.com/'),\n ('https://exampl\u00a3e.org', 'https://xn--example-gia.org/'),\n ('https://example.\u73e0\u5b9d', 'https://example.xn--pbt977c/'),\n ('https://example.verm\u00f6gensberatung', 'https://example.xn--vermgensberatung-pwb/'),\n ('https://example.\u0440\u0444', 'https://example.xn--p1ai/'),\n ('https://exampl\u00a3e.\u73e0\u5b9d', 'https://xn--example-gia.xn--pbt977c/'),\n ],\n)\ndef test_coerce_url(input, output):\n class Model(BaseModel):\n v: HttpUrl\n\n assert str(Model(v=input).v) == 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_pydantic__pydantic/tests/test_networks.py_test_file_url_success_test_http_urls_default_port.assert_str_m_v_expect": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_file_url_success_test_http_urls_default_port.assert_str_m_v_expect", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 323, "end_line": 355, "span_ids": ["test_http_urls_default_port", "test_file_url_success"], "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": "@pytest.mark.parametrize(\n 'value,expected',\n [\n ('file:///foo/bar', 'file:///foo/bar'),\n ('file://localhost/foo/bar', 'file:///foo/bar'),\n ('file:////localhost/foo/bar', 'file:///localhost/foo/bar'),\n ],\n)\ndef test_file_url_success(value, expected):\n class Model(BaseModel):\n v: FileUrl\n\n assert str(Model(v=value).v) == expected\n\n\n@pytest.mark.parametrize(\n 'url,expected_port, expected_str',\n [\n ('https://www.example.com/', 443, 'https://www.example.com/'),\n ('https://www.example.com:443/', 443, 'https://www.example.com/'),\n ('https://www.example.com:8089/', 8089, 'https://www.example.com:8089/'),\n ('http://www.example.com/', 80, 'http://www.example.com/'),\n ('http://www.example.com:80/', 80, 'http://www.example.com/'),\n ('http://www.example.com:8080/', 8080, 'http://www.example.com:8080/'),\n ],\n)\ndef test_http_urls_default_port(url, expected_port, expected_str):\n class Model(BaseModel):\n v: HttpUrl\n\n m = Model(v=url)\n assert m.v.port == expected_port\n assert str(m.v) == expected_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_pydantic__pydantic/tests/test_networks.py_test_postgres_dsns_test_postgres_dsns.assert_str_Model_a_dsn_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_postgres_dsns_test_postgres_dsns.assert_str_Model_a_dsn_a", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 358, "end_line": 372, "span_ids": ["test_postgres_dsns"], "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": "@pytest.mark.parametrize(\n 'dsn',\n [\n 'postgres://user:pass@localhost:5432/app',\n 'postgresql://user:pass@localhost:5432/app',\n 'postgresql+asyncpg://user:pass@localhost:5432/app',\n 'postgres://user:pass@host1.db.net,host2.db.net:6432/app',\n 'postgres://user:pass@%2Fvar%2Flib%2Fpostgresql/dbname',\n ],\n)\ndef test_postgres_dsns(dsn):\n class Model(BaseModel):\n a: PostgresDsn\n\n assert str(Model(a=dsn).a) == dsn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mysql_dsns_test_mysql_dsns.assert_str_Model_a_dsn_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mysql_dsns_test_mysql_dsns.assert_str_Model_a_dsn_a", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 375, "end_line": 392, "span_ids": ["test_mysql_dsns"], "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": "@pytest.mark.parametrize(\n 'dsn',\n [\n 'mysql://user:pass@localhost:3306/app',\n 'mysql+mysqlconnector://user:pass@localhost:3306/app',\n 'mysql+aiomysql://user:pass@localhost:3306/app',\n 'mysql+asyncmy://user:pass@localhost:3306/app',\n 'mysql+mysqldb://user:pass@localhost:3306/app',\n 'mysql+pymysql://user:pass@localhost:3306/app?charset=utf8mb4',\n 'mysql+cymysql://user:pass@localhost:3306/app',\n 'mysql+pyodbc://user:pass@localhost:3306/app',\n ],\n)\ndef test_mysql_dsns(dsn):\n class Model(BaseModel):\n a: MySQLDsn\n\n assert str(Model(a=dsn).a) == dsn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mariadb_dsns_test_mariadb_dsns.assert_str_Model_a_dsn_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mariadb_dsns_test_mariadb_dsns.assert_str_Model_a_dsn_a", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 395, "end_line": 407, "span_ids": ["test_mariadb_dsns"], "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": "@pytest.mark.parametrize(\n 'dsn',\n [\n 'mariadb://user:pass@localhost:3306/app',\n 'mariadb+mariadbconnector://user:pass@localhost:3306/app',\n 'mariadb+pymysql://user:pass@localhost:3306/app',\n ],\n)\ndef test_mariadb_dsns(dsn):\n class Model(BaseModel):\n a: MariaDBDsn\n\n assert str(Model(a=dsn).a) == dsn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_postgres_dsns_validation_error_test_postgres_dsns_validation_error.assert_error_error_mes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_postgres_dsns_validation_error_test_postgres_dsns_validation_error.assert_error_error_mes", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 410, "end_line": 472, "span_ids": ["test_postgres_dsns_validation_error"], "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": "@pytest.mark.parametrize(\n 'dsn,error_message',\n (\n (\n 'postgres://user:pass@host1.db.net:4321,/foo/bar:5432/app',\n {\n 'type': 'url_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid URL, empty host',\n 'input': 'postgres://user:pass@host1.db.net:4321,/foo/bar:5432/app',\n },\n ),\n (\n 'postgres://user:pass@host1.db.net,/app',\n {\n 'type': 'url_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid URL, empty host',\n 'input': 'postgres://user:pass@host1.db.net,/app',\n },\n ),\n (\n 'postgres://user:pass@/foo/bar:5432,host1.db.net:4321/app',\n {\n 'type': 'url_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid URL, empty host',\n 'input': 'postgres://user:pass@/foo/bar:5432,host1.db.net:4321/app',\n },\n ),\n (\n 'postgres://user@/foo/bar:5432/app',\n {\n 'type': 'url_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid URL, empty host',\n 'input': 'postgres://user@/foo/bar:5432/app',\n },\n ),\n (\n 'http://example.org',\n {\n 'type': 'url_scheme',\n 'loc': ('a',),\n 'msg': (\n \"URL scheme should be 'postgres', 'postgresql', 'postgresql+asyncpg', 'postgresql+pg8000', \"\n \"'postgresql+psycopg', 'postgresql+psycopg2', 'postgresql+psycopg2cffi', \"\n \"'postgresql+py-postgresql' or 'postgresql+pygresql'\"\n ),\n 'input': 'http://example.org',\n },\n ),\n ),\n)\ndef test_postgres_dsns_validation_error(dsn, error_message):\n class Model(BaseModel):\n a: PostgresDsn\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=dsn)\n error = exc_info.value.errors()[0]\n error.pop('ctx', None)\n assert error == error_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_pydantic__pydantic/tests/test_networks.py_test_multihost_postgres_dsns_test_multihost_postgres_dsns.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_multihost_postgres_dsns_test_multihost_postgres_dsns.None_7", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 475, "end_line": 494, "span_ids": ["test_multihost_postgres_dsns"], "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 test_multihost_postgres_dsns():\n class Model(BaseModel):\n a: PostgresDsn\n\n any_multihost_url = Model(a='postgres://user:pass@host1.db.net:4321,host2.db.net:6432/app').a\n assert str(any_multihost_url) == 'postgres://user:pass@host1.db.net:4321,host2.db.net:6432/app'\n assert any_multihost_url.scheme == 'postgres'\n assert any_multihost_url.path == '/app'\n # insert_assert(any_multihost_url.hosts())\n assert any_multihost_url.hosts() == [\n {'username': 'user', 'password': 'pass', 'host': 'host1.db.net', 'port': 4321},\n {'username': None, 'password': None, 'host': 'host2.db.net', 'port': 6432},\n ]\n\n any_multihost_url = Model(a='postgres://user:pass@host.db.net:4321/app').a\n assert any_multihost_url.scheme == 'postgres'\n assert str(any_multihost_url) == 'postgres://user:pass@host.db.net:4321/app'\n assert any_multihost_url.path == '/app'\n # insert_assert(any_multihost_url.hosts())\n assert any_multihost_url.hosts() == [{'username': 'user', 'password': 'pass', 'host': 'host.db.net', 'port': 4321}]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_cockroach_dsns_test_cockroach_dsns.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_cockroach_dsns_test_cockroach_dsns.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 497, "end_line": 513, "span_ids": ["test_cockroach_dsns"], "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 test_cockroach_dsns():\n class Model(BaseModel):\n a: CockroachDsn\n\n assert str(Model(a='cockroachdb://user:pass@localhost:5432/app').a) == 'cockroachdb://user:pass@localhost:5432/app'\n assert (\n str(Model(a='cockroachdb+psycopg2://user:pass@localhost:5432/app').a)\n == 'cockroachdb+psycopg2://user:pass@localhost:5432/app'\n )\n assert (\n str(Model(a='cockroachdb+asyncpg://user:pass@localhost:5432/app').a)\n == 'cockroachdb+asyncpg://user:pass@localhost:5432/app'\n )\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='http://example.org')\n assert exc_info.value.errors()[0]['type'] == 'url_scheme'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_amqp_dsns_test_amqp_dsns.assert_m_a_path_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_amqp_dsns_test_amqp_dsns.assert_m_a_path_is_None", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 516, "end_line": 544, "span_ids": ["test_amqp_dsns"], "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 test_amqp_dsns():\n class Model(BaseModel):\n a: AmqpDsn\n\n m = Model(a='amqp://user:pass@localhost:1234/app')\n assert str(m.a) == 'amqp://user:pass@localhost:1234/app'\n assert m.a.username == 'user'\n assert m.a.password == 'pass'\n\n m = Model(a='amqps://user:pass@localhost:5432//')\n assert str(m.a) == 'amqps://user:pass@localhost:5432//'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='http://example.org')\n assert exc_info.value.errors()[0]['type'] == 'url_scheme'\n\n # Password is not required for AMQP protocol\n m = Model(a='amqp://localhost:1234/app')\n assert str(m.a) == 'amqp://localhost:1234/app'\n assert m.a.username is None\n assert m.a.password is None\n\n # Only schema is required for AMQP protocol.\n # https://www.rabbitmq.com/uri-spec.html\n m = Model(a='amqps://')\n assert m.a.scheme == 'amqps'\n assert m.a.host is None\n assert m.a.port is None\n assert m.a.path 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_pydantic__pydantic/tests/test_networks.py_test_redis_dsns_test_redis_dsns.assert_m_a_path_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_redis_dsns_test_redis_dsns.assert_m_a_path_0_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 547, "end_line": 578, "span_ids": ["test_redis_dsns"], "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 test_redis_dsns():\n class Model(BaseModel):\n a: RedisDsn\n\n m = Model(a='redis://user:pass@localhost:1234/app')\n assert str(m.a) == 'redis://user:pass@localhost:1234/app'\n assert m.a.username == 'user'\n assert m.a.password == 'pass'\n\n m = Model(a='rediss://user:pass@localhost:1234/app')\n assert str(m.a) == 'rediss://user:pass@localhost:1234/app'\n\n m = Model(a='rediss://:pass@localhost:1234')\n assert str(m.a) == 'rediss://:pass@localhost:1234/0'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='http://example.org')\n assert exc_info.value.errors()[0]['type'] == 'url_scheme'\n\n # Password is not required for Redis protocol\n m = Model(a='redis://localhost:1234/app')\n assert str(m.a) == 'redis://localhost:1234/app'\n assert m.a.username is None\n assert m.a.password is None\n\n # Only schema is required for Redis protocol. Otherwise it will be set to default\n # https://www.iana.org/assignments/uri-schemes/prov/redis\n m = Model(a='rediss://')\n assert m.a.scheme == 'rediss'\n assert m.a.host == 'localhost'\n assert m.a.port == 6379\n assert m.a.path == '/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_pydantic__pydantic/tests/test_networks.py_test_mongodb_dsns_test_mongodb_dsns.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mongodb_dsns_test_mongodb_dsns.None_6", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 581, "end_line": 605, "span_ids": ["test_mongodb_dsns"], "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": "def test_mongodb_dsns():\n class Model(BaseModel):\n a: MongoDsn\n\n # TODO: Need to unit tests about \"Replica Set\", \"Sharded cluster\" and other deployment modes of MongoDB\n m = Model(a='mongodb://user:pass@localhost:1234/app')\n assert str(m.a) == 'mongodb://user:pass@localhost:1234/app'\n # insert_assert(m.a.hosts())\n assert m.a.hosts() == [{'username': 'user', 'password': 'pass', 'host': 'localhost', 'port': 1234}]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='http://example.org')\n assert exc_info.value.errors()[0]['type'] == 'url_scheme'\n\n # Password is not required for MongoDB protocol\n m = Model(a='mongodb://localhost:1234/app')\n assert str(m.a) == 'mongodb://localhost:1234/app'\n # insert_assert(m.a.hosts())\n assert m.a.hosts() == [{'username': None, 'password': None, 'host': 'localhost', 'port': 1234}]\n\n # Only schema and host is required for MongoDB protocol\n m = Model(a='mongodb://localhost')\n assert m.a.scheme == 'mongodb'\n # insert_assert(m.a.hosts())\n assert m.a.hosts() == [{'username': None, 'password': None, 'host': 'localhost', 'port': 27017}]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_kafka_dsns_test_kafka_dsns.assert_m_a_password_is_No": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_kafka_dsns_test_kafka_dsns.assert_m_a_password_is_No", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 608, "end_line": 627, "span_ids": ["test_kafka_dsns"], "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 test_kafka_dsns():\n class Model(BaseModel):\n a: KafkaDsn\n\n m = Model(a='kafka://')\n assert m.a.scheme == 'kafka'\n assert m.a.host == 'localhost'\n assert m.a.port == 9092\n assert str(m.a) == 'kafka://localhost:9092'\n\n m = Model(a='kafka://kafka1')\n assert str(m.a) == 'kafka://kafka1:9092'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='http://example.org')\n assert exc_info.value.errors()[0]['type'] == 'url_scheme'\n\n m = Model(a='kafka://kafka3:9093')\n assert m.a.username is None\n assert m.a.password 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_pydantic__pydantic/tests/test_networks.py_test_custom_schemes_test_json.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_custom_schemes_test_json.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 630, "end_line": 655, "span_ids": ["test_custom_schemes", "test_json"], "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 test_custom_schemes():\n class Model(BaseModel):\n v: Annotated[Url, UrlConstraints(allowed_schemes=['ws', 'wss']), Strict()]\n\n class Model2(BaseModel):\n v: Annotated[Url, UrlConstraints(host_required=False, allowed_schemes=['foo'])]\n\n assert str(Model(v='ws://example.org').v) == 'ws://example.org/'\n assert str(Model2(v='foo:///foo/bar').v) == 'foo:///foo/bar'\n\n with pytest.raises(ValidationError, match=r\"URL scheme should be 'ws' or 'wss' \\[type=url_scheme,\"):\n Model(v='http://example.org')\n\n with pytest.raises(ValidationError, match='leading or trailing control or space character are ignored in URLs'):\n Model(v='ws://example.org ')\n\n with pytest.raises(ValidationError, match=r'syntax rules, expected // \\[type=url_syntax_violation,'):\n Model(v='ws:///foo/bar')\n\n\ndef test_json():\n class Model(BaseModel):\n v: HttpUrl\n\n m = Model(v='http://foo@example.net')\n assert m.model_dump_json() == '{\"v\":\"http://foo@example.net/\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_valid_test_address_valid.assert_validate_email_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_valid_test_address_valid.assert_validate_email_val", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 658, "end_line": 693, "span_ids": ["test_address_valid"], "tokens": 725}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(not email_validator, reason='email_validator not installed')\n@pytest.mark.parametrize(\n 'value,name,email',\n [\n ('foobar@example.com', 'foobar', 'foobar@example.com'),\n ('s@muelcolvin.com', 's', 's@muelcolvin.com'),\n ('Samuel Colvin ', 'Samuel Colvin', 's@muelcolvin.com'),\n ('foobar ', 'foobar', 'foobar@example.com'),\n (' foo.bar@example.com', 'foo.bar', 'foo.bar@example.com'),\n ('foo.bar@example.com ', 'foo.bar', 'foo.bar@example.com'),\n ('foo BAR ', 'foo BAR', 'foobar@example.com'),\n ('FOO bar ', 'FOO bar', 'foobar@example.com'),\n (' Whatever ', 'Whatever', 'foobar@example.com'),\n ('Whatever < foobar@example.com>', 'Whatever', 'foobar@example.com'),\n (' ', 'FOOBAR', 'FOOBAR@example.com'),\n ('\u00f1o\u00f1\u00f3@example.com', '\u00f1o\u00f1\u00f3', '\u00f1o\u00f1\u00f3@example.com'),\n ('\u6211\u8cb7@example.com', '\u6211\u8cb7', '\u6211\u8cb7@example.com'),\n ('\u7532\u6590\u9ed2\u5ddd\u65e5\u672c@example.com', '\u7532\u6590\u9ed2\u5ddd\u65e5\u672c', '\u7532\u6590\u9ed2\u5ddd\u65e5\u672c@example.com'),\n (\n '\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444@example.com',\n '\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444',\n '\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444@example.com',\n ),\n ('\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937@domain.with.idn.tld', '\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937', '\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937@domain.with.idn.tld'),\n ('foo.bar@example.com', 'foo.bar', 'foo.bar@example.com'),\n ('foo.bar@exam-ple.com ', 'foo.bar', 'foo.bar@exam-ple.com'),\n ('\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2@\u03b5\u03b5\u03c4\u03c4.gr', '\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2', '\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2@\u03b5\u03b5\u03c4\u03c4.gr'),\n ('foobar@\u0430\u0440\u0440\u04cf\u0435.com', 'foobar', 'foobar@\u0430\u0440\u0440\u04cf\u0435.com'),\n ('foobar@xn--80ak6aa92e.com', 'foobar', 'foobar@\u0430\u0440\u0440\u04cf\u0435.com'),\n ('\u0430\u0440\u0440\u04cf\u0435@example.com', '\u0430\u0440\u0440\u04cf\u0435', '\u0430\u0440\u0440\u04cf\u0435@example.com'),\n ('xn--80ak6aa92e@example.com', 'xn--80ak6aa92e', 'xn--80ak6aa92e@example.com'),\n ('\uf96e\u58eb\u8c6a@\u81fa\u7db2\u4e2d\u5fc3.tw', '\u8449\u58eb\u8c6a', '\u8449\u58eb\u8c6a@\u81fa\u7db2\u4e2d\u5fc3.tw'),\n ],\n)\ndef test_address_valid(value, name, email):\n assert validate_email(value) == (name, email)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_invalid_test_address_invalid.with_pytest_raises_Pydant.validate_email_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_invalid_test_address_invalid.with_pytest_raises_Pydant.validate_email_value_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 696, "end_line": 728, "span_ids": ["test_address_invalid"], "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": "@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\n@pytest.mark.parametrize(\n 'value,reason',\n [\n ('@example.com', 'There must be something before the @-sign.'),\n ('f oo.bar@example.com', 'The email address contains invalid characters before the @-sign'),\n ('foobar', 'The email address is not valid. It must have exactly one @-sign.'),\n ('foobar@localhost', 'The domain name localhost is not valid. It should have a period.'),\n ('foobar@127.0.0.1', 'The domain name 127.0.0.1 is not valid. It is not within a valid top-level domain.'),\n ('foo.bar@exam\\nple.com ', None),\n ('foobar ', None),\n ('foobar >', None),\n ('foobar <', None),\n ('foobar <>', None),\n ],\n)\ndef test_address_invalid(value, reason):\n with pytest.raises(PydanticCustomError, match=f'value is not a valid email address: {reason or \"\"}'):\n validate_email(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_pydantic__pydantic/tests/test_networks.py_test_email_validator_not_installed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_email_validator_not_installed_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 731, "end_line": 746, "span_ids": ["test_name_email", "test_email_validator_not_installed"], "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": "@pytest.mark.skipif(email_validator, reason='email_validator is installed')\ndef test_email_validator_not_installed():\n with pytest.raises(ImportError):\n validate_email('s@muelcolvin.com')\n\n\n@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\ndef test_name_email():\n class Model(BaseModel):\n v: NameEmail\n\n assert str(Model(v=NameEmail('foo bar', 'foobaR@example.com')).v) == 'foo bar '\n assert str(Model(v='foo bar ').v) == 'foo bar '\n assert NameEmail('foo bar', 'foobaR@example.com') == NameEmail('foo bar', 'foobaR@example.com')\n assert NameEmail('foo bar', 'foobaR@example.com') != NameEmail('foo bar', 'different@example.com')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_from_ipaddress_import_IPv_test_ipaddress_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_from_ipaddress_import_IPv_test_ipaddress_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["imports", "test_ipaddress_success"], "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": "from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom typing import Any, List\n\nimport pytest\n\nfrom pydantic import BaseModel, IPvAnyAddress, IPvAnyInterface, IPvAnyNetwork, ValidationError\nfrom pydantic.config import ConfigDict\n\n\n@pytest.mark.parametrize(\n 'value,cls',\n [\n ('0.0.0.0', IPv4Address),\n ('1.1.1.1', IPv4Address),\n ('10.10.10.10', IPv4Address),\n ('192.168.0.1', IPv4Address),\n ('255.255.255.255', IPv4Address),\n ('::1:0:1', IPv6Address),\n ('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', IPv6Address),\n (b'\\x00\\x00\\x00\\x00', IPv4Address),\n (b'\\x01\\x01\\x01\\x01', IPv4Address),\n (b'\\n\\n\\n\\n', IPv4Address),\n (b'\\xc0\\xa8\\x00\\x01', IPv4Address),\n (b'\\xff\\xff\\xff\\xff', IPv4Address),\n (b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01', IPv6Address),\n (b'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Address),\n (0, IPv4Address),\n (16_843_009, IPv4Address),\n (168_430_090, IPv4Address),\n (3_232_235_521, IPv4Address),\n (4_294_967_295, IPv4Address),\n (4_294_967_297, IPv6Address),\n (340_282_366_920_938_463_463_374_607_431_768_211_455, IPv6Address),\n (IPv4Address('192.168.0.1'), IPv4Address),\n (IPv6Address('::1:0:1'), IPv6Address),\n ],\n)\ndef test_ipaddress_success(value, cls):\n class Model(BaseModel):\n ip: IPvAnyAddress\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv4address_success_test_ipv4address_success.assert_Model_ipv4_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv4address_success_test_ipv4address_success.assert_Model_ipv4_value_", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 74, "span_ids": ["test_ipv4address_success"], "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": "@pytest.mark.parametrize(\n 'value',\n [\n '0.0.0.0',\n '1.1.1.1',\n '10.10.10.10',\n '192.168.0.1',\n '255.255.255.255',\n b'\\x00\\x00\\x00\\x00',\n b'\\x01\\x01\\x01\\x01',\n b'\\n\\n\\n\\n',\n b'\\xc0\\xa8\\x00\\x01',\n b'\\xff\\xff\\xff\\xff',\n 0,\n 16_843_009,\n 168_430_090,\n 3_232_235_521,\n 4_294_967_295,\n IPv4Address('0.0.0.0'),\n IPv4Address('1.1.1.1'),\n IPv4Address('10.10.10.10'),\n IPv4Address('192.168.0.1'),\n IPv4Address('255.255.255.255'),\n ],\n)\ndef test_ipv4address_success(value):\n class Model(BaseModel):\n ipv4: IPv4Address\n\n assert Model(ipv4=value).ipv4 == IPv4Address(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_strict_test_ip_strict.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_strict_test_ip_strict.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 170, "span_ids": ["test_ip_strict"], "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": "@pytest.mark.parametrize(\n 'tp,value,errors',\n [\n (\n IPv4Address,\n IPv4Address('0.0.0.0'),\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of IPv4Address',\n 'input': '0.0.0.0',\n 'ctx': {'class': 'IPv4Address'},\n }\n ],\n ),\n (\n IPv4Interface,\n IPv4Interface('192.168.0.0/24'),\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of IPv4Interface',\n 'input': '192.168.0.0/24',\n 'ctx': {'class': 'IPv4Interface'},\n }\n ],\n ),\n (\n IPv4Network,\n IPv4Network('192.168.0.0/24'),\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of IPv4Network',\n 'input': '192.168.0.0/24',\n 'ctx': {'class': 'IPv4Network'},\n }\n ],\n ),\n (\n IPv6Address,\n IPv6Address('::1:0:1'),\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of IPv6Address',\n 'input': '::1:0:1',\n 'ctx': {'class': 'IPv6Address'},\n }\n ],\n ),\n (\n IPv6Interface,\n IPv6Interface('2001:db00::0/120'),\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of IPv6Interface',\n 'input': '2001:db00::/120',\n 'ctx': {'class': 'IPv6Interface'},\n }\n ],\n ),\n (\n IPv6Network,\n IPv6Network('2001:db00::0/120'),\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of IPv6Network',\n 'input': '2001:db00::/120',\n 'ctx': {'class': 'IPv6Network'},\n }\n ],\n ),\n ],\n)\ndef test_ip_strict(tp: Any, value: Any, errors: List[Any]) -> None:\n class Model(BaseModel):\n v: tp\n\n model_config = ConfigDict(strict=True)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=str(value))\n assert exc_info.value.errors() == errors\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv6address_success_test_ipv6address_success.assert_Model_ipv6_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv6address_success_test_ipv6address_success.assert_Model_ipv6_value_", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 190, "span_ids": ["test_ipv6address_success"], "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": "@pytest.mark.parametrize(\n 'value',\n [\n '::1:0:1',\n 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',\n b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01',\n b'\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff',\n 4_294_967_297,\n 340_282_366_920_938_463_463_374_607_431_768_211_455,\n IPv6Address('::1:0:1'),\n IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'),\n ],\n)\ndef test_ipv6address_success(value):\n class Model(BaseModel):\n ipv6: IPv6Address\n\n assert Model(ipv6=value).ipv6 == IPv6Address(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipaddress_fails_test_ipaddress_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipaddress_fails_test_ipaddress_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 193, "end_line": 206, "span_ids": ["test_ipaddress_fails"], "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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1', -1, 2**128 + 1])\ndef test_ipaddress_fails(value):\n class Model(BaseModel):\n ip: IPvAnyAddress\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n assert exc_info.value.error_count() == 1\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_any_address',\n 'loc': ('ip',),\n 'msg': 'value is not a valid IPv4 or IPv6 address',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv4address_fails_test_ipv4address_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv4address_fails_test_ipv4address_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 209, "end_line": 222, "span_ids": ["test_ipv4address_fails"], "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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1', -1, 2**32 + 1, IPv6Address('::0:1:0')])\ndef test_ipv4address_fails(value):\n class Model(BaseModel):\n ipv4: IPv4Address\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ipv4=value)\n assert exc_info.value.error_count() == 1\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_v4_address',\n 'loc': ('ipv4',),\n 'msg': 'Input is not a valid IPv4 address',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv6address_fails_test_ipv6address_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipv6address_fails_test_ipv6address_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 225, "end_line": 239, "span_ids": ["test_ipv6address_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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1', -1, 2**128 + 1, IPv4Address('192.168.0.1')])\ndef test_ipv6address_fails(value):\n class Model(BaseModel):\n ipv6: IPv6Address\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ipv6=value)\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_v6_address',\n 'loc': ('ipv6',),\n 'msg': 'Input is not a valid IPv6 address',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipnetwork_success_test_ipnetwork_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipnetwork_success_test_ipnetwork_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 261, "span_ids": ["test_ipnetwork_success"], "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": "@pytest.mark.parametrize(\n 'value,cls',\n [\n ('192.168.0.0/24', IPv4Network),\n ('192.168.128.0/30', IPv4Network),\n ('2001:db00::0/120', IPv6Network),\n (2**32 - 1, IPv4Network), # no mask equals to mask /32\n (20_282_409_603_651_670_423_947_251_286_015, IPv6Network), # /128\n (b'\\xff\\xff\\xff\\xff', IPv4Network), # /32\n (b'\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Network),\n (('192.168.0.0', 24), IPv4Network),\n (('2001:db00::0', 120), IPv6Network),\n (IPv4Network('192.168.0.0/24'), IPv4Network),\n ],\n)\ndef test_ipnetwork_success(value, cls):\n class Model(BaseModel):\n ip: IPvAnyNetwork = None\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_network_success_test_ip_v4_network_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_network_success_test_ip_v4_network_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 279, "span_ids": ["test_ip_v4_network_success"], "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": "@pytest.mark.parametrize(\n 'value,cls',\n [\n ('192.168.0.0/24', IPv4Network),\n ('192.168.128.0/30', IPv4Network),\n (2**32 - 1, IPv4Network), # no mask equals to mask /32\n (b'\\xff\\xff\\xff\\xff', IPv4Network), # /32\n (('192.168.0.0', 24), IPv4Network),\n (IPv4Network('192.168.0.0/24'), IPv4Network),\n ],\n)\ndef test_ip_v4_network_success(value, cls):\n class Model(BaseModel):\n ip: IPv4Network = None\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_network_success_test_ip_v6_network_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_network_success_test_ip_v6_network_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 282, "end_line": 296, "span_ids": ["test_ip_v6_network_success"], "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": "@pytest.mark.parametrize(\n 'value,cls',\n [\n ('2001:db00::0/120', IPv6Network),\n (20_282_409_603_651_670_423_947_251_286_015, IPv6Network), # /128\n (b'\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Network),\n (('2001:db00::0', 120), IPv6Network),\n (IPv6Network('2001:db00::0/120'), IPv6Network),\n ],\n)\ndef test_ip_v6_network_success(value, cls):\n class Model(BaseModel):\n ip: IPv6Network = None\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipnetwork_fails_test_ipnetwork_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipnetwork_fails_test_ipnetwork_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 299, "end_line": 313, "span_ids": ["test_ipnetwork_fails"], "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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1/24', -1, 2**128 + 1])\ndef test_ipnetwork_fails(value):\n class Model(BaseModel):\n ip: IPvAnyNetwork = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_any_network',\n 'loc': ('ip',),\n 'msg': 'value is not a valid IPv4 or IPv6 network',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_network_fails_test_ip_v4_network_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_network_fails_test_ip_v4_network_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 316, "end_line": 330, "span_ids": ["test_ip_v4_network_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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1/24', -1, 2**128 + 1, '2001:db00::1/120'])\ndef test_ip_v4_network_fails(value):\n class Model(BaseModel):\n ip: IPv4Network = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_v4_network',\n 'loc': ('ip',),\n 'msg': 'Input is not a valid IPv4 network',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_network_fails_test_ip_v6_network_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_network_fails_test_ip_v6_network_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 348, "span_ids": ["test_ip_v6_network_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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1/24', -1, 2**128 + 1, '192.168.0.1/24'])\ndef test_ip_v6_network_fails(value):\n class Model(BaseModel):\n ip: IPv6Network = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_v6_network',\n 'loc': ('ip',),\n 'msg': 'Input is not a valid IPv6 network',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipinterface_success_test_ipinterface_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipinterface_success_test_ipinterface_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 351, "end_line": 382, "span_ids": ["test_ipinterface_success"], "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": "@pytest.mark.parametrize(\n 'value,cls',\n [\n ('192.168.0.0/24', IPv4Interface),\n ('192.168.0.1/24', IPv4Interface),\n ('192.168.128.0/30', IPv4Interface),\n ('192.168.128.1/30', IPv4Interface),\n ('2001:db00::0/120', IPv6Interface),\n ('2001:db00::1/120', IPv6Interface),\n (2**32 - 1, IPv4Interface), # no mask equals to mask /32\n (2**32 - 1, IPv4Interface), # so ``strict`` has no effect\n (20_282_409_603_651_670_423_947_251_286_015, IPv6Interface), # /128\n (20_282_409_603_651_670_423_947_251_286_014, IPv6Interface),\n (b'\\xff\\xff\\xff\\xff', IPv4Interface), # /32\n (b'\\xff\\xff\\xff\\xff', IPv4Interface),\n (b'\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Interface),\n (b'\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Interface),\n (('192.168.0.0', 24), IPv4Interface),\n (('192.168.0.1', 24), IPv4Interface),\n (('2001:db00::0', 120), IPv6Interface),\n (('2001:db00::1', 120), IPv6Interface),\n (IPv4Interface('192.168.0.0/24'), IPv4Interface),\n (IPv4Interface('192.168.0.1/24'), IPv4Interface),\n (IPv6Interface('2001:db00::0/120'), IPv6Interface),\n (IPv6Interface('2001:db00::1/120'), IPv6Interface),\n ],\n)\ndef test_ipinterface_success(value, cls):\n class Model(BaseModel):\n ip: IPvAnyInterface = None\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_interface_success_test_ip_v4_interface_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_interface_success_test_ip_v4_interface_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 385, "end_line": 406, "span_ids": ["test_ip_v4_interface_success"], "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": "@pytest.mark.parametrize(\n 'value,cls',\n [\n ('192.168.0.0/24', IPv4Interface),\n ('192.168.0.1/24', IPv4Interface),\n ('192.168.128.0/30', IPv4Interface),\n ('192.168.128.1/30', IPv4Interface),\n (2**32 - 1, IPv4Interface), # no mask equals to mask /32\n (2**32 - 1, IPv4Interface), # so ``strict`` has no effect\n (b'\\xff\\xff\\xff\\xff', IPv4Interface), # /32\n (b'\\xff\\xff\\xff\\xff', IPv4Interface),\n (('192.168.0.0', 24), IPv4Interface),\n (('192.168.0.1', 24), IPv4Interface),\n (IPv4Interface('192.168.0.0/24'), IPv4Interface),\n (IPv4Interface('192.168.0.1/24'), IPv4Interface),\n ],\n)\ndef test_ip_v4_interface_success(value, cls):\n class Model(BaseModel):\n ip: IPv4Interface\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_interface_success_test_ip_v6_interface_success.assert_Model_ip_value_ip": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_interface_success_test_ip_v6_interface_success.assert_Model_ip_value_ip", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 409, "end_line": 428, "span_ids": ["test_ip_v6_interface_success"], "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": "@pytest.mark.parametrize(\n 'value,cls',\n [\n ('2001:db00::0/120', IPv6Interface),\n ('2001:db00::1/120', IPv6Interface),\n (20_282_409_603_651_670_423_947_251_286_015, IPv6Interface), # /128\n (20_282_409_603_651_670_423_947_251_286_014, IPv6Interface),\n (b'\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Interface),\n (b'\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff', IPv6Interface),\n (('2001:db00::0', 120), IPv6Interface),\n (('2001:db00::1', 120), IPv6Interface),\n (IPv6Interface('2001:db00::0/120'), IPv6Interface),\n (IPv6Interface('2001:db00::1/120'), IPv6Interface),\n ],\n)\ndef test_ip_v6_interface_success(value, cls):\n class Model(BaseModel):\n ip: IPv6Interface = None\n\n assert Model(ip=value).ip == cls(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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipinterface_fails_test_ipinterface_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipinterface_fails_test_ipinterface_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 431, "end_line": 446, "span_ids": ["test_ipinterface_fails"], "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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1/24', -1, 2**128 + 1])\ndef test_ipinterface_fails(value):\n class Model(BaseModel):\n ip: IPvAnyInterface = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_any_interface',\n 'loc': ('ip',),\n 'msg': 'value is not a valid IPv4 or IPv6 interface',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_interface_fails_test_ip_v4_interface_fails.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v4_interface_fails_test_ip_v4_interface_fails.None_1", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 449, "end_line": 464, "span_ids": ["test_ip_v4_interface_fails"], "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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1/24', -1, 2**128 + 1])\ndef test_ip_v4_interface_fails(value):\n class Model(BaseModel):\n ip: IPv4Interface = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_v4_interface',\n 'loc': ('ip',),\n 'msg': 'Input is not a valid IPv4 interface',\n 'input': 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_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_interface_fails_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ip_v6_interface_fails_", "embedding": null, "metadata": {"file_path": "tests/test_networks_ipaddress.py", "file_name": "test_networks_ipaddress.py", "file_type": "text/x-python", "category": "test", "start_line": 467, "end_line": 483, "span_ids": ["test_ip_v6_interface_fails"], "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": "@pytest.mark.parametrize('value', ['hello,world', '192.168.0.1.1.1/24', -1, 2**128 + 1])\ndef test_ip_v6_interface_fails(value):\n class Model(BaseModel):\n ip: IPv6Interface = None\n\n with pytest.raises(ValidationError) as exc_info:\n Model(ip=value)\n\n assert exc_info.value.error_count() == 1\n # insert_assert(exc_info.value.errors()[0])\n assert exc_info.value.errors()[0] == {\n 'type': 'ip_v6_interface',\n 'loc': ('ip',),\n 'msg': 'Input is not a valid IPv6 interface',\n 'input': 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_pydantic__pydantic/tests/test_parse.py_from_typing_import_List__test_model_validate_submodel.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_from_typing_import_List__test_model_validate_submodel.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["imports", "test_model_validate_fails", "test_obj", "Model", "test_model_validate_submodel"], "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 List, Tuple\n\nimport pytest\n\nfrom pydantic import BaseModel, ValidationError, model_serializer, parse_obj_as, root_validator\n\n\nclass Model(BaseModel):\n a: float\n b: int = 10\n\n\ndef test_obj():\n m = Model.model_validate(dict(a=10.2))\n assert str(m) == 'a=10.2 b=10'\n\n\ndef test_model_validate_fails():\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate([1, 2, 3])\n assert exc_info.value.errors() == [\n {'input': [1, 2, 3], 'loc': (), 'msg': 'Input should be a valid dictionary', 'type': 'dict_type'}\n ]\n\n\ndef test_model_validate_submodel():\n m = Model.model_validate(Model(a=10.2))\n assert m.model_dump() == {'a': 10.2, 'b': 10}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_wrong_model_test_root_model_error.with_pytest_raises_.MyModel.__root__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_wrong_model_test_root_model_error.with_pytest_raises_.MyModel.__root__", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 53, "span_ids": ["test_model_validate_wrong_model", "test_root_model_error"], "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 test_model_validate_wrong_model():\n class Foo(BaseModel):\n c: int = 123\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate(Foo())\n assert exc_info.value.errors() == [\n {'input': Foo(), 'loc': (), 'msg': 'Input should be a valid dictionary', 'type': 'dict_type'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate(Foo().model_dump())\n assert exc_info.value.errors() == [{'input': {'c': 123}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}]\n\n\ndef test_root_model_error():\n with pytest.raises(\n TypeError,\n match='__root__ models are no longer supported in v2',\n ):\n\n class MyModel(BaseModel):\n __root__: 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_pydantic__pydantic/tests/test_parse.py_test_model_validate_root_test_model_validate_root.MyModel.model_modify_json_schema.return.json_schema_properties_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_root_test_model_validate_root.MyModel.model_modify_json_schema.return.json_schema_properties_", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 78, "span_ids": ["test_model_validate_root"], "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 test_model_validate_root():\n class MyModel(BaseModel):\n root: str\n\n # Note that the following three definitions require no changes across all __root__ models\n # I couldn't see a nice way to create a decorator that reduces the boilerplate,\n # but if we want to discourage this pattern, perhaps that's okay?\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\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_pydantic__pydantic/tests/test_parse.py_test_model_validate_root._Validation_test_model_validate_root.assert_m_model_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_root._Validation_test_model_validate_root.assert_m_model_json_schem", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 80, "end_line": 91, "span_ids": ["test_model_validate_root"], "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 test_model_validate_root():\n\n # Validation\n m = MyModel.model_validate('a')\n assert m.root == 'a'\n\n # Serialization\n # TODO: Possible concern \u2014 `model_dump` is annotated as returning dict[str, Any] \u2014 is that okay, given\n # model_serializer could change that? Should we try to reflect it in the mypy plugin?\n assert m.model_dump() == {'root': 'a'}\n assert m.model_dump_json() == '\"a\"'\n\n # JSON schema\n assert m.model_json_schema() == {'title': 'Root', '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_pydantic__pydantic/tests/test_parse.py_test_parse_root_list_test_parse_root_list.assert_m_root_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_root_list_test_parse_root_list.assert_m_root_a_", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 94, "end_line": 118, "span_ids": ["test_parse_root_list"], "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 test_parse_root_list():\n class MyModel(BaseModel):\n root: List[str]\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n m = MyModel.model_validate(['a'])\n assert m.model_dump() == {'root': ['a']}\n assert m.model_dump_json() == '[\"a\"]'\n assert m.root == ['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_pydantic__pydantic/tests/test_parse.py_test_parse_nested_root_list_test_parse_nested_root_list.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_root_list_test_parse_nested_root_list.None_1", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 150, "span_ids": ["test_parse_nested_root_list"], "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 test_parse_nested_root_list():\n class NestedData(BaseModel):\n id: str\n\n class NestedModel(BaseModel):\n root: List[NestedData]\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n class MyModel(BaseModel):\n nested: NestedModel\n\n m = MyModel.model_validate({'nested': [{'id': 'foo'}]})\n assert isinstance(m.nested, NestedModel)\n assert isinstance(m.nested.root[0], NestedData)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_root_tuple_test_parse_nested_root_tuple.assert_isinstance_nested_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_root_tuple_test_parse_nested_root_tuple.assert_isinstance_nested_", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 153, "end_line": 186, "span_ids": ["test_parse_nested_root_tuple"], "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 test_parse_nested_root_tuple():\n class NestedData(BaseModel):\n id: str\n\n class NestedModel(BaseModel):\n root: Tuple[int, NestedData]\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n class MyModel(BaseModel):\n nested: List[NestedModel]\n\n data = [0, {'id': 'foo'}]\n m = MyModel.model_validate({'nested': [data]})\n assert isinstance(m.nested[0], NestedModel)\n assert isinstance(m.nested[0].root[1], NestedData)\n\n nested = parse_obj_as(NestedModel, data)\n assert isinstance(nested, NestedModel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_custom_root_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_parse_nested_custom_root_", "embedding": null, "metadata": {"file_path": "tests/test_parse.py", "file_name": "test_parse.py", "file_type": "text/x-python", "category": "test", "start_line": 189, "end_line": 240, "span_ids": ["test_json", "test_parse_nested_custom_root"], "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 test_parse_nested_custom_root():\n class NestedModel(BaseModel):\n root: List[str]\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n class MyModel(BaseModel):\n root: NestedModel\n\n @root_validator(pre=True)\n @classmethod\n def populate_root(cls, values):\n return {'root': values}\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n data = handler(self)\n if info.mode == 'json':\n return data['root']\n else:\n return data\n\n @classmethod\n def model_modify_json_schema(cls, json_schema):\n return json_schema['properties']['root']\n\n nested = ['foo', 'bar']\n m = MyModel.model_validate(nested)\n assert isinstance(m, MyModel)\n assert isinstance(m.root, NestedModel)\n assert isinstance(m.root.root, List)\n assert isinstance(m.root.root[0], str)\n\n\ndef test_json():\n assert Model.model_validate_json('{\"a\": 12, \"b\": 8}') == Model(a=12, b=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_pydantic__pydantic/tests/test_private_attributes.py_platform_test_private_attribute.assert_m___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_platform_test_private_attribute.assert_m___dict___", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "test_private_attribute"], "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": "import platform\nfrom typing import ClassVar, Generic, TypeVar\n\nimport pytest\n\nfrom pydantic import BaseModel, ConfigDict, Extra, PrivateAttr\nfrom pydantic.fields import Undefined\n\n\ndef test_private_attribute():\n default = {'a': {}}\n\n class Model(BaseModel):\n _foo = PrivateAttr(default)\n\n assert Model.__slots__ == {'_foo'}\n if platform.python_implementation() == 'PyPy':\n repr(Model._foo).startswith('\"\n\n m = Model()\n assert m._foo == default\n assert m._foo is not default\n assert m._foo['a'] is not default['a']\n\n m._foo = None\n assert m._foo is None\n\n assert m.model_dump() == {}\n assert m.__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_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_nested_test_private_attribute_factory.assert_m___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_nested_test_private_attribute_factory.assert_m___dict___", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 73, "span_ids": ["test_private_attribute_factory", "test_private_attribute_nested"], "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 test_private_attribute_nested():\n class SubModel(BaseModel):\n _foo = PrivateAttr(42)\n x: int\n\n class Model(BaseModel):\n y: int\n sub: SubModel\n\n m = Model(y=1, sub={'x': 2})\n assert m.sub._foo == 42\n\n\ndef test_private_attribute_factory():\n default = {'a': {}}\n\n def factory():\n return default\n\n class Model(BaseModel):\n _foo = PrivateAttr(default_factory=factory)\n\n assert Model.__slots__ == {'_foo'}\n if platform.python_implementation() == 'PyPy':\n repr(Model._foo).startswith('\"\n\n assert Model.__private_attributes__ == {'_foo': PrivateAttr(default_factory=factory)}\n\n m = Model()\n assert m._foo == default\n assert m._foo is default\n assert m._foo['a'] is default['a']\n\n m._foo = None\n assert m._foo is None\n\n assert m.model_dump() == {}\n assert m.__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_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_annotation_test_private_attribute_annotation.assert_m___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_annotation_test_private_attribute_annotation.assert_m___dict___", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 109, "span_ids": ["test_private_attribute_annotation"], "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 test_private_attribute_annotation():\n class Model(BaseModel):\n \"\"\"The best model\"\"\"\n\n _foo: str\n\n assert Model.__slots__ == {'_foo'}\n if platform.python_implementation() == 'PyPy':\n repr(Model._foo).startswith('\"\n assert Model.__private_attributes__ == {'_foo': PrivateAttr(Undefined)}\n assert repr(Model.__doc__) == \"'The best model'\"\n\n m = Model()\n with pytest.raises(AttributeError):\n m._foo\n\n m._foo = '123'\n assert m._foo == '123'\n\n m._foo = None\n assert m._foo is None\n\n del m._foo\n\n with pytest.raises(AttributeError):\n m._foo\n\n m._foo = '123'\n assert m._foo == '123'\n\n assert m.model_dump() == {}\n assert m.__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_pydantic__pydantic/tests/test_private_attributes.py_test_underscore_attrs_are_private_test_underscore_attrs_are_private.with_pytest_raises_.m._bar.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_underscore_attrs_are_private_test_underscore_attrs_are_private.with_pytest_raises_.m._bar.1", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 137, "span_ids": ["test_underscore_attrs_are_private"], "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 test_underscore_attrs_are_private():\n class Model(BaseModel):\n _foo: str = 'abc'\n _bar: ClassVar[str] = 'cba'\n\n assert Model.__slots__ == {'_foo'}\n if platform.python_implementation() == 'PyPy':\n repr(Model._foo).startswith('\"\n assert Model._bar == 'cba'\n assert Model.__private_attributes__ == {'_foo': PrivateAttr('abc')}\n\n m = Model()\n assert m._foo == 'abc'\n m._foo = None\n assert m._foo is None\n\n with pytest.raises(\n AttributeError,\n match=(\n '\"_bar\" is a ClassVar of `Model` and cannot be set on an instance. '\n 'If you want to set a value on the class, use `Model._bar = value`.'\n ),\n ):\n m._bar = 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_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_intersection_with_extra_field_test_private_attribute_invalid_name.with_pytest_raises_.Model.foo.PrivateAttr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_intersection_with_extra_field_test_private_attribute_invalid_name.with_pytest_raises_.Model.foo.PrivateAttr_", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 140, "end_line": 163, "span_ids": ["test_private_attribute_invalid_name", "test_private_attribute_intersection_with_extra_field"], "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 test_private_attribute_intersection_with_extra_field():\n class Model(BaseModel):\n _foo = PrivateAttr('private_attribute')\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert Model.__slots__ == {'_foo'}\n m = Model(_foo='field')\n assert m._foo == 'private_attribute'\n assert m.__dict__ == m.model_dump() == {'_foo': 'field'}\n\n m._foo = 'still_private'\n assert m._foo == 'still_private'\n assert m.__dict__ == m.model_dump() == {'_foo': 'field'}\n\n\ndef test_private_attribute_invalid_name():\n with pytest.raises(\n NameError,\n match='Private attributes \"foo\" must not be a valid field name; use sunder names, e.g. \"_foo\"',\n ):\n\n class Model(BaseModel):\n foo = PrivateAttr()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_slots_are_ignored_test_slots_are_ignored.with_pytest_raises_ValueE.m1.foo._not_spam_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_slots_are_ignored_test_slots_are_ignored.with_pytest_raises_ValueE.m1.foo._not_spam_", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 192, "span_ids": ["test_slots_are_ignored"], "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 test_slots_are_ignored():\n class Model(BaseModel):\n __slots__ = (\n 'foo',\n '_bar',\n )\n\n def __init__(self):\n super().__init__()\n for attr_ in self.__slots__:\n object.__setattr__(self, attr_, 'spam')\n\n assert Model.__private_attributes__ == {}\n assert set(Model.__slots__) == {'foo', '_bar'}\n m1 = Model()\n m2 = Model()\n\n for attr in Model.__slots__:\n assert object.__getattribute__(m1, attr) == 'spam'\n\n # In v2, you are always allowed to set instance attributes if the name starts with `_`.\n m1._bar = 'not spam'\n assert m1._bar == 'not spam'\n assert m2._bar == 'spam'\n\n with pytest.raises(ValueError, match='\"Model\" object has no field \"foo\"'):\n m1.foo = 'not spam'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_default_and_default_factory_used_error_test_generic_private_attribute.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_default_and_default_factory_used_error_test_generic_private_attribute.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 223, "span_ids": ["test_generic_private_attribute", "test_config_override_init", "test_default_and_default_factory_used_error"], "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 test_default_and_default_factory_used_error():\n with pytest.raises(ValueError, match='cannot specify both default and default_factory'):\n PrivateAttr(default=123, default_factory=lambda: 321)\n\n\ndef test_config_override_init():\n class MyModel(BaseModel):\n x: str\n _private_attr: int\n\n def __init__(self, **data) -> None:\n super().__init__(**data)\n self._private_attr = 123\n\n m = MyModel(x='hello')\n assert m.model_dump() == {'x': 'hello'}\n assert m._private_attr == 123\n\n\ndef test_generic_private_attribute():\n T = TypeVar('T')\n\n class Model(BaseModel, Generic[T]):\n value: T\n _private_value: T\n\n m = Model[int](value=1, _private_attr=3)\n m._private_value = 3\n assert m.model_dump() == {'value': 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_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_multiple_inheritance_test_private_attribute_multiple_inheritance.assert_m___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_multiple_inheritance_test_private_attribute_multiple_inheritance.assert_m___dict___", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 283, "span_ids": ["test_private_attribute_multiple_inheritance"], "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": "def test_private_attribute_multiple_inheritance():\n # We need to test this since PrivateAttr uses __slots__ and that has some restrictions with regards to\n # multiple inheritance\n default = {'a': {}}\n\n class GrandParentModel(BaseModel):\n _foo = PrivateAttr(default)\n\n class ParentAModel(GrandParentModel):\n pass\n\n class ParentBModel(GrandParentModel):\n _bar = PrivateAttr(default)\n\n class Model(ParentAModel, ParentBModel):\n _baz = PrivateAttr(default)\n\n assert GrandParentModel.__slots__ == {'_foo'}\n assert ParentBModel.__slots__ == {'_bar'}\n assert Model.__slots__ == {'_baz'}\n if platform.python_implementation() == 'PyPy':\n assert repr(Model._foo).startswith('\"\n assert repr(Model._bar) == \"\"\n assert repr(Model._baz) == \"\"\n assert Model.__private_attributes__ == {\n '_foo': PrivateAttr(default),\n '_bar': PrivateAttr(default),\n '_baz': PrivateAttr(default),\n }\n\n m = Model()\n assert m._foo == default\n assert m._foo is not default\n assert m._foo['a'] is not default['a']\n\n assert m._bar == default\n assert m._bar is not default\n assert m._bar['a'] is not default['a']\n\n assert m._baz == default\n assert m._baz is not default\n assert m._baz['a'] is not default['a']\n\n m._foo = None\n assert m._foo is None\n\n m._bar = None\n assert m._bar is None\n\n m._baz = None\n assert m._baz is None\n\n assert m.model_dump() == {}\n assert m.__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_pydantic__pydantic/tests/test_private_attributes.py_test_private_attributes_not_dunder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attributes_not_dunder_", "embedding": null, "metadata": {"file_path": "tests/test_private_attributes.py", "file_name": "test_private_attributes.py", "file_type": "text/x-python", "category": "test", "start_line": 286, "end_line": 315, "span_ids": ["test_private_attributes_not_dunder", "test_ignored_types_are_ignored"], "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 test_private_attributes_not_dunder() -> None:\n with pytest.raises(\n NameError,\n match='Private attributes \"__foo__\" must not have dunder names; use a single underscore prefix instead.',\n ):\n\n class MyModel(BaseModel):\n __foo__ = PrivateAttr({'private'})\n\n\ndef test_ignored_types_are_ignored() -> None:\n class IgnoredType:\n pass\n\n class MyModel(BaseModel):\n model_config = ConfigDict(ignored_types=(IgnoredType,))\n\n _a = IgnoredType()\n _b: int = IgnoredType()\n _c: IgnoredType\n _d: IgnoredType = IgnoredType()\n\n # The following are included to document existing behavior, and can be updated\n # if the current behavior does not match the desired behavior\n _e: int\n _f: int = 1\n _g = 1 # Note: this is completely ignored, in keeping with v1\n\n assert sorted(MyModel.__private_attributes__.keys()) == ['_e', '_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_pydantic__pydantic/tests/test_rich_repr.py_from_datetime_import_date_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_rich_repr.py_from_datetime_import_date_", "embedding": null, "metadata": {"file_path": "tests/test_rich_repr.py", "file_name": "test_rich_repr.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["imports", "user_fixture", "test_rich_repr", "test_rich_repr_color"], "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": "from datetime import datetime\nfrom typing import List, Optional\n\nimport pytest\n\nfrom pydantic import BaseModel\nfrom pydantic.color import Color\n\n\n@pytest.fixture(scope='session', name='User')\ndef user_fixture():\n class User(BaseModel):\n id: int\n name: str = 'John Doe'\n signup_ts: Optional[datetime] = None\n friends: List[int] = []\n\n return User\n\n\ndef test_rich_repr(User):\n user = User(id=22)\n rich_repr = list(user.__rich_repr__())\n\n assert rich_repr == [\n ('id', 22),\n ('name', 'John Doe'),\n ('signup_ts', None),\n ('friends', []),\n ]\n\n\ndef test_rich_repr_color(User):\n color = Color((10, 20, 30, 0.1))\n rich_repr = list(color.__rich_repr__())\n\n assert rich_repr == ['#0a141e1a', ('rgb', (10, 20, 30, 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_pydantic__pydantic/tests/test_serialize.py___test_serialize_decorator_always.None_1.m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py___test_serialize_decorator_always.None_1.m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["test_serialize_decorator_always", "docstring"], "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": "\"\"\"\nNew tests for v2 of serialization logic.\n\"\"\"\nfrom typing import Any, Optional\n\nimport pytest\nfrom pydantic_core import PydanticSerializationError, core_schema\nfrom typing_extensions import Annotated\n\nfrom pydantic import (\n BaseModel,\n Field,\n FieldSerializationInfo,\n SerializationInfo,\n SerializerFunctionWrapHandler,\n field_serializer,\n model_serializer,\n)\n\n\ndef test_serialize_decorator_always():\n class MyModel(BaseModel):\n x: Optional[int]\n\n @field_serializer('x', json_return_type='str')\n def customise_x_serialisation(v, _info):\n return f'{v:,}'\n\n assert MyModel(x=1234).model_dump() == {'x': '1,234'}\n assert MyModel(x=1234).model_dump(mode='json') == {'x': '1,234'}\n assert MyModel(x=1234).model_dump_json() == '{\"x\":\"1,234\"}'\n m = MyModel(x=None)\n # can't use v:, on None, hence error\n error_msg = (\n 'Error calling function `customise_x_serialisation`: '\n 'TypeError: unsupported format string passed to NoneType.__format__'\n )\n with pytest.raises(PydanticSerializationError, match=error_msg):\n m.model_dump()\n with pytest.raises(PydanticSerializationError, match=error_msg):\n m.model_dump_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_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_json_test_serialize_decorator_json.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_json_test_serialize_decorator_json.None_2", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 44, "end_line": 54, "span_ids": ["test_serialize_decorator_json"], "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 test_serialize_decorator_json():\n class MyModel(BaseModel):\n x: int\n\n @field_serializer('x', json_return_type='str', when_used='json')\n def customise_x_serialisation(v, _info):\n return f'{v:,}'\n\n assert MyModel(x=1234).model_dump() == {'x': 1234}\n assert MyModel(x=1234).model_dump(mode='json') == {'x': '1,234'}\n assert MyModel(x=1234).model_dump_json() == '{\"x\":\"1,234\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_unless_none_test_serialize_decorator_unless_none.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_unless_none_test_serialize_decorator_unless_none.None_5", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 70, "span_ids": ["test_serialize_decorator_unless_none"], "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 test_serialize_decorator_unless_none():\n class MyModel(BaseModel):\n x: Optional[int]\n\n @field_serializer('x', when_used='unless-none')\n def customise_x_serialisation(v, _info):\n return f'{v:,}'\n\n assert MyModel(x=1234).model_dump() == {'x': '1,234'}\n assert MyModel(x=None).model_dump() == {'x': None}\n assert MyModel(x=1234).model_dump(mode='json') == {'x': '1,234'}\n assert MyModel(x=None).model_dump(mode='json') == {'x': None}\n assert MyModel(x=1234).model_dump_json() == '{\"x\":\"1,234\"}'\n assert MyModel(x=None).model_dump_json() == '{\"x\":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_pydantic__pydantic/tests/test_serialize.py_test_annotated_customisation_test_annotated_customisation.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_annotated_customisation_test_annotated_customisation.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 95, "span_ids": ["test_annotated_customisation"], "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 test_annotated_customisation():\n def parse_int(s: str, _: Any) -> int:\n return int(s.replace(',', ''))\n\n class CommaFriendlyIntLogic:\n @classmethod\n def __get_pydantic_core_schema__(cls, _schema):\n # here we ignore the schema argument (which is just `{'type': 'int'}`) and return our own\n return core_schema.general_before_validator_function(\n parse_int,\n core_schema.int_schema(),\n serialization=core_schema.format_ser_schema(',', when_used='unless-none'),\n )\n\n CommaFriendlyInt = Annotated[int, CommaFriendlyIntLogic]\n\n class MyModel(BaseModel):\n x: CommaFriendlyInt\n\n m = MyModel(x='1,000')\n assert m.x == 1000\n assert m.model_dump(mode='json') == {'x': '1,000'}\n assert m.model_dump_json() == '{\"x\":\"1,000\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_valid_signatures_test_serialize_valid_signatures.MyModel.ser_f4.field_serializer_f4_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_valid_signatures_test_serialize_valid_signatures.MyModel.ser_f4.field_serializer_f4_mo", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 126, "span_ids": ["test_serialize_valid_signatures"], "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 test_serialize_valid_signatures():\n def ser_plain(v: Any, info: SerializationInfo) -> Any:\n return f'{v:,}'\n\n def ser_wrap(v: Any, nxt: SerializerFunctionWrapHandler, info: SerializationInfo) -> Any:\n return f'{nxt(v):,}'\n\n class MyModel(BaseModel):\n f1: int\n f2: int\n f3: int\n f4: int\n\n @field_serializer('f1')\n def ser_f1(self, v: Any, info: FieldSerializationInfo) -> Any:\n assert self.f1 == 1_000\n assert v == 1_000\n assert info.field_name == 'f1'\n return f'{v:,}'\n\n @field_serializer('f2', mode='wrap')\n def ser_f2(self, v: Any, nxt: SerializerFunctionWrapHandler, info: FieldSerializationInfo) -> Any:\n assert self.f2 == 2_000\n assert v == 2_000\n assert info.field_name == 'f2'\n return f'{nxt(v):,}'\n\n ser_f3 = field_serializer('f3')(ser_plain)\n ser_f4 = field_serializer('f4', mode='wrap')(ser_wrap)\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_pydantic__pydantic/tests/test_serialize.py_test_serialize_valid_signatures.m_test_serialize_valid_signatures.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_valid_signatures.m_test_serialize_valid_signatures.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 128, "end_line": 136, "span_ids": ["test_serialize_valid_signatures"], "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": "def test_serialize_valid_signatures():\n # ... other code\n\n m = MyModel(**{f'f{x}': x * 1_000 for x in range(1, 9)})\n\n assert m.model_dump() == {\n 'f1': '1,000',\n 'f2': '2,000',\n 'f3': '3,000',\n 'f4': '4,000',\n }\n assert m.model_dump_json() == '{\"f1\":\"1,000\",\"f2\":\"2,000\",\"f3\":\"3,000\",\"f4\":\"4,000\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_invalid_signature_no_params_test_serialize_decorator_self_no_info.assert_MyModel_x_1234_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_invalid_signature_no_params_test_serialize_decorator_self_no_info.assert_MyModel_x_1234_mo", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 139, "end_line": 242, "span_ids": ["test_serialize_decorator_self_info", "test_invalid_signature_bad_plain_signature", "test_serialize_ignore_info_wrap", "test_invalid_signature_no_params", "test_invalid_signature_too_many_params_2", "test_invalid_signature_too_many_params_1", "test_serialize_ignore_info_plain", "test_serialize_decorator_self_no_info", "test_invalid_signature_single_params"], "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": "def test_invalid_signature_no_params() -> None:\n with pytest.raises(TypeError, match='Unrecognized serializer signature'):\n\n class _(BaseModel):\n x: int\n\n # caught by type checkers\n @field_serializer('x')\n def no_args() -> Any: # pragma: no cover\n ...\n\n\ndef test_invalid_signature_single_params() -> None:\n with pytest.raises(TypeError, match='Unrecognized serializer signature'):\n\n class _(BaseModel):\n x: int\n\n # not caught by type checkers\n @field_serializer('x')\n def no_args(self) -> Any: # pragma: no cover\n ...\n\n\ndef test_invalid_signature_too_many_params_1() -> None:\n with pytest.raises(TypeError, match='Unrecognized serializer signature'):\n\n class _(BaseModel):\n x: int\n\n # caught by type checkers\n @field_serializer('x')\n def no_args(self, value: Any, nxt: Any, info: Any, extra_param: Any) -> Any: # pragma: no cover\n ...\n\n\ndef test_invalid_signature_too_many_params_2() -> None:\n with pytest.raises(TypeError, match='Unrecognized serializer signature'):\n\n class _(BaseModel):\n x: int\n\n # caught by type checkers\n @field_serializer('x')\n @staticmethod\n def no_args(not_self: Any, value: Any, nxt: Any, info: Any) -> Any: # pragma: no cover\n ...\n\n\ndef test_invalid_signature_bad_plain_signature() -> None:\n with pytest.raises(TypeError, match='Unrecognized serializer signature for'):\n\n class _(BaseModel):\n x: int\n\n # caught by type checkers\n @field_serializer('x', mode='plain')\n def no_args(self, value: Any, nxt: Any, info: Any) -> Any: # pragma: no cover\n ...\n\n\ndef test_serialize_ignore_info_plain():\n class MyModel(BaseModel):\n x: int\n\n @field_serializer('x')\n def ser_x(v: Any) -> str:\n return f'{v:,}'\n\n assert MyModel(x=1234).model_dump() == {'x': '1,234'}\n\n\ndef test_serialize_ignore_info_wrap():\n class MyModel(BaseModel):\n x: int\n\n @field_serializer('x', mode='wrap')\n def ser_x(v: Any, handler: SerializerFunctionWrapHandler) -> str:\n return f'{handler(v):,}'\n\n assert MyModel(x=1234).model_dump() == {'x': '1,234'}\n\n\ndef test_serialize_decorator_self_info():\n class MyModel(BaseModel):\n x: Optional[int]\n\n @field_serializer('x', json_return_type='str')\n def customise_x_serialisation(self, v, info):\n return f'{info.mode}:{v:,}'\n\n assert MyModel(x=1234).model_dump() == {'x': 'python:1,234'}\n assert MyModel(x=1234).model_dump(mode='foobar') == {'x': 'foobar:1,234'}\n\n\ndef test_serialize_decorator_self_no_info():\n class MyModel(BaseModel):\n x: Optional[int]\n\n @field_serializer('x', json_return_type='str')\n def customise_x_serialisation(self, v):\n return f'{v:,}'\n\n assert MyModel(x=1234).model_dump() == {'x': '1,234'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_test_model_serializer_plain.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_test_model_serializer_plain.None_8", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 245, "end_line": 269, "span_ids": ["test_model_serializer_plain"], "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 test_model_serializer_plain():\n class MyModel(BaseModel):\n a: int\n b: bytes\n\n @model_serializer\n def _serialize(self):\n if self.b == b'custom':\n return f'MyModel(a={self.a!r}, b={self.b!r})'\n else:\n return self.__dict__\n\n m = MyModel(a=1, b='boom')\n assert m.model_dump() == {'a': 1, 'b': b'boom'}\n assert m.model_dump(mode='json') == {'a': 1, 'b': 'boom'}\n assert m.model_dump_json() == '{\"a\":1,\"b\":\"boom\"}'\n\n assert m.model_dump(exclude={'a'}) == {'a': 1, 'b': b'boom'} # exclude is ignored as we used self.__dict__\n assert m.model_dump(mode='json', exclude={'a'}) == {'a': 1, 'b': 'boom'}\n assert m.model_dump_json(exclude={'a'}) == '{\"a\":1,\"b\":\"boom\"}'\n\n m = MyModel(a=1, b='custom')\n assert m.model_dump() == \"MyModel(a=1, b=b'custom')\"\n assert m.model_dump(mode='json') == \"MyModel(a=1, b=b'custom')\"\n assert m.model_dump_json() == '\"MyModel(a=1, b=b\\'custom\\')\"'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_info_test_model_serializer_plain_info.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_info_test_model_serializer_plain_info.None_5", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 272, "end_line": 291, "span_ids": ["test_model_serializer_plain_info"], "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 test_model_serializer_plain_info():\n class MyModel(BaseModel):\n a: int\n b: bytes\n\n @model_serializer\n def _serialize(self, info):\n if info.exclude:\n return {k: v for k, v in self.__dict__.items() if k not in info.exclude}\n else:\n return self.__dict__\n\n m = MyModel(a=1, b='boom')\n assert m.model_dump() == {'a': 1, 'b': b'boom'}\n assert m.model_dump(mode='json') == {'a': 1, 'b': 'boom'}\n assert m.model_dump_json() == '{\"a\":1,\"b\":\"boom\"}'\n\n assert m.model_dump(exclude={'a'}) == {'b': b'boom'} # exclude is not ignored\n assert m.model_dump(mode='json', exclude={'a'}) == {'b': 'boom'}\n assert m.model_dump_json(exclude={'a'}) == '{\"b\":\"boom\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrap_test_model_serializer_wrap.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrap_test_model_serializer_wrap.None_5", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 294, "end_line": 313, "span_ids": ["test_model_serializer_wrap"], "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 test_model_serializer_wrap():\n class MyModel(BaseModel):\n a: int\n b: bytes\n c: bytes = Field(exclude=True)\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler):\n d = handler(self)\n d['extra'] = 42\n return d\n\n m = MyModel(a=1, b='boom', c='excluded')\n assert m.model_dump() == {'a': 1, 'b': b'boom', 'extra': 42}\n assert m.model_dump(mode='json') == {'a': 1, 'b': 'boom', 'extra': 42}\n assert m.model_dump_json() == '{\"a\":1,\"b\":\"boom\",\"extra\":42}'\n\n assert m.model_dump(exclude={'a'}) == {'b': b'boom', 'extra': 42}\n assert m.model_dump(mode='json', exclude={'a'}) == {'b': 'boom', 'extra': 42}\n assert m.model_dump_json(exclude={'a'}) == '{\"b\":\"boom\",\"extra\":42}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrap_info_test_model_serializer_wrap_info.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrap_info_test_model_serializer_wrap_info.None_5", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 316, "end_line": 335, "span_ids": ["test_model_serializer_wrap_info"], "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 test_model_serializer_wrap_info():\n class MyModel(BaseModel):\n a: int\n b: bytes\n c: bytes = Field(exclude=True)\n\n @model_serializer(mode='wrap')\n def _serialize(self, handler, info):\n d = handler(self)\n d['info'] = f'mode={info.mode} exclude={info.exclude}'\n return d\n\n m = MyModel(a=1, b='boom', c='excluded')\n assert m.model_dump() == {'a': 1, 'b': b'boom', 'info': 'mode=python exclude=None'}\n assert m.model_dump(mode='json') == {'a': 1, 'b': 'boom', 'info': 'mode=json exclude=None'}\n assert m.model_dump_json() == '{\"a\":1,\"b\":\"boom\",\"info\":\"mode=json exclude=None\"}'\n\n assert m.model_dump(exclude={'a'}) == {'b': b'boom', 'info': \"mode=python exclude={'a'}\"}\n assert m.model_dump(mode='json', exclude={'a'}) == {'b': 'boom', 'info': \"mode=json exclude={'a'}\"}\n assert m.model_dump_json(exclude={'a'}) == '{\"b\":\"boom\",\"info\":\"mode=json exclude={\\'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_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_json_return_type_test_model_serializer_plain_json_return_type.with_pytest_raises_Pydant.m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_plain_json_return_type_test_model_serializer_plain_json_return_type.with_pytest_raises_Pydant.m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 338, "end_line": 361, "span_ids": ["test_model_serializer_plain_json_return_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": "def test_model_serializer_plain_json_return_type():\n class MyModel(BaseModel):\n a: int\n\n @model_serializer(json_return_type='str_subclass')\n def _serialize(self):\n if self.a == 666:\n return self.a\n else:\n return f'MyModel(a={self.a!r})'\n\n m = MyModel(a=1)\n assert m.model_dump() == 'MyModel(a=1)'\n assert m.model_dump(mode='json') == 'MyModel(a=1)'\n assert m.model_dump_json() == '\"MyModel(a=1)\"'\n\n m = MyModel(a=666)\n assert m.model_dump() == 666\n with pytest.raises(TypeError, match=\"^'int' object cannot be converted to 'PyString'$\"):\n m.model_dump(mode='json')\n\n msg = \"^Error serializing to JSON: 'int' object cannot be converted to 'PyString'$\"\n with pytest.raises(PydanticSerializationError, match=msg):\n m.model_dump_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_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrong_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrong_args_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 364, "end_line": 397, "span_ids": ["test_model_serializer_no_self", "test_model_serializer_wrong_args", "test_model_serializer_classmethod"], "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 test_model_serializer_wrong_args():\n m = r'Unrecognized serializer signature for ' r'<.+MyModel._serialize at 0x\\w+> with `mode=plain`:\\(self, x, y, z\\)'\n with pytest.raises(TypeError, match=m):\n\n class MyModel(BaseModel):\n a: int\n\n @model_serializer\n def _serialize(self, x, y, z):\n return self\n\n\ndef test_model_serializer_no_self():\n with pytest.raises(TypeError, match='`@model_serializer` must be applied to instance methods'):\n\n class MyModel(BaseModel):\n a: int\n\n @model_serializer\n def _serialize(slf, x, y, z):\n return slf\n\n\ndef test_model_serializer_classmethod():\n with pytest.raises(TypeError, match='`@model_serializer` must be applied to instance methods'):\n\n class MyModel(BaseModel):\n a: int\n\n @model_serializer\n @classmethod\n def _serialize(self, x, y, z):\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_pydantic__pydantic/tests/test_strict.py_sys_test_parse_strict_mode_on_field_invalid.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_sys_test_parse_strict_mode_on_field_invalid.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_strict.py", "file_name": "test_strict.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 35, "span_ids": ["imports", "model_with_strict_field", "test_parse_strict_mode_on_field_invalid"], "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": "import sys\nfrom typing import Any, Type\n\nif sys.version_info < (3, 9):\n from typing_extensions import Annotated\nelse:\n from typing import Annotated\n\nimport pytest\n\nfrom pydantic import BaseModel, ConfigDict, Field, ValidationError\n\n\n@pytest.fixture(scope='session', name='ModelWithStrictField')\ndef model_with_strict_field():\n class ModelWithStrictField(BaseModel):\n a: Annotated[int, Field(strict=True)]\n\n return ModelWithStrictField\n\n\n@pytest.mark.parametrize(\n 'value',\n [\n '1',\n True,\n 1.0,\n ],\n)\ndef test_parse_strict_mode_on_field_invalid(value: Any, ModelWithStrictField: Type[BaseModel]) -> None:\n with pytest.raises(ValidationError) as exc_info:\n ModelWithStrictField(a=value)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('a',), 'msg': 'Input should be a valid integer', 'input': 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_pydantic__pydantic/tests/test_strict.py_test_parse_strict_mode_on_field_valid_model_with_strict_config_false.return.ModelWithStrictConfig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_strict_mode_on_field_valid_model_with_strict_config_false.return.ModelWithStrictConfig", "embedding": null, "metadata": {"file_path": "tests/test_strict.py", "file_name": "test_strict.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 56, "span_ids": ["model_with_strict_config_false", "test_parse_strict_mode_on_field_valid"], "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 test_parse_strict_mode_on_field_valid(ModelWithStrictField: Type[BaseModel]) -> None:\n value = ModelWithStrictField(a=1)\n assert value.model_dump() == {'a': 1}\n\n\n@pytest.fixture(scope='session', name='ModelWithStrictConfig')\ndef model_with_strict_config_false():\n class ModelWithStrictConfig(BaseModel):\n a: int\n # strict=False overrides the Config\n b: Annotated[int, Field(strict=False)]\n # strict=None or not including it is equivalent\n # lets this field be overridden by the Config\n c: Annotated[int, Field(strict=None)]\n d: Annotated[int, Field()]\n\n model_config = ConfigDict(strict=True)\n\n return ModelWithStrictConfig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_model_with_strict_config_enabled_test_parse_model_with_strict_config_enabled.assert_all_v_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_model_with_strict_config_enabled_test_parse_model_with_strict_config_enabled.assert_all_v_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_strict.py", "file_name": "test_strict.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 79, "span_ids": ["test_parse_model_with_strict_config_enabled"], "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 test_parse_model_with_strict_config_enabled(ModelWithStrictConfig: Type[BaseModel]) -> None:\n with pytest.raises(ValidationError) as exc_info:\n ModelWithStrictConfig(a='1', b=2, c=3, d=4)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('a',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n with pytest.raises(ValidationError) as exc_info:\n ModelWithStrictConfig(a=1, b=2, c='3', d=4)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('c',), 'msg': 'Input should be a valid integer', 'input': '3'}\n ]\n with pytest.raises(ValidationError) as exc_info:\n ModelWithStrictConfig(a=1, b=2, c=3, d='4')\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('d',), 'msg': 'Input should be a valid integer', 'input': '4'}\n ]\n values = [\n ModelWithStrictConfig(a=1, b='2', c=3, d=4),\n ModelWithStrictConfig(a=1, b=2, c=3, d=4),\n ]\n assert all(v.model_dump() == {'a': 1, 'b': 2, 'c': 3, 'd': 4} for v in 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_pydantic__pydantic/tests/test_strict.py_test_parse_model_with_strict_config_disabled_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_strict.py_test_parse_model_with_strict_config_disabled_", "embedding": null, "metadata": {"file_path": "tests/test_strict.py", "file_name": "test_strict.py", "file_type": "text/x-python", "category": "test", "start_line": 82, "end_line": 94, "span_ids": ["test_parse_model_with_strict_config_disabled"], "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 test_parse_model_with_strict_config_disabled(ModelWithStrictConfig: Type[BaseModel]) -> None:\n class Model(ModelWithStrictConfig):\n model_config = ConfigDict(strict=False)\n\n values = [\n Model(a='1', b=2, c=3, d=4),\n Model(a=1, b=2, c='3', d=4),\n Model(a=1, b=2, c=3, d='4'),\n Model(a=1, b='2', c=3, d=4),\n Model(a=1, b=2, c=3, d=4),\n ]\n assert all(v.model_dump() == {'a': 1, 'b': 2, 'c': 3, 'd': 4} for v in 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_pydantic__pydantic/tests/test_structural_pattern_matching.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_structural_pattern_matching.py_sys_", "embedding": null, "metadata": {"file_path": "tests/test_structural_pattern_matching.py", "file_name": "test_structural_pattern_matching.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "test_match_kwargs"], "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": "import sys\n\nimport pytest\n\n\n@pytest.mark.skipif(sys.version_info < (3, 10), reason='requires python 3.10 or higher')\ndef test_match_kwargs(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import BaseModel\n\nclass Model(BaseModel):\n a: str\n b: str\n\ndef main(model):\n match model:\n case Model(a='a', b=b):\n return b\n case Model(a='a2'):\n return 'b2'\n case _:\n return None\n\"\"\"\n )\n assert module.main(module.Model(a='a', b='b')) == 'b'\n assert module.main(module.Model(a='a2', b='b')) == 'b2'\n assert module.main(module.Model(a='x', b='b')) 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_pydantic__pydantic/tests/test_tools.py_from_typing_import_Dict__test_parse_obj_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_tools.py_from_typing_import_Dict__test_parse_obj_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_tools.py", "file_name": "test_tools.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 48, "span_ids": ["imports", "test_parse_obj", "test_parse_obj_fails", "test_parse_obj_as_model", "test_parse_obj_preserves_subclasses"], "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": "from typing import Dict, List, Mapping, Union\n\nimport pytest\n\nfrom pydantic import BaseModel, ValidationError\nfrom pydantic.dataclasses import dataclass\nfrom pydantic.tools import parse_obj_as, schema_json_of, schema_of\n\n\n@pytest.mark.parametrize('obj,type_,parsed', [('1', int, 1), (['1'], List[int], [1])])\ndef test_parse_obj(obj, type_, parsed):\n assert parse_obj_as(type_, obj) == parsed\n\n\ndef test_parse_obj_as_model():\n class Model(BaseModel):\n x: int\n y: bool\n z: str\n\n model_inputs = {'x': '1', 'y': 'true', 'z': 'abc'}\n assert parse_obj_as(Model, model_inputs) == Model(**model_inputs)\n\n\ndef test_parse_obj_preserves_subclasses():\n class ModelA(BaseModel):\n a: Mapping[int, str]\n\n class ModelB(ModelA):\n b: int\n\n model_b = ModelB(a={1: 'f'}, b=2)\n\n parsed = parse_obj_as(List[ModelA], [model_b])\n assert parsed == [model_b]\n\n\ndef test_parse_obj_fails():\n with pytest.raises(ValidationError) as exc_info:\n parse_obj_as(int, 'a')\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': (),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_tools.py_test_parsing_model_naming_test_parse_mapping_as.assert_parse_obj_as_Dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_tools.py_test_parsing_model_naming_test_parse_mapping_as.assert_parse_obj_as_Dict_", "embedding": null, "metadata": {"file_path": "tests/test_tools.py", "file_name": "test_tools.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 73, "span_ids": ["test_parse_mapping_as", "test_parse_as_dataclass", "test_parsing_model_naming"], "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 test_parsing_model_naming():\n with pytest.raises(ValidationError) as exc_info:\n parse_obj_as(int, 'a')\n assert str(exc_info.value).split('\\n')[0] == '1 validation error for int'\n\n with pytest.raises(ValidationError) as exc_info:\n with pytest.warns(DeprecationWarning, match='The type_name parameter is deprecated'):\n parse_obj_as(int, 'a', type_name='ParsingModel')\n assert str(exc_info.value).split('\\n')[0] == '1 validation error for int'\n\n\ndef test_parse_as_dataclass():\n @dataclass\n class PydanticDataclass:\n x: int\n\n inputs = {'x': '1'}\n assert parse_obj_as(PydanticDataclass, inputs) == PydanticDataclass(1)\n\n\ndef test_parse_mapping_as():\n inputs = {'1': '2'}\n assert parse_obj_as(Dict[int, int], inputs) == {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_pydantic__pydantic/tests/test_tools.py_test_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_tools.py_test_schema_", "embedding": null, "metadata": {"file_path": "tests/test_tools.py", "file_name": "test_tools.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 94, "span_ids": ["test_schema"], "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_schema():\n assert schema_of(Union[int, str], title='IntOrStr') == {\n 'title': 'IntOrStr',\n 'anyOf': [{'type': 'integer'}, {'type': 'string'}],\n }\n assert schema_json_of(Union[int, str], title='IntOrStr', indent=2) == (\n '{\\n'\n ' \"anyOf\": [\\n'\n ' {\\n'\n ' \"type\": \"integer\"\\n'\n ' },\\n'\n ' {\\n'\n ' \"type\": \"string\"\\n'\n ' }\\n'\n ' ],\\n'\n ' \"title\": \"IntOrStr\"\\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_pydantic__pydantic/tests/test_types.py_itertools_test_strict_raw_type.with_pytest_raises_Valida.Model_v_b_fo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_itertools_test_strict_raw_type.with_pytest_raises_Valida.Model_v_b_fo_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 113, "span_ids": ["imports", "test_strict_raw_type", "test_constrained_bytes_default", "con_bytes_model_fixture", "test_constrained_bytes_good"], "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": "import itertools\nimport math\nimport os\nimport re\nimport sys\nimport uuid\nfrom collections import OrderedDict, deque\nfrom datetime import date, datetime, time, timedelta, timezone\nfrom decimal import Decimal\nfrom enum import Enum, IntEnum\nfrom pathlib import Path\nfrom typing import (\n Any,\n Callable,\n Deque,\n Dict,\n FrozenSet,\n Iterable,\n List,\n MutableSet,\n NewType,\n Optional,\n Pattern,\n Sequence,\n Set,\n Tuple,\n TypeVar,\n Union,\n)\nfrom uuid import UUID\n\nimport annotated_types\nimport pytest\nfrom dirty_equals import HasRepr\nfrom pydantic_core._pydantic_core import PydanticCustomError, SchemaError\nfrom typing_extensions import Annotated, Literal, TypedDict\n\nfrom pydantic import (\n UUID1,\n UUID3,\n UUID4,\n UUID5,\n BaseModel,\n ByteSize,\n ConfigDict,\n DirectoryPath,\n EmailStr,\n Field,\n FilePath,\n FiniteFloat,\n Json,\n NameEmail,\n NegativeFloat,\n NegativeInt,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n PositiveFloat,\n PositiveInt,\n SecretBytes,\n SecretStr,\n StrictBool,\n StrictBytes,\n StrictFloat,\n StrictInt,\n StrictStr,\n ValidationError,\n conbytes,\n condecimal,\n confloat,\n confrozenset,\n conint,\n conlist,\n conset,\n constr,\n)\nfrom pydantic.decorators import field_validator\nfrom pydantic.types import ImportString, SecretField, Strict\n\ntry:\n import email_validator\nexcept ImportError:\n email_validator = None\n\n# TODO add back tests for Iterator\n\n\n@pytest.fixture(scope='session', name='ConBytesModel')\ndef con_bytes_model_fixture():\n class ConBytesModel(BaseModel):\n v: conbytes(max_length=10) = b'foobar'\n\n return ConBytesModel\n\n\ndef test_constrained_bytes_good(ConBytesModel):\n m = ConBytesModel(v=b'short')\n assert m.v == b'short'\n\n\ndef test_constrained_bytes_default(ConBytesModel):\n m = ConBytesModel()\n assert m.v == b'foobar'\n\n\ndef test_strict_raw_type():\n class Model(BaseModel):\n v: Annotated[str, Strict]\n\n assert Model(v='foo').v == 'foo'\n with pytest.raises(ValidationError, match=r'Input should be a valid string \\[type=string_type,'):\n Model(v=b'fo')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_bytes_too_long_test_constrained_bytes_too_long.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_bytes_too_long_test_constrained_bytes_too_long.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 116, "end_line": 128, "span_ids": ["test_constrained_bytes_too_long"], "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 test_constrained_bytes_too_long(ConBytesModel):\n with pytest.raises(ValidationError) as exc_info:\n ConBytesModel(v=b'this is too long')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'bytes_too_long',\n 'loc': ('v',),\n 'msg': 'Data should have at most 10 bytes',\n 'input': b'this is too long',\n 'ctx': {'max_length': 10},\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_pydantic__pydantic/tests/test_types.py_test_constrained_bytes_strict_true_test_constrained_list_default.assert_m_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_bytes_strict_true_test_constrained_list_default.assert_m_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 131, "end_line": 192, "span_ids": ["test_constrained_bytes_strict_default", "test_constrained_bytes_strict_false", "test_constrained_list_good", "test_constrained_bytes_strict_true", "test_constrained_list_default"], "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 test_constrained_bytes_strict_true():\n class Model(BaseModel):\n v: conbytes(strict=True)\n\n assert Model(v=b'foobar').v == b'foobar'\n with pytest.raises(ValidationError):\n Model(v=bytearray('foobar', 'utf-8'))\n\n with pytest.raises(ValidationError):\n Model(v='foostring')\n\n with pytest.raises(ValidationError):\n Model(v=42)\n\n with pytest.raises(ValidationError):\n Model(v=0.42)\n\n\ndef test_constrained_bytes_strict_false():\n class Model(BaseModel):\n v: conbytes(strict=False)\n\n assert Model(v=b'foobar').v == b'foobar'\n assert Model(v=bytearray('foobar', 'utf-8')).v == b'foobar'\n assert Model(v='foostring').v == b'foostring'\n\n with pytest.raises(ValidationError):\n Model(v=42)\n\n with pytest.raises(ValidationError):\n Model(v=0.42)\n\n\ndef test_constrained_bytes_strict_default():\n class Model(BaseModel):\n v: conbytes()\n\n assert Model(v=b'foobar').v == b'foobar'\n assert Model(v=bytearray('foobar', 'utf-8')).v == b'foobar'\n assert Model(v='foostring').v == b'foostring'\n\n with pytest.raises(ValidationError):\n Model(v=42)\n\n with pytest.raises(ValidationError):\n Model(v=0.42)\n\n\ndef test_constrained_list_good():\n class ConListModelMax(BaseModel):\n v: conlist(int) = []\n\n m = ConListModelMax(v=[1, 2, 3])\n assert m.v == [1, 2, 3]\n\n\ndef test_constrained_list_default():\n class ConListModelMax(BaseModel):\n v: conlist(int) = []\n\n m = ConListModelMax()\n assert m.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_pydantic__pydantic/tests/test_types.py_test_constrained_list_too_long_test_constrained_list_too_long.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_too_long_test_constrained_list_too_long.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 210, "span_ids": ["test_constrained_list_too_long"], "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 test_constrained_list_too_long():\n class ConListModelMax(BaseModel):\n v: conlist(int, max_length=10) = []\n\n with pytest.raises(ValidationError) as exc_info:\n ConListModelMax(v=list(str(i) for i in range(11)))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_long',\n 'loc': ('v',),\n 'msg': 'List should have at most 10 items after validation, not 11',\n 'input': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],\n 'ctx': {'field_type': 'List', 'max_length': 10, 'actual_length': 11},\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_pydantic__pydantic/tests/test_types.py_test_constrained_list_too_short_test_constrained_list_too_short.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_too_short_test_constrained_list_too_short.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 213, "end_line": 228, "span_ids": ["test_constrained_list_too_short"], "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 test_constrained_list_too_short():\n class ConListModelMin(BaseModel):\n v: conlist(int, min_length=1)\n\n with pytest.raises(ValidationError) as exc_info:\n ConListModelMin(v=[])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('v',),\n 'msg': 'List should have at least 1 item after validation, not 0',\n 'input': [],\n 'ctx': {'field_type': 'List', 'min_length': 1, 'actual_length': 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_pydantic__pydantic/tests/test_types.py_test_constrained_list_optional_test_constrained_list_optional.assert_Model_req_a_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_optional_test_constrained_list_optional.assert_Model_req_a_o", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 231, "end_line": 259, "span_ids": ["test_constrained_list_optional"], "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 test_constrained_list_optional():\n class Model(BaseModel):\n req: Optional[conlist(str, min_length=1)]\n opt: Optional[conlist(str, min_length=1)] = None\n\n assert Model(req=None).model_dump() == {'req': None, 'opt': None}\n assert Model(req=None, opt=None).model_dump() == {'req': None, 'opt': None}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(req=[], opt=[])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('req',),\n 'msg': 'List should have at least 1 item after validation, not 0',\n 'input': [],\n 'ctx': {'field_type': 'List', 'min_length': 1, 'actual_length': 0},\n },\n {\n 'type': 'too_short',\n 'loc': ('opt',),\n 'msg': 'List should have at least 1 item after validation, not 0',\n 'input': [],\n 'ctx': {'field_type': 'List', 'min_length': 1, 'actual_length': 0},\n },\n ]\n\n assert Model(req=['a'], opt=['a']).model_dump() == {'req': ['a'], 'opt': ['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_pydantic__pydantic/tests/test_types.py_test_constrained_list_constraints_test_constrained_list_constraints.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_constraints_test_constrained_list_constraints.None_4", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 303, "span_ids": ["test_constrained_list_constraints"], "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 test_constrained_list_constraints():\n class ConListModelBoth(BaseModel):\n v: conlist(int, min_length=7, max_length=11)\n\n m = ConListModelBoth(v=list(range(7)))\n assert m.v == list(range(7))\n\n m = ConListModelBoth(v=list(range(11)))\n assert m.v == list(range(11))\n\n with pytest.raises(ValidationError) as exc_info:\n ConListModelBoth(v=list(range(6)))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('v',),\n 'msg': 'List should have at least 7 items after validation, not 6',\n 'input': [0, 1, 2, 3, 4, 5],\n 'ctx': {'field_type': 'List', 'min_length': 7, 'actual_length': 6},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n ConListModelBoth(v=list(range(12)))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_long',\n 'loc': ('v',),\n 'msg': 'List should have at most 11 items after validation, not 12',\n 'input': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],\n 'ctx': {'field_type': 'List', 'max_length': 11, 'actual_length': 12},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n ConListModelBoth(v=1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'list_type', 'loc': ('v',), 'msg': 'Input should be a valid list', 'input': 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_pydantic__pydantic/tests/test_types.py_test_constrained_list_item_type_fails_test_constrained_list_item_type_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_list_item_type_fails_test_constrained_list_item_type_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 306, "end_line": 332, "span_ids": ["test_constrained_list_item_type_fails"], "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 test_constrained_list_item_type_fails():\n class ConListModel(BaseModel):\n v: conlist(int) = []\n\n with pytest.raises(ValidationError) as exc_info:\n ConListModel(v=['a', 'b', 'c'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'b',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'c',\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_pydantic__pydantic/tests/test_types.py_test_conlist_test_conlist.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_conlist_test_conlist.None_2", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 335, "end_line": 373, "span_ids": ["test_conlist"], "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 test_conlist():\n class Model(BaseModel):\n foo: List[int] = Field(..., min_length=2, max_length=4)\n bar: conlist(str, min_length=1, max_length=4) = None\n\n assert Model(foo=[1, 2], bar=['spoon']).model_dump() == {'foo': [1, 2], 'bar': ['spoon']}\n\n msg = r'List should have at least 2 items after validation, not 1 \\[type=too_short,'\n with pytest.raises(ValidationError, match=msg):\n Model(foo=[1])\n\n msg = r'List should have at most 4 items after validation, not 5 \\[type=too_long,'\n with pytest.raises(ValidationError, match=msg):\n Model(foo=list(range(5)))\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=[1, 'x', 'y'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('foo', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('foo', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'y',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'list_type', 'loc': ('foo',), 'msg': 'Input should be a valid list', 'input': 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_pydantic__pydantic/tests/test_types.py_test_conlist_wrong_type_default_test_constrained_set_default_invalid.assert_m_v_not_valid_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_conlist_wrong_type_default_test_constrained_set_default_invalid.assert_m_v_not_valid_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 376, "end_line": 407, "span_ids": ["test_conlist_wrong_type_default", "test_constrained_set_good", "test_constrained_set_default", "test_constrained_set_default_invalid"], "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 test_conlist_wrong_type_default():\n \"\"\"It should not validate default value by default\"\"\"\n\n class Model(BaseModel):\n v: conlist(int) = 'a'\n\n m = Model()\n assert m.v == 'a'\n\n\ndef test_constrained_set_good():\n class Model(BaseModel):\n v: conset(int) = []\n\n m = Model(v=[1, 2, 3])\n assert m.v == {1, 2, 3}\n\n\ndef test_constrained_set_default():\n class Model(BaseModel):\n v: conset(int) = set()\n\n m = Model()\n assert m.v == set()\n\n\ndef test_constrained_set_default_invalid():\n class Model(BaseModel):\n v: conset(int) = 'not valid, not validated'\n\n m = Model()\n assert m.v == 'not valid, not validated'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_too_long_test_constrained_set_too_long.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_too_long_test_constrained_set_too_long.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 410, "end_line": 425, "span_ids": ["test_constrained_set_too_long"], "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 test_constrained_set_too_long():\n class ConSetModelMax(BaseModel):\n v: conset(int, max_length=10) = []\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModelMax(v={str(i) for i in range(11)})\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_long',\n 'loc': ('v',),\n 'msg': 'Set should have at most 10 items after validation, not 11',\n 'input': {'4', '3', '10', '9', '5', '6', '1', '8', '0', '7', '2'},\n 'ctx': {'field_type': 'Set', 'max_length': 10, 'actual_length': 11},\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_pydantic__pydantic/tests/test_types.py_test_constrained_set_too_short_test_constrained_set_too_short.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_too_short_test_constrained_set_too_short.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 428, "end_line": 443, "span_ids": ["test_constrained_set_too_short"], "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 test_constrained_set_too_short():\n class ConSetModelMin(BaseModel):\n v: conset(int, min_length=1)\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModelMin(v=[])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('v',),\n 'msg': 'Set should have at least 1 item after validation, not 0',\n 'input': [],\n 'ctx': {'field_type': 'Set', 'min_length': 1, 'actual_length': 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_pydantic__pydantic/tests/test_types.py_test_constrained_set_optional_test_constrained_set_optional.assert_Model_req_a_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_optional_test_constrained_set_optional.assert_Model_req_a_o", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 446, "end_line": 474, "span_ids": ["test_constrained_set_optional"], "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 test_constrained_set_optional():\n class Model(BaseModel):\n req: Optional[conset(str, min_length=1)]\n opt: Optional[conset(str, min_length=1)] = None\n\n assert Model(req=None).model_dump() == {'req': None, 'opt': None}\n assert Model(req=None, opt=None).model_dump() == {'req': None, 'opt': None}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(req=set(), opt=set())\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('req',),\n 'msg': 'Set should have at least 1 item after validation, not 0',\n 'input': set(),\n 'ctx': {'field_type': 'Set', 'min_length': 1, 'actual_length': 0},\n },\n {\n 'type': 'too_short',\n 'loc': ('opt',),\n 'msg': 'Set should have at least 1 item after validation, not 0',\n 'input': set(),\n 'ctx': {'field_type': 'Set', 'min_length': 1, 'actual_length': 0},\n },\n ]\n\n assert Model(req={'a'}, opt={'a'}).model_dump() == {'req': {'a'}, 'opt': {'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_pydantic__pydantic/tests/test_types.py_test_constrained_set_constraints_test_constrained_set_constraints.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_constraints_test_constrained_set_constraints.None_4", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 477, "end_line": 518, "span_ids": ["test_constrained_set_constraints"], "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 test_constrained_set_constraints():\n class ConSetModelBoth(BaseModel):\n v: conset(int, min_length=7, max_length=11)\n\n m = ConSetModelBoth(v=set(range(7)))\n assert m.v == set(range(7))\n\n m = ConSetModelBoth(v=set(range(11)))\n assert m.v == set(range(11))\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModelBoth(v=set(range(6)))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('v',),\n 'msg': 'Set should have at least 7 items after validation, not 6',\n 'input': {0, 1, 2, 3, 4, 5},\n 'ctx': {'field_type': 'Set', 'min_length': 7, 'actual_length': 6},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModelBoth(v=set(range(12)))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_long',\n 'loc': ('v',),\n 'msg': 'Set should have at most 11 items after validation, not 12',\n 'input': {0, 8, 1, 9, 2, 10, 3, 7, 11, 4, 6, 5},\n 'ctx': {'field_type': 'Set', 'max_length': 11, 'actual_length': 12},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModelBoth(v=1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'set_type', 'loc': ('v',), 'msg': 'Input should be a valid set', 'input': 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_pydantic__pydantic/tests/test_types.py_test_constrained_set_item_type_fails_test_constrained_set_item_type_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_set_item_type_fails_test_constrained_set_item_type_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 521, "end_line": 547, "span_ids": ["test_constrained_set_item_type_fails"], "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 test_constrained_set_item_type_fails():\n class ConSetModel(BaseModel):\n v: conset(int) = []\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModel(v=['a', 'b', 'c'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'b',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'c',\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_pydantic__pydantic/tests/test_types.py_test_conset_test_conset_not_required.assert_Model_foo_is_Non": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_conset_test_conset_not_required.assert_Model_foo_is_Non", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 550, "end_line": 596, "span_ids": ["test_conset_not_required", "test_conset"], "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": "def test_conset():\n class Model(BaseModel):\n foo: Set[int] = Field(..., min_length=2, max_length=4)\n bar: conset(str, min_length=1, max_length=4) = None\n\n assert Model(foo=[1, 2], bar=['spoon']).model_dump() == {'foo': {1, 2}, 'bar': {'spoon'}}\n\n assert Model(foo=[1, 1, 1, 2, 2], bar=['spoon']).model_dump() == {'foo': {1, 2}, 'bar': {'spoon'}}\n\n with pytest.raises(ValidationError, match='Set should have at least 2 items after validation, not 1'):\n Model(foo=[1])\n\n with pytest.raises(ValidationError, match='Set should have at most 4 items after validation, not 5'):\n Model(foo=list(range(5)))\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=[1, 'x', 'y'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('foo', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('foo', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'y',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'set_type', 'loc': ('foo',), 'msg': 'Input should be a valid set', 'input': 1}\n ]\n\n\ndef test_conset_not_required():\n class Model(BaseModel):\n foo: Optional[Set[int]] = None\n\n assert Model(foo=None).foo is None\n assert Model().foo 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_pydantic__pydantic/tests/test_types.py_test_confrozenset_test_confrozenset.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_confrozenset_test_confrozenset.None_5", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 599, "end_line": 640, "span_ids": ["test_confrozenset"], "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 test_confrozenset():\n class Model(BaseModel):\n foo: FrozenSet[int] = Field(..., min_length=2, max_length=4)\n bar: confrozenset(str, min_length=1, max_length=4) = None\n\n m = Model(foo=[1, 2], bar=['spoon'])\n assert m.model_dump() == {'foo': {1, 2}, 'bar': {'spoon'}}\n assert isinstance(m.foo, frozenset)\n assert isinstance(m.bar, frozenset)\n\n assert Model(foo=[1, 1, 1, 2, 2], bar=['spoon']).model_dump() == {'foo': {1, 2}, 'bar': {'spoon'}}\n\n with pytest.raises(ValidationError, match='Frozenset should have at least 2 items after validation, not 1'):\n Model(foo=[1])\n\n with pytest.raises(ValidationError, match='Frozenset should have at most 4 items after validation, not 5'):\n Model(foo=list(range(5)))\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=[1, 'x', 'y'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('foo', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('foo', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'y',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'frozen_set_type', 'loc': ('foo',), 'msg': 'Input should be a valid frozenset', 'input': 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_pydantic__pydantic/tests/test_types.py_test_confrozenset_not_required_test_constrained_frozenset_optional.assert_Model_req_a_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_confrozenset_not_required_test_constrained_frozenset_optional.assert_Model_req_a_o", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 643, "end_line": 679, "span_ids": ["test_constrained_frozenset_optional", "test_confrozenset_not_required"], "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": "def test_confrozenset_not_required():\n class Model(BaseModel):\n foo: Optional[FrozenSet[int]] = None\n\n assert Model(foo=None).foo is None\n assert Model().foo is None\n\n\ndef test_constrained_frozenset_optional():\n class Model(BaseModel):\n req: Optional[confrozenset(str, min_length=1)]\n opt: Optional[confrozenset(str, min_length=1)] = None\n\n assert Model(req=None).model_dump() == {'req': None, 'opt': None}\n assert Model(req=None, opt=None).model_dump() == {'req': None, 'opt': None}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(req=frozenset(), opt=frozenset())\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'too_short',\n 'loc': ('req',),\n 'msg': 'Frozenset should have at least 1 item after validation, not 0',\n 'input': frozenset(),\n 'ctx': {'field_type': 'Frozenset', 'min_length': 1, 'actual_length': 0},\n },\n {\n 'type': 'too_short',\n 'loc': ('opt',),\n 'msg': 'Frozenset should have at least 1 item after validation, not 0',\n 'input': frozenset(),\n 'ctx': {'field_type': 'Frozenset', 'min_length': 1, 'actual_length': 0},\n },\n ]\n\n assert Model(req={'a'}, opt={'a'}).model_dump() == {'req': {'a'}, 'opt': {'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_pydantic__pydantic/tests/test_types.py_constring_model_fixture_test_constrained_str_too_long.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_constring_model_fixture_test_constrained_str_too_long.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 682, "end_line": 712, "span_ids": ["constring_model_fixture", "test_constrained_str_too_long", "test_constrained_str_default", "test_constrained_str_good"], "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": "@pytest.fixture(scope='session', name='ConStringModel')\ndef constring_model_fixture():\n class ConStringModel(BaseModel):\n v: constr(max_length=10) = 'foobar'\n\n return ConStringModel\n\n\ndef test_constrained_str_good(ConStringModel):\n m = ConStringModel(v='short')\n assert m.v == 'short'\n\n\ndef test_constrained_str_default(ConStringModel):\n m = ConStringModel()\n assert m.v == 'foobar'\n\n\ndef test_constrained_str_too_long(ConStringModel):\n with pytest.raises(ValidationError) as exc_info:\n ConStringModel(v='this is too long')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': ('v',),\n 'msg': 'String should have at most 10 characters',\n 'input': 'this is too long',\n 'ctx': {'max_length': 10},\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_pydantic__pydantic/tests/test_types.py_test_constrained_str_upper_test_constrained_str_lower.assert_m_v_result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_str_upper_test_constrained_str_lower.assert_m_v_result", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 715, "end_line": 742, "span_ids": ["test_constrained_str_lower", "test_constrained_str_upper"], "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": "@pytest.mark.parametrize(\n 'to_upper, value, result',\n [\n (True, 'abcd', 'ABCD'),\n (False, 'aBcD', 'aBcD'),\n ],\n)\ndef test_constrained_str_upper(to_upper, value, result):\n class Model(BaseModel):\n v: constr(to_upper=to_upper)\n\n m = Model(v=value)\n assert m.v == result\n\n\n@pytest.mark.parametrize(\n 'to_lower, value, result',\n [\n (True, 'ABCD', 'abcd'),\n (False, 'ABCD', 'ABCD'),\n ],\n)\ndef test_constrained_str_lower(to_lower, value, result):\n class Model(BaseModel):\n v: constr(to_lower=to_lower)\n\n m = Model(v=value)\n assert m.v == 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_pydantic__pydantic/tests/test_types.py_test_constrained_str_max_length_0_test_constrained_str_max_length_0.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_str_max_length_0_test_constrained_str_max_length_0.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 745, "end_line": 762, "span_ids": ["test_constrained_str_max_length_0"], "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 test_constrained_str_max_length_0():\n class Model(BaseModel):\n v: constr(max_length=0)\n\n m = Model(v='')\n assert m.v == ''\n with pytest.raises(ValidationError) as exc_info:\n Model(v='qwe')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': ('v',),\n 'msg': 'String should have at most 0 characters',\n 'input': 'qwe',\n 'ctx': {'max_length': 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_pydantic__pydantic/tests/test_types.py_test_string_import_callable_test_string_import_callable.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_import_callable_test_string_import_callable.None_5", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 765, "end_line": 820, "span_ids": ["test_string_import_callable"], "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": "@pytest.mark.parametrize(\n 'annotation',\n [\n ImportString[Callable[[Any], Any]],\n Annotated[Callable[[Any], Any], ImportString],\n ],\n)\ndef test_string_import_callable(annotation):\n class PyObjectModel(BaseModel):\n callable: annotation\n\n m = PyObjectModel(callable='math.cos')\n assert m.callable == math.cos\n\n m = PyObjectModel(callable=math.cos)\n assert m.callable == math.cos\n\n with pytest.raises(ValidationError) as exc_info:\n PyObjectModel(callable='foobar')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'import_error',\n 'loc': ('callable',),\n 'msg': 'Invalid python path: \"foobar\" doesn\\'t look like a module path',\n 'input': 'foobar',\n 'ctx': {'error': '\"foobar\" doesn\\'t look like a module path'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n PyObjectModel(callable='os.missing')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'import_error',\n 'loc': ('callable',),\n 'msg': 'Invalid python path: Module \"os\" does not define a \"missing\" attribute',\n 'input': 'os.missing',\n 'ctx': {'error': 'Module \"os\" does not define a \"missing\" attribute'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n PyObjectModel(callable='os.path')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'callable_type', 'loc': ('callable',), 'msg': 'Input should be callable', 'input': os.path}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n PyObjectModel(callable=[1, 2, 3])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'callable_type', 'loc': ('callable',), 'msg': 'Input should be callable', 'input': [1, 2, 3]}\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_pydantic__pydantic/tests/test_types.py_test_string_import_any_test_string_import_constraints.with_pytest_raises_Valida.PyObjectModel_thing_math": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_import_any_test_string_import_constraints.with_pytest_raises_Valida.PyObjectModel_thing_math", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 823, "end_line": 845, "span_ids": ["test_string_import_constraints", "test_string_import_any"], "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 test_string_import_any():\n class PyObjectModel(BaseModel):\n thing: ImportString\n\n assert PyObjectModel(thing='math.cos').model_dump() == {'thing': math.cos}\n assert PyObjectModel(thing='os.path').model_dump() == {'thing': os.path}\n assert PyObjectModel(thing=[1, 2, 3]).model_dump() == {'thing': [1, 2, 3]}\n\n\n@pytest.mark.parametrize(\n 'annotation',\n [\n ImportString[Annotated[float, annotated_types.Ge(3), annotated_types.Le(4)]],\n Annotated[float, annotated_types.Ge(3), annotated_types.Le(4), ImportString],\n ],\n)\ndef test_string_import_constraints(annotation):\n class PyObjectModel(BaseModel):\n thing: annotation\n\n assert PyObjectModel(thing='math.pi').model_dump() == {'thing': pytest.approx(3.141592654)}\n with pytest.raises(ValidationError, match='type=greater_than_equal'):\n PyObjectModel(thing='math.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_pydantic__pydantic/tests/test_types.py_test_decimal_test_decimal_strict.assert_Model_v_v_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_test_decimal_strict.assert_Model_v_v_model_d", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 848, "end_line": 877, "span_ids": ["test_decimal_strict", "test_decimal"], "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 test_decimal():\n class Model(BaseModel):\n v: Decimal\n\n m = Model(v='1.234')\n assert m.v == Decimal('1.234')\n assert isinstance(m.v, Decimal)\n assert m.model_dump() == {'v': Decimal('1.234')}\n\n\ndef test_decimal_strict():\n class Model(BaseModel):\n v: Decimal\n\n model_config = ConfigDict(strict=True)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=1.23)\n assert exc_info.value.errors() == [\n {\n 'type': 'decimal_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid Decimal instance or decimal string in JSON',\n 'input': 1.23,\n }\n ]\n\n v = Decimal(1.23)\n assert Model(v=v).v == v\n assert Model(v=v).model_dump() == {'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_pydantic__pydantic/tests/test_types.py_test_strict_date_test_strict_date.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_date_test_strict_date.None_2", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 880, "end_line": 906, "span_ids": ["test_strict_date"], "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 test_strict_date():\n class Model(BaseModel):\n v: Annotated[date, Field(strict=True)]\n\n assert Model(v=date(2017, 5, 5)).v == date(2017, 5, 5)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=datetime(2017, 5, 5))\n assert exc_info.value.errors() == [\n {\n 'type': 'date_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid date',\n 'input': datetime(2017, 5, 5),\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='2017-05-05')\n assert exc_info.value.errors() == [\n {\n 'type': 'date_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid date',\n 'input': '2017-05-05',\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_pydantic__pydantic/tests/test_types.py_test_strict_datetime_test_strict_datetime.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_datetime_test_strict_datetime.None_2", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 909, "end_line": 935, "span_ids": ["test_strict_datetime"], "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 test_strict_datetime():\n class Model(BaseModel):\n v: Annotated[datetime, Field(strict=True)]\n\n assert Model(v=datetime(2017, 5, 5, 10, 10, 10)).v == datetime(2017, 5, 5, 10, 10, 10)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=date(2017, 5, 5))\n assert exc_info.value.errors() == [\n {\n 'type': 'datetime_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid datetime',\n 'input': date(2017, 5, 5),\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='2017-05-05T10:10:10')\n assert exc_info.value.errors() == [\n {\n 'type': 'datetime_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid datetime',\n 'input': '2017-05-05T10:10:10',\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_pydantic__pydantic/tests/test_types.py_test_strict_time_test_strict_time.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_time_test_strict_time.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 938, "end_line": 953, "span_ids": ["test_strict_time"], "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 test_strict_time():\n class Model(BaseModel):\n v: Annotated[time, Field(strict=True)]\n\n assert Model(v=time(10, 10, 10)).v == time(10, 10, 10)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='10:10:10')\n assert exc_info.value.errors() == [\n {\n 'type': 'time_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid time',\n 'input': '10:10:10',\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_pydantic__pydantic/tests/test_types.py_test_strict_timedelta_test_strict_timedelta.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_timedelta_test_strict_timedelta.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 956, "end_line": 971, "span_ids": ["test_strict_timedelta"], "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 test_strict_timedelta():\n class Model(BaseModel):\n v: Annotated[timedelta, Field(strict=True)]\n\n assert Model(v=timedelta(days=1)).v == timedelta(days=1)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='1 days')\n assert exc_info.value.errors() == [\n {\n 'type': 'time_delta_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid timedelta',\n 'input': '1 days',\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_pydantic__pydantic/tests/test_types.py_check_model_fixture_check_model_fixture.return.CheckModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_check_model_fixture_check_model_fixture.return.CheckModel", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 974, "end_line": 993, "span_ids": ["check_model_fixture"], "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": "@pytest.fixture(scope='session', name='CheckModel')\ndef check_model_fixture():\n class CheckModel(BaseModel):\n bool_check: bool = True\n str_check: constr(strip_whitespace=True, max_length=10) = 's'\n bytes_check: bytes = b's'\n int_check: int = 1\n float_check: float = 1.0\n uuid_check: UUID = UUID('7bd00d58-6485-4ca6-b889-3da6d8df3ee4')\n decimal_check: condecimal(allow_inf_nan=False) = Decimal('42.24')\n date_check: date = date(2017, 5, 5)\n datetime_check: datetime = datetime(2017, 5, 5, 10, 10, 10)\n time_check: time = time(10, 10, 10)\n timedelta_check: timedelta = timedelta(days=1)\n list_check: List[str] = ['1', '2']\n tuple_check: Tuple[str, ...] = ('1', '2')\n set_check: Set[str] = {'1', '2'}\n frozenset_check: FrozenSet[str] = frozenset(['1', '2'])\n\n return CheckModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_BoolCastable_test_string_too_long.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_BoolCastable_test_string_too_long.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 996, "end_line": 1217, "span_ids": ["BoolCastable", "test_string_too_long", "str_model_fixture", "BoolCastable.__bool__"], "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 BoolCastable:\n def __bool__(self) -> bool:\n return True\n\n\n@pytest.fixture(scope='session', name='StrModel')\ndef str_model_fixture():\n class StrModel(BaseModel):\n str_check: Annotated[str, annotated_types.Len(5, 10)]\n\n return StrModel\n\n\ndef test_string_too_long(StrModel):\n with pytest.raises(ValidationError) as exc_info:\n StrModel(str_check='x' * 150)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': ('str_check',),\n 'msg': 'String should have at most 10 characters',\n 'input': 'x' * 150,\n 'ctx': {'max_length': 10},\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_pydantic__pydantic/tests/test_types.py_test_string_too_short_datetime_model_fixture.return.DatetimeModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_too_short_datetime_model_fixture.return.DatetimeModel", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1220, "end_line": 1243, "span_ids": ["test_string_too_short", "datetime_model_fixture"], "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 test_string_too_short(StrModel):\n with pytest.raises(ValidationError) as exc_info:\n StrModel(str_check='x')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_short',\n 'loc': ('str_check',),\n 'msg': 'String should have at least 5 characters',\n 'input': 'x',\n 'ctx': {'min_length': 5},\n }\n ]\n\n\n@pytest.fixture(scope='session', name='DatetimeModel')\ndef datetime_model_fixture():\n class DatetimeModel(BaseModel):\n dt: datetime\n date_: date\n time_: time\n duration: timedelta\n\n return DatetimeModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_datetime_successful_test_datetime_successful.assert_m_duration_time": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_datetime_successful_test_datetime_successful.assert_m_duration_time", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1246, "end_line": 1251, "span_ids": ["test_datetime_successful"], "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 test_datetime_successful(DatetimeModel):\n m = DatetimeModel(dt='2017-10-05T19:47:07', date_=1493942400, time_='10:20:30.400', duration='00:15:30.0001')\n assert m.dt == datetime(2017, 10, 5, 19, 47, 7)\n assert m.date_ == date(2017, 5, 5)\n assert m.time_ == time(10, 20, 30, 400_000)\n assert m.duration == timedelta(minutes=15, seconds=30, microseconds=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_pydantic__pydantic/tests/test_types.py_test_datetime_errors_test_datetime_errors.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_datetime_errors_test_datetime_errors.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1254, "end_line": 1287, "span_ids": ["test_datetime_errors"], "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 test_datetime_errors(DatetimeModel):\n with pytest.raises(ValueError) as exc_info:\n DatetimeModel(dt='2017-13-05T19:47:07', date_='XX1494012000', time_='25:20:30.400', duration='15:30.0001broken')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'datetime_parsing',\n 'loc': ('dt',),\n 'msg': 'Input should be a valid datetime, month value is outside expected range of 1-12',\n 'input': '2017-13-05T19:47:07',\n 'ctx': {'error': 'month value is outside expected range of 1-12'},\n },\n {\n 'type': 'date_from_datetime_parsing',\n 'loc': ('date_',),\n 'msg': 'Input should be a valid date or datetime, invalid character in year',\n 'input': 'XX1494012000',\n 'ctx': {'error': 'invalid character in year'},\n },\n {\n 'type': 'time_parsing',\n 'loc': ('time_',),\n 'msg': 'Input should be in a valid time format, hour value is outside expected range of 0-23',\n 'input': '25:20:30.400',\n 'ctx': {'error': 'hour value is outside expected range of 0-23'},\n },\n {\n 'type': 'time_delta_parsing',\n 'loc': ('duration',),\n 'msg': 'Input should be a valid timedelta, unexpected extra characters at the end of the input',\n 'input': '15:30.0001broken',\n 'ctx': {'error': 'unexpected extra characters at the end of the input'},\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_pydantic__pydantic/tests/test_types.py_cooking_model_test_enum_successful.assert_repr_m_tool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_cooking_model_test_enum_successful.assert_repr_m_tool_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1290, "end_line": 1312, "span_ids": ["cooking_model", "test_enum_successful"], "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": "@pytest.fixture(scope='session')\ndef cooking_model():\n class FruitEnum(str, Enum):\n pear = 'pear'\n banana = 'banana'\n\n class ToolEnum(IntEnum):\n spanner = 1\n wrench = 2\n\n class CookingModel(BaseModel):\n fruit: FruitEnum = FruitEnum.pear\n tool: ToolEnum = ToolEnum.spanner\n\n return FruitEnum, ToolEnum, CookingModel\n\n\ndef test_enum_successful(cooking_model):\n FruitEnum, ToolEnum, CookingModel = cooking_model\n m = CookingModel(tool=2)\n assert m.fruit == FruitEnum.pear\n assert m.tool == ToolEnum.wrench\n assert repr(m.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_pydantic__pydantic/tests/test_types.py_test_enum_fails_test_enum_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_enum_fails_test_enum_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1315, "end_line": 1328, "span_ids": ["test_enum_fails"], "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 test_enum_fails(cooking_model):\n FruitEnum, ToolEnum, CookingModel = cooking_model\n with pytest.raises(ValueError) as exc_info:\n CookingModel(tool=3)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'literal_error',\n 'loc': ('tool',),\n 'msg': 'Input should be 1 or 2',\n 'input': 3,\n 'ctx': {'expected': '1 or 2'},\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_pydantic__pydantic/tests/test_types.py_test_int_enum_successful_for_str_int_test_int_enum_type.with_pytest_raises_Schema.Model.my_int_enum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_int_enum_successful_for_str_int_test_int_enum_type.with_pytest_raises_Schema.Model.my_int_enum", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1331, "end_line": 1349, "span_ids": ["test_int_enum_successful_for_str_int", "test_enum_type", "test_int_enum_type"], "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 test_int_enum_successful_for_str_int(cooking_model):\n FruitEnum, ToolEnum, CookingModel = cooking_model\n m = CookingModel(tool='2')\n assert m.tool == ToolEnum.wrench\n assert repr(m.tool) == ''\n\n\ndef test_enum_type():\n with pytest.raises(SchemaError, match='\"expected\" should have length > 0'):\n\n class Model(BaseModel):\n my_int_enum: Enum\n\n\ndef test_int_enum_type():\n with pytest.raises(SchemaError, match='\"expected\" should have length > 0'):\n\n class Model(BaseModel):\n my_int_enum: IntEnum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_schema_constraints_test_invalid_decimal_constraint.with_pytest_raises_TypeEr.Foo.a.Field_foo_title_A_tit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_schema_constraints_test_invalid_decimal_constraint.with_pytest_raises_TypeEr.Foo.a.Field_foo_title_A_tit", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1352, "end_line": 1381, "span_ids": ["test_invalid_decimal_constraint", "test_invalid_schema_constraints"], "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": "@pytest.mark.parametrize(\n 'kwargs,type_',\n [\n ({'max_length': 5}, int),\n ({'min_length': 2}, float),\n ({'frozen': True}, bool),\n ({'pattern': '^foo$'}, int),\n ({'gt': 2}, str),\n ({'lt': 5}, bytes),\n ({'ge': 2}, str),\n ({'le': 5}, bool),\n ({'gt': 0}, Callable),\n ({'gt': 0}, Callable[[int], int]),\n ({'gt': 0}, conlist(int, min_length=4)),\n ({'gt': 0}, conset(int, min_length=4)),\n ({'gt': 0}, confrozenset(int, min_length=4)),\n ],\n)\ndef test_invalid_schema_constraints(kwargs, type_):\n with pytest.raises(SchemaError, match='Invalid Schema:\\n.*\\n Extra inputs are not permitted'):\n\n class Foo(BaseModel):\n a: type_ = Field('foo', title='A title', description='A description', **kwargs)\n\n\ndef test_invalid_decimal_constraint():\n with pytest.raises(TypeError, match=\"'max_length' is not a valid constraint for DecimalValidator\"):\n\n class Foo(BaseModel):\n a: Decimal = Field('foo', title='A title', description='A description', max_length=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_pydantic__pydantic/tests/test_types.py_test_string_success_test_string_success.assert_m_name_email_email": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_success_test_string_success.assert_m_name_email_email", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1384, "end_line": 1409, "span_ids": ["test_string_success"], "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": "@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\ndef test_string_success():\n class MoreStringsModel(BaseModel):\n str_strip_enabled: constr(strip_whitespace=True)\n str_strip_disabled: constr(strip_whitespace=False)\n str_regex: constr(pattern=r'^xxx\\d{3}$') = ...\n str_min_length: constr(min_length=5) = ...\n str_email: EmailStr = ...\n name_email: NameEmail = ...\n\n m = MoreStringsModel(\n str_strip_enabled=' xxx123 ',\n str_strip_disabled=' xxx123 ',\n str_regex='xxx123',\n str_min_length='12345',\n str_email='foobar@example.com ',\n name_email='foo bar ',\n )\n assert m.str_strip_enabled == 'xxx123'\n assert m.str_strip_disabled == ' xxx123 '\n assert m.str_regex == 'xxx123'\n assert m.str_email == 'foobar@example.com'\n assert repr(m.name_email) == \"NameEmail(name='foo bar', email='foobaR@example.com')\"\n assert str(m.name_email) == 'foo bar '\n assert m.name_email.name == 'foo bar'\n assert m.name_email.email == 'foobaR@example.com'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_fails_test_string_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_fails_test_string_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1412, "end_line": 1463, "span_ids": ["test_string_fails"], "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": "@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\ndef test_string_fails():\n class MoreStringsModel(BaseModel):\n str_regex: constr(pattern=r'^xxx\\d{3}$') = ...\n str_min_length: constr(min_length=5) = ...\n str_email: EmailStr = ...\n name_email: NameEmail = ...\n\n with pytest.raises(ValidationError) as exc_info:\n MoreStringsModel(\n str_regex='xxx123xxx',\n str_min_length='1234',\n str_email='foobar<@example.com',\n name_email='foobar @example.com',\n )\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_pattern_mismatch',\n 'loc': ('str_regex',),\n 'msg': \"String should match pattern '^xxx\\\\d{3}$'\",\n 'input': 'xxx123xxx',\n 'ctx': {'pattern': '^xxx\\\\d{3}$'},\n },\n {\n 'type': 'string_too_short',\n 'loc': ('str_min_length',),\n 'msg': 'String should have at least 5 characters',\n 'input': '1234',\n 'ctx': {'min_length': 5},\n },\n {\n 'type': 'value_error',\n 'loc': ('str_email',),\n 'msg': (\n 'value is not a valid email address: The email address contains invalid '\n 'characters before the @-sign: LESS-THAN SIGN.'\n ),\n 'input': 'foobar<@example.com',\n 'ctx': {'reason': 'The email address contains invalid characters before the @-sign: LESS-THAN SIGN.'},\n },\n {\n 'type': 'value_error',\n 'loc': ('name_email',),\n 'msg': (\n 'value is not a valid email address: The email address contains invalid characters '\n 'before the @-sign: SPACE.'\n ),\n 'input': 'foobar @example.com',\n 'ctx': {'reason': 'The email address contains invalid characters before the @-sign: SPACE.'},\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_pydantic__pydantic/tests/test_types.py_test_email_validator_not_installed_email_str_test_dict.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_email_validator_not_installed_email_str_test_dict.None_2", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1466, "end_line": 1504, "span_ids": ["test_email_validator_not_installed_name_email", "test_dict", "test_email_validator_not_installed_email_str"], "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": "@pytest.mark.skipif(email_validator, reason='email_validator is installed')\ndef test_email_validator_not_installed_email_str():\n with pytest.raises(ImportError):\n\n class Model(BaseModel):\n str_email: EmailStr = ...\n\n\n@pytest.mark.skipif(email_validator, reason='email_validator is installed')\ndef test_email_validator_not_installed_name_email():\n with pytest.raises(ImportError):\n\n class Model(BaseModel):\n str_email: NameEmail = ...\n\n\ndef test_dict():\n class Model(BaseModel):\n v: dict\n\n assert Model(v={1: 10, 2: 20}).v == {1: 10, 2: 20}\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[(1, 2), (3, 4)])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'dict_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid dictionary',\n 'input': [(1, 2), (3, 4)],\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[1, 2, 3])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'dict_type', 'loc': ('v',), 'msg': 'Input should be a valid dictionary', 'input': [1, 2, 3]}\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_pydantic__pydantic/tests/test_types.py_test_list_success_test_list_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_list_success_test_list_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1507, "end_line": 1520, "span_ids": ["test_list_success"], "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": "@pytest.mark.parametrize(\n 'value,result',\n (\n ([1, 2, '3'], [1, 2, '3']),\n ((1, 2, '3'), [1, 2, '3']),\n ((i**2 for i in range(5)), [0, 1, 4, 9, 16]),\n (deque([1, 2, 3]), [1, 2, 3]),\n ),\n)\ndef test_list_success(value, result):\n class Model(BaseModel):\n v: list\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_test_list_fails_test_list_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_list_fails_test_list_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1523, "end_line": 1538, "span_ids": ["test_list_fails"], "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": "@pytest.mark.parametrize('value', (123, '123', {1, 2, '3'}))\ndef test_list_fails(value):\n class Model(BaseModel):\n v: list\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'list_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid list',\n 'input': value,\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_pydantic__pydantic/tests/test_types.py_test_ordered_dict_test_ordered_dict.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_ordered_dict_test_ordered_dict.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1541, "end_line": 1553, "span_ids": ["test_ordered_dict"], "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 test_ordered_dict():\n class Model(BaseModel):\n v: OrderedDict\n\n assert Model(v=OrderedDict([(1, 10), (2, 20)])).v == OrderedDict([(1, 10), (2, 20)])\n assert Model(v={1: 10, 2: 20}).v == OrderedDict([(1, 10), (2, 20)])\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[1, 2, 3])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'dict_type', 'loc': ('v',), 'msg': 'Input should be a valid dictionary', 'input': [1, 2, 3]}\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_pydantic__pydantic/tests/test_types.py_test_tuple_success_test_tuple_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_success_test_tuple_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1556, "end_line": 1569, "span_ids": ["test_tuple_success"], "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": "@pytest.mark.parametrize(\n 'value,result',\n (\n ([1, 2, '3'], (1, 2, '3')),\n ((1, 2, '3'), (1, 2, '3')),\n ((i**2 for i in range(5)), (0, 1, 4, 9, 16)),\n (deque([1, 2, 3]), (1, 2, 3)),\n ),\n)\ndef test_tuple_success(value, result):\n class Model(BaseModel):\n v: tuple\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_test_tuple_fails_test_tuple_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_fails_test_tuple_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1572, "end_line": 1582, "span_ids": ["test_tuple_fails"], "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": "@pytest.mark.parametrize('value', (123, '123', {1, 2, '3'}))\ndef test_tuple_fails(value):\n class Model(BaseModel):\n v: tuple\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'tuple_type', 'loc': ('v',), 'msg': 'Input should be a valid tuple', 'input': 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_pydantic__pydantic/tests/test_types.py_test_tuple_variable_len_success_test_tuple_variable_len_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_variable_len_success_test_tuple_variable_len_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1585, "end_line": 1598, "span_ids": ["test_tuple_variable_len_success"], "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": "@pytest.mark.parametrize(\n 'value,cls,result',\n (\n ([1, 2, '3'], int, (1, 2, 3)),\n ((1, 2, '3'), int, (1, 2, 3)),\n ((i**2 for i in range(5)), int, (0, 1, 4, 9, 16)),\n (('a', 'b', 'c'), str, ('a', 'b', 'c')),\n ),\n)\ndef test_tuple_variable_len_success(value, cls, result):\n class Model(BaseModel):\n v: Tuple[cls, ...]\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_test_tuple_variable_len_fails_test_tuple_variable_len_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_tuple_variable_len_fails_test_tuple_variable_len_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1601, "end_line": 1642, "span_ids": ["test_tuple_variable_len_fails"], "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": "@pytest.mark.parametrize(\n 'value, cls, exc',\n [\n (\n ('a', 'b', [1, 2], 'c'),\n str,\n [\n {\n 'type': 'string_type',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid string',\n 'input': [1, 2],\n }\n ],\n ),\n (\n ('a', 'b', [1, 2], 'c', [3, 4]),\n str,\n [\n {\n 'type': 'string_type',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid string',\n 'input': [1, 2],\n },\n {\n 'type': 'string_type',\n 'loc': ('v', 4),\n 'msg': 'Input should be a valid string',\n 'input': [3, 4],\n },\n ],\n ),\n ],\n)\ndef test_tuple_variable_len_fails(value, cls, exc):\n class Model(BaseModel):\n v: Tuple[cls, ...]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n assert exc_info.value.errors() == 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_pydantic__pydantic/tests/test_types.py_test_set_success_test_set_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_set_success_test_set_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1645, "end_line": 1658, "span_ids": ["test_set_success"], "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": "@pytest.mark.parametrize(\n 'value,result',\n (\n ({1, 2, 2, '3'}, {1, 2, '3'}),\n ((1, 2, 2, '3'), {1, 2, '3'}),\n ([1, 2, 2, '3'], {1, 2, '3'}),\n ({i**2 for i in range(5)}, {0, 1, 4, 9, 16}),\n ),\n)\ndef test_set_success(value, result):\n class Model(BaseModel):\n v: set\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_test_set_fails_test_set_type_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_set_fails_test_set_type_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1661, "end_line": 1695, "span_ids": ["test_list_type_fails", "test_set_type_fails", "test_set_fails"], "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": "@pytest.mark.parametrize('value', (123, '123'))\ndef test_set_fails(value):\n class Model(BaseModel):\n v: set\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'set_type', 'loc': ('v',), 'msg': 'Input should be a valid set', 'input': value}\n ]\n\n\ndef test_list_type_fails():\n class Model(BaseModel):\n v: List[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='123')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'list_type', 'loc': ('v',), 'msg': 'Input should be a valid list', 'input': '123'}\n ]\n\n\ndef test_set_type_fails():\n class Model(BaseModel):\n v: Set[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='123')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'set_type', 'loc': ('v',), 'msg': 'Input should be a valid set', 'input': '123'}\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_pydantic__pydantic/tests/test_types.py_test_sequence_success_test_sequence_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_success_test_sequence_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1698, "end_line": 1713, "span_ids": ["test_sequence_success"], "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": "@pytest.mark.parametrize(\n 'cls, value,result',\n (\n (int, [1, 2, 3], [1, 2, 3]),\n (int, (1, 2, 3), (1, 2, 3)),\n (int, range(5), [0, 1, 2, 3, 4]),\n (int, deque((1, 2, 3)), deque((1, 2, 3))),\n (Set[int], [{1, 2}, {3, 4}, {5, 6}], [{1, 2}, {3, 4}, {5, 6}]),\n (Tuple[int, str], ((1, 'a'), (2, 'b'), (3, 'c')), ((1, 'a'), (2, 'b'), (3, 'c'))),\n ),\n)\ndef test_sequence_success(cls, value, result):\n class Model(BaseModel):\n v: Sequence[cls]\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_int_iterable_test_infinite_iterable_int.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_int_iterable_test_infinite_iterable_int.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1716, "end_line": 1758, "span_ids": ["test_infinite_iterable_int", "int_iterable", "str_iterable"], "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 int_iterable():\n i = 0\n while True:\n i += 1\n yield str(i)\n\n\ndef str_iterable():\n while True:\n yield from 'foobarbaz'\n\n\ndef test_infinite_iterable_int():\n class Model(BaseModel):\n it: Iterable[int]\n\n m = Model(it=int_iterable())\n\n assert repr(m.it) == 'ValidatorIterator(index=0, schema=Some(Int(IntValidator { strict: false })))'\n\n output = []\n for i in m.it:\n output.append(i)\n if i == 10:\n break\n\n assert output == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\n m = Model(it=[1, 2, 3])\n assert list(m.it) == [1, 2, 3]\n\n m = Model(it=str_iterable())\n with pytest.raises(ValidationError) as exc_info:\n next(m.it)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': (0,),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'f',\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_pydantic__pydantic/tests/test_types.py_test_iterable_any_test_iterable_any.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_iterable_any_test_iterable_any.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1761, "end_line": 1784, "span_ids": ["test_iterable_any"], "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": "@pytest.mark.parametrize('type_annotation', (Iterable[Any], Iterable))\ndef test_iterable_any(type_annotation):\n class Model(BaseModel):\n it: type_annotation\n\n m = Model(it=int_iterable())\n\n output = []\n for i in m.it:\n output.append(i)\n if int(i) == 10:\n break\n\n assert output == ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']\n\n m = Model(it=[1, '2', b'three'])\n assert list(m.it) == [1, '2', b'three']\n\n with pytest.raises(ValidationError) as exc_info:\n Model(it=3)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'iterable_type', 'loc': ('it',), 'msg': 'Input should be iterable', 'input': 3}\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_pydantic__pydantic/tests/test_types.py_test_invalid_iterable_test_infinite_iterable_validate_first.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_iterable_test_infinite_iterable_validate_first.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1787, "end_line": 1829, "span_ids": ["test_infinite_iterable_validate_first", "test_invalid_iterable"], "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 test_invalid_iterable():\n class Model(BaseModel):\n it: Iterable[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(it=3)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'iterable_type', 'loc': ('it',), 'msg': 'Input should be iterable', 'input': 3}\n ]\n\n\ndef test_infinite_iterable_validate_first():\n class Model(BaseModel):\n it: Iterable[int]\n b: int\n\n @field_validator('it')\n @classmethod\n def infinite_first_int(cls, it):\n return itertools.chain([next(it)], it)\n\n m = Model(it=int_iterable(), b=3)\n\n assert m.b == 3\n assert m.it\n\n for i in m.it:\n assert i\n if i == 10:\n break\n\n with pytest.raises(ValidationError) as exc_info:\n Model(it=str_iterable(), b=3)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('it', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'f',\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_pydantic__pydantic/tests/test_types.py_test_sequence_generator_fails_test_sequence_generator_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_generator_fails_test_sequence_generator_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1832, "end_line": 1848, "span_ids": ["test_sequence_generator_fails"], "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 test_sequence_generator_fails():\n class Model(BaseModel):\n v: Sequence[int]\n\n gen = (i for i in [1, 2, 3])\n with pytest.raises(ValidationError) as exc_info:\n Model(v=gen)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of Sequence',\n 'input': gen,\n 'ctx': {'class': 'Sequence'},\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_pydantic__pydantic/tests/test_types.py_test_sequence_fails_test_sequence_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_fails_test_sequence_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1851, "end_line": 1966, "span_ids": ["test_sequence_fails"], "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": "@pytest.mark.parametrize(\n 'cls,value,errors',\n (\n (\n int,\n [1, 'a', 3],\n [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n ],\n ),\n (\n int,\n (1, 2, 'a'),\n [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n ],\n ),\n (\n float,\n ('a', 2.2, 3.3),\n [\n {\n 'type': 'float_parsing',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid number, unable to parse string as an number',\n 'input': 'a',\n },\n ],\n ),\n (\n float,\n (1.1, 2.2, 'a'),\n [\n {\n 'type': 'float_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid number, unable to parse string as an number',\n 'input': 'a',\n },\n ],\n ),\n (\n float,\n {1.0, 2.0, 3.0},\n [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of Sequence',\n 'input': {\n 1.0,\n 2.0,\n 3.0,\n },\n 'ctx': {\n 'class': 'Sequence',\n },\n },\n ],\n ),\n (\n Set[int],\n [{1, 2}, {2, 3}, {'d'}],\n [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 2, 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'd',\n }\n ],\n ),\n (\n Tuple[int, str],\n ((1, 'a'), ('a', 'a'), (3, 'c')),\n [\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1, 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n }\n ],\n ),\n (\n List[int],\n [{'a': 1, 'b': 2}, [1, 2], [2, 3]],\n [\n {\n 'type': 'list_type',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid list',\n 'input': {'a': 1, 'b': 2},\n }\n ],\n ),\n ),\n ids=repr,\n)\ndef test_sequence_fails(cls, value, errors):\n class Model(BaseModel):\n v: Sequence[cls]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n assert exc_info.value.errors() == 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_pydantic__pydantic/tests/test_types.py_test_int_validation_test_int_validation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_int_validation_test_int_validation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1969, "end_line": 2035, "span_ids": ["test_int_validation"], "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 test_int_validation():\n class Model(BaseModel):\n a: PositiveInt = None\n b: NegativeInt = None\n c: NonNegativeInt = None\n d: NonPositiveInt = None\n e: conint(gt=4, lt=10) = None\n f: conint(ge=0, le=10) = None\n g: conint(multiple_of=5) = None\n\n m = Model(a=5, b=-5, c=0, d=0, e=5, f=0, g=25)\n assert m.model_dump() == {'a': 5, 'b': -5, 'c': 0, 'd': 0, 'e': 5, 'f': 0, 'g': 25}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=-5, b=5, c=-5, d=5, e=-5, f=11, g=42)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'greater_than',\n 'loc': ('a',),\n 'msg': 'Input should be greater than 0',\n 'input': -5,\n 'ctx': {'gt': 0},\n },\n {\n 'type': 'less_than',\n 'loc': ('b',),\n 'msg': 'Input should be less than 0',\n 'input': 5,\n 'ctx': {'lt': 0},\n },\n {\n 'type': 'greater_than_equal',\n 'loc': ('c',),\n 'msg': 'Input should be greater than or equal to 0',\n 'input': -5,\n 'ctx': {'ge': 0},\n },\n {\n 'type': 'less_than_equal',\n 'loc': ('d',),\n 'msg': 'Input should be less than or equal to 0',\n 'input': 5,\n 'ctx': {'le': 0},\n },\n {\n 'type': 'greater_than',\n 'loc': ('e',),\n 'msg': 'Input should be greater than 4',\n 'input': -5,\n 'ctx': {'gt': 4},\n },\n {\n 'type': 'less_than_equal',\n 'loc': ('f',),\n 'msg': 'Input should be less than or equal to 10',\n 'input': 11,\n 'ctx': {'le': 10},\n },\n {\n 'type': 'multiple_of',\n 'loc': ('g',),\n 'msg': 'Input should be a multiple of 5',\n 'input': 42,\n 'ctx': {'multiple_of': 5},\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_pydantic__pydantic/tests/test_types.py_test_float_validation_test_float_validation._insert_assert_exc_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_float_validation_test_float_validation._insert_assert_exc_info_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2038, "end_line": 2057, "span_ids": ["test_float_validation"], "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 test_float_validation():\n class Model(BaseModel):\n a: PositiveFloat = None\n b: NegativeFloat = None\n c: NonNegativeFloat = None\n d: NonPositiveFloat = None\n e: confloat(gt=4, lt=12.2) = None\n f: confloat(ge=0, le=9.9) = None\n g: confloat(multiple_of=0.5) = None\n h: confloat(allow_inf_nan=False) = None\n\n m = Model(a=5.1, b=-5.2, c=0, d=0, e=5.3, f=9.9, g=2.5, h=42)\n assert m.model_dump() == {'a': 5.1, 'b': -5.2, 'c': 0, 'd': 0, 'e': 5.3, 'f': 9.9, 'g': 2.5, 'h': 42}\n\n assert Model(a=float('inf')).a == float('inf')\n assert Model(b=float('-inf')).b == float('-inf')\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=-5.1, b=5.2, c=-5.1, d=5.1, e=-5.3, f=9.91, g=4.2, h=float('nan'))\n # insert_assert(exc_info.value.errors())\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_pydantic__pydantic/tests/test_types.py_test_float_validation.assert_exc_info_value_err_test_float_validation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_float_validation.assert_exc_info_value_err_test_float_validation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2058, "end_line": 2128, "span_ids": ["test_float_validation"], "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": "def test_float_validation():\n # ... other code\n assert exc_info.value.errors() == [\n {\n 'type': 'greater_than',\n 'loc': ('a',),\n 'msg': 'Input should be greater than 0',\n 'input': -5.1,\n 'ctx': {\n 'gt': 0.0,\n },\n },\n {\n 'type': 'less_than',\n 'loc': ('b',),\n 'msg': 'Input should be less than 0',\n 'input': 5.2,\n 'ctx': {\n 'lt': 0.0,\n },\n },\n {\n 'type': 'greater_than_equal',\n 'loc': ('c',),\n 'msg': 'Input should be greater than or equal to 0',\n 'input': -5.1,\n 'ctx': {\n 'ge': 0.0,\n },\n },\n {\n 'type': 'less_than_equal',\n 'loc': ('d',),\n 'msg': 'Input should be less than or equal to 0',\n 'input': 5.1,\n 'ctx': {\n 'le': 0.0,\n },\n },\n {\n 'type': 'greater_than',\n 'loc': ('e',),\n 'msg': 'Input should be greater than 4',\n 'input': -5.3,\n 'ctx': {\n 'gt': 4.0,\n },\n },\n {\n 'type': 'less_than_equal',\n 'loc': ('f',),\n 'msg': 'Input should be less than or equal to 9.9',\n 'input': 9.91,\n 'ctx': {\n 'le': 9.9,\n },\n },\n {\n 'type': 'multiple_of',\n 'loc': ('g',),\n 'msg': 'Input should be a multiple of 0.5',\n 'input': 4.2,\n 'ctx': {\n 'multiple_of': 0.5,\n },\n },\n {\n 'type': 'finite_number',\n 'loc': ('h',),\n 'msg': 'Input should be a finite number',\n 'input': HasRepr('nan'),\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_pydantic__pydantic/tests/test_types.py_test_finite_float_validation_test_finite_float_validation_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_finite_float_validation_test_finite_float_validation_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2131, "end_line": 2156, "span_ids": ["test_finite_float_validation_error", "test_finite_float_validation"], "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 test_finite_float_validation():\n class Model(BaseModel):\n a: float = None\n\n assert Model(a=float('inf')).a == float('inf')\n assert Model(a=float('-inf')).a == float('-inf')\n assert math.isnan(Model(a=float('nan')).a)\n\n\n@pytest.mark.parametrize('value', [float('inf'), float('-inf'), float('nan')])\ndef test_finite_float_validation_error(value):\n class Model(BaseModel):\n a: FiniteFloat\n\n assert Model(a=42).a == 42\n with pytest.raises(ValidationError) as exc_info:\n Model(a=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'finite_number',\n 'loc': ('a',),\n 'msg': 'Input should be a finite number',\n 'input': HasRepr(repr(value)),\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_pydantic__pydantic/tests/test_types.py_test_finite_float_config_test_finite_float_config.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_finite_float_config_test_finite_float_config.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2159, "end_line": 2176, "span_ids": ["test_finite_float_config"], "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 test_finite_float_config():\n class Model(BaseModel):\n a: float\n\n model_config = ConfigDict(allow_inf_nan=False)\n\n assert Model(a=42).a == 42\n with pytest.raises(ValidationError) as exc_info:\n Model(a=float('nan'))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'finite_number',\n 'loc': ('a',),\n 'msg': 'Input should be a finite number',\n 'input': HasRepr('nan'),\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_pydantic__pydantic/tests/test_types.py_test_strict_bytes_test_strict_bytes.None_3.Model_v_0_42_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_bytes_test_strict_bytes.None_3.Model_v_0_42_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2179, "end_line": 2194, "span_ids": ["test_strict_bytes"], "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": "def test_strict_bytes():\n class Model(BaseModel):\n v: StrictBytes\n\n assert Model(v=b'foobar').v == b'foobar'\n with pytest.raises(ValidationError, match='Input should be a valid bytes'):\n Model(v=bytearray('foobar', 'utf-8'))\n\n with pytest.raises(ValidationError, match='Input should be a valid bytes'):\n Model(v='foostring')\n\n with pytest.raises(ValidationError, match='Input should be a valid bytes'):\n Model(v=42)\n\n with pytest.raises(ValidationError, match='Input should be a valid bytes'):\n Model(v=0.42)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_bytes_max_length_test_strict_bytes_max_length.None_1.Model_u_b_1234567_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_bytes_max_length_test_strict_bytes_max_length.None_1.Model_u_b_1234567_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2197, "end_line": 2206, "span_ids": ["test_strict_bytes_max_length"], "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 test_strict_bytes_max_length():\n class Model(BaseModel):\n u: StrictBytes = Field(..., max_length=5)\n\n assert Model(u=b'foo').u == b'foo'\n\n with pytest.raises(ValidationError, match=r'Input should be a valid bytes \\[type=bytes_type'):\n Model(u=123)\n with pytest.raises(ValidationError, match=r'Data should have at most 5 bytes \\[type=bytes_too_long,'):\n Model(u=b'1234567')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_str_test_strict_str.None_2.Model_v_b_foobar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_str_test_strict_str.None_2.Model_v_b_foobar_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2209, "end_line": 2227, "span_ids": ["test_strict_str"], "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 test_strict_str():\n class FruitEnum(str, Enum):\n pear = 'pear'\n banana = 'banana'\n\n class Model(BaseModel):\n v: StrictStr\n\n assert Model(v='foobar').v == 'foobar'\n\n msg = r'Input should be a string, not an instance of a subclass of str \\[type=string_sub_type,'\n with pytest.raises(ValidationError, match=msg):\n Model(v=FruitEnum.banana)\n\n with pytest.raises(ValidationError, match='Input should be a valid string'):\n Model(v=123)\n\n with pytest.raises(ValidationError, match='Input should be a valid string'):\n Model(v=b'foobar')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_str_max_length_test_strict_bool.None_2.Model_v_b_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_str_max_length_test_strict_bool.None_2.Model_v_b_1_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2230, "end_line": 2257, "span_ids": ["test_strict_str_max_length", "test_strict_bool"], "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 test_strict_str_max_length():\n class Model(BaseModel):\n u: StrictStr = Field(..., max_length=5)\n\n assert Model(u='foo').u == 'foo'\n\n with pytest.raises(ValidationError, match='Input should be a valid string'):\n Model(u=123)\n\n with pytest.raises(ValidationError, match=r'String should have at most 5 characters \\[type=string_too_long,'):\n Model(u='1234567')\n\n\ndef test_strict_bool():\n class Model(BaseModel):\n v: StrictBool\n\n assert Model(v=True).v is True\n assert Model(v=False).v is False\n\n with pytest.raises(ValidationError):\n Model(v=1)\n\n with pytest.raises(ValidationError):\n Model(v='1')\n\n with pytest.raises(ValidationError):\n Model(v=b'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_pydantic__pydantic/tests/test_types.py_test_strict_int_test_strict_int.None_3.Model_v_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_int_test_strict_int.None_3.Model_v_True_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2260, "end_line": 2276, "span_ids": ["test_strict_int"], "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 test_strict_int():\n class Model(BaseModel):\n v: StrictInt\n\n assert Model(v=123456).v == 123456\n\n with pytest.raises(ValidationError, match=r'Input should be a valid integer \\[type=int_type,'):\n Model(v='123456')\n\n with pytest.raises(ValidationError, match=r'Input should be a valid integer \\[type=int_type,'):\n Model(v=3.14159)\n\n with pytest.raises(ValidationError, match=r'Input should be a valid integer \\[type=int_type,'):\n Model(v=2**64)\n\n with pytest.raises(ValidationError, match=r'Input should be a valid integer \\[type=int_type,'):\n Model(v=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_pydantic__pydantic/tests/test_types.py_test_strict_float_test_bool_unhashable_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_float_test_bool_unhashable_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2279, "end_line": 2301, "span_ids": ["test_bool_unhashable_fails", "test_strict_float"], "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 test_strict_float():\n class Model(BaseModel):\n v: StrictFloat\n\n assert Model(v=3.14159).v == 3.14159\n assert Model(v=123456).v == 123456\n\n with pytest.raises(ValidationError, match=r'Input should be a valid number \\[type=float_type,'):\n Model(v='3.14159')\n\n with pytest.raises(ValidationError, match=r'Input should be a valid number \\[type=float_type,'):\n Model(v=True)\n\n\ndef test_bool_unhashable_fails():\n class Model(BaseModel):\n v: bool\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v={})\n assert exc_info.value.errors() == [\n {'type': 'bool_type', 'loc': ('v',), 'msg': 'Input should be a valid boolean', 'input': {}}\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_pydantic__pydantic/tests/test_types.py_test_uuid_error_test_uuid_error.None_1.Model_v_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_error_test_uuid_error.None_1.Model_v_None_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2304, "end_line": 2321, "span_ids": ["test_uuid_error"], "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 test_uuid_error():\n class Model(BaseModel):\n v: UUID\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v='ebcdab58-6eb8-46fb-a190-d07a3')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'uuid_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid UUID, string, or bytes',\n 'input': 'ebcdab58-6eb8-46fb-a190-d07a3',\n }\n ]\n\n with pytest.raises(ValidationError, match='Input should be a valid UUID, string, or bytes'):\n Model(v=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_pydantic__pydantic/tests/test_types.py_test_uuid_validation_test_uuid_validation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_validation_test_uuid_validation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2324, "end_line": 2372, "span_ids": ["test_uuid_validation"], "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": "@pytest.mark.xfail(sys.platform.startswith('win'), reason='https://github.com/PyO3/pyo3/issues/2913', strict=False)\ndef test_uuid_validation():\n class UUIDModel(BaseModel):\n a: UUID1\n b: UUID3\n c: UUID4\n d: UUID5\n\n a = uuid.uuid1()\n b = uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')\n c = uuid.uuid4()\n d = uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')\n\n m = UUIDModel(a=a, b=b, c=c, d=d)\n assert m.model_dump() == {'a': a, 'b': b, 'c': c, 'd': d}\n\n with pytest.raises(ValidationError) as exc_info:\n UUIDModel(a=d, b=c, c=b, d=a)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'uuid_version',\n 'loc': ('a',),\n 'msg': 'uuid version 1 expected',\n 'input': d,\n 'ctx': {'required_version': 1},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('b',),\n 'msg': 'uuid version 3 expected',\n 'input': c,\n 'ctx': {'required_version': 3},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('c',),\n 'msg': 'uuid version 4 expected',\n 'input': b,\n 'ctx': {'required_version': 4},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('d',),\n 'msg': 'uuid version 5 expected',\n 'input': a,\n 'ctx': {'required_version': 5},\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_pydantic__pydantic/tests/test_types.py_test_uuid_strict_test_uuid_strict.assert_isinstance_m_d_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_strict_test_uuid_strict.assert_isinstance_m_d_ty", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2375, "end_line": 2426, "span_ids": ["test_uuid_strict"], "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 test_uuid_strict() -> None:\n class UUIDModel(BaseModel):\n a: UUID1\n b: UUID3\n c: UUID4\n d: UUID5\n\n model_config = ConfigDict(strict=True)\n\n a = uuid.UUID('7fb48116-ca6b-11ed-a439-3274d3adddac') # uuid1\n b = uuid.UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') # uuid3\n c = uuid.UUID('260d1600-3680-4f4f-a968-f6fa622ffd8d') # uuid4\n d = uuid.UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d') # uuid5\n\n with pytest.raises(ValidationError) as exc_info:\n UUIDModel(a=str(a), b=str(b), c=str(c), d=str(d))\n assert exc_info.value.errors() == [\n {\n 'type': 'is_instance_of',\n 'loc': ('a',),\n 'msg': 'Input should be an instance of UUID',\n 'input': '7fb48116-ca6b-11ed-a439-3274d3adddac',\n 'ctx': {'class': 'UUID'},\n },\n {\n 'type': 'is_instance_of',\n 'loc': ('b',),\n 'msg': 'Input should be an instance of UUID',\n 'input': '6fa459ea-ee8a-3ca4-894e-db77e160355e',\n 'ctx': {'class': 'UUID'},\n },\n {\n 'type': 'is_instance_of',\n 'loc': ('c',),\n 'msg': 'Input should be an instance of UUID',\n 'input': '260d1600-3680-4f4f-a968-f6fa622ffd8d',\n 'ctx': {'class': 'UUID'},\n },\n {\n 'type': 'is_instance_of',\n 'loc': ('d',),\n 'msg': 'Input should be an instance of UUID',\n 'input': '886313e1-3b8a-5372-9b90-0c9aee199e5d',\n 'ctx': {'class': 'UUID'},\n },\n ]\n\n m = UUIDModel(a=a, b=b, c=c, d=d)\n assert isinstance(m.a, type(a)) and m.a == a\n assert isinstance(m.b, type(b)) and m.b == b\n assert isinstance(m.c, type(c)) and m.c == c\n assert isinstance(m.d, type(d)) and m.d == 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_pydantic__pydantic/tests/test_types.py_test_str_strip_whitespace_test_str_strip_whitespace.assert_m_str_check_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_str_strip_whitespace_test_str_strip_whitespace.assert_m_str_check_res", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2429, "end_line": 2444, "span_ids": ["test_str_strip_whitespace"], "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": "@pytest.mark.parametrize(\n 'enabled,str_check,result_str_check',\n [\n (True, ' 123 ', '123'),\n (True, ' 123\\t\\n', '123'),\n (False, ' 123 ', ' 123 '),\n ],\n)\ndef test_str_strip_whitespace(enabled, str_check, result_str_check):\n class Model(BaseModel):\n str_check: str\n\n model_config = ConfigDict(str_strip_whitespace=enabled)\n\n m = Model(str_check=str_check)\n assert m.str_check == result_str_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_pydantic__pydantic/tests/test_types.py_test_str_to_upper_ANY_THING.object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_str_to_upper_ANY_THING.object_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2447, "end_line": 2482, "span_ids": ["test_str_to_lower", "test_str_to_upper", "impl:5"], "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": "@pytest.mark.parametrize(\n 'enabled,str_check,result_str_check',\n [(True, 'ABCDefG', 'ABCDEFG'), (False, 'ABCDefG', 'ABCDefG')],\n)\ndef test_str_to_upper(enabled, str_check, result_str_check):\n class Model(BaseModel):\n str_check: str\n\n model_config = ConfigDict(str_to_upper=enabled)\n\n m = Model(str_check=str_check)\n\n assert m.str_check == result_str_check\n\n\n@pytest.mark.parametrize(\n 'enabled,str_check,result_str_check',\n [(True, 'ABCDefG', 'abcdefg'), (False, 'ABCDefG', 'ABCDefG')],\n)\ndef test_str_to_lower(enabled, str_check, result_str_check):\n class Model(BaseModel):\n str_check: str\n\n model_config = ConfigDict(str_to_lower=enabled)\n\n m = Model(str_check=str_check)\n\n assert m.str_check == result_str_check\n\n\npos_int_values = 'Inf', '+Inf', 'Infinity', '+Infinity'\nneg_int_values = '-Inf', '-Infinity'\nnan_values = 'NaN', '-NaN', '+NaN', 'sNaN', '-sNaN', '+sNaN'\nnon_finite_values = nan_values + pos_int_values + neg_int_values\n# dirty_equals.AnyThing() doesn't work with Decimal on PyPy, hence this hack\nANY_THING = 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_pydantic__pydantic/tests/test_types.py_test_decimal_validation_test_decimal_validation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_validation_test_decimal_validation", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2485, "end_line": 2699, "span_ids": ["test_decimal_validation"], "tokens": 1375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'type_args,value,result',\n [\n (dict(gt=Decimal('42.24')), Decimal('43'), Decimal('43')),\n (\n dict(gt=Decimal('42.24')),\n Decimal('42'),\n [\n {\n 'type': 'greater_than',\n 'loc': ('foo',),\n 'msg': 'Input should be greater than 42.24',\n 'input': Decimal('42'),\n 'ctx': {'gt': 42.24},\n }\n ],\n ),\n (dict(lt=Decimal('42.24')), Decimal('42'), Decimal('42')),\n (\n dict(lt=Decimal('42.24')),\n Decimal('43'),\n [\n {\n 'type': 'less_than',\n 'loc': ('foo',),\n 'msg': 'Input should be less than 42.24',\n 'input': Decimal('43'),\n 'ctx': {\n 'lt': 42.24,\n },\n },\n ],\n ),\n (dict(ge=Decimal('42.24')), Decimal('43'), Decimal('43')),\n (dict(ge=Decimal('42.24')), Decimal('42.24'), Decimal('42.24')),\n (\n dict(ge=Decimal('42.24')),\n Decimal('42'),\n [\n {\n 'type': 'greater_than_equal',\n 'loc': ('foo',),\n 'msg': 'Input should be greater than or equal to 42.24',\n 'input': Decimal('42'),\n 'ctx': {\n 'ge': 42.24,\n },\n }\n ],\n ),\n (dict(le=Decimal('42.24')), Decimal('42'), Decimal('42')),\n (dict(le=Decimal('42.24')), Decimal('42.24'), Decimal('42.24')),\n (\n dict(le=Decimal('42.24')),\n Decimal('43'),\n [\n {\n 'type': 'less_than_equal',\n 'loc': ('foo',),\n 'msg': 'Input should be less than or equal to 42.24',\n 'input': Decimal('43'),\n 'ctx': {\n 'le': 42.24,\n },\n }\n ],\n ),\n (dict(max_digits=2, decimal_places=2), Decimal('0.99'), Decimal('0.99')),\n (\n dict(max_digits=2, decimal_places=1),\n Decimal('0.99'),\n [\n {\n 'type': 'decimal_max_places',\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 1 decimal places',\n 'input': Decimal('0.99'),\n 'ctx': {\n 'decimal_places': 1,\n },\n }\n ],\n ),\n (\n dict(max_digits=3, decimal_places=1),\n Decimal('999'),\n [\n {\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 2 digits before the decimal point',\n 'type': 'decimal_whole_digits',\n 'input': Decimal('999'),\n 'ctx': {'whole_digits': 2},\n }\n ],\n ),\n (dict(max_digits=4, decimal_places=1), Decimal('999'), Decimal('999')),\n (dict(max_digits=20, decimal_places=2), Decimal('742403889818000000'), Decimal('742403889818000000')),\n (dict(max_digits=20, decimal_places=2), Decimal('7.42403889818E+17'), Decimal('7.42403889818E+17')),\n (\n dict(max_digits=20, decimal_places=2),\n Decimal('7424742403889818000000'),\n [\n {\n 'type': 'decimal_max_digits',\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 20 digits in total',\n 'input': Decimal('7424742403889818000000'),\n 'ctx': {\n 'max_digits': 20,\n },\n },\n ],\n ),\n (dict(max_digits=5, decimal_places=2), Decimal('7304E-1'), Decimal('7304E-1')),\n (\n dict(max_digits=5, decimal_places=2),\n Decimal('7304E-3'),\n [\n {\n 'type': 'decimal_max_places',\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 2 decimal places',\n 'input': Decimal('7.304'),\n 'ctx': {'decimal_places': 2},\n }\n ],\n ),\n (dict(max_digits=5, decimal_places=5), Decimal('70E-5'), Decimal('70E-5')),\n (\n dict(max_digits=5, decimal_places=5),\n Decimal('70E-6'),\n [\n {\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 5 digits in total',\n 'type': 'decimal_max_digits',\n 'input': Decimal('0.000070'),\n 'ctx': {'max_digits': 5},\n }\n ],\n ),\n *[\n (\n dict(decimal_places=2, max_digits=10, allow_inf_nan=False),\n value,\n [\n {\n 'loc': ('foo',),\n 'msg': 'Input should be a finite number',\n 'type': 'finite_number',\n 'input': value,\n }\n ],\n )\n for value in non_finite_values\n ],\n *[\n (\n dict(decimal_places=2, max_digits=10, allow_inf_nan=False),\n Decimal(value),\n [\n {\n 'loc': ('foo',),\n 'msg': 'Input should be a finite number',\n 'type': 'finite_number',\n 'input': ANY_THING,\n }\n ],\n )\n for value in non_finite_values\n ],\n (\n dict(multiple_of=Decimal('5')),\n Decimal('42'),\n [\n {\n 'type': 'decimal_multiple_of',\n 'loc': ('foo',),\n 'msg': 'Input should be a multiple of 5',\n 'input': Decimal('42'),\n 'ctx': {\n 'multiple_of': Decimal('5'),\n },\n }\n ],\n ),\n ],\n)\n@pytest.mark.parametrize('mode', ['Field', 'condecimal'])\ndef test_decimal_validation(mode, type_args, value, result):\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_pydantic__pydantic/tests/test_types.py_test_decimal_validation.if_mode_Field__fix_allow_inf_model.return.Model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_validation.if_mode_Field__fix_allow_inf_model.return.Model", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2676, "end_line": 2707, "span_ids": ["test_decimal_validation", "fix_allow_inf_model"], "tokens": 1585}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize(\n 'type_args,value,result',\n [\n (dict(gt=Decimal('42.24')), Decimal('43'), Decimal('43')),\n (\n dict(gt=Decimal('42.24')),\n Decimal('42'),\n [\n {\n 'type': 'greater_than',\n 'loc': ('foo',),\n 'msg': 'Input should be greater than 42.24',\n 'input': Decimal('42'),\n 'ctx': {'gt': 42.24},\n }\n ],\n ),\n (dict(lt=Decimal('42.24')), Decimal('42'), Decimal('42')),\n (\n dict(lt=Decimal('42.24')),\n Decimal('43'),\n [\n {\n 'type': 'less_than',\n 'loc': ('foo',),\n 'msg': 'Input should be less than 42.24',\n 'input': Decimal('43'),\n 'ctx': {\n 'lt': 42.24,\n },\n },\n ],\n ),\n (dict(ge=Decimal('42.24')), Decimal('43'), Decimal('43')),\n (dict(ge=Decimal('42.24')), Decimal('42.24'), Decimal('42.24')),\n (\n dict(ge=Decimal('42.24')),\n Decimal('42'),\n [\n {\n 'type': 'greater_than_equal',\n 'loc': ('foo',),\n 'msg': 'Input should be greater than or equal to 42.24',\n 'input': Decimal('42'),\n 'ctx': {\n 'ge': 42.24,\n },\n }\n ],\n ),\n (dict(le=Decimal('42.24')), Decimal('42'), Decimal('42')),\n (dict(le=Decimal('42.24')), Decimal('42.24'), Decimal('42.24')),\n (\n dict(le=Decimal('42.24')),\n Decimal('43'),\n [\n {\n 'type': 'less_than_equal',\n 'loc': ('foo',),\n 'msg': 'Input should be less than or equal to 42.24',\n 'input': Decimal('43'),\n 'ctx': {\n 'le': 42.24,\n },\n }\n ],\n ),\n (dict(max_digits=2, decimal_places=2), Decimal('0.99'), Decimal('0.99')),\n (\n dict(max_digits=2, decimal_places=1),\n Decimal('0.99'),\n [\n {\n 'type': 'decimal_max_places',\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 1 decimal places',\n 'input': Decimal('0.99'),\n 'ctx': {\n 'decimal_places': 1,\n },\n }\n ],\n ),\n (\n dict(max_digits=3, decimal_places=1),\n Decimal('999'),\n [\n {\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 2 digits before the decimal point',\n 'type': 'decimal_whole_digits',\n 'input': Decimal('999'),\n 'ctx': {'whole_digits': 2},\n }\n ],\n ),\n (dict(max_digits=4, decimal_places=1), Decimal('999'), Decimal('999')),\n (dict(max_digits=20, decimal_places=2), Decimal('742403889818000000'), Decimal('742403889818000000')),\n (dict(max_digits=20, decimal_places=2), Decimal('7.42403889818E+17'), Decimal('7.42403889818E+17')),\n (\n dict(max_digits=20, decimal_places=2),\n Decimal('7424742403889818000000'),\n [\n {\n 'type': 'decimal_max_digits',\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 20 digits in total',\n 'input': Decimal('7424742403889818000000'),\n 'ctx': {\n 'max_digits': 20,\n },\n },\n ],\n ),\n (dict(max_digits=5, decimal_places=2), Decimal('7304E-1'), Decimal('7304E-1')),\n (\n dict(max_digits=5, decimal_places=2),\n Decimal('7304E-3'),\n [\n {\n 'type': 'decimal_max_places',\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 2 decimal places',\n 'input': Decimal('7.304'),\n 'ctx': {'decimal_places': 2},\n }\n ],\n ),\n (dict(max_digits=5, decimal_places=5), Decimal('70E-5'), Decimal('70E-5')),\n (\n dict(max_digits=5, decimal_places=5),\n Decimal('70E-6'),\n [\n {\n 'loc': ('foo',),\n 'msg': 'ensure that there are no more than 5 digits in total',\n 'type': 'decimal_max_digits',\n 'input': Decimal('0.000070'),\n 'ctx': {'max_digits': 5},\n }\n ],\n ),\n *[\n (\n dict(decimal_places=2, max_digits=10, allow_inf_nan=False),\n value,\n [\n {\n 'loc': ('foo',),\n 'msg': 'Input should be a finite number',\n 'type': 'finite_number',\n 'input': value,\n }\n ],\n )\n for value in non_finite_values\n ],\n *[\n (\n dict(decimal_places=2, max_digits=10, allow_inf_nan=False),\n Decimal(value),\n [\n {\n 'loc': ('foo',),\n 'msg': 'Input should be a finite number',\n 'type': 'finite_number',\n 'input': ANY_THING,\n }\n ],\n )\n for value in non_finite_values\n ],\n (\n dict(multiple_of=Decimal('5')),\n Decimal('42'),\n [\n {\n 'type': 'decimal_multiple_of',\n 'loc': ('foo',),\n 'msg': 'Input should be a multiple of 5',\n 'input': Decimal('42'),\n 'ctx': {\n 'multiple_of': Decimal('5'),\n },\n }\n ],\n ),\n ],\n)\n@pytest.mark.parametrize('mode', ['Field', 'condecimal'])\ndef test_decimal_validation(mode, type_args, value, result):\n if mode == 'Field':\n\n class Model(BaseModel):\n foo: Decimal = Field(**type_args)\n\n else:\n\n class Model(BaseModel):\n foo: condecimal(**type_args)\n\n if not isinstance(result, Decimal):\n with pytest.raises(ValidationError) as exc_info:\n m = Model(foo=value)\n print(f'unexpected result: {m!r}')\n # debug(exc_info.value.errors())\n # dirty_equals.AnyThing() doesn't work with Decimal on PyPy, hence this hack\n errors = exc_info.value.errors()\n if result[0].get('input') is ANY_THING:\n for e in errors:\n e['input'] = ANY_THING\n assert errors == result\n # assert exc_info.value.json().startswith('[')\n else:\n assert Model(foo=value).foo == result\n\n\n@pytest.fixture(scope='module', name='AllowInfModel')\ndef fix_allow_inf_model():\n class Model(BaseModel):\n v: condecimal(allow_inf_nan=True)\n\n return Model", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_not_finite_test_decimal_not_finite.if_result_unchanged_.else_.assert_m_v_is_infinite_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_not_finite_test_decimal_not_finite.if_result_unchanged_.else_.assert_m_v_is_infinite_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2710, "end_line": 2729, "span_ids": ["test_decimal_not_finite"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n (Decimal('42'), 'unchanged'),\n *[(v, 'is_nan') for v in nan_values],\n *[(v, 'is_pos_inf') for v in pos_int_values],\n *[(v, 'is_neg_inf') for v in neg_int_values],\n ],\n)\ndef test_decimal_not_finite(value, result, AllowInfModel):\n m = AllowInfModel(v=value)\n if result == 'unchanged':\n assert m.v == value\n elif result == 'is_nan':\n assert m.v.is_nan(), m.v\n elif result == 'is_pos_inf':\n assert m.v.is_infinite() and m.v > 0, m.v\n else:\n assert result == 'is_neg_inf'\n assert m.v.is_infinite() and m.v < 0, m.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_pydantic__pydantic/tests/test_types.py_test_decimal_invalid_test_path_validation_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_invalid_test_path_validation_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2732, "end_line": 2756, "span_ids": ["test_path_validation_success", "test_decimal_invalid", "test_path_validation_fails"], "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 test_decimal_invalid():\n with pytest.raises(ValueError, match='allow_inf_nan=True cannot be used with max_digits or decimal_places'):\n\n class Model(BaseModel):\n v: condecimal(allow_inf_nan=True, max_digits=4)\n\n\n@pytest.mark.parametrize('value,result', (('/test/path', Path('/test/path')), (Path('/test/path'), Path('/test/path'))))\ndef test_path_validation_success(value, result):\n class Model(BaseModel):\n foo: Path\n\n assert Model(foo=value).foo == result\n\n\ndef test_path_validation_fails():\n class Model(BaseModel):\n foo: Path\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=123)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'path_type', 'loc': ('foo',), 'msg': 'Input is not a valid path', 'input': 123}\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_pydantic__pydantic/tests/test_types.py_test_path_validation_strict_test_path_validation_strict.assert_Model_foo_Path_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_path_validation_strict_test_path_validation_strict.assert_Model_foo_Path_t", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2759, "end_line": 2778, "span_ids": ["test_path_validation_strict"], "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 test_path_validation_strict():\n class Model(BaseModel):\n foo: Path\n\n model_config = ConfigDict(strict=True)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo='/test/path')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'is_instance_of',\n 'loc': ('foo',),\n 'msg': 'Input should be an instance of Path',\n 'input': '/test/path',\n 'ctx': {'class': 'Path'},\n }\n ]\n\n assert Model(foo=Path('/test/path')).foo == Path('/test/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_pydantic__pydantic/tests/test_types.py_test_file_path_validation_success_test_file_path_validation_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_file_path_validation_success_test_file_path_validation_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2781, "end_line": 2806, "span_ids": ["test_file_path_validation_fails", "test_file_path_validation_success"], "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": "@pytest.mark.parametrize(\n 'value,result',\n (('tests/test_types.py', Path('tests/test_types.py')), (Path('tests/test_types.py'), Path('tests/test_types.py'))),\n)\ndef test_file_path_validation_success(value, result):\n class Model(BaseModel):\n foo: FilePath\n\n assert Model(foo=value).foo == result\n\n\n@pytest.mark.parametrize('value', ['nonexistentfile', Path('nonexistentfile'), 'tests', Path('tests')])\ndef test_file_path_validation_fails(value):\n class Model(BaseModel):\n foo: FilePath\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n assert exc_info.value.errors() == [\n {\n 'type': 'path_not_file',\n 'loc': ('foo',),\n 'msg': 'Path does not point to a file',\n 'input': value,\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_pydantic__pydantic/tests/test_types.py_test_directory_path_validation_success_test_directory_path_validation_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_directory_path_validation_success_test_directory_path_validation_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2809, "end_line": 2833, "span_ids": ["test_directory_path_validation_fails", "test_directory_path_validation_success"], "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": "@pytest.mark.parametrize('value,result', (('tests', Path('tests')), (Path('tests'), Path('tests'))))\ndef test_directory_path_validation_success(value, result):\n class Model(BaseModel):\n foo: DirectoryPath\n\n assert Model(foo=value).foo == result\n\n\n@pytest.mark.parametrize(\n 'value', ['nonexistentdirectory', Path('nonexistentdirectory'), 'tests/test_t.py', Path('tests/test_ypestypes.py')]\n)\ndef test_directory_path_validation_fails(value):\n class Model(BaseModel):\n foo: DirectoryPath\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n assert exc_info.value.errors() == [\n {\n 'type': 'path_not_directory',\n 'loc': ('foo',),\n 'msg': 'Path does not point to a directory',\n 'input': value,\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_pydantic__pydantic/tests/test_types.py_test_number_gt_test_number_gt.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_gt_test_number_gt.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2836, "end_line": 2853, "span_ids": ["test_number_gt"], "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 test_number_gt():\n class Model(BaseModel):\n a: conint(gt=-1) = 0\n\n assert Model(a=0).model_dump() == {'a': 0}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=-1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'greater_than',\n 'loc': ('a',),\n 'msg': 'Input should be greater than -1',\n 'input': -1,\n 'ctx': {'gt': -1},\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_pydantic__pydantic/tests/test_types.py_test_number_ge_test_number_ge.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_ge_test_number_ge.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2856, "end_line": 2873, "span_ids": ["test_number_ge"], "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 test_number_ge():\n class Model(BaseModel):\n a: conint(ge=0) = 0\n\n assert Model(a=0).model_dump() == {'a': 0}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=-1)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'greater_than_equal',\n 'loc': ('a',),\n 'msg': 'Input should be greater than or equal to 0',\n 'input': -1,\n 'ctx': {'ge': 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_pydantic__pydantic/tests/test_types.py_test_number_lt_test_number_lt.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_lt_test_number_lt.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2876, "end_line": 2893, "span_ids": ["test_number_lt"], "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 test_number_lt():\n class Model(BaseModel):\n a: conint(lt=5) = 0\n\n assert Model(a=4).model_dump() == {'a': 4}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=5)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'less_than',\n 'loc': ('a',),\n 'msg': 'Input should be less than 5',\n 'input': 5,\n 'ctx': {'lt': 5},\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_pydantic__pydantic/tests/test_types.py_test_number_le_test_number_multiple_of_int_valid.assert_Model_a_value_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_le_test_number_multiple_of_int_valid.assert_Model_a_value_mod", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2896, "end_line": 2921, "span_ids": ["test_number_multiple_of_int_valid", "test_number_le"], "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 test_number_le():\n class Model(BaseModel):\n a: conint(le=5) = 0\n\n assert Model(a=5).model_dump() == {'a': 5}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=6)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'less_than_equal',\n 'loc': ('a',),\n 'msg': 'Input should be less than or equal to 5',\n 'input': 6,\n 'ctx': {'le': 5},\n }\n ]\n\n\n@pytest.mark.parametrize('value', (10, 100, 20))\ndef test_number_multiple_of_int_valid(value):\n class Model(BaseModel):\n a: conint(multiple_of=5)\n\n assert Model(a=value).model_dump() == {'a': 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_pydantic__pydantic/tests/test_types.py_test_number_multiple_of_int_invalid_test_number_multiple_of_float_valid.assert_Model_a_value_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_multiple_of_int_invalid_test_number_multiple_of_float_valid.assert_Model_a_value_mod", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2924, "end_line": 2948, "span_ids": ["test_number_multiple_of_int_invalid", "test_number_multiple_of_float_valid"], "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": "@pytest.mark.parametrize('value', [1337, 23, 6, 14])\ndef test_number_multiple_of_int_invalid(value):\n class Model(BaseModel):\n a: conint(multiple_of=5)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'multiple_of',\n 'loc': ('a',),\n 'msg': 'Input should be a multiple of 5',\n 'input': value,\n 'ctx': {'multiple_of': 5},\n }\n ]\n\n\n@pytest.mark.parametrize('value', [0.2, 0.3, 0.4, 0.5, 1])\ndef test_number_multiple_of_float_valid(value):\n class Model(BaseModel):\n a: confloat(multiple_of=0.1)\n\n assert Model(a=value).model_dump() == {'a': 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_pydantic__pydantic/tests/test_types.py_test_number_multiple_of_float_invalid_test_number_multiple_of_float_invalid.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_number_multiple_of_float_invalid_test_number_multiple_of_float_invalid.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2951, "end_line": 2967, "span_ids": ["test_number_multiple_of_float_invalid"], "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": "@pytest.mark.parametrize('value', [0.07, 1.27, 1.003])\ndef test_number_multiple_of_float_invalid(value):\n class Model(BaseModel):\n a: confloat(multiple_of=0.1)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=value)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'multiple_of',\n 'loc': ('a',),\n 'msg': 'Input should be a multiple of 0.1',\n 'input': value,\n 'ctx': {'multiple_of': 0.1},\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_pydantic__pydantic/tests/test_types.py_test_new_type_success_test_new_type_success.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_new_type_success_test_new_type_success.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2970, "end_line": 2981, "span_ids": ["test_new_type_success"], "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 test_new_type_success():\n a_type = NewType('a_type', int)\n b_type = NewType('b_type', a_type)\n c_type = NewType('c_type', List[int])\n\n class Model(BaseModel):\n a: a_type\n b: b_type\n c: c_type\n\n m = Model(a=42, b=24, c=[1, 2, 3])\n assert m.model_dump() == {'a': 42, 'b': 24, 'c': [1, 2, 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_pydantic__pydantic/tests/test_types.py_test_new_type_fails_test_new_type_fails.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_new_type_fails_test_new_type_fails.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2984, "end_line": 3016, "span_ids": ["test_new_type_fails"], "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 test_new_type_fails():\n a_type = NewType('a_type', int)\n b_type = NewType('b_type', a_type)\n c_type = NewType('c_type', List[int])\n\n class Model(BaseModel):\n a: a_type\n b: b_type\n c: c_type\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='foo', b='bar', c=['foo'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'foo',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('b',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'bar',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('c', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'foo',\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_pydantic__pydantic/tests/test_types.py_test_valid_simple_json_test_valid_simple_json_any.assert_JsonModel_json_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_valid_simple_json_test_valid_simple_json_any.assert_JsonModel_json_obj", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3019, "end_line": 3032, "span_ids": ["test_valid_simple_json", "test_valid_simple_json_any"], "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 test_valid_simple_json():\n class JsonModel(BaseModel):\n json_obj: Json\n\n obj = '{\"a\": 1, \"b\": [2, 3]}'\n assert JsonModel(json_obj=obj).model_dump() == {'json_obj': {'a': 1, 'b': [2, 3]}}\n\n\ndef test_valid_simple_json_any():\n class JsonModel(BaseModel):\n json_obj: Json[Any]\n\n obj = '{\"a\": 1, \"b\": [2, 3]}'\n assert JsonModel(json_obj=obj).model_dump() == {'json_obj': {'a': 1, 'b': [2, 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_pydantic__pydantic/tests/test_types.py_test_invalid_simple_json_test_valid_simple_json_bytes.assert_JsonModel_json_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_simple_json_test_valid_simple_json_bytes.assert_JsonModel_json_obj", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3035, "end_line": 3062, "span_ids": ["test_valid_simple_json_bytes", "test_invalid_simple_json"], "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": "@pytest.mark.parametrize('gen_type', [lambda: Json, lambda: Json[Any]])\ndef test_invalid_simple_json(gen_type):\n t = gen_type()\n\n class JsonModel(BaseModel):\n json_obj: t\n\n obj = '{a: 1, b: [2, 3]}'\n with pytest.raises(ValidationError) as exc_info:\n JsonModel(json_obj=obj)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'json_invalid',\n 'loc': ('json_obj',),\n 'msg': 'Invalid JSON: key must be a string at line 1 column 2',\n 'input': '{a: 1, b: [2, 3]}',\n 'ctx': {'error': 'key must be a string at line 1 column 2'},\n }\n ]\n\n\ndef test_valid_simple_json_bytes():\n class JsonModel(BaseModel):\n json_obj: Json\n\n obj = b'{\"a\": 1, \"b\": [2, 3]}'\n assert JsonModel(json_obj=obj).model_dump() == {'json_obj': {'a': 1, 'b': [2, 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_pydantic__pydantic/tests/test_types.py_test_valid_detailed_json_test_valid_detailed_json.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_valid_detailed_json_test_valid_detailed_json.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3065, "end_line": 3087, "span_ids": ["test_valid_detailed_json"], "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 test_valid_detailed_json():\n class JsonDetailedModel(BaseModel):\n json_obj: Json[List[int]]\n\n obj = '[1, 2, 3]'\n assert JsonDetailedModel(json_obj=obj).model_dump() == {'json_obj': [1, 2, 3]}\n\n obj = b'[1, 2, 3]'\n assert JsonDetailedModel(json_obj=obj).model_dump() == {'json_obj': [1, 2, 3]}\n\n obj = '(1, 2, 3)'\n with pytest.raises(ValidationError) as exc_info:\n JsonDetailedModel(json_obj=obj)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'json_invalid',\n 'loc': ('json_obj',),\n 'msg': 'Invalid JSON: expected value at line 1 column 1',\n 'input': '(1, 2, 3)',\n 'ctx': {'error': 'expected value at line 1 column 1'},\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_pydantic__pydantic/tests/test_types.py_test_valid_model_json_test_valid_model_json.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_valid_model_json_test_valid_model_json.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3090, "end_line": 3102, "span_ids": ["test_valid_model_json"], "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 test_valid_model_json():\n class Model(BaseModel):\n a: int\n b: List[int]\n\n class JsonDetailedModel(BaseModel):\n json_obj: Json[Model]\n\n obj = '{\"a\": 1, \"b\": [2, 3]}'\n m = JsonDetailedModel(json_obj=obj)\n assert isinstance(m.json_obj, Model)\n assert m.json_obj.a == 1\n assert m.model_dump() == {'json_obj': {'a': 1, 'b': [2, 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_pydantic__pydantic/tests/test_types.py_test_invalid_model_json_test_invalid_model_json.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_model_json_test_invalid_model_json.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3105, "end_line": 3120, "span_ids": ["test_invalid_model_json"], "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 test_invalid_model_json():\n class Model(BaseModel):\n a: int\n b: List[int]\n\n class JsonDetailedModel(BaseModel):\n json_obj: Json[Model]\n\n obj = '{\"a\": 1, \"c\": [2, 3]}'\n with pytest.raises(ValidationError) as exc_info:\n JsonDetailedModel(json_obj=obj)\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'missing', 'loc': ('json_obj', 'b'), 'msg': 'Field required', 'input': {'a': 1, 'c': [2, 3]}}\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_pydantic__pydantic/tests/test_types.py_test_invalid_detailed_json_type_error_test_invalid_detailed_json_type_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_invalid_detailed_json_type_error_test_invalid_detailed_json_type_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3123, "end_line": 3150, "span_ids": ["test_invalid_detailed_json_type_error"], "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 test_invalid_detailed_json_type_error():\n class JsonDetailedModel(BaseModel):\n json_obj: Json[List[int]]\n\n obj = '[\"a\", \"b\", \"c\"]'\n with pytest.raises(ValidationError) as exc_info:\n JsonDetailedModel(json_obj=obj)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('json_obj', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('json_obj', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'b',\n },\n {\n 'type': 'int_parsing',\n 'loc': ('json_obj', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'c',\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_pydantic__pydantic/tests/test_types.py_test_json_not_str_test_json_not_str.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_not_str_test_json_not_str.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3153, "end_line": 3168, "span_ids": ["test_json_not_str"], "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 test_json_not_str():\n class JsonDetailedModel(BaseModel):\n json_obj: Json[List[int]]\n\n obj = 12\n with pytest.raises(ValidationError) as exc_info:\n JsonDetailedModel(json_obj=obj)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'json_type',\n 'loc': ('json_obj',),\n 'msg': 'JSON input should be string, bytes or bytearray',\n 'input': 12,\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_pydantic__pydantic/tests/test_types.py_test_json_before_validator_test_json_optional_simple.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_before_validator_test_json_optional_simple.None_1", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3171, "end_line": 3194, "span_ids": ["test_json_before_validator", "test_json_optional_simple"], "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_json_before_validator():\n call_count = 0\n\n class JsonModel(BaseModel):\n json_obj: Json[str]\n\n @field_validator('json_obj', mode='before')\n @classmethod\n def check(cls, v):\n assert v == '\"foobar\"'\n nonlocal call_count\n call_count += 1\n return v\n\n assert JsonModel(json_obj='\"foobar\"').model_dump() == {'json_obj': 'foobar'}\n assert call_count == 1\n\n\ndef test_json_optional_simple():\n class JsonOptionalModel(BaseModel):\n json_obj: Optional[Json]\n\n assert JsonOptionalModel(json_obj=None).model_dump() == {'json_obj': None}\n assert JsonOptionalModel(json_obj='[\"x\", \"y\", \"z\"]').model_dump() == {'json_obj': ['x', 'y', '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_pydantic__pydantic/tests/test_types.py_test_json_optional_complex_test_json_required.None_1.JsonRequired_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_optional_complex_test_json_required.None_1.JsonRequired_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3197, "end_line": 3227, "span_ids": ["test_json_required", "test_json_optional_complex"], "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 test_json_optional_complex():\n class JsonOptionalModel(BaseModel):\n json_obj: Optional[Json[List[int]]]\n\n JsonOptionalModel(json_obj=None)\n\n good = JsonOptionalModel(json_obj='[1, 2, 3]')\n assert good.json_obj == [1, 2, 3]\n\n with pytest.raises(ValidationError) as exc_info:\n JsonOptionalModel(json_obj='[\"i should fail\"]')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('json_obj', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'i should fail',\n }\n ]\n\n\ndef test_json_required():\n class JsonRequired(BaseModel):\n json_obj: Json\n\n assert JsonRequired(json_obj='[\"x\", \"y\", \"z\"]').model_dump() == {'json_obj': ['x', 'y', 'z']}\n with pytest.raises(ValidationError, match=r'JSON input should be string, bytes or bytearray \\[type=json_type,'):\n JsonRequired(json_obj=None)\n with pytest.raises(ValidationError, match=r'Field required \\[type=missing,'):\n JsonRequired()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_test_pattern._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_test_pattern._", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3230, "end_line": 3251, "span_ids": ["test_pattern"], "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": "@pytest.mark.parametrize('pattern_type', [re.Pattern, Pattern])\ndef test_pattern(pattern_type):\n class Foobar(BaseModel):\n pattern: pattern_type\n\n f = Foobar(pattern=r'^whatev.r\\d$')\n assert f.pattern.__class__.__name__ == 'Pattern'\n # check it's really a proper pattern\n assert f.pattern.match('whatever1')\n assert not f.pattern.match(' whatever1')\n\n # Check that pre-compiled patterns are accepted unchanged\n p = re.compile(r'^whatev.r\\d$')\n f2 = Foobar(pattern=p)\n assert f2.pattern is p\n\n # assert Foobar.model_json_schema() == {\n # 'type': 'object',\n # 'title': 'Foobar',\n # 'properties': {'pattern': {'type': 'string', 'format': 'regex', 'title': 'Pattern'}},\n # 'required': ['pattern'],\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_pydantic__pydantic/tests/test_types.py_test_pattern_error_test_pattern_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_error_test_pattern_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3254, "end_line": 3269, "span_ids": ["test_pattern_error"], "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": "@pytest.mark.parametrize('pattern_type', [re.Pattern, Pattern])\ndef test_pattern_error(pattern_type):\n class Foobar(BaseModel):\n pattern: pattern_type\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(pattern='[xx')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'pattern_regex',\n 'loc': ('pattern',),\n 'msg': 'Input should be a valid regular expression',\n 'input': '[xx',\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_pydantic__pydantic/tests/test_types.py_test_secretstr_test_secretstr.assert_f_empty_password_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretstr_test_secretstr.assert_f_empty_password_g", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3272, "end_line": 3292, "span_ids": ["test_secretstr"], "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 test_secretstr():\n class Foobar(BaseModel):\n password: SecretStr\n empty_password: SecretStr\n\n # Initialize the model.\n f = Foobar(password='1234', empty_password='')\n\n # Assert correct types.\n assert f.password.__class__.__name__ == 'SecretStr'\n assert f.empty_password.__class__.__name__ == 'SecretStr'\n\n # Assert str and repr are correct.\n assert str(f.password) == '**********'\n assert str(f.empty_password) == ''\n assert repr(f.password) == \"SecretStr('**********')\"\n assert repr(f.empty_password) == \"SecretStr('')\"\n\n # Assert retrieval of secret value is correct\n assert f.password.get_secret_value() == '1234'\n assert f.empty_password.get_secret_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_pydantic__pydantic/tests/test_types.py_test_secretstr_is_secret_field_test_secretstr_is_hashable.assert_type_hash_SecretSt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretstr_is_secret_field_test_secretstr_is_hashable.assert_type_hash_SecretSt", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3295, "end_line": 3316, "span_ids": ["test_secretstr_is_hashable", "test_secretstr_equality", "test_secretstr_idempotent", "test_secretstr_is_secret_field"], "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 test_secretstr_is_secret_field():\n assert issubclass(SecretStr, SecretField)\n\n\ndef test_secretstr_equality():\n assert SecretStr('abc') == SecretStr('abc')\n assert SecretStr('123') != SecretStr('321')\n assert SecretStr('123') != '123'\n assert SecretStr('123') is not SecretStr('123')\n\n\ndef test_secretstr_idempotent():\n class Foobar(BaseModel):\n password: SecretStr\n\n # Should not raise an exception\n m = Foobar(password=SecretStr('1234'))\n assert m.password.get_secret_value() == '1234'\n\n\ndef test_secretstr_is_hashable():\n assert type(hash(SecretStr('secret'))) is 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_pydantic__pydantic/tests/test_types.py_test_secretstr_error_test_secretstr_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretstr_error_test_secretstr_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3319, "end_line": 3333, "span_ids": ["test_secretstr_error"], "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 test_secretstr_error():\n class Foobar(BaseModel):\n password: SecretStr\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password=[6, 23, 'abc'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_type',\n 'loc': ('password',),\n 'msg': 'Input should be a valid string',\n 'input': [6, 23, 'abc'],\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_pydantic__pydantic/tests/test_types.py_test_secret_str_min_max_length_test_secret_str_min_max_length.assert_Foobar_password_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secret_str_min_max_length_test_secret_str_min_max_length.assert_Foobar_password_va", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3336, "end_line": 3369, "span_ids": ["test_secret_str_min_max_length"], "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 test_secret_str_min_max_length():\n class Foobar(BaseModel):\n password: SecretStr = Field(min_length=6, max_length=10)\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password='')\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_short',\n 'loc': ('password',),\n 'msg': 'String should have at least 6 characters',\n 'input': '',\n 'ctx': {'min_length': 6},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password='1' * 20)\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': ('password',),\n 'msg': 'String should have at most 10 characters',\n 'input': '11111111111111111111',\n 'ctx': {'max_length': 10},\n }\n ]\n\n value = '1' * 8\n assert Foobar(password=value).password.get_secret_value() == 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_pydantic__pydantic/tests/test_types.py_test_secretbytes_test_secretbytes.assert_f_copied_with_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_test_secretbytes.assert_f_copied_with_c", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3372, "end_line": 3398, "span_ids": ["test_secretbytes"], "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 test_secretbytes():\n class Foobar(BaseModel):\n password: SecretBytes\n empty_password: SecretBytes\n\n # Initialize the model.\n f = Foobar(password=b'wearebytes', empty_password=b'')\n\n # Assert correct types.\n assert f.password.__class__.__name__ == 'SecretBytes'\n assert f.empty_password.__class__.__name__ == 'SecretBytes'\n\n # Assert str and repr are correct.\n assert str(f.password) == \"b'**********'\"\n assert str(f.empty_password) == \"b''\"\n assert repr(f.password) == \"SecretBytes(b'**********')\"\n assert repr(f.empty_password) == \"SecretBytes(b'')\"\n\n # Assert retrieval of secret value is correct\n assert f.password.get_secret_value() == b'wearebytes'\n assert f.empty_password.get_secret_value() == b''\n\n # Assert that SecretBytes is equal to SecretBytes if the secret is the same.\n assert f == f.model_copy()\n copied_with_changes = f.model_copy()\n copied_with_changes.password = SecretBytes(b'4321')\n assert f != copied_with_changes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_is_secret_field_test_secretbytes_is_hashable.assert_type_hash_SecretBy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_is_secret_field_test_secretbytes_is_hashable.assert_type_hash_SecretBy", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3401, "end_line": 3421, "span_ids": ["test_secretbytes_equality", "test_secretbytes_is_hashable", "test_secretbytes_is_secret_field", "test_secretbytes_idempotent"], "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 test_secretbytes_is_secret_field():\n assert issubclass(SecretBytes, SecretField)\n\n\ndef test_secretbytes_equality():\n assert SecretBytes(b'abc') == SecretBytes(b'abc')\n assert SecretBytes(b'123') != SecretBytes(b'321')\n assert SecretBytes(b'123') != b'123'\n assert SecretBytes(b'123') is not SecretBytes(b'123')\n\n\ndef test_secretbytes_idempotent():\n class Foobar(BaseModel):\n password: SecretBytes\n\n # Should not raise an exception.\n _ = Foobar(password=SecretBytes(b'1234'))\n\n\ndef test_secretbytes_is_hashable():\n assert type(hash(SecretBytes(b'secret'))) is 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_pydantic__pydantic/tests/test_types.py_test_secretbytes_error_test_secretbytes_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretbytes_error_test_secretbytes_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3424, "end_line": 3438, "span_ids": ["test_secretbytes_error"], "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 test_secretbytes_error():\n class Foobar(BaseModel):\n password: SecretBytes\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password=[6, 23, 'abc'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'bytes_type',\n 'loc': ('password',),\n 'msg': 'Input should be a valid bytes',\n 'input': [6, 23, 'abc'],\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_pydantic__pydantic/tests/test_types.py_test_secret_bytes_min_max_length_test_secret_bytes_min_max_length.assert_Foobar_password_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secret_bytes_min_max_length_test_secret_bytes_min_max_length.assert_Foobar_password_va", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3441, "end_line": 3474, "span_ids": ["test_secret_bytes_min_max_length"], "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 test_secret_bytes_min_max_length():\n class Foobar(BaseModel):\n password: SecretBytes = Field(min_length=6, max_length=10)\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password=b'')\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'bytes_too_short',\n 'loc': ('password',),\n 'msg': 'Data should have at least 6 bytes',\n 'input': b'',\n 'ctx': {'min_length': 6},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password=b'1' * 20)\n\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'bytes_too_long',\n 'loc': ('password',),\n 'msg': 'Data should have at most 10 bytes',\n 'input': b'11111111111111111111',\n 'ctx': {'max_length': 10},\n }\n ]\n\n value = b'1' * 8\n assert Foobar(password=value).password.get_secret_value() == 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_pydantic__pydantic/tests/test_types.py_test_generic_without_params_test_generic_without_params_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_generic_without_params_test_generic_without_params_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3477, "end_line": 3510, "span_ids": ["test_generic_without_params", "test_generic_without_params_error"], "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 test_generic_without_params():\n class Model(BaseModel):\n generic_list: List\n generic_dict: Dict\n generic_tuple: Tuple\n\n m = Model(generic_list=[0, 'a'], generic_dict={0: 'a', 'a': 0}, generic_tuple=(1, 'q'))\n assert m.model_dump() == {'generic_list': [0, 'a'], 'generic_dict': {0: 'a', 'a': 0}, 'generic_tuple': (1, 'q')}\n\n\ndef test_generic_without_params_error():\n class Model(BaseModel):\n generic_list: List\n generic_dict: Dict\n generic_tuple: Tuple\n\n with pytest.raises(ValidationError) as exc_info:\n Model(generic_list=0, generic_dict=0, generic_tuple=0)\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'list_type',\n 'loc': ('generic_list',),\n 'msg': 'Input should be a valid list',\n 'input': 0,\n },\n {\n 'type': 'dict_type',\n 'loc': ('generic_dict',),\n 'msg': 'Input should be a valid dictionary',\n 'input': 0,\n },\n {'type': 'tuple_type', 'loc': ('generic_tuple',), 'msg': 'Input should be a valid tuple', 'input': 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_pydantic__pydantic/tests/test_types.py_test_literal_single_test_literal_single.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_literal_single_test_literal_single.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3513, "end_line": 3529, "span_ids": ["test_literal_single"], "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 test_literal_single():\n class Model(BaseModel):\n a: Literal['a']\n\n Model(a='a')\n with pytest.raises(ValidationError) as exc_info:\n Model(a='b')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'literal_error',\n 'loc': ('a',),\n 'msg': \"Input should be 'a'\",\n 'input': 'b',\n 'ctx': {'expected': \"'a'\"},\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_pydantic__pydantic/tests/test_types.py_test_literal_multiple_test_frozenset_field.assert_object_under_test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_literal_multiple_test_frozenset_field.assert_object_under_test_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3532, "end_line": 3566, "span_ids": ["test_frozenset_field", "test_unsupported_field_type", "test_literal_multiple"], "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": "def test_literal_multiple():\n class Model(BaseModel):\n a_or_b: Literal['a', 'b']\n\n Model(a_or_b='a')\n Model(a_or_b='b')\n with pytest.raises(ValidationError) as exc_info:\n Model(a_or_b='c')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'literal_error',\n 'loc': ('a_or_b',),\n 'msg': \"Input should be 'a' or 'b'\",\n 'input': 'c',\n 'ctx': {'expected': \"'a' or 'b'\"},\n }\n ]\n\n\ndef test_unsupported_field_type():\n with pytest.raises(TypeError, match=r'Unable to generate pydantic-core schema MutableSet'):\n\n class UnsupportedModel(BaseModel):\n unsupported: MutableSet[int]\n\n\ndef test_frozenset_field():\n class FrozenSetModel(BaseModel):\n set: FrozenSet[int]\n\n test_set = frozenset({1, 2, 3})\n object_under_test = FrozenSetModel(set=test_set)\n\n assert object_under_test.set == test_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_pydantic__pydantic/tests/test_types.py_test_frozenset_field_conversion_test_frozenset_field_not_convertible.with_pytest_raises_Valida.FrozenSetModel_set_42_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_frozenset_field_conversion_test_frozenset_field_not_convertible.with_pytest_raises_Valida.FrozenSetModel_set_42_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3569, "end_line": 3592, "span_ids": ["test_frozenset_field_conversion", "test_frozenset_field_not_convertible"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n ([1, 2, 3], frozenset([1, 2, 3])),\n ({1, 2, 3}, frozenset([1, 2, 3])),\n ((1, 2, 3), frozenset([1, 2, 3])),\n (deque([1, 2, 3]), frozenset([1, 2, 3])),\n ],\n)\ndef test_frozenset_field_conversion(value, result):\n class FrozenSetModel(BaseModel):\n set: FrozenSet[int]\n\n object_under_test = FrozenSetModel(set=value)\n\n assert object_under_test.set == result\n\n\ndef test_frozenset_field_not_convertible():\n class FrozenSetModel(BaseModel):\n set: FrozenSet[int]\n\n with pytest.raises(ValidationError, match=r'frozenset'):\n FrozenSetModel(set=42)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_bytesize_conversions_test_bytesize_conversions.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_bytesize_conversions_test_bytesize_conversions.None_2", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3595, "end_line": 3618, "span_ids": ["test_bytesize_conversions"], "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": "@pytest.mark.parametrize(\n 'input_value,output,human_bin,human_dec',\n (\n ('1', 1, '1B', '1B'),\n ('1.0', 1, '1B', '1B'),\n ('1b', 1, '1B', '1B'),\n ('1.5 KB', int(1.5e3), '1.5KiB', '1.5KB'),\n ('1.5 K', int(1.5e3), '1.5KiB', '1.5KB'),\n ('1.5 MB', int(1.5e6), '1.4MiB', '1.5MB'),\n ('1.5 M', int(1.5e6), '1.4MiB', '1.5MB'),\n ('5.1kib', 5222, '5.1KiB', '5.2KB'),\n ('6.2EiB', 7148113328562451456, '6.2EiB', '7.1EB'),\n ),\n)\ndef test_bytesize_conversions(input_value, output, human_bin, human_dec):\n class Model(BaseModel):\n size: ByteSize\n\n m = Model(size=input_value)\n\n assert m.size == output\n\n assert m.size.human_readable() == human_bin\n assert m.size.human_readable(decimal=True) == human_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_pydantic__pydantic/tests/test_types.py_test_bytesize_to_test_deque_success.assert_Model_v_1_2_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_bytesize_to_test_deque_success.assert_Model_v_1_2_3_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3621, "end_line": 3655, "span_ids": ["test_bytesize_raises", "test_deque_success", "test_bytesize_to"], "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 test_bytesize_to():\n class Model(BaseModel):\n size: ByteSize\n\n m = Model(size='1GiB')\n\n assert m.size.to('MiB') == pytest.approx(1024)\n assert m.size.to('MB') == pytest.approx(1073.741824)\n assert m.size.to('TiB') == pytest.approx(0.0009765625)\n\n\ndef test_bytesize_raises():\n class Model(BaseModel):\n size: ByteSize\n\n with pytest.raises(ValidationError, match='parse value'):\n Model(size='d1MB')\n\n with pytest.raises(ValidationError, match='byte unit'):\n Model(size='1LiB')\n\n # 1Gi is not a valid unit unlike 1G\n with pytest.raises(ValidationError, match='byte unit'):\n Model(size='1Gi')\n\n m = Model(size='1MB')\n with pytest.raises(PydanticCustomError, match='byte unit'):\n m.size.to('bad_unit')\n\n\ndef test_deque_success():\n class Model(BaseModel):\n v: deque\n\n assert Model(v=[1, 2, 3]).v == deque([1, 2, 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_pydantic__pydantic/tests/test_types.py_test_deque_generic_success_test_deque_generic_success.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_generic_success_test_deque_generic_success.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3658, "end_line": 3689, "span_ids": ["test_deque_generic_success"], "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": "@pytest.mark.parametrize(\n 'cls,value,result',\n (\n (int, [1, 2, 3], deque([1, 2, 3])),\n (int, (1, 2, 3), deque((1, 2, 3))),\n (int, deque((1, 2, 3)), deque((1, 2, 3))),\n (float, [1.0, 2.0, 3.0], deque([1.0, 2.0, 3.0])),\n (Set[int], [{1, 2}, {3, 4}, {5, 6}], deque([{1, 2}, {3, 4}, {5, 6}])),\n (Tuple[int, str], ((1, 'a'), (2, 'b'), (3, 'c')), deque(((1, 'a'), (2, 'b'), (3, 'c')))),\n (str, [w for w in 'one two three'.split()], deque(['one', 'two', 'three'])),\n (\n int,\n {1: 10, 2: 20, 3: 30}.keys(),\n deque([1, 2, 3]),\n ),\n (\n int,\n {1: 10, 2: 20, 3: 30}.values(),\n deque([10, 20, 30]),\n ),\n (\n Tuple[int, int],\n {1: 10, 2: 20, 3: 30}.items(),\n deque([(1, 10), (2, 20), (3, 30)]),\n ),\n ),\n)\ndef test_deque_generic_success(cls, value, result):\n class Model(BaseModel):\n v: Deque[cls]\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_test_deque_generic_success_strict_test_deque_generic_success_strict.assert_Model_v_value_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_generic_success_strict_test_deque_generic_success_strict.assert_Model_v_value_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3692, "end_line": 3705, "span_ids": ["test_deque_generic_success_strict"], "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": "@pytest.mark.parametrize(\n 'cls,value,result',\n (\n (int, deque((1, 2, 3)), deque((1, 2, 3))),\n (str, deque(('1', '2', '3')), deque(('1', '2', '3'))),\n ),\n)\ndef test_deque_generic_success_strict(cls, value: Any, result):\n class Model(BaseModel):\n v: Deque[cls]\n\n model_config = ConfigDict(strict=True)\n\n assert Model(v=value).v == 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_pydantic__pydantic/tests/test_types.py_test_deque_fails_test_deque_fails.assert_expected_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_fails_test_deque_fails.assert_expected_error_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3708, "end_line": 3784, "span_ids": ["test_deque_fails"], "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": "@pytest.mark.parametrize(\n 'cls,value,expected_error',\n (\n (\n float,\n {1, 2, 3},\n {\n 'type': 'list_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid list',\n 'input': {1, 2, 3},\n },\n ),\n (\n float,\n frozenset((1, 2, 3)),\n {\n 'type': 'list_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid list',\n 'input': frozenset((1, 2, 3)),\n },\n ),\n (\n int,\n [1, 'a', 3],\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n ),\n (\n int,\n (1, 2, 'a'),\n {\n 'type': 'int_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n ),\n (\n Tuple[int, str],\n ((1, 'a'), ('a', 'a'), (3, 'c')),\n {\n 'type': 'int_parsing',\n 'loc': ('v', 1, 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n ),\n (\n List[int],\n [{'a': 1, 'b': 2}, [1, 2], [2, 3]],\n {\n 'type': 'list_type',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid list',\n 'input': {\n 'a': 1,\n 'b': 2,\n },\n },\n ),\n ),\n)\ndef test_deque_fails(cls, value, expected_error):\n class Model(BaseModel):\n v: Deque[cls]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=value)\n # debug(exc_info.value.errors())\n assert len(exc_info.value.errors()) == 1\n assert expected_error == exc_info.value.errors()[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_pydantic__pydantic/tests/test_types.py_test_deque_model_test_deque_json.assert_Model_v_deque_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_model_test_deque_json.assert_Model_v_deque_1_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3787, "end_line": 3802, "span_ids": ["test_deque_json", "test_deque_model"], "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 test_deque_model():\n class Model2(BaseModel):\n x: int\n\n class Model(BaseModel):\n v: Deque[Model2]\n\n seq = [Model2(x=1), Model2(x=2)]\n assert Model(v=seq).v == deque(seq)\n\n\ndef test_deque_json():\n class Model(BaseModel):\n v: Deque[int]\n\n assert Model(v=deque((1, 2, 3))).model_dump_json() == '{\"v\":[1,2,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_pydantic__pydantic/tests/test_types.py_test_none_test_none.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_none_test_none.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3805, "end_line": 3864, "span_ids": ["test_none"], "tokens": 570}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.parametrize('value_type', (None, type(None), None.__class__, Literal[None]))\ndef test_none(value_type):\n class Model(BaseModel):\n my_none: value_type\n my_none_list: List[value_type]\n my_none_dict: Dict[str, value_type]\n my_json_none: Json[value_type]\n\n Model(\n my_none=None,\n my_none_list=[None] * 3,\n my_none_dict={'a': None, 'b': None},\n my_json_none='null',\n )\n\n # assert Model.model_json_schema() == {\n # 'title': 'Model',\n # 'type': 'object',\n # 'properties': {\n # 'my_none': {'title': 'My None', 'type': 'null'},\n # 'my_none_list': {\n # 'title': 'My None List',\n # 'type': 'array',\n # 'items': {'type': 'null'},\n # },\n # 'my_none_dict': {\n # 'title': 'My None Dict',\n # 'type': 'object',\n # 'additionalProperties': {'type': 'null'},\n # },\n # 'my_json_none': {'title': 'My Json None', 'type': 'null'},\n # },\n # 'required': ['my_none', 'my_none_list', 'my_none_dict', 'my_json_none'],\n # }\n\n with pytest.raises(ValidationError) as exc_info:\n Model(\n my_none='qwe',\n my_none_list=[1, None, 'qwe'],\n my_none_dict={'a': 1, 'b': None},\n my_json_none='\"a\"',\n )\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'none_required', 'loc': ('my_none',), 'msg': 'Input should be None', 'input': 'qwe'},\n {'type': 'none_required', 'loc': ('my_none_list', 0), 'msg': 'Input should be None', 'input': 1},\n {\n 'type': 'none_required',\n 'loc': ('my_none_list', 2),\n 'msg': 'Input should be None',\n 'input': 'qwe',\n },\n {\n 'type': 'none_required',\n 'loc': ('my_none_dict', 'a'),\n 'msg': 'Input should be None',\n 'input': 1,\n },\n {'type': 'none_required', 'loc': ('my_json_none',), 'msg': 'Input should be None', 'input': 'a'},\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_pydantic__pydantic/tests/test_types.py_test_default_union_types_test_default_union_types._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_default_union_types_test_default_union_types._", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3867, "end_line": 3881, "span_ids": ["test_default_union_types"], "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 test_default_union_types():\n class DefaultModel(BaseModel):\n v: Union[int, bool, str]\n\n # do it this way since `1 == True`\n assert repr(DefaultModel(v=True).v) == 'True'\n assert repr(DefaultModel(v=1).v) == '1'\n assert repr(DefaultModel(v='1').v) == \"'1'\"\n\n # assert DefaultModel.model_json_schema() == {\n # 'title': 'DefaultModel',\n # 'type': 'object',\n # 'properties': {'v': {'title': 'V', 'anyOf': [{'type': t} for t in ('integer', 'boolean', 'string')]}},\n # 'required': ['v'],\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_pydantic__pydantic/tests/test_types.py_test_default_union_class_test_union_subclass.assert_Model_x_MyStr_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_default_union_class_test_union_subclass.assert_Model_x_MyStr_1_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3884, "end_line": 3907, "span_ids": ["test_default_union_class", "test_union_subclass"], "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 test_default_union_class():\n class A(BaseModel):\n x: str\n\n class B(BaseModel):\n x: str\n\n class Model(BaseModel):\n y: Union[A, B]\n\n assert isinstance(Model(y=A(x='a')).y, A)\n assert isinstance(Model(y=B(x='b')).y, B)\n\n\ndef test_union_subclass():\n class MyStr(str):\n ...\n\n class Model(BaseModel):\n x: Union[int, str]\n\n # see https://github.com/pydantic/pydantic-core/pull/294, since subclasses are no-longer allowed as valid\n # inputs to strict-string, this doesn't work\n assert Model(x=MyStr('1')).x == 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_pydantic__pydantic/tests/test_types.py_test_union_compound_types_test_union_compound_types.assert_e_value_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_union_compound_types_test_union_compound_types.assert_e_value_errors_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3910, "end_line": 3941, "span_ids": ["test_union_compound_types"], "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 test_union_compound_types():\n class Model(BaseModel):\n values: Union[Dict[str, str], List[str], Dict[str, List[str]]]\n\n assert Model(values={'L': '1'}).model_dump() == {'values': {'L': '1'}}\n assert Model(values=['L1']).model_dump() == {'values': ['L1']}\n assert Model(values=('L1',)).model_dump() == {'values': ['L1']}\n assert Model(values={'x': ['pika']}) != {'values': {'x': ['pika']}}\n assert Model(values={'x': ('pika',)}).model_dump() == {'values': {'x': ['pika']}}\n with pytest.raises(ValidationError) as e:\n Model(values={'x': {'a': 'b'}})\n # insert_assert(e.value.errors())\n assert e.value.errors() == [\n {\n 'type': 'string_type',\n 'loc': ('values', 'dict[str,str]', 'x'),\n 'msg': 'Input should be a valid string',\n 'input': {'a': 'b'},\n },\n {\n 'type': 'list_type',\n 'loc': ('values', 'list[str]'),\n 'msg': 'Input should be a valid list',\n 'input': {'x': {'a': 'b'}},\n },\n {\n 'type': 'list_type',\n 'loc': ('values', 'dict[str,list[str]]', 'x'),\n 'msg': 'Input should be a valid list',\n 'input': {'a': 'b'},\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_pydantic__pydantic/tests/test_types.py_test_smart_union_compounded_types_edge_case_test_union_typeddict.assert_M_d_dict_foo_baz_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_smart_union_compounded_types_edge_case_test_union_typeddict.assert_M_d_dict_foo_baz_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3944, "end_line": 3963, "span_ids": ["test_smart_union_compounded_types_edge_case", "test_union_typeddict"], "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 test_smart_union_compounded_types_edge_case():\n class Model(BaseModel):\n x: Union[List[str], List[int]]\n\n assert Model(x=[1, 2]).x == [1, 2]\n assert Model(x=['1', '2']).x == ['1', '2']\n assert Model(x=[1, '2']).x == [1, 2]\n\n\ndef test_union_typeddict():\n class Dict1(TypedDict):\n foo: str\n\n class Dict2(TypedDict):\n bar: str\n\n class M(BaseModel):\n d: Union[Dict2, Dict1]\n\n assert M(d=dict(foo='baz')).d == {'foo': '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_pydantic__pydantic/tests/test_types.py_test_custom_generic_containers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_custom_generic_containers_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3966, "end_line": 3989, "span_ids": ["test_custom_generic_containers"], "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 test_custom_generic_containers():\n T = TypeVar('T')\n\n class GenericList(List[T]):\n pass\n\n class Model(BaseModel):\n field: GenericList[int]\n\n model = Model(field=['1', '2'])\n assert model.field == [1, 2]\n assert isinstance(model.field, GenericList)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(field=['a'])\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('field', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_types_namedtuple.py_from_collections_import_n_test_namedtuple_simple.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_from_collections_import_n_test_namedtuple_simple.None_3", "embedding": null, "metadata": {"file_path": "tests/test_types_namedtuple.py", "file_name": "test_types_namedtuple.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "test_namedtuple_simple"], "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": "from collections import namedtuple\nfrom typing import NamedTuple, Tuple\n\nimport pytest\n\nfrom pydantic import BaseModel, ConfigDict, PositiveInt, ValidationError\nfrom pydantic.errors import PydanticSchemaGenerationError\n\n\ndef test_namedtuple_simple():\n Position = namedtuple('Pos', 'x y')\n\n class Model(BaseModel):\n pos: Position\n\n model = Model(pos=('1', 2))\n assert isinstance(model.pos, Position)\n assert model.pos.x == '1'\n assert model.pos == Position('1', 2)\n\n model = Model(pos={'x': '1', 'y': 2})\n assert model.pos == Position('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_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_test_namedtuple.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_test_namedtuple.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_namedtuple.py", "file_name": "test_types_namedtuple.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 51, "span_ids": ["test_namedtuple"], "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 test_namedtuple():\n class Event(NamedTuple):\n a: int\n b: int\n c: int\n d: str\n\n class Model(BaseModel):\n # pos: Position\n event: Event\n\n model = Model(event=(b'1', '2', 3, 'qwe'))\n assert isinstance(model.event, Event)\n assert model.event == Event(1, 2, 3, 'qwe')\n assert repr(model) == \"Model(event=Event(a=1, b=2, c=3, d='qwe'))\"\n\n with pytest.raises(ValidationError) as exc_info:\n Model(pos=('1', 2), event=['qwe', '2', 3, 'qwe'])\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('event', 'arguments', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'qwe',\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_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_schema_test_namedtuple_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_schema_test_namedtuple_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types_namedtuple.py", "file_name": "test_types_namedtuple.py", "file_type": "text/x-python", "category": "test", "start_line": 54, "end_line": 102, "span_ids": ["test_namedtuple_schema"], "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 test_namedtuple_schema():\n class Position1(NamedTuple):\n x: int\n y: int\n\n Position2 = namedtuple('Position2', 'x y')\n\n class Model(BaseModel):\n pos1: Position1\n pos2: Position2\n pos3: Tuple[int, int]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'pos1': {\n 'title': 'Pos1',\n 'type': 'array',\n 'prefixItems': [\n {'title': 'X', 'type': 'integer'},\n {'title': 'Y', 'type': 'integer'},\n ],\n 'minItems': 2,\n 'maxItems': 2,\n },\n 'pos2': {\n 'title': 'Pos2',\n 'type': 'array',\n 'prefixItems': [\n {'title': 'X'},\n {'title': 'Y'},\n ],\n 'minItems': 2,\n 'maxItems': 2,\n },\n 'pos3': {\n 'title': 'Pos3',\n 'type': 'array',\n 'prefixItems': [\n {'type': 'integer'},\n {'type': 'integer'},\n ],\n 'minItems': 2,\n 'maxItems': 2,\n },\n },\n 'required': ['pos1', 'pos2', 'pos3'],\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_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_right_length_test_namedtuple_right_length.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_right_length_test_namedtuple_right_length.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_namedtuple.py", "file_name": "test_types_namedtuple.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 125, "span_ids": ["test_namedtuple_right_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": "def test_namedtuple_right_length():\n class Point(NamedTuple):\n x: int\n y: int\n\n class Model(BaseModel):\n p: Point\n\n assert isinstance(Model(p=(1, 2)), Model)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(p=(1, 2, 3))\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {\n 'type': 'unexpected_positional_argument',\n 'loc': ('p', 'arguments', 2),\n 'msg': 'Unexpected positional argument',\n 'input': 3,\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_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_postponed_annotation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_postponed_annotation_", "embedding": null, "metadata": {"file_path": "tests/test_types_namedtuple.py", "file_name": "test_types_namedtuple.py", "file_type": "text/x-python", "category": "test", "start_line": 128, "end_line": 165, "span_ids": ["test_namedtuple_postponed_annotation", "test_namedtuple_arbitrary_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": "def test_namedtuple_postponed_annotation():\n \"\"\"\n https://github.com/pydantic/pydantic/issues/2760\n \"\"\"\n\n class Tup(NamedTuple):\n v: 'PositiveInt'\n\n class Model(BaseModel):\n t: Tup\n\n # The effect of issue #2760 is that this call raises a `PydanticUserError` even though the type declared on `Tup.v`\n # references a binding in this module's global scope.\n with pytest.raises(ValidationError):\n Model.model_validate({'t': [-1]})\n\n\ndef test_namedtuple_arbitrary_type():\n class CustomClass:\n pass\n\n class Tup(NamedTuple):\n c: CustomClass\n\n class Model(BaseModel):\n x: Tup\n\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n data = {'x': Tup(c=CustomClass())}\n model = Model.model_validate(data)\n assert isinstance(model.x.c, CustomClass)\n\n with pytest.raises(PydanticSchemaGenerationError):\n\n class ModelNoArbitraryTypes(BaseModel):\n x: Tup", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_from_collections_import_n_test_validate_digits.with_pytest_raises_Pydant.PaymentCardNumber_validat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_from_collections_import_n_test_validate_digits.with_pytest_raises_Pydant.PaymentCardNumber_validat", "embedding": null, "metadata": {"file_path": "tests/test_types_payment_card_number.py", "file_name": "test_types_payment_card_number.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["imports", "payment_card_model_fixture", "test_validate_digits"], "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": "from collections import namedtuple\nfrom typing import Any\n\nimport pytest\nfrom pydantic_core._pydantic_core import PydanticCustomError\n\nfrom pydantic import BaseModel, ValidationError\nfrom pydantic.types import PaymentCardBrand, PaymentCardNumber\n\nVALID_AMEX = '370000000000002'\nVALID_MC = '5100000000000003'\nVALID_VISA_13 = '4050000000001'\nVALID_VISA_16 = '4050000000000001'\nVALID_VISA_19 = '4050000000000000001'\nVALID_OTHER = '2000000000000000008'\nLUHN_INVALID = '4000000000000000'\nLEN_INVALID = '40000000000000006'\n\n\n# Mock PaymentCardNumber\nPCN = namedtuple('PaymentCardNumber', ['card_number', 'brand'])\nPCN.__len__ = lambda v: len(v.card_number)\n\n\n@pytest.fixture(scope='session', name='PaymentCard')\ndef payment_card_model_fixture():\n class PaymentCard(BaseModel):\n card_number: PaymentCardNumber\n\n return PaymentCard\n\n\ndef test_validate_digits():\n digits = '12345'\n assert PaymentCardNumber.validate_digits(digits) is None\n with pytest.raises(PydanticCustomError, match='Card number is not all digits'):\n PaymentCardNumber.validate_digits('hello')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_validate_luhn_check_digit_test_validate_luhn_check_digit.if_valid_.else_.with_pytest_raises_Pydant.PaymentCardNumber_validat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_validate_luhn_check_digit_test_validate_luhn_check_digit.if_valid_.else_.with_pytest_raises_Pydant.PaymentCardNumber_validat", "embedding": null, "metadata": {"file_path": "tests/test_types_payment_card_number.py", "file_name": "test_types_payment_card_number.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 76, "span_ids": ["test_validate_luhn_check_digit"], "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": "@pytest.mark.parametrize(\n 'card_number, valid',\n [\n ('0', True),\n ('00', True),\n ('18', True),\n ('0000000000000000', True),\n ('4242424242424240', False),\n ('4242424242424241', False),\n ('4242424242424242', True),\n ('4242424242424243', False),\n ('4242424242424244', False),\n ('4242424242424245', False),\n ('4242424242424246', False),\n ('4242424242424247', False),\n ('4242424242424248', False),\n ('4242424242424249', False),\n ('42424242424242426', True),\n ('424242424242424267', True),\n ('4242424242424242675', True),\n ('5164581347216566', True),\n ('4345351087414150', True),\n ('343728738009846', True),\n ('5164581347216567', False),\n ('4345351087414151', False),\n ('343728738009847', False),\n ('000000018', True),\n ('99999999999999999999', True),\n ('99999999999999999999999999999999999999999999999999999999999999999997', True),\n ],\n)\ndef test_validate_luhn_check_digit(card_number: str, valid: bool):\n if valid:\n assert PaymentCardNumber.validate_luhn_check_digit(card_number) == card_number\n else:\n with pytest.raises(PydanticCustomError, match='Card number is not luhn valid'):\n PaymentCardNumber.validate_luhn_check_digit(card_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_pydantic__pydantic/tests/test_types_payment_card_number.py_test_length_for_brand_test_length_for_brand.if_valid_.else_.assert_exc_info_value_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_length_for_brand_test_length_for_brand.if_valid_.else_.assert_exc_info_value_typ", "embedding": null, "metadata": {"file_path": "tests/test_types_payment_card_number.py", "file_name": "test_types_payment_card_number.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 98, "span_ids": ["test_length_for_brand"], "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": "@pytest.mark.parametrize(\n 'card_number, brand, valid',\n [\n (VALID_VISA_13, PaymentCardBrand.visa, True),\n (VALID_VISA_16, PaymentCardBrand.visa, True),\n (VALID_VISA_19, PaymentCardBrand.visa, True),\n (VALID_MC, PaymentCardBrand.mastercard, True),\n (VALID_AMEX, PaymentCardBrand.amex, True),\n (VALID_OTHER, PaymentCardBrand.other, True),\n (LEN_INVALID, PaymentCardBrand.visa, False),\n ],\n)\ndef test_length_for_brand(card_number: str, brand: PaymentCardBrand, valid: bool):\n # pcn = PCN(card_number, brand)\n if valid:\n assert PaymentCardNumber.validate_brand(card_number) == brand\n else:\n with pytest.raises(PydanticCustomError) as exc_info:\n PaymentCardNumber.validate_brand(card_number)\n assert exc_info.value.type == 'payment_card_number_brand'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_get_brand_test_valid.assert_card_card_number_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_get_brand_test_valid.assert_card_card_number_m", "embedding": null, "metadata": {"file_path": "tests/test_types_payment_card_number.py", "file_name": "test_types_payment_card_number.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 117, "span_ids": ["test_get_brand", "test_valid"], "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": "@pytest.mark.parametrize(\n 'card_number, brand',\n [\n (VALID_AMEX, PaymentCardBrand.amex),\n (VALID_MC, PaymentCardBrand.mastercard),\n (VALID_VISA_16, PaymentCardBrand.visa),\n (VALID_OTHER, PaymentCardBrand.other),\n ],\n)\ndef test_get_brand(card_number: str, brand: PaymentCardBrand):\n assert PaymentCardNumber.validate_brand(card_number) == brand\n\n\ndef test_valid(PaymentCard):\n card = PaymentCard(card_number=VALID_VISA_16)\n assert str(card.card_number) == VALID_VISA_16\n assert card.card_number.masked == '405000******0001'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_error_types_test_error_types.with_pytest_raises_Valida.PaymentCard_card_number_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_error_types_test_error_types.with_pytest_raises_Valida.PaymentCard_card_number_c", "embedding": null, "metadata": {"file_path": "tests/test_types_payment_card_number.py", "file_name": "test_types_payment_card_number.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 133, "span_ids": ["test_error_types"], "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": "@pytest.mark.parametrize(\n 'card_number, error_message',\n [\n (None, 'type=string_type'),\n ('1' * 11, 'type=string_too_short,'),\n ('1' * 20, 'type=string_too_long,'),\n ('h' * 16, 'type=payment_card_number_digits'),\n (LUHN_INVALID, 'type=payment_card_number_luhn,'),\n (LEN_INVALID, 'type=payment_card_number_brand,'),\n ],\n)\ndef test_error_types(card_number: Any, error_message: str, PaymentCard):\n with pytest.raises(ValidationError, match=error_message):\n PaymentCard(card_number=card_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_pydantic__pydantic/tests/test_types_payment_card_number.py_test_payment_card_brand_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_payment_card_number.py_test_payment_card_brand_", "embedding": null, "metadata": {"file_path": "tests/test_types_payment_card_number.py", "file_name": "test_types_payment_card_number.py", "file_type": "text/x-python", "category": "test", "start_line": 136, "end_line": 152, "span_ids": ["test_payment_card_brand"], "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 test_payment_card_brand():\n b = PaymentCardBrand.visa\n assert str(b) == 'Visa'\n assert b is PaymentCardBrand.visa\n assert b == PaymentCardBrand.visa\n assert b in {PaymentCardBrand.visa, PaymentCardBrand.mastercard}\n\n b = 'Visa'\n assert b is not PaymentCardBrand.visa\n assert b == PaymentCardBrand.visa\n assert b in {PaymentCardBrand.visa, PaymentCardBrand.mastercard}\n\n b = PaymentCardBrand.amex\n assert b is not PaymentCardBrand.visa\n assert b != PaymentCardBrand.visa\n assert b not in {PaymentCardBrand.visa, PaymentCardBrand.mastercard}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py___fixture_typed_dict_all.try_.except_AttributeError_.pytest_skip_f_TypedDict_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py___fixture_typed_dict_all.try_.except_AttributeError_.pytest_skip_f_TypedDict_i", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["fixture_typed_dict_all", "docstring"], "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": "\"\"\"\nTests for TypedDict\n\"\"\"\nimport re\nimport sys\nimport typing\nfrom typing import Generic, List, Optional, TypeVar\n\nimport pytest\nimport typing_extensions\nfrom annotated_types import Lt\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import BaseModel, Field, PositiveInt, PydanticUserError, ValidationError\n\nfrom .conftest import Err\n\n\n@pytest.fixture(\n name='TypedDictAll',\n params=[\n pytest.param(typing, id='typing.TypedDict'),\n pytest.param(typing_extensions, id='t_e.TypedDict'),\n ],\n)\ndef fixture_typed_dict_all(request):\n try:\n return request.param.TypedDict\n except AttributeError:\n pytest.skip(f'TypedDict is not available from {request.param}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_fixture_typed_dict_fixture_typed_dict.if_hasattr_TestTypedDict_.else_.pytest_skip_TypedDict_do": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_fixture_typed_dict_fixture_typed_dict.if_hasattr_TestTypedDict_.else_.pytest_skip_TypedDict_do", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 44, "span_ids": ["fixture_typed_dict"], "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": "@pytest.fixture(name='TypedDict')\ndef fixture_typed_dict(TypedDictAll):\n class TestTypedDict(TypedDictAll):\n foo: str\n\n if sys.version_info < (3, 11) and TypedDictAll.__module__ == 'typing':\n pytest.skip('typing.TypedDict does not track required keys correctly on Python < 3.11')\n\n if hasattr(TestTypedDict, '__required_keys__'):\n return TypedDictAll\n else:\n pytest.skip('TypedDict does not include __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_pydantic__pydantic/tests/test_types_typeddict.py_fixture_req_no_req_test_typeddict_all.try_.else_.assert_M_d_dict_foo_baz_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_fixture_req_no_req_test_typeddict_all.try_.else_.assert_M_d_dict_foo_baz_", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 73, "span_ids": ["fixture_req_no_req", "test_typeddict_all"], "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": "@pytest.fixture(\n name='req_no_req',\n params=[\n pytest.param(typing, id='typing.Required'),\n pytest.param(typing_extensions, id='t_e.Required'),\n ],\n)\ndef fixture_req_no_req(request):\n try:\n return request.param.Required, request.param.NotRequired\n except AttributeError:\n pytest.skip(f'Required and NotRequired are not available from {request.param}')\n\n\ndef test_typeddict_all(TypedDictAll):\n class MyDict(TypedDictAll):\n foo: str\n\n try:\n\n class M(BaseModel):\n d: MyDict\n\n except TypeError as e:\n assert str(e) == 'Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.11.'\n else:\n assert M(d=dict(foo='baz')).d == {'foo': '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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_simple_test_typeddict_annotated_simple.None_1.M_d_dict_foo_baz_bar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_simple_test_typeddict_annotated_simple.None_1.M_d_dict_foo_baz_bar_", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 93, "span_ids": ["test_typeddict_annotated_simple"], "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 test_typeddict_annotated_simple(TypedDict, req_no_req):\n Required, NotRequired = req_no_req\n\n class MyDict(TypedDict):\n foo: str\n bar: Annotated[int, Lt(10)]\n spam: NotRequired[float]\n\n class M(BaseModel):\n d: MyDict\n\n assert M(d=dict(foo='baz', bar='8')).d == {'foo': 'baz', 'bar': 8}\n assert M(d=dict(foo='baz', bar='8', spam='44.4')).d == {'foo': 'baz', 'bar': 8, 'spam': 44.4}\n with pytest.raises(ValidationError, match=r'd -> bar\\s+Field required \\[type=missing,'):\n M(d=dict(foo='baz'))\n\n with pytest.raises(ValidationError, match=r'd -> bar\\s+Input should be less than 10 \\[type=less_than,'):\n M(d=dict(foo='baz', bar='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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_total_false_test_typeddict_total_false.with_pytest_raises_Valida.M_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_total_false_test_typeddict_total_false.with_pytest_raises_Valida.M_d_", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 109, "span_ids": ["test_typeddict_total_false"], "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": "def test_typeddict_total_false(TypedDict, req_no_req):\n Required, NotRequired = req_no_req\n\n class MyDict(TypedDict, total=False):\n foo: Required[str]\n bar: int\n\n class M(BaseModel):\n d: MyDict\n\n assert M(d=dict(foo='baz', bar='8')).d == {'foo': 'baz', 'bar': 8}\n assert M(d=dict(foo='baz')).d == {'foo': 'baz'}\n with pytest.raises(ValidationError, match=r'd -> foo\\s+Field required \\[type=missing,'):\n M(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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_test_typeddict.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_test_typeddict.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 129, "span_ids": ["test_typeddict"], "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 test_typeddict(TypedDict):\n class TD(TypedDict):\n a: int\n b: int\n c: int\n d: str\n\n class Model(BaseModel):\n td: TD\n\n m = Model(td={'a': '3', 'b': b'1', 'c': 4, 'd': 'qwe'})\n assert m.td == {'a': 3, 'b': 1, 'c': 4, 'd': 'qwe'}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(td={'a': [1], 'b': 2, 'c': 3, 'd': 'qwe'})\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('td', 'a'), 'msg': 'Input should be a valid integer', 'input': [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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_non_total_test_typeddict_non_total.assert_m_movie_year_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_non_total_test_typeddict_non_total.assert_m_movie_year_", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 154, "span_ids": ["test_typeddict_non_total"], "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 test_typeddict_non_total(TypedDict):\n class FullMovie(TypedDict, total=True):\n name: str\n year: int\n\n class Model(BaseModel):\n movie: FullMovie\n\n with pytest.raises(ValidationError) as exc_info:\n Model(movie={'year': '2002'})\n assert exc_info.value.errors() == [\n {'type': 'missing', 'loc': ('movie', 'name'), 'msg': 'Field required', 'input': {'year': '2002'}}\n ]\n\n class PartialMovie(TypedDict, total=False):\n name: str\n year: int\n\n class Model(BaseModel):\n movie: PartialMovie\n\n m = Model(movie={'year': '2002'})\n assert m.movie == {'year': 2002}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_partial_new_typeddict_test_typeddict_extra.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_partial_new_typeddict_test_typeddict_extra.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 157, "end_line": 184, "span_ids": ["test_partial_new_typeddict", "test_typeddict_extra"], "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 test_partial_new_typeddict(TypedDict):\n class OptionalUser(TypedDict, total=False):\n name: str\n\n class User(OptionalUser):\n id: int\n\n class Model(BaseModel):\n user: User\n\n assert Model(user={'id': 1, 'name': 'foobar'}).user == {'id': 1, 'name': 'foobar'}\n assert Model(user={'id': 1}).user == {'id': 1}\n\n\ndef test_typeddict_extra(TypedDict):\n class User(TypedDict):\n name: str\n age: int\n\n class Model(BaseModel, extra='forbid'):\n u: User\n\n with pytest.raises(ValidationError) as exc_info:\n Model(u={'name': 'pika', 'age': 7, 'rank': 1})\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors() == [\n {'type': 'extra_forbidden', 'loc': ('u', 'rank'), 'msg': 'Extra inputs are not permitted', 'input': 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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_schema_test_typeddict_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_schema_test_typeddict_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 218, "span_ids": ["test_typeddict_schema"], "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 test_typeddict_schema(TypedDict):\n class Data(BaseModel):\n a: int\n\n # TODO: Need to make sure TypedDict's get their own schema\n class DataTD(TypedDict):\n a: int\n\n class Model(BaseModel):\n data: Data\n data_td: DataTD\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'data': {'$ref': '#/$defs/Data'}, 'data_td': {'$ref': '#/$defs/DataTD'}},\n 'required': ['data', 'data_td'],\n '$defs': {\n 'Data': {\n 'type': 'object',\n 'title': 'Data',\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\n },\n 'DataTD': {\n 'type': 'object',\n 'title': 'DataTD',\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_postponed_annotation_test_typeddict_required.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_postponed_annotation_test_typeddict_required.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 221, "end_line": 258, "span_ids": ["test_typeddict_required", "test_typeddict_postponed_annotation"], "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 test_typeddict_postponed_annotation(TypedDict):\n class DataTD(TypedDict):\n v: 'PositiveInt'\n\n class Model(BaseModel):\n t: DataTD\n\n with pytest.raises(ValidationError):\n Model.model_validate({'t': {'v': -1}})\n\n\ndef test_typeddict_required(TypedDict, req_no_req):\n Required, _ = req_no_req\n\n class DataTD(TypedDict, total=False):\n a: int\n b: Required[str]\n\n class Model(BaseModel):\n t: DataTD\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'t': {'$ref': '#/$defs/DataTD'}},\n 'required': ['t'],\n '$defs': {\n 'DataTD': {\n 'title': 'DataTD',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A', 'type': 'integer'},\n 'b': {'title': 'B', 'type': 'string'},\n },\n 'required': ['b'],\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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_from_attributes_test_typeddict_from_attributes.with_pytest_raises_Valida.Model_u_UserCls_foo_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_from_attributes_test_typeddict_from_attributes.with_pytest_raises_Valida.Model_u_UserCls_foo_15", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 261, "end_line": 279, "span_ids": ["test_typeddict_from_attributes"], "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 test_typeddict_from_attributes():\n class UserCls:\n def __init__(self, name: str, age: int):\n self.name = name\n self.age = age\n\n class User(TypedDict):\n name: str\n age: int\n\n class FromAttributesModel(BaseModel, from_attributes=True):\n u: Annotated[User, Field(strict=False)]\n\n class Model(BaseModel):\n u: Annotated[User, Field(strict=False)]\n\n assert FromAttributesModel(u=UserCls('foo', 15)).u == {'name': 'foo', 'age': 15}\n with pytest.raises(ValidationError, match='Input should be a valid dictionary'):\n Model(u=UserCls('foo', 15))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_not_required_schema_test_typeddict_not_required_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_not_required_schema_test_typeddict_not_required_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 282, "end_line": 308, "span_ids": ["test_typeddict_not_required_schema"], "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 test_typeddict_not_required_schema(TypedDict, req_no_req):\n Required, NotRequired = req_no_req\n\n class DataTD(TypedDict, total=True):\n a: NotRequired[int]\n b: str\n\n class Model(BaseModel):\n t: DataTD\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'t': {'$ref': '#/$defs/DataTD'}},\n 'required': ['t'],\n '$defs': {\n 'DataTD': {\n 'title': 'DataTD',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A', 'type': 'integer'},\n 'b': {'title': 'B', 'type': 'string'},\n },\n 'required': ['b'],\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_pydantic__pydantic/tests/test_types_typeddict.py_test_typed_dict_inheritance_schema_test_typed_dict_inheritance_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typed_dict_inheritance_schema_test_typed_dict_inheritance_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 311, "end_line": 343, "span_ids": ["test_typed_dict_inheritance_schema"], "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 test_typed_dict_inheritance_schema(TypedDict, req_no_req):\n Required, NotRequired = req_no_req\n\n class DataTDBase(TypedDict, total=True):\n a: NotRequired[int]\n b: str\n\n class DataTD(DataTDBase, total=False):\n c: Required[int]\n d: str\n\n class Model(BaseModel):\n t: DataTD\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'t': {'$ref': '#/$defs/DataTD'}},\n 'required': ['t'],\n '$defs': {\n 'DataTD': {\n 'title': 'DataTD',\n 'type': 'object',\n 'properties': {\n 'a': {'title': 'A', 'type': 'integer'},\n 'b': {'title': 'B', 'type': 'string'},\n 'c': {'title': 'C', 'type': 'integer'},\n 'd': {'title': 'D', 'type': 'string'},\n },\n 'required': ['b', 'c'],\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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_nonoptional_schema_test_typeddict_annotated_nonoptional_schema.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_nonoptional_schema_test_typeddict_annotated_nonoptional_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 346, "end_line": 372, "span_ids": ["test_typeddict_annotated_nonoptional_schema"], "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 test_typeddict_annotated_nonoptional_schema(TypedDict):\n class DataTD(TypedDict):\n a: Optional[int]\n b: Annotated[Optional[int], Field(42)]\n c: Annotated[Optional[int], Field(description='Test')]\n\n class Model(BaseModel):\n data_td: DataTD\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'data_td': {'$ref': '#/$defs/DataTD'}},\n 'required': ['data_td'],\n '$defs': {\n 'DataTD': {\n 'type': 'object',\n 'title': 'DataTD',\n 'properties': {\n 'a': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'A'},\n 'b': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'default': 42, 'title': 'B'},\n 'c': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'description': 'Test', 'title': 'C'},\n },\n 'required': ['a', 'c'],\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_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_test_typeddict_annotated.if_isinstance_expected_E.else_.assert_Model_d_input_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_annotated_test_typeddict_annotated.if_isinstance_expected_E.else_.assert_Model_d_input_valu", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 375, "end_line": 400, "span_ids": ["test_typeddict_annotated"], "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": "@pytest.mark.parametrize(\n 'input_value,expected',\n [\n ({'a': '1', 'b': 2, 'c': 3}, {'a': 1, 'b': 2, 'c': 3}),\n ({'a': None, 'b': 2, 'c': 3}, {'a': None, 'b': 2, 'c': 3}),\n ({'a': None, 'c': 3}, {'a': None, 'b': 42, 'c': 3}),\n # ({}, None),\n # ({'data_td': []}, None),\n # ({'data_td': {'a': 1, 'b': 2, 'd': 4}}, None),\n ],\n ids=repr,\n)\ndef test_typeddict_annotated(TypedDict, input_value, expected):\n class DataTD(TypedDict):\n a: Optional[int]\n b: Annotated[Optional[int], Field(42)]\n c: Annotated[Optional[int], Field(description='Test', lt=4)]\n\n class Model(BaseModel):\n d: DataTD\n\n if isinstance(expected, Err):\n with pytest.raises(ValidationError, match=expected.message_escaped()):\n Model(d=input_value)\n else:\n assert Model(d=input_value).d == 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_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_typeddict_test_recursive_typeddict.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_typeddict_test_recursive_typeddict.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 403, "end_line": 429, "span_ids": ["test_recursive_typeddict"], "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 test_recursive_typeddict(create_module):\n @create_module\n def module():\n from typing import Optional\n\n from typing_extensions import TypedDict\n\n from pydantic import BaseModel\n\n class RecursiveTypedDict(TypedDict):\n # TODO: See if we can get this working if defined in a function (right now, needs to be module-level)\n foo: Optional['RecursiveTypedDict']\n\n class RecursiveTypedDictModel(BaseModel):\n rec: RecursiveTypedDict\n\n assert module.RecursiveTypedDictModel(rec={'foo': {'foo': None}}).rec == {'foo': {'foo': None}}\n with pytest.raises(ValidationError) as exc_info:\n module.RecursiveTypedDictModel(rec={'foo': {'foo': {'foo': 1}}})\n assert exc_info.value.errors() == [\n {\n 'input': 1,\n 'loc': ('rec', 'foo', 'foo', 'foo'),\n 'msg': 'Input should be a valid dictionary',\n 'type': 'dict_type',\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_pydantic__pydantic/tests/test_types_typeddict.py_T_test_generic_typeddict_in_concrete_model.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_T_test_generic_typeddict_in_concrete_model.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 432, "end_line": 454, "span_ids": ["test_generic_typeddict_in_concrete_model", "impl"], "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": "T = TypeVar('T')\n\n\ndef test_generic_typeddict_in_concrete_model():\n T = TypeVar('T')\n\n class GenericTypedDict(typing_extensions.TypedDict, Generic[T]):\n x: T\n\n class Model(BaseModel):\n y: GenericTypedDict[int]\n\n Model(y={'x': 1})\n with pytest.raises(ValidationError) as exc_info:\n Model(y={'x': 'a'})\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('y', 'x'),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_types_typeddict.py_test_generic_typeddict_in_generic_model_test_generic_typeddict_in_generic_model.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_generic_typeddict_in_generic_model_test_generic_typeddict_in_generic_model.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 457, "end_line": 476, "span_ids": ["test_generic_typeddict_in_generic_model"], "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 test_generic_typeddict_in_generic_model():\n T = TypeVar('T')\n\n class GenericTypedDict(typing_extensions.TypedDict, Generic[T]):\n x: T\n\n class Model(BaseModel, Generic[T]):\n y: GenericTypedDict[T]\n\n Model[int](y={'x': 1})\n with pytest.raises(ValidationError) as exc_info:\n Model[int](y={'x': 'a'})\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('y', 'x'),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_module_test_recursive_generic_typeddict_in_module.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_module_test_recursive_generic_typeddict_in_module.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 479, "end_line": 517, "span_ids": ["test_recursive_generic_typeddict_in_module"], "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 test_recursive_generic_typeddict_in_module(create_module):\n @create_module\n def module():\n from typing import Generic, List, Optional, TypeVar\n\n from typing_extensions import TypedDict\n\n from pydantic import BaseModel\n\n T = TypeVar('T')\n\n class RecursiveGenTypedDictModel(BaseModel, Generic[T]):\n rec: 'RecursiveGenTypedDict[T]'\n model_config = dict(undefined_types_warning=False)\n\n class RecursiveGenTypedDict(TypedDict, Generic[T]):\n foo: Optional['RecursiveGenTypedDict[T]']\n ls: List[T]\n\n int_data: module.RecursiveGenTypedDict[int] = {'foo': {'foo': None, 'ls': [1]}, 'ls': [1]}\n assert module.RecursiveGenTypedDictModel[int](rec=int_data).rec == int_data\n\n str_data: module.RecursiveGenTypedDict[str] = {'foo': {'foo': None, 'ls': ['a']}, 'ls': ['a']}\n with pytest.raises(ValidationError) as exc_info:\n module.RecursiveGenTypedDictModel[int](rec=str_data)\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('rec', 'foo', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {\n 'input': 'a',\n 'loc': ('rec', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_1_test_recursive_generic_typeddict_in_function_1.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_1_test_recursive_generic_typeddict_in_function_1.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 520, "end_line": 554, "span_ids": ["test_recursive_generic_typeddict_in_function_1"], "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 test_recursive_generic_typeddict_in_function_1():\n T = TypeVar('T')\n\n # First ordering: typed dict first\n class RecursiveGenTypedDict(TypedDict, Generic[T]):\n foo: Optional['RecursiveGenTypedDict[T]']\n ls: List[T]\n\n class RecursiveGenTypedDictModel(BaseModel, Generic[T]):\n rec: 'RecursiveGenTypedDict[T]'\n model_config = dict(undefined_types_warning=False)\n\n # Note: no model_rebuild() necessary here\n # RecursiveGenTypedDictModel.model_rebuild()\n\n int_data: RecursiveGenTypedDict[int] = {'foo': {'foo': None, 'ls': [1]}, 'ls': [1]}\n assert RecursiveGenTypedDictModel[int](rec=int_data).rec == int_data\n\n str_data: RecursiveGenTypedDict[str] = {'foo': {'foo': None, 'ls': ['a']}, 'ls': ['a']}\n with pytest.raises(ValidationError) as exc_info:\n RecursiveGenTypedDictModel[int](rec=str_data)\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('rec', 'foo', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {\n 'input': 'a',\n 'loc': ('rec', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_2_test_recursive_generic_typeddict_in_function_2.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_2_test_recursive_generic_typeddict_in_function_2.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 557, "end_line": 588, "span_ids": ["test_recursive_generic_typeddict_in_function_2"], "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 test_recursive_generic_typeddict_in_function_2():\n T = TypeVar('T')\n\n # Second ordering: model first\n class RecursiveGenTypedDictModel(BaseModel, Generic[T]):\n rec: 'RecursiveGenTypedDict[T]'\n model_config = dict(undefined_types_warning=False)\n\n class RecursiveGenTypedDict(TypedDict, Generic[T]):\n foo: Optional['RecursiveGenTypedDict[T]']\n ls: List[T]\n\n int_data: RecursiveGenTypedDict[int] = {'foo': {'foo': None, 'ls': [1]}, 'ls': [1]}\n assert RecursiveGenTypedDictModel[int](rec=int_data).rec == int_data\n\n str_data: RecursiveGenTypedDict[str] = {'foo': {'foo': None, 'ls': ['a']}, 'ls': ['a']}\n with pytest.raises(ValidationError) as exc_info:\n RecursiveGenTypedDictModel[int](rec=str_data)\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('rec', 'foo', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {\n 'input': 'a',\n 'loc': ('rec', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_rebuild_error_test_recursive_generic_typeddict_in_function_rebuild_error.with_pytest_raises_.IntModel_rec_int_data_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_rebuild_error_test_recursive_generic_typeddict_in_function_rebuild_error.with_pytest_raises_.IntModel_rec_int_data_re", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 591, "end_line": 613, "span_ids": ["test_recursive_generic_typeddict_in_function_rebuild_error"], "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 test_recursive_generic_typeddict_in_function_rebuild_error():\n T = TypeVar('T')\n\n class RecursiveGenTypedDictModel(BaseModel, Generic[T]):\n rec: 'RecursiveGenTypedDict[T]'\n model_config = dict(undefined_types_warning=False)\n\n IntModel = RecursiveGenTypedDictModel[int]\n\n class RecursiveGenTypedDict(TypedDict, Generic[T]):\n foo: Optional['RecursiveGenTypedDict[T]']\n ls: List[T]\n\n int_data: RecursiveGenTypedDict[int] = {'foo': {'foo': None, 'ls': [1]}, 'ls': [1]}\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n '`RecursiveGenTypedDictModel[int]` is not fully defined; you should define `RecursiveGenTypedDict`,'\n ' then call `RecursiveGenTypedDictModel[int].model_rebuild()` before the first'\n ' `RecursiveGenTypedDictModel[int]` instance is created.'\n ),\n ):\n IntModel(rec=int_data).rec", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_rebuild_pass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_recursive_generic_typeddict_in_function_rebuild_pass_", "embedding": null, "metadata": {"file_path": "tests/test_types_typeddict.py", "file_name": "test_types_typeddict.py", "file_type": "text/x-python", "category": "test", "start_line": 616, "end_line": 650, "span_ids": ["test_recursive_generic_typeddict_in_function_rebuild_pass"], "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 test_recursive_generic_typeddict_in_function_rebuild_pass():\n T = TypeVar('T')\n\n class RecursiveGenTypedDictModel(BaseModel, Generic[T]):\n rec: 'RecursiveGenTypedDict[T]'\n model_config = dict(undefined_types_warning=False)\n\n IntModel = RecursiveGenTypedDictModel[int]\n\n class RecursiveGenTypedDict(TypedDict, Generic[T]):\n foo: Optional['RecursiveGenTypedDict[T]']\n ls: List[T]\n\n int_data: RecursiveGenTypedDict[int] = {'foo': {'foo': None, 'ls': [1]}, 'ls': [1]}\n IntModel.model_rebuild()\n assert IntModel(rec=int_data).rec == int_data\n\n str_data: RecursiveGenTypedDict[str] = {'foo': {'foo': None, 'ls': ['a']}, 'ls': ['a']}\n with pytest.raises(ValidationError) as exc_info:\n IntModel(rec=str_data)\n assert exc_info.value.errors() == [\n {\n 'input': 'a',\n 'loc': ('rec', 'foo', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n },\n {\n 'input': 'a',\n 'loc': ('rec', 'ls', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\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_pydantic__pydantic/tests/test_typing.py_typing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_typing.py_typing_", "embedding": null, "metadata": {"file_path": "tests/test_typing.py", "file_name": "test_typing.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 67, "span_ids": ["test_is_union", "imports", "test_is_none_type", "test_is_namedtuple"], "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": "import typing\nfrom collections import namedtuple\nfrom typing import Callable, NamedTuple\n\nimport pytest\nfrom typing_extensions import Literal, get_origin\n\nfrom pydantic import Field # noqa: F401\nfrom pydantic._internal._typing_extra import is_namedtuple, is_none_type, origin_is_union\n\ntry:\n from typing import TypedDict as typing_TypedDict\nexcept ImportError:\n typing_TypedDict = None\n\ntry:\n from typing_extensions import TypedDict as typing_extensions_TypedDict\nexcept ImportError:\n typing_extensions_TypedDict = None\n\n\ntry:\n from mypy_extensions import TypedDict as mypy_extensions_TypedDict\nexcept ImportError:\n mypy_extensions_TypedDict = None\n\nALL_TYPEDDICT_KINDS = (typing_TypedDict, typing_extensions_TypedDict, mypy_extensions_TypedDict)\n\n\ndef test_is_namedtuple():\n class Employee(NamedTuple):\n name: str\n id: int = 3\n\n assert is_namedtuple(namedtuple('Point', 'x y')) is True\n assert is_namedtuple(Employee) is True\n assert is_namedtuple(NamedTuple('Employee', [('name', str), ('id', int)])) is True\n\n class Other(tuple):\n name: str\n id: int\n\n assert is_namedtuple(Other) is False\n\n\ndef test_is_none_type():\n assert is_none_type(Literal[None]) is True\n assert is_none_type(None) is True\n assert is_none_type(type(None)) is True\n assert is_none_type(6) is False\n assert is_none_type({}) is False\n # WARNING: It's important to test `typing.Callable` not\n # `collections.abc.Callable` (even with python >= 3.9) as they behave\n # differently\n assert is_none_type(Callable) is False\n\n\n@pytest.mark.parametrize('union_gen', [lambda: typing.Union[int, str], lambda: int | str])\ndef test_is_union(union_gen):\n try:\n union = union_gen()\n except TypeError:\n pytest.skip('not supported in this python version')\n else:\n origin = get_origin(union)\n assert origin_is_union(origin)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_collections.abc_LoggedVar.get._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_collections.abc_LoggedVar.get._", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 60, "span_ids": ["test_import_module", "test_import_no_attr", "LoggedVar", "imports", "foobar", "LoggedVar.get", "test_import_module_invalid", "impl:5"], "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": "import collections.abc\nimport os\nimport pickle\nimport sys\nfrom copy import copy, deepcopy\nfrom typing import Callable, Dict, Generic, List, NewType, Tuple, TypeVar, Union\n\nimport pytest\nfrom dirty_equals import IsList\nfrom pydantic_core import PydanticCustomError\nfrom typing_extensions import Annotated, Literal\n\nfrom pydantic import BaseModel\nfrom pydantic._internal import _repr\nfrom pydantic._internal._typing_extra import all_literal_values, get_origin, is_new_type\nfrom pydantic._internal._utils import (\n BUILTIN_COLLECTIONS,\n ClassAttribute,\n ValueItems,\n all_identical,\n deep_update,\n lenient_issubclass,\n smart_deepcopy,\n to_lower_camel,\n unique_list,\n)\nfrom pydantic._internal._validators import import_string\nfrom pydantic.color import Color\nfrom pydantic.fields import Undefined\n\ntry:\n import devtools\nexcept ImportError:\n devtools = None\n\n\ndef test_import_module():\n assert import_string('os.path') == os.path\n\n\ndef test_import_module_invalid():\n with pytest.raises(PydanticCustomError, match='Invalid python path: \"xx\" doesn\\'t look like a module path'):\n import_string('xx')\n\n\ndef test_import_no_attr():\n with pytest.raises(PydanticCustomError, match='Module \"os\" does not define a \"foobar\" attribute'):\n import_string('os.foobar')\n\n\ndef foobar(a, b, c=4):\n pass\n\n\nT = TypeVar('T')\n\n\nclass LoggedVar(Generic[T]):\n def get(self) -> 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_pydantic__pydantic/tests/test_utils.py_test_display_as_type_test_display_as_type.assert__repr_display_as_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_display_as_type_test_display_as_type.assert__repr_display_as_t", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 84, "span_ids": ["test_display_as_type"], "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": "@pytest.mark.parametrize(\n 'value,expected',\n [\n (str, 'str'),\n ('foobar', 'str'),\n ('SomeForwardRefString', 'str'), # included to document current behavior; could be changed\n (List['SomeForwardRef'], \"List[ForwardRef('SomeForwardRef')]\"), # noqa: F821\n (Union[str, int], 'Union[str, int]'),\n (list, 'list'),\n (List, 'List'),\n ([1, 2, 3], 'list'),\n (List[Dict[str, int]], 'List[Dict[str, int]]'),\n (Tuple[str, int, float], 'Tuple[str, int, float]'),\n (Tuple[str, ...], 'Tuple[str, ...]'),\n (Union[int, List[str], Tuple[str, int]], 'Union[int, List[str], Tuple[str, int]]'),\n (foobar, 'foobar'),\n (LoggedVar, 'LoggedVar'),\n (LoggedVar(), 'LoggedVar'),\n ],\n)\ndef test_display_as_type(value, expected):\n assert _repr.display_as_type(value) == 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_pydantic__pydantic/tests/test_utils.py_test_display_as_type_310_test_display_as_type_310.assert__repr_display_as_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_display_as_type_310_test_display_as_type_310.assert__repr_display_as_t", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 87, "end_line": 108, "span_ids": ["test_display_as_type_310"], "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": "@pytest.mark.skipif(sys.version_info < (3, 10), reason='requires python 3.10 or higher')\n@pytest.mark.parametrize(\n 'value_gen,expected',\n [\n (lambda: str, 'str'),\n (lambda: 'SomeForwardRefString', 'str'), # included to document current behavior; could be changed\n (lambda: List['SomeForwardRef'], \"List[ForwardRef('SomeForwardRef')]\"), # noqa: F821\n (lambda: str | int, 'Union[str, int]'),\n (lambda: list, 'list'),\n (lambda: List, 'List'),\n (lambda: list[int], 'list[int]'),\n (lambda: List[int], 'List[int]'),\n (lambda: list[dict[str, int]], 'list[dict[str, int]]'),\n (lambda: list[Union[str, int]], 'list[Union[str, int]]'),\n (lambda: list[str | int], 'list[Union[str, int]]'),\n (lambda: LoggedVar[int], 'LoggedVar[int]'),\n (lambda: LoggedVar[Dict[int, str]], 'LoggedVar[Dict[int, str]]'),\n ],\n)\ndef test_display_as_type_310(value_gen, expected):\n value = value_gen()\n assert _repr.display_as_type(value) == 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_pydantic__pydantic/tests/test_utils.py_test_lenient_issubclass_test_lenient_issubclass_is_lenient.assert_lenient_issubclass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_lenient_issubclass_test_lenient_issubclass_is_lenient.assert_lenient_issubclass", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 127, "span_ids": ["test_lenient_issubclass", "test_lenient_issubclass_with_generic_aliases", "test_lenient_issubclass_is_lenient"], "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 test_lenient_issubclass():\n class A(str):\n pass\n\n assert lenient_issubclass(A, str) is True\n\n\n@pytest.mark.skipif(sys.version_info < (3, 9), reason='generic aliases are not available in python < 3.9')\ndef test_lenient_issubclass_with_generic_aliases():\n from collections.abc import Mapping\n\n # should not raise an error here:\n assert lenient_issubclass(list[str], Mapping) is False\n\n\ndef test_lenient_issubclass_is_lenient():\n assert lenient_issubclass('a', 'a') 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_pydantic__pydantic/tests/test_utils.py_test_unique_list_test_unique_list.assert_unique_list_unique": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_unique_list_test_unique_list.assert_unique_list_unique", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 130, "end_line": 140, "span_ids": ["test_unique_list"], "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": "@pytest.mark.parametrize(\n 'input_value,output',\n [\n ([], []),\n ([1, 1, 1, 2, 1, 2, 3, 2, 3, 1, 4, 2, 3, 1], [1, 2, 3, 4]),\n (['a', 'a', 'b', 'a', 'b', 'c', 'b', 'c', 'a'], ['a', 'b', 'c']),\n ],\n)\ndef test_unique_list(input_value, output):\n assert unique_list(input_value) == output\n assert unique_list(unique_list(input_value)) == unique_list(input_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_pydantic__pydantic/tests/test_utils.py_test_value_items_test_value_items.None_16": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_value_items_test_value_items.None_16", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 178, "span_ids": ["test_value_items"], "tokens": 510}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_value_items():\n v = ['a', 'b', 'c']\n vi = ValueItems(v, {0, -1})\n assert vi.is_excluded(2)\n assert [v_ for i, v_ in enumerate(v) if not vi.is_excluded(i)] == ['b']\n\n assert vi.is_included(2)\n assert [v_ for i, v_ in enumerate(v) if vi.is_included(i)] == ['a', 'c']\n\n v2 = {'a': v, 'b': {'a': 1, 'b': (1, 2)}, 'c': 1}\n\n vi = ValueItems(v2, {'a': {0, -1}, 'b': {'a': ..., 'b': -1}})\n\n assert not vi.is_excluded('a')\n assert vi.is_included('a')\n assert not vi.is_excluded('c')\n assert not vi.is_included('c')\n\n assert str(vi) == \"{'a': {0, -1}, 'b': {'a': Ellipsis, 'b': -1}}\"\n assert repr(vi) == \"ValueItems({'a': {0, -1}, 'b': {'a': Ellipsis, 'b': -1}})\"\n\n excluded = {k_: v_ for k_, v_ in v2.items() if not vi.is_excluded(k_)}\n assert excluded == {'a': v, 'b': {'a': 1, 'b': (1, 2)}, 'c': 1}\n\n included = {k_: v_ for k_, v_ in v2.items() if vi.is_included(k_)}\n assert included == {'a': v, 'b': {'a': 1, 'b': (1, 2)}}\n\n sub_v = included['a']\n sub_vi = ValueItems(sub_v, vi.for_element('a'))\n assert repr(sub_vi) == 'ValueItems({0: Ellipsis, 2: Ellipsis})'\n\n assert sub_vi.is_excluded(2)\n assert [v_ for i, v_ in enumerate(sub_v) if not sub_vi.is_excluded(i)] == ['b']\n\n assert sub_vi.is_included(2)\n assert [v_ for i, v_ in enumerate(sub_v) if sub_vi.is_included(i)] == ['a', '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_pydantic__pydantic/tests/test_utils.py_test_value_items_merge_test_value_items_merge.assert_actual_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_value_items_merge_test_value_items_merge.assert_actual_expected", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 227, "span_ids": ["test_value_items_merge"], "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": "@pytest.mark.parametrize(\n 'base,override,intersect,expected',\n [\n # Check in default (union) mode\n (..., ..., False, ...),\n (None, None, False, None),\n ({}, {}, False, {}),\n (..., None, False, ...),\n (None, ..., False, ...),\n (None, {}, False, {}),\n ({}, None, False, {}),\n (..., {}, False, {}),\n ({}, ..., False, ...),\n ({'a': None}, {'a': None}, False, {}),\n ({'a'}, ..., False, ...),\n ({'a'}, {}, False, {'a': ...}),\n ({'a'}, {'b'}, False, {'a': ..., 'b': ...}),\n ({'a': ...}, {'b': {'c'}}, False, {'a': ..., 'b': {'c': ...}}),\n ({'a': ...}, {'a': {'c'}}, False, {'a': {'c': ...}}),\n ({'a': {'c': ...}, 'b': {'d'}}, {'a': ...}, False, {'a': ..., 'b': {'d': ...}}),\n # Check in intersection mode\n (..., ..., True, ...),\n (None, None, True, None),\n ({}, {}, True, {}),\n (..., None, True, ...),\n (None, ..., True, ...),\n (None, {}, True, {}),\n ({}, None, True, {}),\n (..., {}, True, {}),\n ({}, ..., True, {}),\n ({'a': None}, {'a': None}, True, {}),\n ({'a'}, ..., True, {'a': ...}),\n ({'a'}, {}, True, {}),\n ({'a'}, {'b'}, True, {}),\n ({'a': ...}, {'b': {'c'}}, True, {}),\n ({'a': ...}, {'a': {'c'}}, True, {'a': {'c': ...}}),\n ({'a': {'c': ...}, 'b': {'d'}}, {'a': ...}, True, {'a': {'c': ...}}),\n # Check usage of `True` instead of `...`\n (..., True, False, True),\n (True, ..., False, ...),\n (True, None, False, True),\n ({'a': {'c': True}, 'b': {'d'}}, {'a': True}, False, {'a': True, 'b': {'d': ...}}),\n ],\n)\ndef test_value_items_merge(base, override, intersect, expected):\n actual = ValueItems.merge(base, override, intersect=intersect)\n assert actual == 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_pydantic__pydantic/tests/test_utils.py_test_value_items_error_test_pretty.assert_list_m___pretty___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_value_items_error_test_pretty.assert_list_m___pretty___", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 267, "span_ids": ["test_value_items_error", "test_is_new_type", "test_pretty"], "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 test_value_items_error():\n with pytest.raises(TypeError) as e:\n ValueItems(1, (1, 2, 3))\n\n assert str(e.value) == \"Unexpected type of exclude value \"\n\n\ndef test_is_new_type():\n new_type = NewType('new_type', str)\n new_new_type = NewType('new_new_type', new_type)\n assert is_new_type(new_type)\n assert is_new_type(new_new_type)\n assert not is_new_type(str)\n\n\ndef test_pretty():\n class MyTestModel(BaseModel):\n a: int = 1\n b: List[int] = [1, 2, 3]\n\n m = MyTestModel()\n assert m.__repr_name__() == 'MyTestModel'\n assert str(m) == 'a=1 b=[1, 2, 3]'\n assert repr(m) == 'MyTestModel(a=1, b=[1, 2, 3])'\n assert list(m.__pretty__(lambda x: f'fmt: {x!r}')) == [\n 'MyTestModel(',\n 1,\n 'a=',\n 'fmt: 1',\n ',',\n 0,\n 'b=',\n 'fmt: [1, 2, 3]',\n ',',\n 0,\n -1,\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_pydantic__pydantic/tests/test_utils.py_test_pretty_color_test_devtools_output.assert_devtools_pformat_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_pretty_color_test_devtools_output.assert_devtools_pformat_M", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 270, "end_line": 295, "span_ids": ["test_devtools_output", "test_pretty_color"], "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 test_pretty_color():\n c = Color('red')\n assert str(c) == 'red'\n assert repr(c) == \"Color('red', rgb=(255, 0, 0))\"\n assert list(c.__pretty__(lambda x: f'fmt: {x!r}')) == [\n 'Color(',\n 1,\n \"fmt: 'red'\",\n ',',\n 0,\n 'rgb=',\n 'fmt: (255, 0, 0)',\n ',',\n 0,\n -1,\n ')',\n ]\n\n\n@pytest.mark.skipif(not devtools, reason='devtools not installed')\ndef test_devtools_output():\n class MyTestModel(BaseModel):\n a: int = 1\n b: List[int] = [1, 2, 3]\n\n assert devtools.pformat(MyTestModel()) == 'MyTestModel(\\n a=1,\\n b=[1, 2, 3],\\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_pydantic__pydantic/tests/test_utils.py_test_deep_update_test_deep_update.assert_deep_update_mappin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_deep_update_test_deep_update.assert_deep_update_mappin", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 298, "end_line": 328, "span_ids": ["test_deep_update"], "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": "@pytest.mark.parametrize(\n 'mapping, updating_mapping, expected_mapping, msg',\n [\n (\n {'key': {'inner_key': 0}},\n {'other_key': 1},\n {'key': {'inner_key': 0}, 'other_key': 1},\n 'extra keys are inserted',\n ),\n (\n {'key': {'inner_key': 0}, 'other_key': 1},\n {'key': [1, 2, 3]},\n {'key': [1, 2, 3], 'other_key': 1},\n 'values that can not be merged are updated',\n ),\n (\n {'key': {'inner_key': 0}},\n {'key': {'other_key': 1}},\n {'key': {'inner_key': 0, 'other_key': 1}},\n 'values that have corresponding keys are merged',\n ),\n (\n {'key': {'inner_key': {'deep_key': 0}}},\n {'key': {'inner_key': {'other_deep_key': 1}}},\n {'key': {'inner_key': {'deep_key': 0, 'other_deep_key': 1}}},\n 'deeply nested values that have corresponding keys are merged',\n ),\n ],\n)\ndef test_deep_update(mapping, updating_mapping, expected_mapping, msg):\n assert deep_update(mapping, updating_mapping) == expected_mapping, 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_pydantic__pydantic/tests/test_utils.py_test_deep_update_is_not_mutating_test_all_literal_values.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_deep_update_is_not_mutating_test_all_literal_values.None_2", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 331, "end_line": 370, "span_ids": ["test_all_literal_values", "test_deep_update_is_not_mutating", "test_class_attribute", "test_undefined_repr", "test_undefined_copy"], "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": "def test_deep_update_is_not_mutating():\n mapping = {'key': {'inner_key': {'deep_key': 1}}}\n updated_mapping = deep_update(mapping, {'key': {'inner_key': {'other_deep_key': 1}}})\n assert updated_mapping == {'key': {'inner_key': {'deep_key': 1, 'other_deep_key': 1}}}\n assert mapping == {'key': {'inner_key': {'deep_key': 1}}}\n\n\ndef test_undefined_repr():\n assert repr(Undefined) == 'PydanticUndefined'\n\n\ndef test_undefined_copy():\n assert copy(Undefined) is Undefined\n assert deepcopy(Undefined) is Undefined\n\n\ndef test_class_attribute():\n class Foo:\n attr = ClassAttribute('attr', 'foo')\n\n assert Foo.attr == 'foo'\n\n with pytest.raises(AttributeError, match=\"'attr' attribute of 'Foo' is class-only\"):\n Foo().attr\n\n f = Foo()\n f.attr = 'not foo'\n assert f.attr == 'not foo'\n\n\ndef test_all_literal_values():\n L1 = Literal['1']\n assert all_literal_values(L1) == ['1']\n\n L2 = Literal['2']\n L12 = Literal[L1, L2]\n assert all_literal_values(L12) == IsList('1', '2', check_order=False)\n\n L312 = Literal['3', Literal[L1, L2]]\n assert all_literal_values(L312) == IsList('3', '1', '2', check_order=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_pydantic__pydantic/tests/test_utils.py_test_smart_deepcopy_immutable_non_sequence_test_smart_deepcopy_immutable_non_sequence.assert_smart_deepcopy_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_smart_deepcopy_immutable_non_sequence_test_smart_deepcopy_immutable_non_sequence.assert_smart_deepcopy_obj", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 373, "end_line": 381, "span_ids": ["test_smart_deepcopy_immutable_non_sequence"], "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": "@pytest.mark.parametrize(\n 'obj',\n (1, 1.0, '1', b'1', int, None, test_all_literal_values, len, test_all_literal_values.__code__, lambda: ..., ...),\n)\ndef test_smart_deepcopy_immutable_non_sequence(obj, mocker):\n # make sure deepcopy is not used\n # (other option will be to use obj.copy(), but this will produce error as none of given objects have this method)\n mocker.patch('pydantic._internal._utils.deepcopy', side_effect=RuntimeError)\n assert smart_deepcopy(obj) is deepcopy(obj) is 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_pydantic__pydantic/tests/test_utils.py_test_smart_deepcopy_empty_collection_T_1.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_smart_deepcopy_empty_collection_T_1.TypeVar_T_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 384, "end_line": 411, "span_ids": ["test_smart_deepcopy_collection", "impl:7", "test_smart_deepcopy_error", "test_smart_deepcopy_empty_collection"], "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": "@pytest.mark.parametrize('empty_collection', (collection() for collection in BUILTIN_COLLECTIONS))\ndef test_smart_deepcopy_empty_collection(empty_collection, mocker):\n mocker.patch('pydantic._internal._utils.deepcopy', side_effect=RuntimeError) # make sure deepcopy is not used\n if not isinstance(empty_collection, (tuple, frozenset)): # empty tuple or frozenset are always the same object\n assert smart_deepcopy(empty_collection) is not empty_collection\n\n\n@pytest.mark.parametrize(\n 'collection', (c.fromkeys((1,)) if issubclass(c, dict) else c((1,)) for c in BUILTIN_COLLECTIONS)\n)\ndef test_smart_deepcopy_collection(collection, mocker):\n expected_value = object()\n mocker.patch('pydantic._internal._utils.deepcopy', return_value=expected_value)\n assert smart_deepcopy(collection) is expected_value\n\n\n@pytest.mark.parametrize('error', [TypeError, ValueError, RuntimeError])\ndef test_smart_deepcopy_error(error, mocker):\n class RaiseOnBooleanOperation(str):\n def __bool__(self):\n raise error('raised error')\n\n obj = RaiseOnBooleanOperation()\n expected_value = deepcopy(obj)\n assert smart_deepcopy(obj) == expected_value\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_pydantic__pydantic/tests/test_utils.py_test_get_origin_test_get_origin.assert_get_origin_input_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_get_origin_test_get_origin.assert_get_origin_input_v", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 414, "end_line": 428, "span_ids": ["test_get_origin"], "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": "@pytest.mark.parametrize(\n 'input_value,output_value',\n [\n (Annotated[int, 10] if Annotated else None, Annotated),\n (Callable[[], T][int], collections.abc.Callable),\n (Dict[str, int], dict),\n (List[str], list),\n (Union[int, str], Union),\n (int, None),\n ],\n)\ndef test_get_origin(input_value, output_value):\n if input_value is None:\n pytest.skip('Skipping undefined hint for this python version')\n assert get_origin(input_value) is output_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_pydantic__pydantic/tests/test_utils.py_test_all_identical_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_all_identical_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 431, "end_line": 461, "span_ids": ["test_on_lower_camel_many_length", "test_on_lower_camel_one_length", "test_all_identical", "test_on_lower_camel_zero_length", "test_undefined_pickle"], "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 test_all_identical():\n a, b = object(), object()\n c = [b]\n assert all_identical([a, b], [a, b]) is True\n assert all_identical([a, b], [a, b]) is True\n assert all_identical([a, b, b], [a, b, b]) is True\n assert all_identical([a, c, b], [a, c, b]) is True\n\n assert all_identical([], [a]) is False, 'Expected iterables with different lengths to evaluate to `False`'\n assert all_identical([a], []) is False, 'Expected iterables with different lengths to evaluate to `False`'\n assert (\n all_identical([a, [b], b], [a, [b], b]) is False\n ), 'New list objects are different objects and should therefore not be identical.'\n\n\ndef test_undefined_pickle():\n undefined2 = pickle.loads(pickle.dumps(Undefined))\n assert undefined2 is Undefined\n\n\ndef test_on_lower_camel_zero_length():\n assert to_lower_camel('') == ''\n\n\ndef test_on_lower_camel_one_length():\n assert to_lower_camel('a') == 'a'\n\n\ndef test_on_lower_camel_many_length():\n assert to_lower_camel('i_like_turtles') == 'iLikeTurtles'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_json_SomeNamedTuple.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_json_SomeNamedTuple.x", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["SomeNamedTuple", "GenericPydanticModel", "SomeTypedDict", "imports", "PydanticModel", "impl:5"], "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": "import json\nimport sys\nfrom typing import Any, Dict, ForwardRef, Generic, List, NamedTuple, Tuple, TypeVar, Union\n\nimport pytest\nfrom pydantic_core import ValidationError\nfrom typing_extensions import TypeAlias, TypedDict\n\nfrom pydantic import AnalyzedType, BaseModel, ValidationInfo\nfrom pydantic.config import ConfigDict\nfrom pydantic.decorators import field_validator\n\nItemType = TypeVar('ItemType')\n\nNestedList = List[List[ItemType]]\n\n\nclass PydanticModel(BaseModel):\n x: int\n\n\nT = TypeVar('T')\n\n\nclass GenericPydanticModel(BaseModel, Generic[T]):\n x: NestedList[T]\n\n\nclass SomeTypedDict(TypedDict):\n x: int\n\n\nclass SomeNamedTuple(NamedTuple):\n x: 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_pydantic__pydantic/tests/test_validator.py_test_types_test_types.assert_expected_v_val_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_types_test_types.assert_expected_v_val_", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 59, "span_ids": ["test_types"], "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": "@pytest.mark.parametrize(\n 'tp, val, expected',\n [\n (PydanticModel, PydanticModel(x=1), PydanticModel(x=1)),\n (PydanticModel, {'x': 1}, PydanticModel(x=1)),\n (SomeTypedDict, {'x': 1}, {'x': 1}),\n (SomeNamedTuple, SomeNamedTuple(x=1), SomeNamedTuple(x=1)),\n (List[str], ['1', '2'], ['1', '2']),\n (Tuple[str], ('1',), ('1',)),\n (Tuple[str, int], ('1', 1), ('1', 1)),\n (Tuple[str, ...], ('1',), ('1',)),\n (Dict[str, int], {'foo': 123}, {'foo': 123}),\n (Union[int, str], 1, 1),\n (Union[int, str], '2', '2'),\n (GenericPydanticModel[int], {'x': [[1]]}, GenericPydanticModel[int](x=[[1]])),\n (GenericPydanticModel[int], {'x': [['1']]}, GenericPydanticModel[int](x=[[1]])),\n (NestedList[int], [[1]], [[1]]),\n (NestedList[int], [['1']], [[1]]),\n ],\n)\ndef test_types(tp: Any, val: Any, expected: Any):\n v = AnalyzedType(tp).validate_python\n assert expected == v(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_pydantic__pydantic/tests/test_validator.py_IntList_test_type_alias.assert_res_1_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_IntList_test_type_alias.assert_res_1_2_", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 98, "span_ids": ["test_local_namespace_variables", "impl:11", "impl:7", "test_global_namespace_variables", "test_top_level_fwd_ref", "test_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": "IntList = List[int]\nOuterDict = Dict[str, 'IntList']\n\n\ndef test_global_namespace_variables():\n v = AnalyzedType(OuterDict).validate_python\n res = v({'foo': [1, '2']})\n assert res == {'foo': [1, 2]}\n\n\ndef test_local_namespace_variables():\n IntList = List[int]\n OuterDict = Dict[str, 'IntList']\n\n v = AnalyzedType(OuterDict).validate_python\n\n res = v({'foo': [1, '2']})\n assert res == {'foo': [1, 2]}\n\n\n@pytest.mark.skipif(sys.version_info < (3, 9), reason=\"ForwardRef doesn't accept module as a parameter in Python < 3.9\")\ndef test_top_level_fwd_ref():\n FwdRef = ForwardRef('OuterDict', module=__name__)\n v = AnalyzedType(FwdRef).validate_python\n\n res = v({'foo': [1, '2']})\n assert res == {'foo': [1, 2]}\n\n\nMyUnion: TypeAlias = 'Union[str, int]'\n\n\ndef test_type_alias():\n MyList = List[MyUnion]\n v = AnalyzedType(MyList).validate_python\n res = v([1, '2'])\n assert res == [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_pydantic__pydantic/tests/test_validator.py_test_validate_python_strict_test_validate_python_strict.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_python_strict_test_validate_python_strict.None_5", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 126, "span_ids": ["test_validate_python_strict"], "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 test_validate_python_strict() -> None:\n class Model(TypedDict):\n x: int\n\n lax_validator = AnalyzedType(Model, config=ConfigDict(strict=False))\n strict_validator = AnalyzedType(Model, config=ConfigDict(strict=True))\n\n assert lax_validator.validate_python({'x': '1'}, strict=None) == Model(x=1)\n assert lax_validator.validate_python({'x': '1'}, strict=False) == Model(x=1)\n with pytest.raises(ValidationError) as exc_info:\n lax_validator.validate_python({'x': '1'}, strict=True)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n strict_validator.validate_python({'x': '1'})\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n assert strict_validator.validate_python({'x': '1'}, strict=False) == Model(x=1)\n with pytest.raises(ValidationError) as exc_info:\n strict_validator.validate_python({'x': '1'}, strict=True)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '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_pydantic__pydantic/tests/test_validator.py_test_validate_json_strict_test_validate_json_strict.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_json_strict_test_validate_json_strict.None_5", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 154, "span_ids": ["test_validate_json_strict"], "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 test_validate_json_strict() -> None:\n class Model(TypedDict):\n x: int\n\n lax_validator = AnalyzedType(Model, config=ConfigDict(strict=False))\n strict_validator = AnalyzedType(Model, config=ConfigDict(strict=True))\n\n assert lax_validator.validate_json(json.dumps({'x': '1'}), strict=None) == Model(x=1)\n assert lax_validator.validate_json(json.dumps({'x': '1'}), strict=False) == Model(x=1)\n with pytest.raises(ValidationError) as exc_info:\n lax_validator.validate_json(json.dumps({'x': '1'}), strict=True)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n strict_validator.validate_json(json.dumps({'x': '1'}), strict=None)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '1'}\n ]\n assert strict_validator.validate_json(json.dumps({'x': '1'}), strict=False) == Model(x=1)\n with pytest.raises(ValidationError) as exc_info:\n strict_validator.validate_json(json.dumps({'x': '1'}), strict=True)\n assert exc_info.value.errors() == [\n {'type': 'int_type', 'loc': ('x',), 'msg': 'Input should be a valid integer', 'input': '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_pydantic__pydantic/tests/test_validator.py_test_validate_python_context_test_validate_python_context.assert_contexts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_python_context_test_validate_python_context.assert_contexts_", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 157, "end_line": 172, "span_ids": ["test_validate_python_context"], "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": "def test_validate_python_context() -> None:\n contexts: List[Any] = [None, None, {'foo': 'bar'}]\n\n class Model(BaseModel):\n x: int\n\n @field_validator('x')\n def val_x(cls, v: int, info: ValidationInfo) -> int:\n assert info.context == contexts.pop(0)\n return v\n\n validator = AnalyzedType(Model)\n validator.validate_python({'x': 1})\n validator.validate_python({'x': 1}, context=None)\n validator.validate_python({'x': 1}, context={'foo': 'bar'})\n assert contexts == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_json_context_test_validate_json_context.assert_contexts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_validate_json_context_test_validate_json_context.assert_contexts_", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 175, "end_line": 190, "span_ids": ["test_validate_json_context"], "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 test_validate_json_context() -> None:\n contexts: List[Any] = [None, None, {'foo': 'bar'}]\n\n class Model(BaseModel):\n x: int\n\n @field_validator('x')\n def val_x(cls, v: int, info: ValidationInfo) -> int:\n assert info.context == contexts.pop(0)\n return v\n\n validator = AnalyzedType(Model)\n validator.validate_json(json.dumps({'x': 1}))\n validator.validate_json(json.dumps({'x': 1}), context=None)\n validator.validate_json(json.dumps({'x': 1}), context={'foo': 'bar'})\n assert contexts == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_merge_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validator.py_test_merge_config_", "embedding": null, "metadata": {"file_path": "tests/test_validator.py", "file_name": "test_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 193, "end_line": 217, "span_ids": ["test_merge_config"], "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 test_merge_config() -> None:\n class Model(BaseModel):\n x: int\n y: str\n\n model_config = ConfigDict(strict=True, title='FooModel')\n\n analyzed = AnalyzedType(Model, config=ConfigDict(strict=False, str_max_length=20))\n\n # strict=False gets applied to the outer Model but not to the inner typeddict validator\n # so we're allowed to validate a dict but `x` still must be an int\n analyzed.validate_python({'x': 1, 'y': '2'})\n assert analyzed.json_schema()['title'] == 'FooModel'\n with pytest.raises(ValidationError) as exc_info:\n analyzed.validate_python({'x': 1, 'y': 'x' * 21})\n assert exc_info.value.errors() == [\n {\n 'type': 'string_too_long',\n 'loc': ('y',),\n 'msg': 'String should have at most 20 characters',\n 'input': 'xxxxxxxxxxxxxxxxxxxxx',\n 'ctx': {'max_length': 20},\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_pydantic__pydantic/tests/test_validators.py_re_test_simple.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_re_test_simple.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 48, "span_ids": ["imports", "test_simple"], "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": "import re\nfrom collections import deque\nfrom datetime import datetime\nfrom enum import Enum\nfrom itertools import product\nfrom typing import Any, Deque, Dict, FrozenSet, List, Optional, Tuple, Type, Union\nfrom unittest.mock import MagicMock\n\nimport pytest\nfrom typing_extensions import Literal\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n Extra,\n Field,\n FieldValidationInfo,\n ValidationError,\n errors,\n validator,\n)\nfrom pydantic.decorators import field_validator, root_validator\n\n\ndef test_simple():\n class Model(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n assert Model(a='this is foobar good').a == 'this is foobar good'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('a',),\n 'msg': 'Value error, \"foobar\" not found in a',\n 'input': 'snap',\n 'ctx': {'error': '\"foobar\" not found in a'},\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_pydantic__pydantic/tests/test_validators.py_test_int_validation_test_int_validation.assert_Model_a_2_63_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_int_validation_test_int_validation.assert_Model_a_2_63_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 80, "span_ids": ["test_int_validation"], "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 test_int_validation():\n class Model(BaseModel):\n a: int\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'snap',\n }\n ]\n assert Model(a=3).a == 3\n assert Model(a=True).a == 1\n assert Model(a=False).a == 0\n with pytest.raises(ValidationError) as exc_info:\n Model(a=4.5)\n assert exc_info.value.errors() == [\n {\n 'type': 'int_from_float',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, got a number with a fractional part',\n 'input': 4.5,\n }\n ]\n\n # Doesn't raise ValidationError for number > (2 ^ 63) - 1 and limits them to (2 ^ 63) - 1\n assert Model(a=(2**63) + 100).a == (2**63) - 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_pydantic__pydantic/tests/test_validators.py_test_int_overflow_validation_test_frozenset_validation.assert_Model_a_1_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_int_overflow_validation_test_frozenset_validation.assert_Model_a_1_2_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 108, "span_ids": ["test_int_overflow_validation", "test_frozenset_validation"], "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": "@pytest.mark.parametrize('value', [2.2250738585072011e308, float('nan'), float('inf')])\ndef test_int_overflow_validation(value):\n class Model(BaseModel):\n a: int\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a=value)\n assert exc_info.value.errors() == [\n {'type': 'finite_number', 'loc': ('a',), 'msg': 'Input should be a finite number', 'input': value}\n ]\n\n\ndef test_frozenset_validation():\n class Model(BaseModel):\n a: FrozenSet[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n assert exc_info.value.errors() == [\n {'type': 'frozen_set_type', 'loc': ('a',), 'msg': 'Input should be a valid frozenset', 'input': 'snap'}\n ]\n assert Model(a={1, 2, 3}).a == frozenset({1, 2, 3})\n assert Model(a=frozenset({1, 2, 3})).a == frozenset({1, 2, 3})\n assert Model(a=[4, 5]).a == frozenset({4, 5})\n assert Model(a=(6,)).a == frozenset({6})\n assert Model(a={'1', '2', '3'}).a == frozenset({1, 2, 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_pydantic__pydantic/tests/test_validators.py_test_deque_validation_test_deque_validation.assert_Model_a_6_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_deque_validation_test_deque_validation.assert_Model_a_6_a_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 146, "span_ids": ["test_deque_validation"], "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 test_deque_validation():\n class Model(BaseModel):\n a: Deque[int]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n assert exc_info.value.errors() == [\n {'type': 'list_type', 'loc': ('a',), 'msg': 'Input should be a valid list', 'input': 'snap'}\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(a=['a'])\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n }\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(a=('a',))\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a', 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n }\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(a={'1'})\n assert exc_info.value.errors() == [\n {'type': 'list_type', 'loc': ('a',), 'msg': 'Input should be a valid list', 'input': {'1'}}\n ]\n assert Model(a=[4, 5]).a == deque([4, 5])\n assert Model(a=(6,)).a == deque([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_pydantic__pydantic/tests/test_validators.py_test_validate_whole_test_validate_whole.assert_Model_a_1_2_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_whole_test_validate_whole.assert_Model_a_1_2_a_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 165, "span_ids": ["test_validate_whole"], "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 test_validate_whole():\n class Model(BaseModel):\n a: List[int]\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a1(cls, v: List[Any]) -> List[Any]:\n v.append('123')\n return v\n\n @field_validator('a')\n @classmethod\n def check_a2(cls, v: List[int]) -> List[Any]:\n v.append(456)\n return v\n\n assert Model(a=[1, 2]).a == [1, 2, 123, 456]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_pre_error_test_validate_pre_error.Model.check_a2.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_pre_error_test_validate_pre_error.Model.check_a2.return.v", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 168, "end_line": 189, "span_ids": ["test_validate_pre_error"], "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 test_validate_pre_error():\n calls = []\n\n class Model(BaseModel):\n a: List[int]\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a1(cls, v: Any):\n calls.append(f'check_a1 {v}')\n if 1 in v:\n raise ValueError('a1 broken')\n v[0] += 1\n return v\n\n @field_validator('a')\n @classmethod\n def check_a2(cls, v: Any):\n calls.append(f'check_a2 {v}')\n if 10 in v:\n raise ValueError('a2 broken')\n return v\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_pydantic__pydantic/tests/test_validators.py_test_validate_pre_error.assert_Model_a_3_8_a__test_validate_pre_error.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_pre_error.assert_Model_a_3_8_a__test_validate_pre_error.None_5", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 191, "end_line": 220, "span_ids": ["test_validate_pre_error"], "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 test_validate_pre_error():\n # ... other code\n\n assert Model(a=[3, 8]).a == [4, 8]\n assert calls == ['check_a1 [3, 8]', 'check_a2 [4, 8]']\n\n calls = []\n with pytest.raises(ValidationError) as exc_info:\n Model(a=[1, 3])\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('a',),\n 'msg': 'Value error, a1 broken',\n 'input': [1, 3],\n 'ctx': {'error': 'a1 broken'},\n }\n ]\n assert calls == ['check_a1 [1, 3]']\n\n calls = []\n with pytest.raises(ValidationError) as exc_info:\n Model(a=[5, 10])\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('a',),\n 'msg': 'Value error, a2 broken',\n 'input': [6, 10],\n 'ctx': {'error': 'a2 broken'},\n }\n ]\n assert calls == ['check_a1 [5, 10]', 'check_a2 [6, 10]']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_validate_assignment_model_fixture_validate_assignment_model_fixture.return.ValidateAssignmentModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_validate_assignment_model_fixture_validate_assignment_model_fixture.return.ValidateAssignmentModel", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 223, "end_line": 245, "span_ids": ["validate_assignment_model_fixture"], "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": "@pytest.fixture(scope='session', name='ValidateAssignmentModel')\ndef validate_assignment_model_fixture():\n class ValidateAssignmentModel(BaseModel):\n a: int = 4\n b: str = ...\n c: int = 0\n\n @field_validator('b')\n @classmethod\n def b_length(cls, v, info):\n values = info.data\n if 'a' in values and len(v) < values['a']:\n raise ValueError('b too short')\n return v\n\n @field_validator('c')\n @classmethod\n def double_c(cls, v: Any):\n return v * 2\n\n model_config = ConfigDict(validate_assignment=True, extra=Extra.allow)\n\n return ValidateAssignmentModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_ok_test_validating_assignment_dict.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_ok_test_validating_assignment_dict.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 248, "end_line": 293, "span_ids": ["test_validating_assignment_ok", "test_validating_assignment_fail", "test_validating_assignment_value_change", "test_validating_assignment_dict", "test_validating_assignment_extra"], "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 test_validating_assignment_ok(ValidateAssignmentModel):\n p = ValidateAssignmentModel(b='hello')\n assert p.b == 'hello'\n\n\ndef test_validating_assignment_fail(ValidateAssignmentModel):\n with pytest.raises(ValidationError):\n ValidateAssignmentModel(a=10, b='hello')\n\n p = ValidateAssignmentModel(b='hello')\n with pytest.raises(ValidationError):\n p.b = 'x'\n\n\ndef test_validating_assignment_value_change(ValidateAssignmentModel):\n p = ValidateAssignmentModel(b='hello', c=2)\n assert p.c == 4\n\n p = ValidateAssignmentModel(b='hello')\n assert p.c == 0\n p.c = 3\n assert p.c == 6\n\n\ndef test_validating_assignment_extra(ValidateAssignmentModel):\n p = ValidateAssignmentModel(b='hello', extra_field=1.23)\n assert p.extra_field == 1.23\n\n p = ValidateAssignmentModel(b='hello')\n p.extra_field = 1.23\n assert p.extra_field == 1.23\n p.extra_field = 'bye'\n assert p.extra_field == 'bye'\n\n\ndef test_validating_assignment_dict(ValidateAssignmentModel):\n with pytest.raises(ValidationError) as exc_info:\n ValidateAssignmentModel(a='x', b='xx')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\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_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_values_dict_test_validating_assignment_values_dict.assert_model_b_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_values_dict_test_validating_assignment_values_dict.assert_model_b_4", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 296, "end_line": 317, "span_ids": ["test_validating_assignment_values_dict"], "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 test_validating_assignment_values_dict():\n class ModelOne(BaseModel):\n a: int\n\n class ModelTwo(BaseModel):\n m: ModelOne\n b: int\n\n @field_validator('b')\n @classmethod\n def validate_b(cls, b, info: FieldValidationInfo):\n if 'm' in info.data:\n return b + info.data['m'].a # this fails if info.data['m'] is a dict\n else:\n return b\n\n model_config = ConfigDict(validate_assignment=True)\n\n model = ModelTwo(m=ModelOne(a=1), b=2)\n assert model.b == 3\n model.b = 3\n assert model.b == 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_pydantic__pydantic/tests/test_validators.py_test_validate_multiple_test_validate_multiple.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_multiple_test_validate_multiple.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 320, "end_line": 352, "span_ids": ["test_validate_multiple"], "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 test_validate_multiple():\n class Model(BaseModel):\n a: str\n b: str\n\n @field_validator('a', 'b')\n @classmethod\n def check_a_and_b(cls, v: Any, info: FieldValidationInfo) -> Any:\n if len(v) < 4:\n field = cls.model_fields[info.field_name]\n raise AssertionError(f'{field.alias or info.field_name} is too short')\n return v + 'x'\n\n assert Model(a='1234', b='5678').model_dump() == {'a': '1234x', 'b': '5678x'}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='x', b='x')\n assert exc_info.value.errors() == [\n {\n 'type': 'assertion_error',\n 'loc': ('a',),\n 'msg': 'Assertion failed, a is too short',\n 'input': 'x',\n 'ctx': {'error': 'a is too short'},\n },\n {\n 'type': 'assertion_error',\n 'loc': ('b',),\n 'msg': 'Assertion failed, b is too short',\n 'input': 'x',\n 'ctx': {'error': 'b is too short'},\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_pydantic__pydantic/tests/test_validators.py_test_classmethod_test_use_no_fields_field_validator.with_pytest_raises_.Model.checker.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_classmethod_test_use_no_fields_field_validator.with_pytest_raises_.Model.checker.return.v", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 355, "end_line": 434, "span_ids": ["test_classmethod", "test_duplicates", "test_use_no_fields", "test_use_bare", "test_use_no_fields_field_validator", "test_use_bare_field_validator"], "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 test_classmethod():\n class Model(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v: Any):\n assert cls is Model\n return v\n\n m = Model(a='this is foobar good')\n assert m.a == 'this is foobar good'\n m.check_a('x')\n\n\ndef test_duplicates():\n msg = r'duplicate validator function \\\"tests.test_validators::test_duplicates..Model.duplicate_name\\\";'\n with pytest.warns(UserWarning, match=msg):\n\n class Model(BaseModel):\n a: str\n b: str\n\n @field_validator('a')\n def duplicate_name(cls, v: Any):\n return v\n\n @field_validator('b')\n def duplicate_name(cls, v: Any): # noqa\n return v\n\n\ndef test_use_bare():\n with pytest.raises(TypeError, match='validators should be used with fields'):\n\n class Model(BaseModel):\n a: str\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator\n def checker(cls, v):\n return v\n\n\ndef test_use_bare_field_validator():\n with pytest.raises(TypeError, match='field_validators should be used with fields'):\n\n class Model(BaseModel):\n a: str\n\n @field_validator\n def checker(cls, v):\n return v\n\n\ndef test_use_no_fields():\n with pytest.raises(TypeError, match=re.escape(\"validator() missing 1 required positional argument: '__field'\")):\n\n class Model(BaseModel):\n a: str\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator()\n def checker(cls, v):\n return v\n\n\ndef test_use_no_fields_field_validator():\n with pytest.raises(\n TypeError, match=re.escape(\"field_validator() missing 1 required positional argument: '__field'\")\n ):\n\n class Model(BaseModel):\n a: str\n\n @field_validator()\n def checker(cls, v):\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_pydantic__pydantic/tests/test_validators.py_test_validator_bad_fields_throws_configerror_test_validator_bad_fields_throws_configerror.with_pytest_raises_TypeEr.Model.with_pytest_warns_Depreca.check_fields.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_bad_fields_throws_configerror_test_validator_bad_fields_throws_configerror.with_pytest_raises_TypeEr.Model.with_pytest_warns_Depreca.check_fields.return.v", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 437, "end_line": 452, "span_ids": ["test_validator_bad_fields_throws_configerror"], "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 test_validator_bad_fields_throws_configerror():\n \"\"\"\n Attempts to create a validator with fields set as a list of strings,\n rather than just multiple string args. Expects ConfigError to be raised.\n \"\"\"\n with pytest.raises(TypeError, match='validator fields should be passed as separate string args.'):\n\n class Model(BaseModel):\n a: str\n b: str\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator(['a', 'b'])\n def check_fields(cls, v):\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_pydantic__pydantic/tests/test_validators.py_test_field_validator_bad_fields_throws_configerror_test_validate_always.assert_check_calls_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_bad_fields_throws_configerror_test_validate_always.assert_check_calls_2", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 455, "end_line": 489, "span_ids": ["test_validate_always", "test_field_validator_bad_fields_throws_configerror"], "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 test_field_validator_bad_fields_throws_configerror():\n \"\"\"\n Attempts to create a validator with fields set as a list of strings,\n rather than just multiple string args. Expects ConfigError to be raised.\n \"\"\"\n with pytest.raises(TypeError, match='field_validator fields should be passed as separate string args.'):\n\n class Model(BaseModel):\n a: str\n b: str\n\n @field_validator(['a', 'b'])\n def check_fields(cls, v):\n return v\n\n\ndef test_validate_always():\n check_calls = 0\n\n class Model(BaseModel):\n a: str = None\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('a', pre=True, always=True)\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'xxx'\n\n assert Model().a == 'xxx'\n assert check_calls == 1\n assert Model(a='y').a == 'y'\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_test_validate_always_on_inheritance.assert_check_calls_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_test_validate_always_on_inheritance.assert_check_calls_2", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 492, "end_line": 530, "span_ids": ["test_validate_always_on_inheritance", "test_field_validator_validate_default"], "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 test_field_validator_validate_default():\n check_calls = 0\n\n class Model(BaseModel):\n a: str = Field(None, validate_default=True)\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'xxx'\n\n assert Model().a == 'xxx'\n assert check_calls == 1\n assert Model(a='y').a == 'y'\n assert check_calls == 2\n\n\ndef test_validate_always_on_inheritance():\n check_calls = 0\n\n class ParentModel(BaseModel):\n a: str = None\n\n class Model(ParentModel):\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('a', pre=True, always=True)\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'xxx'\n\n assert Model().a == 'xxx'\n assert check_calls == 1\n assert Model(a='y').a == 'y'\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_on_inheritance_test_validate_not_always.assert_check_calls_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_on_inheritance_test_validate_not_always.assert_check_calls_1", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 533, "end_line": 569, "span_ids": ["test_field_validator_validate_default_on_inheritance", "test_validate_not_always"], "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 test_field_validator_validate_default_on_inheritance():\n check_calls = 0\n\n class ParentModel(BaseModel):\n a: str = Field(None, validate_default=True)\n\n class Model(ParentModel):\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'xxx'\n\n assert Model().a == 'xxx'\n assert check_calls == 1\n assert Model(a='y').a == 'y'\n assert check_calls == 2\n\n\ndef test_validate_not_always():\n check_calls = 0\n\n class Model(BaseModel):\n a: Optional[str] = None\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'xxx'\n\n assert Model().a is None\n assert check_calls == 0\n assert Model(a='y').a == 'y'\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_wildcard_validators_test_wildcard_validators.assert_calls_check_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_wildcard_validators_test_wildcard_validators.assert_calls_check_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 572, "end_line": 592, "span_ids": ["test_wildcard_validators"], "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 test_wildcard_validators():\n calls: list[tuple[str, Any]] = []\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n a: str\n b: int\n\n @validator('a')\n def check_a(cls, v: Any) -> Any:\n calls.append(('check_a', v))\n return v\n\n @validator('*')\n def check_all(cls, v: Any) -> Any:\n calls.append(('check_all', v))\n return v\n\n assert Model(a='abc', b='123').model_dump() == dict(a='abc', b=123)\n assert calls == [('check_a', 'abc'), ('check_all', 'abc'), ('check_all', 123)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_wildcard_validator_error_test_wildcard_validator_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_wildcard_validator_error_test_wildcard_validator_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 595, "end_line": 622, "span_ids": ["test_wildcard_validator_error"], "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 test_wildcard_validator_error():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n a: str\n b: str\n\n @validator('*')\n def check_all(cls, v: Any) -> Any:\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n assert Model(a='foobar a', b='foobar b').b == 'foobar b'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': ('a',),\n 'msg': 'Value error, \"foobar\" not found in a',\n 'input': 'snap',\n 'ctx': {'error': '\"foobar\" not found in a'},\n },\n {'type': 'missing', 'loc': ('b',), 'msg': 'Field required', 'input': {'a': 'snap'}},\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_pydantic__pydantic/tests/test_validators.py_test_invalid_field_test_validate_child.with_pytest_raises_Valida.Child_a_snap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_invalid_field_test_validate_child.with_pytest_raises_Valida.Child_a_snap_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 625, "end_line": 656, "span_ids": ["test_invalid_field", "test_validate_child"], "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 test_invalid_field():\n with pytest.raises(errors.PydanticUserError) as exc_info:\n\n class Model(BaseModel):\n a: str\n\n @field_validator('b')\n def check_b(cls, v: Any):\n return v\n\n assert str(exc_info.value) == (\n \"Validators defined with incorrect fields: check_b \"\n \"(use check_fields=False if you're inheriting from the model and intended this)\"\n )\n\n\ndef test_validate_child():\n class Parent(BaseModel):\n a: str\n\n class Child(Parent):\n @field_validator('a')\n @classmethod\n def check_a(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n assert Parent(a='this is not a child').a == 'this is not a child'\n assert Child(a='this is foobar good').a == 'this is foobar good'\n with pytest.raises(ValidationError):\n Child(a='snap')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_extra_test_validate_child_extra.with_pytest_raises_Valida.Child_a_snap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_extra_test_validate_child_extra.with_pytest_raises_Valida.Child_a_snap_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 659, "end_line": 679, "span_ids": ["test_validate_child_extra"], "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 test_validate_child_extra():\n class Parent(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a_one(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n class Child(Parent):\n @field_validator('a')\n @classmethod\n def check_a_two(cls, v: Any):\n return v.upper()\n\n assert Parent(a='this is foobar good').a == 'this is foobar good'\n assert Child(a='this is foobar good').a == 'THIS IS FOOBAR GOOD'\n with pytest.raises(ValidationError):\n Child(a='snap')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_all_test_validate_child_all.with_pytest_warns_Depreca.with_pytest_raises_Valida.Child_a_snap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_all_test_validate_child_all.with_pytest_warns_Depreca.with_pytest_raises_Valida.Child_a_snap_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 682, "end_line": 699, "span_ids": ["test_validate_child_all"], "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 test_validate_child_all():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Parent(BaseModel):\n a: str\n\n class Child(Parent):\n @validator('*')\n @classmethod\n def check_a(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n assert Parent(a='this is not a child').a == 'this is not a child'\n assert Child(a='this is foobar good').a == 'this is foobar good'\n with pytest.raises(ValidationError):\n Child(a='snap')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_parent_test_validate_parent.None_1.Child_a_snap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_parent_test_validate_parent.None_1.Child_a_snap_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 702, "end_line": 721, "span_ids": ["test_validate_parent"], "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 test_validate_parent():\n class Parent(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n class Child(Parent):\n pass\n\n assert Parent(a='this is foobar good').a == 'this is foobar good'\n assert Child(a='this is foobar good').a == 'this is foobar good'\n with pytest.raises(ValidationError):\n Parent(a='snap')\n with pytest.raises(ValidationError):\n Child(a='snap')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_parent_all_test_inheritance_keep.assert_Child_a_0_a_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_parent_all_test_inheritance_keep.assert_Child_a_0_a_1", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 724, "end_line": 760, "span_ids": ["test_inheritance_keep", "test_validate_parent_all"], "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 test_validate_parent_all():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Parent(BaseModel):\n a: str\n\n @validator('*')\n @classmethod\n def check_a(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n class Child(Parent):\n pass\n\n assert Parent(a='this is foobar good').a == 'this is foobar good'\n assert Child(a='this is foobar good').a == 'this is foobar good'\n with pytest.raises(ValidationError):\n Parent(a='snap')\n with pytest.raises(ValidationError):\n Child(a='snap')\n\n\ndef test_inheritance_keep():\n class Parent(BaseModel):\n a: int\n\n @field_validator('a')\n @classmethod\n def add_to_a(cls, v: Any):\n return v + 1\n\n class Child(Parent):\n pass\n\n assert Child(a=0).a == 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_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_test_inheritance_replace.assert_Child_a_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_test_inheritance_replace.assert_Child_a_a_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 763, "end_line": 810, "span_ids": ["test_inheritance_replace"], "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 test_inheritance_replace():\n \"\"\"We promise that if you add a validator\n with the same _function_ name as an existing validator\n it replaces the existing validator and is run instead of it.\n \"\"\"\n\n class Parent(BaseModel):\n a: List[str]\n\n @field_validator('a')\n @classmethod\n def parent_val_before(cls, v: List[str]):\n v.append('parent before')\n return v\n\n @field_validator('a')\n @classmethod\n def val(cls, v: List[str]):\n v.append('parent')\n return v\n\n @field_validator('a')\n @classmethod\n def parent_val_after(cls, v: List[str]):\n v.append('parent after')\n return v\n\n class Child(Parent):\n @field_validator('a')\n @classmethod\n def child_val_before(cls, v: List[str]):\n v.append('child before')\n return v\n\n @field_validator('a')\n @classmethod\n def val(cls, v: List[str]):\n v.append('child')\n return v\n\n @field_validator('a')\n @classmethod\n def child_val_after(cls, v: List[str]):\n v.append('child after')\n return v\n\n assert Parent(a=[]).a == ['parent before', 'parent', 'parent after']\n assert Child(a=[]).a == ['parent before', 'child', 'parent after', 'child before', 'child 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_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_root_validator_test_inheritance_replace_root_validator.Parent.parent_val_after.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_root_validator_test_inheritance_replace_root_validator.Parent.parent_val_after.return.values", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 813, "end_line": 836, "span_ids": ["test_inheritance_replace_root_validator"], "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 test_inheritance_replace_root_validator():\n \"\"\"\n We promise that if you add a validator\n with the same _function_ name as an existing validator\n it replaces the existing validator and is run instead of it.\n \"\"\"\n\n class Parent(BaseModel):\n a: List[str]\n\n @root_validator(skip_on_failure=True)\n def parent_val_before(cls, values: Dict[str, Any]):\n values['a'].append('parent before')\n return values\n\n @root_validator(skip_on_failure=True)\n def val(cls, values: Dict[str, Any]):\n values['a'].append('parent')\n return values\n\n @root_validator(skip_on_failure=True)\n def parent_val_after(cls, values: Dict[str, Any]):\n values['a'].append('parent after')\n return values\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_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_root_validator.Child_test_inheritance_replace_root_validator.assert_Child_a_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_inheritance_replace_root_validator.Child_test_inheritance_replace_root_validator.assert_Child_a_a_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 838, "end_line": 855, "span_ids": ["test_inheritance_replace_root_validator"], "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 test_inheritance_replace_root_validator():\n # ... other code\n\n class Child(Parent):\n @root_validator(skip_on_failure=True)\n def child_val_before(cls, values: Dict[str, Any]):\n values['a'].append('child before')\n return values\n\n @root_validator(skip_on_failure=True)\n def val(cls, values: Dict[str, Any]):\n values['a'].append('child')\n return values\n\n @root_validator(skip_on_failure=True)\n def child_val_after(cls, values: Dict[str, Any]):\n values['a'].append('child after')\n return values\n\n assert Parent(a=[]).a == ['parent before', 'parent', 'parent after']\n assert Child(a=[]).a == ['parent before', 'child', 'parent after', 'child before', 'child 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_pydantic__pydantic/tests/test_validators.py_test_validation_each_item_test_validation_each_item_nullable.assert_Model_foobar_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validation_each_item_test_validation_each_item_nullable.assert_Model_foobar_1_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 858, "end_line": 883, "span_ids": ["test_validation_each_item", "test_validation_each_item_nullable"], "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 test_validation_each_item():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n foobar: Dict[int, int]\n\n @validator('foobar', each_item=True)\n @classmethod\n def check_foobar(cls, v: Any):\n return v + 1\n\n assert Model(foobar={1: 1}).foobar == {1: 2}\n\n\ndef test_validation_each_item_nullable():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n foobar: Optional[List[int]]\n\n @validator('foobar', each_item=True)\n @classmethod\n def check_foobar(cls, v: Any):\n return v + 1\n\n assert Model(foobar=[1]).foobar == [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_pydantic__pydantic/tests/test_validators.py_test_validation_each_item_one_sublevel_test_validation_each_item_one_sublevel.assert_Model_foobar_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validation_each_item_one_sublevel_test_validation_each_item_one_sublevel.assert_Model_foobar_1_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 886, "end_line": 899, "span_ids": ["test_validation_each_item_one_sublevel"], "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 test_validation_each_item_one_sublevel():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n foobar: List[Tuple[int, int]]\n\n @validator('foobar', each_item=True)\n @classmethod\n def check_foobar(cls, v: Tuple[int, int]) -> Tuple[int, int]:\n v1, v2 = v\n assert v1 == v2\n return v\n\n assert Model(foobar=[(1, 1), (2, 2)]).foobar == [(1, 1), (2, 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_pydantic__pydantic/tests/test_validators.py_test_key_validation_test_validator_always_optional.assert_check_calls_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_key_validation_test_validator_always_optional.assert_check_calls_2", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 902, "end_line": 932, "span_ids": ["test_key_validation", "test_validator_always_optional"], "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 test_key_validation():\n class Model(BaseModel):\n foobar: Dict[int, int]\n\n @field_validator('foobar')\n @classmethod\n def check_foobar(cls, value):\n return {k + 1: v + 1 for k, v in value.items()}\n\n assert Model(foobar={1: 1}).foobar == {2: 2}\n\n\ndef test_validator_always_optional():\n check_calls = 0\n\n class Model(BaseModel):\n a: Optional[str] = None\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('a', pre=True, always=True)\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert check_calls == 1\n assert Model().a == 'default value'\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_optional_test_field_validator_validate_default_optional.assert_check_calls_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_optional_test_field_validator_validate_default_optional.assert_check_calls_2", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 935, "end_line": 951, "span_ids": ["test_field_validator_validate_default_optional"], "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 test_field_validator_validate_default_optional():\n check_calls = 0\n\n class Model(BaseModel):\n a: Optional[str] = Field(None, validate_default=True)\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert check_calls == 1\n assert Model().a == 'default value'\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_validator_always_pre_test_field_validator_validate_default_pre.assert_check_calls_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_always_pre_test_field_validator_validate_default_pre.assert_check_calls_2", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 954, "end_line": 989, "span_ids": ["test_validator_always_pre", "test_field_validator_validate_default_pre"], "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 test_validator_always_pre():\n check_calls = 0\n\n class Model(BaseModel):\n a: str = None\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('a', pre=True, always=True)\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert Model().a == 'default value'\n assert check_calls == 2\n\n\ndef test_field_validator_validate_default_pre():\n check_calls = 0\n\n class Model(BaseModel):\n a: str = Field(None, validate_default=True)\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert Model().a == 'default value'\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_validator_always_post_test_validator_always_post.assert_Model_a_defa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_always_post_test_validator_always_post.assert_Model_a_defa", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 992, "end_line": 1007, "span_ids": ["test_validator_always_post"], "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_validator_always_post():\n class Model(BaseModel):\n # NOTE: Unlike in v1, you can't replicate the behavior of only applying defined validators and not standard\n # field validation. This is why I've set the default to '' instead of None.\n # But, I think this is a good thing, and I don't think we should try to support this.\n a: str = ''\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('a', always=True)\n @classmethod\n def check_a(cls, v: Any):\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert Model().a == 'default 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_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_post_test_field_validator_validate_default_post_optional.assert_Model_a_defa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_validator_validate_default_post_test_field_validator_validate_default_post_optional.assert_Model_a_defa", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1010, "end_line": 1048, "span_ids": ["test_field_validator_validate_default_post_optional", "test_validator_always_post_optional", "test_field_validator_validate_default_post"], "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": "def test_field_validator_validate_default_post():\n class Model(BaseModel):\n a: str = Field('', validate_default=True)\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v: Any):\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert Model().a == 'default value'\n\n\ndef test_validator_always_post_optional():\n class Model(BaseModel):\n a: Optional[str] = None\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('a', pre=True, always=True)\n @classmethod\n def check_a(cls, v: Any):\n return 'default value' if v is None else v\n\n assert Model(a='y').a == 'y'\n assert Model().a == 'default value'\n\n\ndef test_field_validator_validate_default_post_optional():\n class Model(BaseModel):\n a: Optional[str] = Field(None, validate_default=True)\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n return v or 'default value'\n\n assert Model(a='y').a == 'y'\n assert Model().a == 'default 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_pydantic__pydantic/tests/test_validators.py_test_datetime_validator_test_datetime_validator.assert_check_calls_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_datetime_validator_test_datetime_validator.assert_check_calls_3", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1051, "end_line": 1071, "span_ids": ["test_datetime_validator"], "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 test_datetime_validator():\n check_calls = 0\n\n class Model(BaseModel):\n d: datetime = None\n\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n @validator('d', pre=True, always=True)\n @classmethod\n def check_d(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or datetime(2032, 1, 1)\n\n assert Model(d='2023-01-01T00:00:00').d == datetime(2023, 1, 1)\n assert check_calls == 1\n assert Model().d == datetime(2032, 1, 1)\n assert check_calls == 2\n assert Model(d=datetime(2023, 1, 1)).d == datetime(2023, 1, 1)\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_datetime_field_validator_test_pre_called_once.assert_check_calls_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_datetime_field_validator_test_pre_called_once.assert_check_calls_1", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1074, "end_line": 1109, "span_ids": ["test_datetime_field_validator", "test_pre_called_once"], "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 test_datetime_field_validator():\n check_calls = 0\n\n class Model(BaseModel):\n d: datetime = Field(None, validate_default=True)\n\n @field_validator('d', mode='before')\n @classmethod\n def check_d(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v or datetime(2032, 1, 1)\n\n assert Model(d='2023-01-01T00:00:00').d == datetime(2023, 1, 1)\n assert check_calls == 1\n assert Model().d == datetime(2032, 1, 1)\n assert check_calls == 2\n assert Model(d=datetime(2023, 1, 1)).d == datetime(2023, 1, 1)\n assert check_calls == 3\n\n\ndef test_pre_called_once():\n check_calls = 0\n\n class Model(BaseModel):\n a: Tuple[int, int, int]\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a(cls, v: Any):\n nonlocal check_calls\n check_calls += 1\n return v\n\n assert Model(a=['1', '2', '3']).a == (1, 2, 3)\n assert check_calls == 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_pydantic__pydantic/tests/test_validators.py_test_assert_raises_validation_error_test_assert_raises_validation_error.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_assert_raises_validation_error_test_assert_raises_validation_error.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1112, "end_line": 1135, "span_ids": ["test_assert_raises_validation_error"], "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 test_assert_raises_validation_error():\n class Model(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v: Any):\n assert v == 'a', 'invalid a'\n return v\n\n Model(a='a')\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n injected_by_pytest = \"assert 'snap' == 'a'\\n - a\\n + snap\"\n assert exc_info.value.errors() == [\n {\n 'type': 'assertion_error',\n 'loc': ('a',),\n 'msg': f'Assertion failed, invalid a\\n{injected_by_pytest}',\n 'input': 'snap',\n 'ctx': {'error': \"invalid a\\nassert 'snap' == 'a'\\n - a\\n + snap\"},\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_test_root_validator.Model.example_root_validator2.return.dict_values_c_changed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_test_root_validator.Model.example_root_validator2.return.dict_values_c_changed_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1138, "end_line": 1163, "span_ids": ["test_root_validator"], "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 test_root_validator():\n root_val_values: List[Dict[str, Any]] = []\n\n class Model(BaseModel):\n a: int = 1\n b: str\n c: str\n\n @field_validator('b')\n @classmethod\n def repeat_b(cls, v: Any):\n return v * 2\n\n @root_validator(skip_on_failure=True)\n def example_root_validator(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n root_val_values.append(values)\n if 'snap' in values.get('b', ''):\n raise ValueError('foobar')\n return dict(values, b='changed')\n\n @root_validator(skip_on_failure=True)\n def example_root_validator2(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n root_val_values.append(values)\n if 'snap' in values.get('c', ''):\n raise ValueError('foobar2')\n return dict(values, c='changed')\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_pydantic__pydantic/tests/test_validators.py_test_root_validator.assert_Model_a_123_b__test_root_validator.assert_root_val_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator.assert_Model_a_123_b__test_root_validator.assert_root_val_values_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1165, "end_line": 1194, "span_ids": ["test_root_validator"], "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": "def test_root_validator():\n # ... other code\n\n assert Model(a='123', b='bar', c='baz').model_dump() == {'a': 123, 'b': 'changed', 'c': 'changed'}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(b='snap dragon', c='snap dragon2')\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': (),\n 'msg': 'Value error, foobar',\n 'input': {'b': 'snap dragon', 'c': 'snap dragon2'},\n 'ctx': {'error': 'foobar'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='broken', b='bar', c='baz')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'broken',\n }\n ]\n\n assert root_val_values == [\n {'a': 123, 'b': 'barbar', 'c': 'baz'},\n {'a': 123, 'b': 'changed', 'c': 'baz'},\n {'a': 1, 'b': 'snap dragonsnap dragon', 'c': 'snap dragon2'},\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_pre_test_root_validator_pre.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_pre_test_root_validator_pre.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1197, "end_line": 1230, "span_ids": ["test_root_validator_pre"], "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 test_root_validator_pre():\n root_val_values: List[Dict[str, Any]] = []\n\n class Model(BaseModel):\n a: int = 1\n b: str\n\n @field_validator('b')\n @classmethod\n def repeat_b(cls, v: Any):\n return v * 2\n\n @root_validator(pre=True)\n def root_validator(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n root_val_values.append(values)\n if 'snap' in values.get('b', ''):\n raise ValueError('foobar')\n return {'a': 42, 'b': 'changed'}\n\n assert Model(a='123', b='bar').model_dump() == {'a': 42, 'b': 'changedchanged'}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(b='snap dragon')\n\n assert root_val_values == [{'a': '123', 'b': 'bar'}, {'b': 'snap dragon'}]\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': (),\n 'msg': 'Value error, foobar',\n 'input': {'b': 'snap dragon'},\n 'ctx': {'error': 'foobar'},\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_repeat_test_root_validator_repeat2.with_pytest_warns_UserWar.Model.repeat_validator_1.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_repeat_test_root_validator_repeat2.with_pytest_warns_UserWar.Model.repeat_validator_1.return.values", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1233, "end_line": 1260, "span_ids": ["test_root_validator_repeat", "test_root_validator_repeat2"], "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 test_root_validator_repeat():\n with pytest.warns(UserWarning, match='duplicate validator function'):\n\n class Model(BaseModel):\n a: int = 1\n\n @root_validator(skip_on_failure=True)\n def root_validator_repeated(cls, values: Dict[str, Any]) -> Dict[str, Any]: # type: ignore\n return values\n\n @root_validator(skip_on_failure=True)\n def root_validator_repeated(cls, values: Dict[str, Any]) -> Dict[str, Any]: # noqa: F811\n return values\n\n\ndef test_root_validator_repeat2():\n with pytest.warns(UserWarning, match='duplicate validator function'):\n\n class Model(BaseModel):\n a: int = 1\n\n @field_validator('a')\n def repeat_validator(cls, v: Any) -> Any: # type: ignore\n return v\n\n @root_validator(skip_on_failure=True)\n def repeat_validator(cls, values: Any) -> Any: # noqa: F811\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_types_test_root_validator_types.assert_root_val_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_types_test_root_validator_types.assert_root_val_values_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1263, "end_line": 1280, "span_ids": ["test_root_validator_types"], "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 test_root_validator_types():\n root_val_values: Optional[Tuple[Type[BaseModel], Dict[str, Any]]] = None\n\n class Model(BaseModel):\n a: int = 1\n b: str\n\n @root_validator(skip_on_failure=True)\n def root_validator(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n nonlocal root_val_values\n root_val_values = cls, values\n return values\n\n model_config = ConfigDict(extra=Extra.allow)\n\n assert Model(b='bar', c='wobble').model_dump() == {'a': 1, 'b': 'bar', 'c': 'wobble'}\n\n assert root_val_values == (Model, {'a': 1, 'b': 'bar', 'c': 'wobble'})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_returns_none_exception_test_reuse_global_validators.assert_dict_Model_x_1_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_returns_none_exception_test_reuse_global_validators.assert_dict_Model_x_1_y_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1283, "end_line": 1310, "span_ids": ["test_reuse_global_validators", "test_root_validator_returns_none_exception", "reusable_validator"], "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 test_root_validator_returns_none_exception():\n class Model(BaseModel):\n a: int = 1\n\n @root_validator(skip_on_failure=True)\n def root_validator_repeated(cls, values):\n return None\n\n with pytest.raises(\n TypeError,\n match=r\"(:?__dict__ must be set to a dictionary, not a 'NoneType')|(:?setting dictionary to a non-dict)\",\n ):\n Model()\n\n\ndef reusable_validator(num: int) -> int:\n return num * 2\n\n\ndef test_reuse_global_validators():\n class Model(BaseModel):\n x: int\n y: int\n\n double_x = field_validator('x', allow_reuse=True)(reusable_validator)\n double_y = field_validator('y', allow_reuse=True)(reusable_validator)\n\n assert dict(Model(x=1, y=1)) == {'x': 2, 'y': 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_pydantic__pydantic/tests/test_validators.py_declare_with_reused_validators_reset_tracked_validators._FUNCS_update_original_tr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_declare_with_reused_validators_reset_tracked_validators._FUNCS_update_original_tr", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1313, "end_line": 1342, "span_ids": ["reset_tracked_validators", "declare_with_reused_validators"], "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 declare_with_reused_validators(include_root, allow_1, allow_2, allow_3):\n class Model(BaseModel):\n a: str\n b: str\n\n @field_validator('a', allow_reuse=allow_1)\n @classmethod\n def duplicate_name(cls, v: Any):\n return v\n\n @field_validator('b', allow_reuse=allow_2)\n @classmethod\n def duplicate_name(cls, v: Any): # noqa F811\n return v\n\n if include_root:\n\n @root_validator(allow_reuse=allow_3, skip_on_failure=True)\n def duplicate_name(cls, values): # noqa F811\n return values\n\n\n@pytest.fixture\ndef reset_tracked_validators():\n from pydantic._internal._decorators import _FUNCS\n\n original_tracked_validators = set(_FUNCS)\n yield\n _FUNCS.clear()\n _FUNCS.update(original_tracked_validators)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_allow_reuse_test_allow_reuse.if_duplication_count_1_.else_.declare_with_reused_valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_allow_reuse_test_allow_reuse.if_duplication_count_1_.else_.declare_with_reused_valid", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1345, "end_line": 1352, "span_ids": ["test_allow_reuse"], "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": "@pytest.mark.parametrize('include_root,allow_1,allow_2,allow_3', product(*[[True, False]] * 4))\ndef test_allow_reuse(include_root, allow_1, allow_2, allow_3, reset_tracked_validators):\n duplication_count = int(not allow_1) + int(not allow_2) + int(include_root and not allow_3)\n if duplication_count > 1:\n with pytest.warns(UserWarning, match='duplicate validator function'):\n declare_with_reused_validators(include_root, allow_1, allow_2, allow_3)\n else:\n declare_with_reused_validators(include_root, allow_1, allow_2, allow_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_pydantic__pydantic/tests/test_validators.py_test_root_validator_classmethod_test_root_validator_classmethod.Model.example_root_validator.root_validator_skip_on_fa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_classmethod_test_root_validator_classmethod.Model.example_root_validator.root_validator_skip_on_fa", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1355, "end_line": 1378, "span_ids": ["test_root_validator_classmethod"], "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": "@pytest.mark.parametrize('validator_classmethod,root_validator_classmethod', product(*[[True, False]] * 2))\ndef test_root_validator_classmethod(validator_classmethod, root_validator_classmethod, reset_tracked_validators):\n root_val_values = []\n\n class Model(BaseModel):\n a: int = 1\n b: str\n\n def repeat_b(cls, v: Any):\n return v * 2\n\n if validator_classmethod:\n repeat_b = classmethod(repeat_b)\n repeat_b = field_validator('b')(repeat_b)\n\n def example_root_validator(cls, values):\n root_val_values.append(values)\n if 'snap' in values.get('b', ''):\n raise ValueError('foobar')\n return dict(values, b='changed')\n\n if root_validator_classmethod:\n example_root_validator = classmethod(example_root_validator)\n example_root_validator = root_validator(skip_on_failure=True)(example_root_validator)\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_classmethod.assert_Model_a_123_b__test_root_validator_classmethod.assert_root_val_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_classmethod.assert_Model_a_123_b__test_root_validator_classmethod.assert_root_val_values_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1380, "end_line": 1405, "span_ids": ["test_root_validator_classmethod"], "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": "@pytest.mark.parametrize('validator_classmethod,root_validator_classmethod', product(*[[True, False]] * 2))\ndef test_root_validator_classmethod(validator_classmethod, root_validator_classmethod, reset_tracked_validators):\n # ... other code\n\n assert Model(a='123', b='bar').model_dump() == {'a': 123, 'b': 'changed'}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(b='snap dragon')\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': (),\n 'msg': 'Value error, foobar',\n 'input': {'b': 'snap dragon'},\n 'ctx': {'error': 'foobar'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='broken', b='bar')\n assert exc_info.value.errors() == [\n {\n 'type': 'int_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'broken',\n }\n ]\n\n assert root_val_values == [{'a': 123, 'b': 'barbar'}, {'a': 1, 'b': 'snap dragonsnap dragon'}]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_assignment_validator_cls_test_literal_validator.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_assignment_validator_cls_test_literal_validator.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1408, "end_line": 1445, "span_ids": ["test_literal_validator", "test_assignment_validator_cls"], "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 test_assignment_validator_cls():\n validator_calls = 0\n\n class Model(BaseModel):\n name: str\n\n model_config = ConfigDict(validate_assignment=True)\n\n @field_validator('name')\n @classmethod\n def check_foo(cls, value):\n nonlocal validator_calls\n validator_calls += 1\n assert cls == Model\n return value\n\n m = Model(name='hello')\n m.name = 'goodbye'\n assert validator_calls == 2\n\n\ndef test_literal_validator():\n class Model(BaseModel):\n a: Literal['foo']\n\n Model(a='foo')\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='nope')\n assert exc_info.value.errors() == [\n {\n 'type': 'literal_error',\n 'loc': ('a',),\n 'msg': \"Input should be 'foo'\",\n 'input': 'nope',\n 'ctx': {'expected': \"'foo'\"},\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_pydantic__pydantic/tests/test_validators.py_test_literal_validator_str_enum_test_literal_validator_str_enum.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_literal_validator_str_enum_test_literal_validator_str_enum.None_5", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1448, "end_line": 1469, "span_ids": ["test_literal_validator_str_enum"], "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": "@pytest.mark.xfail(reason='working on V2 - enum validator bug https://github.com/pydantic/pydantic/issues/5242')\ndef test_literal_validator_str_enum():\n class Bar(str, Enum):\n FIZ = 'fiz'\n FUZ = 'fuz'\n\n class Foo(BaseModel):\n bar: Bar\n barfiz: Literal[Bar.FIZ]\n fizfuz: Literal[Bar.FIZ, Bar.FUZ]\n\n my_foo = Foo.model_validate({'bar': 'fiz', 'barfiz': 'fiz', 'fizfuz': 'fiz'})\n assert my_foo.bar is Bar.FIZ\n # TODO: this doesn't pass, `my_foo.barfiz == 'fiz'`\n # Is this an intentional behavior change?\n assert my_foo.barfiz is Bar.FIZ\n assert my_foo.fizfuz is Bar.FIZ\n\n my_foo = Foo.model_validate({'bar': 'fiz', 'barfiz': 'fiz', 'fizfuz': 'fuz'})\n assert my_foo.bar is Bar.FIZ\n assert my_foo.barfiz is Bar.FIZ\n assert my_foo.fizfuz is Bar.FUZ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_nested_literal_validator_test_union_literal_with_constraints.with_pytest_raises_TypeEr.m_x_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_nested_literal_validator_test_union_literal_with_constraints.with_pytest_raises_TypeEr.m_x_1", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1472, "end_line": 1504, "span_ids": ["test_union_literal_with_constraints", "test_nested_literal_validator"], "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 test_nested_literal_validator():\n L1 = Literal['foo']\n L2 = Literal['bar']\n\n class Model(BaseModel):\n a: Literal[L1, L2]\n\n Model(a='foo')\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='nope')\n assert exc_info.value.errors() == [\n {\n 'type': 'literal_error',\n 'loc': ('a',),\n 'msg': \"Input should be 'foo' or 'bar'\",\n 'input': 'nope',\n 'ctx': {'expected': \"'foo' or 'bar'\"},\n }\n ]\n\n\n# TODO: this test fails because our union schema\n# doesn't accept `frozen` as an argument\n# Do we need to add `frozen` to every schema?\n@pytest.mark.xfail(reason='frozen field')\ndef test_union_literal_with_constraints():\n class Model(BaseModel, validate_assignment=True):\n x: Union[Literal[42], Literal['pika']] = Field(frozen=True)\n\n m = Model(x=42)\n with pytest.raises(TypeError):\n m.x += 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_pydantic__pydantic/tests/test_validators.py_test_field_that_is_being_validated_is_excluded_from_validator_values_test_field_that_is_being_validated_is_excluded_from_validator_values.Model.validate_bar.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_that_is_being_validated_is_excluded_from_validator_values_test_field_that_is_being_validated_is_excluded_from_validator_values.Model.validate_bar.return.v", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1507, "end_line": 1527, "span_ids": ["test_field_that_is_being_validated_is_excluded_from_validator_values"], "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 test_field_that_is_being_validated_is_excluded_from_validator_values():\n check_values = MagicMock()\n\n class Model(BaseModel):\n foo: str\n bar: str = Field(alias='pika')\n baz: str\n\n model_config = ConfigDict(validate_assignment=True)\n\n @field_validator('foo')\n @classmethod\n def validate_foo(cls, v: Any, info: FieldValidationInfo) -> Any:\n check_values({**info.data})\n return v\n\n @field_validator('bar')\n @classmethod\n def validate_bar(cls, v: Any, info: FieldValidationInfo) -> Any:\n check_values({**info.data})\n return v\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_pydantic__pydantic/tests/test_validators.py_test_field_that_is_being_validated_is_excluded_from_validator_values.model_test_exceptions_in_field_validators_restore_original_field_value.assert_model_foo_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_field_that_is_being_validated_is_excluded_from_validator_values.model_test_exceptions_in_field_validators_restore_original_field_value.assert_model_foo_foo_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1529, "end_line": 1561, "span_ids": ["test_field_that_is_being_validated_is_excluded_from_validator_values", "test_exceptions_in_field_validators_restore_original_field_value"], "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 test_field_that_is_being_validated_is_excluded_from_validator_values():\n # ... other code\n\n model = Model(foo='foo_value', pika='bar_value', baz='baz_value')\n check_values.reset_mock()\n\n assert list(dict(model).items()) == [('foo', 'foo_value'), ('bar', 'bar_value'), ('baz', 'baz_value')]\n\n model.foo = 'new_foo_value'\n check_values.assert_called_once_with({'bar': 'bar_value', 'baz': 'baz_value'})\n check_values.reset_mock()\n\n model.bar = 'new_bar_value'\n check_values.assert_called_once_with({'foo': 'new_foo_value', 'baz': 'baz_value'})\n\n # ensure field order is the same\n assert list(dict(model).items()) == [('foo', 'new_foo_value'), ('bar', 'new_bar_value'), ('baz', 'baz_value')]\n\n\ndef test_exceptions_in_field_validators_restore_original_field_value():\n class Model(BaseModel):\n foo: str\n\n model_config = ConfigDict(validate_assignment=True)\n\n @field_validator('foo')\n @classmethod\n def validate_foo(cls, v: Any):\n if v == 'raise_exception':\n raise RuntimeError('test error')\n return v\n\n model = Model(foo='foo')\n with pytest.raises(RuntimeError, match='test error'):\n model.foo = 'raise_exception'\n assert model.foo == '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_pydantic__pydantic/tests/test_validators.py_test_overridden_root_validators_test_overridden_root_validators.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_overridden_root_validators_test_overridden_root_validators.None_1", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1564, "end_line": 1597, "span_ids": ["test_overridden_root_validators"], "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": "def test_overridden_root_validators():\n validate_stub = MagicMock()\n\n class A(BaseModel):\n x: str\n\n @root_validator(pre=True)\n def pre_root(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n validate_stub('A', 'pre')\n return values\n\n @root_validator(pre=False, skip_on_failure=True)\n def post_root(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n validate_stub('A', 'post')\n return values\n\n class B(A):\n @root_validator(pre=True)\n def pre_root(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n validate_stub('B', 'pre')\n return values\n\n @root_validator(pre=False, skip_on_failure=True)\n def post_root(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n validate_stub('B', 'post')\n return values\n\n A(x='pika')\n assert validate_stub.call_args_list == [[('A', 'pre'), {}], [('A', 'post'), {}]]\n\n validate_stub.reset_mock()\n\n B(x='pika')\n assert validate_stub.call_args_list == [[('B', 'pre'), {}], [('B', 'post'), {}]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_pre_root_validator_fail_test_validating_assignment_pre_root_validator_fail.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_pre_root_validator_fail_test_validating_assignment_pre_root_validator_fail.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1600, "end_line": 1624, "span_ids": ["test_validating_assignment_pre_root_validator_fail"], "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 test_validating_assignment_pre_root_validator_fail():\n class Model(BaseModel):\n current_value: float = Field(..., alias='current')\n max_value: float\n\n model_config = ConfigDict(validate_assignment=True)\n\n @root_validator(pre=True)\n def values_are_not_string(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n if any(isinstance(x, str) for x in values.values()):\n raise ValueError('values cannot be a string')\n return values\n\n m = Model(current=100, max_value=200)\n with pytest.raises(ValidationError) as exc_info:\n m.current_value = '100'\n assert exc_info.value.errors() == [\n {\n 'type': 'value_error',\n 'loc': (),\n 'msg': 'Value error, values cannot be a string',\n 'input': {'current_value': '100', 'max_value': 200.0},\n 'ctx': {'error': 'values cannot be a string'},\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_skip_on_failure_invalid_test_root_validator_skip_on_failure_invalid.with_pytest_raises_TypeEr.Model.root_val.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_skip_on_failure_invalid_test_root_validator_skip_on_failure_invalid.with_pytest_raises_TypeEr.Model.root_val.return.values", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1627, "end_line": 1641, "span_ids": ["test_root_validator_skip_on_failure_invalid"], "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": "@pytest.mark.parametrize(\n 'kwargs',\n [\n {'skip_on_failure': False},\n {'skip_on_failure': False, 'pre': False},\n {'pre': False},\n ],\n)\ndef test_root_validator_skip_on_failure_invalid(kwargs: Dict[str, Any]):\n with pytest.raises(TypeError, match='MUST specify `skip_on_failure=True`'):\n\n class Model(BaseModel):\n @root_validator(**kwargs)\n def root_val(cls, values: Dict[str, Any]) -> Dict[str, Any]:\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_skip_on_failure_valid_test_root_validator_skip_on_failure_valid.Model.root_val.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_skip_on_failure_valid_test_root_validator_skip_on_failure_valid.Model.root_val.return.values", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1644, "end_line": 1657, "span_ids": ["test_root_validator_skip_on_failure_valid"], "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": "@pytest.mark.parametrize(\n 'kwargs',\n [\n {'skip_on_failure': True},\n {'skip_on_failure': True, 'pre': False},\n {'skip_on_failure': False, 'pre': True},\n {'pre': True},\n ],\n)\ndef test_root_validator_skip_on_failure_valid(kwargs: Dict[str, Any]):\n class Model(BaseModel):\n @root_validator(**kwargs, allow_reuse=True)\n def root_val(cls, values: Dict[str, Any]) -> Dict[str, Any]:\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_pydantic__pydantic/tests/test_validators.py_test_root_validator_many_values_change__get_source_line.with_open_filename_as_f_.return.f_readline_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_many_values_change__get_source_line.with_open_filename_as_f_.return.f_readline_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1660, "end_line": 1688, "span_ids": ["_get_source_line", "impl", "test_root_validator_many_values_change"], "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 test_root_validator_many_values_change():\n \"\"\"It should run root_validator on assignment and update ALL concerned fields\"\"\"\n\n class Rectangle(BaseModel):\n width: float\n height: float\n area: Optional[float] = None\n\n model_config = ConfigDict(validate_assignment=True)\n\n @root_validator(skip_on_failure=True, allow_reuse=True)\n def set_area(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n values['area'] = values['width'] * values['height']\n return values\n\n r = Rectangle(width=1, height=1)\n assert r.area == 1\n r.height = 5\n assert r.area == 5\n\n\nV1_VALIDATOR_DEPRECATION_MATCH = r'Pydantic V1 style `@validator` validators are deprecated'\n\n\ndef _get_source_line(filename: str, lineno: int) -> str:\n with open(filename) as f:\n for _ in range(lineno - 1):\n f.readline()\n return f.readline()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_deprecated_test_v1_validator_deprecated.assert_check_x_in_sourc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_deprecated_test_v1_validator_deprecated.assert_check_x_in_sourc", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1691, "end_line": 1715, "span_ids": ["test_v1_validator_deprecated"], "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 test_v1_validator_deprecated():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH) as w:\n\n class Point(BaseModel):\n y: int\n x: int\n\n @validator('x')\n @classmethod\n def check_x(cls, x: int, values: Dict[str, Any]) -> int:\n assert x * 2 == values['y']\n return x\n\n assert Point(x=1, y=2).model_dump() == {'x': 1, 'y': 2}\n\n warnings = w.list\n assert len(warnings) == 1\n w = warnings[0]\n # check that we got stacklevel correct\n # if this fails you need to edit the stacklevel\n # parameter to warnings.warn in _decorators.py\n assert w.filename == __file__\n source = _get_source_line(w.filename, w.lineno)\n # the reported location varies slightly from 3.7 to 3.11\n assert 'check_x' in source or \"@validator('x')\" in 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_pydantic__pydantic/tests/test_validators.py_test_info_field_name_data_before_test_info_field_name_data_before.assert_Model_a_b_your_foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_info_field_name_data_before_test_info_field_name_data_before.assert_Model_a_b_your_foo", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1718, "end_line": 1737, "span_ids": ["test_info_field_name_data_before"], "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 test_info_field_name_data_before():\n \"\"\"\n Test accessing info.field_name and info.data\n We only test the `before` validator because they\n all share the same implementation.\n \"\"\"\n\n class Model(BaseModel):\n a: str\n b: str\n\n @field_validator('b', mode='before')\n @classmethod\n def check_a(cls, v: Any, info: FieldValidationInfo) -> Any:\n assert v == b'but my barbaz is better'\n assert info.field_name == 'b'\n assert info.data == {'a': 'your foobar is good'}\n return 'just kidding!'\n\n assert Model(a=b'your foobar is good', b=b'but my barbaz is better').b == 'just kidding!'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_decorator_proxy_test_decorator_proxy.assert_Model_val3_1_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_decorator_proxy_test_decorator_proxy.assert_Model_val3_1_2", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1740, "end_line": 1766, "span_ids": ["test_decorator_proxy"], "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 test_decorator_proxy():\n \"\"\"\n Test that our validator decorator allows\n calling the wrapped methods/functions.\n \"\"\"\n\n def val(v: int) -> int:\n return v + 1\n\n class Model(BaseModel):\n x: int\n\n @field_validator('x')\n @staticmethod\n def val1(v: int) -> int:\n return v + 1\n\n @field_validator('x')\n @classmethod\n def val2(cls, v: int) -> int:\n return v + 1\n\n val3 = field_validator('x')(val)\n\n assert Model.val1(1) == 2\n assert Model.val2(1) == 2\n assert Model.val3(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_pydantic__pydantic/tests/test_validators.py_test_root_validator_self_test_v1_validator_signature_kwargs_not_allowed.with_pytest_warns_Depreca.with_pytest_raises_TypeEr.Model.check_a._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_self_test_v1_validator_signature_kwargs_not_allowed.with_pytest_warns_Depreca.with_pytest_raises_TypeEr.Model.check_a._", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1769, "end_line": 1812, "span_ids": ["test_v1_validator_signature_kwargs_not_allowed", "test_field_validator_self", "test_validator_self", "test_root_validator_self"], "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 test_root_validator_self():\n with pytest.raises(TypeError, match=r'`@root_validator` cannot be applied to instance methods'):\n\n class Model(BaseModel):\n a: int = 1\n\n @root_validator(skip_on_failure=True)\n def root_validator(self, values: Any) -> Any:\n return values\n\n\ndef test_validator_self():\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n with pytest.raises(TypeError, match=r'`@validator` cannot be applied to instance methods'):\n\n class Model(BaseModel):\n a: int = 1\n\n @validator('a')\n def check_a(self, values: Any) -> Any:\n return values\n\n\ndef test_field_validator_self():\n with pytest.raises(TypeError, match=r'`@field_validator` cannot be applied to instance methods'):\n\n class Model(BaseModel):\n a: int = 1\n\n @field_validator('a')\n def check_a(self, values: Any) -> Any:\n return values\n\n\ndef test_v1_validator_signature_kwargs_not_allowed() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n with pytest.raises(TypeError, match=r'Unsupported signature for V1 style validator'):\n\n class Model(BaseModel):\n a: int\n\n @validator('a')\n def check_a(cls, value: Any, foo: Any) -> 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_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_kwargs1_test_v1_validator_signature_kwargs1.assert_Model_a_1_b_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_kwargs1_test_v1_validator_signature_kwargs1.assert_Model_a_1_b_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1815, "end_line": 1828, "span_ids": ["test_v1_validator_signature_kwargs1"], "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 test_v1_validator_signature_kwargs1() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n a: int\n b: int\n\n @validator('b')\n def check_b(cls, value: Any, **kwargs: Any) -> Any:\n assert kwargs == {'values': {'a': 1}}\n assert value == 2\n return value + 1\n\n assert Model(a=1, b=2).model_dump() == {'a': 1, '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_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_kwargs2_test_v1_validator_signature_kwargs2.assert_Model_a_1_b_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_kwargs2_test_v1_validator_signature_kwargs2.assert_Model_a_1_b_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1831, "end_line": 1845, "span_ids": ["test_v1_validator_signature_kwargs2"], "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 test_v1_validator_signature_kwargs2() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n a: int\n b: int\n\n @validator('b')\n def check_b(cls, value: Any, values: Dict[str, Any], **kwargs: Any) -> Any:\n assert kwargs == {}\n assert values == {'a': 1}\n assert value == 2\n return value + 1\n\n assert Model(a=1, b=2).model_dump() == {'a': 1, '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_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_values_test_v1_validator_signature_with_values.assert_Model_a_1_b_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_values_test_v1_validator_signature_with_values.assert_Model_a_1_b_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1848, "end_line": 1861, "span_ids": ["test_v1_validator_signature_with_values"], "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 test_v1_validator_signature_with_values() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n a: int\n b: int\n\n @validator('b')\n def check_b(cls, value: Any, values: Dict[str, Any]) -> Any:\n assert values == {'a': 1}\n assert value == 2\n return value + 1\n\n assert Model(a=1, b=2).model_dump() == {'a': 1, '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_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_values_kw_only_test_v1_validator_signature_with_values_kw_only.assert_Model_a_1_b_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_values_kw_only_test_v1_validator_signature_with_values_kw_only.assert_Model_a_1_b_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1864, "end_line": 1877, "span_ids": ["test_v1_validator_signature_with_values_kw_only"], "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 test_v1_validator_signature_with_values_kw_only() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n a: int\n b: int\n\n @validator('b')\n def check_b(cls, value: Any, *, values: Dict[str, Any]) -> Any:\n assert values == {'a': 1}\n assert value == 2\n return value + 1\n\n assert Model(a=1, b=2).model_dump() == {'a': 1, '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_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_field_test_v1_validator_signature_with_config.with_pytest_warns_Depreca.with_pytest_raises_TypeEr.Model.check_b._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_v1_validator_signature_with_field_test_v1_validator_signature_with_config.with_pytest_warns_Depreca.with_pytest_raises_TypeEr.Model.check_b._", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1880, "end_line": 1903, "span_ids": ["test_v1_validator_signature_with_config", "test_v1_validator_signature_with_field"], "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 test_v1_validator_signature_with_field() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n with pytest.raises(TypeError, match=r'The `field` and `config` parameters are not available in Pydantic V2'):\n\n class Model(BaseModel):\n a: int\n b: int\n\n @validator('b')\n def check_b(cls, value: Any, field: Any) -> Any:\n ...\n\n\ndef test_v1_validator_signature_with_config() -> None:\n with pytest.warns(DeprecationWarning, match=V1_VALIDATOR_DEPRECATION_MATCH):\n with pytest.raises(TypeError, match=r'The `field` and `config` parameters are not available in Pydantic V2'):\n\n class Model(BaseModel):\n a: int\n b: int\n\n @validator('b')\n def check_b(cls, value: Any, config: Any) -> 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_pydantic__pydantic/tests/test_validators.py_test_model_config_validate_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_model_config_validate_default_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1906, "end_line": 1932, "span_ids": ["test_model_config_validate_default"], "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 test_model_config_validate_default():\n class Model(BaseModel):\n x: int = -1\n\n @field_validator('x')\n @classmethod\n def force_x_positive(cls, v):\n assert v > 0\n return v\n\n assert Model().x == -1\n\n class ValidatingModel(Model):\n model_config = ConfigDict(validate_default=True)\n\n with pytest.raises(ValidationError) as exc_info:\n ValidatingModel()\n assert exc_info.value.errors() == [\n {\n 'ctx': {'error': 'assert -1 > 0'},\n 'input': -1,\n 'loc': ('x',),\n 'msg': 'Assertion failed, assert -1 > 0',\n 'type': 'assertion_error',\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_pydantic__pydantic/tests/test_validators_dataclass.py_re_test_simple.assert_MyDataclass_a_thi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_re_test_simple.assert_MyDataclass_a_thi", "embedding": null, "metadata": {"file_path": "tests/test_validators_dataclass.py", "file_name": "test_validators_dataclass.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "test_simple"], "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": "import re\nfrom dataclasses import asdict, is_dataclass\nfrom typing import Any, List\n\nimport pytest\nfrom dirty_equals import HasRepr, IsStr\n\nfrom pydantic import ValidationError, root_validator\nfrom pydantic.dataclasses import dataclass\nfrom pydantic.decorators import field_validator\n\n\ndef test_simple():\n @dataclass\n class MyDataclass:\n a: str\n\n @field_validator('a')\n @classmethod\n def change_a(cls, v):\n return v + ' changed'\n\n assert MyDataclass(a='this is foobar good').a == 'this is foobar good 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_pydantic__pydantic/tests/test_validators_dataclass.py_test_validate_before_test_validate_before.assert_MyDataclass_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_validate_before_test_validate_before.assert_MyDataclass_a_1_", "embedding": null, "metadata": {"file_path": "tests/test_validators_dataclass.py", "file_name": "test_validators_dataclass.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 43, "span_ids": ["test_validate_before"], "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 test_validate_before():\n @dataclass\n class MyDataclass:\n a: List[int]\n\n @field_validator('a', mode='before')\n @classmethod\n def check_a1(cls, v: List[Any]) -> List[Any]:\n v.append('123')\n return v\n\n @field_validator('a')\n @classmethod\n def check_a2(cls, v: List[int]) -> List[int]:\n v.append(456)\n return v\n\n assert MyDataclass(a=[1, 2]).a == [1, 2, 123, 456]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_validate_multiple_test_validate_multiple.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_validate_multiple_test_validate_multiple.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validators_dataclass.py", "file_name": "test_validators_dataclass.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 78, "span_ids": ["test_validate_multiple"], "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 test_validate_multiple():\n @dataclass\n class MyDataclass:\n a: str\n b: str\n\n @field_validator('a', 'b')\n @classmethod\n def check_a_and_b(cls, v, info):\n if len(v) < 4:\n raise ValueError(f'{info.field_name} is too short')\n return v + 'x'\n\n assert asdict(MyDataclass(a='1234', b='5678')) == {'a': '1234x', 'b': '5678x'}\n\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(a='x', b='x')\n assert exc_info.value.errors() == [\n {\n 'ctx': {'error': 'a is too short'},\n 'input': 'x',\n 'loc': ('a',),\n 'msg': 'Value error, a is too short',\n 'type': 'value_error',\n },\n {\n 'ctx': {'error': 'b is too short'},\n 'input': 'x',\n 'loc': ('b',),\n 'msg': 'Value error, b is too short',\n 'type': 'value_error',\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_pydantic__pydantic/tests/test_validators_dataclass.py_test_type_error_test_type_error.with_pytest_raises_TypeEr.MyDataclass_a_x_b_x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_type_error_test_type_error.with_pytest_raises_TypeEr.MyDataclass_a_x_b_x_", "embedding": null, "metadata": {"file_path": "tests/test_validators_dataclass.py", "file_name": "test_validators_dataclass.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 97, "span_ids": ["test_type_error"], "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 test_type_error():\n @dataclass\n class MyDataclass:\n a: str\n b: str\n\n @field_validator('a', 'b')\n @classmethod\n def check_a_and_b(cls, v, info):\n if len(v) < 4:\n raise TypeError(f'{info.field_name} is too short')\n return v + 'x'\n\n assert asdict(MyDataclass(a='1234', b='5678')) == {'a': '1234x', 'b': '5678x'}\n\n with pytest.raises(TypeError, match='a is too short'):\n MyDataclass(a='x', b='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_pydantic__pydantic/tests/test_validators_dataclass.py_test_classmethod_test_inheritance_replace.assert_Child_a_0_a_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_classmethod_test_inheritance_replace.assert_Child_a_0_a_5", "embedding": null, "metadata": {"file_path": "tests/test_validators_dataclass.py", "file_name": "test_validators_dataclass.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 151, "span_ids": ["test_inheritance_replace", "test_classmethod", "test_validate_parent"], "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 test_classmethod():\n @dataclass\n class MyDataclass:\n a: str\n\n @field_validator('a')\n @classmethod\n def check_a(cls, v):\n assert cls is MyDataclass and is_dataclass(MyDataclass)\n return v\n\n m = MyDataclass(a='this is foobar good')\n assert m.a == 'this is foobar good'\n m.check_a('x')\n\n\ndef test_validate_parent():\n @dataclass\n class Parent:\n a: str\n\n @field_validator('a')\n @classmethod\n def change_a(cls, v):\n return v + ' changed'\n\n @dataclass\n class Child(Parent):\n pass\n\n assert Parent(a='this is foobar good').a == 'this is foobar good changed'\n assert Child(a='this is foobar good').a == 'this is foobar good changed'\n\n\ndef test_inheritance_replace():\n @dataclass\n class Parent:\n a: int\n\n @field_validator('a')\n @classmethod\n def add_to_a(cls, v):\n return v + 1\n\n @dataclass\n class Child(Parent):\n @field_validator('a')\n @classmethod\n def add_to_a(cls, v):\n return v + 5\n\n assert Child(a=0).a == 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_pydantic__pydantic/tests/test_validators_dataclass.py_test_root_validator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_root_validator_", "embedding": null, "metadata": {"file_path": "tests/test_validators_dataclass.py", "file_name": "test_validators_dataclass.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 189, "span_ids": ["test_root_validator"], "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 test_root_validator():\n root_val_values = []\n\n @dataclass\n class MyDataclass:\n a: int\n b: str\n\n @field_validator('b')\n @classmethod\n def repeat_b(cls, v):\n return v * 2\n\n @root_validator(skip_on_failure=True)\n def root_validator(cls, values):\n root_val_values.append(values)\n if 'snap' in values.get('b', ''):\n raise ValueError('foobar')\n return dict(values, b='changed')\n\n assert asdict(MyDataclass(a='123', b='bar')) == {'a': 123, 'b': 'changed'}\n\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(1, b='snap dragon')\n assert root_val_values == [{'a': 123, 'b': 'barbar'}, {'a': 1, 'b': 'snap dragonsnap dragon'}]\n\n assert exc_info.value.errors() == [\n {\n 'ctx': {'error': 'foobar'},\n 'input': HasRepr(IsStr(regex=re.escape(\"ArgsKwargs(args=(1,), kwargs={'b': 'snap dragon'})\"))),\n 'loc': (),\n 'msg': 'Value error, foobar',\n 'type': 'value_error',\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_pydantic__pydantic/tests/test_version.py_re_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_version.py_re_", "embedding": null, "metadata": {"file_path": "tests/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["test_version_attribute_is_present", "imports", "test_version_info", "test_standard_version", "test_version_attribute_is_a_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": "import re\n\nfrom packaging.version import parse as parse_version\n\nimport pydantic\nfrom pydantic.version import version_info\n\n\ndef test_version_info():\n s = version_info()\n assert re.match(' *pydantic version: ', s)\n assert s.count('\\n') == 4\n\n\ndef test_standard_version():\n v = parse_version(pydantic.VERSION)\n assert str(v) == pydantic.VERSION\n\n\ndef test_version_attribute_is_present():\n assert hasattr(pydantic, '__version__')\n\n\ndef test_version_attribute_is_a_string():\n assert isinstance(pydantic.__version__, 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"}}} \ No newline at end of file