diff --git "a/pydantic__pydantic-8977/docstore.json" "b/pydantic__pydantic-8977/docstore.json" new file mode 100644--- /dev/null +++ "b/pydantic__pydantic-8977/docstore.json" @@ -0,0 +1 @@ +{"docstore/metadata": {"/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": "fce589878a4f78abca5eb8f01f2d2122270665b5ca0a245a4a0f7c11f4279674"}, "/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": "b83a8b6dd15cd5ffad3421be3d899236f93743f63cfec0b7249c3b6477256a51"}, "/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/pydantic/_internal/_core_utils.py_get_type_ref_get_type_ref.return.type_ref": {"doc_hash": "14194ec67a91d2e86b0780a2c3ff97b233cc68b5b029f8df97c1b74265669a76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_is_builtin_dataclass_": {"doc_hash": "c0c861d30d2c4d99db00f1ce0e127c5289b420c9d95febee241f5c0fe8fe45f9"}, "/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": "656c6305f6cb667fe688a1e1eada8d9c2df67db9e92285be444fd7ed73191488"}, "/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": "9565396723d7eaab7383ef44eb54fe7e452d9b36d7c11a8673eb77e6b7d01fb9"}, "/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": "df7fc8a8a80277cee3352b2c6f63745150e6ba0c93130b9a3af73e468477245c"}, "/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": "128d7aec0153dc99ecf9defb53f9e7e03c7641fe7e40ce11aedbf1c691159bcc"}, "/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": "c0a20064ae1747e431a2edd67247e507f76d1c7b2b426360badb2238ee5c93fa"}, "/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": "d1c308eae6044f1e33ad977a13012c68d4cc695145717765ef39b6eb8416dc5d"}, "/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": "df72d22bff854c4bdc5afb9dfcb9d0898b687c0a4e9f0b68d3266821be3dca35"}, "/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": "6531933ba54f7bc7de8d1897b99ad341f09c33f44c222292d042014d42d47658"}, "/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": "bdee3c801f5fe048bb50a1a7917feed413f02e0e1116ae92d9e0eb2173dd8883"}, "/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": "4b15fce21b0717ea41d551396b75f1efc3cc46f2abadae877bf30de4c81088b2"}, "/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": "99bdb517cf78477508ce78157cf02ecab85298ba506968d27b30994767bf1de9"}, "/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": "5126a2a0121b72baef69ae4b0cf05845f3275523e3227b6925b7070d038c573d"}, "/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": "8bd56642d6e65352ab3c7add363789bd67be65851476aa296962605f3d4f2983"}, "/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": "991628f150327ff1730b724ace1e3e6b68491d472ce8991ffb3798b10844a983"}, "/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": "a7738851e4a84c417761472ad8790d38aaae9e8d243ecbbba44b1db7cfcf0a28"}, "/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": "664d31ac26087e16f8e11c7eefe8d4aa959cc0542f016d22236e36906d585b5b"}, "/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": "a1149770c4fa4acc4d8113f629230f17c55af6a2cf4c0ff23139b0cf50fc4b50"}, "/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": "3f8f6dc11af7174ad2493e5772c1b3614fcba5a6f6cd5e5a43ab3541886b9162"}, "/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": "4585ee5f28cbb7635efd5e5bf120c6bff76cedd746362ee718ac4c57a52c40ab"}, "/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": "21918bfce30cbdc1cc26ed58bf029628d9ae5a8b926b98c65fa98878290a9278"}, "/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": "d95c797aa1860f48b75a9f23120649e30775ac53332cb2f7dc4568f4cbfc3e36"}, "/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": "c13f6c4a0a9be4098ba80cd9bd2c910e74467946479a5d98804561ec73005875"}, "/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": "b9649152d7c87e4caaf9f1107264f6cbc1dfbfef56e75a9cf5e00939b4497f32"}, "/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": "9cab9b814819ae315dc8e871198799b94d9592bbb50f3e14a3c22389e8fe4b0c"}, "/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": "75f27e396a77207725a51fad82bb3fb69ffaf34338be49f2a450d7f91a6256dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__late_cache_key_": {"doc_hash": "422c43e15567a8fb859ac487fb24bfd46007e9f2c8b8c29222b91c05a35ace50"}, "/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": "ae9cb0fe9e6f8fb519419e984cdf2559206fd850293e3a49315e3cb5d183a1ee"}, "/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": "518672c0e3c68fce74390d93eaf348b14229ae9947e2262058db67c544db2764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_display_as_type_": {"doc_hash": "edbe35e8b45a591543afd184319069075051a5ad2ac47a5cc66f5f78c7ad483b"}, "/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": "84930561a5a1dc541cdcc0ad6203ecb21debcbbf1bce75f3919beb377245cbfc"}, "/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": "1396c96e7044a02c6c4f9bae60c9fdfab125c3f519cf33a6cd0111309b7f1c7f"}, "/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": "7be0d18eda573f21188b6a472c38ae2ed1f86dcc65f39ecfcf1847c469e93219"}, "/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": "3b322025348d02e9a45ce9a4e3443642d2ebb75be8d950926ed5c26e9df367b5"}, "/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": "f28ccbedf25f1c2048aa1d22a7c5913478b70bfa153c1ea76c8ef61274277667"}, "/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": "9d316277364a6cf6efbb5ac946ee531c2726f205f5ee2fad21931aacc6f4fda9"}, "/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": "278b4416176c534e11f296b4422859e54f9c51d44a30f70323fec5e0c6676999"}, "/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": "a22a08d5613b3d43299792ed257831c2529cd40d612b50651d97070e15ca71f5"}, "/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": "b9f32abd01a5dc37428ba2efe8989311f9c6a6e7892bdd0ed14875a442a67cb7"}, "/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": "303bde3c0964df111a1b2b05a2760addbeb42e766e079dafa93d7d5a945aa88b"}, "/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": "005ff0a13e7ab134eb654ce08b025d428fe39d6dfdeb2c3414af3912bdb3e328"}, "/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": "77d3f7562c31e3bc2207922dc7d9512e349c42e01c4a7ca04e5e729944d9ea76"}, "/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": "c200855722e83d0877831b7553352b7d61bd5bd3573bec62641042b48f1f3b52"}, "/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": "1210a64f1a0f1dd4ffab716f034e3d5c383e22c85b29cb7af8f4de66885c463a"}, "/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": "3dc74a51a431b64fce748fbf01d5775c60f1c242e956976ba6962ee2a640edd4"}, "/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": "779be27260fcf2ddf6e64b8cc357fdabcb5957bac86d12acdbd69a2c5de190a0"}, "/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": "14bd18bd9b63b87ecee726b5b7c22784e258e3d42326a073245f73209f06b3fd"}, "/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": "4342db265b4e4992f171898bc8b29c3de9fb87a76bec539359613d0ca23fef20"}, "/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": "2789337998f4cbbc09bd6bf0f0a0286e82bdd519486824eddf177e2682b17b42"}, "/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": "50328f8068f39894888339a93051f7da1fe52ecee1bba72b74150cfe50dc6522"}, "/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": "e831452273ee09f444282285a5fcbfc946b56b1e04400536a6aeeed43da6d16e"}, "/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": "046993fb6419d0008a7fc5bca11dea517e918a3c8d151663d713f30a173bde19"}, "/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": "c1b1a456e349be4a6260340142d5a7942ae4f14d0373547daf57fe57c5eafed8"}, "/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": "954922d0e8794f3024ba98a20d93347b5dbab70f6f322578d7189f65793a2072"}, "/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": "4814ec437f2c8588dc4298a56956da40bcccb1c0d3d35b58877547ac87c39ba6"}, "/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": "2284eb748eb532e8aa5f73fa282b9d61fe5cf0fe16e4a3ef920a01507f837e1c"}, "/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": "923a286d9b0bc0a4990a8b461a8f440186432057d9873678f562d3b8dfc6106f"}, "/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": "73c56ae090ff7dfd5c3bfbb94be489c639f1e32253c22bb7bb3cb3f6722b48ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/copy_internals.py__calculate_keys_": {"doc_hash": "c74a93de9f65825f3c32d342634749b93fd23278d289f79cb15f5fa6782bac2f"}, "/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": "dd57ac0ed874faecafb53af3f5efc7768f0851bccc41a353d90ddcb25e038beb"}, "/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": "cc59acd0e0f0c507f7a3817b40b6d5bf8cb405fd7b7bca733979c30a3d5d1473"}, "/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": "9952ae5bd493b137a14894be2e54533e433aaa9385ded3dd5ba84d87e08dae28"}, "/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": "37b1eb4bd408795bc5028829a5f11ba71aa67a0551fb4d9d0de908f4fe5f23f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_load_file_": {"doc_hash": "5e4de682fea58c002d64880bc79f18b77fd6541066e274f7f70006601217054e"}, "/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": "748ac937bb7f3d745a50283ff4fd1ee9496d9b43c44fa1a63bfa9d1cc7c8643d"}, "/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": "70ca40c9eec45b819be9190b1f90c2bf5500e3aa1b87bef8f1df403991bd36a4"}, "/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": "6ffc68b98d74feec7bfcb38eae7adf6eb900d57a64de133d37730f95ae9389a4"}, "/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": "9af9d3128ed0fe3f89d373c48024a90236099154cd76a62312e95eedddc45aa2"}, "/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": "1ef834d044c6024adcee3f7a0ddb7ae7820c202041d46dd23f879af796dbac14"}, "/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": "91d7a59e75346e5e2ef6790e91d43b13f0deb35ab65f6ca1e328d2f4741ce521"}, "/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": "b101a88f3c06ae134293dc97d89a6b9caa907b04ed7b89085efbd57d6822cc91"}, "/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": "78b5b18b67089783e61a214249924087854cc7423c42cda8cbdaa86d1dadbe54"}, "/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": "2d4a4662041600947048bd602ea925f9d0ab61bf61d3c39bace49fb9c2a2a49a"}, "/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": "6f6ff70e04800c3339191b2965ff0be60168f8ba38eb7a8da5d8f78599dcd10f"}, "/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": "bc01123e962a919539f8c280897f32f1696f603ab0289368a1f0753440ce9538"}, "/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": "755b32d4f4a39dd03aedfc78a59a7ff349a7944fbd06cfd06f868cf1ff826661"}, "/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": "0309f206fb4870b172690851d02ac9aa8914eb9c1e832f9de88d348e7ed5781f"}, "/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": "f5ae2682ae7cadd64ea286b5fcef8d5309a16341b5d7d3ab3a44765cfbef5888"}, "/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": "f042dfa27b39dcc9312b9e20da0c131854c798e59f9a040e99d4c234423f5e86"}, "/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": "93f5dc6f4c6847c440423f6f93ee778db40b7afc0a7c952ecd04a1599649b99d"}, "/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": "e1f70887e9e7a559bb8c62bd9d5dfbca18104ed9216f1720591b992e5a0b6798"}, "/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": "3ca36decfb686128f714b25a0f38aa0bdd3c5936576f267ee185bc3346c58df7"}, "/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": "35cae2e80e3d8cbdff3c1ef7a44e7e3ae6c6703e0c2c1ebb4982c6659635717b"}, "/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": "55b7af200ceae70a636681866d0c98eb7868a9f0609363c706c1f7455501a863"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_parse_toml_": {"doc_hash": "c488d07016eec1923d4d44576bc27e9fb4731e22411cb5d2cbd846b3f065d487"}, "/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": "129fcc875feb26b02d3d38d576942b8c2878964fba64b9465a0db575fdd696f5"}, "/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": "48f66befd14604d9973acf1417a675559ae3fc6f389aeb5bc6971cd3c2562748"}, "/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": "6592eb9a588f1efd08b7515cf2090d57cde1a3dcaed01c002cab888237d03742"}, "/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": "b0cce0564d9d624e34cec140db7b0c0e72fc102e64b424fde53a928a4203e7e6"}, "/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": "6288d7bfe17e4246790e0c9d0bf1b2aa05508519bc7dd0d5e1dd2363c00dc74e"}, "/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": "927b2a069fb308b5dba736d822a465825146a2810a6b3a549b27d20a40b424a2"}, "/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": "00b066ca6a7ccc566cfe6264d3f7f96ca3e4aae2272863f226f1253a1779e313"}, "/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": "58c4845289d88a73178f28fbd9ba444857c685db50bddc012e941e9fab52281b"}, "/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/success.py___Flags.__str__.return.f_flag_self_strict_bool_": {"doc_hash": "6fd2e3304a956792bad3d6adaa2291d52bf29491f42b1b63c13106d7073c9153"}, "/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": "08539d9e88845f2048981d9bc5544fd0c3e28a5c9e1b42865c212909813b78d2"}, "/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": "54e70f77409ad7326a009469f4c10c4a310f9df18fd6a4e07ac0c54324aba27a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/success.py_validated_": {"doc_hash": "61a8aab72e45ef25983bef4916b8bf73f50de8753b8fe86aca03954d4124d953"}, "/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/pyright/pyright_example.py___": {"doc_hash": "774423e763f639eb735b565582f08d2fb0bd39c7b8ff9c96e1322ace2d19de3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_abc.py_abc_": {"doc_hash": "aa7d31bd3394e3d4cdd88e131541153be9d349be0ff04905b22c717421871af8"}, "/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": "753b566410a2aff2fd4da7ed28c53aa78fe5b6b5569c72fbc18a835f1fd4cd72"}, "/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": "f9922dbe7819bbe0cc8534bd915fc9597b24688afcc06201e645309302ffe797"}, "/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": "1fef64002a8e584f5b3a9acfd84d2c28ea8d2610a2ddf511d17557c09168391b"}, "/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": "47ecab10522c925a776de44f4cb76f3775847bca073d48d6e062e2307389e45d"}, "/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": "7cf2004b89b27bf044826cba2a2d84f751eaeeebf10ca07fcb9e7f59b3cabae6"}, "/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_assert_in_validators.py___": {"doc_hash": "d4d9f6649da44695bbc4b9c6aa280fb4261ccc34829a4f17df63abe59120b29d"}, "/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": "6586280fa3440daa56337451bc946f28d8b2b8117d0b2479920a682823057b5e"}, "/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": "09ae691a32abf4cf7e41d8da3689e32330b31d669b04345244118557e5fa7ffa"}, "/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__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.test_base_config_custom_init_signature_TestsBaseConfig.test_base_config_custom_init_signature.assert__equals_str_sig_": {"doc_hash": "8a6bfafe40d8bde2c09d17f13f969792873622b29bf3d7c2f9cb799dd9866239"}, "/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": "cd972867ebf59b619c2aef36b7dc5d48451e50ca6e5561ac5298313071320bbc"}, "/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": "6f82faebf1cfcc2829596cba73c97b7e16f0075e56b2fa85c739cece553d7dba"}, "/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": "77fde1938f1e6eb7e18c814054817d58202f87fb4aff4fa752528e96aea230eb"}, "/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": "462d14aebac066a666345e8248632fddffbe9d50a55703a3d844d38f742666ef"}, "/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": "87761cd974c28f5cabf4757371454945a16573b4e92fdd9470f7b1b648d351e0"}, "/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": "45c251eb05d168912ec33cab8db82186d9bf21b57015c4d546c344e3f66d2096"}, "/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": "f1ff172683aab99df5ab36cf043de56c8f26d873de6482ee00051d966bbc7c5d"}, "/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": "20b0ace4a59628b6ebb6cb28ee32b100ffd6cd028bf1623acfc7cf595c806cf4"}, "/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": "04d645ef816069a4c751c7739df5da4612c826503730487f5ef12262b6d8e3ae"}, "/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": "4b704792b6a196196fc9178b35ab3220c5c82ac9e0f026fd58fcc80212964fa5"}, "/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": "61ee7c02851697a4bd8ee306ee4bc027c5bad65fcfc962192589dae806841c5f"}, "/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": "354073d3ab3c23fc1fa061cc58dacb9348b328f2b65ccd36b8c5c9f739bbe546"}, "/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": "c0068fa8f92e5f64a17b90477d1763ed7ce6a193754cbdf883c1ae0015e49b10"}, "/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": "bc3c011eab9a514bb3a2e28f144f96416eb1d83338288ff0139f29d67473cec1"}, "/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": "25c2cb0d0bdf748c37a66bb626506ade6bd9b07df5aeb4750a3c21f8364832ee"}, "/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": "6f61288f4667638386a1711b57d170f91c805eca9be1d203fecf0451b3749075"}, "/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": "ac83757a94a03df7148b9dec87ccb1bd57acc2955017d98569069d5f85583e54"}, "/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_dataclasses.py_dataclasses_test_model_name.None_1": {"doc_hash": "d6ee77ee7f0a93b47bc6e80a8cdc1b3eb7b99745d3c3bb7235e3b7de579a23f2"}, "/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": "f0eb47254b193a975cd151b282eff121347f7940d065df759f6e45388bd1ee6c"}, "/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": "3215674c32a709a0af85b04d2c810806c92fb593e7271b011f45257c6ff68b95"}, "/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": "2ff0268845413933cf47787d4e4c934c55e018d95f6ce2e7bd7e21717a90f71b"}, "/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": "9c20bfc747cffd71c37590468c77c37742813693ba2b28c5caad02e618f6d2eb"}, "/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": "901ecfbbb41a095250c0951cd689a892e3f373a4618996aa75619d5b266026dd"}, "/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": "d19a462b0a7a7cee8d80c8d605965d9698bf3516a7c475efa4b60308ca71d1a2"}, "/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": "946a1d5befe9940ba0606364819871f755dff25ff7e50d424802ec1cc7c057b7"}, "/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": "9517281607f8ac8229fe25b57651c4d581f8b8986fe27e67b7edc1f344d93c20"}, "/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": "b921f97107f60c0f26f7e2e8da0c6d6e21b2ac6c0a005bcf077baa105f4208b4"}, "/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": "49f0a85db48b1d4be39145d227e0a9d93179b4c67886a06b721885cd10696a4b"}, "/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": "76cfba75ad1a22ad35ac304701719678a1f634c90ba7feb369c5d1477f5f4625"}, "/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_initvars_post_init_test_initvars_post_init.assert_p_path_Path_h": {"doc_hash": "fb62f2249140b467de5cffa0f65d7a744b775900729fd45c4b97c03803b78587"}, "/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_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": "1d4ca3597191034939bac9039a01073db07847bfc46479971b2966ce44383ead"}, "/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": "27fad79695db7c59bb0ad95201785d515bfdc68515068c5ba5574d80f04c19ec"}, "/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": "caeb09042da42726edb1efd983f387b2b6f04841df383a96ff4330c8b6a394f4"}, "/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": "e15bc09c1cf552cf30160735f1fdf61c0cfce2171691d32d8d3f7da372dd0d3c"}, "/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_ignore_extra_test_allow_extra.assert_foo___dict___": {"doc_hash": "82dba7fc243bad5d6cb54d5843d9df6751b5787ba370176c49032d9626f751b5"}, "/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": "1046d0784ac77c6866781555ec8c5b2306737f0896ffc748bc19c825491664a6"}, "/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": "b8a87760dbbdd09d6ca8c52fa19e2f13a698331b7c38136f31a0fb3cf0b71606"}, "/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": "0c56fefa278e03f85fba32cc363e09982d11dad368dd9a60699366552da395a7"}, "/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_datetime.py_test_datetime_parsing_test_datetime_parsing.if_isinstance_result_Err.else_.assert_DatetimeModel_dt_v": {"doc_hash": "3638567c64631235ddfc9971bdcb38a53a13271438d4f7937df726eae90cae20"}, "/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": "c2467297eddc13ffc7be36e2205baa262bd5a011db779c48b35f5fcb88bfc634"}, "/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": "73e5ff6c7edd46e51021e22f5d859195cb0cdeaad92e66a96b71017163166b4e"}, "/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": "e54e3d3c91e280847d6380f868f4249c0097543bcbe1bd5a674822c7f47fbcd0"}, "/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": "425bc6d55f3285bf3b028ba1eef50249beae4c58992d61ec16f0ab2b16489402"}, "/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": "4a4ced46df46e5fae86b0fd015d4195c01a8283f9d834b3d38afecfef2414bb3"}, "/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_nested_orm_test_parse_raw_pass.assert_model_model_dump_": {"doc_hash": "803657bd214c2e66350c2a3ae4fe5dea7508d5dcc8699fc55f891ce798dd1d0c"}, "/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": "a897818bc83604c6e2b5e81c6689418311e4d24b7282d483fafe66feaf9de44c"}, "/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": "b7493219cfdc64394531c3e4ccb22b3f0bab88faa63f7acb5da7b6b157ff6470"}, "/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": "cf0db929e7c8b6880b4680da22e64e1c224496848f5093b75d54960b0b909662"}, "/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": "5d0c3a88eb22718f6bbb45ebdd1b7ed5ec3ee31c02f3ede15303bd586ccb9489"}, "/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": "d4a1ffdc559c0fff854f8b2815b1b3eb9121455cc0c021d7cdb0012a269b3172"}, "/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": "2ef4fabef39952e23ce27b8252b0b6530acfd5aa4fc79e0f95940d050fa66bf3"}, "/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": "f6778a006b562334ca06a9cedbab94654e7f370618960671e6de0e1ccb6bbb7b"}, "/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": "781c7d7fa334951d5a3dcfda5523cfe70bfbcfa63aaacfb8cb7996f62152ff7d"}, "/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": "ef48c7fc36367a76ce285955e2c0287be0e2bac8d7cc5c73c0b8da5b50fcfc73"}, "/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": "c607b7df1a65940cfb29f994e35a3cbc2d7d54c331e4e9013dbdfa5014f459ed"}, "/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": "9b679c26cc60914ab237182beb3333f63a20628933a5b34916208d21da11fcbb"}, "/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": "6e1f948d0b5c00a65ad103b0adf6d9d525b60f8e7358c4e9488980b315e66008"}, "/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": "a68cce502d43c38eff81457d18361d8eaebb9242f88f7d003e5fdeee7355fcf3"}, "/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": "39d2bd43e11e29ae2dda7631c76e318a64a4e7e5552c5129670fc2c288719991"}, "/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": "a40e4376831a8dac15b73341d5694ebfd28c81c72e0994e2806692a6f2caa1cc"}, "/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_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_wrap_function_schema_test_wrap_function_schema.assert_apply_discriminato": {"doc_hash": "53da8d7af136c51601d4bbe7e3873ef8b9a0aa1501c1a9dfd0c3f9168b2f1ef3"}, "/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": "043571a829e2f0f8edd5fe9a944f916ddd4ecff5ea0dc21f2dda833d2357eea6"}, "/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": "a46ec5a85a533456a682b631bb96b18abc6d4fcd0d11509d342bf92ad32f7392"}, "/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": "ec38203ca485d6f1ffc053d8b602ce96330c80f446400faa347d8267306f2cbb"}, "/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": "fbd5e92083489948b506509e7f3eacecb0f69adacc89ac7206759ad4e6c4f839"}, "/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": "6334aa5b599be779dc6fa46c5aa8ebe59c58a21046da28cf0394c9916ccfb380"}, "/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": "1e2e6ab23ec60e3fac8e1d3270df5d1d56dd57c135b8aa8f7fae6d5f0fe1de6c"}, "/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": "6dbf40647d2d11e276cb9d936d2bc41944f24ff135e1995aed0535d6fa3cfde4"}, "/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": "b4987ba3ce0449152642b1425bb343a959943051baf77436ac36d49e660f116d"}, "/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_tuple_length_error_test_tuple_invalid.assert_exc_info_value_err": {"doc_hash": "f5ffcc7a1a42f06fc97e287715ad82478d98ed6c771e13f1ee67e36ac2af237e"}, "/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": "ee13fd895e806c138c6c7c1c69311906a862007fdefde4da8b2dc39cd384da5f"}, "/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": "25cc8bb2f504f636b43d986498b0a1a968bda1080953e101fe293c7b12edc645"}, "/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": "9e2869b2690d0d8dd234bbba2214be9d54dcbf3d5109cb783926be5faac86bce"}, "/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": "2e101bfc03432d113a8a3e1548c3c1a3b930eb2d399fff27bc2a22c45ac55f5f"}, "/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": "0e6f142a8c50cfdbaa76c6a5ac93f0addd6511e45b8ff30eedd9476d5ec87cf5"}, "/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": "f8c30ae1425d5890790fd370cbb2fac3966ffe5805c433e75a684fdda49fa408"}, "/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": "baea49c5ba24b010f4c46b0ae1c90e8b0b2ca28d2787217a9cb198261a3c8fde"}, "/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": "1364d20851c2f0e45157d78c7512784464c15e6f3470c35d8587cd0c868ed316"}, "/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": "d202da0a922cd7ef420a9842e47c60e981435dd8483060af597af498134d3702"}, "/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": "860707a9ed9c8051572749531111f5d3e516e71c29fc49cf0c8cd41640266e31"}, "/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": "5c1b46edfad856fa7fee3b367dfbf0898619a752d7aa173ea6d404926b16290e"}, "/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": "269945cf091db9d001d44c1fd33d0982b7d556d73af373329cfae45d8df3c738"}, "/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": "5a123c0d5062e754b9c026282d241212dbfd348c0ba23d37ebfbdd7239ff2dd0"}, "/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": "f4154283785f2dab241122b3e2c54104b3aa23aae29c62d9edc2184ecab01acc"}, "/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": "72b14c8b7802700daa8b660785e1d6f7e5a8a143a5442e6e73aa6ed0f77b14e3"}, "/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": "1b5ec173b1f8171658668485d49c3f32e83bc321cb9cdb9fa3e4897dabb04a3e"}, "/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": "4533834022cc265c22dc6ef63577b80f381e71a88a62c226a02f01654be25a12"}, "/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": "0d69e315547615adf9a15938100f3434b7b83f7746e5f930117deb8a227eecb3"}, "/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": "b33045a94a3cf1bd439a47b44719863ed79736d6f9a7e7ecab63a7a3fada25bc"}, "/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": "bcfd204adaca7ef58297b1bb545d4693bc6d895541a256f981e6023917db6319"}, "/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": "18a7581ebfcee97fa17ca44400100280a5fd63e00b0da118435a1a9db6eb46a8"}, "/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": "08a5b2320f297d4d5a1989cfde6529434bde92def358c9f6680ec26e6cbff45b"}, "/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": "e2fa78fa0a3b778a91c32fa268966af09df5af8d5e0c617418cd7d63b02e3bc7"}, "/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": "a3295f8cea3ef6308e4d937671789e5377747f5fa877b5418160bb3b9ded00b9"}, "/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": "09bfbcf5004567b842abae929ad373df61fd16e4cf3d539a9f023cae4f2ae0c3"}, "/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": "51fc67b0f0d71fb73eae10ae10d6918e5f16edc0a4a655313360c43b7e396d72"}, "/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": "cc58f5b3b26f2ae21794ff190e7139c06f35e74c43a508a8cd16766dc63931d6"}, "/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": "98eb9bd6e5dfa63ae7c9ec10969aaad3d5ac74b83e633868511e83faa52df703"}, "/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": "457a6900370cb8d475ae0715649b2bd84eb36a911772dd1fa012d55023012261"}, "/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": "1ed9f79c074a01b2a77d62233fcff5abb8f4ca34b72f1b62073e80ea54597dd1"}, "/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": "224de101ed1ce2202d8d4651d02a39f3036c98daa8d58324cd71ed978763d3ef"}, "/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": "cd83da478b9e8915d204dec0156f3dea98ed8e4e1cbd2a607d5577fc5ce0c92c"}, "/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": "915c2b3f3814e9c8de45010d3e8b3eda6221cef4f2ae7ff90179e15e7ec93b57"}, "/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": "794d940a2e3bf721dcaedcc708f71f54194be14b09c0a2f5fb33efd454e57fa3"}, "/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": "4fa8c61b83dd83c444d9daae8dd8295f20a72211d2e0a27f19b45be7a3d9ce4f"}, "/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": "0023ec22a06dfc4c209b3e94bbab10451caf11e5232801986a08af3545335a2f"}, "/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": "c7ead69484d757eef519e16652a527dc4b47d8dd7b83aa0a589359f419f1cee0"}, "/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": "ea9367b10676dafa4da64641db1a139c436a231ef38c7837b80d9813ddf76a61"}, "/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": "e7874afff55ae5c370464914faf1b71744970212f9395c8e56401459c6a3fc04"}, "/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": "dfd6550312d127b61f57d80c91f949e85bc5d19d94f5d42024ad153e038f53d1"}, "/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": "405426b3da17ea9665bf4973c9a3c18d3f0f7ff4feca6720ef374b11a9d34ac4"}, "/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": "2b80a21e3e4eeb9b95ca6145281c9b4ae2667e48951ee0c00da734f9464df3ec"}, "/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": "0b2951cc3c238552632a54ad6b808a44add5be946b92125e2de5949c0e9b44d6"}, "/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": "4ebaa3a48a4c71b0ffb6a194bdf3580790e1282594c12c576e3b760dde10751d"}, "/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": "ea539d9eb14b9d1c15680af019d53544b7e3c1e3b06dcf3f5a77f2264fe9ff22"}, "/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": "8503bbc608ab09362496de750380d23b2806cba0a54173a4236357b2e1053899"}, "/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": "30c3f1463187d5a2776d7e71284d318d5b001de10c78e4bd7be910028145a20f"}, "/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": "e28a04e060953e08bdd6e67e9222948038ef0d1ec3efb3b06c9b15f1204234c9"}, "/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": "163da96535a8341edfd960b2bf36f39fb8590f53896a85e4126fdeaa1e326474"}, "/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": "5355bf73e15c6aec0ecc3b6a03f6c20bc16502e41483f01ea0ea4c06ce631a7d"}, "/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": "998d796195f266d7a20d1a71b5e1c9f74f7bb9d4fcaea0adfdf952ec5bfaf6c9"}, "/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": "3602a419935c84998e7127a94d860e8634fa5d1ec4a44da20bf99295556c11cc"}, "/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": "150bd85f8413ca5aaf4ede9dcb1fd37641f267ac2e9432eb640055ff55940039"}, "/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": "ea80dc5b86bd07bfe0d509fff596617546c6ed11b9a619cb57096d00454354c2"}, "/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": "e80fbd37fe866df91608495451563045a8e706a2dc060e9370c6fd711d36770b"}, "/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": "bd10bdda8f47f5a088823e2a05a30b2f815aa61b15786b83806c0ecd8f384a0a"}, "/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": "ca4b9729fc959c648b2d677aff1d43b1bc60a97edcb599e475fd7a5065f609c1"}, "/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": "2fa3362ac329d8cbf5b98a5f14295c5ed81dbb076c12a6c95bc85f3a7237e91f"}, "/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": "cbbfd10b4c0969ec21a7a4711974d306c9afffbf26e4baef09876ee9618420b5"}, "/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": "9ee140c695131540bfeb7b626cb995298cea45b762a0aed83fbdc551e7e73832"}, "/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": "689a75629c23cdbf09846741f7d591b032eb9ff0b17827d56409251440bea81e"}, "/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.assert_replace_types_Mode_test_replace_types_with_user_defined_generic_type_field.assert_m_model_dump_": {"doc_hash": "edf6d2ee5c74ff23c4f4fe2c680feb54b8d57966b12707bab5b5094945304c52"}, "/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": "3181a8d7954dde1d6fef82036caa9d7171b7ef1a08c6e42ada0613f1c6864836"}, "/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": "58c9477c0a8a8991c5c703e411cd033b366707b0b4dd9be07370bab6d739070e"}, "/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": "ba74e1df55020edea9243f3c3ab0962f6250e4ba5f00fb9d7856d4c78d2cb17e"}, "/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": "c763295c5052a414589f44a432fdf1f169f7b6a338dc5405da6cfab2d25498f8"}, "/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": "21fb658360248c10e647ec137fcc772b73d70f8dfff9f2eb8a164caf8b189f92"}, "/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": "0d8a31f213fdc22c23790964ad037b347489147562c8cf0fe48a82df749d2d96"}, "/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": "d3c0982df93aadd288494fb549d8700ce71d9e521395df614df3878e0f7bda64"}, "/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": "b4d889885a2ba36677edbda3798388e24ef510939bb72b31c6311dae08108cf9"}, "/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": "616ab6da7d32332e41e1d337f4362bf1ffac9c81a081f187e44b6303a1964eab"}, "/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": "e473e3947e8257ffffbabca62fbb89231eb37e7d14c4df1ca33adb1643bbbf75"}, "/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": "af5af062250505e168a9c61668f7affaf6b419df41dd3144b7d47263117d1d07"}, "/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": "eb2306cae004ae981f4e6a61f94c58d11e8896e26fc5ab3536b21eb7fed09207"}, "/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_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_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_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": "a4094c48e7fa803c90bc6a6aaeced2eda254cc28ebb2396fc9b512de94e820e0"}, "/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": "a5e5db0d150a927129ab8e78186f5d82919097385cd1789efb6d5c760cef587f"}, "/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": "dd1674aaddb14f1f331b6cfb25cb19e5b5168a42c8ca5b64a0f21ed11e9d661f"}, "/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": "8f80ba4540d468677f9d0b38e82db1f7047fcefb1ecc34ccd13c12c2d12d6deb"}, "/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": "a442e2caecfe293bf351ee10f8b8d1dc09c7e791d123376c6a93f51a9fda71aa"}, "/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": "c732ec5ddfdf571ecd603e362263ac713d0130e32c4dc9775707deeb922ceba9"}, "/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_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_schema.py_json_T.TypeVar_T_": {"doc_hash": "215bdd7ac4e60d5f2f733ad3c9c04fc741c1168849b8e33f59fd0d817d71257b"}, "/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": "01bd33f8663ac5e3b825eb046633d9ce707615c6debccbd23766682484585792"}, "/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": "c3d1fc6135de0e3470b47147be09c687b3aa62cec0b4e7d37bf5b7faab95b8ca"}, "/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": "d107a9aaf4522e5ce9a221df8f2e31dfa3d6e67bf7c184057e729694cd40a081"}, "/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_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_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": "7c1aade0432c6daab6a1eb7a6047be555748f0f7b56616fc9e209a5714d8a33f"}, "/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": "acca755f3073aeacaf26b04d359e74fdfacf82de751aca46ba680ff284186926"}, "/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": "0b0837542fccf0007ef9c1ca5f4305e4d11bd949d440f0a2fcdc9d9deba1c681"}, "/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": "ba5ee994242648a548c807e88f5dc02acb622eb27fc4b9999152f62db5f1f6a8"}, "/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_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_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": "ca628de4db244cd701af975be4a91ae1470a7247d76bd01c2db596b56b569681"}, "/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": "90f8c55cbde4dea697ba054d2081fa803efa0a827b4b7d6b863c4352ed5b8127"}, "/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": "0453a1d37f55667b9cf6db9a519917fdc7128d5de5fd5a6ceffaf619d1b09e02"}, "/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_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_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": "3e4499e3eee3b17d4ca167eed378b2dd100862951165d643ff66af688397b34e"}, "/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": "8a5e0546d2a69a30b5af0dc11a27f389bb26b9a05bb230474ddf6f0d0986699f"}, "/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": "a4edc225219b54c244e8c78525bc16e33e4cdf77a24a4df4bbf208d1303b74a1"}, "/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": "a680cbd684c50f6b61fa3697ec1f3f473e53a66ee58eb7a48fcfd400f8cbb12a"}, "/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": "12806a068e0ef3076890936e689414dec3644d216ee6e3b1bfe96d6c755a3aec"}, "/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_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.Model_test_schema_for_generic_field.assert_ModelModified_mode": {"doc_hash": "8a3c3b2e68092b35606dec36126871b4aebae23958f7204b8b8a06c3c897f30b"}, "/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": "7b248fa06cd0b0bc05d103b9c971c0165afb986a5471831d535781b35534083e"}, "/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": "645efaad93fbfb7ae0eb43544698766287a5a8867ff0e8abe9d748f83e9a70cc"}, "/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_modify_schema_dict_keys_test_modify_schema_dict_keys.assert_MyModel_model_json": {"doc_hash": "fc10c4709ed87b77baf8d78e84dcc67a684f54f105da423630ac120785901d47"}, "/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": "d4a0c6d6d6eaffbd86966ee0c00c4000343ae3a481a69065b24253912664ec92"}, "/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": "f72d23d802870670fd378784f30725887ab3aea9817b3aeb7bf1c922f9e52d46"}, "/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": "9e26eacbc347831c858527c11b3c74a60e87ef861685a8f3ca0450417ff3fa9d"}, "/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": "f59fa3f740941beffabf9ce914a00e8de33d4da9867b2999ea07016c526027e5"}, "/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": "49771b82e25d6b2007262e464ba81f7d848d660ab1c3f8f4de7705cd822f6a52"}, "/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": "d941ab7fd0a37c8e648aafb8855aa23d389e1c77a9d7b57c8c9e6dfdf43ba537"}, "/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": "485f33722f96dcd8fd69913c13bd80d138c04c5caf5b80f653315308c3de81da"}, "/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": "72a5a20f3ab75c410316608e2add43eeecb7c0a1f99e54dde19b90e3a799d05a"}, "/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_main.py_json_ultra_simple_model_fixture.return.UltraSimpleModel": {"doc_hash": "89565486ae09d512f37ae83b8e92965d0ccdf67a72f810ed7f6e1823bfe57883"}, "/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": "ce071280dfe07456ee8e1a15b416228202e327c8e170c5b44ee8a50fddb0b8d0"}, "/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": "d53fc5453c14862c67898c56743b043985e0762abbcef3f2fcedc418acceead0"}, "/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": "18247d10efad3ee77f0ae2d730ddce117c4c8d01042599b2846db9e35aabb653"}, "/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": "f139542b1ebb4236f84c5700cd08d4324a18bdf65c3f07d2d37b02d3caab9389"}, "/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_literal_enum_values_test_literal_enum_values.assert_exc_info_value_err": {"doc_hash": "3b8e30e2b2672d114c301cfb2c42a05c16e8203ec820eb7edfa4a879f7bf609d"}, "/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": "cce0deadb2dfe2f427df30dbe7cb942771ab8130ab33d2395d93fa03062799a6"}, "/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": "bfc3c9449576561079d7b752e262e43350667c4b6e3d1bbafe9eaeab22327afe"}, "/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": "0289ab1d9e0acdcdf3863bd681f92161c82e128df0b4ccd080183b64b350d696"}, "/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": "0ccdad9031150195407a7b292b617bb1773ff981d862d96836629284ccedce9c"}, "/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": "b1368a85eb24a69a14e9c2a11ea5dd4d660dead29dc848b8df6d1957a13b8647"}, "/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": "87ff15d04cb58e6df569909a573eadf72c98f811e53e43bc7f116def6f2e4a89"}, "/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_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": "ae8ed5a13a8039b37ca84ba99e08c45ba402f35c165c8a95d1f250c97150ecd1"}, "/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": "58f5bfbac988172212a0ec97a77c4290be5bd423360f75918e10d3feece263bf"}, "/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": "d0102b9b747423577858c2548a5cbf949b68ff709106f949f7f62086949ac208"}, "/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_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_class_kwargs_config_test_class_kwargs_config._assert_Model_model_fiel": {"doc_hash": "ee46f8749173a76f45d93cc002ff93e71fe6abe126d93e9b5dd03e9dbef944a0"}, "/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": "f20018de64f0017be95cc92840bf6cdac1954138e595659e51ff7e879f53649b"}, "/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_validate_strict_test_model_validate_strict.None_5": {"doc_hash": "ac30621e638239e65c06eb6048f77879d67321bfc277fc941e06d10b95161499"}, "/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": "6aad45f5199300eee9a96faec7fe018637580d186dfd8ae0f305c3d50285fd1a"}, "/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_model_signature.py_test_custom_init_signature_test_custom_init_signature.assert__equals_str_sig_": {"doc_hash": "235300de793e29842bbeb0d1e786f4dc16673c025d48955d83c8cc6e350e3fb9"}, "/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": "3baeb2281f23cbb44675b93e4e8b6f608a9c45b5b317fb89a32c70fdc786b971"}, "/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": "95c11ad7e58726cced248df7f87526b38cbfe8ed54f3a1e23b827ec7968f65c2"}, "/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": "bd96ae0aa55e7b82143c4d24a2d9d5fd08c3100b8c2e53f6b58171023f2de85b"}, "/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": "41f88324829511a42adb698f48d84d1ed636a88ccd29efde9913573b50e8c178"}, "/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_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_postgres_dsns_validation_error_test_postgres_dsns_validation_error.assert_error_error_mes": {"doc_hash": "c2792d04802e27428716e88d381b6e736c35c5933e992fc0ad1e4872bdaf3f40"}, "/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": "6330944449a574b44ed6c809ab5981bf6f693574ddb3e1db73bc08c025df165f"}, "/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": "9bfd902079d691d70576fdad03c17649824cca84ceb91008c5af58ffad859348"}, "/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": "59a1addc41470d00931e5ed5acf8797b1e2fdaaab2cc5309d6667b604db83ff6"}, "/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": "de5d994d84d26da60a023b7c8693174ce1886eac9da752183c6530042c3ea0a6"}, "/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": "29a2879a15483a73afbccbc95a692af416734d6d72814a253007054ed4448afe"}, "/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": "93ff77ae4ab7ad7db23096ccbf5922150d1e0c44ff3d8d96725c8b4a613d2d03"}, "/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": "6545cf299fceaee5fbebb934fefe265e33392bdbc8e718ea85862d97ecc7b686"}, "/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": "c691683921c07a3cdaa229c72493ee607940257f0be9b0abb4d2a20166893d95"}, "/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": "3d2c5a94eb87ce84c81caa269786cefdb2b53a30b7c8500daf22280ab418479b"}, "/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": "db4dc7e58e49b0bd1b49807149d220039d3084df1fd3d25e7584484715e4b984"}, "/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": "726643c23ca3becdc5f6103bac6f58ca44e6e6cba4548671667ac0ca0b1e91cb"}, "/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": "93d861c838b9b9aae8f4aa9660ba5eb7f211dc3996e90560d587320cea4dd778"}, "/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": "b87f8e00f81f6aed5ecfb0c3d3bfc98b5dd2884e3e11acc96eb5cdc09ac8c378"}, "/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": "26a77b425fa2e2c5bf1384003ce5854325ca356ad08665633abc990fcbefa325"}, "/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": "a3287070230ee2a68c517394095f3d2a9cecc8e85b4ab1d04ff952b1d90c0513"}, "/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": "b8f2f7cc267581f6e49a3808498e776e41bbdf1242afb881dbe25d1231e7fcaa"}, "/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": "8998e98ae9c319690e3c56f2e4c990a574ca4a5cf33b043abc116250adbb31a4"}, "/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": "b70a70f834c5150d4b60730be9eab14a767d670beb04dfbfc690c496c99d7b0d"}, "/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": "4696e53a38408af31978a21b379bd30d6f9db5e8dfd078f358c3a8bfd93a90a9"}, "/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": "e8bf16d717c5c5295a9f226716e6725746e995ffc209dc768145dfac94bcd1d1"}, "/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": "09d8628dc7a7e6762af885de9927688e6c1ca751d853ee38b329e5508af2cf0e"}, "/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": "1d30f006650010061b2c2a96747ffff28de0d7db246ecc5bc72aa45d5bc55335"}, "/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": "388e82f58b8e139910cae6a5035776e3af10dc2c24833dac6ce6dbbc557647de"}, "/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": "7e5e8a8ccd9f0ff38e5808a1bc961503d0766ad99d4bfc54f95da6b3d2ec9e0c"}, "/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": "58f9fd54ef120ef6bf29b8f077673fde60509bf16aa00dac49fd97be5f7f0fd9"}, "/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": "7270a3d1267e15cf4804fcd77432a447608186643eb1b5c94188430db32128eb"}, "/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": "e65fd077e2371ee3f3ba5538efaac5f958a85951154abcfa12e6bcaa0317f75e"}, "/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": "ab3d2a680295cb2824c4dc4b792158e7a0470b2dd8c6316b45b799c5566c3450"}, "/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": "52c2f64d701cba1655e23b1210232746cc537470df6f431b9ff36d730e24b1ab"}, "/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": "00652d445e0aeff5033c305bf1f6ecb5cb101e40ae89a23fb8e8288dd94e9de4"}, "/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": "d7de040f12bdc44bd0623de8a70e5bc936124caa4cc19d9c52cfd85307841036"}, "/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": "fc0fae66ab5b20ebc4a153d93d7d6d57cf1883f7609782cb2c3f52e2510cc9cc"}, "/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": "7af5b317b6b94e690cb8aec864329762ffbde49c2073d1a88b1bf625a25f369a"}, "/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": "7d52d6d13cd9c48f14f88696475c6b4d7001cd498ad90736d0654891a9e53d8f"}, "/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_strict.py_sys_test_parse_strict_mode_on_field_invalid.assert_exc_info_value_err": {"doc_hash": "9cae811384e091929c9c8cec4b1183363c60927bab862e1033c13c871f6d249a"}, "/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": "cd4d4073fbeec78b774a0f17b062e8dc0cc6dba1cbe2358713f83229844270f1"}, "/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": "f8421cdc371213e53c7ed439a5068825e9400d17a9ce8e1bbbffabcf00c66b3d"}, "/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": "9963dfb86e853eed0edfa085d1c35cf0a8679005895c1ecf7633865451400376"}, "/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_namedtuple.py_from_collections_import_n_test_namedtuple_simple.None_3": {"doc_hash": "222789ee370d94bf67bd191ea7fb1a98e4cc82837510b632035bab6c52495ded"}, "/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": "9ea536ccc4e6da132d66539e0286fdf162539d744ab29e65334df5e1aacdb540"}, "/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": "0da89d6d5cb7f9f66ce73d94fc4aeb3e5a2ea0031680ad7206859cf2feb47668"}, "/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": "0f202791da3806a3af6566ed4f0c970da4468d06a1de3c49c53931ad542e55d6"}, "/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": "227347910cacb145ac460ae8f0b55c748473fd1879cf7eca8ccd33a32d8cbce6"}, "/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": "78a27e03fbd5b2e824fcb16160306817178422837286f2e1ffaa86bd82ce83fd"}, "/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": "5f891f2b00352082f7c6ba86218c63cdf0860f86e54c5c266c392e7a9b6616e1"}, "/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": "767244ca616103159b6db250098095441c0bdf6092a50111fb1b46a3aa94be6e"}, "/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": "10feef05c8bdebcadcfd74e6dc6ef4cf6df46ed5707223c4050d9c65d8b4f751"}, "/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": "c4eee65647e658cdfbfa783d5bb54d554fca300eda9819add0b04dcacbf3d36f"}, "/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": "d97d400937995229b4b8cff8d15dc4aa8e96fc3da8aae1c13f4f3bb3f0b052dc"}, "/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_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": "d2fa9069acbdb11ff413ec6dad8faeedd9becf5efa87f55444cb0acbdc3bda66"}, "/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": "04e6433c216ed5e4e6f1c0bd8bbd99d9115b8e8a55579870cea6544983870b04"}, "/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": "299a64f81af982736af2d8a227f8dae6aae7bb527dc4081a560e4469311c6a33"}, "/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": "a0fa18535e1c98870f960948d558ffee216f889d2ae91a8ded9a7dfa4e320d21"}, "/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": "3fae215e13def76ee7d7e7df700206c026d8fa5d3895337bade954a5d9ce7c23"}, "/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": "19217883fa15a63cef48482b40f8a0ce8fed6debf930a07bdc97808e15c9cca7"}, "/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": "6f896c0a366bcf5281675ce1bccdd37e8cf46b206b8cd744e4c4319806118bcd"}, "/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_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": "d8b716f4fe8cc6748b31b3fe5b3d3c4c1d84f9f00284979eb17dd7baef540c04"}, "/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": "1a2e5d54dff5aea37e10d6c47267ce7ad240cace5912bae7cacd780461fc26e5"}, "/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_validators.py_test_int_validation_test_int_validation.assert_Model_a_2_63_": {"doc_hash": "731aa23b1b4cebc506d739ca5c7cf2eaf420c2d4c4c74d08b7dc4cfb5f80d72e"}, "/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": "a3f799c17095f468f01c854c7204d078d4de76eb281d5736a01d891cfe319869"}, "/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": "4224057eced48132e5e2906dac8938b5917db07ed885f6424b44e307c82b514a"}, "/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": "6b581870a3753a3515c50bb8a560f5f23a6d3fca234704e877b5e5f63c38e612"}, "/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": "dd2f6e5bd13b7af92aeb53ebdf5befc541590bb298fdacfe58066bc1f50626da"}, "/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": "0f5f7f04ca958ccc426a06058e42229fba90d795fa7bf8aeb769bf4c7fb3a219"}, "/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": "a70b24d4739ffc67cf637a32dec6228fbf4c0440dc5667035413b420a9127114"}, "/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": "59f2bad5f516cebfdf8078509039675b08c85c0a065a1d64a8c9ea1ac8cbf02e"}, "/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": "d8de0dbf82c14b7ff12a5fb0830ee86589c64f4fb4eb519a6341249f9b5e536a"}, "/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": "4a7f9a3169891bd025b0044c9860af8b293e9f82b8b490bf1cea604658e8d3a1"}, "/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_validator_error_test_wildcard_validator_error.assert_exc_info_value_err": {"doc_hash": "57f2ea54cc4945289961f224ec63d1ea08becacd19fd1f25c9bc03f60be2770b"}, "/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": "a8c11875387d301c3486c7e3aee5464ee402ad323ebfd0d79a442f0d1377e08a"}, "/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_validation_each_item_test_validation_each_item_nullable.assert_Model_foobar_1_": {"doc_hash": "6ae7361a43ff26b8a91a29955d3cb0d96a6d088231f5c9989ee7c0a90ba3210e"}, "/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": "421c14becf20ac590293bec1224942ef276c5686ee6abf8d21e9e1cfedeb33ee"}, "/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": "ff83e0b1798fc95ac128193ec3584ed2171ac5c3ae606563758cd63af645e12b"}, "/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": "28b9e93665ad65a95912b8ccd46fed44ac16284b80c48f27b3f6eb06fbcfb620"}, "/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": "86f12bee3bc5a90e82ad8819c81a18788eb9519302ab6704bc8f79b863850190"}, "/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": "1aaaa1dcce68559b726bbee8fb0ef38735d328f75483e34097ac525d54fbfaa6"}, "/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": "3c0bddcd3d6a97b9e9c0daee3fa505e71d8d8ca4207954739adc731bf45c8fa3"}, "/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": "7e446fa8b93fc52a963b665df910ed2f2d2b262b7078245e1c99060353ece2bd"}, "/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": "63d2f7c7d7a861392b8ca68e7a11f720782abac1a500736ae95d4cf70fe64100"}, "/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": "4f654e860a04e0d9165ebfa92e1645ee27a9577b51316e7c08ee431f667243b9"}, "/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": "7b03627a708a3e4900b89f3e3e687b47c6462e0edd8970af6f5d4339fce4be76"}, "/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": "c7a5a7c35f3fc075004b7dcfd6bdc238c3e0eb8fba8a78439eef113d03794bee"}, "/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": "ea1479cec24ecaf85d36bf9c56b109274f27e91de1ee6913c4c05a294592f270"}, "/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": "d8f1d0a23fa92f1004276568c128aab180a763e8f2aea6733419e21a03ebddef"}, "/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": "fc28823b7dfd9e4e7a75a07f984b668321a1d04100fc923af65a88602c66fa84"}, "/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": "4dffe1fa54c1dd841ae0626ecf35c83ac7c9d3881cc4389db2b3e0c5245e931a"}, "/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_v1_validator_signature_kwargs1_test_v1_validator_signature_kwargs1.assert_Model_a_1_b_2_mo": {"doc_hash": "3ecca695237feaa51cdea686f935e4f76e283bb78f3c57f7923df2eb7b0d2010"}, "/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": "db0377f4c51a55c449ed639ac0eae4f35656b977491add3b7cfd85a877f7c800"}, "/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": "25d9b4b2daa718ae8eac8b6a854d4663eee8b01cccac2b7b4b95f872adea4e72"}, "/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": "99ea0b38170868f24e36dd0cc84a4dd50afb82a2c0c53bcc4ae2a67b7cbd1916"}, "/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": "30e6acb282a570659a8dce5381f01278601cf2cc769af7cf49c5cea31bd79654"}, "/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/docs/plugins/main.py_from___future___import_an_on_files.return.files": {"doc_hash": "8423f56ad82b898a822ebde98338468db2194480d19f532592aea4396b91eda8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapper.for_model_ConfigWrapper.if_not_TYPE_CHECKING_.__getattr__.try_.except_KeyError_.try_.except_KeyError_.raise_AttributeError_f_Co": {"doc_hash": "15978c531da04aa73b38a63650b5389ab746dcba804916c6965d7d489981d37e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapper.core_config_ConfigWrapper.__repr__.return.f_ConfigWrapper_c_": {"doc_hash": "0cb49dcd5c8923b37c282e61043fc9dc4e1162d3673f653e0d56ba042071bbd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_config_defaults_config_defaults.ConfigDict_": {"doc_hash": "ec0446d4d18d2a19a4fad9b1635fd3619c00d7033d3d60d4641da01454bf430b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_prepare_config_prepare_config.return.config_dict": {"doc_hash": "72e25e46dfd881c0ee6e20eff0c5870068668b0d5c356235ed39dca6b9e93420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_config_keys_V2_RENAMED_KEYS._": {"doc_hash": "8820ecdb324bf91ca6b912b137879c18c1a6caaa820b54197f5566475b3ecd69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_check_deprecated_": {"doc_hash": "3e96bdc885198043ea3f4fd80829ee051213b7c4002b95884c29a93f7f1fbeca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_build_metadata_dict_": {"doc_hash": "647c6b7e94829df1c05f54a395037ffbd2f05a8e4630b3b1a86d146cc0fb1c84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_PydanticDescriptorProxy_PydanticDescriptorProxy.__getattr__.return.getattr_self_wrapped___n": {"doc_hash": "b5ada34a89bee182dd64d06f1230e4d6661638c5f627b688d0662586698d25ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfos_DecoratorInfos.computed_fields.field_default_factory_dic": {"doc_hash": "ea1d822f391db019a445334664174e955bba7f089e886660322c58ebd302bac4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfos.build.for_var_name_var_value_i_DecoratorInfos.build.return.res": {"doc_hash": "dee43a49c7b961b388d070de5ff4dc7878eab564352173c1130fe82c85195090"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_validator_inspect_validator.raise_PydanticUserError_": {"doc_hash": "cb8a2322185a8424b0e4b1b73884dcb6e1902f0411f2cf9333a66b693ec64144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_annotated_serializer_inspect_annotated_serializer.if_info_arg_is_None_.else_.return.info_arg": {"doc_hash": "f2430ad1feae2fab34289f66f94761e603ee133300b79d67cb44e5bd58426e56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_model_serializer_inspect_model_serializer.if_info_arg_is_None_.else_.return.info_arg": {"doc_hash": "eeba0a5c9e42e813a02b1c8e7781cebf7d6cfe560dc8573f7806649cf882289b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py__serializer_info_arg__serializer_info_arg.return.None": {"doc_hash": "8e75823ff727ef5ba47d96274afdf6234b6d24241eda97de80b2e932e1b6861c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_unwrap_wrapped_function_unwrap_wrapped_function.return.func": {"doc_hash": "db8d2008266fada3b023616a339a25b56d168c1b24bda0147048535580932df2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_make_generic_v1_field_validator_make_generic_v1_field_validator.if_needs_values_kw_.else_.return.wrapper2": {"doc_hash": "9de794aaf631b7dec9afbfdd11bdf760b48ff1b0a06be7bd97358534f85c67ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_RootValidatorValues_V2CoreAfterRootValidator.__call__._": {"doc_hash": "c184fcdc52b1f6ddf03b27227baea6566d793ad7cd16d38dcab787b8b85f9dd8"}, "/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_": {"doc_hash": "0a5eb474749dec7a82d79da872a1416f9095c90215431c55bd59d05eac7707a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_model_fields_collect_model_fields.class_vars.set_": {"doc_hash": "1a6ddadf58b85a8416a65bf49a2bce2da3dd79b81a7edab88e1c2e8a7f5c135e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_model_fields.for_ann_name_ann_type_in_collect_model_fields.return.fields_class_vars": {"doc_hash": "a1d9964e197728bda2c70c8bb863b2fc950f4debec785df7d4fd84b559a36c8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__is_finalvar_with_default_val_": {"doc_hash": "79cc52167400fca4ff1f3661642d2e2dbc92d87d53b83f3e25fff4be7a223e9f"}, "/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": "810d78c33bcff5784b498256f338866966be2bc449f871b46072a50f3b23770f"}, "/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": "25e0b03ac413e4f7c789a1a839e6231c2b5f7f41a2f0ffa88e243ccff6fbe669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._callable_schema_GenerateSchema._callable_schema.return.core_schema_call_schema_": {"doc_hash": "fd0cdc7e49f28fdd2d119c3fbd6c5732617c86eb1836ae5d1b2d0f0390b2ec2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_apply_model_validators_apply_model_validators.return.schema": {"doc_hash": "e578138c77fb5d7289b039dafbf1927d248fae01c96cd077c08c696b0d183345"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_args_get_origin.return.typing_extensions_get_ori": {"doc_hash": "7ce75be14fb2d259eef9466bb455eca42f0245fc0dc58716b074f7d764948fb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_standard_typevars_map_get_standard_typevars_map.return.dict_zip_parameters_args": {"doc_hash": "01ab018d99e4152a66948939023984761b3abec9aeda61be42bf4ac2a0cc1e62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_model_typevars_map_get_model_typevars_map.return.dict_zip_iter_contained_t": {"doc_hash": "994b9221a6259820217a5745e942f3d7ed4967c511b59f2d1ac36bc84151280e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_GenerateJsonSchemaHandler.resolve_ref_schema_GenerateJsonSchemaHandler.resolve_ref_schema.return.json_schema": {"doc_hash": "63907ce2d6d1c2d3a3fb2238dc75a65919ca4e5b2684e03f9b9120c84746ec95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_add_module_globals_get_cls_types_namespace.return.ns": {"doc_hash": "061e17489ebe7ea5b7e4f75752aa57f3b9897eb966ece1bfc5b91f65b4e45337"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_eval_type_lenient_eval_type_lenient.try_.except_NameError_.return.value": {"doc_hash": "a3180192354e876c4bcfe2ea618decd12c2f875291744e0c53c7b19d3d7f18a6"}, "/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.None_4": {"doc_hash": "75063e1a85ae956717c825588b1e2c6af0974a7478304bdbeb7e50f379b23666"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/class_validators.py__": {"doc_hash": "063a121ad59904790f0309bfbc67dbc8412edf6c223095f398c5e376b6681a39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color.as_named_Color.as_named.if_self__rgba_alpha_is_No.else_.return.self_as_hex_": {"doc_hash": "9fc35a867ad528ea3cf0481627c2bba92c06b2d000f9d274998ee08b7db84019"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_ints_to_rgba_ints_to_rgba.return.RGBA_parse_color_value_r_": {"doc_hash": "71f8913228df6f2c2cbc8e7b84772c4b0acecba118c4d0cc92c950170b5504de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_color_value_parse_color_value.if_0_color_max_val_.else_.raise_PydanticCustomError": {"doc_hash": "4dfe1171ee023f9d5a0927834c0fc6d61df6e2a638400ad7e84870dc1e17c204"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_hsl_parse_hsl.return.RGBA_r_g_b_parse_float": {"doc_hash": "793b862bbc2422ee20c81eb7aaa76b26b27e1dde783d88bb7031670b4f824c2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_float_to_255_": {"doc_hash": "77bec336db340cb4692869dba305742d288cfaa113b5f0dac8985211a744158f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/datetime_parse.py__": {"doc_hash": "5a09ce7ea367636ad007b62d646eca6663887d902fd0bdcce7a5e04ddba0bed9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py__": {"doc_hash": "1b6a14f1ebc486848d4312bd0dc0ba25bc33e9dec8feada9e1f29e0050c6b5bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/config.py_from___future___import_an__ConfigMetaclass.__getattr__.try_.except_KeyError_as_exc_.raise_AttributeError_f_ty": {"doc_hash": "9cd4e40148702da923fd6a253287d728be93cf3eced096527503ed3f8e70bcf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_warnings_validate_arguments_1._": {"doc_hash": "884dd02cc53e5798737242443a3039006f73dee54aac61f561376db6f18faf8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_": {"doc_hash": "64ab575749c7c987a107778381b25e4bf901ebd9f72605f53aa29a8083d3e2e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_": {"doc_hash": "5787bb8c2c2cb60a445fe194d51b1fd1d4c74e5e19f31d37a32b1cf767cd0d60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values": {"doc_hash": "50cd301bf69ae1110508ddd2c3ac25b1f35191a7dff08b3ef418472851c42e8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_ValidatedFunction.execute_ValidatedFunction.execute.if_self_v_args_name_in_d_.else_.return.self_raw_function_d_": {"doc_hash": "dd27f07954a0c91233f2f995b8bdf5c9947cc3d2201728cd281cdc693816a9b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_ValidatedFunction.create_model_": {"doc_hash": "a241f15be9dcf9a11df46ed237d425c3196305802c52abc6b7f51e88c6b1b5de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py__TODO_Add_a_suggested_m_custom_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.return.pydantic_encoder_obj_": {"doc_hash": "0dc6a0221b274410cf0cdb1c83fde342fa135a8f57554ff57a91ae19c1ce0694"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_timedelta_isoformat_": {"doc_hash": "85eeb3b1d66bf90eb9a3d525102ab87e4ae27994caa5396411415386ee4957c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_schema_of_schema_of.return.res": {"doc_hash": "bef4c14093b6537c35c822a3a391943c7dbc49aa188d9665fd51ebf154f28d7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_schema_json_of_": {"doc_hash": "036886a146b6db661fc6191c6ac59429d644c62d6e7bc4fb561111cff97122d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/env_settings.py__": {"doc_hash": "c5a9c5ec3cfbd5d64bde50dc1cc99261c0f2adf65fdc6b9356664b9c98d796ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/error_wrappers.py__": {"doc_hash": "a8dec235004ef9a69c5af62e969313ec74a616857f638918c0ac749fdec1078c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticUndefinedAnnotation_PydanticUndefinedAnnotation.from_name_error.return.cls_name_name_message_st": {"doc_hash": "fe39bb0e295e2823fdee83b58e2f8c679c5d70d3990b169e50640f7cb33351f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticImportError_": {"doc_hash": "82962d93d4ab9c78f3d696af230cf887fd6f3bff2713e3249d3051c5549dfd33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.get_default_FieldInfo.get_default.if_self_default_factory_i.else_.return.None": {"doc_hash": "b5b2027e3fbcef63c4019e7c55d2ebd1e13eab9246feb45e859b58efffb95bd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_ModelPrivateAttr.get_default_ModelPrivateAttr.__eq__.return.isinstance_other_self___": {"doc_hash": "8960580282b4849a5cce6e091b1f0b4249d37f39089d93fde89386d7747eb1dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_PrivateAttr_PrivateAttr.return.ModelPrivateAttr_": {"doc_hash": "e5b1c0ec62c690df08e170ab01eaf90a4c17731dd576b68595489feb92893e2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/generics.py__": {"doc_hash": "1a2d4cd418e2b27f4af53d5546e224cedd97e48c2a803ad2f348f184e5625c86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json.py__": {"doc_hash": "b0b6c3df14f2e651eba6ebf9a82332e9a7c0429acb1a6640b727a814a66eb38d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__pydantic_init_subclass___BaseModel.__pydantic_init_subclass__.pass": {"doc_hash": "a268049ff27862753405c8c2b792861223cf401d83f4ee72a89cd05197d4d6f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_copy_BaseModel.model_copy.return.copied": {"doc_hash": "f3515cfdc73504e057bb4fc1e20bf9e66ac4deadf9cb1b709a4ba180e206135b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__copy___BaseModel.__copy__.return.m": {"doc_hash": "23c297fefcaf6b176bb374c0964a46938fa2f9f2bac102d4fc418868fa1da77d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/parse.py__": {"doc_hash": "8530f94809b7674ae3fa6f59ee295541e45860cc9b8881531182266e59863bf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/schema.py__": {"doc_hash": "65771a38dcdeed5f5f4552e99d661074e622e3eadf3111e094bbaf86ca673921"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py__": {"doc_hash": "d07911b1de7eda2b7a531d749651090623ee955763cf35aaf413ac3b9ca7bb11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/typing.py__": {"doc_hash": "d9399de8fba955ffd7eaa3be11b0bc3baa258e46b8356f6b6e5b62903cecf0c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/utils.py__": {"doc_hash": "a6adc42b0240afce2ef0158ec1ab6716608f251210f6cfe45dc751175c04357b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validators.py__": {"doc_hash": "e2da5cd654d21754e04830b084f1420631e21921aaed64546d55431fa8070a0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/computed_fields.py_from_pydantic_import_Base_": {"doc_hash": "a3e9111b1f8e1c61afe70c90622b080a996102141a39b4ae4d685f79c895d63d"}, "/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_field_info_repr_with_aliases.assert_repr_Model_model_f": {"doc_hash": "b571d73261e8a7b47ca9a6475658572d90e0f26e612a47a32c024c78e687bfaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_low_priority_alias_test_low_priority_alias.None_5": {"doc_hash": "1bb3580baa3e4c6ea870f52954ad7adb1e5b73b5854c17893b3e1929ffc1e29c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_empty_string_alias_test_populate_by_name_config.with_expectation_.assert_f_bar__expected": {"doc_hash": "ee68c250abe4eadc25ca5196cba6631b9458e153a8d4ce1960c23ccaab086fef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_test_validation_alias.assert_exc_info_value_err": {"doc_hash": "a5ea91e6f09db5e990eac1e9bcd6758386d036b73c065e149eca9d3b073bcdb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_with_alias_test_validation_alias_with_alias.assert_exc_info_value_err": {"doc_hash": "025c335c28ba39a616f099f75367ada1482c9e7bb49ba377b8594115db309584"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_from_str_alias_test_validation_alias_from_str_alias.assert_exc_info_value_err": {"doc_hash": "371f9f5fbaf0084866d70ccd05e771b0beaa9ed43157254d0a6d5bb9d1c00b09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_from_list_alias_test_validation_alias_from_list_alias.None_3": {"doc_hash": "08cb3a0b4ec7c763ca6bfe5f160b0a6b4052540f07d46e6f21e00269c232e4fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_path_test_validation_alias_invalid_value_type.with_pytest_raises_TypeEr.Model.x.Field_validation_alias_12": {"doc_hash": "daf1b15aeefd367364b76fe216ff455a0d706a81e8118a82dc29c5d0e7cc14ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_alias_test_annotated_alias.assert_MyModel_b_def_e": {"doc_hash": "9952d5fb92a7895ce2a1f4a995de9f21d167494d64764ea7044bb5bc85ea5b55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_modify_get_schema_annotated_test_modify_get_schema_annotated.None_1": {"doc_hash": "aca0dccb8739bef6601678c02f2147cbe1f6f9ab2895161b95349b211d761db8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_set_test_computed_fields_set.None_1": {"doc_hash": "79401dc92cde2a1c0370ee5c2efe44967284d1d7bf7a80933e9620eacfe3b375"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_del_test_computed_fields_del.None_3": {"doc_hash": "1468d352bee43e22daa4857cc112bee7bd884cdddfede453a24decd8d448d24d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_cached_property_test_cached_property.None_6": {"doc_hash": "940c9162ab72f2a831a6db83a267b1f0fc340d90547f32b8e8e9475dfcdf8716"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_properties_and_computed_fields_test_properties_and_computed_fields.None_3": {"doc_hash": "7c657145cffc9eeb8ec3289e4be0dcd5fac2fa425d6af22c949f45dd8226156d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_repr_test_functools.assert_m_neg_True_is_Fal": {"doc_hash": "e328ac7ecde90ba6958423f9e22772b5376ffc710594fcd720439bb3c2367639"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_include_exclude_test_include_exclude.assert_m_model_dump_exclu": {"doc_hash": "452b9c6bec621220597e7ed7c85f577e664f3195549b354073d675020a3f72cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_expected_type_test_expected_type.assert_m_model_dump_json_": {"doc_hash": "9c9141bc7df414fc89c3d0cae92e0ae18a0beaac9a44d64f2baa5f56d010be59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_inheritance_test_inheritance.assert_c_model_dump_": {"doc_hash": "10b8ebc7ad1be93faa5de440f7ac4ba1c9648817655f6ecd298dca2759d0c7ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_dataclass_test_free_function.assert_m_model_dump_": {"doc_hash": "f3b6369acb3582a58436ae16a2982dddaf9289b4b87e7022d468cc24ab047572"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_private_computed_field_test_classmethod.assert_m_model_dump_": {"doc_hash": "86778c8d220f40d41853f9075e28d6115efd424eab10393cbd2497adb9f5f9d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_validate_assignment_test_validate_assignment.None_1.m.area.3": {"doc_hash": "3b60f54e4116d33471c67ff2837fff4d42ecf4e6e4b0cb04990aa621ac50ebb1"}, "/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.assert_str_to_lower_not": {"doc_hash": "78cce05144b10bc9b972f7ca7f202b705b6b41797e0f831e371b450ce063b83e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_invalid_extra_test_invalid_config_keys.my_function.pass": {"doc_hash": "c310fe550e9fb49c0f30aeb10f07fe01b5cdbc989574fe68cf4d28d3f5edeef4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_multiple_inheritance_config_test_multiple_inheritance_config.None_15": {"doc_hash": "bdc930f6fed89847fb9ecfa1842d07b8bded405eefde3fe2fa5e2f3382e0bf22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_hashable_required_test_hashable_required.None_1": {"doc_hash": "d109c19ed45535b4c2c46e92089e4132e52763379ddea1a59f03917813f03d8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_lazy_cases_for_dataclass_equality_checks_lazy_cases_for_dataclass_equality_checks.return._case_i_for_i_in_range_4": {"doc_hash": "7628bf7692ed67de97cf71a90a077d5fae31fea2c2fb2fedd393a80a4321bcce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_equality_for_field_values_test_issue_2424.assert_ValidatedThing_x_": {"doc_hash": "89956aeec6ad8571dca8f8bcea7cbd5069a6f44335dbdde794f59b9d2917ff61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_allow_extra_subclass_test_forbid_extra.with_pytest_raises_Valida.Foo_x_1_y_2_": {"doc_hash": "d9f45503503a50037006ad8afd31728f38aa6872277612fc706137a1b1934b04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_self_reference_dataclass_test_self_reference_dataclass.assert_exc_info_value_err": {"doc_hash": "076f069bdf63d555f63cdeb4f72283978444b8b465287309ce338b124a860ec7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_config_validate_default_test_dataclass_config_validate_default.assert_exc_info_value_err": {"doc_hash": "5d2bcd95c6c09a1a6a29a85ba189f1f048daca857029ebbce0a0be8dd664cda6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_unparametrized_generic_dataclass_test_unparametrized_generic_dataclass.assert_exc_info_value_err": {"doc_hash": "9d663723a271ea13f8eb142179cc799f41c6fc38ef1b91014c85c441c3564f2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_parametrized_generic_dataclass_test_parametrized_generic_dataclass.if_not_error_.else_.assert_exc_info_value_err": {"doc_hash": "fc501dce38c5366938b7bbcdd03649a84e00445152239abd5a86f9fb82966f33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_dataclass_preserves_metadata_test_pydantic_dataclass_preserves_metadata.assert_FooPydantic___qual": {"doc_hash": "e9081fd46fa9e76840e3947aceb9c0cf9211c14e648ed60f09fef87da9f8fa01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_re_date_model_fixture.return.DateModel": {"doc_hash": "12b371ccd3f05b9c8d675c03d007930a3752568924708963caa478d0873759a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_properties_test_extra_allow_from_orm.assert_not_hasattr_model_": {"doc_hash": "ce907dcc4463f572d9cbe3890662a8ebb673c96cf042cb3440413789a4920d34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_parse_raw_pass_fail_test_parse_raw_pass_fail.assert_exc_info_value_err": {"doc_hash": "07629ee69d82b18bcdd78fc13bcad7d3a3676d047669bb78017080d6cd625ed7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_min_items_deprecation_test_field_min_items_deprecation.assert_exc_info_value_err": {"doc_hash": "2e6ae8f65d108cfae2de2a6ed1bf09b3d4746d3138870e42343f748d951b62eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_min_items_with_min_length_test_field_min_items_with_min_length.assert_exc_info_value_err": {"doc_hash": "4a5d7cbff926b5ab916bda75e2754f5ae990e441b12ee355132869f440f78ffa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_max_items_test_field_max_items.assert_exc_info_value_err": {"doc_hash": "afed54694bd4afbcebaca1d5315ed74ff42db398a90f962001da9533960eaff0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_max_items_with_max_length_test_field_max_items_with_max_length.assert_exc_info_value_err": {"doc_hash": "1fc2fbb4784244c09b43aae14248653121ce8275ee632e66f05808be14ed2f5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_parse_obj_test_copy_and_set_values.assert_m2_x_2": {"doc_hash": "1d88d56795cfe3222239233a81daf49d4e45d16a025cf4a93566879027979579"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_get_value_test_get_value.assert_v_1_2_3_": {"doc_hash": "1e9532bd48041ec1ab6daeb62aa5a124bc5c4cfd1961e3628bdc68f0da2d4240"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_args_test_args.None_5.foo_1_2_a_3_b_4_": {"doc_hash": "3e0f31893ac451fa16e7bcddc1d8643fa0c878ba786c44e20229b251e3215c9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_wrap_test_wrap.assert_repr_inspect_signa": {"doc_hash": "8bbb3ea52f1205c33a5fe860425dab4a031a99822dd1bbee62b60939fc93fa1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_kwargs_test_untyped.assert_foo_1_x_2_c": {"doc_hash": "372f71d6e7dcc74437ba871a1e41e5df443920ad6b67c7cb0de2a3a345be68f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_var_args_kwargs_test_var_args_kwargs.None_7": {"doc_hash": "600c025bf1723321434fa917b71386e6a304deb8e8a8db1b555a25c701323bb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_field_can_provide_factory_test_positional_only.None_2.module_foo_a_1_b_2_": {"doc_hash": "e9eb0e2851d4f6e2681a577581cc90dc1960d7c23abca7d7db96edb1b0156407"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_args_name_test_args_name.None_2.foo_1_2_3_": {"doc_hash": "c00475e4650adb9f7c1e57e986485096b9c13ceaa4a9d1f4f12f4a383a19bf52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_v_args_test_v_args.None_3.foo4.pass": {"doc_hash": "55e5fe33f01e66e956952ec823ad8f2e33ec309a92068eca186788eef6a16851"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_async_test_async.assert_exc_info_value_err": {"doc_hash": "53b8d22a69ee1838d6c2c17d7078d65b4537bbdb712342667143725137180388"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err": {"doc_hash": "36c92bf950ad764408e4ecc571d50e2fffb45c11de3b0acd4379b18268f5c597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_item_method_test_item_method.assert_exc_info_value_err": {"doc_hash": "6637f13e310513d52fe34e5ebfa3814577b8e55ddf5b58865711ade8dfe4e189"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_class_method_test_class_method.assert_exc_info_value_err": {"doc_hash": "35688de53c4583f78ec3efab8ea573645d53fd95354dbb907ccff789c191f879"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_config_title_test_config_fields.with_pytest_raises_Pydant.foo.return.f_a_b_": {"doc_hash": "41a8fddc4071e1dc0625a7f4021be3e0479ab7bb330918d2cd934c64f59bf54d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_config_arbitrary_types_allowed_test_config_arbitrary_types_allowed.assert_exc_info_value_err": {"doc_hash": "0602b1244610c5eaace3cafd083c9803f99d123c0e4b790301ffae122eb13dd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_validate_": {"doc_hash": "ac333e39a5e7a11e17cbc52ca52623204149dc93d6440a9e4bc8be4765d23d0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_validate_default_test_force_extra.assert_Model_model_config": {"doc_hash": "914ab4f4b6bd157cd7efdab65f01ac623d2776596f74fc62190b4aeba41caed4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_hashable_optional_test_hashable_json_schema.with_pytest_raises_.Model_model_json_schema_": {"doc_hash": "772b40cd1f9cebb552106d5b0527b5fe42a9a5aa71effb082d8448a2c17c227a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_default_factory_called_once_test_default_factory_called_once.assert_exc_info_value_err": {"doc_hash": "f9310fc5dc6a69f2f8af0e035fdc9c9bd9662e3da6b21a747fb792807872cbe4"}, "/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_model_fields_s": {"doc_hash": "7af427926c5ba31960063ee32049b98aad0cc82efa9e259e2a4e0ad7f8af5ed1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_custom_sequence_behavior_test_replace_types_identity_on_unchanged.assert_replace_types_type": {"doc_hash": "036a47040953d223589649624c74d7b628e5694045653d05903e1c2d521fbf61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_deep_generic_test_deep_generic._i_e_inner_model_is_co": {"doc_hash": "1e56e094b2dac88404061381a7d0ee89a7574cd5515dcf1204785bde1dcd5b49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_partial_callable_test_generic_with_partial_callable.assert_not_Model_str_int": {"doc_hash": "092eef3c3dac3a4708449f1714bdd96495909b9c9291e34bd0bf8c180176cea4"}, "/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_test_construct_other_generic_model_with_validation.assert_exc_info_value_err": {"doc_hash": "49820bb150821919a351a6e8190b4ca376d988cb25a38e871bf1089061315694"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_enum_bound_test_generic_enum_bound.assert_Model_MyEnum_mode": {"doc_hash": "ddbe394014f5ced51dce849cd6b69cf7967ac8df1d00c79c78d15ea59265cfa0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_encode_dataclass_test_encode_pydantic_dataclass.assert_json_dumps_f_defa": {"doc_hash": "fb2c963ef2124ed6288f1da7c38a83ee6bbecef9f0a3787091efd57bbcce20c3"}, "/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.SpamEnum.__get_pydantic_json_schema__.return.field_schema": {"doc_hash": "fd8667e4ab3ea17381abbbc22f503801da9956595ab5432f3602eea5d7edf272"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_modify_schema.Model_test_enum_modify_schema.assert_Model_model_json_s": {"doc_hash": "78bb4f5969c45978e3a84170fc94f70bf4314b942ef81a9565aeb339bc69a36c"}, "/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.__get_pydantic_core_schema__.if_hasattr_source___arg.else_.return.handler_source_": {"doc_hash": "bb4d25de97c132fa3c842188309444843d6f3b431ff10f07270a7a546b619e65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema.Gen.__get_pydantic_json_schema___test_advanced_generic_schema.Gen.__get_pydantic_json_schema__.return.field_schema": {"doc_hash": "5bd8309a2ad2609557c637a9db3013589135116a06e68f7fdb08e3e46ac8ccff"}, "/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.__get_pydantic_json_schema__.return.field_schema": {"doc_hash": "14b11bc64172f8c63af4b8b2ba83f6d9d765387b44d58469b9604bdccb1c647d"}, "/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_test_override_generate_json_schema.assert_MyModel_model_json": {"doc_hash": "d0d2f9e5e3a906a7839005d90daa2218e5baa04405fdfa8b326eaa3ebb22ee42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_default_json_schema_test_nested_default_json_schema.assert_OuterModel_model_j": {"doc_hash": "ca83ea10577612ddd17d72de82b5e191b3d0d5d65da55b938555ae2a501f4362"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_get_pydantic_core_schema_calls_test_get_pydantic_core_schema_calls.None_4": {"doc_hash": "9cdf90658ffbaa3510ee484b2932fd3bc999f02b2e8e6895737f7972c36eaf1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_field_order_is_preserved_with_extra_test_field_order_is_preserved_with_extra.None_2": {"doc_hash": "93fa157bee4a6eaa1678e7d151c1e81770573f64bfda61a03777fce0b6e53893"}, "/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_list_of_model_instance.None_1": {"doc_hash": "69e7c2b2a448872249724203b22579e01d0cccf7175446061afbfd9491cff88f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_untyped_fields_error_test_custom_init_subclass_params.assert_NewModel_something": {"doc_hash": "21b6ef026186f8be0a468018732e2f9279a38c497d074b7dc804a9c613c77d59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_recursive_model_test_recursive_cycle_with_repeated_field.assert_exc_info_value_err": {"doc_hash": "d5735c100c7fb7a6a2e26f12850ca3f0cb8c177aed35d1a9bdfa3a2359984bb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_two_defaults_test_default_factory.assert_SingletonFieldMode": {"doc_hash": "ce89a48e7e1c3e3995b1da3ed1aa38f5d6a4ae4d197e6b4bd7ee90c266ab9d14"}, "/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_annotated_final.None_3": {"doc_hash": "94714aaca21f1bd823a0598365d237face2ed3e9dee6088e18ef3d6cb9029f53"}, "/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.None_3": {"doc_hash": "0b8adf28216d82f91218c6e6d2191172d226b8f15206182fd502ee00e035cda9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_call_signatures_test_post_init_call_signatures.None_1": {"doc_hash": "a2b554f11ee296eb4fb636b2eb7e34e3569fed93bc130d571f488469dd100543"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_json_context_test_validate_json_context.assert_contexts_": {"doc_hash": "6e86bd41937927c6d21d5a2edf198b0c5f8a4034280b55c0300ed895529f8aa1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_pydantic_init_subclass_test_pydantic_init_subclass.assert_calls_": {"doc_hash": "4cd1b8e73f6a556da105c810d0fad69426e56fda462f98fff0070770219e94ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_migration.py_importlib_": {"doc_hash": "4cd2e09d3c543fcc320a4d418c93435ded425c646da7b34fd5cd0e76b968d71d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_model_validator_before_test_model_validator_before.assert_Model_model_valida": {"doc_hash": "3acef811be1bc7079aa2b590b549fcb2ebd7c0be1e1f9c5860325123c4ccbab0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py___test_serialize_extra_allow_subclass_1.assert_json_loads_m_model": {"doc_hash": "d9c7f3332a513e0cc7107f26891b7b1b0b95b5bd58b904edf1f993e572aabd98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_plain_always_test_serializer_annotated_plain_always.None_2": {"doc_hash": "2cbe6b0f2c566af2c943a4d3c19beb3b60c286b08e62ede67637eddc984c00d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_plain_json_test_serializer_annotated_plain_json.None_2": {"doc_hash": "90ade85c073f2f843892f6dfa8a9226a9353e3885437b64c8cf8330dbcdf5130"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_wrap_always_test_serializer_annotated_wrap_always.None_2": {"doc_hash": "9aed92961789edef5988252dc615f15d1a9aecac0adad7f40d4c2032b889ee1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_wrap_json_test_serializer_annotated_wrap_json.None_2": {"doc_hash": "a68a43dfa8bee9ed744075e56cabe6210c4b6ff0fca6ded788485709c3052f89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_typing_cache_test_serializer_annotated_typing_cache.assert_FancyIntModel_x_12": {"doc_hash": "658040abc95e54f7da2217792d6ee1397e6972eda8b2b4d13f7543d47b7f439b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_decorator_always_test_serialize_decorator_always.None_1.m_model_dump_json_": {"doc_hash": "3d9ca3cc1f5f0ce7e53ce254efeb2e537b800490da81db28586df715df8520e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_wrong_args_test_field_multiple_serializer.with_pytest_raises_TypeEr.MyModel.serializer2.return.v": {"doc_hash": "a777b831367d95040d516ffb03c6fefba9aa3ac1741ff0ea71c2f21514177c73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_field_multiple_serializer_subclass_test_field_multiple_serializer_subclass.assert_MySubModel_x_1234_": {"doc_hash": "b9b7b6b994dcbb181198c41d6b1e2613878e91d2eac7f61e6941b2292dc07d6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_partial_test_serialize_partial.assert_MyModel_x_1234_mo": {"doc_hash": "5644c078e4e57e4141bde38b030c2e8aa3b1f3fa930bcf25c50ac6b3806659ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_partialmethod_test_serialize_partialmethod.assert_MyModel_x_1234_mo": {"doc_hash": "f50b7735895edcec8048e246699724739ac8ad3d6bb96c3180b0a8393eeb7936"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_inheritance_override_test_serializer_allow_reuse_inheritance_override.None_1._.other_func_name.return._parent_encoder_": {"doc_hash": "f122b4b6bc5f3304d74b0c26a293076ccdea17107de65d633440ecc515407588"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_same_field_test_serializer_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d": {"doc_hash": "9bfedfbd0912a7274f017df124519072f00dfde3297df9c8ff98ad93476228c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_1_test_serializer_allow_reuse_different_field_1.assert_Model_x_1_y_2_mo": {"doc_hash": "827ddeb61ca7a411768095303fefa3f4599868410e35b255b4dfd1efcc9985a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_2_test_serializer_allow_reuse_different_field_2.assert_Model_x_1_y_2_mo": {"doc_hash": "bae09e83d6a6091e2381363225dca3822f3d9312e09a6f94b2f14ce9067c848b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_3_test_serializer_allow_reuse_different_field_3.assert_Model_x_1_y_2_mo": {"doc_hash": "4809e12372df036d735390036a5c91dfda34aeb4fcd680397fa782d1b5a20095"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_optional_test_optional.assert_exc_info_value_err": {"doc_hash": "d2bacad61c4b855eb1feaeffe8128a6fc782cff32adc8b9a326d996293eeab19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_wrap_test_wrap.assert_repr_inspect_signa": {"doc_hash": "19bc66f9580c00afc8a9674c400e026130aacfb774436a6aadd455349e66d1ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_kwargs_test_untyped.assert_foo_1_x_2_c": {"doc_hash": "65eb2549497b60fcc5957b33953888357790bb249496594d2198f453f4658ab5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_var_args_kwargs_test_var_args_kwargs.None_7": {"doc_hash": "1aa7a7f0a56bba0c3a3a88df4130eb96c80ff9dfb5de609a9761b28056c6cbc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_field_can_provide_factory_test_annotated_field_can_provide_factory.assert_foo2_1_100": {"doc_hash": "e93f4310d56e7d27ca7be090129aef472dc495f8283b9bd9378b3fd9d40a84ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_positional_only_test_positional_only.None_4": {"doc_hash": "5a608f4238c57cdbdc9ffba63898b0c8edbdcfacd682043dddb028f86662c99b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_args_name_test_args_name.None_2": {"doc_hash": "1360c73f934b80e43f8388bdd34941ce3db3c9fcfb9ed7e746f99957fd08f6af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_v_args_test_v_args.assert_foo4_123_123": {"doc_hash": "d9bb61f96e1c9c0baec22832f4bf2cb513933f66eab7516e007cfb409d6c46ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_async_test_async.assert_exc_info_value_err": {"doc_hash": "e12fd96b725306bf6b849c3bc185c1e380b84e3bbe408b0946a4dd7184fb30c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err": {"doc_hash": "a74a3b4fd8f71a91623f6f83f1a5c38645d52da8477b145a68b4f74b28f39c07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_local_annotation_test_local_annotation.assert_exc_info_value_err": {"doc_hash": "b0a58b84dc3123469f76445c54a03cce842ec1cc285d997efe23b4da3e5d5b5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_item_method_test_item_method.assert_exc_info_value_err": {"doc_hash": "85de92d0699dfb41ac62b3b0fa2a8117a285f5ed6a8b080eb053b43b6526344b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_class_method_test_class_method.assert_exc_info_value_err": {"doc_hash": "70cda1a190eb66c63e091d9814c38d05d3f1d5275ce0726ed7744a80327704c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_annotated_use_of_alias_test_annotated_use_of_alias.assert_exc_info_value_err": {"doc_hash": "98f385b22096a8b6cf4b1e686d0b7ef862a705002fb3afa0a414f3aafcd4f190"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_use_of_alias_test_populate_by_name.assert_foo_a_10_c_1_": {"doc_hash": "897ee5f1bf108aeaad47865be60d40fa29da49d4db7a4d4c598fc7f562c91167"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_wrap_test_annotated_validator_wrap.assert_exc_info_value_err": {"doc_hash": "604575b27d8752d00e7f0bcb0485ae6d6fa391e91734ca887f972b98b7ad3435"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_nested_test_annotated_validator_nested.assert_exc_info_value_err": {"doc_hash": "182f2e495c530e06f77553839cacdeb5afdc496ee1270fedbf9e0ddecd1f24ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_runs_before_field_validators_test_annotated_validator_typing_cache.assert_FancyIntModel_x_0_": {"doc_hash": "a37c97239210d716bb2db2bda4e969616aa6a0d18a90f7571b7e7b3a161faf44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_simple_test_simple.assert_exc_info_value_err": {"doc_hash": "5898a839e59a24dfdaffe6efe8d100ef544c6c66659f72030ed31c9f280d654a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_subclass_test_root_validator_subclass.assert_Child3_x_1_expect": {"doc_hash": "ddd53287199f0213383d21e9546fe30789230232a8228fda766f3975e9437330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_nested_literal_validator_test_nested_literal_validator.assert_exc_info_value_err": {"doc_hash": "768129741248dd9b17db5f096f910f1c0d4eab618e96513682b17c7c59efb5d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_model_config_validate_default_test_model_config_validate_default.assert_exc_info_value_err": {"doc_hash": "39ce6778b139bea092cda69e2ed29d2da38e49ec6ef15ee90e417a9a5a53419e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_partial_val_func1_test_functools_partialmethod_validator_v2.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "421fe78db294f660e24a2918ddc70f9c6b09d2cc8c2c18c3b86b601fd5e31271"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partialmethod_validator_v2_cls_method_test_functools_partialmethod_validator_v2_cls_method.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "000aa2a8c6cc3dfc0695f0bc7694a5ea0a0fbbaa3be30ecc3f378f85b4d80b16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partial_validator_v1_test_functools_partial_validator_v1.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "79d6db5e4aae12677bb838c781b4361bc29b0afeac3ea3366a02b7b6f3635c3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partialmethod_validator_v1_cls_method_test_functools_partialmethod_validator_v1_cls_method.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "144493a9e14d5ff34b76b6f4379b7c380713f8386baf7aef71b93051bca988b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_inheritance_test_validator_allow_reuse_inheritance.assert_Child_x_1_model_d": {"doc_hash": "ad765ab5c8b8650a93713409399bd3082428474c68fad19f69ef0895a67d849e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_same_field_test_validator_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d": {"doc_hash": "e7b66d5567b55ae50b7366a0fc996c37cc380bbfd0545138621d2b21df68c764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_different_field_1_test_validator_allow_reuse_different_field_1.assert_Model_x_1_y_2_mo": {"doc_hash": "1613bed76539b3d98ef32c60f8cdcea3e414bace161d3bd33166c821a0e3ab39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_different_field_2_test_validator_allow_reuse_different_field_2.assert_Model_x_1_y_2_mo": {"doc_hash": "090a921c1b9e967d84c1868111e99267de115ac7cba7326f0a9bfd980a08527c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_different_field_3_test_validator_allow_reuse_different_field_4.assert_Model_x_1_y_2_mo": {"doc_hash": "1c9e9eebc40a90bc712ba6784ffb503002234a92f7a92abf9c5e2f76dea42bf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_allow_reuse_same_field_test_root_validator_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d": {"doc_hash": "2375346147ecd83ed5b76e2b2934405cffad9874308de3fcce5bb31de5c61e1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_from_dataclasses_import_a_test_simple.assert_MyDataclass_a_thi": {"doc_hash": "d43062ca44cbfd4f06767d17408572de79c882d5215b0338edb6f319b25621b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_collect_invalid_schemas_Walk.Callable_core_schema_Cor": {"doc_hash": "59d84413edf15c1514256aa5d16e640de030ffcc3e5891ab03fb419715522bfd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_definitions_schema__WalkCoreSchema.handle_definitions_schema.return.new_schema": {"doc_hash": "59820090c8eb5f7acc9449f28ed7fa1f5b57469856a777e4d5d2a59d997a9c5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_arguments_schema__WalkCoreSchema.handle_call_schema.return.schema": {"doc_hash": "73d7e5ca8aeb691b8e9f467fcb65a7d70510f76b020617c0b04d5d763646f1b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__dispatch_walk_core_schema.return.f_schema_copy__dispatc": {"doc_hash": "7b3abb8feb308f57103b4e48625e52c500c3a6af442dc1b4a21a4674d7dd5758"}, "/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_model_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_model_choice.return.self__infer_discriminator": {"doc_hash": "aff79122f6f0e69dfff2733eeaf10f9fe84c1d4b99e731ffb644378d0fa4f7c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_md_field_schema_GenerateSchema._generate_md_field_schema.return.core_schema_model_field_": {"doc_hash": "9192512cac5eac37f8a1c9514e43e954edfb275c442208dc7ee02bc64e490598"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._get_wrapped_inner_schema_GenerateSchema._get_wrapped_inner_schema.return.CallbackGetCoreSchemaHand": {"doc_hash": "6ab924f9a617ad7413987ddefd69ba1cd47f109b64b10429ff94fae54e8c011a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__extract_get_pydantic_json_schema__extract_get_pydantic_json_schema.return.js_modify_function": {"doc_hash": "4cd96234e56ba76cff92554a4a9d141f9064eedb877aa96edfee3209db9553c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_collect_known_metadata_collect_known_metadata.return.res_remaining": {"doc_hash": "f51bccf92021d6bd8f79ccd8e731eb351ec6d67c3d101057ae9857f235a1bd53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_check_metadata_": {"doc_hash": "9e1739f2a6cac79ab5f496c683e2efd08ecb2eb0438fe2b5a132ac2d1f07a4ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_path_schema_prepare_pydantic_annotations_path_schema_prepare_pydantic_annotations.return._": {"doc_hash": "9f666f2fbfcf1dce0f8b7fcf6dccaf0b9666123478ba35683bd26385c1c50021"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_dequeue_validator_dequeue_validator.if_isinstance_input_value.else_.return.collections_deque_handler": {"doc_hash": "2c636d21cebf899d6722cb3183aa8da8f866212b30b5fc7ca85e4c19a1a96e50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SequenceValidator_SequenceValidator.serialize_sequence_via_list.if_info_mode_is_json_.else_.return.self_mapped_origin_items_": {"doc_hash": "96bbb7e6e7a87d03181f67840954240aa67483cfc814cfcb9d5a2aae844ef84a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SequenceValidator.__get_pydantic_core_schema___SequenceValidator.__get_pydantic_core_schema__.return.schema": {"doc_hash": "4bee4b8bc048d2b7947f100c488e2b4e9f1431de3e36a602c01b13dfcda89752"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SEQUENCE_ORIGIN_MAP_identity.return.s": {"doc_hash": "107d8020f0374b2afba48a9e14f2c6a1ca31e6cf8b61e2d9ac8028ca809d66be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_MAPPING_ORIGIN_MAP_defaultdict_validator.if_isinstance_input_value.else_.return.collections_defaultdict_d": {"doc_hash": "1cde8fe1402df79944a89585b490b268be3c5fc11cc95a80d23bc3eb0a58492d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_get_defaultdict_default_default_factory_get_defaultdict_default_default_factory.return.default_default_factory": {"doc_hash": "153be1901595bf91d79e962eaecfb23ca6f7c102bb0de6192beb1eac1966c67b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_mapping_like_prepare_pydantic_annotations_mapping_like_prepare_pydantic_annotations.return._": {"doc_hash": "69b396db5427ae36c5468a4298e10c0e6fc1c08a0c2da6766e9ac07040153cee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_migration.py_REMOVED_IN_V2_": {"doc_hash": "0c3c95a942ef0752dd0f2fdfc9d205ba73630c7ecb09339558bf80c4f879cc0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/alias_generators.py_to_snake_": {"doc_hash": "4e8bc0a08626912faff7eb72b96d918bffd1e1aaf652d22722524ea08a507aa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_validator_validator.mode._before_if_pre_is_True_e": {"doc_hash": "f3db47f5356bb22958623b2c06d1e5ed0ffa333326aed223fc6aaa790df0664a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_validator.dec_validator._type_ignore_return_val": {"doc_hash": "c5970099c4284965faca9f1c045ce27faeb6fd2552c49ef2431828d8e7bdc6ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_root_validator_root_validator_3._": {"doc_hash": "a00557edf8da8298c991c15b9e1f1a921ded8f25a92a0c755e47f3487fa27949"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_root_validator_4_root_validator_4.wrap.partial__decorators_v1_ma": {"doc_hash": "cbd92711074e83602bd9c6ff6ae923a6afd2d141a8ec40c175fd96866d9f6c4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_root_validator_4.dec_": {"doc_hash": "9726ca995aeeefbff4c77d07b001ee2e20f9f648a6e5288b0b660feb8cff7a74"}, "/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_items.yield_dict_key_v": {"doc_hash": "a349f2003e451423412253b82fea569011d2996f957897be339916a474df572a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_if_TYPE_CHECKING__field_serializer_2._": {"doc_hash": "9ee00ad1cc5d00a20f15e45ce80952ba1ff19c83e53eac1b299e8b53d930ad36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_if_TYPE_CHECKING__FieldValidatorModes.Literal_before_after_": {"doc_hash": "e79dd91169836f704198a738fb4921400019cb8ab059d54b6d79a378c65dcc5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_field_validator_2_field_validator_2.if_not_all_isinstance_fie.raise_PydanticUserError_": {"doc_hash": "494d3c8ef8d1bcb695861009d01294b4f8fe3272ba9b2c11f4746222d8da919a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_field_validator_2.dec_field_validator_2.return.dec": {"doc_hash": "9a5d624f62ccba1da213f55bbf04115dac0dc37d360459a9d0a2e2f5763a8fdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_validate_BaseModel.model_validate.return.cls___pydantic_validator_": {"doc_hash": "62ba32157848d917aef6b8cebaa2bdcd209b5d0fe4d5c8c2ebef255657e6e843"}, "/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_": {"doc_hash": "ee9caa70b33d9864c26d21f948dbdedfacba05892fff72cb231fc12c888fefed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__deepcopy___BaseModel.__deepcopy__.return.m": {"doc_hash": "7a40a116f31c1e54f095d07ee1c33619fb3bdd44b6d128e14a86100c6fd99808"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__repr_args___BaseModel.__repr_args__.yield_from_k_getattr_s": {"doc_hash": "f8919792891955cefb678968fb8aa71c7f0430f46e98ca32d8f034710c3ca59c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_BaseModel.schema.return.cls_model_json_schema_by_": {"doc_hash": "ef1706d42709c9ba1a7d45baa1d4fa47e5f54e0fe076355577637bb3a654b235"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_json_BaseModel.schema_json.return.json_dumps_": {"doc_hash": "c9c536d7d3cb5dda3ab0ae1088d3e63462ed4a222ed4ef527ab60436dc9a0f57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_UrlConstraints_UrlConstraints.__hash__.return.hash_": {"doc_hash": "9d1a49e284725f93010e28f8d9d097ad8ae784057d240a988972a5e091b81ed5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.validate_python_TypeAdapter.validate_python.return.self_validator_validate_p": {"doc_hash": "17ed83f04f1e680b78426d8ae2f5b14b28459eb4c7c0b541433e1727f6bbd122"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.validate_json_TypeAdapter.validate_json.return.self_validator_validate_j": {"doc_hash": "cdc57969a59e07d40323e0171704929ccf7df106a35801c7605e9ed76f22b19e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.dump_python_TypeAdapter.dump_python.return.self_serializer_to_python": {"doc_hash": "bec3186dc6d3f66c9d3f06e1361a0a3ebdc420d6fdd41647605e79123a09b740"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.dump_json_TypeAdapter.dump_json.return.self_serializer_to_json_": {"doc_hash": "421f4791b3331d05624a4f02ba7d1795cfbb18b2da446706ce383912bacee95c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.json_schema_TypeAdapter.json_schema.return.schema_generator_instance": {"doc_hash": "a698ed4188e2d62607a0e6f02efdb8e2904d2e5c0a55774855d0063e63ad9c58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.json_schemas_": {"doc_hash": "bd732575825f6067ea391f7b28d0f71f8c625bcd1f8b6d8112d966947d1419fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Base64Encoder_Base64Encoder.get_json_format.return._base64_": {"doc_hash": "e7a615c5222aef8fa7aea170777aea4f98b7ff34e4ee3f599b5480202b8199b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_EncodedBytes_EncodedBytes.__hash__.return.hash_self_encoder_": {"doc_hash": "7a2f89bcd374d7e9eca3eff5ff758f85383f8b975a8fae90e91d39f950edb8e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_importlib_disable_error_urls.os_environ_PYDANTIC_ERRO": {"doc_hash": "9cd36ae16bec70e3c2147ebd58e83d4e850840a5c8729cf7b1816da96d10e423"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success.py_KwargsNotFrozenModel_": {"doc_hash": "58ade2a03ab41268871b2d6678d7271e7382a9f9579c3df7f282ad4fcb8ebece"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_random_try_.except_ImportError_.singledispatchmethod.None": {"doc_hash": "44f954a3d5762f2d831125c583f7e8e7369212fdcc89a6a9befd136036bf78e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_expected_type_wrong_test_expected_type_wrong.None_2.m_model_dump_json_": {"doc_hash": "8f2cf4330e50ef9a2819094b17d3bb11d5123f47b46647e30e2308b933ddd368"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_frozen_test_frozen.assert_exc_info_value_err": {"doc_hash": "30558d153851aecdd5652fb5f38d6ac6bc7fc6ef75bf994d35305a85e890e571"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_CustomType_test_computed_fields_infer_return_type.None_1": {"doc_hash": "06c238a15af3257ca3946cb941df7b6e8548e25c0c729f22dec78cc1a13105e1"}, "/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_8": {"doc_hash": "ed8ee7004fba1291042bbe4984b19b2e167fc8c7ce34b6832ca21a07e4b73ad7"}, "/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_inc": {"doc_hash": "733b115f967b43d4cad4ec0ba0541d98bcbe6903e997d69808c7efe5475ba984"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_recursive_dataclasses_gh_4509_test_recursive_dataclasses_gh_4509.assert_me_recipes_bur": {"doc_hash": "633f276c0a1e770673ef7df711c0eaded62a3c214a4b4d82a791aad5406c3610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_future_date_validation_success_test_future_date_validation_fails.assert_exc_info_value_err": {"doc_hash": "9296fb64b1482dca6bfb99247da2948b6c9a236aa87269acd4534805a982be65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_past_datetime_validation_success_test_past_datetime_validation_success.assert_Model_foo_value_f": {"doc_hash": "e4f21d2545e3bd5645299fe8ca837008122694e3c9d36fc90187a0e7ec4abb32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_past_datetime_validation_fails_test_future_datetime_validation_success.assert_Model_foo_2064_06": {"doc_hash": "7a2b3f757cf026c9e64a7a5341a6bb3d00cc06bfd3d3ad973f2c164bdc5cc574"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorators.py_pytest_test_inspect_validator_error_wrap.None_1": {"doc_hash": "900187b3d2baa6f3ace00afc26c6a313a7402b2576e2319f6bf079bddfe658a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorators.py_test_inspect_validator_error_": {"doc_hash": "741f4b0459c6c1975fac6ec80515736fc05a1a6a7d702b819c5f58a71a1382c2"}, "/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.None_1": {"doc_hash": "1ea07acc090eb1e355c903b022220c025256d07a16b03df70416bfaee7eb27d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_GroupModuleGlobals_print_callback.return.re_sub_r_https_errors_": {"doc_hash": "94570a5e9a98b96d399487ccb6eab8727ea239e9ee5e91100dab6c7e37b6f1dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_init_test_custom_init.None_3": {"doc_hash": "f0a884afe1c0ac6eafc885f994e46477943dd24207147920e99fe3e9d0468b96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_nested_custom_init_test_init_inspection.assert_calls_x_1_": {"doc_hash": "ba897025832a71e8ce53aff2756b69ce79aa1eab3bc146eb938311d53b308604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_on_annotation_test_type_on_annotation.assert_Model_model_fields": {"doc_hash": "f82e446cde6382c912a51d15a0df69e2ede24a47254cce40b613d41f866aeb37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_invalid_forward_ref_model_test_invalid_forward_ref_model.assert_exc_info_value_err": {"doc_hash": "2b344e960f19df62643cca014cf42446b743304c75fcf4a3189d466108ae120c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_pytest_raises_user_error_for_undefined_type_pytest_raises_user_error_for_undefined_type.return.pytest_raises_": {"doc_hash": "f87b42573db0f10b82276b98907f494181a628f94aa4e8eec6c41a65047af327"}, "/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_user_e.module.Foobar_a_1_": {"doc_hash": "79b78230b92dfcc9b418e05823165a1bb14ff8122be1313eb9905cad07b09e22"}, "/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.None_3": {"doc_hash": "7f6721ae7e03ac494899a17a567c8a82a7667b001ad6837783bf3581ef97ac15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_methods_are_inherited_test_config_is_inherited.assert_exc_info_value_err": {"doc_hash": "9c78e9b16550a7a17e204b124021672d93c4ea561e9cb8e8a3d32b610c6ba1fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_default_argument_test_subclass_can_be_genericized.Result_T_": {"doc_hash": "b23d57c172472952fcd834d2944f1a330a3b4548cfe3df3f80c1066bf4b4c53f"}, "/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_generic_with_user_defined_generic_field.with_pytest_raises_Valida.model.Model_int_field_a_": {"doc_hash": "a6499f85d5ade6772e89a66528bd5046e0ef9523bfa07fd8b31e71cc2d0ebdad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_intenum_bound_test_generic_intenum_bound.assert_Model_MyEnum_mode": {"doc_hash": "a348ff627199591aadff6055bfe626d425f53a47c7e0aa79f19b7211f7c2500b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_variadic_generic_init_test_variadic_generic_init.assert_my_toolbox_all_com": {"doc_hash": "7ffc61b470b687d8d1a488809b1484a440c2884cb27b7616c2d5a5443c1a7c6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py_test_representation_integrations_": {"doc_hash": "f71d43923bd9b36af0d4174e89b5cd9724738fbb08569a6bee66b0fe3d23daee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_special_decimal_types_test_special_decimal_types.assert_Model_model_json_s": {"doc_hash": "e28f274205405734f1fe6ed5a77d7a24181bd355a8e9dc0912e85b2766d0858f"}, "/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_model_json_sch": {"doc_hash": "127ed390bc6dfc4725960f6216aacb189d9207b9e50ee64bb058087b50928061"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_serialization_test_constraints_schema_serialization.assert_Foo_model_json_sch": {"doc_hash": "f711f0da3a8e612ebfc2547e0b1dc57dd3c631032a4a79f100f46b4c851a7b60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_constraints_schema_validation_passes_test_constraints_schema_validation_passes.assert_Foo_a_value_": {"doc_hash": "4ce43b5693594c1978687152872657fca048b91463d55762bf776f6a5a93de07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_annotated_get_json_schema_test_annotated_get_json_schema.assert_sum_calls_1": {"doc_hash": "7b4c2bd81c0208fd2fb42d85d77a205077985f96e3d4ef1945f048e134f797b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_serialization_validation_interaction_test_serialization_validation_interaction.assert_vs_schema_": {"doc_hash": "84829fb0c39fa06fb171415ef5a7fb86bd66ced28376606f02aeb54bbbd9b03e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_computed_field_test_computed_field.None_1": {"doc_hash": "5e69ab38b41cc73d75fe47b3b5cadfc86b18f40afb7380bd921dc97e6aa45bff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_serialization_schema_with_exclude_test_serialization_schema_with_exclude.None_2": {"doc_hash": "39ad839809f54c87554aecd5b1052ff24570688b0939fcbeb2c0c1f27f76623c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_broken_via_pydantic_extra_interference_test_extra_broken_via_pydantic_extra_interference.assert_e_value_args_": {"doc_hash": "2eeb304acb7680bbcb0e4057af909bf78e38fd5214f2750b280844f7e2582149"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mapping_subclass_as_input_test_mapping_subclass_as_input.assert_v_one_1_t": {"doc_hash": "b750e2cfa4ca39647f22eee28fa5a4c3b5e0867f5387d88dba2e00f77bd408f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_typing_coercion_dict_MyDict.__repr__.return.f_MyDict_super___repr_": {"doc_hash": "f7dd22259035a0c9c2bfcc6f07dfc39288fa8dbe9590350f630b1e618e1eb6ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_with_context_test_model_validate_with_context.None_2": {"doc_hash": "ef1b22a141e5deeb1f751d1a4710c499c834fbe12a79f8c8376e47536b9e5b52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_nullable_http_url_test_http_url_invalid.assert_type_error_ty": {"doc_hash": "8f7e063b9f4bf3c5be5d74e2e6a36241337ae3eb2178dcf94c8d5abb6ee90cae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_custom_schemes_test_custom_schemes.None_2.Model_v_ws_foo_bar_": {"doc_hash": "0189529523ab4fcf6811ec83710adfa8c0c1c5298d10f57e30902cb53d959ba2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_url_constraints_hash_equal_test_url_constraints_hash_equal.assert_hash_UrlConstraint": {"doc_hash": "e86859db4f45e2098d7179fe1bf6eb6c6e23c2cfe27430fd902386a860fa1acb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_url_constraints_hash_inequal_test_json.assert_m_model_dump_json_": {"doc_hash": "ebaf0c76a23b02d21773d7ac8d49ae9ef2fb8398928d54298fd9eb808ff6ff3a"}, "/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_test_ignored_types_are_ignored.assert_sorted_MyModel___p": {"doc_hash": "f2d3a09f5fa2615251fab4b16aceac6ef3da8de00dfd9a0bebb6dd762bf0481e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_extra_allow_subclass_2_test_serialize_extra_allow_subclass_2.None_5": {"doc_hash": "ff12fb9c19af3ea4874f970a61aa085a429928f89d924ba58a23b336a1db4b84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_4_test_serializer_allow_reuse_different_field_4.assert_Model_x_1_000_y_2": {"doc_hash": "c6abba1cc96f1893e89eee80d1edf16de887a714a13ba669cae82a4932022f37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_any_model_test_serialize_any_model.assert_AnyModel_x_m_mode": {"doc_hash": "be2a0b282fbdf335f3d46afe9f5c3939e0d801a63b36e0d56c86f8c7604c58d1"}, "/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.None_1.FromAttributesModel_u_Use": {"doc_hash": "7c50e6044297a4435a4999e1464420c3653e98aef866e8bc911fe0cfb78fba4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_all_identical_test_all_identical.assert_": {"doc_hash": "2b39e9c95908a654a6f5827b904b516f1627bc3f22cc135973c2912bf8ffb36b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_undefined_pickle_test_snake2camel_start_lower.assert_to_camel_value_": {"doc_hash": "d0b6fa849c43e351c09f21b0ac13a86a461c26a04d6d0a5415b415ff8c680580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_snake2camel_test_snake2camel.assert_to_pascal_value_": {"doc_hash": "b0862e250ef85c710a8718561b88702b72d37d06c02b76c71769ec9e3a987366"}, "/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_": {"doc_hash": "ee611cfdff091cc6d71252842e57ff028f7f077d52510501c79ba4800c78c6f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_invalid_field_test_invalid_field.with_pytest_raises_errors.Model.check_b.return.v": {"doc_hash": "c2003aafd8c4fbdcb81149f481ba95b495f8b978838e1a3066d24ddf4328a166"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_test_validate_child.with_pytest_raises_Valida.Child_a_snap_": {"doc_hash": "9485e236b008687bc5398b8b0d8a658fc98a3e62b7d79c7cb2e1ba35de263f67"}, "/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.assert_Child_a_a_": {"doc_hash": "fdfe9a181f85db5321964b11036ca3f39c1a52cbe732b3e4143d5f97f297b036"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_pre.assert_Model_a_123_b__test_root_validator_pre.assert_exc_info_value_err": {"doc_hash": "77500efeaa2f4d1a1f1115846127fd0356449e8a5a1995398b1ac7e30e0193b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_union_literal_with_constraints_test_union_literal_with_constraints.assert_exc_info_value_err": {"doc_hash": "9d905bf852eb19aa50ec7c26771f4a3e368af5069706b92445d39ade865a41f2"}, "/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": "17560e81e5c5f305616af022226568e10011093d01dd813a6ce0945b4ea4fc0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validating_assignment_model_validator_before_fail_test_validating_assignment_model_validator_before_fail.assert_exc_info_value_err": {"doc_hash": "557d4a7e3cd75a9ddb6bb7619c947ff27cf989b318ea7a523a4cae132ac78a96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_model_validator_many_values_change__get_source_line.with_open_filename_as_f_.return.f_readline_": {"doc_hash": "f546df6195660402ed4d2768f9050dfff754672f64d05073f0499747a376daf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_model_validator_": {"doc_hash": "8fa5e1c1b20c69e3da47cedceeba98bbf403dada5502f032105eb4745b394610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_from___future___import_an_is_list_like_schema_with_items_schema.return.schema_type_in__LIST_L": {"doc_hash": "ca131490d66aabaa17219abfaa89a0347ffb44a0caa6d6711af5e85b8355f809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_typed_dict_schema__WalkCoreSchema.handle_typed_dict_schema.return.schema": {"doc_hash": "db384da353ff6ce2c63182b84e1ddb458bc8d16af216b151fcdedf22639082a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_dataclass_args_schema__WalkCoreSchema.handle_dataclass_args_schema.return.schema": {"doc_hash": "a08d6fce8d27cf94774ff7ed341f5285df93796ea081659ced365347465ebae7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfos.build_DecoratorInfos.build.to_replace._": {"doc_hash": "a5dfb34a0a69c9c3d74eb37aa461fd71264912862deb126f27f2c66d5925a2ab"}, "/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": "e0aaf289dc23922afbbe547cef9c20f717ccfa84effcd601f9445569afd2002f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._type_alias_type_schema_GenerateSchema._literal_schema.return.core_schema_literal_schem": {"doc_hash": "f62d468c702e280f4d29afbb4f49ee0b47da7672ceefb158cb247f55033f8d9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._pattern_schema_GenerateSchema._hashable_schema.return.core_schema_custom_error_": {"doc_hash": "792f7d2222b39f17d4324f3e5fe5bfae4998aeac4ac921d6470b6cf3a860630f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_annotations.inner_handler_GenerateSchema._apply_annotations.inner_handler.return.transform_inner_schema_sc": {"doc_hash": "564390d17fa969325eda7dc6c93d6fd30295d288c9b6fdf7cfbdf7b21db43c90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_field_serializers_GenerateSchema._apply_field_serializers.return.schema": {"doc_hash": "fdd97e8eda2a50b09f5649df3519c655040e1cf0444ecaf8014631994a7798f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_model_serializers_GenerateSchema._apply_model_serializers.return.schema": {"doc_hash": "0fe54e3cd441de7787a6a8426b84c182c7ced64c234cc4c0107237fd4cdbdf5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_expand_grouped_metadata_expand_grouped_metadata.for_annotation_in_annotat.if_isinstance_annotation_.else_.yield_annotation": {"doc_hash": "5f95814eb510ba1301c1755822a6e69a0c2bb7bbef4c319e416785dbd06a916a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__ModelNamespaceDict__ModelNamespaceDict.__setitem__.return.super___setitem___k_v_": {"doc_hash": "a1dc01c1391059c2e375026f269c15797702208c5ccef764da3d3b54963f2307"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass_ModelMetaclass.__new__._call_we_re_in_the_middl": {"doc_hash": "db7a516c2c6d5dd96519fa5dd26e84195e513f305f127d6848ee838612cb7eca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass.__new__.if_bases__ModelMetaclass.__new__.if_bases_.else_.return.super___new___mcs_cls_": {"doc_hash": "28711ee0f774005aff52102db849665ac0d603a87748dc23b0154a0f67dee750"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py_Representation.__repr_name___Representation.__repr__.return.f_self___repr_name___": {"doc_hash": "a2dbcad80a7e008a1075edba1ab1caa89375f74b5e2f6609dee1589e310c386e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SchemaTransformer_SchemaTransformer.__get_pydantic_json_schema__.return.self_get_json_schema_sche": {"doc_hash": "57802945ea26f4a5f05a933874adb9b92b42178eab574d50019275f528739585"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_InnerSchemaValidator_InnerSchemaValidator.__get_pydantic_core_schema__.return.self_core_schema": {"doc_hash": "0c76efa41327c3015b48506726faad75aba49a6f1eb2dc9dfc3c309d2717f1ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_sequence_like_prepare_pydantic_annotations_sequence_like_prepare_pydantic_annotations.return._source_type_SequenceVa": {"doc_hash": "020e27693b593e71d4cd70c27108b8e996e2c94ddc6a8f6f479c4da0f508956b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_MappingValidator_MappingValidator.__get_pydantic_core_schema__.return.schema": {"doc_hash": "091007533d3caa384d14cd1ea1c646889b801cc55ec0f5c3b3614ac183551230"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_prepare_pydantic_annotations_ip_prepare_pydantic_annotations.return.None": {"doc_hash": "f6ee402b631f2f30345122d75fb7b47455edf817241e7d76305ed4c43289fea1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py__import_string_logic__import_string_logic.if_len_components_1_.else_.return.module": {"doc_hash": "aee43728bc6e985dfafe2ab86f281fdebd2d01eeaff4769eaa0b1e029ecb92bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_rebuild_dataclass_": {"doc_hash": "6a9572ed76127181032e05f6970a9ecb2d3177d6a5a38615da833d8e04357322"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__FromFieldInfoInputs__FieldInfoInputs.default": {"doc_hash": "44f90c34fff64ceb2a3a2ed19950f8758d0c2777a6ecbc03e0a993635cd3d3c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.is_required_FieldInfo.rebuild_annotation.if_not_self_metadata_.else_._type_ignore": {"doc_hash": "64eb080b58aa7f7e29e665ec31925dd22804064e055c8b584cc03524307d4821"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.apply_typevars_map_FieldInfo.apply_typevars_map.self.annotation._generics_replace_types_a": {"doc_hash": "7e65cf2fa3c68e1d5754587a2f6f9b4ee0b3ec412fad8037d5406a316c33428f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_PlainSerializer.__get_pydantic_core_schema___PlainSerializer.__get_pydantic_core_schema__.return.schema": {"doc_hash": "4102643bd2688c9be6229eba7e26d39dbcbed0fe2c51dca220304cd7b5052cfd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_WrapSerializer_WrapSerializer.when_used._always_": {"doc_hash": "fe86bd2a9dc529ca1b3484f01f9014f350d07528345315b31eaf4726e73adf33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_WrapSerializer.__get_pydantic_core_schema___WrapSerializer.__get_pydantic_core_schema__.return.schema": {"doc_hash": "f950923c0ef24b09442163186bfbb5ac660d5802cae822df9819e470dfb90bf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_FuncType_model_serializer_5._": {"doc_hash": "5e0f78c0d6403eebbb99290e1d861f57678a8ca1a5624da94b21606efe4bab75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.dict_BaseModel.dict.return.self_model_dump_": {"doc_hash": "5886b32e9e814d574df940358c2d226f155ed74e82dcc9b82ef2881a76742d03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.validate_BaseModel.update_forward_refs.cls_model_rebuild_force_T": {"doc_hash": "bfbe869f21faa411c4c35086d1a9c6d97f4203ef006ecd8bd3c1fad997d76cdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.get_default_value_TypeAdapter.get_default_value.return.self_validator_get_defaul": {"doc_hash": "ee7c26df8cd822e3276efbdb93fe87bbebb40cd58c19af915166be2b7883c28a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PathType.validate_file_PathType.__hash__.return.hash_type_self_path_type_": {"doc_hash": "0c4091a273a501bd7448b25eeddc520bb6cce62a6302f111e1b6d592bb4f883a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/__init__.py__flake8_noqa_": {"doc_hash": "eb10875b84a75e91e67f75f0db153f70a935201dfd1d7a875d95fb7998000063"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py____PyObject_dotted_names": {"doc_hash": "43ca73947acb8ffb0ea7b4582dece70db3fa9b0a67b4fb0cf9fa0f3e8dcc3d90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_st_register_type_strategy_None_7": {"doc_hash": "aee796f5bd36fa66cbb85934d351877a6d076830fb7e73898996f836bdd5342c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_None_8__registered_2.pass": {"doc_hash": "a9212149fc095567fb3bcf9c7e35b1316f8a0d66af29cb1cd550ed301ef17281"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py__registered_3_resolves.return.inner": {"doc_hash": "b1532b0d749788a404cb854290ba3bcb5187317ae6e5a3dcd13e2a407fd413da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py__Type_to_strategy_resolv_resolve_json.return.st_builds_": {"doc_hash": "a621d1536174d5ee4b866a81ff7175efffacf6da77d2704f36621a1032e8b23a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_conbytes_resolve_conbytes.return.st_from_regex_pattern_enc": {"doc_hash": "9fe979aca23f4d15199b127252327b8ed8069d8e73a511c38742b22135e9b531"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_condecimal_resolve_condecimal.return.s": {"doc_hash": "5cb03c87083682b6549e6837d5b808a9a134a2e05a526d569b856f694516264c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_confloat_resolve_confloat.return.st_integers_min_value_ma": {"doc_hash": "65c7635a7fe937bc8648e574ca3a7d5c9fa399091d2fe0daf7b8dd422d9ac128"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_conint_resolve_conint.return.st_integers_min_value_ma": {"doc_hash": "17112cc82b360c9889d392e07a71b278d8c9e02481d03b0770dbd5d968057f33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_condate_resolve_condate.return.st_dates_min_value_max_v": {"doc_hash": "142b48cf5184c5e5532d0141568508e9939b2e3499232efeb7009c1bbec34ffe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_constr_": {"doc_hash": "3c11ea8ddc73089d6f0764c3921625042be6a21831a04d477b8b6a9ae4ce5653"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/annotated_types.py_sys_if_sys_version_info_3_.else_.is_legacy_typeddict.return.False": {"doc_hash": "304fa18a086a2c866a6566eac9ef0e6fa671ea3849cf8888704d0f63e4c7ca6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/annotated_types.py_create_model_from_typeddict_create_model_from_typeddict.return.create_model_typeddict_cl": {"doc_hash": "11ba43a9a0b5e0e24a0d43363c32feea5d977e6e62173bd05262c2b6f405dcd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/annotated_types.py_create_model_from_namedtuple_": {"doc_hash": "d302c582f218b4b2981de6092c470dfebe4c58928ea433c1c9beae7ad054890d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_warnings_Validator.__init__.self.skip_on_failure.skip_on_failure": {"doc_hash": "9426bb8acba4e43b33a6e9dad379fb4c1f48dc96e72d011af421ab259a83702d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_None_1_ROOT_VALIDATOR_CONFIG_KEY.___root_validator_config_": {"doc_hash": "052776b24fbceae62ba2b6227e703b49e16b87c8cffe11f3c4cd35b46992dc95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_validator_validator.return.dec": {"doc_hash": "21c375f6a2c911689fced10a7198bf4651cbca725f51bc3760efb3f87c15920f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_root_validator_root_validator_3.return.dec": {"doc_hash": "6ff3181a9fccb89a512cac82eadb9cb3769865679af97c478a8e210a1bfd4f6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py__prepare_validator__prepare_validator.return.f_cls": {"doc_hash": "b891d28cfa6e20b6e1064a365e60a8fbc7fced865af7c0059bf380d22eae3d6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_ValidatorGroup_ValidatorGroup.get_validators.if_validators_.else_.return.None": {"doc_hash": "6859014b9f079229c560ab4763eb760fda6953c76b8a5f0b5aa0af47e5687198"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_ValidatorGroup.check_for_unused_extract_validators.return.validators": {"doc_hash": "1db4fd8fff58440469ee6385102b9352c837117e3cb60e4673b4d38c4b67897f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_extract_root_validators_inherit_validators.return.validators": {"doc_hash": "8db83077121780d797baebdf9d037650742fab9bb843d0f2bb13acfb7d23130d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_make_generic_validator_all_kwargs._values_field_conf": {"doc_hash": "c365f476ad120fd1680f8e78e5014c153e95b95a4277083cbd418f4f9bde2598"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py__generic_validator_cls__generic_validator_cls.if_has_kwargs_.else_.return.lambda_cls_v_values_fi": {"doc_hash": "3a96e2b546cb61e7646c7490dcf042db854a95b5a05a8446b56fd538911e988f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py__generic_validator_basic_": {"doc_hash": "e171eb54be77df0d5b0817cd4e725c17d5d48f1409fb2c648c0b5fc080fb52dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py___HslColorTuple.Union_Tuple_float_float_": {"doc_hash": "29bd336ae54f461d7ad0066344b92a3d92cc1c3d98c9a543032d34d9be78f0a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_RGBA_RGBA.__getitem__.return.self__tuple_item_": {"doc_hash": "488c86cb686ee3be0a020b323a0f6236291784f9d5f5a9abaa3ce29d08522ee5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py__these_are_not_compiled__rads.2_math_pi": {"doc_hash": "999df771fa061e7e2aa89c0a28f4b7bd9b3b0e651bbda1cb6319903bc2da8e9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_Color_Color.as_named.if_self__rgba_alpha_is_No.else_.return.self_as_hex_": {"doc_hash": "5a1bfc007c08c84b5554290ec4b8b2c89932a57416cebf7bb9bdfb99c5dda2de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_Color.as_hex_Color.as_hex.return._as_hex": {"doc_hash": "b2916c4138e697af0381846768a6a174b9be9e4b197831b6a0fa93160d376676"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_Color.as_rgb_Color.as_rgb.if_self__rgba_alpha_is_No.else_.return._": {"doc_hash": "943461cb4a069b0457b9beb804b64d09bab030305fb4c4b4799095af857c636f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_Color.as_rgb_tuple_Color.as_rgb_tuple.if_alpha_is_None_.else_.return.r_g_b": {"doc_hash": "37e366b8bced62143da8c47295e614809db3eb9809b7d2f0272997a035e97af6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/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": "f0dc1f0ab46372802616b89acb88d7a9a112541075dbea581f823ced61f738ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_Color.as_hsl_tuple_Color.as_hsl_tuple.if_alpha_.else_.return.h_s_l": {"doc_hash": "1b984df3c8a7bb4fb9a2b9b5b251c00b3ae5debc4c4126abc93a74945348ae31"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_Color._alpha_float_Color.__hash__.return.hash_self_as_rgb_tuple_": {"doc_hash": "ada1d7b765d7aff8af20e7ecab47f60bcb3473b764fd1795f0cff9f6b94c2228"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_tuple_parse_tuple.if_len_value_3_.else_.raise_ColorError_reason_": {"doc_hash": "3cea3da437b9f44ec5b3f4911a20985a38ac2eac3b191db35615b0d9b32b0802"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_str_parse_str.raise_ColorError_reason_": {"doc_hash": "6d102a2ac570a1553c0aee5ce6009cfd96c3415ad0ec4d7f1474662c46858021"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_ints_to_rgba_parse_color_value.if_0_color_max_val_.else_.raise_ColorError_reason_f": {"doc_hash": "b7f27fed963d90f56c8b84f903dfe0ed6d700d94dfc36a8865b4a2e08e10a40c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_float_alpha_parse_float_alpha.if_almost_equal_floats_al.else_.raise_ColorError_reason_": {"doc_hash": "641128fce446ae6211e31cee3b2c9387acdddaada6377f8f2aa3a0019968a403"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_hsl_": {"doc_hash": "f7aad99a05d6cee140711b3a9c5e5159c7779d888fea9776172aaa39fe13286b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_json_if_not_compiled_.else_._type_ignore": {"doc_hash": "2083bde383628544851dbdade025df8122ce00c592cd0daac8c224b584378d06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_BaseConfig_BaseConfig.post_init_call._before_validation_": {"doc_hash": "16c3603bfc4391a9654f769b05e11c39227520ba251a5a31fb85898aa7dc35fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_BaseConfig.get_field_info_BaseConfig.prepare_field.pass": {"doc_hash": "0fe8ad15c3bb6d0bde643d1642d50c4a9d72e47809cfaf2d5166ce98104e1a4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_get_config_": {"doc_hash": "0ab4a39245c64ea2aa46e6e361132d9d580dadfb93ca23165d540ae7e1cd91a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py___StrBytesIntFloat.Union_str_bytes_int_fl": {"doc_hash": "dee9497477f6b070cbeafdc56b10f6451d49df5383c86e10814544b49b73b9a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_get_numeric_from_unix_seconds.return.dt_replace_tzinfo_timezon": {"doc_hash": "6fdde639ab94b4dba8373cd19f81edba3c5b42ab3b38a21212f9b21b5d4ac0cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py__parse_timezone__parse_timezone.if_value_Z_.else_.return.None": {"doc_hash": "8007ea053f4c969581c1d6959ffac2f968966ae699c5eb73a1e07bd4e6baa5de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_date_parse_date.try_.except_ValueError_.raise_errors_DateError_": {"doc_hash": "a2f283480fefa87a3009d5d782c6d3f36328291dbe62d092c92fb3c447e70201"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_time_parse_time.try_.except_ValueError_.raise_errors_TimeError_": {"doc_hash": "32e92b9d0c77c02d15b3da02985c766048639f644f81398c8e432dff1f6017f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_datetime_parse_datetime.try_.except_ValueError_.raise_errors_DateTimeErro": {"doc_hash": "ff0efff782cb25bcf9d5007eff3049de68dfac8b66a4b4d5937a75cf58f07da3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_duration_": {"doc_hash": "7ed532826c005d2c9b0c88502d6ffc3f9d2b439cf60e4c2fb5d533586c4473c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_from_functools_import_wra_validate_arguments_1._": {"doc_hash": "d24aeb702dabffda8a07a67072f4a840a50f5a81ed6b9c926e77304ee0d58419"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_": {"doc_hash": "fe46e3b543cfcb9db96b8ab41c9d99881bfaf8fc310c78e148085cf072ce90c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_": {"doc_hash": "c072884c4d58a09a36da4703ea0fadb429637f2e5b065af48bddec929e5d8696"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values": {"doc_hash": "f1e7e1aed953c6f7747d98663128fc4b35445e91b1508de9f19a420e402ff68e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction.execute_ValidatedFunction.execute.if_self_v_args_name_in_d_.else_.return.self_raw_function_d_": {"doc_hash": "1e552222e83f37b0539661c72f8ca0f51e661ed55784e777ecba774fa772a327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction.create_model_ValidatedFunction.create_model.if_hasattr_CustomConfig_.raise_ConfigError_": {"doc_hash": "cb373f79a8b28503c96b244563677ce8071dcf0d5f5f9242e5aafcd871bc74b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction.create_model.DecoratorBaseModel_": {"doc_hash": "dc5bfb3cae8bc873179210c16ab2cc629d8444441eca247b21c15e30d1da89c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_os_SettingsError.pass": {"doc_hash": "063425ec535c9ef51648d78971b8b5559b4ea38e8dbe470caf5aa140b18d0a3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_BaseSettings_BaseSettings.__init__.super___init___": {"doc_hash": "7fdd6843ded901cc10db18f52bbcac65e6c1d5d1779608bff4f4a66c01bc956b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_BaseSettings._build_values_BaseSettings._build_values.if_sources_.else_.return._": {"doc_hash": "a4acf4981c77376e07835d44fc61b02f96fb7105c5973a9d4625f1f22797285a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_BaseSettings.Config_BaseSettings.__config__": {"doc_hash": "c79b21a6f9971c25b9f30c78c7d4614065cc5271459da0bfcadc97c3ac872d40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_InitSettingsSource_EnvSettingsSource.__init__.self.env_prefix_len.env_prefix_len": {"doc_hash": "b75177e2d791481515d178d9f6a58ec3890dbb8755478d9c4680ee7dca6c4123"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.__call___EnvSettingsSource.__call__.return.d": {"doc_hash": "8f6d285c2316cf374991a5fc78a730511094cc24c322e248331b73f44f030425"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.explode_env_vars_EnvSettingsSource.__repr__.return._": {"doc_hash": "5e3603a053eff3687c68aa416fbb793892732c52355a6b4f4f3f99ec279e4e9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_SecretsSettingsSource_SecretsSettingsSource.__repr__.return.f_SecretsSettingsSource_s": {"doc_hash": "029e5c6f8275b3fc4fb0e9725dbaedcc64ffffb9244268f49ade11290ff1bc08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_read_env_file_": {"doc_hash": "1b3e430aceb281f9e2e9767a62285d971ed55c8f639690656a34b4f7d780d52e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_json___all__._ErrorWrapper_Validati": {"doc_hash": "3c685f5786827766c4fd5209f46041f866212399820c12e30c3e015f506f3996"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_ErrorWrapper_ErrorList.Union_Sequence_Any_Erro": {"doc_hash": "7eb070b00f1fc8e0019830e08d0f221eddf279381ca598da5a52b5e8e26e3bdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_ValidationError_ValidationError.__repr_args__.return._model_self_model___n": {"doc_hash": "31f00b2811a54b2809e31df4c22d202b9d625b064573c1dab2572289c6c41f2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_display_errors__display_error_type_and_ctx.if_ctx_.else_.return.t": {"doc_hash": "ec1a47432cf22b9ef4c297d0556f1196ba996374a7b565481f5937227d5702d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_flatten_errors_flatten_errors.for_error_in_errors_.if_isinstance_error_Erro.else_.raise_RuntimeError_f_Unkn": {"doc_hash": "c95d0aef5c7c3287a0b5d1d8706526b48993d45171f4e9ab0772fd976a66daca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_error_dict_get_exc_type.try_.except_KeyError_.return.r": {"doc_hash": "d0cceddb4c5b890f298d3c134dae0d99d5e2aefd082dc6d798aa8c6243c6d6da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py__get_exc_type_": {"doc_hash": "95f06a8657745efac378e103c50c0f0db821856391215a56a140899a679f48b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_from_decimal_import_Decim___all__._": {"doc_hash": "98cbea1aeff2c06530cb36b15ca0cd3929b26b6af0ba0bc4e3b0051ca19f7bdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_cls_kwargs_cls_kwargs.return.cls_ctx_": {"doc_hash": "d79665a68b41a5b591d511046950b98e959fe0c9ad4fad90b386867e6657745a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_PydanticErrorMixin__PathValueError.__init__.super___init___path_str": {"doc_hash": "ccd6353ec91e9a84b7e7a1515d3f4e594ebbae2252a788171b21665228e5cc6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_PathNotExistsError_FrozenSetMaxLengthError.__init__.super___init___limit_va": {"doc_hash": "b2d84f6195bd331571895fc51dc5c3e74cf29e077f914819534fbec88a3c45e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_AnyStrMinLengthError_DateError.msg_template._invalid_date_format_": {"doc_hash": "3f84257efa70e1e82076a06d1d32af2e9d7fc756a1b05b7d0ef79b4df874e9fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_DateNotInThePastError_ColorError.msg_template._value_is_not_a_valid_col": {"doc_hash": "0085b4118dfc77220d43bba9a212ecb8d2cf40f38e3dd8c65a012ff267b24a8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_StrictBoolError_MissingDiscriminator.msg_template._Discriminator_discrimin": {"doc_hash": "9087f21fa5f0671daf17f8b1e0c41d4c7e8a31c2a3c18e3d3ad916665ae68ddc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_InvalidDiscriminator_": {"doc_hash": "36a15db7ca5a90f1a524fb51dcf2b6d382af3eeb2041d1606ad24542741e4291"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_copy_if_TYPE_CHECKING_.BoolUndefined.Union_bool_UndefinedType": {"doc_hash": "0eefd0e02a73a0149196427fc62d5618837906988142bd67b471908e4d585cb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_FieldInfo_FieldInfo.get_constraints.return._attr_for_attr_default_i": {"doc_hash": "c620d45a64cc05dca3ebebe6aac427b08d0af2bc3dee4b06a26378f4946ac036"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_FieldInfo.update_from_config_FieldInfo._validate.if_self_default_is_not_Un.raise_ValueError_cannot_": {"doc_hash": "5e7ca506de98b74bef4b5e964c9e7d3931621f5fd17ba95e979f1e71fdb464bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_Field_Field._": {"doc_hash": "92e6f765e2e96df0fb8775d56e7a44303569669826fc1fc6147f48c8efedc096"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_Field.field_info_Field.return.field_info": {"doc_hash": "7d99df89f159cace3dc8e631ca6d3d066bc1ca100d8fb83b8607e0cf1f3ef64a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py__used_to_be_an_enum_but__MAPPING_LIKE_SHAPES._SHAPE_DEFAULTDICT_SHAPE": {"doc_hash": "b09055428b7437562dccfbc6baf7d2a0cbb722ac8187817f22d541544f34e0f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField_ModelField.get_default.return.smart_deepcopy_self_defau": {"doc_hash": "c693c681eebdc530e9dfb1fe549881dba1ef7422bd2d9d0bab2c6fe0ab2ee55f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._get_field_info_ModelField._get_field_info.return.field_info_value": {"doc_hash": "4256952c67491cee86a67722e55ac6240fb02e4c217128545f3a115d85f55eff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.infer_ModelField.infer.return.cls_": {"doc_hash": "494ffb6835c95035ac54bc1671f81c981fa782336c26df6530f5d12de7314fad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.set_config_ModelField.set_config.if_new_include_is_not_Non.self.field_info.include.ValueItems_merge_self_fie": {"doc_hash": "fbe3780ba42b80593a3b55e67374903fc087adb04d64255db5d7909526808829"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.alt_alias_ModelField.prepare.self_populate_validators_": {"doc_hash": "968b7b2861b2ddc9ae4b2c449766b7c780b112cef88421e4ba6dcc93541cb7f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._set_default_and_type_ModelField._set_default_and_type.if_self_required_is_False.self.allow_none.True": {"doc_hash": "f4fc9f0f9bbfa52e73cd62a44dfb72cd5039ee4b36df866ce554bd1c95262e9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_analysis_ModelField._type_analysis._add_extra_check_for_co": {"doc_hash": "d742ee6d0701b3dfa805d49ac95cb1c59b3062c232ee5575841db0cb7503d328"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_analysis.if_origin_is_None_or_orig_ModelField._type_analysis.self.sub_fields._self__create_sub_type_se": {"doc_hash": "25dea06ae5e9dbfa28f053b152c34551641efb0ebb2f5328180ea93cec5d1011"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.prepare_discriminated_union_sub_fields_ModelField.prepare_discriminated_union_sub_fields.self.discriminator_alias.get_unique_discriminator_": {"doc_hash": "62e24a980ee57dceb3de4b897ae8e8814fd8fed950a789fdbd061dad2b0d7b00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._create_sub_type_ModelField._create_sub_type.return.self___class___": {"doc_hash": "0d5bc0d5f489c4111c0db75c664cdbaaf951d62a40fdaa6b35e656bc8baa26d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.populate_validators_ModelField.populate_validators.self.post_validators_5.self_post_validators_or_N": {"doc_hash": "38f7c556fe34a45c4c9ad33d966f75ec749e08a0fcf457d67e315cb0d20c6df9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.validate_ModelField.validate.return.v_errors": {"doc_hash": "50897801a6781343b72b3a66957e546da00a946c2b4ba54dcb624d0116b2760c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_sequence_like_ModelField._validate_sequence_like.return.converted_None": {"doc_hash": "d6bffd0856f32bd937fce3af6ae3b4cd1a6d597038d812f7be7bdfa83ec0e39c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_iterable_ModelField._validate_tuple.if_errors_.else_.return.tuple_result_None": {"doc_hash": "ff839cbab9ea87ee0d2b49369cce8df843d1a03ebdd6b22d8dc3374405433d2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_mapping_like_ModelField._validate_mapping_like.if_errors_.else_.return.self__get_mapping_value_v": {"doc_hash": "785b812793d6c55a084514e7671bf0f329a6c5dc7eb9abfe627b96d204420c36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._get_mapping_value_ModelField._get_mapping_value.if_original_cls_dict_o.else_.try_.except_TypeError_.raise_RuntimeError_f_Coul": {"doc_hash": "6ae70cc31e981a7917581d29fc39db20e2ea2e900f9615dc213f49f406d47f9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_singleton_ModelField._validate_singleton.if_self_sub_fields_.else_.return.self__apply_validators_v_": {"doc_hash": "53dade901c07d44cca8c69d86ff159ee029443e92c55a203d2a15d9435b51194"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_discriminated_union_ModelField._validate_discriminated_union.None_1.else_.return.sub_field_validate_v_val": {"doc_hash": "29e1c8f846fb3842a74959527d361023b06886030cbfd28abfbf089969beb3f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._apply_validators_ModelField.is_complex.return._": {"doc_hash": "57bbb789a0436d0e7541eafdfadc691144fcdf7327f6f93604380885fad2a5bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_display_ModelField.__repr_args__.return.args": {"doc_hash": "a9dbcb6ac1385316a3624b1b56250e5913518341aa331ab01b3ac5239d4e3b26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelPrivateAttr_ModelPrivateAttr.__eq__.return.isinstance_other_self___": {"doc_hash": "50711d4cfb7ead45f563931b8b857ee6eecf484fab46189664d906dcf0f7221e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_PrivateAttr_": {"doc_hash": "cd3bf0ed6031cb2f320a4b206f0818e67509d2c8bf5811bf7849a891b5725b8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_sys__assigned_parameters.AssignedParameters_": {"doc_hash": "ef61d602d16579d9155e00b3578228da940522d85e7d605a66b7ed108ed12a0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel_GenericModel._Setting_the_return_type": {"doc_hash": "39c03c5f56c95b3d5eaf5e99ee21c41ee9798655bf048259e0349fcb8bccf5b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__class_getitem___GenericModel.__class_getitem__._If_none_are_left_the_m": {"doc_hash": "773dce75cbadc826b722dd1ad007fe486103cfb66df958816e15169ef6089620"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__class_getitem__._class_is_a_generic_clas_GenericModel.__class_getitem__.return.created_model": {"doc_hash": "55e87897c6c731cbd145237fc085612ead838441c7af240cd476cc0a622a46b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__concrete_name___GenericModel.__concrete_name__.return.f_cls___name___params_": {"doc_hash": "611b3b4d41da3d0b7f91800f6d957a07c3e776134e21f3dba740c0f883679c8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__parameterized_bases___GenericModel.__parameterized_bases__.for_base_model_in_cls___b.if_not_issubclass_base_mo.else_.yield_from_build_base_mod": {"doc_hash": "0c36116c1d364253ebf8422225cdd8f23d5b10a3f36d77a959d303ba96d9d5d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_check_parameters_count_iter_contained_typevars.if_isinstance_v_TypeVar_.else_.for_arg_in_args_.yield_from_iter_contained": {"doc_hash": "6f3fb6eb8c896f628065928ad58b6132ad170f82b41c58d755c65263bfbb705b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_get_caller_frame_info_get_caller_frame_info.return.frame_globals_get___name": {"doc_hash": "0ba4f511575e8c79749378f77e3ec839b99334c9be2e470c57861f95bf06b363"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py__prepare_model_fields_": {"doc_hash": "f4ed53b1a63186d55fa4144985450d9522baf09241fcd27255b92482413f2dfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_datetime_isoformat.return.o_isoformat_": {"doc_hash": "6d3077f9d8c1facb95f6ffe0057f25e0edc8f2b62492cc6f5d8ee34c003389cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_decimal_encoder_decimal_encoder.if_dec_value_as_tuple_e.else_.return.float_dec_value_": {"doc_hash": "155dab12372836444475ba1c7ec13d132b76eca09e8f6d71ae5e84ea907b1748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_ENCODERS_BY_TYPE_ENCODERS_BY_TYPE._": {"doc_hash": "dcac769491f76f3d98785d17bc7d6d75fefb4d20227005942ea4b2c21d0b6144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_pydantic_encoder_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.raise_TypeError_f_Object_": {"doc_hash": "af26ae00f9bc64f874edef0677fb997bdb59ea189250849113543d941d1c2e7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_custom_pydantic_encoder_": {"doc_hash": "15f9ae0345ee2c27c3dbc127ca796585dcaea39c6ad5845eb04342e24c3f8624"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_warnings__is_base_model_class_defined.False": {"doc_hash": "b320b6e761744f9de884e1e7e053db0efd05f5a1c618bc49247fbfa551d0ead1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_ModelMetaclass_ModelMetaclass.__new__.is_untouched.return.isinstance_v_untouched_t": {"doc_hash": "ee123b375ba9e8564a0c69505beb2afe22290859f6a711cc3f9de255a0bf823a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_ModelMetaclass.__new__.if_namespace_get___modu_ModelMetaclass.__new__.exclude_from_namespace.fields_private_attribut": {"doc_hash": "7241f9e707ef1bc169c1c497130a62e3af7577e1e596ea9e322483d86d9c24bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_ModelMetaclass.__new__.new_namespace_ModelMetaclass.__instancecheck__.return.hasattr_instance___fiel": {"doc_hash": "5672d3b86f0369b28a603ab334272b5e1329b11a7137787455ad17656aa05aea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_object_setattr_BaseModel.__init__.__pydantic_self____init_p": {"doc_hash": "d471738b25005a3a29063b747ba56bef726887484df6a1e5fac9da63d78d9335"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.__setattr___BaseModel.__setattr__.self___fields_set___add_n": {"doc_hash": "e11cc465aaa57c3505dcbf8d183e2fa0546257cce02109450fa35858c8256254"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.__getstate___BaseModel._init_private_attributes.for_name_private_attr_in.if_default_is_not_Undefin.object_setattr_self_name": {"doc_hash": "68539df63a8ee8fd888684912c7d7ba5b1bd226b849b448f921ab1d6ced68994"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.dict_BaseModel.dict.return.dict_": {"doc_hash": "bb69c3388329f2cefbd29635306ad614a025190d99e2f65783b915feff5221f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.json_BaseModel.json.return.self___config___json_dump": {"doc_hash": "6b8172c4cd3a7d4902f861f6f8f32595cfc2ff296a0259474efdf207509d0e42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._enforce_dict_if_root_BaseModel.parse_obj.return.cls_obj_": {"doc_hash": "d51bebda7665489cd4fd04ecc072124c1b8dc0839580a9e80a22915169480d5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.parse_raw_BaseModel.parse_raw.return.cls_parse_obj_obj_": {"doc_hash": "039dbe64ae3f6b4ffd49b0d2d9ae82c0f0c00a060b1f10dc16ead00c72d03cd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.parse_file_BaseModel.parse_file.return.cls_parse_obj_obj_": {"doc_hash": "4728eb9c6fe895ff85a9340221f95e9218ab657c96353478fb20ef871f13c58c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.from_orm_BaseModel.from_orm.return.m": {"doc_hash": "58b05589e57d0aaae0225c496d541a8ba54b127ced31db591a6dabadbb63b5ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.construct_BaseModel.construct.return.m": {"doc_hash": "f94b79f8f54ca5682c90851bd08ada9aeb77490034b077ea149981bf19b4d034"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._copy_and_set_values_BaseModel._copy_and_set_values.return.m": {"doc_hash": "1ce046cd86c1debbd3724a7fce1ea714ff8245b501e7027a8003398fab379541"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.copy_BaseModel.copy.return.self__copy_and_set_values": {"doc_hash": "490e3b1125db75ec93c8f281860c6d0ba8ed6054c9b213da3a7ae84bb0671084"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.schema_BaseModel.__get_validators__.yield_cls_validate": {"doc_hash": "9a489b6420704d83f773702a6fec2742710c2e59a71c0c38eaa7ea0e57a4bf71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.validate_BaseModel._decompose_class.return.cls___config___getter_dic": {"doc_hash": "86e04bdc111e82844f516604a179297a01578a1bd301dff3cfc71cb537bf08ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._get_value_BaseModel._get_value.if_isinstance_v_dict_.else_.return.v": {"doc_hash": "208550c101ba2b58d28b4f4972da37ad9a20e60233d1b8efd2ea5b56f4bf6c3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.__try_update_forward_refs___BaseModel.__iter__.yield_from_self___dict___": {"doc_hash": "f46cdadce7c08a16e88ba6b1b19fd73dab7ef19100540af0198446076e2b5f34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._iter_BaseModel._iter.for_field_key_v_in_self_.yield_dict_key_v": {"doc_hash": "6db4e38b933af6f1500e5bc2a9f5ed7d70873ba532ff92b119f995ad81ca3a79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._calculate_keys_BaseModel.__repr_args__.return._": {"doc_hash": "11b38f49aebf8e8ba161034a46d284b54723f1c9eaa0e33484a196e16a9a4b89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py__is_base_model_class_defined_6_create_model_3._": {"doc_hash": "016f71aa7c9aabbeb31b779738e210a7e6748bc5db1067624bf2565a18c43470"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_create_model_4_create_model_4.return.meta___model_name_resolv": {"doc_hash": "065cab2e643005b41f0648291c62abeed4a34321232a010848b94f10e9a3e2e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py__missing_": {"doc_hash": "6fc68c3cc5ff0fad2d3303a2012a1c540d9b146f5e7dbf5785514fb9956caec0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_sys_plugin.return.PydanticPlugin": {"doc_hash": "71a7f809216d60b8a6d201c26acb6cd9a8c0caac276c3938ed9f42f2a7c3523c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticPlugin_PydanticPlugin._pydantic_model_class_maker_callback.transformer_transform_": {"doc_hash": "321e4936c88bfe27cfe60fdcb11500db573d70a5f7e6a57af00d1b72808aad12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticPlugin._pydantic_model_metaclass_marker_callback_PydanticPlugin._pydantic_model_metaclass_marker_callback.if_getattr_info_metaclass._type_ignore_attr_defin": {"doc_hash": "6b6521559799d5b2b00f2334532af5b562fa4b5e64b544ede94a5a0a89a9f836"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticPlugin._pydantic_field_callback_PydanticPlugin._pydantic_field_callback.return.default_any_type": {"doc_hash": "fd1c9b31a67cfaf557dae1816d823211bf83bb5571b231567d4902aa95d6d740"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticPluginConfig_PydanticPluginConfig.to_data.return._key_getattr_self_key_": {"doc_hash": "6bff3bf85354cf4447e4b8cd9d214ea363d532cb1a7b3d4abce877c892cfaddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_from_orm_callback_from_orm_callback.return.ctx_default_return_type": {"doc_hash": "1899c32552513409ee7e8f355cc9215b168015473557c11f28115a3b6e598982"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer_PydanticModelTransformer.transform.info_metadata_METADATA_KE": {"doc_hash": "a961c633e20ac8ef317133c7067442c01325d2fb45649ee95e4f45856ac1c46a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/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": "7b6b553104f7c2a4ae2cb45394401152901d623a1ed738303f668aa78e6a58e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.collect_config_PydanticModelTransformer.collect_config.return.config": {"doc_hash": "90faadf824ae01369af73f2b74f492e6d705377212956afc981f955a4e986323"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.collect_fields_PydanticModelTransformer.collect_fields.return.all_fields": {"doc_hash": "e63cee96e772dbb2a0eb7f2f3941ed873d4c6aa02b66b087bad728d09bb92b81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.if___init___not_in_ctx_.add_method_ctx___init__": {"doc_hash": "7399020ded7e196381fcfeff62d5570bc387f7fe44edbb0fd074a353c4805062"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.add_construct_method_PydanticModelTransformer.add_construct_method.add_method_": {"doc_hash": "da2797d80a5e79196a3d76c935f6217cf592be71f898a93a37fe9ab8f3b06f58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/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": "b2c8c625cd619804e0aeb712e1e1570cd71d95e5304058fb313cbde5c91c4171"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.get_config_update_PydanticModelTransformer.get_config_update.return.None": {"doc_hash": "87236d6febf14bfd5525e06cb995513487dcfde4e16920fee4b51491c0e275b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.get_is_required_PydanticModelTransformer.get_is_required.return.isinstance_expr_Ellipsis": {"doc_hash": "c7343ba7097faaa228f6c747d32d0069cdb65025e53f2d26f5f00c39d6fcf099"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.type_has_implicit_default_PydanticModelTransformer.type_has_implicit_default.return.False": {"doc_hash": "8d027e081170e0b2d4f1c02f2745899486646dc26195b5184b12045f0da080cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.get_alias_info_PydanticModelTransformer.get_alias_info.return.None_False": {"doc_hash": "1f4c4ef1cc93a0bf368b9db31566963c89cf9c06c473f1900da65d6eb9d33338"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.get_field_arguments_PydanticModelTransformer.get_field_arguments.return.arguments": {"doc_hash": "a30ea46513ad82bc2f74c8853d3e48366002091dedfe071130d460cfe4118a5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.should_init_forbid_extra_PydanticModelTransformer.is_dynamic_alias_present.return.False": {"doc_hash": "1cbce5bebbc7b7692d3da60a50546d46d3d3215f0336936facac165504ca00c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelField_PydanticModelField.to_var.return.Var_name_info_self_name_": {"doc_hash": "593ad4a6c473091bac506cb3fd00c1e8d9920e8dc9f0a49bd5a82b88125b786c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelField.to_argument_PydanticModelField.deserialize.return.cls_data_": {"doc_hash": "efcdb15510bad33ba4ec293e8d93f3455bc6daf626728d709d45af72f0c9d89f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_ModelConfigData_ModelConfigData.setdefault.if_getattr_self_key_is_.setattr_self_key_value_": {"doc_hash": "9c0fbacdbaefd8213f3418b506d26287303563d7f04f9543d36db4a2101e83ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_ERROR_ORM_error_required_dynamic_aliases.api_fail_Required_dynami": {"doc_hash": "562a08594ed3417f057018adaf3ab26bcc4e291a55f33802c3639b645b3019c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_error_unexpected_behavior_error_default_and_default_factory_specified.api_fail_Field_default_a": {"doc_hash": "0ed870130c72bf0ee232d6e331c89f2b9bdf0b27d8b8b0e5fe48a23ee5ec8111"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_add_method_add_method.info_defn_defs_body_appen": {"doc_hash": "da052fc2a2edfeb0f9035e1918763a6c2aacecfaed893deda137a7a64f74e5e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_get_fullname_get_name.return.fn": {"doc_hash": "5a6422556a9927f3d72fb473081bda1bbbb8751a97bb6cdbed0206dbe55506ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_parse_toml_": {"doc_hash": "5eabc598a7747a0676bbef1a1c58d8db16f0b9bfe5e7eeaf02427904401d87a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_re__fragment_regex.r_P_fragment_s_": {"doc_hash": "68c6442f5abe523116ee2014eccfa681490c1df1e2e04e978ea8d86a5f6aa1a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_url_regex_multi_host_url_regex.return._multi_host_url_regex_cac": {"doc_hash": "9218f3876a45468f53e1de9ffad3f34416387927381c4a8b712d367c38ef96d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_ascii_domain_regex_ascii_domain_regex.return._ascii_domain_regex_cache": {"doc_hash": "481191e9f90f707be80ee6cfcf9d84911a7f3d5086b9c796bbc8a8418eb72808"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_int_domain_regex_host_regex.return._host_regex_cache": {"doc_hash": "48e2277691cc574fba69adbb850ec801645d808b70d4e5cbf7414b0b84e2b6d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl_AnyUrl.__init__.self.fragment.fragment": {"doc_hash": "8000f7288cb223101baf1850d04b6b20fb5ab1e1a7f5dc9e8e9fb7480454d8b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.build_AnyUrl.build.return.url": {"doc_hash": "d2426bb6ec586d43c3c802de67b2ca04143ad6479fd7852c2b24c84f5ce249b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.__modify_schema___AnyUrl.validate.return.cls__build_url_m_url_pa": {"doc_hash": "0e0069f56aaa0995a414ec5be532e103a8d8529fa7bd2abacc8e18e03f9e1f2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl._build_url_AnyUrl._build_url.return.cls_": {"doc_hash": "2b34059fcfeb2dc2d83a47f26e9ee9b3f9b17f23800fe58cf2beedf6a7c4252c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl._match_url_AnyUrl.validate_parts.return.parts": {"doc_hash": "4fd79ee30b7408672bd51213b43793ebeb27f3963ff7c50ce3c8bd00302e1b83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.validate_host_AnyUrl.validate_host._type_ignore": {"doc_hash": "160aec7b9d1659523d6ad2a80c65e65c675884558c4ef53184ae5fe2cf029cc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.get_default_parts_AnyUrl.__repr__.return.f_self___class_____name_": {"doc_hash": "cef53eea711e347f2007d1d0ee21a9c2b8b28cebe0ac7c24aa9c88c8217093d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyHttpUrl_FileUrl.__slots__._": {"doc_hash": "3f03874ca6cae2aa38cd43a4cd663c51f18504a33e2eee85c2147f678275e54d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_MultiHostDsn_MultiHostDsn.validate_parts.return.super_validate_parts_pa": {"doc_hash": "cd6d5a0fd1e5b83b8bd31d980cfa75e0a557b35de41dd132865b0d9525e2a056"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_MultiHostDsn._build_url_MultiHostDsn._build_url.if_len_hosts_parts_1_.else_.return.cls_": {"doc_hash": "c3b5f9b203c6a92d7ba97712c75b59a2c64ecab60d58374ff4f3b5240b5c9df0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_PostgresDsn_KafkaDsn.get_default_parts.return._": {"doc_hash": "8b0434709473da99190d6070ebc3c7ce4538676b2de172fb00601444403e3683"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_stricturl_stricturl.return.type_UrlValue_AnyUrl_": {"doc_hash": "589b556bf9afb89476304cb887aee72ac9f7f3594d75b25ac0127bfbfb0e9f88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_import_email_validator_EmailStr.validate.return.validate_email_value_1_": {"doc_hash": "400086c3c2bfc231a783b4774e7430d9caff5dc575aa29c317a0e56781e8ef64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_NameEmail_NameEmail.__str__.return.f_self_name_self_emai": {"doc_hash": "1ed7f786ed2b64fcba32ca13eb7108172ae643a9b3fe2abc9b95116b2b937f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyAddress_IPvAnyAddress.validate.None_1.except_ValueError_.raise_errors_IPvAnyAddres": {"doc_hash": "1ed839ace127d5b27ffaae5e2924ba4ab870def2b4a605f63d639453302e7d06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyInterface_IPvAnyInterface.validate.None_1.except_ValueError_.raise_errors_IPvAnyInterf": {"doc_hash": "d6214b4baffea61b351894fd7e4dfd29c69a82d2b26fd56506606c60288a0cbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/parse.py_json_load_str_bytes.if_proto_Protocol_json.else_.raise_TypeError_f_Unknown": {"doc_hash": "f88a6b0efe910dd779d629913f7c2e5ae7e82dec5772999c5dda50fafca260c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/parse.py_load_file_": {"doc_hash": "b37403e2a2159c0e64cb67610c902d193bcb1d16fd2b05986465a7bd53b8ce59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_re__apply_modify_schema.if_field_in_args_or_kw.else_.modify_schema_field_schem": {"doc_hash": "8b5985fdd091c00c85e54fe2700e3abf36289be993c3aa86ec7b5223a2bdab9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_schema_schema.return.output_schema": {"doc_hash": "26954f02de9524bc0549059fb54085ba0698b656e895fd52fc1315092f28bb38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_model_schema_model_schema.return.m_schema": {"doc_hash": "a07790c7c47de64247acf6537ccd5710f65b4062679e106df443cb546b045fc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_field_info_schema_get_field_info_schema.return.schema__schema_overrides": {"doc_hash": "f9a4965ccacfdfe24e490fb52f7f8a2a880f53563eb836ab479f7afcb594d17e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_schema_field_schema.if_ref_in_f_schema_.else_.return.s_f_definitions_f_neste": {"doc_hash": "581ce8a39af7998afe9663665865ee29bf606bc05ba49a8221ca5446eb2278f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_numeric_types__numeric_types_attrs._": {"doc_hash": "533cb4d62008517c2b9ba61713109463d2317d645265ea0bc39b1ddaf6a904cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_field_schema_validations_get_field_schema_validations.return.f_schema": {"doc_hash": "03c2e88b8dad4a3f413d691352685307a866c1d3d207ba286929f82de6e1fde0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_model_name_map_get_model_name_map.return._v_k_for_k_v_in_name_mo": {"doc_hash": "43a1d6994d6ab3c611923714b974e5cc42a0b991eb800152c5d6f396ef4c3f5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_model_get_flat_models_from_model.return.flat_models": {"doc_hash": "1115e0fabac848ac56076e6926dc0d11923714437a67492d1370babf197d50dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_field_get_flat_models_from_field.return.flat_models": {"doc_hash": "91c649ad6d62b8384fd42ffc6c45928a1666f2cf724d8c8c57d24e6ce6ef5bcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_fields_get_flat_models_from_fields.return.flat_models": {"doc_hash": "2ed374cbd2dd23bce53bb011fa2ec878b7343c471a3e43faf1801a17ee71a0f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_models_get_long_model_name.return.f_model___module______mo": {"doc_hash": "906d7d9913eee7d504af6a5aa86da244ad50bb9fe1fa8c1633aa2d275c472e9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_type_schema_field_type_schema.return.f_schema_definitions_ne": {"doc_hash": "f620828e1226c53c9299051607cfe17d640a5b5f9329f6e5383c742d58a9edc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_model_process_schema_model_process_schema.return.s_m_definitions_nested_": {"doc_hash": "d5af1363fccdd3f40e9b1495cbb2b4b48a64ae7d052aaf764a0e81728c9b0d19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_model_type_schema_model_type_schema.return.out_schema_definitions_": {"doc_hash": "d9b54e06854c6d511702fade9e47184ad4cebbda948ea8b2ec455a4fddd4913d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_enum_process_schema_enum_process_schema.return.schema_": {"doc_hash": "f6d4ba4ac7cc6f6f52dd93febd39d77e7b48d27602e15432c0b8641d1f4a4c3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_sub_fields_schema_field_singleton_sub_fields_schema.nested_models.set_": {"doc_hash": "0a1b16db9fa4b4a7f4cf01575d21f0953e283ae032e7f64898b880ee0ebb9a54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_sub_fields_schema.if_len_sub_fields_1__field_singleton_sub_fields_schema.if_len_sub_fields_1_.else_.return.s_definitions_nested_mo": {"doc_hash": "0914d8c6533fcd170365be1f982b6bce459f1fcd8e54136acebae6095d99061a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py__Order_is_important_e_g_json_scheme._type_string_forma": {"doc_hash": "d7e2c71e53ebddd2ba8b88ebaba6a7bd7e4374678bd4816e2054e12bf165e185"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_add_field_type_to_schema_get_schema_ref.return._allOf_schema_ref_i": {"doc_hash": "6661e71acc268a8d6bc39812e1c6b7ef82c92fc96339694db429bd1ffc21b948"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_schema_field_singleton_schema.if_field_field_info_is_no.f_schema_const_field": {"doc_hash": "c40a2166b9d1d50f186a243930fc3e8604580d912d5f7d06a1c768b521188367"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_schema.if_is_literal_type_field__field_singleton_schema.raise_ValueError_f_Value_": {"doc_hash": "82fc2f0d494ec67678a8ba2215dac9852a168c31a8de91e0385df707a40e318a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_multitypes_literal_field_for_schema_multitypes_literal_field_for_schema.return.ModelField_": {"doc_hash": "6c1f8c075aba547e88c81f74e40ea005e1b73c5df34b39900a9694d7f8ed0d36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_encode_default__map_types_constraint._int_conint_float_conf": {"doc_hash": "4361fc256ac741581bc7905f8c7331c35117793a89351a3c9230467b4667bd6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_from_field_info_get_annotation_from_field_info.return.annotation": {"doc_hash": "02ed6057f546f10798c6bc6601ebeaf61e103fd00d5bb8b7228bf6ddcfc2675e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_with_constraints_get_annotation_with_constraints.go.constraint_func.None": {"doc_hash": "7faa0bd12c0e2321e37ba2e71f6ed867a67b4f872f8ca4474ba642b784a9610b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_with_constraints.go.if_isinstance_type__type_": {"doc_hash": "522d0975857bb68811803cb6859d68dd0711f04861b3c24bf771b91110d49bdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_json_parse_obj_as.return.model_type___root___obj_": {"doc_hash": "b877ecbd46519028d98835673c79b07a0d64659115dc50fd0a9114dd9721a1ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_parse_file_as_parse_file_as.return.parse_obj_as_type__obj_": {"doc_hash": "83c82fc165491f64ee9f4359a10bfbb8485c9c54adbad2f8bfec9bfc99673f32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_parse_raw_as_parse_raw_as.return.parse_obj_as_type__obj_": {"doc_hash": "4319b152814972ba68316dc189723792e7727cc8cd3104f1485f13a400e62c23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_schema_of_": {"doc_hash": "12d9622f81a8f134ecc9c181e9224c47923136fcbe035e03fa5c4b30bc93238a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_abc__registered_1.pass": {"doc_hash": "ee4eec7be6d1b09284840fc1faa75b6bcb3f9bdd97bd51da09c2a9ab7990d18f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py__registered_2__registered_2.return.typ": {"doc_hash": "7f9fcccdccf3adaf24c4873c82b463ff9db3e6e33dc118682fb66a8444a746e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedNumberMeta_ConstrainedNumberMeta.__new__.None_1": {"doc_hash": "487799ab816aa6d7f3c240f08725ee6f731149ab6cbecbda12ab5016327cb6a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py___None_1.else_.StrictBool.validate.raise_errors_StrictBoolEr": {"doc_hash": "5ec064cffc00a61bdc7078e4217cf0f5fcf61868a54fd5b020680e9a203d99c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_1_ConstrainedInt.__get_validators__.yield_number_multiple_val": {"doc_hash": "28274a186d790bfbdd460220ffe54cf3d1647b6b11566fded3e7ae0f9f5b583d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conint_None_2.else_.StrictInt.strict.True": {"doc_hash": "aa5594de20b4406778640c05b15bd7f11d5c5efc9bd4c55639bf33e2f0df0b8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_2_ConstrainedFloat.__get_validators__.yield_float_finite_valida": {"doc_hash": "4e5ec29ec9a7673805fc18380a1ad1b5b42d9c2bbf6c43e263a994dd1fbab557"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_confloat_confloat.return.type_ConstrainedFloatVal": {"doc_hash": "3818651f5535451c972591c915fcd57efc71524be38b244c6cdac8155eb371c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_3_None_3.else_.FiniteFloat.allow_inf_nan.False": {"doc_hash": "45c4d303d8a3765374ab928a640d694221f1acf74cbab3be8316ad5ded5f69f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_3_ConstrainedBytes.__get_validators__.yield_constr_length_valid": {"doc_hash": "462ed7c3902216e5054a3f7d2272fc133f99a46501adfd6eca3a4555fc7f9e15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conbytes_None_4.else_.StrictBytes.strict.True": {"doc_hash": "7f93187bea24d00fb534833066d625b609584f8a027214c097eb905c6c75eb18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_4_ConstrainedStr._get_pattern.return.regex_if_isinstance_regex": {"doc_hash": "b3702043b22a074857426f57ffc90be46be51ac5fea4bb433719fe07028204db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_constr_constr.return._registered_type_Constra": {"doc_hash": "71944b0944b73de0721eedd2617d2389920e9ad8a3ca09727ce2f28042d994b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_5_ConstrainedSet.__modify_schema__.update_not_none_field_sch": {"doc_hash": "fcaa706eb6f9b161351a50e513225db9a3f8f56ed117c5a944981bc8e949ea49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedSet.set_length_validator_ConstrainedSet.set_length_validator.return.v": {"doc_hash": "74b68c84425f39d2629f15aec0ef68a839da2b64e2e83d42d01592ea5e2ccde6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conset_conset.return.new_class_ConstrainedSet": {"doc_hash": "ecf0c7c43e80ff758d0c1aa47f10cd31fe7e67ba3486d647c24ff5c5abd0c33a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_7_ConstrainedFrozenSet.__modify_schema__.update_not_none_field_sch": {"doc_hash": "16446ff54ffd173fb9425681237e21b940f0a2388dbea41a04c11b6fa239c5ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedFrozenSet.frozenset_length_validator_ConstrainedFrozenSet.frozenset_length_validator.return.v": {"doc_hash": "fb96ee62be4878a547b145d4b45c397aa4681e915c6d969b3d760f39ec95d48a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_confrozenset_confrozenset.return.new_class_ConstrainedFro": {"doc_hash": "4628eb4de49ea1d322ee579d0b14b32476c4572d6e5d5ef1c1cd8cadf2e47712"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_8_ConstrainedList.__modify_schema__.update_not_none_field_sch": {"doc_hash": "bb9bd7ee2fc10d7776f4936c18b63772af587f400df8b15113cfd2a9287f3e04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedList.list_length_validator_ConstrainedList.unique_items_validator.return.v": {"doc_hash": "1edf8b1e8d59f59afc816d2d8e21fd57301a79da65d715fa20a5e41ae810642a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conlist_conlist.return.new_class_ConstrainedLis": {"doc_hash": "e631b11a16d9bf50ac1653f97a1846ebe66b9b1532a3ceec70007b4a1d7cfa74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_10_None_6.else_.PyObject.validate.None_1.except_ImportError_as_e_.raise_errors_PyObjectErro": {"doc_hash": "17074b5299754b5d8e9f85a6d3f8c608005cc5a7b9209961627cec766d0202f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_11_ConstrainedDecimal.__get_validators__.yield_cls_validate": {"doc_hash": "063b31197581de0f365a3858ddd36d2404f7ba548564c6e5809d62146284b405"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedDecimal.validate_ConstrainedDecimal.validate.return.value": {"doc_hash": "d5877e1393b9fa713f5cfeba60e1f39edc69f5146e20471eb52221268e776588"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_condecimal_condecimal.return.type_ConstrainedDecimalV": {"doc_hash": "83121531b112786d8a146b7d9328cd20266f9062a63cba3ba509419c90ec318f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_12_None_9.else_.Json.__modify_schema__.field_schema_update_type_": {"doc_hash": "67768b1705b67498ecbf792b4f02705d99d7e9aae061618a81dbd5b535c22447"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_15_SecretField.get_secret_value._": {"doc_hash": "2df515db15535e39b05e187f12d2eee609d29344664c90138b7a2999f511dfa1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_SecretStr_SecretStr.get_secret_value.return.self__secret_value": {"doc_hash": "b572317d805a15e2efd7df3ff6723aad4f4fd3acdbf58c94498e393d53680333"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_SecretBytes_SecretBytes.get_secret_value.return.self__secret_value": {"doc_hash": "5b96ec52bf9d7bb1d67687f995d1fa17c1525307bfb0e3e1d5097b0c6932c73c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_16_PaymentCardNumber.validate_digits.return.card_number": {"doc_hash": "e9971566178c3b5a21b1084557d695ef4e677524649946b9c999083cfbd40b80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_PaymentCardNumber.validate_luhn_check_digit_PaymentCardNumber.validate_luhn_check_digit.return.card_number": {"doc_hash": "fcb60f2bbbcba4323315a1332b188c4bc86da53978afb80d6a2d620b8a20c740"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_PaymentCardNumber.validate_length_for_brand_PaymentCardNumber._get_brand.return.brand": {"doc_hash": "0f715e0acefec9a13877a4e85f8b6383abea4c7051784a9de2f0b77efcabb060"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_17_byte_string_re.re_compile_r_s_d_": {"doc_hash": "c5bff931372b0cbd79d171924b6f3dbb8ae9ef62afd91e224f2c7af9e114893d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ByteSize_ByteSize.validate.return.cls_int_float_scalar_u": {"doc_hash": "ac4ce95ad92394e2e7b5656b1b26a41de813ad23df1755b06dcd3dd329fa403d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ByteSize.human_readable_ByteSize.to.return.self_unit_div": {"doc_hash": "86b535d669437fb0ed45058f32c03be85a99b51a38deba0061f2a96403aeaef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_18_None_10.else_.FutureDate.validate.return.value": {"doc_hash": "8da4d6889e087774ba212d9d9b5c22ae0f8a330f0101e2547c02237ca440817f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedDate_": {"doc_hash": "7dee2b45d20083aee2e7c71d3542ecc8e443b89cd7a68a66d0280f0c9a2ff8cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_sys_if_hasattr_typing_Liter.LITERAL_TYPES_add_typing_": {"doc_hash": "d582992a5d12b69950b53e07e21014e96949af11a98574bda827d1db6202296f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_None_3_None_3.else_.get_origin.return._typing_get_origin_tp_or": {"doc_hash": "02d70375d2afd9f06effd95bc63492ce3561751b475999fbf32f3a76673544e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_None_4_None_4.else_.get_args.return._typing_get_args_tp_or_g": {"doc_hash": "f71cf53ac6aa4d8556b0f61b75c505a81dc205f89fe76e0cd0dc067a5bd33f34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_display_as_type_display_as_type.try_.except_AttributeError_.return.str_v_replace_typing_": {"doc_hash": "47dbf3bc1f329a5f31695ca94dc05f9b79c10b1d927aba0384ecf0dcd1afd4d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_resolve_annotations_resolve_annotations.return.annotations": {"doc_hash": "4309427cb94ae29a59be2cc5caa433080e9f159fb997d06a000c95224b2664da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_is_callable_type_all_literal_values.return.tuple_x_for_value_in_valu": {"doc_hash": "19d6cd5eb9c8897b7a6be58196216ae3332cfb7b9662855fc883249a0bf4f528"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_is_namedtuple_is_finalvar.return._check_finalvar_ann_type_": {"doc_hash": "1c18079fd0ff39c9425f6a26acdb03f566e6266621205caccbdcda9f15c4e67c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_update_field_forward_refs_update_field_forward_refs.if_field_discriminator_ke.field_prepare_discriminat": {"doc_hash": "344052210244c519642ad7918e19406937f429db109a7e283bcfb0a75e8c1989"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_update_model_forward_refs_update_model_forward_refs.for_key_in_set_json_encod.json_encoders_new_key_": {"doc_hash": "2eedc3b800be59cfc1220fe453767d79c9ffee69ce97a79e06a89c08b194bffd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_get_class_": {"doc_hash": "51c4a8b3fe634bda1ba511678f660d143c8575bab400257acccb7c1170bcdfa5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_keyword_BUILTIN_COLLECTIONS._": {"doc_hash": "aaf5aab6ca499056303b93e54a792cb160cef20b5abbf9a10fb5badc2caf09ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_import_string_import_string.None_1.except_AttributeError_as_.raise_ImportError_f_Modul": {"doc_hash": "53ab67522feebd6a522a5b963295ee9b9f31ae08b1a08baafbb535b2ee1dc934"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_truncate_truncate.return.v": {"doc_hash": "b4dbf66b0a951a4140370ec805434abc2ee3b524a255511e592d4ec57eff074e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_sequence_like_almost_equal_floats.return.abs_value_1_value_2_": {"doc_hash": "299df8f401dd388ff8bf35c8460737909397fe52203daefc8ad2bbbc0936a36e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_generate_model_signature_generate_model_signature.return.Signature_parameters_list": {"doc_hash": "a9943279e85a0278acc23790880d3c9615e93f18a553a3ae28bf73d60bdf6648"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_get_model_T.TypeVar_T_": {"doc_hash": "f0f9e46cf4478963fa556832146558761693f8b8dc970916713033bf646d87f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_unique_list_PyObjectStr.__repr__.return.str_self_": {"doc_hash": "5b4bd4d7d56b68e7f4d7d508bba50a70c89bbdd17955d26bae6e33e9ac39aae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_Representation_Representation.__repr_args__.return._a_v_for_a_v_in_attrs": {"doc_hash": "f941d0559370f4f99823a7b7bd6bcdc74e6dab3d04f56f55d5d2f8633fa5c524"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_Representation.__repr_name___Representation.__rich_repr__.for_name_field_repr_in_s.if_name_is_None_.else_.yield_name_field_repr": {"doc_hash": "6e94c637340058f224d4c2adee4aa4e23f43bf491fb9e4dfd9430aa442ac47e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_GetterDict_GetterDict.__repr_name__.return.f_GetterDict_display_as_": {"doc_hash": "abd5b74a1e2c975137af0954d1f97bb9b223264f5d0d21b507c9e699065ae208"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_ValueItems_ValueItems.for_element.return.item_if_not_self_is_true_": {"doc_hash": "a38cfb0246888faa9f6c65e90a8a9cee34cb95843d99b0a0063c734e9adebc4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_ValueItems._normalize_indexes_ValueItems._normalize_indexes.return.normalized_items": {"doc_hash": "0b959110228832935af58ba00374a86d9bbec86514c5d5f3c9fffdff93fff10d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_ValueItems.merge_ValueItems.merge.return.merged": {"doc_hash": "e1b2b208dc4c08d0aa93754cf4cbe2e16a15729232b5333a13037cea3bcf505c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_ValueItems._coerce_items_ValueItems.__repr_args__.return._None_self__items_": {"doc_hash": "7f8e62e94be769475911b31210047d360c0291bd487d96890eb60dcb5fc689c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_ClassAttribute_ClassAttribute.__get__.raise_AttributeError_f_s": {"doc_hash": "0e3e82376ab4e76740333143fac88639a7abb6149b614c2e1340787ae64ac6b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_path_types_Obj.TypeVar_Obj_": {"doc_hash": "704049411469a967ded9c2dd117f4d9f4cfc5730be0830480d881ae3f9efc5c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_smart_deepcopy_smart_deepcopy._slowest_way_when_we_act": {"doc_hash": "88b7f45f026c1292bfd78ffd7851d4e5cd8300e0a1c94ee6153f6f3f88797a1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_is_valid_field_all_identical.return.True": {"doc_hash": "9a6f7a29e57cccc59f67ebd3e814aa6a86d758420a1bb81ae66238ad21b2b1ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_assert_never_get_unique_discriminator_alias.return.unique_aliases_pop_": {"doc_hash": "246a1e75c57a305f0fdf1c30b9d2df079d31b7a6089a56b18d20e4b507b48073"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_get_discriminator_alias_and_values_get_discriminator_alias_and_values.if_is_union_get_origin_tp.else_.return.tp___fields___discriminat": {"doc_hash": "384f5292468fc1e7c1e34edfab387249671eca6441a6cb26d71ded1e53b450a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py__get_union_alias_and_all_values_": {"doc_hash": "8a08896d47b60bf397b144c64ff7929a586e41bc833ef8de1714fc0d008c02dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_math_max_str_int.4_300": {"doc_hash": "fa8d12c165fde7c53443411efe80bdce7d835ca5ccc3cfc1a479e181cc2d974d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_int_validator_int_validator.try_.except_TypeError_ValueE.raise_errors_IntegerError": {"doc_hash": "531c49fa3ce8e8cf08e563363700e69645bb7a0d6c5faa0f26191651f316fe55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_strict_int_validator_number_multiple_validator.return.v": {"doc_hash": "eef3d59ec47fd630c71ee6baf299df7beb776d1a6101599db8ce210a1409f06e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_number_size_validator_number_size_validator.return.v": {"doc_hash": "cb2698d5577ccbc07eb1c689b73ddb96f0c26764f096ab335d3b78f8a0737391"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_constant_validator_enum_member_validator.return.enum_v_value_if_config_us": {"doc_hash": "693115342c549c4cdbba721db60110e52f2c9e7fc737ffb37ac2c8b0525f1272"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_uuid_validator_uuid_validator.return.v": {"doc_hash": "b1c2dc6875a48f771cc6472f7b58c1f89598dc10b9cb209338792040b84160b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_decimal_validator_int_enum_validator.raise_errors_IntEnumError": {"doc_hash": "53e00f7e9887b3a4ac6e79401b180ee406aa64e4fab74a1a1edd9d69dc4a4a8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_literal_validator_make_literal_validator.return.literal_validator": {"doc_hash": "a16d5d40bb30266fd0021f18fb50886f2202de3ba1995208af87026e1a1b6e60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_constr_length_validator_constr_length_validator.return.v": {"doc_hash": "a65c585e85da4836c85b15a428e143785b5d0a13cf8bc673f596d60b6c29fd1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_constr_strip_whitespace_NamedTupleT.TypeVar_NamedTupleT_bo": {"doc_hash": "7989d7e3668cb7c93948402b1e76e925276667c9231cb30d910035d2fed0f324"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_namedtuple_validator_make_namedtuple_validator.return.namedtuple_validator": {"doc_hash": "6853c51fcd3a3c99d26ba104018abe5e46b381ee5bac5a41726ec757e3df4487"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_typeddict_validator_make_typeddict_validator.return.typeddict_validator": {"doc_hash": "3e6821826953fb20d3d8b5e8756ec412b4614b600fc1fa810e808d33cd333d24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_IfConfig__VALIDATORS._": {"doc_hash": "36a8d6338ba203650591e3fa9f361c825fdf866ba044ae8bb520ba94e3f2506a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_find_validators_": {"doc_hash": "f43a40011970d45b08efefcfc104577350893c490c07bd080492434d2f988664"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/version.py___all___": {"doc_hash": "e39fed829d7534f1e1c3b66f2c5a9c21bedfb57ae4b5fc8fa4d2a336b0a1a1b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/metaclass_args.py_from_pydantic_import_Base_": {"doc_hash": "6afe7b2a5c2d05c7e73c588fa0bf33d892d819272cc5addfd03209d4c270e787"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_aliases_priority_test_aliases_priority.assert_model_model_dump_b": {"doc_hash": "571e283802d6d78595bd3845c35264ccd6eb162fc7a85ad9c83509cebe41236c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_serialization_alias_test_serialization_alias_from_alias.assert_foo_in_sig_param": {"doc_hash": "b2675b94997910bd157ffac4230939a3614b739e374fed7d5882be64bddf8276"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_aliases_json_schema_test_aliases_json_schema.assert_Model_model_json_s": {"doc_hash": "e95021b87bdada7d7053161f3da4124a6b323dddbf0902b8a49db3c1c694d466"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_missing_return_type_test_computed_fields_missing_return_type.None_1": {"doc_hash": "8570adcc117eecfd8c66ff019b4cc7a1b08f2406b7e0b527ccbc9f4bf29987a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_alias_generator_test_alias_generator.MyModel.my_aliased_computed_field_2.return.self_my_standard_field_": {"doc_hash": "805d1f74370247751ad28c9145ff3d92bc390e284efec93ce0a7ca508a0c2e0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_alias_generator.MySubModel_test_alias_generator.None_3": {"doc_hash": "723cf4ffd57ca77ec72478850cf4e1e735a169b493fa3517dcfbe8c2a482ccd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_make_base_model_make_typed_dict.return.Model": {"doc_hash": "9ced51826c1362dad2b905832dd6b0f28efbf1c6b3d5cf9e4b281e657af97f77"}, "/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_4.assert_Config_validate_": {"doc_hash": "9229fb1f5539bc8338694a07f9bb05206b21ae80d053ca6fa6d73bbcfaefe100"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_hide_input_in_errors_test_hide_input_in_errors.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "6e4567652b09112bfd02feeac5f882fc6837d9b4bd517962e4bcaeab716e79fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_parametrize_inf_nan_capable_type_test_config_inf_nan_enabled.assert_Model_value_inf_na": {"doc_hash": "edceb41a1882e56c39cb205ace8d079a9a2e6d841cb684e63831f26408b5eedc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_inf_nan_disabled_test_config_inf_nan_disabled.assert_e_value_errors_inc": {"doc_hash": "08e44f5666b26e42d8a6f89b41c178d08c8105f82cd57799d145e444cdc02cac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_copy_undefined_test_immutable_copy_with_frozen.with_pytest_raises_Valida.m2.b.13": {"doc_hash": "a13f25dc0ac678f16734c2b660484b157895677a7cf34fe3b79c307d226ad9de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_pickle_fields_set_test_pickle_preserves_extra.assert_m2_model_extra_": {"doc_hash": "46f6e73aa17578f5b213f0e439f804395a0e3886e43c013ec2b285d2a6fe7523"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_platform_test_create_model.assert_model___module___": {"doc_hash": "3171e14851824a78f3a6ecb07b2627b7e1df718dd856ee395ff8a30d4e991780"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_inheritance_test_inheritance.None_3": {"doc_hash": "e1936524bf151313c2d9f2f0a42d3a47611f573b93ffac9f1f312080ccef4ee8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_descriptors_test_private_descriptors.MyDescriptor.__delete__.self.fn.fail": {"doc_hash": "c07ed0e457623635d1f1476052f5d16f612aea829c3e9d70306aa0a0211a42c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_attr_set_name_test_private_attr_set_name.None_4": {"doc_hash": "ec3760c25db1512559695020208601d0182be1252692e7626521dfc4e10c16dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_attr_default_descriptor_attribute_error_test_private_attr_default_descriptor_attribute_error.with_pytest_raises_Attrib.Model___private_attribute": {"doc_hash": "4db3a730f19c6773bfad2e0bef25b516235b799c67e687aeb2305d1c69fba348"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_value_test_default_value_ellipsis.with_pytest_raises_Valida.MyDataclass_": {"doc_hash": "721bdecced8c12b7367f19150da9cafd1149079645ce250d8796e6364d650d97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_json_schema_with_computed_field_test_json_schema_with_computed_field.None_1": {"doc_hash": "150b11da695e2c9fcd259b53184923523ac09e876937cccbd3ac4a12e888a03e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_new_not_called_test_new_not_called.assert_pyd_instance_a_": {"doc_hash": "db4ba14d990d2ad9b22e56c9003afbb8db343f9ef0304e2d2b8a6d02660c6ee7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_cyclic_reference_dataclass_test_cyclic_reference_dataclass.None_6": {"doc_hash": "75a3d493169f09b05889c90bf5eb3677821ceb2ccae038815025c2405e464c33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_cross_module_cyclic_reference_dataclass_test_cross_module_cyclic_reference_dataclass.None_4": {"doc_hash": "0f51b2c746b331e1ceea39c795b00c2e17d05ef833be7c2c886030caa75b94b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_kw_only_inheritance_test_kw_only_inheritance.assert_child_y_1": {"doc_hash": "c8dafa307210cf8a393a0155c9dc3e9da928d0871010f1c377c5a53fcb7b5463"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_extra_forbid_list_no_error_test_model_validator_after.assert_d_b_4": {"doc_hash": "c1311e644470c34515f9ff01fc42c598c233cb1dda97aad16fdef3d6524d4fa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_alias_generator_test_dataclass_alias_generator.assert_exc_info_value_err": {"doc_hash": "df2c13ffbbd7b1b73cd41e067e275b81b855523528f72ee779fc02119124dae5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_vars_inheritance_test_init_vars_inheritance.assert_exc_info_value_err": {"doc_hash": "d65b3b6087cb7c1937527169b2c04a5d781db4f22bd006d37208371a47cdf12c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_vars_call_monkeypatch_test_init_vars_call_monkeypatch.assert_stack_depth_1_i": {"doc_hash": "488f654e0c9ca74372ffd86e5e220a8b96e8bdb6eb0d17de048095ce7b9c3a71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_decorators_in_model_field_test_decorators_in_model_field.assert_m_model_dump_": {"doc_hash": "39bce74c84fdfb4dc3877549e395b43fadb07b83ac2e97e2245cab7c6ce2e0b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_vanilla_dataclass_decorators_in_type_adapter_test_vanilla_dataclass_decorators_in_type_adapter.assert_adapter_dump_pytho": {"doc_hash": "1e8f7c18a0fc78609d2b8408a39df887c51c1e24daf825298332495affa35ca3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_slots_test_dataclass_slots.assert_dc_b_bar_": {"doc_hash": "8bc4d1abe11cadbe8242d9ea9f28da754d9c4f9b2f392c78682cf7d63e9631e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_slots_mixed_test_dataclass_slots_mixed.assert_SubModel_z2_z2": {"doc_hash": "4a96595052c487dcdc54c34335da7b3b3354580ea25c7086dab9a089001658cc"}, "/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_isinstance_validat": {"doc_hash": "b1c7743bb14ebbdf67a3387f07cb3d99ad766ed6960dab6db691002816fd9f57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_fields_test_fields.None_1.assert_len_m___fields___": {"doc_hash": "945eb20347ea4e6badbdca13c3ee94b679cae9eb4c42972a7f399e33d9d2efa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_const_test_unique_items_conlist.with_pytest_raises_Pydant.Model.x": {"doc_hash": "31d83557d9bd8ca024f8535e0d8e5b2100c5f06570be293be0cd96a9868cd95f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_allow_mutation_test_allow_mutation.assert_m_y_3": {"doc_hash": "6ca3913233593b0889cc8354b72bb2a8113b6683c16af894e40efa9345174e4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_extra_arguments_test_field_extra_arguments.assert_Model_model_json_s": {"doc_hash": "a29386ebe4c13da99b7c01cb9670f847a5cdf3a03b07a55b7351fa96392b701d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_deprecated_module_test_deprecated_module.None_8.validate_arguments_test": {"doc_hash": "4b96d860b904e557a8c1f9d1d6da0a4b0ff8d6dce952609ba141f8df122001b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_deprecated_color_": {"doc_hash": "b0161ec4e7d19ea1b7b22ccfdb42178b5024391449d3b4e8b6d63e96a5e7fb0b"}, "/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__.convert_to_init_error.return.init_e": {"doc_hash": "fc1522a1b69788fd7667049b05f24c61c3fd2420812dd5c93a5438f504d81bcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_long_int_test_parent_field_with_default.assert_c_c_3": {"doc_hash": "2f31f2e5a7c6eee9d43dd04c2928f31022d18b3bdf9c232e45dd76c8b02862a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_abstractmethod_missing_for_all_decorators_test_abstractmethod_missing_for_all_decorators.with_pytest_raises_.Square_side_1_0_": {"doc_hash": "af3b00270e7dc143f38cda361a9912fc406d8fba139daee66d4eb0effa4b2747"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_errors.py_re_test_user_error_url.assert_str_exc_info_value": {"doc_hash": "46c6e7049fa97aec93fcfb88939fc9de1382dd2ed3bbb8596f2d4cd0007d9cac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_errors.py_test_raise_validation_error_hide_input_": {"doc_hash": "fc1e85e2c170f73ee04f1e241cbb4b98c60e6118a75518cd58ac926bfe8f211d"}, "/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_referenced_generic_type_bound.ReferenceModel_MyInt_": {"doc_hash": "e54d52f6e8425d5f70c9cb6edd37fb361b2f991056ecd859f141bf79b8bef1ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_parse_generic_json_test_parse_generic_json.assert_serialization_sche": {"doc_hash": "c0177f7612c6b95267e9228bb56516021fae57e4382ffd1de81bce20f9fef80a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_memray_limit_memory_test_generics_memory_use.for_t1_t2_t3_in_total_._.pass": {"doc_hash": "54cc1c611c859580a5665db46d29bf5e0953957fab2f6d9d62be308640cb84cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_encode_fallback_basemodel_test_recursive.assert_M_value_1_nested_": {"doc_hash": "230f93ebe5a7dd88143d7ff4b64a1a32953429012af2120db6f22327306b6cd0"}, "/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_invalid_json_schema_extra.with_pytest_raises_.MyModel_model_json_schema": {"doc_hash": "7e18a1d6e5580dfd1b51c8c3d59d5972dd64d05c1b71ab695aa45b4b722979ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_decimal_json_schema_test_decimal_json_schema.None_1": {"doc_hash": "f4d42948f102c21c606977f0db49b0d8e23f141a41ede6bf1021dc867585e131"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_test_optional_modify_schema.assert_Model_model_json_s": {"doc_hash": "4005be833c4e51d5146d4caa302617900a24f0df6c3f1896c284a8ca9e651718"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_any_test_set.assert_Model_model_json_s": {"doc_hash": "88bc7ef85d6ca751481d68ff2e0d2ba6de182854940c3e5c641d8de641bef00a"}, "/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_ta_json_schema_": {"doc_hash": "26909a008ccb136623e940c0493b616f3861fd73f46c970384fe57cce5764e2e"}, "/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.None_1": {"doc_hash": "6ee9476da2cb0f2156287aae6339c42965a17caa04a152c41a806b5492ed40e6"}, "/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.assert_model_schema_prop": {"doc_hash": "dabb36d7c7401415d354eca5023a163e9c326f5cff65572086fc80190f074b99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_tuple_with_extra_schema_test_tuple_with_extra_schema.assert_Model_model_json_s": {"doc_hash": "76daeba374fe77b843e4b1b5a955ebf8c2cbeda0faa62740019ab2fc4a4f8c65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_namedtuple_modify_schema_test_namedtuple_modify_schema.assert_Location_model_jso": {"doc_hash": "841086b372529388bc69893eaf1806c0ca9b795eb0c4d1cc9b854d242a7c1abc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_remove_anyof_redundancy_test_remove_anyof_redundancy.assert_MyModel_model_json": {"doc_hash": "3f5127c74bb9f48c07cb7bf26363202d4e40a2db6bf42f9d7f4d3314cf1744eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_generate_json_schema_generate_twice_test_generate_json_schema_generate_twice.None_1.generator_generate_defini": {"doc_hash": "5c281aaa6e4cdf7fd2a41c80c155fdb37fe33c5d3ecac7a97a821ddb47c4fd9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_mappings_str_int_json_schema_test_sequence_schema.assert_Model_model_json_s": {"doc_hash": "0f42c7eda31d3b507bcaecc4e1bb5f22a5d174dcd7684e1da8f7ee3d0b57bbf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_sequences_int_json_schema_test_sequences_int_json_schema.assert_Model_model_valida": {"doc_hash": "87824bb269eaf19c911f10b609b3fee45ace375a1537be6933cec056c98efc47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_arbitrary_type_json_schema_test_arbitrary_type_json_schema.assert_Model_model_json_s": {"doc_hash": "f369da09633313241f6d607adf9a06c4daae0a1896d0aa305056d8cb6527daac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_core_metadata_core_schema_metadata_test_build_metadata_dict_initial_metadata.with_pytest_raises_TypeEr.build_metadata_dict_initi": {"doc_hash": "fb4cd7b1096a2758c8ebe8a174dca1e2098f589b40fc1c94057787c9f6ec7e3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_type_adapter_json_schemas_title_description_test_type_adapter_json_schemas_without_definitions.assert_definitions_not_": {"doc_hash": "ece9cabb66c2709dff45da805c25c99c02127c245c3bc7dd7bf42109ded7e8ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_custom_chain_schema_test_custom_chain_schema.assert_Model_model_json_s": {"doc_hash": "45665ffd2c262d9d39ef19220f6dbb0a58d1cf760ebc5fa5ad3eeab29236e948"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_or_python_schema_test_json_or_python_schema.assert_Model_model_json_s": {"doc_hash": "30c923c47c7a76f4913da05d124203365c3d472f07617b280b782a64667e5aec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_rebuild_zero_depth_test_model_equality_fields_set.assert_m1_m2": {"doc_hash": "57390c37867bdb8157a6959b34ae16adc9a5aebcaef0cc888bb7a518b956b364"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_equality_test_recursion_loop_error.assert_repr_exc_info_valu": {"doc_hash": "94ac02d2d3d262bace2f03e9e61b5948f826eb07cd7d00684b70b9f1d6bcdef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_nested_types_ignored_test_nested_types_ignored.with_pytest_raises_Pydant.BadModel.x.NonNestedType": {"doc_hash": "9cacc232d852b9c158d9154ab935efb40632488f37e4130edb3245e7b28fe49f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_sys__equals.if_isinstance_a_str_and.else_.raise_TypeError_f_argumen": {"doc_hash": "c48db3f6add75afe38fa71d2a09685c0e2dc9dd2697043161ca8f2bda97b0c79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_test_model_signature_test_generic_model_signature.assert__equals_str_sig_": {"doc_hash": "61bb1c7c2a34fe9ac7371975d3226fc854a6a499a00c02352208e383644607f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_from___future___import_an_test_model_validator_wrap.assert_Model_model_valida": {"doc_hash": "15075556f502514d13680e316583582dc5b0a971c650850e86821b72fd6cef7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_model_validator_before_revalidate_always_test_model_validator_before_revalidate_always.assert_Model_model_valida": {"doc_hash": "16bb3ace0e740913604a7cb7a7f239e1b9414b3800a992ba92c3fa99c1b15faf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_model_validator_after_test_subclass.assert_Person_age_28_age": {"doc_hash": "5284ffcaad6dd58931b12022b2f3aa05d4c11e0aa53772be3fe5c734420227f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_nested_models_": {"doc_hash": "e08fb5b730a59a4bd6e86b08f72dcb3a71a6806b36f8139219a66c9ce9c4a6e9"}, "/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.assert_m_model_json_schem": {"doc_hash": "6cd55bf2212592749f676d3bfcdb7509b657a9393926f7a5b1f20d1b89afa249"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_ignored_types_are_ignored_cached_property_test_none_as_private_attr.assert_a__x_is_None": {"doc_hash": "a48b6b66b9c230e5dfb236f96baa2047e53630f8d9268b59a242ea036ead1ec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_nested_test_root_model_as_field.assert_isinstance_m_root_": {"doc_hash": "0c9648aaf02776469a7b68cf65db481076b3b0b5acff272a61c3a33e1ee30e51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_construct_test_construct_nested.with_pytest_raises_Attrib.v_model_dump_": {"doc_hash": "4fc389bff887865743e6112723dfe210fcf93549f208e255bd6524f54a9f5f89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_assignment_test_model_validator_before.assert_exc_info_value_err": {"doc_hash": "9dcb2fef6384b023abc4b1d8659b36ccef67f74ba74103e3437e63b8c507c4cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_model_validator_after_test_private_attr.assert_m_model_dump_": {"doc_hash": "b3ba642507595f5f62a22872f4e9e68273795f9358f04d94c4a59f407ffad5b5"}, "/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.None_1.assert_m_model_dump_json_": {"doc_hash": "f181a4ec855eed3c269d32e68f8c49d588e09e85c74cde520237eecd45bf6084"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_invalid_field_test_serialize_with_extra.assert_m_model_dump_": {"doc_hash": "1ba0238c653f866fb0fabbe644b7e372c0e3ed6916228a0e04e46100dddc2cb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_nested_models_test_model_serializer_nested_models.assert_Model_x_2_inner_M": {"doc_hash": "26f7c2a42ab97baf57a0b5ba4808247dc5b58405166d242cb0ebd888d8c2970f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_json_SomeNamedTuple.x": {"doc_hash": "624393c74f467ed748c4b9452d439ef74593276376aa3b68ae15adf95e867f73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_types_test_types.assert_expected_v_val_": {"doc_hash": "ae42a8b1f31076f6474058fba00990ce48ed3ab1a65dbda172eb649d77af3388"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_IntList_test_type_alias.assert_res_1_2_": {"doc_hash": "0559a0d829580cf95063fdc262768561b37661a00d1653eb75407fc44741d9a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_python_strict_test_validate_python_strict.None_5": {"doc_hash": "ae826ce39362e1dbc8f5c8f0b1b0547f85443d01cd7f76b622790f1e227d9738"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_json_strict_test_validate_json_strict.None_5": {"doc_hash": "a7f90d94ac2bc7733a0982399ef043909319fe30bdd28cf257df79f00b2ba9bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_python_context_test_validate_python_context.assert_contexts_": {"doc_hash": "18ed26e522204fa510a7a3b3b3155a5e9f6136a02de79b38c493aff412f13576"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_json_context_test_validate_json_context.assert_contexts_": {"doc_hash": "9f9f366ff89c67f625b91c1bec36bebc2f8c37c5f978bac8041095f24d3e915b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_datetime_ShortRecursiveGenericAlias.Annotated_RecursiveGeneri": {"doc_hash": "87d54db5730ed0344e1c74cd0ad93ada84de43f7019810f5dab29f057f9e316b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_test_type_alias.assert_t_json_schema_": {"doc_hash": "5202cc433971f6d4af80c8c7f2c7459a38c1088b0e2d204027b787de0af8dca9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_type_alias_test_recursive_type_alias.assert_exc_info_value_err": {"doc_hash": "edd40620540d5e8129281d5b1de71633168822b94f57103921621f733ae3e9da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_annotated_test_type_alias_annotated.assert_t_json_schema_": {"doc_hash": "1b41433f69003803f984b6ee0b577673f6772eebf61489aefd0612c189bee954"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_annotated_defs_test_type_alias_annotated_defs.assert_t_json_schema_": {"doc_hash": "830314f76662d0f7649cc5f14968766be75af64cce2d30143900e9ffc3959931"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_generic_type_alias_test_recursive_generic_type_alias.assert_t_json_schema_": {"doc_hash": "80eab3238738db71b43787a67ca45fd19aef97c5d405c94dad60cb63bd53dbb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_generic_type_alias_annotated_test_recursive_generic_type_alias_annotated.assert_t_json_schema_": {"doc_hash": "a3a70756eac0eada502d6dbd643729a0499ff7d1acb79afe5afa04a785ee793e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_test_pattern_with_invalid_param.with_pytest_raises_.Foo.pattern": {"doc_hash": "a3bf410a3d4c2ac69ede0f8a3d58debcb254184aaad3191326000e83e29664b7"}, "/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_3_test_recursive_generic_typeddict_in_function_3.assert_exc_info_value_err": {"doc_hash": "4647e19bc8506bfbc3887ce0c1f3732a96001cae1eee47f2542f1f8a2b01f75c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_field_validator_test_typeddict_field_validator.assert_child_ta_validate_": {"doc_hash": "15d0d480397c150a39c24b918182d77bce8adbf1925106b6357f38d867f78ea1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_model_validator_test_typeddict_model_validator.assert_ta_validate_python": {"doc_hash": "8bb3f4444caa0ef0f07fea7e7f43af4fbdaa3ce9f9dbe64cbee0a704844c9c19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_field_serializer_test_typeddict_field_serializer.assert_child_ta_dump_pyth": {"doc_hash": "7fd05344f36e9c3f8e64cd63699794043386900a7bcc3673698726ccbb492ac9"}, "/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_19": {"doc_hash": "b8ec65715b81f67a813c2be9922a0d82388511dcee9706116125630453082106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_camel2snake_test_camel2snake.assert_to_snake_value_": {"doc_hash": "6bca4a85dd64a36592eb83f310fd5b3544a73d38d1700c16a5fd7236bff64c8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_model_fields_schema_test_handle_model_fields_schema.assert_schema_": {"doc_hash": "16bb2ccab5bbbfb03c05eec053f3096ad2dcef89ec7949958e96a16914453c47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_typed_dict_schema_test_handle_typed_dict_schema.assert_schema_": {"doc_hash": "60c1e4eac95e74c84ea8de0f4c7eb24c429ed8456121c3c53d384404d6d63852"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_function_schema_test_handle_function_schema.None_2": {"doc_hash": "45351342f108c1bafa0db2040ffe3d15133b109e28ffd456089d925ace61fe55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_call_schema_": {"doc_hash": "c479bc9bb351f00848f9d9e1a81fb3412483c962819e4ad6b68c9cdd6df91941"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_v1.py_from_pydantic_import_VERS_": {"doc_hash": "8557cb204dc4c1739780baa522444912330c1453b2b1d5c01c37e8e1a069fd18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_alias_generator_test_config_arbitrary_types_allowed.assert_exc_info_value_err": {"doc_hash": "fab215d2e42dc13703dc3abeb38ce523247606f42b55939fe75260a0281c91db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_validate_return_test_validate_all.assert_foo_0_datetime": {"doc_hash": "7f55b41a71ddfba7df9c6ddc7c0150bf152d0ea0c4ef405ab71ca1896577f6b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_validate_all_positional_test_validate_all_positional.assert_module_foo_0_d": {"doc_hash": "7b06f24b621a366d52e7f84fd23e2fa602ba156d4668813ff6194c19541936d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_allow_reuse_inheritance_test_root_validator_allow_reuse_inheritance.assert_Child_x_1_model_d": {"doc_hash": "38c82b2b242a9864184fb3c0e10b3d63d46289b36a7a8652b454877c6518b515"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_bare_root_validator_test_validator_with_underscore_name.assert_Model_name_Adrian": {"doc_hash": "463a9d24e5d87f81934cee2ec8328c31be0b233800c0333211154536eef5fefe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_set_dataclass_fields_set_dataclass_fields._type_ignore": {"doc_hash": "8ee4c405f080caff796fa52d63a977c3bfbe2f2877ede15a323fda90c4155241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ValidatorDecoratorInfo_ValidatorDecoratorInfo.check_fields": {"doc_hash": "0caab6303b05867fc6664bb3d9129873d2809553aec51a26252fac3c0523cfac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldValidatorDecoratorInfo_RootValidatorDecoratorInfo.mode": {"doc_hash": "3cda4c6015d5f58c844836f91122dc8ca2c3f38280b58e7a58de0f1996b2b646"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldSerializerDecoratorInfo_FieldSerializerDecoratorInfo.check_fields": {"doc_hash": "a62decc258b0586eabd3f5e56c4060c5bf8670cae705fe9e54e1713ec6d2374e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelSerializerDecoratorInfo_ModelSerializerDecoratorInfo.when_used": {"doc_hash": "d55bc5a062f66820b067bcbdf37693e19b333f7dbcf0ab52e0fdb3c812f7d9ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelValidatorDecoratorInfo_DecoratedType._": {"doc_hash": "c5767e6987f137881d0138d63a590ce290ef97a5555aeff3f91f2782fdf6790e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfoType_Decorator.info": {"doc_hash": "6e1de70956ffb5aaa7ef70eba4b2fe12c8d30c75d37d1aa3d33ed05b66379dd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_AnyDecoratorCallable_is_instance_method_from_sig.return.False": {"doc_hash": "781d6c22cc0d7998b6649b924398f11e75dd6a4ffe279ec2e843941fdc8e4db7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ensure_classmethod_based_on_signature__is_classmethod_from_sig.return.False": {"doc_hash": "711d51620f1ecafb00a94b9b85390c64a8a0058864a4bfcaecfc7d7cf37b2b74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_function_return_type_get_function_return_type.if_explicit_return_type_i.else_.return.explicit_return_type": {"doc_hash": "5c54aad9ad9d7dff275a1e75cf06cb81f2cfa7baf36bf45533e49f7ba30025ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_count_positional_params_": {"doc_hash": "9a299d00a47cdfbff52ff0a91c09d142fdef3a1a3496ddb9832421842ce69f94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py__Logic_for_V1_validator_can_be_keyword.return.param_kind_in_Parameter_": {"doc_hash": "f17ad79dbed7d03b9677be7f6bb331afa1c9bc36594395374685855999e1caca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator__ApplyInferredDiscriminator._This_class_is_used_to_": {"doc_hash": "af555eba5692e83955a5e61d7bf0a6542ee01c6106e3a49d665d979ab2a63527"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__Private_logic_for_crea_object_setattr.object___setattr__": {"doc_hash": "8f1e851b6a4d254db7e2b9ab76507be200f0bcfc1c2217e66d068fa0637dbfcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_repr.py__Tools_to_provide_prett_PlainRepr.__repr__.return.str_self_": {"doc_hash": "4e5a85ce0eed1f689d9b6b7fd83928af871860c11d222b416690d48e97517443"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py__Types_and_utility_func_if_TYPE_CHECKING_.HandlerOverride.Callable_CoreSchemaOrFie": {"doc_hash": "f944860368f81f9377421ab1ab747f758e57fc6d5d669d031e8c166f8bb752bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_CallbackGetCoreSchemaHandler.resolve_ref_schema_": {"doc_hash": "9583bcdb0bdbde06ac83150480a785cafcb18400c6177c236cf4881188432b85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__Logic_for_generating_p_if_typing_TYPE_CHECKING_.StdSchemaFunction.Callable_GenerateSchema_": {"doc_hash": "b34681568153b1481fc4653439e2739e9f566f923b7eb33c39ad5e78adb726b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_url_prepare_pydantic_annotations_": {"doc_hash": "9bd094611bca4bce4fa9c530bea90b31d727651e439106f66e5b09353e20e96d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py__Logic_for_interacting__literal_values.return.get_args_type__": {"doc_hash": "19c98aae772beba36f4405d63f38fe16e1e4e213ce4c05e7a2a4343e4721d182"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/alias_generators.py__Alias_generators_for_c_to_camel.return.re_sub___A_Z_lamb": {"doc_hash": "fead8e33e3f54f8df6317997cf32e75c506a365eeec4fe093cb9ba029562f24e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py__Color_definitions_are__HslColorTuple.Union_Tuple_float_float_": {"doc_hash": "919a05771104b628f3178fa39ebf429df914395fe5a1dd8ce373ea6369b68e5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color_Color.original.return.self__original": {"doc_hash": "5683ec3b3e4e3e69479b83ee2b4337eb81d8c7a1414420c754d3463b17224c16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py__Provide_an_enhanced_da_if_sys_version_info_3.else_.dataclass_1._": {"doc_hash": "f0e716f8ed6ae8dc9be929c5b22d65d186882bb8dd60a3c1ab34e8ddc5bda795"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass.create_dataclass_dataclass.return.create_dataclass__cls_": {"doc_hash": "fcd8679b89c88a3207622cf08650bfe3a90d6ba5ea6e9d90a511987bcbd8c863"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py__Pydantic_specific_erro_PydanticErrorCodes.Literal_": {"doc_hash": "3c4363193502bdabcd1a35ea9e0d7659678479bc5368c76ba89293651d794e64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticErrorMixin_PydanticUserError._An_error_raised_due_to": {"doc_hash": "06e5bd93ec2c9b9877235111d58585cd523183fed5bf19f05e79f88029f7396b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py__The_networks_module_co___all__._": {"doc_hash": "266708901b3f1ff0878152ffd5b1cd6a75f255f5b017de42636fcfe90f3b0f4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_confrozenset_AnyItemType.TypeVar_AnyItemType_": {"doc_hash": "d978f461a55eca94e27634d712508727e0967daf402be9ec0e34997f1cea1512"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretBytes_PaymentCardBrand.__str__.return.self_value": {"doc_hash": "988a252f9ffdfab08143bfdd48c9e9d5ca55ad5f4479f9e4d05177d578af1fc4"}, "/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": "81f6448111bab510e694633da9e7808c7fe4eb92eb2e7e741c154521be5310d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.to_ByteSize.to.return.self_unit_div": {"doc_hash": "4272f81111a831030fa41c988478aeee52bb8178b79849766d567162263ba59c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_None_5_if_TYPE_CHECKING_.if_MYPY_.else_.AnyClassMethod.classmethod_Any_Any_Any": {"doc_hash": "3e7b5e906a7a139f8ca75dc5ac79fb6a77ef6f2f85c955389bdf2d7152a431e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py___all___None_8.else_.is_none_type.return.type__in_NONE_TYPES": {"doc_hash": "c768f79ee2380a18b91ee31bfce1456a4df9f79322bb0c67698720cf3d3d6164"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_wrapped_nullable_union_test_wrapped_nullable_union._insert_assert_discrimin": {"doc_hash": "556ba08445fe5e898192e486dc09add8f65e2c123fd5477a59dfd80fbd4d4424"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_advanced_generic_schema._insert_assert_Model_mod_test_advanced_generic_schema.assert_Model_model_json_s": {"doc_hash": "84c9ec7fe36ab94ddafad53a9122da380fa87d27832e6fffe1fb3e672b1a2cbe"}, "/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._insert_assert_Model_mod": {"doc_hash": "bec65ea28f141c64cc93ff0ff17eb3c1d19ac59610c366d4cea019571b97b23f"}, "/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._insert_assert_Model_mod": {"doc_hash": "e21f8fb8fd1d9268652a090a4998d46de88badc912229b3f09ded99c7e229acd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_lax_or_strict_schema_test_lax_or_strict_schema.assert_Model_model_json_s": {"doc_hash": "66c10a4dc2cd0a18689dc48c58a22d2e5998f350ee595e3cbeceacb0abe979be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_override_enum_json_schema_test_override_enum_json_schema.assert_Model_model_json_s": {"doc_hash": "eadcf258bb294213e1874056048ec7a444a804de5c58efa47093c47d3d9283bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_get_core_schema_unpacks_refs_for_source_type_test_get_core_schema_unpacks_refs_for_source_type.assert_received_schemas_": {"doc_hash": "07e813b0920dd944f7d82f9ca27e87167680e9541dbdc5d3481cf8b170140ddf"}, "/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.CustomTD.__get_pydantic_core_schema__.return.schema": {"doc_hash": "1e931c8f27296de29179db9662114a811cabc93c5d5a15fd2bcea93abfdb06fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_schema.Model_test_typeddict_schema.None_1": {"doc_hash": "aaafcd26467aac5e7705c8f2cca80c73bf46fbbfdd49bb7a973b286b2afb41cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_make_v1_generic_root_validator_make_v1_generic_root_validator._mode_after_for_pydant": {"doc_hash": "b06c1494aa055ed99ffa128e6fb897dfe688b2d7943fe3892dd730f8fc758586"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_make_v1_generic_root_validator._wrapper2_": {"doc_hash": "94a29c30a8081c7dca7872d2625b3a5713d93a0750b66169a3f629c908f51f60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py__get_caller_frame_info__get_caller_frame_info.return.frame_globals_get___name": {"doc_hash": "29098646c766a67a6dc10ee0b8046b8de0019acbfdedeb068c9a70888d60065c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_DictValues_iter_contained_typevars.if_isinstance_v_TypeVar_.else_.for_arg_in_args_.yield_from_iter_contained": {"doc_hash": "bbe49c941030a1b0a59d7b55728ed4b524eb9154bd73f4e50488eb2ec2266575"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace_inspect_namespace.ignored_names.set_": {"doc_hash": "20fec39d8e101449b48bb516cb04b797a43d16a5e45a5bc625be54752eab55a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_AnyType_": {"doc_hash": "fe5af32cc7c1bcf9d4e6fb028fafdaa77898bcc42c4ab3b73d0b60e85f1210f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py__This_module_contains_r__inspect_validator._decorators_inspect_valid": {"doc_hash": "f57cdb085fa8df1fc1499c97452d08e504776d164b24014845cad69bcb343995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py__ModelType_ModelWrapValidatorHandler.__call__._": {"doc_hash": "f3fe095ecfbb7e8fe4112482fc6107641db84bde1efeed14869c6d2bfcf86011"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelWrapValidatorWithoutInfo_ModelWrapValidatorWithoutInfo.__call__._": {"doc_hash": "f816132e183b8bc9561bcf3d42d28aa10fe44fcacc143edd5ac126bf6233c4e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelWrapValidator_ModelWrapValidator.__call__._": {"doc_hash": "aa2f844a6697283ae38c205024e17b2fe1db3c1be5d9cb2043447ab89f6c3eb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelBeforeValidatorWithoutInfo_ModelBeforeValidatorWithoutInfo.__call__._": {"doc_hash": "4759f59abcd0090bd87d843f836e60568a607560381ca5efa8353774361a111b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelBeforeValidator_ModelBeforeValidator.__call__._": {"doc_hash": "c36eb8e8dc4be6f760f4765be53c636346326049c5f0cc5b849d8be58a987544"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelAfterValidatorWithoutInfo_model_validator_5._": {"doc_hash": "e6f642b49b0a7c3a28781ef7d7db678c0d36f2043fd88231bc6feecf90e51aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_model_validator_6_model_validator_6.return.dec": {"doc_hash": "db879f0c2a12384b781244d35e6684081c08cd66047a876454442b05b898d965"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_None_3_": {"doc_hash": "c09d3720f6996402dca70d882e8abf0a7fd114068a41c729c59521fbe1a21743"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__Logic_for_creating_mod__object_setattr._model_construction_objec": {"doc_hash": "3705b6342a7786e5c9caadc5b39a581da560a3ec9024f34edd0137996d9220aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_parametrized_name_BaseModel.model_post_init.pass": {"doc_hash": "1eb3373668591db2ec27d9245a29d64ae46b05f91749a631bf84ed2a05bc6616"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_validate_json_BaseModel.model_validate_json.return.cls___pydantic_validator_": {"doc_hash": "bbf2a98e7a2334dd63d7e520e605e1581a7e16d62cdf467ed662bf655903df1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._take_logic_from__repr__BaseModel.__fields_set__.return.self___pydantic_fields_se": {"doc_hash": "1af312a2dcbaa75a32b8bc3b254fb67051c48a50f681e2ccadb58ad9b2cfaf9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer_PydanticModelTransformer.__init__.self.plugin_config.plugin_config": {"doc_hash": "b01778fb4358af9bec958dc1b72a01c303747164acc4eedaa73c05dc723d8cf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_error_unexpected_behavior_error_unexpected_behavior.api_fail_full_message_co": {"doc_hash": "31c91d7aa6940d4aea7394dcc76b6c7c1ada685f2a1a7dd4bc782eed92875502"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_error_untyped_fields_error_default_and_default_factory_specified.api_fail_Field_default_a": {"doc_hash": "6f34e85d188f99c63911252c39e0134ff4c6355d0cc12b5c82517fde7cfddca8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_IPvAnyNetwork.__get_pydantic_json_schema___IPvAnyNetwork._validate._type_ignore_return_val": {"doc_hash": "f2d631f07cc369ab1aac0dac1991464a80b29742d71b0c29d5685b74821da79f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Strict_StrictBool.Annotated_bool_Strict_": {"doc_hash": "d460010691d5d7b677ab7ac8997b3a21bde91bd5b64efea02d1bd7893f6499c9"}, "/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_DynamicAliasModel2_x_y_": {"doc_hash": "2a4b1ca4bd49294f1848b4d184ee659c6e543d93cbfff8315b085ee146db6412"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_": {"doc_hash": "652bead441ce6cc18375e0addbe6f28f49a4e48e3151b4cf969328a4b2fbb651"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_descriptors.A_test_private_descriptors.None_13": {"doc_hash": "9d70cb40733beb4e7dd34d4e1f88ab095d635d36d8dd280350185fe79f9ac952"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_attr_set_name_do_not_crash_if_not_callable_test_del_model_attr_with_privat_attrs.assert_not_hasattr_m_so": {"doc_hash": "46a1f0c02aaa6d256968aa688b8285bb4e56cd9285fc7bfc8a45d62e26565161"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_del_model_attr_with_privat_attrs_error_test_del_model_attr_with_privat_attrs_error.with_pytest_raises_Attrib.del_m_other_field": {"doc_hash": "df7cd0993f617099101d5395ef33435e24de81b555d815b80f6241c8dad9cff9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_from___future___import_an_SOURCES_ROOT.Path___file___parent_par": {"doc_hash": "7d5259423bd7df4be15f033b3f519d50c7f1af39abeb8efc90a4ced2a40f530a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_skip_docs_tests_skip_docs_tests.None_2.except_ImportError_.return._ansi2html_not_installed_": {"doc_hash": "5ca11945b4efbe6cb513d6e5efce10c7ac3f098f1454fc04442e55e33b6e72df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_run_example_run_example.try_.else_.group_globals_set_group_n": {"doc_hash": "9d4fc5123454fce9a9954ca40b549b95b82c75e2af4d5d9227c78cbeccf5aed7"}, "/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.run_example_example_eval": {"doc_hash": "ddfbc4a82f7ff7196979452b9ae4cb21385a95c641205459d7f958092fb2ca98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docs_devtools_example_test_docs_devtools_example.None_2.else_.assert_output_html_out": {"doc_hash": "01ceedf38fb842c8fa732917d01703270f98a3bf48049237a4c5e59d0d60cdf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_error_codes_": {"doc_hash": "2f25c0ff65fa4702e8c5ad92baffee45bc3d792eec02db74dde0425b686d2c8c"}, "/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_raised_by_usage.with_pytest_raises_user_e.module.Foobar_a_1_": {"doc_hash": "59f424362cae2f86ee9b6d4e0859c5538a26aeb09e00ed76771c41cc081b9b3c"}, "/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_ta_dump_json_gen_v": {"doc_hash": "f444a5c549004e77411a9e724c777b5810454349c5c7628560ca6341e11440ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_literal_types_test_literal_types.assert_Model_model_json_s": {"doc_hash": "c8f6f8b84658b0391c2e69e02237dd5949424d5f090b05593e1a271e02428eed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_color_type_test_typeddict_with_extra_allow.assert_TypeAdapter_Model_": {"doc_hash": "a627cdb2934463e6b42869da846ca2eeedec030d1012e90cb3a2d6513faa1b82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_root_model_test_root_model.assert_C_model_json_schem": {"doc_hash": "1021a83762a642bd9ec37eb9ec95408318c59b43bc9eccc32384f723cdb974c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_extras_on_ref_test_json_schema_extras_on_ref.assert_ta_json_schema_": {"doc_hash": "c73a6a27b93ebc902b21682146ff3cee2561c5c6d9308fcf1218617dae9e56dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_inclusion_of_defaults_test_resolve_def_schema_from_core_schema.assert_Outer_model_json_s": {"doc_hash": "ce0f13c70a79019a6b51e7dcfe9550cee9db7d7da4abc467c2763fdbbba6d4c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_examples_annotation_test_examples_annotation.None_1": {"doc_hash": "4f9c6a6daa0a6e22fbd718eaf38e5eeb657586a313852940dca523c6d59d7742"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_field_required_missing_test_typeddict_field_required_missing.CustomType.__get_pydantic_core_schema__.return.core_schema_no_info_after": {"doc_hash": "9440fd67f5e6c14ea5292c83a2fb8d2c0c940e20e4b1b35733befc67cdef694f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_field_required_missing.Model_test_typeddict_field_required_missing.assert_exc_info_value_err": {"doc_hash": "484c2eb8c432fd8c1a3395eb2177e8f506c9ade89ed88f1b22171cdd29e8579a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_get_core_schema_return_new_ref_test_get_core_schema_return_new_ref.assert_OuterModel_inner_I": {"doc_hash": "4d73899cc4c0ad2fb6aab7e4778088d0cc84ad1e3ffe698059e99f1b1b9b025b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_resolve_def_schema_from_core_schema_test_resolve_def_schema_from_core_schema.assert_Outer_model_valida": {"doc_hash": "87293f92811b0877c782f6f0aca2d7db3cbb6c1f4eb916385952bc79f6248a73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_validator_scalar_test_extra_validator_scalar.assert_Child_model_json_s": {"doc_hash": "4600134f0f9f677e4ba3e9c56fe522dab959c17aed8e52e8f3d4f1055684ff74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_validator_named_test_extra_validator_named.assert_Child_model_json_s": {"doc_hash": "192a8c7ac413c20394c61d7232747653346432525f4f80651212355e62a8d9c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_validate_assignment_false_test_root_model_as_attr_with_validate_default.assert_m_rooted_value___p": {"doc_hash": "9fb78e5220b9a7e205a844f36fd64ccc58d4e0f033b7806485bd347cac038af6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_in_root_model_default_test_nested_root_model_proper_default.assert_m_value___pydantic": {"doc_hash": "b17b656774909853d8023b2057f0e521fc86b2c82e35e083cc4f1b98fc18199a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_json_schema_meta_test_root_model_json_schema_meta.None_3": {"doc_hash": "0962d7540052d3aff31acec701a11becf05187ce782c00c51999ef7a00e3e329"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_pattern_serialize_test_type_adapter_dump_json.assert_ta_dump_json_Model": {"doc_hash": "a6cc2a6510f04d06dff73f2c1db50a75eda5ef53c23095e7ff74e3aec9526355"}, "/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_partial_new_typeddict.None_1": {"doc_hash": "e24d047aafe2533642a04a604428fddba1ecdae6f925e0a28f8e16ce44cfd7c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_extra_default_test_typeddict_extra_default.assert_exc_info_value_err": {"doc_hash": "2cb43d6335cacc32df6f30a1bfb2b99fa9cf3ee6622a651c805295bd72cd1747"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_from___future___import_an_from_pydantic_import_Byte": {"doc_hash": "152c396caafebb440f88193e6e1b9fc312160dfe34fcd33b079b64217eb38734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_Row_Row.input_source_str.if_self_python_input_.else_.return._": {"doc_hash": "cd5c1d317dffaae32e6c26eb000644a9d0f483b5ccb45d1feb2f8a57ca64edf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_ConversionTable_": {"doc_hash": "9c63994bb92b36c895743bc863eb72f0f2e5943f0cd5c9a698635c3be15313c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_ast_find_heading.raise_ValueError_f_headin": {"doc_hash": "2612c84fb8176a817e50e95da861401887177b0a0f0addb7dc00860a4f7c8683"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_insert_at_top_insert_at_top.return.f_abstract_Usage_Doc": {"doc_hash": "5d4a30a7bb10f2c197978b2364e4220d7cb310ea09b8db73922e48a54fdbd417"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_replace_links_replace_links.return.f_abstract_Usage_Doc": {"doc_hash": "5ed7d6a496eb8190242d554aedb34d6c7e713a14cd4df1e6c51827745f353870"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_update_docstring_": {"doc_hash": "7a1bb0eb171cc5f4d4d0eda27455ee63e2d725626f11e1d056b9d1fe4f616f2a"}, "/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_render_why_markd.else_.return.markdown": {"doc_hash": "83fa87c26e614b16cc4387aa1a14d25db30f561da0849e82edd957ded6e6f2c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_changelog_add_changelog.if_not_new_file_is_file_.new_file_write_text_histo": {"doc_hash": "27bc42d3fca972f6b526801f7e27ce00243abbcd4c10a0b142c3e60258350358"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_mkdocs_run_deps_MAX_MINOR_VERSION.11": {"doc_hash": "094c183714187bd9d01b4e60148459fcd587a1e80814f60f87dc3abc8e9d4c17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_get_orgs_data_tile_template._": {"doc_hash": "e76c8a41cf532450a8b088cbaef010b8790f57f657a910506516f6c9cc0df66e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_render_index_render_index.return.re_sub_r_organisation": {"doc_hash": "bc21df5ce746a49901d90a2efe52ef2226018fc27bc587f3c1fcde077b17a3a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_render_why__generate_table_heading.return._generate_table_row_col_n": {"doc_hash": "7545796f4ef2531334d615a419edd4c501077959c7fd28f3659e25372261980a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/using_update.py_from_pathlib_import_Path_update_lib.lib_stars_stars": {"doc_hash": "f9b7a55c8d9bfcfef42709b666653f17664fa92ee643f74a5d042e544f72c1d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/using_update.py_with_THIS_DIR_using_t_": {"doc_hash": "81dd40630b76d0c4698942f2847c0706c0ba00d48c7e5e052653fed096ac9b7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py_typing___version__.VERSION": {"doc_hash": "4d3a96b4e6fc0f5db860203f1e09fc6d6629996d01dc595d429eef0fece20af3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py___all_____all__._": {"doc_hash": "97bbda833770c71cd16f7618120344168b7e46f645ffcde7410b7b89b0bbcfbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py__A_mapping_of_member_n_": {"doc_hash": "22618e4029eb1ae850d52ee44cf53e49a9dbc58b5f5a03e4aa20414c3b197461"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_from___future___import_an_DEPRECATION_MESSAGE._Support_for_class_based_": {"doc_hash": "e953668c1290680e48851d6436bdde5834a50daec517ac20dad475e32d3e1657"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapper_ConfigWrapper.__init__.if_check_.else_.self.config_dict.cast_ConfigDict_config_": {"doc_hash": "c53646b7d492bac717988423be9f1d5a586003766177ef5724c227ace0850c2c"}, "/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._TODO_Consider_moving_t": {"doc_hash": "4d389ded3ce8196f60e981378ecb1c37868b28ca060c1a17a3c3ae8f44ed4f7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler_CoreMetadataHandler.metadata.return.metadata": {"doc_hash": "b95cd050ed0e5a50139a332b9d161ca0c32858faa398d31a0373fc4f89745739"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_get_ref_collect_definitions.return.defs": {"doc_hash": "9210ffc587b91354e866dcfa1e826afd7b7151c49d8ea0b946eaabee6c21b1f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_define_expected_missing_refs_define_expected_missing_refs.return.None": {"doc_hash": "c23a8058145dcc629b6068b2b20b5cb188a1420ae800aca8b6a9cfa2b871ef3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__TODO_Should_we_move__W__WalkCoreSchema._handle_other_schemas.return.schema": {"doc_hash": "12c0a59a45beba3765d717a940fe78ce68f13cd855bc1de7170bc22892c972c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema._handle_ser_schemas__WalkCoreSchema._handle_ser_schemas.return.ser_schema": {"doc_hash": "38e753e30e5a0e437f9abde5b8a06dfa64b9e0726bede3469d7d11a290a81e3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_model_fields_schema__WalkCoreSchema.handle_model_fields_schema.return.schema": {"doc_hash": "2b734e7ff36bc880b58da9badad24ea060eca0124f37e4e28108628420c727a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references_simplify_schema_references.collect_refs.if_s_type_definiti.else_.if_ref_is_not_None_.else_.return.recurse_s_collect_refs_": {"doc_hash": "a4c977d569c86dfb48c55ec9a8d189b3a5dad05f5ccd6c59539946c256aff1a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.schema_simplify_schema_references.count_refs.return.s": {"doc_hash": "2f66b75674189d6d67075565f56a3e27aeaa8315504cf6de8a7e89e045e070e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.schema_5_simplify_schema_references.can_be_inlined.return.True": {"doc_hash": "30460c669b5bd157e4cb4a4d993afa2a4f0bb53d234ac88fb90588d3dac05aaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.inline_refs_simplify_schema_references.return.schema": {"doc_hash": "f3e6b1161599e964874dc7d8cb53fea6cb3710310c1c0e0947ee4fad957b51d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__strip_metadata__strip_metadata.return.walk_core_schema_schema_": {"doc_hash": "3fc999cc2d5369dfb2ae1415ce8c0460f70d00d4da69fb262973f0e6a210dc0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_pretty_print_core_schema_": {"doc_hash": "267ce4ddb684b372c67daf70772412fe1d23260d42a434d2869efbd977cbf03f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py__Private_logic_for_crea_if_typing_TYPE_CHECKING_.else_.DeprecationWarning.PydanticDeprecatedSince20": {"doc_hash": "8c7ed1015b76d0e9eac2e08851f5f8b75b3230b0af495eca050fd04cc9237727"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_Decorator.build_Decorator.bind_to_cls.return.self_build_": {"doc_hash": "356e1d3ec25d0d1d2dfcb03bb37c746cdb6d544a99c792b37b4080bb2020b432"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_bases_mro.return._tp_mro_for_bases_bas": {"doc_hash": "ba73621495e5b3ebd6daf436e921ede4710a167bd48e7635acad85ff3102131c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_mro_for_bases__sentinel.object_": {"doc_hash": "eee6c05e602e8e37abe22ea06ed8e765a68e7071a91fb6174e6fc59b92d2d768"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_attribute_from_bases_get_attribute_from_bases.if_isinstance_tp_tuple_.else_.try_.except_AttributeError_.return.get_attribute_from_bases_": {"doc_hash": "6d8e847bedcfe002a93bfb5ea8030a0a2636733b3b256fc6ba57541cc2e31ea0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_attribute_from_base_dicts_get_attribute_from_base_dicts._raise_the_error": {"doc_hash": "84f55a6ead13ef24eb26a510c632ccc881f7262df377ed8194182ccc5a40d97a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_field_serializer_inspect_field_serializer.if_info_arg_and_computed_.else_.return.is_field_serializer_info": {"doc_hash": "394b6d68fc230a716ab209a6d0f623639b26dba69a5dd22f4a552ca451592925"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_apply_discriminator_apply_discriminator.return._ApplyInferredDiscriminat": {"doc_hash": "7af4f1cee605fddf1a98fdc76b10ec0698f0e57a4ad8da1ea84a5f47fc4eeb3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__Private_logic_related__if_TYPE_CHECKING_.DecoratorInfos": {"doc_hash": "f5757c9ba5b146d9a978234313a03e29efa8e8a66bae94fc99f4353b031be25d"}, "/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": "628d8311db0b6a9370da32a0d52a2b11ae0e6e1631c997b0b71d5ab8cf7a0e43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_forward_ref.py_from___future___import_an_": {"doc_hash": "5f2793aa9346f0db52343b08f0d538e2560db28a306e5c2d39bbaf96e97fdb4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_modify_model_json_schema_JsonEncoders.Dict_Type_Any_JsonEncod": {"doc_hash": "f3182fa9bc9d252bffe9489a3147dd93af8eda64a907e6182b371d8859a5a7c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__add_custom_serialization_from_json_encoders__add_custom_serialization_from_json_encoders.return.schema": {"doc_hash": "ee96d81a55e3e1134605c2605b7b92b0f0d5c887850ac7ee1edc2f11ec4b33e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema_GenerateSchema.__init__.self.defs._Definitions_": {"doc_hash": "485638626d34b2c8b4d764a22fc4d0363dff7dea1c1905c792b97dbd441b7ffa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.__from_parent_GenerateSchema.__from_parent.return.obj": {"doc_hash": "00ff605e33a882e8020691a777cdfe6c664e1c63549a90bdd42ccfd24d632a87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._arbitrary_type_schema_GenerateSchema._arbitrary_type_schema.return.core_schema_is_instance_s": {"doc_hash": "44fbb50251575df0d82c96d41b6b6ca3afb415a2b1c2e2405cf08d3cda60f336"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._unknown_type_schema_GenerateSchema._unknown_type_schema.raise_PydanticSchemaGener": {"doc_hash": "386860488481f0f50758ff7a683b2089ef34950f37f745325d45a09852e0643c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._add_js_function_GenerateSchema._add_js_function.if_js_function_not_in_pyd.pydantic_js_functions_app": {"doc_hash": "40fb318a8370be1cdd991b911c336ac2d3b61dd2dc229391b2aeca2353831e13"}, "/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": "da295469e4106e24213de6b368e613284c30baa5b0a3dbde511d7ffd7dbd9858"}, "/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.with_self_defs_get_schema.with_self__config_wrapper.return.core_schema_definition_re": {"doc_hash": "c7d88566cfdabe4a7ce0766f0f0b6f68d54c366e088a6260c9087d8a1928b6b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._unpack_refs_defs_GenerateSchema._generate_schema_from_property.return.schema": {"doc_hash": "50f2f356b9c14cb3679460e0e83cf12d26a9a7573017e3847fb7e7636f7b0683"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._resolve_forward_ref_GenerateSchema._resolve_forward_ref.return.obj": {"doc_hash": "160a8ce92f6d56211da0411414768b554ecffd5b369ced0f2ec7a9ec42a0a311"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_inner_GenerateSchema._generate_schema_inner.return.self_match_type_obj_": {"doc_hash": "e88d72ccf2a228568b93c292a9c19c2e3788bc2fbcbd383be8536983ccc1b932"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.match_type_GenerateSchema.match_type.return.self__unknown_type_schema": {"doc_hash": "c9156442c1ba510c43512f4a3c164447efe38e51124834ec253e29c171e7c3c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._match_generic_type_GenerateSchema._match_generic_type.return.self__unknown_type_schema": {"doc_hash": "f42d12566ef548cfd7b76fd42849c473cfa5facf0253cfced8d2ab8d373ce10d"}, "/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.FieldInfo": {"doc_hash": "9aa488ece609a86a8816f6c1bb6fa3482ccb144bb935b0e9f5daf8a0ecbe57d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._typed_dict_schema.with_self_defs_get_schema_GenerateSchema._typed_dict_schema.with_self_defs_get_schema.with_self__config_wrapper.return.core_schema_definition_re": {"doc_hash": "4dfd972ff8de918cbe1576a4c237c7f7ba2b01b636929ba058157a556a5fe147"}, "/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.with_self_defs_get_schema.return.core_schema_call_schema_a": {"doc_hash": "812fdba07dace0e8739e4ee18a60724b6d4370e24af8895cac4f4686638394a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._type_schema_GenerateSchema._union_is_subclass_schema.return.core_schema_union_schema_": {"doc_hash": "30d9e6c50620d44b3e714200fee0fc6dd6a35d488fdae30dcbcb4a28f684603e"}, "/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": "3eeb5d584aa69ef0c577ccb8398c02bf496421d67d140d427f5e8a60886296e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._unsubstituted_typevar_schema_GenerateSchema._unsubstituted_typevar_schema.if_default_is_not_None_.else_.return.core_schema_any_schema_": {"doc_hash": "e54650deaf43d893b7815307daa5914e75324843c25f16ff8cc3d90bcf3b7246"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._annotated_schema_GenerateSchema._annotated_schema.return.schema": {"doc_hash": "368ad87199c1df24d596bc2d09d148c7a7b25df6ee0b535114ab5c8c43d163eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._get_prepare_pydantic_annotations_for_known_type_GenerateSchema._get_prepare_pydantic_annotations_for_known_type.return.None": {"doc_hash": "141a5f571599fc5b7db46f415449e270a9f566a127a2b4c64ebfbbfdc16d1094"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_annotations_GenerateSchema._apply_annotations.pydantic_js_annotation_functions._": {"doc_hash": "0c6611be488b40d8dbd7c6ba7a45c1d1abe60dfeb8068f2419d006e33db22455"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_annotations.get_inner_schema_GenerateSchema._apply_annotations.return._add_custom_serialization": {"doc_hash": "af328df0535e0b4ed21c81d0d90f9b058e8b006ce4f38b143869a40c1a76aa4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_single_annotation_GenerateSchema._apply_single_annotation.return.original_schema": {"doc_hash": "de6e3a57274be3db85932108bcd854e5a2dd89ab0a8c1faaafa9c28113610775"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_single_annotation_json_schema_GenerateSchema._apply_single_annotation_json_schema.return.schema": {"doc_hash": "67479c8635ff845782e5731463f266318eae85a2eac9bc87f33090562ce309e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_wrap_default_wrap_default.if_field_info_default_fac.else_.return.schema": {"doc_hash": "b09f8140353432be8690665addaf3d0ad6bc35232c6a6f23765da295636f031e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__Definitions__Definitions.get_schema_or_ref.if_ref_in_self_seen_or_re.else_.try_.finally_.self_seen_discard_ref_": {"doc_hash": "c5643dd4cdd38fefd2d143b8158cd9369a4c2ca359da9a694d3c038e841dc3b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_has_instance_in_type_has_instance_in_type.return.False": {"doc_hash": "04a6f8fdf3becd02b1bc77c9a46b433c868a9e01a6fca086332280afba9a1fbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_internal_dataclass.py__": {"doc_hash": "e9db7b721e354f1c777c1ad203edbfce9340c72d501da8d00d4afb0df31c1c94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_from___future___import_an_for_constraint_in_INT_CON.CONSTRAINTS_TO_ALLOWED_SC": {"doc_hash": "1b5d8d8d1f67af4b4fc95bd0acc784b8697ae15dcafca876adb0ef1f51440b24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_for_constraint_in_DATE_TI_for_constraint_in_LAX_OR_.CONSTRAINTS_TO_ALLOWED_SC": {"doc_hash": "79f410e831447ac54145ec9553c8ca7e6772eea01e0aa7bea10fd0701090a132"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_add_js_update_schema_as_jsonable_value.return.v": {"doc_hash": "b3ac68b95c18ea7ff7491ffea5cef88de27fe694219cf159f84c379f4713a809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata_apply_known_metadata.schema_type.schema_type_": {"doc_hash": "778900a97db3ffb78a6e6dbb911fe907326841251a1ab33740e587c24ff83587"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata.for_constraint_value_in__apply_known_metadata.for_constraint_value_in_.if_constraint_allow_i.else_.raise_RuntimeError_f_Unab": {"doc_hash": "1dff10564096c30c3e387029fea46576baa190f8c7c48103963739bb4e55c8ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata.for_annotation_in_other_m_apply_known_metadata.return.schema": {"doc_hash": "a8698f8e10944b5800500101524c06467fb5935dadf87542b1fd67bd393db1ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_mock_val_ser.py_from___future___import_an_MockValSer.rebuild.return.None": {"doc_hash": "cb491b171a3928e19221fbf7995f05a7a1dd329547a8ba37fa43746e5c503864"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_mock_val_ser.py_set_model_mocks_set_model_mocks.cls.__pydantic_serializer__.MockValSer_type_igno": {"doc_hash": "5ceb38e314196e6263f689d33fde2780ddf10730561a67a37fd0683d7f397ef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_mock_val_ser.py_set_dataclass_mocks_": {"doc_hash": "ee648994e2b7a00f934337f42a17f78907a569e48d9af8063b9de8d008f2a773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass.if_not_typing_TYPE_CHECKI_ModelMetaclass.__instancecheck__.return.hasattr_instance___pyda": {"doc_hash": "f7beae6ef5211a36dc2b674ad54f4e37c065d13236e9f0c16d9f1d0a4a53d9f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_init_private_attributes_init_private_attributes.if_getattr_self___pydan.object_setattr_self___p": {"doc_hash": "ab44f558a5e25d1c195d2f78ee4b8031af056cdc0bd0238db353fbbc43903815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_get_model_post_init_get_model_post_init.if_model_post_init_is_not.return.model_post_init": {"doc_hash": "a9050994e8b01d27e616b7e98bdb7632f516f9373e00cd9bf355e48795e1d7a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_set_model_fields_set_model_fields.for_k_in_class_vars_.if_value_is_not_None_and_.setattr_cls_k_value_def": {"doc_hash": "076a06828b7c3c8fd5d36439db1ce94fe778f183ead63e1f238e7f3604101642"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_build_lenient_weakvaluedict_build_lenient_weakvaluedict.return.result": {"doc_hash": "421dd7dba62891123ebc7c891e88d3575580376e8ba15482c416f2a51884de9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_unpack_lenient_weakvaluedict_": {"doc_hash": "08c2fdea507414bdeedcc5edebe6a479168ac209060d7f1ccda42b53420e0852"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_CallbackGetCoreSchemaHandler_CallbackGetCoreSchemaHandler.field_name.return.self__generate_schema_fie": {"doc_hash": "88fd916950ffd7a4c62dde35fddec5992968c1af1795417b17cfcb005042c10c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_decimal_prepare_pydantic_annotations_decimal_prepare_pydantic_annotations.return.source_InnerSchemaValid": {"doc_hash": "a837d5a4bc635ca1aa4836ba6891ffbf5b5f5f3ad11cae983aa6a8709fc09751"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_datetime_prepare_pydantic_annotations_uuid_prepare_pydantic_annotations.return._source_type_InnerSchem": {"doc_hash": "d1829a86f9c6fe031cbf15f94f1bf43ec4853ab05573f510cb6c5da23c8bbe34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__Bucket_of_reusable_int_KeyType.TypeVar_KeyType_": {"doc_hash": "61dd9931b8d6033ffe0123daa12168291284b1c0ab60553867458a53de9818bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_deep_update_T.TypeVar_T_": {"doc_hash": "6ee7301361cfb8d8ec07978ad8c7d4308058e3bc3762ca28690f0794aa8aa1ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py__Validator_functions_fo_from_pydantic_core__pydan": {"doc_hash": "0c97c061c044643f72aae2118415576c980d79ed9ff95d8be6e1bcb4adf28c57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_sequence_validator_import_string.if_isinstance_value_str_.else_.return.value": {"doc_hash": "7a00a9b1938c40207fccb09966ffe2e03ec67d3ccf04c9b9f9e26320a1e183ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_migration.py_sys_REDIRECT_TO_V1._": {"doc_hash": "f2cc5e698f2dc8fec0fe6a2e8adb4ff0ab64d7e182ae744fc8e668fef5a163da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py__Type_annotations_to_us___all__._GetJsonSchemaHandler_": {"doc_hash": "660262d41e5c027ccb8e8ccc7be742e1c0dcbaac8205b21f51c282d60bd3e8df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetJsonSchemaHandler_GetJsonSchemaHandler.__call__.raise_NotImplementedError": {"doc_hash": "68f26ebca3811a07e1b4d9d7671196b2e4df4b5cb3421b7297979d31c361dcc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetJsonSchemaHandler.resolve_ref_schema_GetJsonSchemaHandler.resolve_ref_schema.raise_NotImplementedError": {"doc_hash": "1aa18015eef0ffa1e34b33494cbddf1b14958aae9003294b87c902470fa6d924"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler_GetCoreSchemaHandler.__call__.raise_NotImplementedError": {"doc_hash": "b663fc0bf232e9acca3c0e4fdf3b66a94f7ccec870824ec85bf0b649483d19c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler.generate_schema_GetCoreSchemaHandler.generate_schema.raise_NotImplementedError": {"doc_hash": "3bdb7811c98e4b57347d3590b0f00d420079507c19249627e29170aaeb81ffc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler.resolve_ref_schema_": {"doc_hash": "c4a63d3eaff37979d852058c0a52db3f59cb3976788aee886ea8d3be3d89273e"}, "/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_math_isclose_alpha_1_.else_.raise_PydanticCustomError": {"doc_hash": "3b57d1ca23e7225bf5961f284b1b94314f672132b919140c36fbedd8bd22001f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__Configuration_for_Pyda_ExtraValues.Literal_allow_ignore_": {"doc_hash": "e0a2cea3d50ddedb7bdb276baed5cac50301e9cd3b0dcf3fbebb9ec760f2b058"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict_ConfigDict.populate_by_name": {"doc_hash": "58d10041831d9557bc61f6fcc383eabff6008ec7d7220884099852b375d28323"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_9_ConfigDict.validate_assignment": {"doc_hash": "cee98cc1cde276493e43fa5f75e5792b6a609d57ef339d8a5649ce508753c7c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_11_ConfigDict.arbitrary_types_allowed": {"doc_hash": "05b5b3c72aae5164354aaa2a1694583ac1d9eb92a007d7ba93f9a77797ac38df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_12_ConfigDict.alias_generator": {"doc_hash": "8ff16804d8b1c103022bf2ec6369b4662829be3d97163c04e68a89bd94c6c827"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_23_ConfigDict.None_23": {"doc_hash": "3ba98ff43509583c212278807661a022bf5a651a71c28e762d28ecb43d6446fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py___getattr___if_3_8_sys_version_.dataclasses.InitVar.__call__._call_initvar": {"doc_hash": "295f26fc076f9a854bde89ec1eb04cb9d7436db7863ae4e3aad5ceead74fd04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py__Old_validator_and__if_TYPE_CHECKING_.else_.DeprecationWarning.PydanticDeprecatedSince20": {"doc_hash": "a0519216b6bc0b704e479a06ba8d0f64af0f687d8ca3581961fcaff9c496f677"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/config.py_BaseConfig_BaseConfig.__init_subclass__.return.super___init_subclass__": {"doc_hash": "8061e7246442da6321d8f83282b41159e7e51b5c050a82f9c6f2512dfd3b7cec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/config.py__ExtraMeta_": {"doc_hash": "a337f11a7abaae34b215ac45fb8a37a3be4d4c4a2c3cdbe4210dccc833b0153d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_from___future___import_an_Protocol.pickle._pickle_": {"doc_hash": "fe1065b8d30f239ce6013160958d5ac872d3908271760eea3a4cd35a308e68cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/parse.py_load_str_bytes_load_str_bytes.if_proto_Protocol_json.else_.raise_TypeError_f_Unknown": {"doc_hash": "b93d90380ce56be47c2e872da7bf7d86b957fecca7ebc4c12b6692248c4bda78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_from___future___import_an_T.TypeVar_T_": {"doc_hash": "496de84a39fc596dc1129d0dbc26ada9d1bc08012888d2f5c9afa628edfa9018"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_parse_obj_as_parse_obj_as.return.TypeAdapter_type__valida": {"doc_hash": "404abaca18b2f8950b5198391b3b951871b68db3c7b9d566dde16f790f141bc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.merge_field_infos_FieldInfo.merge_field_infos.return.field_info": {"doc_hash": "75444b2fbf066ce516405e3571497a9dcd0ac51d87f35b940253dbd9a0f7a6ec"}, "/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_default_default_de": {"doc_hash": "084f4b9a9d57872cac93355e5847c6374a7329b8174606d2131ed5640321c692"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._extract_metadata_FieldInfo._extract_metadata.return.annotation_": {"doc_hash": "f7af026c2906ae535e880282790b0a71dc59d69126b64b386004b76fe7c265d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__EmptyKwargs__DefaultValues.dict_": {"doc_hash": "67c786da49bfbad13127735b39d950509ab7c63b7f2f407daf33be59abc00a3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field_Field._Usage_docs_https_do": {"doc_hash": "341fc3f86e755d7a50748d9507b357a2936bc1e1e838df4bf120c37e4923b176"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field.return__FIELD_ARG_NAMES_remove_": {"doc_hash": "c88e9a24c68f67bcc8e5124fbefb7b8858f80fc84dfb00a2dcdeaa1bfe1d86c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__do_not_include_the_vark_ModelPrivateAttr.__set_name__.if_callable_set_name_.set_name_cls_name_": {"doc_hash": "ef653d02b14493dd2599fcce29a80ee754f227ea9ccb3f76b3f05a5dedfdc8a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_5.dec_": {"doc_hash": "3d6e2ad0bbef7774252d3439b07c798d925258c88a11e7dbfee874084de940a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py__This_module_contains_r_GetCoreSchemaHandler": {"doc_hash": "ed3902912efa22a4bf125e171d5a389cd090770a4db5da8274e86f404fc33993"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_PlainSerializer_PlainSerializer.when_used._always_": {"doc_hash": "0d45a3302eb30eb0fa4174dea552a743bd03056d663a134a4117f99e101aca3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_field_serializer_3_field_serializer_3.return.dec": {"doc_hash": "dfe7eb427b98ce42990379b51d7bddeb2e0a1f5e708286507d8dbce4897eb176"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AfterValidator_AfterValidator.func": {"doc_hash": "31fd0e61a970048910213749797032d228ac04d64b496c07aa858bbd08d8a5e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AfterValidator.__get_pydantic_core_schema___AfterValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_after": {"doc_hash": "87145beeeaaee8c27284d83b5929c9733501770de233331cfa47da5300a67afa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_BeforeValidator_BeforeValidator.func": {"doc_hash": "f7ff963cf71f90145ded102375d2fe3ff4892beedf2a5a31c716ad529e5c1f75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_BeforeValidator.__get_pydantic_core_schema___BeforeValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_befor": {"doc_hash": "293283617632deecf83fb30bcdd4d467720ed8bbd348d44ce0374e382fc16e09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_PlainValidator_PlainValidator.func": {"doc_hash": "beea1d0121f412cc39e850fb7b04c6a9a1fcfa2252e66f7104702de39131d68a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_PlainValidator.__get_pydantic_core_schema___PlainValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_plain": {"doc_hash": "4f468e9e10f3cac16ad9e45620bcfd89a72501585656f7bedf17a063af5d184c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_WrapValidator_WrapValidator.func": {"doc_hash": "185826ecf7bbbbc8f290e4546ebe6f368d7af75f0e52e70c4ac8495ca5a4cd5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_WrapValidator.__get_pydantic_core_schema___WrapValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_wrap_": {"doc_hash": "7a07cac448bf5e011daf09ec70c60326eac2f2c039411b9f7b4dc475c48ceeef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AnyType_None_2.else_.InstanceOf.__hash__.object___hash__": {"doc_hash": "036847eda6fc58805b367a3fcdb01e7f7ce723e1adc8afd3df8dbd84adf6ca38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel_BaseModel._Usage_docs_https_do": {"doc_hash": "3f0cf2cb3fc4ed6d5eccb83428977298c8b48b510919fa3a2cb03a7b51916b14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.if_typing_TYPE_CHECKING__BaseModel.__pydantic_root_model__.False": {"doc_hash": "cd9f381dca9f9bac031bed712ffc368df6dc9e591975f02c2fe5919d653c0c1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__init___BaseModel.model_fields_set.return.self___pydantic_fields_se": {"doc_hash": "e4e8d9df55723a68e41bccc114f3037d9328664ff42ec6371485ea4ab2bd4f8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_validate_strings_BaseModel.model_validate_strings.return.cls___pydantic_validator_": {"doc_hash": "30ec70432450075ff719f728986e1e33acff7b2d55f68812916dcc32b9fab2d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._check_frozen_BaseModel._check_frozen.raise_pydantic_core_Valid": {"doc_hash": "c368ba985cba49f8d27e22c95e641914680a64f5af9f8f8399fd3ea47be297b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.from_orm_BaseModel.from_orm.return.cls_model_validate_obj_": {"doc_hash": "5a9966983c658e1ee6bbe2232d6ef18fd624fff1594e9806a877f7c03003298a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.construct_BaseModel.construct.return.cls_model_construct__fiel": {"doc_hash": "9a74386f519c1ac430da1fb24452949aa642177f9a234d8a608b933d8c4cfb01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.copy_BaseModel.copy.return.copy_internals__copy_and_": {"doc_hash": "bdd7582f3fde52cb269574c8cd28241a53fc8727773adf5808e9236513863cec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._get_value_BaseModel._get_value.return.copy_internals__get_value": {"doc_hash": "39f79b113c30724f86edc55730e04c091ccdc6ba7a77f9a1b16c14dd5b3ed57d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._calculate_keys_BaseModel._calculate_keys.return.copy_internals__calculate": {"doc_hash": "0d9b04e94aa8939cdb00ffac3e341d52295f57eeeee7cc9f46cfb5004a12d65d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_create_model._": {"doc_hash": "3f40efbce3b5369be71ea9d4b1de6bf480cd6399fcd778d9597f0c8be18ee95b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_1_create_model_1._": {"doc_hash": "86601de41f162aafbb1f3721121bb2581f2296a9f53639defdfdf6da79d67e6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py__This_module_includes_c___version__.2": {"doc_hash": "d14fcde61e86cb1e3e51b19b6e0ec556fe2c8ef5a2446ae01f73102916535877"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_plugin_PydanticPlugin.get_base_class_hook.return.None": {"doc_hash": "299cf003bdcbf24a1a82b275b4c0dd08802216f1689aaa70742e929d679f0945"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin.get_metaclass_hook_PydanticPlugin._pydantic_model_class_maker_callback.return.transformer_transform_": {"doc_hash": "5f12bd090924666b8a2f5c367b0e9775e9d6ec73591a1841f2008f91efce5205"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.expand_type_PydanticModelField.expand_type.return.self_type": {"doc_hash": "aab9707186b1edcc48e2596d975a54bb91caa0f245fa190fd92c403a6ba86ed3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.transform_PydanticModelTransformer.transform.return.True": {"doc_hash": "e239123b0eda5fd905728f915034bfc76464dab7a938b9304c4273c5ce145e04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.adjust_decorator_signatures_PydanticModelTransformer.adjust_decorator_signatures.for_name_sym_in_self__cl.if_isinstance_sym_node_D.if_.sym.node.func.is_class.True": {"doc_hash": "76f5b98f391e32238dc98221f8cbff6c166525b7981d8a9117a3623fd59db29d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer._get_assignment_statements_from_if_statement_PydanticModelTransformer._get_assignment_statements_from_block.for_stmt_in_block_body_.if_isinstance_stmt_Assig.elif_isinstance_stmt_IfS.yield_from_self__get_assi": {"doc_hash": "56dad638305fa63d5795c2b67031ab583381d711eb53c0b37fdf54e3cd5caad7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer._infer_dataclass_attr_init_type_PydanticModelTransformer._infer_dataclass_attr_init_type.return.default": {"doc_hash": "fbb74d973e19bd40f524cf3a7f984c8142d752b52bb1b092594e7ecbf544ae8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.add_method_self__api_sel": {"doc_hash": "aa18a7173175f1e1afe00b8a402923f3f03bbd52395d7268ea9000cfdaaee14c"}, "/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_var_name_Sy": {"doc_hash": "cb352bdbae2aec1fac1bfb6fad7145de5cd7891f9eacb166ec37436178a9184d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_has_default_PydanticModelTransformer.get_has_default.return.not_isinstance_expr_Elli": {"doc_hash": "4169dc314c9d89673f42c848dd8b8e676f7618b621e262e35872b00bf63c695f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_AnyUrl_None_4": {"doc_hash": "7130ca60f723ac4adf54eb16da9b6d2fd079d8e81ba6c690b986a5772143c90d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_PostgresDsn_None_10": {"doc_hash": "5a7cfdab895d36143dee75753474abc757c8e546f7f088baac2c82fbe313216a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NameEmail_NameEmail.__get_pydantic_json_schema__.return.field_schema": {"doc_hash": "dac484cc13675f9e4b0aac5fbd146194cb1c075eb4445aa94e43f80e74fc233a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NameEmail.__get_pydantic_core_schema___NameEmail.__str__.return.f_self_name_self_emai": {"doc_hash": "175b65e4c7d6df46dd6b42a95c8e4d34d17bba26043db463f5fa218db2dd1fbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py__build_pretty_email_regex_MAX_EMAIL_LENGTH.2048": {"doc_hash": "742000a1a5bbbdba734015803d9035e6b02f3008a0ee2eb5d519f2a8c25697fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py__Maximum_length_for_an__": {"doc_hash": "5405444e88af960dd446c9c0a8abb83a02904f0e60147881f1015c2fe4378693"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py__Usage_docs_https_do_SchemaKind.Literal_BaseModel_Typ": {"doc_hash": "1a823a8d3b8fa5f85da57707921ae18106bdcdc4cc6809a041c31ee3613a1167"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_PydanticPluginProtocol_PydanticPluginProtocol.new_schema_validator.raise_NotImplementedError": {"doc_hash": "6bfcff7b0e97b463ad5d1b9b5f02821b138ddec6dfc2efec7d4419136e5dd70c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_BaseValidateHandlerProtocol_BaseValidateHandlerProtocol.on_exception.return": {"doc_hash": "81e74ce027e8139c56f6458bf02768d9594e7ca5024f83e0cb2ca5693ab1beb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_ValidatePythonHandlerProtocol_ValidatePythonHandlerProtocol.on_enter.pass": {"doc_hash": "436f369416810d3f65302eeda977a6784b1443ddb626dac8bf79ce3701b1beaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_ValidateJsonHandlerProtocol_ValidateJsonHandlerProtocol.on_enter.pass": {"doc_hash": "a10ed27b3f8ce0e0437842f899bff4ad377ccd22814393f383c48f3835aae53f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_StringInput_": {"doc_hash": "7da9b48f265e2718e3aed076b0d87074e09d3f89cd6bc514a9179b20dedfe457"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_loader.py_from___future___import_an__loading_plugins.False": {"doc_hash": "26accacd06481fd63423020e003d805878d111452a75914b1b9e3e07e7c57337"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_loader.py_get_plugins_": {"doc_hash": "913958f26c9fa1fec23781d6a53d01668969d8f604e6045426823ecde559bb8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py__Pluggable_schema_valid_events.list_Event___args___": {"doc_hash": "f59cba6ca7ea1db7b48192b3d45192b79b787fbd4fc341abaf0630e0f637df32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py__type_ignore_create_schema_validator.if_plugins_.else_.return.SchemaValidator_schema_c": {"doc_hash": "97f2a01e7e1e92e953864cd24dd0fc7cab752d0cce6a347b6d3a468757c14dd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_PluggableSchemaValidator_PluggableSchemaValidator.__getattr__.return.getattr_self__schema_vali": {"doc_hash": "61ad9e526c462648ae2930f2e0a01c7494d221e434fdfc044d0cf5a80bab6833"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_build_wrapper_build_wrapper.if_not_event_handlers_.else_.return.wrapper": {"doc_hash": "66f481049df980ba02d79495e560937d449ed0d81ced0342a74a73d515f6c14e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_filter_handlers_": {"doc_hash": "4a4c326f665755501aec0c1f1849cbaffb75bae55bb22b45b4f42a27791c8904"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py__RootModel_class_and_ty_RootModelRootType.typing_TypeVar_RootModel": {"doc_hash": "981a973afa0c91d0cfba1b608937e6b78931c8fced73c145b1a3dbfcfbf5aa90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.model_construct_RootModel.model_construct.return.super_model_construct_r": {"doc_hash": "e9837116d7030d54584b1153ef84ef2e0b967a4d52b24807adb659e37f0f0779"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.__getstate___RootModel.__copy__.return.m": {"doc_hash": "b7e09103c096cb5089a552d7de41424f53824a50c4c1375bcba507ea2b993f39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.__deepcopy___RootModel.__deepcopy__.return.m": {"doc_hash": "03f70076980c7f588024885170c9897d2bd55fee4157fd4a19d9661ac572a86c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.if_typing_TYPE_CHECKING__": {"doc_hash": "5747529e45fc16da8420fe011b19b506abad557e7a5a96db9fe0c7e28ad09ec5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__get_schema__get_schema.return.schema": {"doc_hash": "4d4d55a1ee80b8b4bea240cd167eea1b2cc8d23687d8be526a289f988115e726"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.validate_strings_TypeAdapter.validate_strings.return.self_validator_validate_s": {"doc_hash": "1b4f7a4a44fd64270a38096c5ed589797ebf60f31f0cfaea76506f86fc433b0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__A_boolean_that_must_be_conint.return.Annotated_": {"doc_hash": "d6cf3126e6e30685f355f0750386c7880c16525924fe11fd6510b23e9c264e52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveInt_None_9": {"doc_hash": "4cb369a8b2505d03d73736e78e41f62cd6362aac17f606ddeb7a6a35697ff57c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_AllowInfNan_confloat.return.Annotated_": {"doc_hash": "306f2888b3a676769b22ef9eb32ff0347132dd378a9bb50792fc5bb8e5c28c4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveFloat__A_float_that_must_be_v": {"doc_hash": "be81117d8edfa0e68a974c771333dfd35a08a665e271d453b89ec4f795484014"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_FiniteFloat_conbytes.return.Annotated_": {"doc_hash": "80be2d1ae4d8f32174c4ea93491f725b313defb38fb69197e9cdd9bb3ce31f34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StrictBytes_StringConstraints.pattern.None": {"doc_hash": "a41333582332e774e8745a90cf1bc7ac9aa5ef507f0c6f90b8ee2293bff277a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StringConstraints.__iter___StringConstraints.__iter__.if_.yield__fields_pydantic_ge": {"doc_hash": "799d227e0eedd60bdf167273af23d2cccf55bec4a0a3874030dd526e65bd88be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_constr_constr.return.Annotated_": {"doc_hash": "6777167208d0e9467a73d0436af98e6683681bef295a04d0a9b0cc852903c6cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StrictStr_conset.return.Annotated_Set_item_type_": {"doc_hash": "b151bcf91d0fd40483a03ecde62f40a7d027a357af7946a4cffeb542ae5d6bfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_conlist_AnyType.TypeVar_AnyType_": {"doc_hash": "3b1be581d07677c2caf914caaa12e74b7e392dc0243fac9434308c384940b454"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_if_TYPE_CHECKING__if_TYPE_CHECKING_.else_.ImportString.__repr__.return._ImportString_": {"doc_hash": "939a3d2b4086550c2abd3729cf5b5eba87f7f2d7f189b85635b6f48e5ca8acc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_22_condecimal.return.Annotated_": {"doc_hash": "814ab3361fe7f90be7f123327d127fe579ac674dc9bce085a503840bb113ba9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_23_UuidVersion.__hash__.return.hash_type_self_uuid_versi": {"doc_hash": "6849255daee8145d4310c96fb4296061cdbb8d300f08a0394a7a0966eb3d8876"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_UUID1_UUID5.Annotated_UUID_UuidVersi": {"doc_hash": "0836a6cc162ca74c64ebd8c0be49a666ec3067814e6fb0dfc26d717304ab9852"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_27_PathType.__get_pydantic_core_schema__.return.core_schema_with_info_aft": {"doc_hash": "911fffdbef83f3cb07dff78dcabfb48d9e34d111f07bbff43f4415ed7706694b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_FilePath_None_32": {"doc_hash": "7978a408508920e9218a4e1120c72b28a3e24ec1e06b413e975ff6b0420ab7d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_1_None_33": {"doc_hash": "2aea5e071ef710cddb27f139f19c8d48b8e95669913ab5980d89516de8d3d754"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize._validate_ByteSize._validate.return.cls_int_float_scalar_u": {"doc_hash": "13c874966dd0c40b1032b68e939e19684403f44a615663f701a6d046b1e5511d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_36_None_2.else_.FutureDate.__repr__.return._FutureDate_": {"doc_hash": "432e70a72abf279924688d8102fd5436d414bafab9e605ef3a7349c564e72129"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_condate_condate.return.Annotated_": {"doc_hash": "8ffe2fa81c947a5aece6ad3f6566ac15518d14c6a2f86ffde79e416b3a72bf19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_37_None_3.else_.FutureDatetime.__repr__.return._FutureDatetime_": {"doc_hash": "93c30ce4ee36faca64f805a2915377fe41f3fa47bd0200afbe216f3f8331b100"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_38_EncoderProtocol.get_json_format._": {"doc_hash": "e15aa599aece913f948804fe0ac6750736dac5ea6af0ba0031e2f15f3d579fc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Base64UrlEncoder_Base64UrlEncoder.get_json_format.return._base64url_": {"doc_hash": "51e004665f3a842955d7e2f383041fed81745ae376dc8fb5f3ab662c2300d9f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_EncodedStr_EncodedStr.__hash__.return.hash_self_encoder_": {"doc_hash": "4fa20ce106f7385d7771f375e3005d8162bb330f81e0ca9cd3e95f9db99ddc91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Base64Bytes_None_42": {"doc_hash": "14c3abb766eff3a72595053c3f2ea0c636830a4ed2a36e8639cf9bde03022016"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py___getattr___GetPydanticSchema.__hash__.object___hash__": {"doc_hash": "c4b4cfe8e31a11a2d05caac6b31428c874af0a6c95a28c4942550a8876d794c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Tag_Tag.__get_pydantic_core_schema__.return.schema": {"doc_hash": "4bc6f14cafdc8f36d0fca78baddf9b47ee023ba78f342b41d14aa6863734a625"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource._read_env_files_EnvSettingsSource._read_env_files.return.dotenv_vars": {"doc_hash": "2a9bc273f09fddba309a6102171e1dc8771dd32e9518763cf04bf110f485726e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.field_is_complex_EnvSettingsSource.field_is_complex.return.True_allow_parse_failure": {"doc_hash": "e18032d2db8e00704e061eadeffd3c7e576e2949c746bebcbad218b67fccd6bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_replace_types_replace_types.if_isinstance_new_type_s.else_.return.new_type": {"doc_hash": "99654db4b43e85050c03683112861934df654be276bb3f78eaad102c78b33c4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyNetwork_MAX_EMAIL_LENGTH.2048": {"doc_hash": "cc1f9c91d2ab0061f57bc6c0afe018b8e847dffa712746f3cf7a6258a14fe4d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py__Maximum_length_for_an__": {"doc_hash": "8de37292a68b74cf5b19f066d028b6315d8d1b754f11a14a46449242fbf7ed2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py__Decorator_for_validati_validate_call_1._": {"doc_hash": "505a6596f44ea10c79557c50c47c1a9d2120a5639fd46e654e387540cd5f98f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py__The_version_module_h_version_short.return._join_VERSION_split_": {"doc_hash": "f17fc1f9243cd463dc24d7215b500bd670c6a5a06aeda5e954a9293d7052c404"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py_version_info_version_info.return._n_join_30_for": {"doc_hash": "36b4e0c8017fc5a9be1ad5e7513db116331f492546f7cb469151dce90321746a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py_parse_mypy_version_": {"doc_hash": "e4e0c8ad31b7d9b122af8459a1837d16f418cfce98b8435607be5fad297446da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py__Pydantic_specific_warn_PydanticDeprecationWarning.__init__.self.expected_removal.expected_removal_if_expec": {"doc_hash": "b8bd947e3b5af1ae2229cc5a8be6b3e80377aba5e882e7cb0fc7b80c0c6cdbc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/check_relnotes.py__Short_helper_script_to_": {"doc_hash": "cdecba4ff9d70e0c28461a69207b143ce8d53c0f1b98aa92764b51d028cde788"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/make_history.py_from___future___import_an_main.print_f_nSUCCESS_added_": {"doc_hash": "589e9d2aa3d5c0eb91961e337ca33c9ca7c7483d9201b0b38a584abc3713a93e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/make_history.py_get_notes_": {"doc_hash": "ed0bcebd1559a75042c9a7de26fb5d37ed060df3d02bd1130707034edf29cd9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/generate_north_star_data.py_from_datetime_import_date_website.return.one_of_blog_social_profi": {"doc_hash": "2921fc7ce88a64197ace965a6ccf10170dd684992c6f7e8d4d27fe4a26e07e3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/generate_north_star_data.py_person_": {"doc_hash": "b8faa54f0cec5998c6380104a79237d82333708bd1680f034f4b34abca9cdf21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py__https_github_com_pyd_OUTER_DATA_MODEL_COUNT.5": {"doc_hash": "4c7911fcdf4c2bbcdd3e553a46d740c10618f6ebe7f8167c908c5f2134eeb6c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_create_data_models_create_data_models.return._models_models_with_ne": {"doc_hash": "65c31ce1ace67242f37c00e69a7e2b62c4ca736a495b78530bb72ffe564a45da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_test_fastapi_startup_perf_test_fastapi_startup_perf.assert_len_data_models_": {"doc_hash": "a01b1ac230fa4c2b2d93dbbe0359458687955ba553d53da6eb0b7847f76d7cea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_test_fastapi_startup_perf.bench_test_fastapi_startup_perf.benchmark_bench_": {"doc_hash": "41b047c3e5fcf1c8d12c3f1baa005ef963b6c17f04243525cc749205f2df34b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_if___name_____main____": {"doc_hash": "cff46c9f32c31309ed997e2a99cf361b3b2efa05a45b394bc11d773d115b00f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_simple.py__https_github_com_pyd_test_fastapi_startup_perf.benchmark_run_": {"doc_hash": "6ccf8f8b736abfebb2aa969b724236b474a1ca039fe1ff60e8e5a7df81551eff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_simple.py_if___name_____main____": {"doc_hash": "e797593e65f8121629f3245ee0925f83220b33ca8dbf9dc4c61c895e9c32ec6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_north_star.py___pydantic_type_adapter.return.TypeAdapter_List_Person_": {"doc_hash": "313b74567fcad638ce72ce134e88dfe3f8e6430c12890d427be0c357bf8c7982"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/check_usage_docs.py___": {"doc_hash": "eef7e62ff670258d720f4420930a98676c2435521a39fc317f66af130e875403"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/generics.py_from_typing_import_Any_D_": {"doc_hash": "69527cc1fcbc6bbec6d25762e31204db3dcb5050e36c2c90017d30379a0ba568"}, "/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_KwargsNotFrozenModel.a.1": {"doc_hash": "f557e8f1344b974c560866d9a55c098f210a0937d3bd557b1dfab8521707bd3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_": {"doc_hash": "a8676593d5fa5758359b78e72ed480448d5d2436380dbdb8ba0f6c4e2e0cebae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "90be6a4dfa7094779f30af0e4f3e13e2c824347a9696ad52a7a129f671923941"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/root_models.py__": {"doc_hash": "b19f8f1960ea00e788774572479a8b1ab58bcba328ec7aea1bb8614eccbfa0df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail1.py___": {"doc_hash": "aff27835428deae89ce5119d2b6c72f8356751939912f554adc45336e56e678f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail2.py___": {"doc_hash": "1c21b189c3a51b310ab0b8ee9771420d8d018c85226435a262bc0e7e6587ea5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail3.py___": {"doc_hash": "145ec62a9541cfe2a6520f5a03e83648454322a461db22e0da7f567689718286"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/metaclass_args.py_from_pydantic_import_Base_": {"doc_hash": "7e351321f6487b720b9e9e10114be42abd6f06bf824f8c6ea30f5c5604c9bf5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py_NotFrozenModel_": {"doc_hash": "93bccf8a2ebd9971650ced9858e26e37df968ffc30e767c66267bd14d6ef5db8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_FrozenModel.model_config.dict_frozen_True_": {"doc_hash": "dfed45b0d2bfbbdbf4ce1190fb9067d1c4959aabca6388ea6b86f3955e6935f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py_NotFrozenModel_": {"doc_hash": "28e33626ac583c8210e7baed72a273e95dcc8072e6f59a27517dabfc91ff302e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "27e0dc27e69fe3a3649015df9aff4ba1edefd8638b2b0a2696d11fec14812359"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/success.py___Flags.__str__.return.f_flag_self_strict_bool_": {"doc_hash": "84119f87201838d6c75952c82252e4d7bbac146ac14f3da7befae79d8dec1ae1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/success.py_Model_Model.pre_root_check.return.values": {"doc_hash": "fe05f8f57a07280ac449bd763ed95c102dd46c4ceaaabea9d4aaf2d713f6b18a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_": {"doc_hash": "e20d1e7586b7ea79ce2ae34cddc772e274e988614fca4931b77c09a5b77f0cca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_": {"doc_hash": "c311d5ce120f3b070c749be137b2ec118844e5b693068a7ebed49bb4579ad1db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/success.py_validated_": {"doc_hash": "de4e2202b76f62fbe31a72e515c3ca6436ff2c5e36b3af632f587f61af079d15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict-no-any_ini/dataclass_no_any.py__": {"doc_hash": "20a3cb1691b721cf76523db8db73a1576f47e730491d625ed12caaeeb27c3168"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/fail_defaults.py_from_pydantic_import_Base_": {"doc_hash": "dc3d9e5773085dbcdc2b453afb7597d9e56466ee4c028d476ab56f4a341c4e4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_default_factory.py___": {"doc_hash": "0d20f166de41118b8d67e97e7005fa92f2fb042b9d25c4abb193877e10d1022c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "d007b507712c06c0fbc8383e26f7318be7ed323e6bac5ebeebe3473d893c9de4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "9614c916e7991911aba3c948bd841f5801b2f4f5ace553cc3107cefe175a040d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "2e8e1f1bf8752aab7e22152f7e23882cabf4434cbcd51397863385325b98e031"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"doc_hash": "5b9e66b569322e2f0b9fd9229da79a393b812221b5628e0e240a3bf106ea4e26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "915b0b230ce5eeccd9875e3986b688622762944d371cc3e50c0aa94c3a786260"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "cb313de68ae3dc5e128ab827577fb8db6ad3fd23c0691d9635d9743cdba85f6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_37": {"doc_hash": "24e0fbedcc13f762f7ca585f4392f4134c93543950a873d93fd09917fea9ad72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "d8a7d32eb966b67f74463784a3f86dd350b712297edf722cb206e54780df1c1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "764e80e5640588d3fd636ec9d6a1f85fd365dbd6bcf40559e9af4d68907534df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel(x=1).x.2": {"doc_hash": "3e4abf13032e3a8fdece552cace81b52731a94dadfcdad06213926fd7ea244a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py_NotFrozenModel_model_vali_": {"doc_hash": "b3f43d154169551e48472ad9042f623f187482a5ddf9709a3e1513820f3075eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-very-strict_ini/metaclass_args.py_from_pydantic_import_Base_": {"doc_hash": "f0e4fc54f58d98b0b2b7b47a5d09e048f3bb42830d63406f101a52e718b54024"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/custom_constructor.py_from_pydantic_import_Base_": {"doc_hash": "abb8fb934f1d40d5bf4fc08912c572fdfa6ec6900b75b7dc531baa3c60dcb58d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/generics.py_from_typing_import_Any_D_": {"doc_hash": "0f8c68ec89d3025af516d9deb26c2e68fc506566a35219aeb278b94382a8b85b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"doc_hash": "71d7808eae7552c5fba1461531f3590d3ee4b98de3d5eb567c1e9341a34f7ddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._": {"doc_hash": "3b7f33b451feed9da69b00a05cf494394338b334cae6020e0b1cb4ddb3cb904d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "27e849cbfbcfdd4b95fe53feebbb50b06f01953e664e4048e14f0241a10ee773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "cfcecb56b185945f474eae573fd3532576841227c00837bcb748b93c121b5958"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"doc_hash": "29804824aaf9144ebc029e193d103651e23dcf409577aec804fd512074bbc578"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "e7715c6c6f21a32895216d15767be8108fd7d76d8f0edfb0c02fa679850dc7e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"doc_hash": "27b8c511d8054cbbb7f60bec96562fad39719a9f9150c099db4b87696012ed54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"doc_hash": "5e81319c12f38dcce385f6ac337b7128ff4f9ab4cc44790346cdd565920dcb66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "4c369e98ec08ea6036c63962df554e812cf197eeed7f59948c5352671e06495a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "ff5462e421348944a7787cec2c51365d1490094ea712a8bf94dd1e860038b41a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success.py_KwargsNotFrozenModel_": {"doc_hash": "bb35356727fe9c34008461aa9e83458118c84ff49ffa31dc45a6a4d0f8165331"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1": {"doc_hash": "ea192ca07632e994d4398fdfc475841aa1b32b27e890d154819913e5d7d51801"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_": {"doc_hash": "bc65d8d046aef428a49e8ecfcf0f3187549d0f712a886f951c9058b71181bec3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "24e4cacc9ae7d78cb17910797bbbb8c907e5313b2deaff3838a1b088f3b74232"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/root_models.py_from_typing_import_List_": {"doc_hash": "07d6ccc6dae8e06acaa476153677fce6741062921f77518068f8bd21d13bc677"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail1.py___": {"doc_hash": "838d798d0d007a22cebfa6f26b041a14aed8498c5a5267901326e2eb8075a350"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail2.py___": {"doc_hash": "bb9873eacecb0f88b37caf36960ba9eed2c97dfa817bced0f87e7b2430545735"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail3.py___": {"doc_hash": "d93ed80b0fd073f086333108b40bc9b5369347e476975ef970a425f82268c3c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "c1ca26bb668a5f952b0da3663456479e550a399b558f038498d6f3ce4aa4ff8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py___Flags.__str__.return.f_flag_self_strict_bool_": {"doc_hash": "0f45d40b6706053603628bd2d597f70e29ca4c8f96fb76f0f4b0842cc6408724"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py_Model_Model.pre_root_check.return.values": {"doc_hash": "dae076b05840cb113ee9f43f31889db932fe52e73c5cd405bf8917dd14dbad21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_": {"doc_hash": "b56809b5c480c7a589ef26c239a4fda3a2f0eefb54d14e108d5d44d553a568ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_": {"doc_hash": "6c660c20737fc7c73ca851750b94ea582418543661a94e2256d9d7416000b84e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py_validated_": {"doc_hash": "8046154e27af05ce455f36f851da2976b9a93846d0b5c2c6b646abce3de9d1ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/fail_defaults.py_from_pydantic_import_Base_": {"doc_hash": "007314088583caeb6080e405f8bfc5254dfd093a7f331b9f62012f1df3ef11de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "05a1c1dc23f4073ef37f91624d85b73022e846ae7c07c1364af47d81f62e7af9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "5434493cee0040b7ee0ff0db44b99aa20fcb48f1e1f90804d5654876330203fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "2269f25e28e4c1e53e8d76b0017be6cd0e3c8d4deab9752d77f8cc21bf4aea39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"doc_hash": "b4100ccefc4c608697e82f75fec5dd9c506d428c60f8444c7a378535eeb3f61a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "f44f37a231131f1a8dd51e903e1b791dfa7a035acc48a2f27c05bf57d29890ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "cb11973bbd7ce3fceff759862b6510dbdaee994d194869b344487c302a07bfa6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_37": {"doc_hash": "4fc63585594ea64be19fe6fb853a3735d772b6d5fc5e87a9245321c2e6bca145"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "b225a497ea11316cac7e5a606a6e64729b852ad1db4cca97fedf48ada3c5a8a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "e7d5fa8cb56d663cab330ae0fee50c1f5df5cc5fd2eaf99ed0ab71105c823e72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel(x=1).x.2": {"doc_hash": "ca80cc935a284c4d0322c20498b915d49abf4273b8d0a61b2842d37768ed8f53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py_NotFrozenModel_model_vali_": {"doc_hash": "61c101806c4ebe8543d1988c051aa5b6a9c20bf0d5603c2ca9475297ac968b2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"doc_hash": "8fa3f67c95eb293cf3c023c2d9079525d610cb8aa3385ebbe8072bfaf93df1fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._": {"doc_hash": "a654ac38d36fbce9aa863d5a2df9607f6156d8b95f299936caa6e8426e60881a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "9bac89fd099608158ca76d2731bfd03ca13997e32edfab181fc32dce2f1d6454"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "3bc50e53e7c36593ba4f257a03cc75cbed2267216c1c50067987e3393470bdaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"doc_hash": "47282acc0fb9f755725ac3ae4f231bf1486e8ac7ad745f3babb993e35c1e481b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "05d2502addb9656970c980ec7866e8104ee60f795bc3e03cf9d4a511c3e8338d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"doc_hash": "d06e8e4fc30af9255ef8802be029dca02ef24ae9e00b37243c5c0496ec2dde99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"doc_hash": "910eb2450b9e995ca13f0e4d0656a2ad2a44bb78b935c387d1430f1721fdb6f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "88babedf13ab1bd96a06d5ed393c20fac1c9031be1e0625e56da38097f05b050"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "6575aaa60dd4b6f510e0638e058d95ceea031105aa7490e445739a4a5d062c66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py_KwargsNotFrozenModel_": {"doc_hash": "0b6a0d9c5d0e02dd51269cb1c87c4048f895d4933a01277d2d3dae91ef0f1d67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1": {"doc_hash": "0c0657e4f06fad0807ba3adaa7706dcdff96bd9cfff3fbeb0ae223cf32583524"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_": {"doc_hash": "3ccd00a71b767c6cb6708c415e5474b4dd053436ef4a8857695f5bb10388028e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "de751432ef97b8f2d31d7691226f655b0aee29f5a5c654e1709a5bb3aee79bc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/fail1.py___": {"doc_hash": "1d160298db38b88aee34336aa40ff3519477b907b44c99ccf44c2e2cd012db49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/fail2.py___": {"doc_hash": "fdf8dd575c4cbbd9088240a5aa45bac2ccdd36f08c89a9b39be611777c8c70f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/metaclass_args.py_from_pydantic_import_Base_": {"doc_hash": "52dd1ac12c1f0a065844dc1db4db1f1ad92046e6fc5836e88eba3ce5d51ea21f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py_DynamicModel_": {"doc_hash": "5cdbfb5f262426fc9d2238dca610c667799728bdeccde77468b1ed50cfc26d14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV__.NestedModel_Model": {"doc_hash": "5a81520449e0b2bdaebe0235b7f40696f607f02c42d044e9cfbc59dac85488d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py_DynamicModel_": {"doc_hash": "7ce852c518464bccad25c82c634a43ec71ed9a30a3d74e4cc5e0d631d8c92245"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "22257b134d34a01767138444705e14ae041336b5d32120557c74db1db1bc2a8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/fail1.py___": {"doc_hash": "8a1872aa2a2216ced990b1d0dc9e12e7fa4ef44941052bc4b4668a6663415fc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/fail2.py___": {"doc_hash": "9937a922e66d8d4996f4ab84a612f4ca3b055fd6c7c6b3e6ed73ef5dec94dde5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "0851ed2df74d6eff03cf9a7b8c9eca4bdcf2b04a62fa36da58679597c836e8e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_dynamic_model.x.2": {"doc_hash": "0f9ca162e14dd677365d033f22d75bf22f8dba26a02e8adb227d7322607d387b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py_FrozenModel_": {"doc_hash": "f9892418190716f6e0e9a0d6722a7dbad185820e2cda4ed2d42cdaa48966b054"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "31f1bc7454ef4ed31b747535c4eaa78e94665f4797d263d3480606c1d4d73df8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "4fe9bba0047fb89279bebace72db1ca45b7f78a7235f97e0dcf1d91cf476361d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "bde9e41a260b857a3715112a2836f50c857720b349b7d9e523698fcaec656747"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "fc9b7d77903e06f5d6b589d92db516ca27815d172544c567856f8827b95ae4c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "bc6622811b575cab496cd1cc4b52b6081bdcc2b2502e2458cfed44ea9ec5d87e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "e7bdce41577dc22c637e41018d87d6a2fa6ed9703af913ac753d7047a18d6162"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"doc_hash": "0fe6990165d5b0ad5aeaeb694efc541ba53d992ac056ccbea63735922cf39e01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "2e4937f7037b22771dd3079f0b0283bc9c16f759aff95ef85fcd45d72d186a88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "b559e59931ba49d8b670ca8ce086b4120649c8525145d3a233d0d66bcf75dedc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"doc_hash": "18621232925a265335f83f7e033eaefc5038d6567e2bdcde4994a6bc77445f2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._": {"doc_hash": "0bc249bc344a8c07ff81b3f60dde274890b967fcc80ca607bdfaace41fcbe08f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "309d84be2db716a939a5c1619e5cce37e5055b35449a49a3d52deb6eb732b5e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "2d7ba67fc695ff15b8fc40753c7f1e39e602c8783d7ee40e3a50c0e72569ef12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "c8a301750b8aa15b4ff14e6a064f630b957c3fed483901c3ddb80c65cd5d4f0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "0a08b7fef92b662410db0dd907856a14dbfb3bd1f09ddbd85fe503010b8aded6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"doc_hash": "4986086a8b4079ea274a5e14b671025ae2092424dd8b737b45ae6b96f6984f62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"doc_hash": "19285d8ad09d3403304c15e01f004bf0e76b600e6fe8099d15974b1af535bc88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "815d1ae9134149bff23c4b3b7ea7ad95401ac83ebdf6e5ee834e23df104a315f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "2127d77e763347efb1e22e3abe7070b2ca555a721005eb2ef82011e54c98393f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "c430d1d24c3e99fdfd2bdb1b9428640e96f1617475baab085508fec218323ea1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "641fdb11e6c17ed8a20e66b7ddb1543e09738301e00a4d64e374d353b57c5623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "b6336ac4d67269fae7b7df84f461b384a8c4a35201a9f455912b24d19d922844"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "47412497c8fdde2188a4a41c0f6a32adfe363918ac02d1406ee72d968973102f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "f63525c174e412e704eb5df5db5db7d4f896628d39ff0cf1b7b0856c64612979"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "2af17aeb3cfa33ef74457c58613599cd405134682bd932ecd976287f4b80d101"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"doc_hash": "2da67606204695e0804d5fae7a5ddf131a2c66040bbd58007eded90b00ad51b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "86add5569e3e271fb57f8b33f2bfadc76384fef906e7609386ff6b5f2eeca995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "fe1e571046a9598506384f2ef0ed45d3b750d4dbb06c9348efd169f2e28a073f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"doc_hash": "5d6a41422a4649e282f937e4366657632cfb00ed3f600348b6302b627a238a64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._": {"doc_hash": "1db37e0fb3ab46c73d1574e8e039dfa516046b63d0c0d3c7bf9d179f72f41346"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "aad0a286f1123294a27089f9929209b559c2a811b8d49f02e063efe105e0fd5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "1e8128dc9355d1fb9fef4bc3777218ab0ca3577d8431227d9523f9ca7f07ce91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "3ff4e7b730eccdeb16d105df4c76e5a829e87a6681252b4b6f6ff3a15d13b9d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "6f999ac65d53fef9b493626d6a92624105e08d4edf4d35917ec9c5552612128d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"doc_hash": "8e07b7cbaf24f689ff30df465cb71867a2dd36d1b3fc431fd522e322b15dbc98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"doc_hash": "94302d24b30211fb7801079203fb0b8dd157b43a696eb79c9e30d44f3d67c3ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "48d2908e32bbb672fac077e4f359e5d404974d53f86bfa235d90d40291894050"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "a63035ac2f7918e906df9d2319f4cdabe084d51e0ac148be6880d39d1e389837"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_foo_": {"doc_hash": "4e9f69219a2ab4af0f6383b0f6ebe07b69cd4f79669026384b503161afa38c3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_default_factory.py___": {"doc_hash": "fc099d49d6f63ea53a580506cc45fadeb370f96f1fdccca8568b3c414e9eba10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "5c16a9ea33f9a2c8e6f53eb0d10ce936cd13ce1b0da970385754bd8e44c82cf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "dc7539d3e119adec9fa8a9da5514a471e3710a4c66260ff264afcd49e61a17bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "f7e080fb56f4f7dffb23a033668cce2fcc0afc4147f0d8cd2ca868fa5702f0ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "e97c1c2f9d8c162b99cb3cf4050dff5cea06eb51a3d677c88738b1edd75579d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "37e1bfb533c5abf9d70db617cdc3bcba4b667976f3f7dafb94730bc1cdbc2884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "74cda2b774c930c47136b6197ec212afa7e6ca09795b9d4976084cef91b7093f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"doc_hash": "d9f3be701b085407e7c0959110f349fe1d930e7f7072a4c320dd934f163e48f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "de135108335104061d2186679aac16aff410651ee010daa44b0baaf795b40144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "2315d4bcf81ef1960f6fd6b1885dc912b604598909aa3ba1bfde7b17c321f2d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"doc_hash": "badbf614d5764e7681ec0ef34a324dfd35882b47b027d79b0a362e0d041a4d47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._": {"doc_hash": "500bb39ecfaa8a7c4ba30e9d600343eacfbedda5a1f42dd72e13777727671a8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "7c34f067abdbe40647ac8cbbaf6185697ed51f52bab15dcc6df4f0e7d9994492"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "70278f8db4145e82bfd4e6601929605188780abec6b1c7bde3ef828b0be4f931"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "49c0ccb4a88f215a3cae2497eda5de7b30965c559bfb4ecac2345d1c2a2fd3d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "712f509527b6276dc3361c7c9510572dc79cd80e76006f8bec17e2ff8322e300"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel_z_1_": {"doc_hash": "5b84cade317720ab6710560441ddf26b36e217c05681c8746d5ba188a96241e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_AliasGeneratorModel2_test._": {"doc_hash": "d147b09169b3a88b2ce327e7601ce88888fe6833ddc6201562328d2c24912980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "a782411b22230cee0aa0af5e6516ff3fdc4d0ca49d6498a29fe9e99de6a85f93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "e454502b60b83d08f8fffab4104a199c1167a9042cc218ebae612191937bb29e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "f658bc329c544e9983ea5b2e5f1cb661cc08f3081748768ef6b5b1c0215ed33e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "1d4e83fd7e67b6ff59425883bdf8bad2e6d7d7049e4c2a6871f052e270ae18c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "986896f805dd399d38affa98af65a6c8fba5fffc961f3010855619eeafc53a53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "0ba3c51235bc53a769d67d595c6e14a7e22ac63ea4085309b679580954ef239a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "f595b8696d28c5bbb17ef80481b7121541a1347ce535052a471e2eb9a8d8553c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "307809461d42048558c5444a8848e3f34a107b02e4fa55a54e372c31f69d1582"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"doc_hash": "5cf1a4af5624183aedc15cc0f4103223ecdb07dd075481c27cd88271044e977c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"doc_hash": "09bd399f86d846a9ea7b34d5625925f259fb3c827c35d97b29dd1a6be1afaff3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "27a82a266e603e7bc6a37b5226b6bf5e83077c4ac1d5343b02047be1cb0a7fbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "5da7e4ae2366124f1ddef76683a8cd40b6405259e479ab9f199e774b42c07c74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"doc_hash": "dac74e925d8c0b065ca15e71ae88fdebf89b4a44ecb8d881931847888bacf1db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._": {"doc_hash": "c1d21deb8fc68e1e7594f34b7d8d2b7985f5331f724d1cf7015a46d2ad7cab59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "6233b1548100d96c8afc6ac7c4e3be3d3bcc2459a76f53576135c4bda7312379"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_": {"doc_hash": "3cb0d1a32b7fa3d71eefd9c037c639b62051ee358f37e19b4cc70a389fc56d9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"doc_hash": "b9b88643540b92ab9b435c839088adfce1c97e94be4ef51c5a7f494cae3389de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "fc2dbf1307c467619daaea2e7389c164580a8b0d9a70f425d4152b749bdd1848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel_z_1_": {"doc_hash": "a91130c1ee8e67141f2a13b05acad5deada22889f2a51abcd5ddfd16173a50c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_AliasGeneratorModel2_test._": {"doc_hash": "0644263aee29311d7fa67a337e097392afecca33ade90711cbef85e09802f837"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"doc_hash": "d12dcafa854b023104b1c95f4b3bebd80f7e1b60be437b1c23ada8f0f42473e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"doc_hash": "708c84eee60047b74cfa849b5a5aa473ccfcf3bd5d7cb46a1be9487fe32e8787"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/pydantic_settings.py_from_pydantic_settings_im_": {"doc_hash": "875a1f7b5e4ff00ca2850c559379d2145060731981891ef249e5638de68a178d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_dataclasses_os_chdir_Path___file___p": {"doc_hash": "c3f663879a19d45f07e084b1088a7cf3bc0b885136801972117a1bff140559a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_MypyCasesBuilder_MypyCasesBuilder.build.return.built_cases": {"doc_hash": "481e5b969c23c6805ad03f51051d3c32ee6ed72abc03f13f8b384729d7160b92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_cases_MypyTestConfig._the_target_for_the_curr": {"doc_hash": "f89c0ed85a1bd67afd64ac71cb0759842e1354900a9056265065f1c1f0b16722"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_get_test_config_get_test_config.return.MypyTestConfig_existing_": {"doc_hash": "207047ad54d47e425d7eadeda7111d45f427bef533a150d0f82e070c56a5e5f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_get_expected_return_code_test_success_cases_run.importlib_import_module_f": {"doc_hash": "7c6d659adcd0cf617c75a361844cd44bf5936842418586d3eade50eaf65bb149"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_explicit_reexports_test_explicit_reexports.for_name_export_all_in_.for_export_in_export_all_.assert_export_in_root_all": {"doc_hash": "5935cab4cdfd133b795a4e5988ad30b416ccdc37e9c1c7364bca9596792b85b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_explicit_reexports_exist_test_parse_mypy_version.assert_parse_mypy_version": {"doc_hash": "b304d1ecabfadf54de7989631747341e2840426f2acdb8c4377f57b3d47e8765"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_merge_python_and_mypy_output_": {"doc_hash": "25aaa0bec1325d7fec8836a1d91a9d697331d7270781af2ef2c02bd34ec9b41d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/plugin/example_plugin.py_from_pydantic_import_Base_": {"doc_hash": "00dc58f31c8c899aaa56d77d1d00dfcec0e2305061195ba58ccf55bcfa05b685"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/plugin/test_plugin.py_os_": {"doc_hash": "e9b389d2236bbb1274b6a4a595606b0fc88168c6feadb5fe977ca09b0f93068d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_used_by_default.assert__test_alias_generator_used_by_default.assert_": {"doc_hash": "b922aef36250de4a6b5f2e8152e3d8424c713f4a1b9f76ef195c0d68719901f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_sys_NO_VALUE.object_": {"doc_hash": "ac53489d5e9334336018916dc1b5f4e0f21f3fcea50d3f8dd5b11c75f08e3db5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_test_annotated.assert_repr_M_model_field": {"doc_hash": "da8a834b31f669187ab798bc020c2d04da5d879223f1e060d4be90b496ac7438"}, "/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": "ab27209a0216e37bf2e646cea168827407f6d64b5b0d0115f404a6d011279b77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_get_pydantic_core_schema_source_type_test_get_pydantic_core_schema_source_type.None_1": {"doc_hash": "d1504f27dff599a458baa22b783b3dad9561c8cc8be8053889338c6eaa6fd0a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_type_adapter_test_merge_field_infos_type_adapter.assert_ta_json_schema_": {"doc_hash": "1ede106fdddedcdcab83b1614515c8f89220d77e518bcd544836f8bfc16d2ce4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_model_test_model_dump_doesnt_dump_annotated_dunder.assert_AnnotatedModel_one": {"doc_hash": "c00a1287b56eaf3184311398dd1fa27057454a45f81bfeda2bea841a80d928fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_ordering_test_merge_field_infos_ordering.None_2": {"doc_hash": "aeb80bc29c1f136802fed83f6214beac40697e2bb63ea844ebf71bd3b5593dae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_validate_float_inf_nan_python_test_validate_float_inf_nan_python.assert_exc_info_value_err": {"doc_hash": "63c4b59084f8e555d0827ce4fb74bfbc7ad9ec2765e9dfad1a70fcd9c6ace130"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_predicate_error_python_test_predicate_error_python.assert_exc_info_value_err": {"doc_hash": "cac55b0598755a925d846007dbdfd6eed7ffa9f30c678cae1b8f3aa046b96933"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_exclude_none_test_exclude_none.None_3": {"doc_hash": "ab81e07446a41cbb2c205c3182b88d4f153a285753f6a14501abddeb4e51edf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_abstractmethod_test_abstractmethod_missing.with_pytest_raises_.Square_side_4_0_": {"doc_hash": "3109be62a56d8b93b33996f9776036a97f926e70ffd9f00ce34a80499866edbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_multiple_references_to_schema_test_multiple_references_to_schema.assert_ta_json_schema_mod": {"doc_hash": "4a21edf89f7194bdf1b554d7b3c62fa29b83645d0a5b8aa0c10b934341bb1964"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_json_model_with_strict_config.return.ModelWithStrictConfig": {"doc_hash": "d1c1a08bd39999279beb3f8c462ccfb6af63de2d78c886a0b49644ae04efe219"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_wrapper_match_test_config_wrapper_match.assert_": {"doc_hash": "07367ff06432ed4b1d98599ff2dcfd1f0741138c17dbcdec17817c066555c56c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_validation_error_cause_test_config_validation_error_cause.assert_src_exc___notes___": {"doc_hash": "97588c7a1df02f94389e007a696f4b6490f6b603277f561c588bf5935c066fa5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_defaults_match_test_config_is_not_inherited_in_model_fields.assert_m_model_dump_": {"doc_hash": "31ea1e55f86ef2f8e804b2f78d2cebc2bf35d6a615f6d03ce9106991fcf1ee6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_wrapper_repr_test_json_encoders_model.assert_json_loads_Model_v": {"doc_hash": "54a85c39f22eddf99f38543cd539ab0770976d8a72d0a5182b02a04116695d5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_json_encoders_type_adapter_test_json_encoders_type_adapter.None_3": {"doc_hash": "7b4e015fbee70a3da826afe2c2406fde961dde000083c4a73e3943ba49fe0b2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_model_defer_build_test_config_type_adapter_defer_build.None_5": {"doc_hash": "61ff0c72a265985d484d0343321127a5a0611025a679bac9d04378dc5ddaf2f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_model_defer_build_nested_test_config_model_defer_build_nested.None_4": {"doc_hash": "1b615a7871b3f6bfa8faa0df8f57c3eb1630de31fa93162f698f13fa93d1ae2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_model_defer_build_ser_first_test_defer_build_json_schema.assert_M_model_json_schem": {"doc_hash": "de756c81b9fe9e88acc7baaca3e38c2c42d1454b54c076c8ce3080a65410131f"}, "/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_create_model_with_doc.assert_model___doc___": {"doc_hash": "6a2d9c1f2126624c247d43c4ae6377fe3ca689e89679f2e924fdeb352cc7c202"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_kw_only_test_kw_only_subclass.assert_B_1_y_2_z_3_": {"doc_hash": "db5d227a491ae499d5ceb97d45f03bb9e8bf59e31532cfacc071aedca0e3b5ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_dataclass_decorators_dataclass_decorators.return._argvalues_decorators_": {"doc_hash": "6dfb51b0da89528127cbc31fc03eab1227d5db8ce644c682bee9230f0db0c78d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_multiple_parametrized_generic_dataclasses_test_multiple_parametrized_generic_dataclasses.None_5": {"doc_hash": "b79db703e16190ec4761e9c3e3f2628b2e129902ab3ea92ca6364670b9c6eb1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_rebuild_dataclass_test_model_config_override_in_decorator_empty_config.assert_ta_validate_python": {"doc_hash": "dd8037a37111428b3bdbcbe093059226278ed219250e136858f30a38cfb12308"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_field_annotation_test_pydantic_field_annotation.assert_exc_info_value_err": {"doc_hash": "8f0f503336bad40a6f282f2e97c322c50db5ab09c56c9dc2a5bce359aa2cbc47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_combined_field_annotations_test_combined_field_annotations.assert_exc_info_value_err": {"doc_hash": "37a335ca671636797463e528c984dc02beaf33ca757c679a5152792c8ba8c60f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_field_default_factory_with_init_test_dataclass_field_default_with_init.assert_RootModel_Model_m": {"doc_hash": "ac96fe617c4e86a041227e3371ab49cd7aad43cac247a4aea591125545f36d19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_metadata_test_metadata.assert_TypeAdapter_Pydant": {"doc_hash": "08d25c881ed0aa2c74f6bb79e43303ca3e1ac3314d860aa3db37586ab28eb7da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_signature_test_signature.assert_str_inspect_signat": {"doc_hash": "1f088d8aabcda6ccc5ceef72709ed46b8c0022a424c768fd635fd619f68cf1e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_date_parsing_time_model_fixture.return.TimeModel": {"doc_hash": "09af18a68d627ed7acc476f27f64d23ad2e7ea0e2f1052ff099ea454594d4144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_time_parsing_datetime_model_fixture.return.DatetimeModel": {"doc_hash": "9d220fc1af59efcb40927180c3d2ee82b7d995e13e4655c0770a1d761bf691b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_future_datetime_validation_fails_test_invalid_annotated_type.with_pytest_raises_TypeEr.Model.foo": {"doc_hash": "6d198a86bdeaeb3b5c988d240a7d0c15c47244cba494ddc74e51f18b845ec3b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_tzinfo_could_be_reused_": {"doc_hash": "3f8849604cedccce14ac359aeaf078689d8a8cea84357d102dcc5dedbeadb7aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_regex_test_modify_schema_error.with_pytest_raises_.Model.__modify_schema__.pass": {"doc_hash": "768b4e5e1880c5f216373c4da7c21497a5a6a564fca9c5f5f4520fc4515137ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_v1_v2_custom_type_compatibility_test_v1_v2_custom_type_compatibility.assert_ta_json_schema_": {"doc_hash": "956e6cdbac8f4872b3dafba279a2cf80160a42b09411c08dc606530a4100e628"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_v1_get_validators_test_v1_get_validators.assert_m_x_day_1": {"doc_hash": "fe65ebf500a1789accb50ecb45ca1873f57ab593b97165210061908b662a0e24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_v1_get_validators_invalid_validator_test_v1_get_validators_invalid_validator.with_pytest_raises_TypeEr.InvalidValidatorModel_x_1": {"doc_hash": "1d7ac28878d32f924a57053acb0e537551563ed091358b342a862c5cedd54781"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_extra_does_not_rewrite_json_schema_extra_test_dict.with_pytest_warns_Pydanti.assert_m_dict_x_": {"doc_hash": "c056658f976193d2dbb20a67f7e971dcba85e736f057280b892e13b54f8b9547"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_json_test_json.with_pytest_warns_Pydanti.None_2.m_json_foo_4_": {"doc_hash": "ae6d0814c2c4835697bdc6f79ddd5c36693fae82f27b08f4b25b5d2c990d70c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_asyncio_validate_arguments.with_pytest_warns_.return.validate_arguments_deprec": {"doc_hash": "c0a137aef4f5df7cc0ba00e753ba1dda02d77cbd4cfca60769baad277fde9c7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_re_test_discriminated_union_type.with_pytest_raises_.Model.x.Field_discriminator_": {"doc_hash": "5e1e66f263a0dbb950ee2e12649f47eef49565d087e90bdc0c81a49c6bf56566"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_single_variant_test_discriminated_single_variant.assert_exc_info_value_err": {"doc_hash": "c89609bc7c139b63835c83d5c5121699acc398808f9c9ff343fbd0a077289a07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_single_variant_test_discriminated_union_literal_discriminator.with_pytest_raises_Pydant.Model.number": {"doc_hash": "279a423714ce4e9eb6129f86b7523aa91cadd75d7656dffb50ea608e7dc99af6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_invalid_alias_test_invalid_alias.with_pytest_raises_TypeEr.apply_discriminator_schem": {"doc_hash": "d4e32d0e1ca7af25be6f0c59e926d24a6f18a5cb63f14cc27173ba0bebf6c7b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_wrapped_nullable_union.assert_discriminated_sche_test_wrapped_nullable_union.assert_discriminated_sche": {"doc_hash": "9af7a86620dbd0b363e45689673ea4d296023648c6729cd96b58d7c98f97f47f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_in_submodel_test_union_in_submodel._insert_assert_TestModel": {"doc_hash": "1b709cf05760eb17ead72f04a6b1aef9a7364c4cdd71a0c0b76cb5da54c93eb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_in_submodel.assert_TestModel_model_js_test_union_in_submodel.assert_TestModel_model_js": {"doc_hash": "fd78b5b52ffc744998ba6ba33dfdf3ef6db8265ff41c709cada972eca92527e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_function_after_discriminator_test_function_after_discriminator.assert_exc_info_value_err": {"doc_hash": "235a5c78c90b7f0cf349dded6e9ff2722af04743fb69ea0fba87082c167767ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_sequence_discriminated_union_test_sequence_discriminated_union.assert_Model_model_json_s": {"doc_hash": "e79f9b3c0fffae4aa7dcf5804822aad6b59d315aaab42f55033fa04e7c869853"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_callable_discriminated_union_animals_shared_pet_discriminator_value.return.get_discriminator_value": {"doc_hash": "9c0fe0ffab0c6e4d12ba28bd9b4afdaab4ad7c1094ddbe73597dbfc74a33cf0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_with_type_adapter_test_callable_discriminated_union_with_type_adapter.None_9": {"doc_hash": "efed97949b2fecdee51403943d14be4698159b3d42d998ae809eb94dfc4a87a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_various_syntax_options_for_callable_union_test_various_syntax_options_for_callable_union.models._PetModelField_PetModelA": {"doc_hash": "57aa9194850983b22256a3191e87147c3f6f938e1a015639477d48bfdcdf56f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_various_syntax_options_for_callable_union.for_model_in_models__test_various_syntax_options_for_callable_union.for_model_in_models_.None_9": {"doc_hash": "84d64d5e39ba2385e6f9c24665a1df90df9dc322fe01a4a62cfecf9578b3c318"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docstrings_examples_set_cwd.try_.finally_.os_chdir_cwd_": {"doc_hash": "3d27301fe182d9ff2d61f3a037af94c3e7e69597662a2e8d38816274f5fefc2d"}, "/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.__init__.self.t2.t2": {"doc_hash": "f781eb5ac6a014a208923966187cd008299a0ad332aad51a82b22a6b4bb9ee1c"}, "/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_rf_ann": {"doc_hash": "5e446b46f6e60061b730c900cbce2417ba727504df63e64b9beaf8bba9f0d6d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.validate_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.return.core_schema_with_info_aft": {"doc_hash": "328ac11a8c08fe964d71264497324b9b60da383ce83410d77e3855904a6e6bc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_generic_wrapped_forwardref_test_generic_wrapped_forwardref.assert_exc_info_value_err": {"doc_hash": "80837e6e4916bb261208c71e281abd74aeaf76d1c562ecdfdf05f013bed201bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_plain_basemodel_field_test_plain_basemodel_field.assert_exc_info_value_err": {"doc_hash": "a282648d7ebdb7e9f4cfa65c6a1d632efd66acbc54f85773e7ad4a89d780dc18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_sequences_str_test_sequences_str.assert_e_value_errors_inc": {"doc_hash": "c1f219e11f5e8f6b90c3833857f98d3e04767e2aacb7af39e8acff975de4f34e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_multiple_enums_test_union_literal_with_other_type.assert_m_model_dump_json_": {"doc_hash": "3d25fb5e63d378e72841d20cbab6d4179bbdd69d8b4d0b67e11405467ce8b523"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_union_test_model_repr_before_validation.assert_log_before_My": {"doc_hash": "928b8877718c6b2bbd48fc0728df4c32a057613529df39dfa30a60d57b4a3ffe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_exception_handler_test_custom_exception_handler.assert_len_traceback_exce": {"doc_hash": "27816185a3a5bdc7e7743c16b19e578337d0f33d4c390eed1609ab80689d99ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_walk_fails_on_double_diamond_composition_test_recursive_walk_fails_on_double_diamond_composition.assert_E_c_C_b_B_a_1_A_": {"doc_hash": "69eb64ac1c101036934d88d5ad4638d0032fa71a5c0d46268b932249f77df5a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py_importlib_test_public_api_dynamic_imports.if_module_name___modu.else_.assert_isinstance_importe": {"doc_hash": "0b8912cd11e53f6bdcfbf2fe8fd9b937e6f0b57bc859ea1fcb4cbb0999c48d90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py_test_public_internal_test_public_internal.if_public_internal_attrib.pytest_fail_The_followin": {"doc_hash": "b513126110a199d402ebcf5ea07b32bd4b18ed9e5c640db4049ab61204bb40fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_recursive_models_union_test_recursive_models_union.assert_module_Bar_model_f": {"doc_hash": "ce8c035787946179006cd60e22736c3d1b043b121aeec9325d21984ad0b2af33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_rebuild_recursive_schema_test_rebuild_recursive_schema.for_m_in_models_.m_model_rebuild__types_na": {"doc_hash": "f1f67ce8c4619a815ef7435352cda3aef34b25b025c95711bdfc18231a4cce7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_forward_ref_in_generic_": {"doc_hash": "63f4f9731701f175ea5cb7c914d01e13653481d1baac89206e4c01b566802bdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_circular_generic_refs_get_cleaned_up_test_circular_generic_refs_get_cleaned_up.assert_len__GENERIC_TYPES": {"doc_hash": "3c5e12395486ff1c9af4d5d1cb66f9a39d556cb558e6086ea4603f6b19392f44"}, "/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_with_inner_typevar.assert_nested_resolved_b_": {"doc_hash": "ff853b04387f398dd708e465cbd83d06ef105d7632d959d29c12a29239ea8922"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_partial_specification_name_test_partial_specification_name.assert_concrete_model___n": {"doc_hash": "73066cf586817328f5fdccccdfd1e70290b35356cfee2fe954744102bca499bd"}, "/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.CustomSet.__get_pydantic_core_schema__.return.core_schema_no_info_after": {"doc_hash": "1b8877c46836fa4a83140e75fafdf5f6ebafb5ae01dffe63581a18878c80d217"}, "/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.CustomTuple_test_replace_types_with_user_defined_generic_type_field.CustomLongTuple.__get_pydantic_core_schema__.return.core_schema_no_info_after": {"doc_hash": "d457d1a8e740f8652a97fb3afe16787961d60dfea11e907d9f4eb31666c0c336"}, "/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.long_tuple_field": {"doc_hash": "cf3d3d372cd8b65ad20d2333f2d72dca9f4b3135f517ad4fc484f3c306a96243"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_with_referenced_generic_union_type_bound_test_generic_with_callable.assert_Model___pydantic_g": {"doc_hash": "f964bc15fe18a3f8c4ec6748646fc50695d5d2d998086eb6152df45e6318e2c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_enum_test_generic_literal.assert_m_model_dump_": {"doc_hash": "1baa45eab7be1b8b14c3b3a1c21e20563ffc53761ead0a47f886f54660ea5d7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_annotated_test_generic_subclass_with_extra_type_requires_all_params.with_pytest_raises_.B._": {"doc_hash": "c9f350c5ae3559ff5b1c24acb7e5d745830b57e939cfd1dc237eb49488b3aa6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_subclass_with_extra_type_with_hint_message_test_generic_subclass_with_extra_type_with_hint_message.with_pytest_raises_.with_pytest_warns_.ChildGenericClass._": {"doc_hash": "55a65499ef62c38b88be29f4f192e0d0949845077d5601aee381c887b234cddb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_multi_inheritance_generic_binding_test_parent_field_parametrization.assert_exc_info_value_err": {"doc_hash": "f73dd2ee069e91017340c4b1e05109e28158898f1ae9e12576ef6532528c875a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_variadic_generic_with_variadic_fields_test_variadic_generic_with_variadic_fields.with_pytest_raises_TypeEr.MyToolboxClass_manual_too": {"doc_hash": "83a0e86f3cf886fb7a3d60d36d9a640c7ca28f131b4ca73728507ad513041994"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_namedtuple_test_generic_none.assert_Container_None_va": {"doc_hash": "71a4ac89f32d734f1728a58bbeaadb17e6372ff14e32354e179cd34d7e3a6e66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_paramspec_is_usable_test_parametrize_with_basemodel.Concrete.pass": {"doc_hash": "d14627f63cc5132fdb88de7095afd6d69075958f2f288b9cbc4b1c98b1a62ac7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_no_generic_base_test_reverse_order_generic_hashability.assert_len_m1_m2_1": {"doc_hash": "7714a6ad8317eb97c1214de9c97bb803b1cc441a84d5e946764fbc9e1b9fb6d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_serialize_unsubstituted_typevars_bound_test_serialize_unsubstituted_typevars_bound.None_5": {"doc_hash": "1d28a57b730d4c0cdbeefba4a8f7a20ddd783a017cf11f1b42418276e25be843"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_serialize_unsubstituted_typevars_bound_default_supported_test_serialize_unsubstituted_typevars_bound_default_supported.None_5": {"doc_hash": "2f471eabd0d9f02d3db695a7b142272415d94deb797e40e201682daf22b2349c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_serialize_unsubstituted_typevars_variants_test_serialize_unsubstituted_typevars_variants.None_5": {"doc_hash": "8d9048960cd211b0e3e1e2151c73ee05f4083676ef76f5eb59260b35ed8491d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_mix_default_and_constraints_": {"doc_hash": "e343ba57e88fed9e0f5879cc333878126526b1f439d4aedd84ad0cd23877f728"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py___remove_metadata.return.walk_core_schema_schema_": {"doc_hash": "7acac090018dd5b7e155454d52844dc3bfb5b7a0f60dfcf2e5ebeaf4b5b5d0c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py_test_build_schema_defs_test_build_schema_defs._check_for_validity": {"doc_hash": "6df370dd961167848807d7c17650ce5b6e5d1060d768dae0342cc824bac89350"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_resolve_ref_schema_recursive_model_test_resolve_ref_schema_recursive_model.assert_Model_model_json_s": {"doc_hash": "96c7390ddda8d919c3931ae14988f70980f8c9359777e911f0e34cb1b5e8dfce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_json_encoder_config_test_custom_iso_timedelta.assert_json_loads_m_model": {"doc_hash": "4ef7b610c83950db23e42f2b08855b069f87e79a6eb82ddbeca4253561b0387c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoders_config_simple_inheritance_test_json_encoders_config_simple_inheritance.assert_json_loads_Child_": {"doc_hash": "76fb195f9eabcb0c7ee8d94c15384da30071a768a693011a2496c4189eb118ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_iso_timedelta_annotated_test_custom_iso_timedelta_annotated.assert_json_loads_m_model": {"doc_hash": "066904a191e6a96713e9cee5752d486c41c2e4738f518ce87a900f8dae1a0cfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoders_on_model_test_json_encoders_on_model.None_1": {"doc_hash": "9263a7378c6fd358209245c1dd9a2145697850064434e57711ec5acb827d040d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoders_not_used_for_python_dumps_": {"doc_hash": "2b6123a47fa6a1cca0ece1e5d664486a86efcac1e2ac0f75cc8c594e2a389eed"}, "/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_default_value_M": {"doc_hash": "ff4ea13515935a193199430ddde325e4b4caa6ca7b4ee3d969f45e2a892cb0b1"}, "/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_model_default_timedelta_test_model_default_timedelta.assert_Model_model_json_s": {"doc_hash": "40f2f87e0528b0c3d8896e44b80bfe06b7a7b4f333b5edbfead6935e6378791d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_default_bytes_test_model_default_bytes.assert_Model_model_json_s": {"doc_hash": "420f0b3f38adc792eb60969c0a293659bb7d64fedd149d862b3fc3d500d0ef53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_default_timedelta_test_dataclass_default_timedelta.assert_TypeAdapter_Datacl": {"doc_hash": "930e61144cfea24d7325ddcb7963ab2b73f7e5df619b457d91080bf8eb20db60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_default_bytes_test_dataclass_default_bytes.assert_TypeAdapter_Datacl": {"doc_hash": "8af67071fca043eea548805f2ac93611aacc00dc71fd8ec45b52432a8c963fc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_default_timedelta_test_typeddict_default_timedelta.assert_TypeAdapter_MyType": {"doc_hash": "b6f2b807a1354200665828cec29d94140a6eb6463329ff94b8c1598e16fbefeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_default_bytes_test_typeddict_default_bytes.assert_TypeAdapter_MyType": {"doc_hash": "b2e30687b96d2fdeacdb258d44510077ddc1a4ac1dfe5d4fa50826166257cff7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_subclass_metadata_test_docstring.assert_A_model_json_schem": {"doc_hash": "63449e40629c58ff97bd22231631bc87b36b5dfc997e938a53fe69932e216e80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_validator_test_optional_validator.assert_exc_info_value_err": {"doc_hash": "1e9c5fec6b4cdcbc6cd9e43cf565e6ec48ec68c59f2780f2a343ba5425f66690"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_field_with_validator_test_unparameterized_schema_generation.assert_foo_dict_schema_": {"doc_hash": "cc1504d1c29746bf82b1ef10b577d4648c7de23b831ed9217a637763fa68dbc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_behavior_allow_test_typeddict_with_extra_behavior_allow.assert_TypeAdapter_Model_": {"doc_hash": "df6f837dedcec7bb93cbd8aa354eda5d0f078e84d91431b0c9bd27bb6f308626"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_ignore_test_typeddict_with_extra_behavior_ignore.assert_TypeAdapter_Model_": {"doc_hash": "6863f61f8246b05054674c3049025b55941749c0398cceeef6a58d78c122cca9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_forbid_test_typeddict_with_extra_forbid.assert_TypeAdapter_Model_": {"doc_hash": "9ae37e450edbb0daa58d03195a4067883db2640468bf1008e793f786d2693297"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_behavior_forbid_test_typeddict_with_extra_behavior_forbid.assert_TypeAdapter_Model_": {"doc_hash": "8fb761684251fb0f12a40ce9331a964a5588f35aa1508f01c22797a1fd0206e1"}, "/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_input_output_test_multiple_models_with_same_input_output.None_3": {"doc_hash": "939dcaf5f9b54fcab29ffdfaf189b1c998779625c1b00a3018cb19df5bd803bf"}, "/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_different_input_output_test_multiple_models_with_same_name_different_input_output.None_3": {"doc_hash": "657c502ddb421fce7099f8130b9697418dcb5ca973ad507fed055178dd08f845"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_mode_name_causes_no_conflict_test_mode_name_causes_no_conflict.None_1": {"doc_hash": "798910db231e1b7696df348ef2fe6aba023b058d8d7a48b65e433879818f1940"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ref_conflict_resolution_without_mode_difference_test_ref_conflict_resolution_without_mode_difference.assert_defs_": {"doc_hash": "fe667a06adbfbf878a76cfcb77d49e5107bb1d41a33386cb14c188d758ab512c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ref_conflict_resolution_with_mode_difference_test_ref_conflict_resolution_with_mode_difference.assert_defs_": {"doc_hash": "05209f938a77e3a3b376ca66142ce230cb8cf3d5a47ebc75fc165ee50ef43eb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_conflicting_names_test_conflicting_names.assert_defs_": {"doc_hash": "51caae2781305223c36c0a86880a34425a6c442ddfccb86228305f40712af671"}, "/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_with_info_pla": {"doc_hash": "78452e317b86e13c735541578e7b005a5c481d0860d97084ecf8a0d59f07611c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_with_strict_mode_test_model_with_schema_extra_callable_instance_method.with_pytest_warns_Pydanti.assert_Model_model_json_s": {"doc_hash": "7fe9ccb06738386c2d48983cff5414185d63e69d5606ceb0cbc46daaf8b07a3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_extras_and_examples_are_json_encoded_test_extras_and_examples_are_json_encoded.None_1": {"doc_hash": "d16378f98fb228033063581fcce75b50b17dd3123ba870386c706a831edc812a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_hashable_types_test_hashable_types.assert_Model_model_json_s": {"doc_hash": "cc343068f015a70c09e96e791f3780e56475c3c824aa75282216a1d1d50a7834"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_skip_json_schema_annotation_test_skip_json_schema_annotation.assert_Model_model_json_s": {"doc_hash": "36608f1717fad8429c36feb554090f48580e2dd5d35bdf9c58ba0e40a0a58848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_skip_json_schema_exclude_default_test_skip_json_schema_exclude_default.assert_Model_model_json_s": {"doc_hash": "fc46691eadae0258647cd1b85b9f6dd78e8cdfa685d1bd9ba9f0ed7658cc7219"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_keys_sorting_test_json_schema_keys_sorting.assert_json_dumps_actual_": {"doc_hash": "bf06fbe18f2ae056cc303f055e976d924c28e6b9f8ef24d596602c992693bbdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_custom_type_gets_unpacked_ref_test_custom_type_gets_unpacked_ref.assert_ta_json_schema_": {"doc_hash": "7e2a48cc092ad5ef85d4ecd7c062392335b5d11e89c22da9fe458f50f5780f63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_field_json_schema_metadata_test_field_json_schema_metadata.assert_ta_json_schema_": {"doc_hash": "a5fb6826194cbf86cf27d01673322eae83e4d6161e5405d1ef81b4d2c74c7f22"}, "/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_qualname_test_multiple_models_with_same_qualname.assert_model_c_model_json": {"doc_hash": "350e88aabf199d0798b016c1acf32adb5d5abf54b17411fccc14fc462a30d4a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_generate_definitions_for_no_ref_schemas_test_generate_definitions_for_no_ref_schemas.assert_result_": {"doc_hash": "debcc1d9bf4a3df4ecfaa2c7c71b3806f2ba9c84c1013c68e8a4bb63b7491a2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_chain_schema_test_chain_schema.None_2": {"doc_hash": "cf740eee26071c0de204b2f62aac3318a4d8afeb79aac4472d19e2df4637f2f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_deferred_json_schema_test_dollar_ref_alias.assert_MyModel_model_json": {"doc_hash": "aed3db07f5a969a02ba58d4e9cf0ac4cafc6d9a99a771648b9c890657134d240"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_multiple_parametrization_of_generic_model_test_multiple_parametrization_of_generic_model.assert_calls_1": {"doc_hash": "7d7b2331cfdae638e6bfd3e063a3dc5736ebfb5b334343f5d7e3ecf333a0f4be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_test_callable_json_schema_extra.for_key_in_abc_._default_is_not_present": {"doc_hash": "c55f57105c3e71a95eadf0f47e7289cd4ad8ca6779c10b90dfab6b1092ab1ce9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_dataclass_test_callable_json_schema_extra_dataclass.MyDataclass.f.Field_json_schema_extra_p": {"doc_hash": "a8199aeee19f44f4168454cd380955467b4abdb4f8a9aec38dd4147e103f816f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_dataclass.adapter_test_callable_json_schema_extra_dataclass.for_key_in_abcdef_._default_is_not_present": {"doc_hash": "93bdc513cb4b7bce7db3f4fc59fbc554e36322cd5fbdf762c2a8cf726763caaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_rebuild_happens_even_with_parent_classes_test_model_rebuild_happens_even_with_parent_classes.assert_module_B_model_jso": {"doc_hash": "2af63b24326fd49924aab61bee60accb091f958eee4d8efd90d2a96d266fc3d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_enum_complex_value_test_json_schema_serialization_defaults_required.assert_sdr_model_schema_": {"doc_hash": "283d231b409f28ab75a949f2891d63a40366eca3f3f06e9378355e8dc9f66b21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_mode_override_test_json_schema_mode_override.None_4": {"doc_hash": "0601307db16f52e36d78d95e8e360218c7ac6477592eb521af5f13bd96e235a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_models_json_schema_generics_test_models_json_schema_generics.assert_models_json_schema": {"doc_hash": "cf32a8f0fb0b22fd793a615943714e97d7afd2ccf12e5f9b0c173516816c6592"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_recursive_non_generic_model_test_recursive_non_generic_model.assert_Bar_model_json_sch": {"doc_hash": "d8ebc62f731d2534a56fed733579710f3e2f893b06a9a237f2b596b1ac529efc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_parent_sub_model_fixture_test_not_required.assert_exc_info_value_err": {"doc_hash": "7a9db4bf4ab11fd180da91a49bd7fd7762d7259138fd30d174b5d19306a76663"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_allow_extra_test_allow_extra.assert_m_model_dump_": {"doc_hash": "5ad70a2a429d45baf29a5d112f380f64c5a0b0c463900960a75e5d09e103e713"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_allow_extra_from_attributes_test_forbidden_extra_success.assert_m_foo_whatever": {"doc_hash": "b1fde8864abdd212926f16602215bfd7b744e8b22e2155b8056be42fcd2c9450"}, "/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_extra_allowed.assert_model_c_1": {"doc_hash": "2369848f4fd9adb461da4b63c6b0c8df5ef651204a35e9dc9626c58d4535cf74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_reassign_instance_method_with_extra_allow_test_extra_ignored.assert_model_model_extra_": {"doc_hash": "4dce80f17cb414b5585b70e77b1042854d2d3009ac244fa1c1d436221b1f0bbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_extra_is_none_when_extra_is_forbid_test_field_order.assert_list_Model_model_f": {"doc_hash": "c1ef285fa678863167af578fdf711a76c88d74ab63a3e3302cd66ecc616ebb4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_required_test_mutability.assert_m_a_11": {"doc_hash": "15cded3504c4c127f088b6c32b3d6e09199f895e6566b362747f7d2ba25b49df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_model_test_frozen_model.None_3": {"doc_hash": "07e7103acb339c78a60fa57354331789454592a6a78661482978a7f20a46d849"}, "/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.None_3": {"doc_hash": "7e89f1314e4e2faf0e6489dbe84fe62e6580e53ecc5e9f0f32ef022930c96973"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validating_assignment_fail_test_validating_assignment_fail.None_1": {"doc_hash": "435c3c90fa1b492d359d2996821b7a8628623f7ba46a6c140182851d240ab318"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_Foo_test_enum_values.None_3": {"doc_hash": "eb97d7c2c2d9cde13ba4dbc3305654f0621c46f64e68b8e09efe4e9a5de8eff1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_strict_enum_values_OtherClass.pass": {"doc_hash": "dcd40f9c67f92a898d89ec9ed7f00b147984467959cdf465e038329d035e3a57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_iteration_extra_test_model_iteration_extra.assert_dict_m_a_1": {"doc_hash": "11a611e29da55654a6d91021c6e46828b00f8c89456853796bee7aafa5aad91a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_field_with_validate_assignment_test_frozen_field_with_validate_assignment.assert_exc_info_value_err": {"doc_hash": "c7e70cbbb92a54c85417e9a15e56c4e10dbac3676be6793030301dc688155300"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_field_decl_without_default_val_test_frozen_field_decl_without_default_val.assert_Model_model_fields": {"doc_hash": "abb715b533d25e89e57312a42365bb1bbb084fa08a33bcf13aebfcdf2a4b0e75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_not_called_without_override_test_model_post_init_subclass_private_attrs.assert_calls_C_model": {"doc_hash": "768cac3b5df5e80ace7e53d9ac52847fbdcdc8e3aaa3dcee94b098baac8e67ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_post_init_subclass_setting_private_attrs_test_model_post_init_subclass_setting_private_attrs.with_pytest_raises_Attrib.assert_m__priv6_94": {"doc_hash": "09d0965aa105c2c4767f13f941340b9e5792304acfe84b2ff89780c2f10b19c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_post_init_correct_mro_test_deeper_recursive_model.assert_m_model_dump_": {"doc_hash": "81c7b757bf169c9660880fbd0b22ace1e2010539891957073c1bea21357e7f09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_rebuild_localns_test_model_rebuild_localns.with_pytest_raises_Pydant.C_model_rebuild__types_na": {"doc_hash": "8249c4975064119ee3213c7e9c785e7a89822e28ba2b75e3d5e65c4803b599cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_protected_namespace_default_test_multiple_protected_namespace.with_pytest_warns_.Model.model_config.ConfigDict_protected_name": {"doc_hash": "62a6d2de71c2039f981d9945549ace11cc8a8349c761bb6d3dca31964a124650"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_get_core_schema_test_model_get_core_schema.Model_": {"doc_hash": "a23f85206e7a31274d4c7e8f2c225e3634fd4e148464bc1dcb90f9012f29c699"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_python_from_attributes_test_validate_python_from_attributes.assert_res_ModelFromAt": {"doc_hash": "3da58188e77da12e5d63b40b3f4f22da68221673bf0ff66a8c8b0c42bc5e5f7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_strings_test_model_validate_strings.if_raises_match_is_not_No.else_.assert_Model_model_valida": {"doc_hash": "e4471fc37cd6090fbc5cf1733f2cf5a5cc7a7902446f7b1f7ada644829ce4269"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_strings_dict_test_model_signature_annotated.assert_Model___signature_": {"doc_hash": "81107f306280c6e4107da45d0ca37711ad1c4b72a50b8cf5dbf0d59c891e9873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_super_getattr_extra_test_help.assert_class_Model_in_m": {"doc_hash": "9106201ee0a469f2792b0360c10f571dfa1f3129d3220cf162352d030db870bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_cannot_use_leading_underscore_field_names_test_schema_generator_customize_type.assert_Model_x_1_x_1": {"doc_hash": "ef8cb98e7eebe9fa940d0671db7a9b1ef956e1a076c9090937f19bb24d41a6f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_schema_generator_customize_type_constraints_test_schema_generator_customize_type_constraints.assert_exc_info_value_err": {"doc_hash": "ac7c1f8aaf5c51d16ba1ce8d13c4da98fb2d303aad54b170dfc7d9c368e9de87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_schema_generator_customize_type_constraints_order_test_schema_generator_customize_type_constraints_order.assert_exc_info_value_err": {"doc_hash": "086d47092173f34416c5ad609f440e8dce73b5ee844bbb3d73a462cb9b00e15a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mongodsn_default_ports_test_mongodsn_default_ports.assert_str_m_dsn_expe": {"doc_hash": "d9e58e24c95c0ec2355cbbbf98c1a373b79cb5a1a39822e0a2d009a4d42b7f29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_json_test_ipaddress_success.assert_Model_ip_value_ip": {"doc_hash": "93b2b8e94639ec6357c77bf15e342339715e7766eaea7b7c0dc7c903a9ba394b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipvany_serialization_test_ipvany_serialization.assert_json_loads_m_model": {"doc_hash": "e2b83df71b39bf5cd3978e558eca39345259a6ca9d9a2206a4b9942970a8ac5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_dataclasses_IntWrapper.__eq__.return.self_get_other_get_": {"doc_hash": "0b13515036a95f24c914446a8b38ae0506570c1ea86ce9dd60b0e3b3ed13e45b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_test_pickle_pydantic_weakref_test_pickle_pydantic_weakref.assert_loaded_ref_out_of": {"doc_hash": "82998a8c7360450601546cb6089d3a5790777d5a8aabbad5148bd43178d91797"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableModel_test_pickle_model.with_pytest_raises_Valida.model_type_foo_hi_val_": {"doc_hash": "e0498de3cb63a4e618346c769e296ef971874e84c4afa02350ab235bd4e00325"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableNestedModel_test_pickle_nested_model.None_5": {"doc_hash": "4c1e10527fd1ac3ee09b05dc52b331a5a8ddadd1ce8f4f14cb3ba9e984c357bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableDataclass_child_dataclass_factory.return.NonImportableChildDatacla": {"doc_hash": "375b0b0d9f69d5478535353a82a8e68ada71bd365ccad83b77525a9b776478a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_test_pickle_dataclass_test_pickle_dataclass.None_7": {"doc_hash": "762490da7f1c3dd678e45d6827ba817d02c04495c90bdc51b5eef082947576c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableNestedDataclassModel_test_pickle_dataclass_nested_in_model.None_3": {"doc_hash": "9730c8d65fcbe554676648c5d374c8643e1e6514667f7f9a35f82724fa4fb0dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableModelWithConfig_": {"doc_hash": "f1f5399c438518f21e00e4764e43c6521bd51b90d142fbd23b5f3367fbc904f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_from___future___import_an_install_plugin.try_.finally_._plugins_clear_": {"doc_hash": "8acf1dba485f0a7edeb4bbb191ea9f029812ff819ec9dfe97e7630601dba2302"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_success_test_on_validate_json_on_success.CustomOnValidateJson.on_success.assert_isinstance_result_": {"doc_hash": "054bbab3ab0190bab0de8d38174419502beca6a57a197b2f3252e8d9bf0a61c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_error_test_on_validate_json_on_error.CustomOnValidateJson.on_error.assert_error_errors_inclu": {"doc_hash": "222f03c9991918ff6a28cd6986c368cb5c95a0bded90a755c4901de7eeff225a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_error.Plugin_test_on_validate_json_on_error.with_install_plugin_plugi.with_contextlib_suppress_.Model_model_validate_json": {"doc_hash": "4077e898dd1c9fffbcdb48c82a813d4ff431314a995699260e86b184b7c9f4cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_success_test_on_validate_python_on_success.CustomOnValidatePython.on_success.assert_isinstance_result_": {"doc_hash": "89fc0e59132e024c5f226fd92ace6a600a25c2281116cff9e68782e8f438e5d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_error_test_on_validate_python_on_error.CustomOnValidatePython.on_error.assert_error_errors_inclu": {"doc_hash": "e3bac79297909144a83851a34b406eeef2c784ebb6d64bf7846bb5d1176e5ab6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_stateful_plugin_test_stateful_plugin.CustomOnValidatePython.on_exception.stack_pop_": {"doc_hash": "6fd29829d39fb6246df2c09005801d0b7fd53fe2aedabc4bf5e201b459e1b4d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_stateful_plugin.Plugin_test_stateful_plugin.with_install_plugin_plugi.None_3": {"doc_hash": "5ddb4eee6d1abef866b059b9c90543e55132b0421a171cd69d4d847071d4d5bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_all_handlers_test_all_handlers.with_install_plugin_plugi.None_5": {"doc_hash": "3e2efe6e79a293fbdfa5dadd4f4dce9221392b4527cab7271142c4d74390d5c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_dataclass_test_plugin_path_dataclass.with_install_plugin_plugi.Bar.a": {"doc_hash": "c822f5d973fe7bda144d8f44b21afd4838939f770b9fbeebae69d9055837b947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_test_plugin_path_type_adapter.with_install_plugin_plugi.TypeAdapter_List_str_": {"doc_hash": "95d5a3659ca1b2dd2f46c4fec9cf00c11a771d5d2c65e7a281460f1e2c16fe23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_with_module_test_plugin_path_type_adapter_with_module.with_install_plugin_plugi.TypeAdapter_List_str_mo": {"doc_hash": "e929acef7cf8141d5c88c376dd82b88d287c152a57d61a9ea658a46c5bca9866"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_validate_call_test_plugin_path_validate_call.None_1.validate_call_my_partial_": {"doc_hash": "fafa8652017f57e2d968b5f317febebfa7c0eb348af48e6d3e9fb09234e346eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_create_model_test_plugin_path_create_model.with_install_plugin_plugi.create_model_FooModel_": {"doc_hash": "1241f4877fb467425c27c08884536570161246d06cd61c116430fc0cd50bd5e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_complex_": {"doc_hash": "5c8b25a0b1aac803b59b999c4bf3e3926115042ff6e31404d7bb0c58f1dad28a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_functools_test_private_attribute.assert_m___dict___": {"doc_hash": "72eb9c3334dce858f78d2d3dab59a5bf0c1be9454b9de86d50b971c1b0bfafdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_private_attribute_double_leading_underscore_test_private_attribute_double_leading_underscore.assert_m___dict___": {"doc_hash": "9d747c405acae5bc825b00a721a9b84412144610d702a70dbd072b3733081b9a"}, "/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": "38c52d90bce60411e8fc8d07b7fb6bf5f6680816260acf5d8b7f52ecf28fc23b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_layout_compatible_multiple_private_parents_test_layout_compatible_multiple_private_parents.assert_m__private_2": {"doc_hash": "8658754d721dc4e972928a005feb32ad62be148400fa69f522d4edd558eb0475"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_unannotated_private_attr_": {"doc_hash": "d9cca477d3789eca13fa8b82d0f5b43b84b93eeda97bfae2c1b6050bd701fd42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_pickle_from_pydantic_import_": {"doc_hash": "68dc9b7cdd87721aeadb1165f885b4bd21b2a36d98498c639d7e6d96e5639d9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_parametrize_root_model_parametrize_root_model.return.pytest_mark_parametrize_": {"doc_hash": "3fdf0bbc52b25593e984a81d7042623d8cd80855d1a046bf14af40750516e29b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_check_schema_test_root_model_recursive.assert_repr_A_model_valid": {"doc_hash": "70e5f260f4484fe3185a41d0314814d239298d225eb58ce515b7bed1c94a065c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_v1_compatibility_serializer_test_v1_compatibility_serializer.with_pytest_warns_Pydanti.assert_m_dict_my_r": {"doc_hash": "5cdd35b2c787d65e1565a78ec8d65758739516d961fa892fb0c8f82c693fc5f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_dump_with_base_model_test_root_model_dump_with_base_model.assert_m_model_dump_json_": {"doc_hash": "10c46380458547b8e566904c52bfbdeb17b55f602ddd66dd87b9237f8fc85073"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_mixed_discriminated_union_test_mixed_discriminated_union.assert_Model_data_mode": {"doc_hash": "86cdaaa0db279f15649a7475e7f8506f362945d5b1db0cdc78eed06863f925bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_list_rootmodel_test_list_rootmodel.assert_obj_model_dump_": {"doc_hash": "b14fc807a4e794531cb848bc68cf43efd6749626df8cadb5c4ac97ad49f60fad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_and_data_error_test_copy_preserves_equality.assert_model_deepcopie": {"doc_hash": "793b8db2f975058e2c29fdf0925aac450914b1c6e51cf4a090432561711eb7ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_model_validate_strings_": {"doc_hash": "7d8d955a6d6ff12fc0131c9bd38bf469d06e82f9e8cadde5e16929c8478367d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_as_any_test_serialize_as_any.assert_json_loads_OuterMo": {"doc_hash": "36532bcbb7b8d4cd162e5f2a3bf64f63da14dcd279545df5238fc359a859ef78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_forward_ref_for_serializers_test_forward_ref_for_serializers.assert_Model_model_json_s": {"doc_hash": "3765616c9f8d937d5c2a9dae1fc29e1b84a9050ae51d7e1d629e4b9665281be8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_forward_ref_for_computed_fields_test_forward_ref_for_computed_fields.assert_Model_x_1_model_d": {"doc_hash": "fdd8646aab0c5016cadcf4a07661a28cae6ab2268df068c3c571d02de39a8de0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_computed_field_custom_serializer_test_computed_field_custom_serializer.assert_json_loads_m_model": {"doc_hash": "eefca11a9824ddd0dd53b0ac38f8c43f3c0e3a61aeebb75aa1b23636b0c3292f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_annotated_computed_field_custom_serializer_test_annotated_computed_field_custom_serializer.Model.quadruple_x_plus_one.return.self_two_x_2": {"doc_hash": "5f273cc12fd7166a5ee9c7b89885296c480acea4b4dbb9682b9ec67f740079b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_annotated_computed_field_custom_serializer.m_test_annotated_computed_field_custom_serializer.assert_Model_model_json_s": {"doc_hash": "d9bb5922b12345e4875d02d4a53ecea910ad6c967461992c543f0d77210b819d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_computed_field_custom_serializer_bad_signature_test_computed_field_custom_serializer_bad_signature.with_pytest_raises_Pydant.Model.ser_two_x_bad_signature.return.f_The_double_of_x_is_v_": {"doc_hash": "971336e682e95dbc9ffc60c4c0e5bc878f0443c505c0924c108b98d98bc9158e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_forward_ref_for_classmethod_computed_fields_test_enum_as_dict_key.assert_MyModel_foo_MyEnu": {"doc_hash": "1e217e1b905aac1270cf4b6b662eb2bb221869f057619506a46ecefb82b53e56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_subclass_support_unions_test_subclass_support_unions.assert_s_model_dump_": {"doc_hash": "321faa336372588c0fc786de33c869849ab22a2f4748ef609fa54c236e03f6a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_subclass_support_unions_with_forward_ref_": {"doc_hash": "80ee4a0249e236c3e2c04a101f4dbc0474fee0fc979bbadfa2fb6bac8420652a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_python_from_attributes_test_validate_python_from_attributes.assert_res_ModelFromAt": {"doc_hash": "b1a08cf00522e420951faae438c3576ed9901c425d491834e2b4ed3f42321cf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_generic_type_alias_annotated_defs_test_recursive_generic_type_alias_annotated_defs.assert_t_json_schema_": {"doc_hash": "1b5714360894d0b1c1fd236e4922cb3c9eb2e0509f7f496c98efb58bd0f36bb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_field_test_field.assert_ta_json_schema_": {"doc_hash": "4103cb0f5ffd976fa7563e70fbc966d6967b1cc08cf6109548b25b0c02013d02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_collections_test_constrained_list_optional.assert_Model_req_a_o": {"doc_hash": "1c7122706afb856b71743b36dbeef589b0d071befef905078f8e8015446f34d9"}, "/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_set_optional.assert_Model_req_a_o": {"doc_hash": "14022c2b9e4218fb0a823513fd84cc7ebf99d2757d43b065534e84c364546dff"}, "/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_str_default.assert_m_v_foobar_": {"doc_hash": "54205c40a2bf222fdf6640b3d258d0ef517007a78f9e099e136cebe8446ccf44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constrained_str_too_long_test_constrained_str_max_length_0.assert_exc_info_value_err": {"doc_hash": "b87972df16828d71960aeb1852de64bb8272334ab6ecf6d7e5ec018d1450c344"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_fails_test_set_success.assert_Model_v_value_v_": {"doc_hash": "7afbcbcab4ee319eb43e7309f8b74858110e1b3cf35d8b242893fcc1e4718502"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_set_fails_test_sequence_generator_fails.assert_exc_info_value_err": {"doc_hash": "0e9954857c0d66a999234d5e47b0d88ddbdd29042ce6c2b1275a659a70e2155d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_sequence_fails_test_float_validation._insert_assert_exc_info_": {"doc_hash": "476a577cf60207cd2535298e602eb7f4ecfb765cf24fbb3fd8c93a43bc0a8d76"}, "/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_bool_unhashable_fails.assert_exc_info_value_err": {"doc_hash": "0edbaf36fbd5fae654b976bd1edbf23a43d5463a6917ddc551447e40944338d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_error_test_uuid_validation.None_2": {"doc_hash": "95d2e63828cfafe03121b784cdefc77485ae8f5967656aa1719431a38f8caa0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_uuid_strict_test_path_strict_override.assert_m_x_Path_foo_": {"doc_hash": "968de89c2e652dec5b688a7cf6b529440974d4280eed93ec5f16f39e9af12167"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_path_validation_fails_test_new_type_success.assert_m_model_dump_": {"doc_hash": "7d1341c74aeaba956db28ed78576df4ee48649913f298bd37ea37ecd7bd97a24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_new_type_fails_test_json_required.None_1.JsonRequired_": {"doc_hash": "28db34a22c156bd92a276def5870930a5ca6e3ad23a30556cc8285c7a2009f1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_namedtuple_postponed_annotation_test_namedtuple_arbitrary_type.with_pytest_raises_Pydant.ModelNoArbitraryTypes.x": {"doc_hash": "6fa9c1cb016200f6b4db2b29b998f4a9043b3142efb99e934b7a4a5b7f350245"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_recursive_namedtuple_test_recursive_namedtuple.assert_exc_info_value_err": {"doc_hash": "4819b24977d8207677838fe7b5f3d76413db2d0a0c3100725b37c1aa9c6e7d48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_model_serializer_test_typeddict_model_serializer.assert_ta_dump_python_Mod": {"doc_hash": "d2928d767d8705633c62268c27862d8dea8216096a4a2b1d1aca2dbd0821314a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_model_config_test_schema_generator.assert_ta_validate_python": {"doc_hash": "5f137e56bdbd200f08a3b9d74944ac29e461bf77ed4de7c2b5df3b8dc48c9802"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_grandparent_config_": {"doc_hash": "0e37f79fe015894cba2377e01444189b49555c5f72cc71df919b144a719af7ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_partial_test_positional_and_keyword_with_same_name.assert_module_f_1_a_2_": {"doc_hash": "80ae3d3804ddea3d9925736726b33d0f9c843345b90f2390c49058ccb75b3d38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_model_as_arg_test_model_as_arg.assert_res_x_1_": {"doc_hash": "71846de3b01e868e8bef2515942e674fe839ceed4a8eaf34e072b1d52d93264e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_do_not_call_repr_on_validate_call_test_classmethod_order_error.with_pytest_raises_.A.method.pass": {"doc_hash": "ff6889ec75cf98ad1e3566722c7adacbbcec2ebf9501c7c68cb998bc202612f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_async_func_test_async_func.assert_exc_info_value_err": {"doc_hash": "d72cfe1d6fdf425a7dd35c2299bf6528eac51346e7d4949580b38f78383f4047"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_contextlib_test_annotated_validator_before.None_2": {"doc_hash": "9e83b8b727205152e018632934a825c137b326c1e498a950dadb728e61d77b8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_builtin_test_annotated_validator_plain.assert_Model_x_2_x_": {"doc_hash": "71d80e0139260885b2752d930aa903b90c3ea8e22ed9b3d63aef03bc80c5ef1f"}, "/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_Pydanti.check_fields.return.v": {"doc_hash": "d99fb7ab3ef17af112d6ab7b4e128dd57274c49ef0a547616fc62502fb5fdbae"}, "/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.with_pytest_warns_Pydanti.example_root_validator2.return.dict_values_c_changed_": {"doc_hash": "377d31a499279f2e1c407552e4051410f9411aed4fd76948202dd9ec97754b7a"}, "/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.Model.with_pytest_warns_Pydanti.root_validator.return._a_42_b_changed_": {"doc_hash": "b4f990313011480cb97487e59fac32c73764f042a000bc9cb7d767dab7ca5e66"}, "/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.with_pytest_warns_Pydanti.example_root_validator.root_validator_skip_on_fa": {"doc_hash": "9729f4dc88e964f1aa9278ce2faa0980fb58f92ae2b535286c9115afe0c34741"}, "/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.with_pytest_warns_.Model.root_val.return.values": {"doc_hash": "17ab52705ee66bb4608e5ada138809c89adee816efc9ca64ee32d5caface71dc"}, "/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.with_pytest_warns_.Model.root_val.return.values": {"doc_hash": "a229e4b9a6ed17586e8767bb044c74a4ffd897d89d985e8bab1ed9ca4c9b316f"}, "/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_Pydanti.with_pytest_raises_TypeEr.Model.check_a._": {"doc_hash": "468adb1fa2ecc3bab5504591f5efeadfa7d92f7bec72a40b9c5234114564f229"}, "/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_Pydanti.with_pytest_raises_TypeEr.Model.check_b._": {"doc_hash": "3fb6575fd0cb59da8e7d8452c059f9e2cf2c97cb53494d2bff67eb8a05c8c87c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partialmethod_validator_v1_test_functools_partialmethod_validator_v1.with_pytest_warns_Pydanti.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "cb64e48763d00c351d3329b8bf1632385a2c470de57e645a496c151522e0ac7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_function_error_hide_input_test_validator_function_error_hide_input.with_pytest_raises_Valida.Model_x_123_": {"doc_hash": "ff187b88bfbf5697ba5485a28a1c6a988027afaf73c22933fb1241a7d7fa3de6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_foobar_validate_test_before_validator_field_name.assert_m_foobar_valu": {"doc_hash": "5b81f2375bdf104e1fab41a6f2fdac1f46d6116dacb7b4c40b0d296fe642c230"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_plain_validator_field_name_test_wrap_validator_field_name.assert_m_foobar_valu": {"doc_hash": "bbc6aaf3d7c4663535ce2567f765603e5636e07d462c59db24c2ffd66b887b1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_default_raises_for_basemodel_test_validate_default_raises_for_basemodel.assert_exc_info_value_err": {"doc_hash": "2caa1f7dc3d9731b6760dac71f97b98b94399bbe741e3636e2ae97f2aba06538"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_warnings.py_from_pydantic_import_Pyda_": {"doc_hash": "7ae86e7ee11e6c1dfd88ec975654b548b28d9fa865a64182856f0304a57b9e9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapperStack_ConfigWrapperStack.push.try_.finally_.self__config_wrapper_stac": {"doc_hash": "bfcff2d6d02268ab5f171eefef98e0720aab6a93d461484094666a874228e2a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_complete_dataclass_complete_dataclass.cls.__pydantic_core_schema__.schema": {"doc_hash": "7eeb042de8a8928105cad19567e8aafeee4081273061441445cda02965eb29dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_complete_dataclass.cls.__pydantic_validator___complete_dataclass.return.True": {"doc_hash": "2be684f377be773b2b612359aabc257462e472a54c08a3e39783885bee9fde69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py__Logic_related_to_valid_if_TYPE_CHECKING_.FieldValidatorModes": {"doc_hash": "48073873bbc7c4eaaa1f9c760ddddfe2d93c68e69e2543d096a76f8619e27cc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._computed_field_schema.set_computed_field_metadata_GenerateSchema._computed_field_schema.return.core_schema_computed_fiel": {"doc_hash": "b3ff51a88e12a424da4409d6c2acf3483bf8720c84305777a5ca4c029889f92a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_get_json_schema_update_func_get_json_schema_update_func.return.json_schema_update_func": {"doc_hash": "1d032faa0930e864a164009d031bf3cd731228dab3a54ea1f57345fbfcd06610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_add_json_schema_extra__CommonField.metadata": {"doc_hash": "7fe5f06f1b5abf05916cf3cf30b4c027ee3ef924d529c524db20ee16414afbf4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__common_field__common_field.return._": {"doc_hash": "82d9de71298088f3893467cd7605ffde5d1e1a2532f804aa2c1443d83b02b485"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_resolve_original_schema_": {"doc_hash": "8d9f0170ccd83f90e9bf76d740fa85458745016bae3b662561ad0a1f0477fdd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_from___future___import_an__GENERIC_TYPES_CACHE.GenericTypesCache_": {"doc_hash": "66c2e0e22d9320606607ec84b38fae5916ad90ac5852f0bca57ef4cddd920cdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_PydanticGenericMetadata_create_generic_submodel.return.created_model": {"doc_hash": "1914eb6a384586087027c655eb8e823ad49d84234c49a6c266f8e8f5e18076ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_git.py__Git_utilities_adopted_": {"doc_hash": "96e01207973eda597bcd922142709e3efd516c4935dc997271316cb279fe4306"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass._collect_bases_data_ModelMetaclass._collect_bases_data.return.field_names_class_vars_": {"doc_hash": "13a086baa4e8e48e2dd9cab58262cb87b7eac41fa794421d17409786e9e26d2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass.__fields___ModelMetaclass.__dir__.return.attributes": {"doc_hash": "c4dac687bd69ec3bd68e2b274c15f2f8d6971e3faabd072da4be0bbd1ebe03ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace.for_var_name_value_in_li_inspect_namespace.for_var_name_value_in_li.if_var_name_model_con.elif_var_name_not_in_raw_.if_var_name_in_base_class.else_.raise_PydanticUserError_": {"doc_hash": "097f50bd501ce4bc6baa9522d2d1f20d061e5a0a0f3ace1f87d3bb7ae7808022"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace.for_ann_name_ann_type_in_inspect_namespace.return.private_attributes": {"doc_hash": "3a237e7915a38b78a75ea917fc0885cc54e990692920ff90c361e0de2cca06e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_set_default_hash_func_set_default_hash_func.if_base_hash_func_in_Non.cls.__hash__.new_hash_func": {"doc_hash": "3306c56565effd422a484e981271602703c854d8b85dc2bd62851253077d1e51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_make_hash_func_make_hash_func.return.hash_func": {"doc_hash": "f427f78db7e7f4c109255aa801b4346dc19b2a7dadcb925bfb4627c48744bbf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__PydanticWeakRef__PydanticWeakRef.__reduce__.return._PydanticWeakRef_self_": {"doc_hash": "40c4f2374580fbcac34e624f7097f12f078f1b1de1d80c55dce5c093be665b81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__SENTINEL_all_identical.return.True": {"doc_hash": "d566207cede9a8a71c167d078f29994b2fa4e53901ea0596d958e14e572b9bd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_SafeGetItemProxy_": {"doc_hash": "cdb14d7d2c1b36290260e90ef27fd4711b587498eb5dd349cd93f222af947b0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py__Support_for_alias_conf_AliasPath.convert_to_aliases.return.self_path": {"doc_hash": "f12178adb8e87efaed7d2e7a43890eadee7bb98fe5f7d44fe0834f284349fe06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasChoices_AliasChoices.convert_to_aliases.return.aliases": {"doc_hash": "c54656423614baa6326139d06b2d8b72a3717c75d672abbc7a2e8367767145a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator_AliasGenerator.serialization_alias.None": {"doc_hash": "d1dc6dd1ef9d35d41cd335ea19e6b201d1cc0104fa6ba819a8ffc4e4e7e43913"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator._generate_alias_AliasGenerator._generate_alias.return.alias": {"doc_hash": "03a7411536a41327bcc81abf75fa74255dce0a673e30693b4c5b616cf7d76066"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator.generate_aliases_": {"doc_hash": "251f557090ca1b6f9892bf85f0900e70959fb898542197aee8aebf01280bafd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_15_ConfigDict.json_encoders": {"doc_hash": "115a143a23410d24dccdaf329dfe75d15b976f216582ef48c2db252d61b6b6c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_19_ConfigDict.revalidate_instances": {"doc_hash": "88645e98bf1230371311bea4dde0357c52a870574a4be20a96b20dd40d8b2e9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.ser_json_timedelta_ConfigDict.protected_namespaces": {"doc_hash": "2b4209232f0e76e47d330f4c19288092dda415ffb87849e96d2ed360502cdbb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_30_ConfigDict.defer_build": {"doc_hash": "d1421479e0f2521c0e82f80cedfb3a2dd843ceb3ebe2dd685e2246262de3f539"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_32_ConfigDict.json_schema_mode_override": {"doc_hash": "c3a424516976f55da15290e30723c721cf93677e5f093564acdecf817c1a37bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_36_ConfigDict.regex_engine": {"doc_hash": "e297d2b35755ec378a401cac8fde39becc80b110fc82c8e0a57ae32570ce1ba9"}, "/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.FieldInfo_default_default": {"doc_hash": "b59ee9d12b1d1d9c23d6d35d016a987918bd760e86a5fc699bfe7b9825dfa1c4"}, "/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.FieldInfo_annotation_anno": {"doc_hash": "6cd88f2d5642e523226d374d880ff30c01beda1b9231b95130afc3064d2bd62f"}, "/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_Fi.else_.return.FieldInfo_annotation_anno": {"doc_hash": "94c1d7e6c4957e396fd057b4b5b51581b03397ff1f3f1d91ed32fa63622ece61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__wrapped_property_is_private_PropertyT.typing_TypeVar_PropertyT": {"doc_hash": "08221efee5bb4a98502aa33a625e49d7552704d897ca1e977f31580f3483b4ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_computed_field_4._": {"doc_hash": "ada86447bfea95b8d5a43f424596e4be981085b1e95848a18f28e9ec17946254"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_5_computed_field_5._Usage_docs_https_do": {"doc_hash": "e5381437d5feaf435d6b9f62c456e68b0ea3678446fd745454313d553df573ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_FreeModelBeforeValidatorWithoutInfo_FreeModelBeforeValidatorWithoutInfo.__call__._": {"doc_hash": "13e1ae15802b63140e6880744b23510d2b7c01beee98b81987ceeda8b68084d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_FreeModelBeforeValidator_FreeModelBeforeValidator.__call__._": {"doc_hash": "30b127e00b5cc5fe686b46be6f4efb543e9f253b322ea632c6b9787736ffabc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelClassVar_PydanticModelClassVar.serialize.return._": {"doc_hash": "2b6a9b1b4efbc0c5a94c8deee8f042dc9ee92a2a434061da1c9219b823b5bb38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_fields_and_class_vars_PydanticModelTransformer.collect_fields_and_class_vars.return.list_found_fields_values_": {"doc_hash": "4e648e4934c81fcc3d1edc3bb58cf2ca50d2b8e94e20e8b1ea0f521fbe118b54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_or_class_var_from_stmt_PydanticModelTransformer.collect_field_or_class_var_from_stmt.node_type.get_proper_type_node_type": {"doc_hash": "f2c39db152062cbaa66ab12e9c44295e1477494c94eb711996419c704e1a2583"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_or_class_var_from_stmt.if_isinstance_node_type__PydanticModelTransformer.collect_field_or_class_var_from_stmt.return.PydanticModelField_": {"doc_hash": "3adefde093fa5f2d4bd34e8de7fa744bbccfe18d372a39b4ad400bd0c7f1495d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__Type_adapter_specifica_if_TYPE_CHECKING_.IncEx.Union_Set_int_Set_str_": {"doc_hash": "c9bb1eb3361291fec8ee7587b92ad39869e84c8da63112729fc80f0432fe8aca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__The_types_module_conta_T.TypeVar_T_": {"doc_hash": "8f6193391d9c1a3e21dfdc2a6fb28e47e974aee062a6caf302ac3804cf9ac239"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Discriminator_Discriminator._Type_to_use_in_custom": {"doc_hash": "535196d8e03405bf2dc7b784dcc12e1ba3386b93a499f1e7c3b79e87fbd050e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Discriminator.custom_error_message_Discriminator.__get_pydantic_core_schema__.if_isinstance_self_discri.else_.return.self__convert_schema_orig": {"doc_hash": "12351615148c9ace493862039f2c75af80094daddc79cc1f8c07bfaf24cf568d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Discriminator._convert_schema_Discriminator._convert_schema.return.core_schema_tagged_union_": {"doc_hash": "e6aaea9d9e30b250b182c4fd79a618ab880a59826a5398f6c2a5900ff98e16ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__JSON_TYPES__get_type_name.return.getattr_type____name___": {"doc_hash": "b543785780b4842f7511a1479c16968cf39c3814624e05167ebe1c62bb42a761"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__AllowAnyJson_": {"doc_hash": "5d715dbda2d44dcde24b3ed793833541e89a02d5c0aa055fa6add0ff4cc0604a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_from___future___import_an_PYDANTIC_VERSION.metadata_version_pydanti": {"doc_hash": "489806f4ba1f0e499356af018e727ac7fb3e7aeaf411368a1eaf7d0856fa0fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py__New_implementation_of_p_OldImplementationModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"doc_hash": "2ea0fd5b5bfac20d1460885c2ef3fa7db5f9396c3d72b700695c6afe055eeea8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_DictComprehensionEqModel_DictComprehensionEqModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"doc_hash": "494c1d625008a1e938e3b2cfa37feb9b67ccd00cd94aa16e039ccf79294ad398"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModel_ItemGetterEqModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"doc_hash": "cbb78f425290fd8c49450369c5762c002ffa3b07ccd480ec04d13a68e92630bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModelFastPath_ItemGetterEqModelFastPath.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"doc_hash": "9af048555338eb90b990f995cc3fd3d5bcb8e8898de7491824fd924b89a326ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_K__SafeGetItemProxy.__contains__.return.self_wrapped___contains__": {"doc_hash": "50859ff5be21ae80a63a56494ae4e1d813ce04c267a9e34b5ea8a09d5390d201"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_SafeItemGetterEqModelFastPath_SafeItemGetterEqModelFastPath.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"doc_hash": "4ea9c9dbca626e739da56b2982c96fd570573ae55dc3de35edd17b4a4572100e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModelFastPathFallback_ItemGetterEqModelFastPathFallback.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"doc_hash": "f9a471ba0b0d88c6c7d7660921e38cb8b879a30aaea25ff21ae48c1788d42fd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_IMPLEMENTATIONS_IMPLEMENTATIONS._": {"doc_hash": "9390a68d78d3d3f823516b3223b2ab1a47f8158d096863b9202e34b2e5996322"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py__Benchmark_running_plo_plot_all_benchmark.return.fig": {"doc_hash": "92c596aeb722b9be9a8d5ca30142c24813594128d09075b9c451103add6de0b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_plot_benchmark_SizedIterable.pass": {"doc_hash": "b9fc3a2623b62c98f4fecd4dcc2c964f2e0a9484b962dc5fe825ace9c12d889e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_nodiff_run_benchmark_nodiff.return.run_benchmark_": {"doc_hash": "7d3fe4a61e9733a0a8cc4c967435f1980d18bec1ea227673b5429d6489e92815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_first_diff_run_benchmark_first_diff.return.run_benchmark_": {"doc_hash": "d9877367129b9d60154de55c8e63e000e9e1b5b36322e1af4860ea6ff385316e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_last_diff_run_benchmark_last_diff.return.run_benchmark_": {"doc_hash": "3a30e3caa888ca9cea6bf69c8952db253e32e1b23a590e616b029ea9e21943a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_random_unequal_run_benchmark_random_unequal.return.times": {"doc_hash": "9154b73f4c3e19383a0a9f6a36d85b51fc749d66855e548530f456e023594d7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_BENCHMARKS_run_benchmark.return.np_asarray_times_dtype_f": {"doc_hash": "1853dde98718daf1d29d0222add69495e5440407cc11726bce747d61513c142c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_if___name_____main____": {"doc_hash": "aa6ba14cd7f090eb3c3339a87bd069f2ed6fa6037d7ebb86fd2a6c7a0c81eb81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_north_star.py__NORTH_STAR_DATA_PATH_": {"doc_hash": "3fa9ccb7c3e93d2d1d260ed73978cc85138ceaa9b6341046a1bb85edd9dddd1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_create_module_create_module.return.run": {"doc_hash": "366b33a87fb63b7c4418324f7103e6e55badd4d96c3b69748f4f2075689c88b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_subprocess_run_code_": {"doc_hash": "1c0be31f21431d357bb2069649452a5a835745020fe46433f51ec945ea6e9005"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x": {"doc_hash": "455c6185f9601d7739f5fd34bea19a9987933e12293a9ae213a8309554aad641"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_": {"doc_hash": "9928e0deeed2b431d8163780a1ae2da15f05dd43eaab11ae22ff33376050b4b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_": {"doc_hash": "5dcb8cec6b6589cbc349f439b91507d6b82c4ad3308e0df88cf2d827018a7ec8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py_NotFrozenModel_": {"doc_hash": "e1d057d7e43aed1837e2abadfa73d46d9e3b948c458f0e2464bd306dc7fb90d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x": {"doc_hash": "ba22ef7eb891095772d0e80cf96769c595ffba65c7e8b7886928140d5252a6c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_": {"doc_hash": "5ecdecc1cf25f81ef95674f111dc4644c7c892930d4fc6bcefd40ff7ad6a8a4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py_NotFrozenModel_": {"doc_hash": "3d21818b4c7936db080c0dd58b45a6e5789207e1ca187efc0f60c58ca4403816"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x": {"doc_hash": "7832e96d1edd2058878db9d3f5327f7c9dc9483aee53c28a057eb14c54bcdacf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I__.NestedModel_Model": {"doc_hash": "64ffa9b7b8a0852d129875b14d28e6c319c160291a8e45b5fbcac3fe52546cd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_DynamicModel.create_model_DynamicMode": {"doc_hash": "32a83241f95375de3011e8fdd880d6addeeab9eed6ea757c34e9a4eb131e1470"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success.py_dynamic_model_": {"doc_hash": "3ee4d085ddb471f567605ee1bfc77dbb33bb7675d3b7dbcbfda2b592faa3eefe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_DynamicModel.create_model_DynamicMode": {"doc_hash": "69dbb469ef1efd01b6c6c7bb046d6725a038bba9fa1d2c640fe0cc7f4e8fa3a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_dynamic_model_get_my_custom_validator.return.my_custom_validator": {"doc_hash": "3b6f9acf50b36b7fb1e802efb7d96a13e88056115f7959443638e0ea49527835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_parent_upper_alias_generator._": {"doc_hash": "e0afdf5e746e3387cfa8876506662c4eb060b2177079818e3f23d8cae1302219"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_on_parent_test_alias_generator_on_parent.None_4": {"doc_hash": "16c314e21f7ca4fce9ed5eedb15bfce68ec1329767f7d8606e5c1813147a9d03"}, "/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_alias_generator_on_child.None_1": {"doc_hash": "bfea1596dd51a5dff8a6ef0943c5c9f583acd86391f392fb27e91ef367fbbff8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_used_by_default_test_alias_generator_used_by_default.Model.g.Field_alias_g_alias": {"doc_hash": "52aca10a45c773e73b65c4726df521284b70a9e1490154b175c9f6ba57291abc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_parse_data_test_validation_alias_parse_data.assert_exc_info_value_err": {"doc_hash": "1688ad6963254d60fd164656c29a5089de35b7389a903c26485d90a6f9f1a77f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_28_test_alias_generator_with_positional_arg.None_2": {"doc_hash": "0f6a84dbac357155c3ac1a6959b88126942d1cce1ff5b172f2d1530e6c9e4295"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_with_computed_field_test_alias_generator_with_invalid_callables.for_alias_kind_in_valid.with_pytest_raises_.Foo.model_config.ConfigDict_alias_generato": {"doc_hash": "e09bdc377b7d0f729da5f9def2a16375fffc3ab1b9a274729c307a2aa8ef80b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_field_info_not_lost_from_forwardref_test_annotated_field_info_not_lost_from_forwardref.assert_exc_info_value_err": {"doc_hash": "efbcf981d16dc3e384a8a1ae6c86905186de6df80012b83d3eb052a544537d7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_json_schema_test_computed_fields_json_schema.Rectangle.double_width.return.self_width_2": {"doc_hash": "ed63e27f3bee185be8b2043dabf12012f9c37246c2cd66b9eb33e2efb624252e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_json_schema.assert_Rectangle_model_js_test_computed_fields_json_schema.assert_Rectangle_model_js": {"doc_hash": "0965b1cc2b569918f579ea1181ef99e2ed2fad5e8d72bca7c93af291fc3fc354"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_initvar_test_derived_field_from_initvar.with_pytest_raises_Valida.DerivedWithInitVar_Not_A": {"doc_hash": "ba3cbd966cea2eb0cf7c6c5c28d2b9b86a1b2939e93d8e9c5b381f5227c7e1de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_fields_set_test_fields_dir.assert___fields___not_i": {"doc_hash": "e7987e9d8a88997a6af226eb1bb11050a10590e6a96f567829eb4985d4dad930"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_extra_used_as_enum_test_extra_used_as_enum.with_pytest_warns_.assert_getattr_Extra_att": {"doc_hash": "9d5917153f0599f13897cc18935faee0326d934523a4847d8fd66fd41a25b142"}, "/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_3.Model_model_validate_pe": {"doc_hash": "7b58e876a969a22ee7da1c36f95921a11c1696df937be8fa7479c0538039d4f3"}, "/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_3_test_discriminated_union_validation.None_7": {"doc_hash": "9a6d543a10325247b86d4d6a9f22e89364ed6f659e383b71024edccdc53c76cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_recursive_test_callable_discriminated_union_recursive.None_2.DiscriminatedModel_model_": {"doc_hash": "2cf4db37c3584e882aad8584a29ba5039b9823ccdff553ff214a9c1987eb0942"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_recursive.None_2_test_callable_discriminated_union_recursive.assert_m_model_dump_": {"doc_hash": "df7c5a99f29cff6ef3eeb5f5e3a0b3c104563c5ed78d7052231e2a66c09425be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_functools_from_pydantic_functional_": {"doc_hash": "579528f3f93abf6a8410d3aae49621af7674b518bfddfb818279c9aef8416a1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_root_models_in_discriminated_union_test_recursive_root_models_in_discriminated_union.assert_Outer_model_json_s": {"doc_hash": "4654f61b4329b9fba89712ea128a4d87dc736ea5e1542788f170c1c9095684a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_eq_with_cached_property_": {"doc_hash": "016d5512f3c3d55ae1d3a1a39c0591dd440dffe9bbc23aa9ec1300fddda34b70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py__language_Python_": {"doc_hash": "f3e480ad7ffec66731c9fb8d1a80819e3d0b2e7c905ba4eb05a9c126d5f3e197"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_module_with_colon_in_name_test_module_with_colon_in_name.assert_v_schema_": {"doc_hash": "023a523fb193f192cbfa229860232c6aa28f3974a3c937168ab35840dac54ffd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_not_frozen_are_not_hashable_test_hash_function_give_different_result_for_different_object.assert_hash_m_hash_m3": {"doc_hash": "089376f46c730e086be8ab8bd77d4a340771842afdc8e603b4adf838fd93c0e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_hash_function_works_when_instance_dict_modified_test_hash_function_works_when_instance_dict_modified.hash_m_": {"doc_hash": "8b2738ff8ff986341c088c5fdb9e36630d42af6d29cb9403318f45a775a527a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_hash_function_overrides_default_hash_function_test_hash_method_is_inherited_for_frozen_models.None_1": {"doc_hash": "0229fa3643665aa7b68952f6a2b1d4598827bb703b2503a58584b15a976c1dfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_copy_extra_test_model_copy_extra.assert_m5_model_extra_": {"doc_hash": "ac7c73a98a12fe64477531320482788a698df9a3e7aba4c2dab2caa0e06cf16d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_parametrized_name_not_generic_test_model_equality_generics.for_m1_in_models_.for_m2_in_models_.assert_hash_m3_hash_m": {"doc_hash": "d0f301bd7bf07c8cc549de53d6cee320046ce9dbb360bcd296770b9d86f2dfb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_nats_dsns_test_nats_dsns.assert_str_Model_dsn_dsn_": {"doc_hash": "da6976a601313c3d91a0840117f2eb0525381452cc165bd42388935b7fd33fcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_success.CustomPlugin_test_on_validate_json_on_success.with_install_plugin_plugi.assert_Model___pydantic_v": {"doc_hash": "d530fbcd924d7c6002bbe9845d1a439389dc8ee2eda83177562de9df0a419947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_success.Plugin_test_on_validate_python_on_success.with_install_plugin_plugi.None_1": {"doc_hash": "25bc4b4f4d9ebaddf91a9db4f9768052769fd141d54765f9e4c142db9a19f622"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_error.Plugin_test_on_validate_python_on_error.with_install_plugin_plugi.assert_Model_model_valida": {"doc_hash": "f326979612d6b01ddb3e69cee090a62a533baa29e00df30fe5a0cc6aca9ced61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_nested_generic_type_alias_type_test_nested_generic_type_alias_type.assert_model_model_json_s": {"doc_hash": "5e0b94f4db462597bb59731c5032390b1ecc79b338999d85abb5a8ca182ae824"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_json_schema_test_json_schema.None_12": {"doc_hash": "734a950cf42f74469dbe48a7963582d127e580cb151ec25e3f30e7ada87f23d4"}, "/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_validator_x_": {"doc_hash": "a0a0d0afb44d5c7bf37794ad51b0bf635ab1cfa6f7ee4e02e4aaac6e50f2d9c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_version.py_from_unittest_mock_import_": {"doc_hash": "01f9e8d3d4f0fd9066e77e4f8f1efc14344c8f6ca053f0d0353db0f98b5fea20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_conversion_table_build_conversion_table.return.markdown": {"doc_hash": "14fdce8bc1ede7117e18351d82be7f6bfcb6d281c571a30ae5e9a2471093dbe9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_devtools_example_maintainers_template.Template_": {"doc_hash": "7b8f75db1aa4f373092e06872b5deb15a03c9450f54e9dff672242cc27cba700"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_populate_pydantic_people_": {"doc_hash": "d9bab2530e400992df49654a822960330da9af7631d251fcfe10dbfd949153ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validate_call.py_from___future___import_an_": {"doc_hash": "a9293199bdfaa38659628d9b3c73b4cb633af00b579525fc16c07dbc4d1d0747"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__getattr_no_parents__type_has_config.try_.except_TypeError_.return.False": {"doc_hash": "f4abe7b6fa68c4eba40b163dbcbc384f4642fbf3ed2f487d2191a76beb476cfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py_validate_call_2_validate_call_2._Usage_docs_https_do": {"doc_hash": "96bb2d319769d246a8c505cd25ece0ce0fd31fd15ef311ae97ab7b4ebb6875e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py_validate_call_2.validate_": {"doc_hash": "085f85dfe206341fdbb2b80f001b0ce08c0afc6d597140dde21d618bc80e7619"}, "/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_multi_inheritance.assert_FooModel___orig_ba": {"doc_hash": "0ff82adc8efac8be31b69a5dd995ef33a45e722936b293f2ea0c997f52dbfd3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_must_not_reset_parent_namespace_test_create_model_must_not_reset_parent_namespace.assert_exc_info_value_err": {"doc_hash": "f878d677373f91784a5d7d7dc97bfb80cc9eecffca76bcdfec3d8c6a306a174d"}, "/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_datetime.py_test_datetime_parsing_from_str_test_datetime_parsing_from_str.if_isinstance_result_Err.else_.assert_DatetimeModel_dt_v": {"doc_hash": "3403278fff03b4020c2c4bcfca0952ca330f2ce4dcc32a98feccf95a73ac1d7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_strings_test_validate_strings.if_raises_match_is_not_No.else_.assert_ta_validate_string": {"doc_hash": "623932a9e182c205f9ea6e140a904eeeca11c01a6879859b619746c7c212bd6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_strings_dict_test_annotated_type_disallows_config.with_pytest_raises_Pydant.TypeAdapter_Annotated_Mod": {"doc_hash": "66e70fc8922d01dc598c5c0e7a59f0afca47923c4d31ae8371abc7fc0e341bc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_type_alias.assert_t_json_schema__test_recursive_type_alias_name.assert_sorted_json_schema": {"doc_hash": "5aec923dfaf03683f27c446b1fa966a30a75ef9c550d5f28844896b79f8f9ea1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_string_import_callable_test_decimal_strict.assert_Model_model_valida": {"doc_hash": "af1dca11ae0b13f91faa0dc56bf3af5728ca8b0d1860fb2d7afff8580811c74c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_decimal_precision_test_strict_date.None_2": {"doc_hash": "b8222b9fdc7df9b8e039a1aafd441acb91f448bbef91b371bf2e7ec71461d1c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_alias_generator_test_typeddict_inheritance.assert_ta_validate_python": {"doc_hash": "cf60c9a383652ad1f3a0dd5cf710cfce26ae9dd1d876ded763c7a17e5cff35be"}, "/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.schema_6.self__apply_field_seriali": {"doc_hash": "0230d463c05cd4aaa8e5389229fb3b0ea765835a8729fa4fc8c14bb781c3321a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._common_field_schema.json_schema_updates_GenerateSchema._common_field_schema.return._common_field_": {"doc_hash": "8b0c89bfe7eaafdc91441c55c1a2f02a50d2a6eb72ba744d64cd690bf482d791"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_private_field_with_default_test_annotated_private_field_with_default.None_1.assert_model_bar": {"doc_hash": "118071a4f931aa18b74c90d753a8ecd3bb3eccdafa16ca874e6937fd4a68b560"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_min_length_field_info_not_lost_": {"doc_hash": "332a5bbdc1cb88ae21cf31f78c3844dbc082cbb6cb0245640edc7a1f7379c387"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_without_name_in_globals_test_plugin_path_type_adapter_without_name_in_globals.with_install_plugin_plugi.exec_code_bar_baz_": {"doc_hash": "9eae0fe407467d9a81f62797934754ae4e0abb92eacbd82a3b8e4ff2f33ebd07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._iter_BaseModel._iter.return.copy_internals__iter_self": {"doc_hash": "1cb6da4d481554514e9f990f72c58a61adc062e54fddd457cfb7d87529d7804e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._copy_and_set_values_BaseModel._copy_and_set_values.return.copy_internals__copy_and_": {"doc_hash": "7699764a71daf39512ae354c84eff5e2bbd3321b31371ce7bf3a604936625a7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_get_test_computed_fields_get.None_14": {"doc_hash": "9d9227cfddc0b2301480127fe861b92bddb55ddaec41e612bb3de89496d65df4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_list_schema__WalkCoreSchema.handle_json_or_python_schema.return.schema": {"doc_hash": "e5bb91e7535a62ca68bc683311c98b8980326a55277fccdc425b4b6575c6a8ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._config_wrapper_GenerateSchema._frozenset_schema.return.core_schema_frozenset_sch": {"doc_hash": "32d701316807d7bacc16647416e1c61d52a87e94014b7329ed77c0d7fa48b8a7"}, "/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_schema_": {"doc_hash": "3600e356a49a2aa6234a7fc25c58c900322db26ca5d8d95c46417afd4e602514"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_eval_type_backport_eval_type_backport.try_.except_TypeError_as_e_.return.eval_type_backport_value_": {"doc_hash": "f0f49fcd9ee0dbb3b19d5c8fbfac633f826ea0a0f3462b450a87c28c83bb2bce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_backport_fixable_error_get_function_type_hints.return.type_hints": {"doc_hash": "84fb20fefa8812bbbbcc0cf61a0b2259371e1600d085e58e0dc52cfdc6367ae6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_dataclass_": {"doc_hash": "4411fda16be3b1e973f507a444438053136ee1b859586179b32e2cb3a050553c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass_dataclass.if_sys_version_info_3.else_.kwargs._": {"doc_hash": "21e8cb256d3aad6220638c715f235578a84a078bed5f40b0ed8db78f192777e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel_RootModel._pyright_ignore_reportF": {"doc_hash": "555379d5e408f50c5351d3f5914cf02f1301b9806d3fa453a65a824b99f2d86a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter_TypeAdapter.__init___1._": {"doc_hash": "d7729d2b1039d0ddd714c2767eb7345d6f05df0b49033fb293c381e56a63786d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.__init___2_TypeAdapter.__init___2.self.serializer.serializer": {"doc_hash": "9d7f69c2af4710ea03b8f29b61a1dcc68fb61742c1a7481e06f8ac7082026556"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py_PydanticDeprecationWarning.__str___PydanticDeprecationWarning.__str__.return.message": {"doc_hash": "937b13232d057ad3aeb3eabc2997316dc7c2f6e6b6ec9763846085e4f698fa04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py_PydanticDeprecatedSince20_": {"doc_hash": "cb9e7bfc6a6c88af816602fa654fd9cf939dea16dbe3a2fa60cac2771c21f07a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/root_models.py_from_typing_import_List_": {"doc_hash": "cbb6d5f4f0a913b89797a1b223ece7aba43ca1e3687e4e3480b166d68680e2a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-plugin_ini/root_models.py_from_typing_import_List_": {"doc_hash": "8544068e731f4569dcd347b035dfa697387a92826c1f12b043801d580684623f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/root_models.py_from_typing_import_List_": {"doc_hash": "b42a3df855b6616615a528f70ae003eb3880f6b8251ba07c790bb350e70d54a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/root_models.py_from_typing_import_List_": {"doc_hash": "284d9cd6ee9a2c44712b76fb608df65faa07ece5a70dbbeedd36931c25c3612a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-default_toml/root_models.py_from_typing_import_List_": {"doc_hash": "8eb34bc6685dafbb104f33f19a400368d8600c7827b5d7bc44eeafde4e639a24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_repr_false_test_repr_false.assert_hidden_field_thi": {"doc_hash": "0dbe80bb296b58735cc5ae7068aa44cf8edd43e3d1800d46c79515883a8a77d4"}, "/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.Model.f1": {"doc_hash": "78d13ddb523eff5de99796b9ce61f4f3f53c32b15a7de49ab0a08e2379a4b0fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_pep585_generic_types.default_model_kwargs_test_pep585_generic_types.None_15": {"doc_hash": "59dd43a3500e5dde11710696e40bc7f994d59f293f813bd68ddbd624b7475919"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_field_info_annotated_attribute_name_clashing_test_root_model_arbitrary_private_field_works.None_1": {"doc_hash": "00984c9fdfa52f5362f0807782f78c19d98738aeb12ce415a1b58ea50df6a04b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_recursive_models_union_backport_test_recursive_models_union_backport.assert_module_Bar_model_f": {"doc_hash": "8794e751c535cbd1f73d74754c4eb63e1ce67cb0a84bce4aa20aebe6aeba3400"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_byte_size_type_test_byte_size_type.None_1": {"doc_hash": "f6fdb3232e593339b9416b4619e0acb8ad3854e80f063ee665fddb4ab2613bbc"}, "/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.assert_Model_model_json_s": {"doc_hash": "b3d1788564a8a1853cf4845b0e67738ac50e0a6cb16411ecd88dd5a4d6d42bcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_shadow_attribute_test_shadow_attribute.assert_getattr_Three_fo": {"doc_hash": "a0f4825bff9afcded82aaf9adc8bbe58e6528647df2ad4b25e0bf712bc75f243"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_eval_type_backport_": {"doc_hash": "15e2a5b37e9fa9161c44cd38a7de74222b7cea196faa824c3cede34ce08a7524"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_ta_config_with_annotated_type_test_ta_config_with_annotated_type.None_6": {"doc_hash": "ee899ef5c0c3c9bf13b5128f16f05f5fc3ebf75f89e20a0274ea631171ee6309"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_eval_type_backport_": {"doc_hash": "6a0c2108172b47e836af74c0f947672a18da12c78d60a3fb08c8543b042e9277"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_non_specified_generic_type_alias_type_test_redefined_type_alias.assert_MyOuterModel_model": {"doc_hash": "ca8a0b8818590c8bbaf1613aa5cb14d048a10a4793452388a4ea69424e298ee6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_to_type_with_ref_": {"doc_hash": "4c7de57235067ece76593af4f1092c0ed0662b21c00a6426d14080bde7f10b9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_datetime_test_int_enum_successful_for_str_int.assert_repr_m_tool_": {"doc_hash": "4025107048df54a16693e1ffd2a03f3d99281fb88c03b28c86d2aa4402deebb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_plain_enum_validate_test_string_success.assert_m_str_gt_b_": {"doc_hash": "c54ece8d1a6578f5bc12963e346840a3900e958848b16f8d7c0a3f1e30190dc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_recursive_generic_namedtuple_test_namedtuple_defaults.None_1": {"doc_hash": "e4ee2404d5497446766b1896bf6806212b9d5d2112a6d33429c071b36b8a12cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_eval_type_backport_": {"doc_hash": "eb66841f80be6b81cb88fdeb1732481350f9870767505eb9b8272b4094a1a47a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_typing.py_sys_test_get_function_type_hints_none_type.assert_get_function_type_": {"doc_hash": "9d86a881532e2d600804d7ae5f67ec36e31ff145683492d74ba8d32ee3832130"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_typing.py_test_eval_type_backport_not_installed_": {"doc_hash": "fac3606d35b6e88ca39233af63fcc08caae3d96028dbea90234d047d036986f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_tuple_schema_test_handle_tuple_schema.assert_schema_": {"doc_hash": "26047d79e1d205f58b624962def353e808d6372be4f1d98555d8be1e633adaba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_asyncio_test_args.None_9": {"doc_hash": "658c26b46a6f891917e9f631a4dc0b78fea829906f00ca249fcec8675f28e618"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_validate_call_with_slots_test_validate_call_with_slots.None_5": {"doc_hash": "1a42fe076b29d050c2187bf8b1ad01878511b0fe337d67156ceac35664142963"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_eval_type_backport_": {"doc_hash": "469f3fe1e9d43219a242dd47367b617fdd53ce121e19f8d23f7ea803348f21bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py_from___future___import_an__field_name_for_signature.return._alias_if_valid_field_inf": {"doc_hash": "fb40a53606330bc851a69004819eb6b2cc121cfd6d9d7047f441737f6862dda9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py__process_param_defaults__process_param_defaults.return.param": {"doc_hash": "86244ff99e39cce871edb6d89886eaaacfeee7aef6c78a30aeabddf8f16dbb97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py__generate_signature_parameters__generate_signature_parameters.return.merged_params": {"doc_hash": "f2e2089e54d0ee6d2ae2fafee489f03d0bdefb7326cd711aa94d451c4894145a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py_generate_pydantic_signature_": {"doc_hash": "0939106097a504580a67ab0573fc5643511b43171c180870ed524752a04e8728"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo_FieldInfo._None_has_a_special_mean": {"doc_hash": "bdae2b76424d6cc06c92e665ca67b818302a31d40d886c006ba0c33b75053967"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field._Check_deprecated_and_re_Field.None_6": {"doc_hash": "faae3891fa718b8b427cf1d519dbf38a9354f3db1e170b54e970aed6dcac1a75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field.if_allow_mutation_is_not__Field.if_include_is_not_None_.warn_include_is_deprec": {"doc_hash": "25ce5b185c5291d4500d442ca8ebfa11dfb16951c76fe2643dbe2e573f5f2ac6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inherited_dataclass_signature_test_alias_with_dashes.assert_obj_some_var_s": {"doc_hash": "fae246be39c4cebd86335e093d7c420d9169e53932a40d3d3cceb778de31b67b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_strings_test_init_false_not_in_signature.assert_b_in_signature_p": {"doc_hash": "926d61af21e5352bb50a74d56da7dc90a6f667ea2efeceb0bd1c11feab7c4200"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_init_test_cases_init_test_cases._": {"doc_hash": "363734054942eb2b5f866c2eaa52564cb7843fc705aaea5c05e1b560b066d5f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_false_with_post_init_test_init_false_with_post_init.if_isinstance_expected_l.else_.assert_dataclasses_asdict": {"doc_hash": "bb5147259ffa479c86ca76220a09b4aad2721193c906678949cb0a6a75c4a53a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_false_with_default_test_init_false_with_default.if_isinstance_expected_l.else_.assert_dataclasses_asdict": {"doc_hash": "d2fe077200f1b18b6194d95b896ed019e313a47e5fe23e8a0f626b011453ac2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_default_raises_for_dataclasses_test_validate_default_raises_for_dataclasses.assert_exc_info_value_err": {"doc_hash": "c746e11bbc9fb48b027d9dac90eb197e2ee619e5d656be864ba6fb622411b815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_plain_validator_plain_serializer_": {"doc_hash": "9a444f8dd2b8a25031608628814869d348366443a73e5133f6adc99313f14a08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py__dedent_source_lines__dedent_source_lines.return.dedent_source": {"doc_hash": "69588f0d92dcb1c724daef5188f7cc6ec4e565a5cda2f24674f5092f368d5e1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py__extract_source_from_frame__extract_source_from_frame.while_frame_.frame.frame_f_back": {"doc_hash": "e639ab870ae5146214fea0d6e618b86ec873aac63f911d73e318f5736b4be79b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py_extract_docstrings_from_cls_": {"doc_hash": "11b289df669e7c70a56e91ad80288cc2a13b5d18cf5700498eb2756af3c4597b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_PydanticMetadata__update_fields_from_docstrings.if_config_wrapper_use_att.for_ann_name_field_info_.if_field_info_description.field_info.description.fields_docs_ann_name_": {"doc_hash": "64b8b37b1f874bb7d29ac2e474a902667a3b782b0168f17f767c7d50dd102cf1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_38_ConfigDict.None_40": {"doc_hash": "27b6677829ce259c9c2e43053785ac4762331175e8f6825dca3c626a64ecc1b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__TypeT_": {"doc_hash": "2ec77390ca49bd468d353deef2e48a0c2fd1744c8d72210da7b941c984030e69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass.make_pydantic_fields_compatible_dataclass.make_pydantic_fields_compatible.for_annotation_cls_in_cls.for_field_name_in_annotat.cls___annotations___field": {"doc_hash": "1c4830e82aef4b37d610bb23d381e15351b4f27b29f4b952b0bae70ee1cd85de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.if_not_typing_TYPE_CHECKI_BaseModel.if_not_typing_TYPE_CHECKI.__delattr__.if_item_in_self_model_fie.else_.try_.except_AttributeError_.raise_AttributeError_f_t": {"doc_hash": "783bb0959f6939b391ac785a8fe6f75d64530c1440150a5a73217238a6c5ea29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretType__SecretBase._display.raise_NotImplementedError": {"doc_hash": "b6e796f1b3f8449da23228abd86d7f88f4f70724957fa20a87e5f6a72aa21a04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Secret_Secret._display.return._if_self_get_": {"doc_hash": "79915e46c0836d735b69d9f20f212865b71c419333cc5fc485531121e3a6d54f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Secret.__get_pydantic_core_schema___Secret.__get_pydantic_core_schema__.return.core_schema_json_or_pytho": {"doc_hash": "f1c4c052b315d9f0a714b784ba6eacda02b35601021973a9b6adcb0e5f1e35e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__secret_display__SecretField.__get_pydantic_core_schema__.json_schema.core_schema_no_info_after": {"doc_hash": "98559c73dec07f2cfcd43d0f0abf60f13260b68dbe21509c1725ca62569dd16c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__SecretField.__get_pydantic_core_schema__.get_secret_schema__SecretField.__get_pydantic_core_schema__.return.core_schema_lax_or_strict": {"doc_hash": "0b569d0a0d4570f478d99fcf54d07ed8feceb4b17b967fe6f42ebed4a3a621aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretStr_SecretStr._display.return._secret_display_self__sec": {"doc_hash": "00f3403589b5194ef9033d98ad25398ab917ce653074f173d2cb9d3bd6209d32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_35_ByteSize.byte_sizes_update_k_lowe": {"doc_hash": "a2e19ea3cbcf8c3cd7f3f283983d08be8d7ed8aa467b73edaf8f8ff640db53d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.byte_string_pattern_ByteSize.__get_pydantic_core_schema__.return.core_schema_with_info_aft": {"doc_hash": "f36efd42f5b164c45390cddf33a8230a5fa5c515374d78ea43b241aea61ac97e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.human_readable_ByteSize.human_readable.return.f_num_0_1f_separator_f": {"doc_hash": "35319968293559b7a8efd2f861f06bd2deefd730e60e57f11739794eea347b87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/no_strict_optional.py__": {"doc_hash": "54a46f770675836c91cdf2f098f2c0fbbe04d8443cde18d8169516e1e0bef6e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/with_config_decorator.py__": {"doc_hash": "d2f7f70fd2ff2dfb4f97adb20dafcb14b71ad742b8663b79111139943822a0b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/with_config_decorator.py__": {"doc_hash": "75e315831bdabff74e5c6b293242689f06ad29560699787419db7596fada1a3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-no-strict-optional_toml/no_strict_optional.py__": {"doc_hash": "47b2a0a856874c7b523b30909703ac33f28075020af1d828c2fd289f6aec2238"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/with_config_decorator.py__": {"doc_hash": "12fdc382556dec37939e7fd82da9aff24f33f382b63995fb8e466f937bb4ff9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_json_schema_with_inner_models_with_duplicate_names_test_json_schema_with_inner_models_with_duplicate_names.assert_model_b_model_json": {"doc_hash": "ad833e420da660a0cca6ac52946f0ad725977d5cf8928b8a608b3454aeba591f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_resolving_forward_refs_across_modules_": {"doc_hash": "89d845ffdf8dc465cf4cf8b2d1dc15ab681c534c07a6e0dceeb533e5ee98ffc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclasses_with_config_decorator_test_dataclasses_with_config_decorator.None_1": {"doc_hash": "6507e4070ed960cab60a7f3e8de6ccbb636797b5c66e9869d6a952fee47d4159"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_disallow_extra_allow_and_init_false_test_annotations_valid_for_field_inheritance.assert_B_a_1_a_1": {"doc_hash": "3dac0bdcafbee28c243bb57318257757fa89c478acb918e9087494e05867b002"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_annotations_valid_for_field_inheritance_with_existing_field_test_annotations_valid_for_field_inheritance_with_existing_field.assert_b_b_b_": {"doc_hash": "18ed449fac4ee09ce696d32546edb0fd8b5c74e6824680e34bccec236f75e8e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_annotation_with_double_override_": {"doc_hash": "01615a3e7abce701c250c66275eb7706cef00115bef336359be93a124cdba0e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_with_missing_tag_test_callable_discriminated_union_with_missing_tag.None_2.except_PydanticUserError_.assert_exc_info_code_": {"doc_hash": "e353c70dce4f3d67f2aca178a00052231f37ea84e7d4008d481e848b03417088"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions_test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions.assert_definitions_": {"doc_hash": "56c52af324ec26c3a9ad1d9d53c32001dee96e051540bef58e2b1ce8aa597f25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_textwrap_test_model_no_docs_extraction.None_1": {"doc_hash": "65903c5f053af6eda0f420e88565c4e17698a5e9b3eab10326fca24e85063ff0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_docs_extraction_test_model_docs_extraction.None_5": {"doc_hash": "cded78144807cd01a3f9a465ea762e304add938a22af9dcf20eb6249d50b5f84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_docs_duplicate_class_test_model_docs_duplicate_class.None_1": {"doc_hash": "f1099c07e80f2fd28c43d20e34d4911cd102061c8901bd4531d0a76a14db742d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_docs_dedented_string_test_model_docs_inheritance.None_2": {"doc_hash": "d6aba00882eb6d87dc99b605a3803ad0a43c17203b2147dc6b1c2e726fb74eac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_different_name_test_model_generic.assert_MyModel_int_model": {"doc_hash": "86855e631bd478bdff4c51bbbb6e417ee72faa540a2ef40a45b4d6a1421c31b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_dataclass_no_docs_extraction_test_dataclass_docs_extraction.MyModel.None_8": {"doc_hash": "55989bf0d2bb1e8d3a3884d4a1e8d03fca952b78f8676f62098990d967173bb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_dataclass_docs_extraction.assert_MyModel___pydantic_test_dataclass_docs_extraction.None_6": {"doc_hash": "8f8818181e0fd57845c1c3f998a21c1e3aa1e4bb3d5ea805f7ca5f421fb18d81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_typeddict_test_typeddict_as_field.assert_a_property_descri": {"doc_hash": "12349a599b32435a8446bffb36781dfd1cbb56a84ea780a1842704dee7aafcd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_create_model_test_": {"doc_hash": "03bec2a60a982778fc12f2b9653873e5f8dcc83a341a0aa3a58c37079c4ca93d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_title_test_typeddict_with__callable_json_schema_extra.assert_TypeAdapter_Model_": {"doc_hash": "229b29bee523b1e1183e40c99c9beab135d3a17b5fcce073a52665f8f8da9536"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_repeated_custom_type_test_repeated_custom_type.with_pytest_raises_Valida.OuterModel_x_2_y_1_z_": {"doc_hash": "7e8e258324e0eefd48e2aba8ae23029dee58c49ca95a5307d2a2a352931c5e6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_pattern_error_test_strict_secretfield_by_config.with_pytest_raises_Valida.Foobar_value_value_": {"doc_hash": "c9961458d39d2d34da4235ad9828fd94261042bf2d709f16d6882abd29e187e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_secretfield_annotated_test_secretdate_parsing.with_pytest_raises_Valida.FooBar_d_value_": {"doc_hash": "fe166f904f54ec2e4c33ae73203d32a10f2b96ee3734cda45a88e289eb4a022d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_secretdate_equality_test_generic_without_params_error.assert_exc_info_value_err": {"doc_hash": "04fe37c90bdd19dbe7e13caa54af4e62c561b3ff7f3b57218be656955bc9a1a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_literal_single_test_deque_generic_success_strict.assert_Model_v_value_v_": {"doc_hash": "2946fe968db5a6fdfe20ba8331b9103afb6a5ae4c59e988d666ef90c512dbfdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_deque_fails_test_none.assert_exc_info_value_err": {"doc_hash": "a498c9ea439e5d49a022c4b7204f6966ff9e5ef9d01d7f060b77840346ef73f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_none_literal_test_union_typeddict.assert_M_d_dict_foo_baz_": {"doc_hash": "d7f63c17d2709d071b84369a0a88db2344ebbfbc7dd62ceb86c6527b853cc2dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_custom_generic_containers_test_base64url.assert_Model_model_json_s": {"doc_hash": "8063ecdf50040648173b0113d6608a3172e29976fe60c761e7ad9460407fd8f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_base64url_invalid_test_ordered_dict_from_dict.assert_m_model_json_schem": {"doc_hash": "46bbf5ea5b1ef35ef7e6934935350937a5c0184e2d5722f6ea9a859faa15dec5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_handle_3rd_party_custom_type_reusing_known_metadata_test_transform_schema.assert_Model_x_1_x_": {"doc_hash": "22fccaebdd0a9adaf2158bc7c8d9f1c1a2379b9ce9d39cf7d07940e41b9753be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_transform_schema_for_first_party_class_test_constraints_arbitrary_type.CustomType.__repr__.return.f_CustomType_self_v_": {"doc_hash": "a63fd351d1af60cad366e958784e345215d146f7a68f7bf793c5a8972a725eb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_constraints_arbitrary_type.Model_test_constraints_arbitrary_type.assert_exc_info_value_err": {"doc_hash": "a7dd91dc09d2dc90048e1f2be91d8aa0a10e86e0559845c77de409350c3ba231"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_annotated_default_value_test_union_tags_in_errors.None_3": {"doc_hash": "8d850dd6947f3ad43617c1edd0bda32d53bd1df113e6b3c02f78cbcc544a1180"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_value_": {"doc_hash": "93c5cafb70e65c71ac31435b6bee2007bd450729fbc0fe8f60285fbfd00db9b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_from___future___import_an_set_discriminator_in_metadata.metadata_CORE_SCHEMA_META": {"doc_hash": "619b8e7292dcb5529db4cdefe88c39182805b274da1d0cdf916d7dd3b91d8427"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_apply_discriminators_apply_discriminators.return._core_utils_walk_core_sch": {"doc_hash": "5b11529b4fc9e58cf7432f93e8ece5ffb28a1594458c4f810bed7269ff0481e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py__Utilities_related_to_a_DocstringVisitor.visit_Expr.if_.self.target.None": {"doc_hash": "3e445cb6df19698927366145bcfb44adfd7039501dcaf44474490a785a9c2932"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__Convert_python_types_t_TUPLE_TYPES._tuple_typing_Tuple_": {"doc_hash": "ee590246fadc8c57f74b9dcac75623b0db5cc533cbeea78153e1a5c710ebb2dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_LIST_TYPES_check_validator_fields_against_field_name.return.False": {"doc_hash": "0e5c75338b9c21367231c23f547d745af0d44a6b0c7679c725fd9f6da10f2b59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_TypesNamespace__get_first_non_null.return.a_if_a_is_not_None_else_b": {"doc_hash": "d5429891b7e9a6278c5122248fe263044b1b69637f909fd915beda1a64a7c371"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_discriminator_to_union_GenerateSchema.collect_definitions.return.core_schema_definitions_s": {"doc_hash": "d8876674986dd6ac51dc3e297bfc87df94f6e7612ca9b0e9d80e2636c8e9ab32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._get_args_resolving_forward_refs_GenerateSchema._get_first_two_args_or_any.return.args_0_args_1_": {"doc_hash": "9c21386f807a70a34a6554ef3b5151b3e3046d8490d445794bff7a6875d089fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_alias_generator_to_field_info_GenerateSchema._apply_alias_generator_to_field_info.if_.if_field_info_validation_.field_info.validation_alias._get_first_non_null_valid": {"doc_hash": "b12906b6cdd1a570c7c47392dafce3376b92b92b47bc723531b78d1bc9e98390"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_alias_generator_to_computed_field_info_GenerateSchema._apply_alias_generator_to_computed_field_info.if_.None_2.computed_field_info.alias._get_first_non_null_seria": {"doc_hash": "441b03ebd1df555df53bc9f6c8cf5b99097180135f93ce1825dedc39e9e1eaaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._dataclass_schema_GenerateSchema._dataclass_schema.with_self_defs_get_schema.assert_False_Unreachabl": {"doc_hash": "bd5894783d10b64cff138ae38e024e80e333fe9da75dfa170103580823c55ded"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._computed_field_schema_GenerateSchema._computed_field_schema.if_alias_generator_is_not.self__apply_alias_generat": {"doc_hash": "b319f8335752501e825b99ecc2c09ebfcd3f3526120cc3dd6274db0e88845292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_set_deprecated_descriptors_set_deprecated_descriptors.for_field_computed_field.if_.setattr_cls_field_desc_": {"doc_hash": "8763d8e1e1ea4320a5f335976e6a3699f16b0208affdb94b95f034acebfa7457"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__DeprecatedFieldDescriptor__DeprecatedFieldDescriptor.__set__.raise_AttributeError_self": {"doc_hash": "8f59cf60a4e0677ee07d1932f793ae89bb22b84e6ed6f55b51fe965d6f2b42e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_GenerateJsonSchemaHandler_GenerateJsonSchemaHandler.__call__.return.self_handler_core_schema_": {"doc_hash": "1fcf13b4c81c1e5a8fbe189d557a500260a12f70b1896ab403f5eca379a9162c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_get_enum_core_schema_get_enum_core_schema.return.enum_schema": {"doc_hash": "45809bed36776726e2cc8bc85734a3ac3ee7dc25cae41bfa0e87e14d8bfe33ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_7_None_7.else_._make_forward_ref.typing_ForwardRef": {"doc_hash": "ae7c939d132273496568e88b0b9f037a7d9392691a9d7adaa6d149706e64fbdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_pattern_either_validator_pattern_str_validator.if_isinstance_input_value.else_.raise_PydanticCustomError": {"doc_hash": "71f221fc94c76d340c320f9453b956be41f0da5be07b9648de55fbdc85b7f8b7"}, "/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_value.else_.raise_PydanticCustomError": {"doc_hash": "fc11e4b53696b3f19a3516c6700a01d48ffa4e4577b262472a00bae09b8f8cf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__Defining_fields_on_mod_if_sys_version_info_3.else_.Deprecated.deprecated": {"doc_hash": "1fc158690756fa9d2441ac188a98ce47754d1640973a947a6bb2d3da69f3150d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.metadata_lookup_FieldInfo.__init__.None_4": {"doc_hash": "18dc0ee44345fdd490fff9d1be40f5eac345aa14ec7d14e546d648612a14e27a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._collect_metadata_FieldInfo.deprecation_message.return.self_deprecated_if_isinst": {"doc_hash": "577f677a1bd10fbee6b5e0bfa467f13b990bf64e9b41a4470ca428f67bdd0a28"}, "/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_and_sel.else_.if_value_is_not_None_and_.yield_s_value": {"doc_hash": "3ba54119c16d6fc0481fe9c61b095082d4479f75b434f40b684d600d690b55bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_ComputedFieldInfo_ComputedFieldInfo.deprecation_message.return.self_deprecated_if_isinst": {"doc_hash": "c3e6befec311d4cc75a13ada3de8381f5402b95158d9eb0899e7db6006d772a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_model_serializer_6_model_serializer_6.if_f_is_None_.else_._type_ignore": {"doc_hash": "d0b6b2d58684952ed97bf8eb56eb65c46184663fc470a67519fb70be94d11f1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__get_pydantic_core_schema___BaseModel.__get_pydantic_core_schema__.return.handler_source_": {"doc_hash": "62754d85e7d7a48a343d81c83d75ec72d020c2474d5b160d282aa83b2e5df05e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__get_pydantic_json_schema___BaseModel.__get_pydantic_json_schema__.return.handler_core_schema_": {"doc_hash": "673fcb1affcbc35763929a5c1b9ee852343d40a4eed84a40348b7317f3c0b5a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__getstate___BaseModel.__getstate__.return._": {"doc_hash": "0a6154130f8b1b5f0b8f8b58d4797f258d53412f46dd6b3e79f9a4cfa4b33a74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__setstate___BaseModel.None_2.__eq__.if_isinstance_other_Base.else_._delegate_to_the_other_i": {"doc_hash": "49909fbeff1158c322b4bc6fe9c7baddb2e878b9d1ff2923b97fe7899f731e54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.None_3_BaseModel.__repr__.return.f_self___repr_name___": {"doc_hash": "3ff43900a74b39ef561afd5dd03aa243b743a5ae2342e6db43cc1af87c4f9b27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_2_create_model_2.annotations._": {"doc_hash": "b0708c1722da0f5ad37da23e00ba7a97d9548f9259a3020172381c3ee5028c09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_2.for_f_name_f_def_in_fiel_": {"doc_hash": "93d227529595152e12e9c607334f2d31c49a499f538cb0bb913403cb87763fc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField_PydanticModelField.__init__.self.info.info": {"doc_hash": "fb5afcf4dd171bd226385d4cee4f0253626c43bcf5a06d18eda43b162261f863"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_argument_PydanticModelField.to_argument.return.Argument_": {"doc_hash": "a1d950cbca2fbf1c15ea2147b6b3a4adf82811f306fedb81dea6df9f0edbd30a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_var_PydanticModelField.expand_typevar_from_subtype.if_self_type_is_not_None_.with_state_strict_optiona.self.type.map_type_from_supertype_s": {"doc_hash": "7223fd33434e51727923e7484bbfc20207b20adda91d53bf7983424654f90b39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NatsDsn_None_1.else_.EmailStr._validate.return.validate_email_input_valu": {"doc_hash": "d922922d0b54fe01921e37a3d72c73233feb32d91b9b5e70a26c0778b4e36988"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_discriminated_unions.py_from___future___import_an_": {"doc_hash": "9b17ed269604d74c3e16ec90ba6a815fa3abdf6db060f8297f80690cc27a5504"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/config_conditional_extra.py__": {"doc_hash": "a881097e886220f8263435f94b99173b48b32c9e3dd04cc906e6ff6a184fab55"}, "/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_DynamicAliasModel2_x_y_": {"doc_hash": "b2dc34e022f489af932c6fc353bb6964b4ba32cdb4e6660882afbf0a5b7fa4b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_KwargsDynamicAliasModel_": {"doc_hash": "d34e7c1ccad2b30667e26ad7a4f2d1193b3e34505e07ec9f6b434ecc01e9f6bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_optional_inheritance.py__": {"doc_hash": "dce4e42f379806d9a2a9ca0ad1228649c3a7579edd35121a23ffb71ab0005302"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/strict_equality.py__": {"doc_hash": "e9076958f7d8624e0e89a328c73c5a90555515b02e6cb2949e3a2f5ba3d5d373"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"doc_hash": "078d2247028cf180230ef1300d4ce932434cb995c95b2cbfe28b3c3873daa44d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "fe232b48e7c07c2b0afb73cad755b1af94e66aef42a1aaab0962c2d099507e59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_39": {"doc_hash": "83ff7ae9bc3594d030b69b5e7c2b4b360367e0e575391c0b4a7c7782b27bb9e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"doc_hash": "94a9522d88e94305f1043e090aeead83f6d2b41ca2f5bbe96482b743f0d50573"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "2a76b5176b5e6015ba01520e577cf7934551d534654ff900db447a9d9a4f2822"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_optional_inheritance.py_from_typing_import_Option_": {"doc_hash": "ac8e2493be5cbe433f15da86e7f5e0a73d1598fdc92631e6a74d15d10c3a271b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict-equality_toml/strict_equality.py_from_pydantic_import_Base_": {"doc_hash": "63c86bc0f1306145297423955fe4854a458edc40c3ee212e35dba4d9c93ea131"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"doc_hash": "980e1fdc48de6c7c680c0730613fe0ccc77f6b3de4f73c2db03a3b21d5d51b0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "e1a4537abe3dd0cbd7bcfafa78a6fa3943a8de2924f01ad2b3f21a9c84fe3bf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_39": {"doc_hash": "8c4f865144f05e5c2fdbcafa7e656cfa04e71ea43678c93ca55696c5a552b914"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"doc_hash": "ab4860e68b202e2868efa617afbae62f09f7a4bfd144c1fc1d39108aaa2c0392"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"doc_hash": "67ff53419fe09fd9e6536be0c8bbd4897166d3d2c683c0c8c6545746b4da155a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_optional_inheritance.py_from_typing_import_Option_": {"doc_hash": "151520a7b75eb2aa680fc816df425d8df08f32baee9eaa27af4d49c306f2c5b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "005f1827fde2ae1077aee6b42438718c49adffbe2eacc2ae1525d8eb3f010d92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "32126fbe449df6ee36119c1b2565b11b0c458fe4c4668310e7adfc983471910d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"doc_hash": "f180f5f8e77ffcd1ebb06c0089f52be0e51ad033f9370273de405c42dfffe56a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "b16dd7e67e2e7f28ff3dee4f84d31d877f2838d72b50b9a681d903b141428856"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "f935b6a697cc0b7b396e803bd8cfb14e00a5c35575a5397537973443a73a8ea4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "fd8f92b40c67b055f27050d512c418d2eec98ac64687f53372f47511cccae49c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "3ed7a043accb0e26c25a28394257c226319ab1c06a804b1c357504a61aaf8c6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"doc_hash": "b0eb47d13b45c724cafbae64a68ab62a5c0232f474dbcc319a6e8f84fcc525f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "e50821355c11d0aa1498020b7e89fa5d85de031656d7804a1b48e3ba184cbc0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "4764a9ecb17eef603acade2d35733b9badc9fc12cf290d752fb3e800a9ce12cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "9038f839abfd1e4302223c980ec2a1a1b785e10ce715112839dcef7b35fe36b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "1d07c19f9f321ff366f7ace2dbed822a8dda559ea29c5ba1cc5fe2931974d72a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"doc_hash": "f28aaa602b1f2816833c5804c76c4bd6e63a4cafbc2e06e93cc5ea1bd221c750"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "09600d4f2e203e1cd5291eaf47d217a8a03c8d9d7feadaaa93e0763ca0d0d760"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "2909f4851a211a1b3c4f65572ae3ab41ce8524eaf0bebfc06c8b8a1a91bcad3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_optional_inheritance.py_from_typing_import_Option_": {"doc_hash": "e8d0816f854fd51f562716960ece529b52fdc18d0d5cfd30e0eed53c46830c52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "d2a7520c1f928ba1b94f89bc040db949ca91c689562f3494872d34b16d18e258"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "ae30a7fa7c3e3f6d88e84c18433e65c9cc0cec1d375da96cba9fff2458077ce5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"doc_hash": "79b088d26146ebe64bf7b499ac120502115ee0c16aa6971a272414f30d205e41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"doc_hash": "004c899c93672b3f0321008340e6e35e687a00f678b9f6913ee0818885235407"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"doc_hash": "421e4ab1ebe3a1304c63d3df1fe159bfd738c983ad671c239efb84e8d8c37ad5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_optional_inheritance.py_from_typing_import_Option_": {"doc_hash": "2c7888e0466707146bc674bf1605bf745516e202adaed974cfaa4e8937bde999"}, "/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.if_merged_output_exis.else_.assert_mypy_returncode_": {"doc_hash": "3c3cdd6d8a2010840dfcea8cce11ebe2f23078266097c532cba072f000b2dc02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_all_alias_kinds_specified_test_all_alias_kinds_specified.None_5": {"doc_hash": "7b973505a2c90648eaaf8f2311d74ee9a4e3e2f398da0b0de2838a45c3ec629e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_with_computed_field_for_serialization_test_alias_generator_with_computed_field_for_serialization.assert_r_model_dump_by_al": {"doc_hash": "a4f4421689648c96bd2f68b8ffd63990f0deb9c7d4dab04d7086988c4a84a34a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_empty_str_alias_generator_": {"doc_hash": "69dd4e2ea068dee6d4b7fd1fa7d1c9f8c33be3af6fb589f8566ce4cf6c4ae28a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_generic_computed_field_test_generic_computed_field.with_pytest_warns_UserWar.B_int_model_dump_": {"doc_hash": "f4433b37f284530d221a9a5b8fb361402494379c2a38d338fde851ade15c414c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_field_override_raises_": {"doc_hash": "6014915cc15df4492b8c6658e831b79db0d03fc292c0af552fb95657cadeecdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_partial_creation_with_defer_build_test_partial_creation_with_defer_build.assert_partial_model_json": {"doc_hash": "6dbfef772b33aa473d2b3bc74f6f6d0d07476ab0b75fec81b395a6a15ce50e50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_model_config_as_model_field_raises_": {"doc_hash": "ba920a7d5d3ba5f0fa39f24ecaec57d33c2b7d06786e8b9b8fa76a570a1a54fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_del_model_attr_with_privat_attrs_twice_error_test_create_model_non_annotated.with_pytest_raises_.create_model_FooModel_": {"doc_hash": "4f1017c7840d69bc9b5e763cc5c59faa5e186811080528800cefde4850736427"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_typing_annotated_field_info_test_create_model_typing_annotated_field_info.assert_foo_description_": {"doc_hash": "8c56820934a408e6c589ca2397ef191e46e307279ea8137e6a08412af1d3da7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_expect_field_info_as_metadata_typing_test_create_model_multiple_protected_namespace.with_pytest_warns_.create_model_": {"doc_hash": "ac327efd0ba2f1cb616edadcdf670282bce878056608bb859d2e5d49ae08a2b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_base_dataclasses_annotations_resolving_test_base_dataclasses_annotations_resolving.assert_TypeAdapter_D2_va": {"doc_hash": "3002f363b92740afd1ee2b18e55fe6a0ad9a81452f7d49d19dc893373d1dcbb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_base_dataclasses_annotations_resolving_with_override_test_base_dataclasses_annotations_resolving_with_override.assert_TypeAdapter_D3_va": {"doc_hash": "c37103c2803466fd3629bd3bf82c46b42f8765a19d8ec9d72dedf8be1d0a5340"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_modify_schema_on_nested_class_error_test_modify_schema_on_nested_class_error.with_pytest_raises_.B.a": {"doc_hash": "99a7e65e2d4260fa3a359821ae556fb28d9d0d8f4e5beac21d63bf6f6f0970ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_importlib.metadata_test_deprecated_fields.assert_b_1": {"doc_hash": "dfdd15e60ee9aa4adadb6e4eb4944b4ffec187eae589c107e6008a15c242ef3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_deprecated_fields_deprecated_class_test_deprecated_fields_deprecated_class.None_2": {"doc_hash": "22130106c349ece7f1cd9442dd7c750923a56fdbfd58d7b843ecc91242806f95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_deprecated_fields_field_validator_test_deprecated_fields_validate_assignment.None_1.assert_instance_x_2": {"doc_hash": "bb6a7f6c2fea96e89954a381538c604f2f061a700c82fd89fdab2420f57c1210"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_computed_field_deprecated_test_computed_field_deprecated.Model.p5.return.1": {"doc_hash": "e89a631f4cc5960d3bc3f8bba316f9e26c8531d09a100b9c0c74ab4a26d8aa37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_computed_field_deprecated.assert_Model_model_json_s_test_computed_field_deprecated.assert_p3_1": {"doc_hash": "c6cb4211b1803c2b583ba8087eb2935bcb0b1f3312c7ec470d9ae17c8e248a22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_computed_field_deprecated_deprecated_class_test_computed_field_deprecated_deprecated_class.assert_p1_1": {"doc_hash": "65ec6ccf90eaba13cc33f6b90229ca2fca470cd034eaec5d71cdba1d8e0ef75e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_deprecated_with_boolean_": {"doc_hash": "5808b2fb3a9800d3646eb7728c566f377223005f336cff3a22794cad99fcf900"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminator_test_nested_discriminator._insert_assert_MyModel_m": {"doc_hash": "58ddc967611592b63e2d5d9bec5a6851cb65a68ab61c1956743f65cda2607429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminator.assert_MyModel_model_json_test_nested_discriminator.assert_MyModel_model_json": {"doc_hash": "0288b4df3bceb6ab2ed457fea0ecd840e9532dce68b1078a97a722d8e1df4c33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_schema_gen_uses_tagged_union_in_ref_test_nested_schema_gen_uses_tagged_union_in_ref.for_definition_in_adapter.if_definition_schema_.assert_definition_schema": {"doc_hash": "cfdb65b873469c624688b9f812a356f2e68f9aea149923087593ca7d3a4625db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminiated_union_with_typed_dict_test_recursive_discriminiated_union_with_typed_dict.for_definition_in_core_sc.if_Foo_in_definition_r.assert_definition_fields": {"doc_hash": "8457aa2a927a8495d87a70f8d7224acc8e5fdf566d714291c4437165279f560a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminiated_union_with_base_model_test_recursive_discriminiated_union_with_base_model.for_definition_in_core_sc.if_Foo_in_definition_r.assert_definition_schema": {"doc_hash": "eb3786cdbfe162bf75f38a757dad52aad9baef7bd17f443c25ab6c1b7823de49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminated_union_with_pydantic_dataclass_test_recursive_discriminated_union_with_pydantic_dataclass.for_definition_in_core_sc.if_Foo_in_definition_r.for_field_in_definition_.assert_field_schema_t": {"doc_hash": "05240982a5612329a51d6eeeda34009647504191e50fbf58586bb36b7be4e4e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_with_nested_dataclass_test_discriminated_union_with_nested_dataclass.assert_ta_core_schema_sc": {"doc_hash": "89cbe0a50bb4e260707a9e631d0ca54de9d87c7623ebe4714fef06bb0ac4ed3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_with_nested_typed_dicts_": {"doc_hash": "7f75034cedd4e9180d806f512ba284594defdcff2bbbc44773c188bf573691c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_from_typing_import_Union_test_field_info_annotation_keyword_argument.assert_e_value_args_": {"doc_hash": "fb7fe0fc2ab30e96394f284cf8636dae9b7c2f66b2b2f936e06d5495153980d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_root_model_field_override_test_root_model_field_override.assert_isinstance_validat": {"doc_hash": "32235042369c4d5f37130ac14191fd97b176cc7f65ac737b6b1cd613f075f2b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_frozen_field_repr_": {"doc_hash": "e36e06dc988008a6f6b388b6c825720f8ef67227b164a65cebdad4e493eb4e81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_description_not_included_for_basemodel_test_recursive_json_schema_build.assert_Model_model_json_s": {"doc_hash": "f49cd04bfaea8d235b84f400056d8012ff7be18c8d02653d64d747abd6adf0ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_json_schema_annotated_with_field_test_json_schema_annotated_with_field.assert_Model_model_json_s": {"doc_hash": "179b171407d6522d656149ebbc523275258b98bd0edf0f6721ccd749ce81acb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_required_fields_in_annotated_with_create_model_test_required_fields_in_annotated_with_basemodel.None_2": {"doc_hash": "36aef326c2bb981789118ffcc519e51f0f1b6945cc1056989f1c8e8f62aa873c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_default_value_encoding_": {"doc_hash": "0b9469feb32e55d660b4db64b94385e325161ddd21753ea545a91bd206b347a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_json_try_.except_ImportError_.email_validator.None": {"doc_hash": "66429f5d16af5853787be7b0afb0151262b2083eb108f103df749f15a397d803"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mariadb_dsns_test_clickhouse_dsns.assert_str_Model_a_dsn_a": {"doc_hash": "4773d57e02c7261ce9cddb263d5485b5142c09dd8d0c1ea7895f0bad4ef3fa5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_address_invalid_test_email_validator_not_installed.with_pytest_raises_Import.validate_email_s_muelcol": {"doc_hash": "2a1f5ca12301e534014294571f9047dad7182f666100bf42148edb2bec6f2252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_name_email_": {"doc_hash": "69fbfa202d91f3b1b95e4db8e22986f2f2dc74938408c50079ad12e3d4feec33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_importlib_metadata_reset_plugins.loader._plugins_2.initial_plugins": {"doc_hash": "81becfbec3f706d09ab585bc657fee1dff622ffa3736a3a0b32b45d09614c74d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_mock_mock.with_patch_object_importl.yield": {"doc_hash": "cc9577860f0d5bedbd504295e94fe081c3c49fbf1ba08d6dc95b978e66f72638"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_test_loader_": {"doc_hash": "dfd848bb2b0581d4fbc7d69d188230aa3852cc7706d50248d87b5aa6e48350ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_all_fields_int_ser_instance_method_with_info2.return.f_v_": {"doc_hash": "883ce4110a51914083863ad93d3f63f6dd1c44ffb3f4935b7b4ab4bcf9d1df70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py___parent_sub_model_fixture.return.ParentModel": {"doc_hash": "01e2980a5f5ebd7e96a432fd9dfde22b400bd79930ab42f1c9e065564b408de0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_inspect_type_hints_inspect_type_hints.if_isinstance_obj_type_t.for_member_name_member_o.if_inspect_isclass_member.inspect_type_hints_member": {"doc_hash": "708239e58a14455d0d91558261a4239db1e9775b570eb02db31c0dc48051d056"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_test_obj_type_hints_test_obj_type_hints.inspect_type_hints_obj_ty": {"doc_hash": "9f9ca32068355184a2324f91490f1cde28dcb1a747ca91209d2d59eb0317de14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_test_parent_sub_model_": {"doc_hash": "df58af428574b5bb03448a57912c2e6096c29d0fd26374b33bbda1947e3b7e26"}, "/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_TypeEr.Model.checker.return.v": {"doc_hash": "2bb33915d9680581ac57984b1edb46ee266f68f93db40fb6d9676f00686d3535"}, "/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_all.assert_MyModel_x_10_x_": {"doc_hash": "ad8c865e2ac4d2e1eb322a5c859288ef92c3add11f2940ad70fc00a0e688c9c2"}, "/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_raises_Valida.Child_a_snap_": {"doc_hash": "3cf342483e98d45883ebb650075ea56d8514db157210c6d0c9f15272a93c792d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_datetime_field_validator_test_datetime_field_validator.assert_check_calls_3": {"doc_hash": "de63e3e0487a7c7a1c6d273dd6a05ac7947af264e043789b548f20bba7e7315b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_pre_called_once_test_assert_raises_validation_error.assert_exc_info_value_err": {"doc_hash": "c8328e01f97827d562347eae69c5bd49c81b8df4cd4acd030cf1ed33e106e96b"}}, "docstore/data": {"/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": 98, "end_line": 136, "span_ids": ["upgrade_python"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 numbers = match.group(3)\n # import devtools\n # devtools.debug(numbers)\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}```{numbers}', ' ' * 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(.+?)^```(\\s+(?:^\\d+\\. .+?\\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": 145, "end_line": 159, "span_ids": ["remove_code_fence_attributes"], "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 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(\n r' (?:test|lint|upgrade|group|requires|output|rewrite_assert)=\".+?\"', '', match.group(2), flags=re.M\n )\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_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/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": 87, "end_line": 122, "span_ids": ["get_type_ref"], "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 get_type_ref(type_: type[Any], args_override: tuple[type[Any], ...] | None = None) -> str:\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 = get_origin(type_) or type_\n\n args = get_args(type_) if is_generic_alias(type_) else (args_override or ())\n generic_metadata = getattr(type_, '__pydantic_generic_metadata__', None)\n if generic_metadata:\n origin = generic_metadata['origin'] or origin\n args = generic_metadata['args'] or args\n\n module_name = getattr(origin, '__module__', '')\n if isinstance(origin, TypeAliasType):\n type_ref = f'{module_name}.{origin.__name__}:{id(origin)}'\n else:\n try:\n qualname = getattr(origin, '__qualname__', f'')\n except Exception:\n qualname = getattr(origin, '__qualname__', '')\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/_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": 247, "end_line": 282, "span_ids": ["is_builtin_dataclass"], "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 is_builtin_dataclass(_cls: type[Any]) -> TypeGuard[type[StandardDataclass]]:\n \"\"\"Returns True if a class is a stdlib dataclass and *not* a pydantic dataclass.\n\n We check that\n - `_cls` is a dataclass\n - `_cls` does not inherit from a processed pydantic dataclass (and thus have a `__pydantic_validator__`)\n - `_cls` does not have any annotations that are not dataclass fields\n e.g.\n ```py\n import dataclasses\n\n import pydantic.dataclasses\n\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 Args:\n cls: The class.\n\n Returns:\n `True` if the class is a stdlib dataclass, `False` otherwise.\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/_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": 54, "end_line": 106, "span_ids": ["_ApplyInferredDiscriminator.__init__"], "tokens": 823}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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[Hashable, 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": 167, "end_line": 195, "span_ids": ["_ApplyInferredDiscriminator.apply"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ApplyInferredDiscriminator:\n\n def apply(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n \"\"\"Return a new CoreSchema based on `schema` that uses a tagged-union with the discriminator provided\n to this class.\n\n Args:\n schema: The input schema.\n\n Returns:\n The new core schema.\n\n Raises:\n TypeError:\n - If `discriminator` is used with invalid union variant.\n - If `discriminator` is used with `Union` type with one variant.\n - If `discriminator` value mapped to multiple choices.\n ValueError:\n If the definition for ref is missing.\n PydanticUserError:\n - If a model in union doesn't have a discriminator field.\n - If discriminator field has a non-string alias.\n - If discriminator fields have different aliases.\n - If discriminator field not of type `Literal`.\n \"\"\"\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 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": 201, "end_line": 255, "span_ids": ["_ApplyInferredDiscriminator._apply_to_root"], "tokens": 657}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ApplyInferredDiscriminator:\n\n def _apply_to_root(self, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\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 # If the schema is not a union, it probably means it just had a single member and\n # was flattened by pydantic_core.\n # However, it still may make sense to apply the discriminator to this schema,\n # as a way to get discriminated-union-style error messages, so we allow this here.\n schema = core_schema.union_schema([schema])\n\n # Reverse the choices list before extending the stack so that they get handled in the order they occur\n choices_schemas = [v[0] if isinstance(v, tuple) else v for v in schema['choices'][::-1]]\n self._choices_to_handle.extend(choices_schemas)\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": 253, "end_line": 303, "span_ids": ["_ApplyInferredDiscriminator._handle_choice"], "tokens": 608}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"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'] == 'definition-ref':\n if choice['schema_ref'] not in self.definitions:\n raise MissingDefinitionForUnionRef(choice['schema_ref'])\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 choices_schemas = [v[0] if isinstance(v, tuple) else v for v in choice['choices'][::-1]]\n self._choices_to_handle.extend(choices_schemas)\n elif choice['type'] not in {\n 'model',\n 'typed-dict',\n 'tagged-union',\n 'lax-or-strict',\n 'dataclass',\n 'dataclass-args',\n 'definition-ref',\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": 250, "end_line": 260, "span_ids": ["_ApplyInferredDiscriminator._is_discriminator_shared"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ApplyInferredDiscriminator:\n\n def _is_discriminator_shared(self, choice: core_schema.TaggedUnionSchema) -> bool:\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": 320, "end_line": 389, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_choice"], "tokens": 753}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_choice( # noqa C901\n self, choice: core_schema.CoreSchema, source_name: str | None\n ) -> list[str | int]:\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_schema = subchoice[0] if isinstance(subchoice, tuple) else subchoice\n subchoice_values = self._infer_discriminator_values_for_choice(subchoice_schema, 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'] == 'model-fields':\n return self._infer_discriminator_values_for_model_choice(choice, source_name=source_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 elif choice['type'] == 'definition-ref':\n schema_ref = choice['schema_ref']\n if schema_ref not in self.definitions:\n raise MissingDefinitionForUnionRef(schema_ref)\n return self._infer_discriminator_values_for_choice(self.definitions[schema_ref], source_name=source_name)\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": 327, "end_line": 339, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_typed_dict_choice"], "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 _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 \"\"\"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'TypedDict {source_name!r}'\n field = choice['fields'].get(self.discriminator)\n if field is None:\n raise PydanticUserError(\n f'{source} needs a discriminator field for key {self.discriminator!r}', code='discriminator-no-field'\n )\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": 303, "end_line": 314, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_dataclass_choice"], "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 _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(\n f'{source} needs a discriminator field for key {self.discriminator!r}', code='discriminator-no-field'\n )\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": 330, "end_line": 347, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_field"], "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 _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_field(self, field: CoreSchemaField, source: str) -> list[str | int]:\n if field['type'] == 'computed-field':\n # This should never occur as a discriminator, as it is only relevant to serialization\n return []\n alias = field.get('validation_alias', self.discriminator)\n if not isinstance(alias, str):\n raise PydanticUserError(\n f'Alias {alias!r} is not supported in a discriminated union', code='discriminator-alias-type'\n )\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 code='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._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": 413, "end_line": 430, "span_ids": ["_ApplyInferredDiscriminator._set_unique_choice_for_values"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ApplyInferredDiscriminator:\n\n def _set_unique_choice_for_values(self, choice: core_schema.CoreSchema, values: Sequence[str | int]) -> None:\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 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 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 else:\n self._tagged_union_choices[discriminator_value] = choice", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 136, "end_line": 166, "span_ids": ["filter_field_decorator_info_by_field", "check_decorator_fields_exist"], "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 check_decorator_fields_exist(decorators: Iterable[AnyFieldDecorator], fields: Iterable[str]) -> None:\n \"\"\"Check if the defined fields in decorators exist in `fields` param.\n\n It ignores the check for a decorator if the decorator has `*` as field or `check_fields=False`.\n\n Args:\n decorators: An iterable of decorators.\n fields: An iterable of fields name.\n\n Raises:\n PydanticUserError: If one of the field names does not exist in `fields` param.\n \"\"\"\n fields = set(fields)\n for dec in decorators:\n if '*' in dec.info.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'Decorators defined with incorrect fields: {dec.cls_ref}.{dec.cls_var_name}'\n \" (use check_fields=False if you're inheriting from the model and intended this)\",\n code='decorator-missing-field',\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": 170, "end_line": 204, "span_ids": ["apply_each_item_validators"], "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 apply_each_item_validators(\n schema: core_schema.CoreSchema,\n each_item_validators: list[Decorator[ValidatorDecoratorInfo]],\n field_name: str | None,\n) -> core_schema.CoreSchema:\n # This V1 compatibility shim should eventually be removed\n\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, field_name)\n return schema\n elif schema['type'] == 'tuple':\n if (variadic_item_index := schema.get('variadic_item_index')) is not None:\n schema['items_schema'][variadic_item_index] = apply_validators(\n schema['items_schema'][variadic_item_index], each_item_validators, field_name\n )\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, field_name)\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, field_name)\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_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": 1258, "end_line": 1291, "span_ids": ["GenerateSchema._generate_parameter_schema"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _generate_parameter_schema(\n self,\n name: str,\n annotation: type[Any],\n default: Any = Parameter.empty,\n mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] | None = None,\n ) -> core_schema.ArgumentsParameter:\n \"\"\"Prepare a ArgumentsParameter to represent a field in a namedtuple or function signature.\"\"\"\n from ..fields import FieldInfo\n\n if default is Parameter.empty:\n field = FieldInfo.from_annotation(annotation)\n else:\n field = FieldInfo.from_annotated_attribute(annotation, default)\n assert field.annotation is not None, 'field.annotation should not be None when generating a schema'\n source_type, annotations = field.annotation, field.metadata\n with self.field_name_stack.push(name):\n schema = self._apply_annotations(source_type, annotations)\n\n if not field.is_required():\n schema = wrap_default(field, schema)\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 else:\n alias_generator = self._config_wrapper.alias_generator\n if isinstance(alias_generator, AliasGenerator) and alias_generator.alias is not None:\n parameter_schema['alias'] = alias_generator.alias(name)\n elif isinstance(alias_generator, Callable):\n parameter_schema['alias'] = alias_generator(name)\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._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": 1405, "end_line": 1424, "span_ids": ["GenerateSchema._sequence_schema", "GenerateSchema._iterable_schema"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _sequence_schema(self, sequence_type: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for a Sequence, e.g. `Sequence[int]`.\"\"\"\n item_type = self._get_first_arg_or_any(sequence_type)\n item_type_schema = self.generate_schema(item_type)\n list_schema = core_schema.list_schema(item_type_schema)\n\n python_schema = core_schema.is_instance_schema(typing.Sequence, cls_repr='Sequence')\n if item_type != Any:\n from ._validators import sequence_validator\n\n python_schema = core_schema.chain_schema(\n [python_schema, core_schema.no_info_wrap_validator_function(sequence_validator, list_schema)],\n )\n return core_schema.json_or_python_schema(json_schema=list_schema, python_schema=python_schema)\n\n def _iterable_schema(self, type_: Any) -> core_schema.GeneratorSchema:\n \"\"\"Generate a schema for an `Iterable`.\"\"\"\n item_type = self._get_first_arg_or_any(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__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": 1923, "end_line": 1943, "span_ids": ["impl:30"], "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": "_VALIDATOR_F_MATCH: Mapping[\n tuple[FieldValidatorModes, Literal['no-info', 'with-info']],\n Callable[[Callable[..., Any], core_schema.CoreSchema, str | None], core_schema.CoreSchema],\n] = {\n ('before', 'no-info'): lambda f, schema, _: core_schema.no_info_before_validator_function(f, schema),\n ('after', 'no-info'): lambda f, schema, _: core_schema.no_info_after_validator_function(f, schema),\n ('plain', 'no-info'): lambda f, _1, _2: core_schema.no_info_plain_validator_function(f),\n ('wrap', 'no-info'): lambda f, schema, _: core_schema.no_info_wrap_validator_function(f, schema),\n ('before', 'with-info'): lambda f, schema, field_name: core_schema.with_info_before_validator_function(\n f, schema, field_name=field_name\n ),\n ('after', 'with-info'): lambda f, schema, field_name: core_schema.with_info_after_validator_function(\n f, schema, field_name=field_name\n ),\n ('plain', 'with-info'): lambda f, _, field_name: core_schema.with_info_plain_validator_function(\n f, field_name=field_name\n ),\n ('wrap', 'with-info'): lambda f, schema, field_name: core_schema.with_info_wrap_validator_function(\n f, schema, field_name=field_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_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": 1868, "end_line": 1890, "span_ids": ["apply_validators"], "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 apply_validators(\n schema: core_schema.CoreSchema,\n validators: Iterable[Decorator[RootValidatorDecoratorInfo]]\n | Iterable[Decorator[ValidatorDecoratorInfo]]\n | Iterable[Decorator[FieldValidatorDecoratorInfo]],\n field_name: str | None,\n) -> core_schema.CoreSchema:\n \"\"\"Apply validators to a schema.\n\n Args:\n schema: The schema to apply validators on.\n validators: An iterable of validators.\n field_name: The name of the field if validators are being applied to a model field.\n\n Returns:\n The updated schema.\n \"\"\"\n for validator in validators:\n info_arg = inspect_validator(validator.func, validator.info.mode)\n val_type = 'with-info' if info_arg else 'no-info'\n\n schema = _VALIDATOR_F_MATCH[(validator.info.mode, val_type)](validator.func, schema, field_name)\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": 1369, "end_line": 1382, "span_ids": ["_validators_require_validate_default"], "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 _validators_require_validate_default(validators: Iterable[Decorator[ValidatorDecoratorInfo]]) -> bool:\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/_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": 257, "end_line": 339, "span_ids": ["replace_types"], "tokens": 822}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 Args:\n type_: The class or generic alias.\n type_map: Mapping from `TypeVar` instance to concrete types.\n\n Returns:\n A new type representing the basic structure of `type_` with all\n `typevar_map` keys recursively replaced.\n\n Example:\n ```py\n from typing import List, Tuple, Union\n\n from pydantic._internal._generics import replace_types\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:\n return _UnionGenericAlias(origin_type, resolved_type_args)\n # NotRequired[T] and Required[T] don't support tuple type resolved_type_args, hence the condition below\n return origin_type[resolved_type_args[0] if len(resolved_type_args) == 1 else 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_model_class(type_):\n parameters = type_.__pydantic_generic_metadata__['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]\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 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": 339, "end_line": 356, "span_ids": ["impl:25", "check_parameters_count"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_parameters_count(cls: type[BaseModel], parameters: tuple[Any, ...]) -> None:\n \"\"\"Check the generic model parameters count is equal.\n\n Args:\n cls: The generic model.\n parameters: A tuple of passed parameters to the generic model.\n\n Raises:\n TypeError: If the passed parameters count is not equal to generic model parameters count.\n \"\"\"\n actual = len(parameters)\n expected = len(cls.__pydantic_generic_metadata__['parameters'])\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": 328, "end_line": 364, "span_ids": ["generic_recursion_self_type", "recursively_defined_type_refs"], "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": "@contextmanager\ndef generic_recursion_self_type(\n origin: type[BaseModel], args: tuple[Any, ...]\n) -> Iterator[PydanticRecursiveRef | None]:\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": 367, "end_line": 384, "span_ids": ["get_cached_generic_type_early"], "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 get_cached_generic_type_early(parent: type[BaseModel], typevar_values: Any) -> type[BaseModel] | None:\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": 387, "end_line": 394, "span_ids": ["get_cached_generic_type_late"], "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 get_cached_generic_type_late(\n parent: type[BaseModel], typevar_values: Any, origin: type[BaseModel], args: tuple[Any, ...]\n) -> type[BaseModel] | None:\n \"\"\"See the docstring of `get_cached_generic_type_early` for more information about the two-stage cache lookup.\"\"\"\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": 397, "end_line": 411, "span_ids": ["set_cached_generic_type"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 \"\"\"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": 414, "end_line": 435, "span_ids": ["_union_orderings_key"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _union_orderings_key(typevar_values: Any) -> Any:\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": 438, "end_line": 447, "span_ids": ["_early_cache_key"], "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 _early_cache_key(cls: type[BaseModel], typevar_values: Any) -> GenericTypesCacheKey:\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": 450, "end_line": 460, "span_ids": ["_late_cache_key"], "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 _late_cache_key(origin: type[BaseModel], args: tuple[Any, ...], typevar_values: Any) -> GenericTypesCacheKey:\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_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": 465, "end_line": 547, "span_ids": ["complete_model_class"], "tokens": 591}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def complete_model_class(\n cls: type[BaseModel],\n cls_name: str,\n config_wrapper: ConfigWrapper,\n *,\n raise_errors: bool = True,\n types_namespace: dict[str, Any] | None,\n create_model_module: str | None = None,\n) -> bool:\n \"\"\"Finish building a model class.\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 Args:\n cls: BaseModel or dataclass.\n cls_name: The model or dataclass name.\n config_wrapper: The config wrapper instance.\n raise_errors: Whether to raise errors.\n types_namespace: Optional extra namespace to look for types in.\n create_model_module: The module of the class to be created, if created by `create_model`.\n\n Returns:\n `True` if the model is successfully completed, else `False`.\n\n Raises:\n PydanticUndefinedAnnotation: If `PydanticUndefinedAnnotation` occurs in`__get_pydantic_core_schema__`\n and `raise_errors=True`.\n \"\"\"\n typevars_map = get_model_typevars_map(cls)\n gen_schema = GenerateSchema(\n config_wrapper,\n types_namespace,\n typevars_map,\n )\n\n handler = CallbackGetCoreSchemaHandler(\n partial(gen_schema.generate_schema, from_dunder_get_core_schema=False),\n gen_schema,\n ref_mode='unpack',\n )\n\n if config_wrapper.defer_build:\n set_model_mocks(cls, cls_name)\n return False\n\n try:\n schema = cls.__get_pydantic_core_schema__(cls, handler)\n except PydanticUndefinedAnnotation as e:\n if raise_errors:\n raise\n set_model_mocks(cls, cls_name, f'`{e.name}`')\n return False\n\n core_config = config_wrapper.core_config(cls)\n\n try:\n schema = gen_schema.clean_schema(schema)\n except gen_schema.CollectedInvalid:\n set_model_mocks(cls, cls_name)\n return False\n\n # debug(schema)\n cls.__pydantic_core_schema__ = schema\n\n cls.__pydantic_validator__ = create_schema_validator(\n schema,\n cls,\n create_model_module or cls.__module__,\n cls.__qualname__,\n 'create_model' if create_model_module else 'BaseModel',\n core_config,\n config_wrapper.plugin_settings,\n )\n cls.__pydantic_serializer__ = SchemaSerializer(schema, core_config)\n cls.__pydantic_complete__ = True\n\n # set __signature__ attr only for model class, but not for its instances\n cls.__signature__ = ClassAttribute(\n '__signature__',\n generate_pydantic_signature(init=cls.__init__, fields=cls.model_fields, config_wrapper=config_wrapper),\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/_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": 28, "end_line": 48, "span_ids": ["Representation", "Representation.__repr_args__"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 \"\"\"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_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": 85, "end_line": 118, "span_ids": ["display_as_type"], "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 display_as_type(obj: Any) -> str:\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 elif isinstance(obj, typing_extensions.TypeAliasType):\n return str(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 if typing_extensions.get_origin(obj) == typing_extensions.Literal:\n args = ', '.join(map(repr, typing_extensions.get_args(obj)))\n else:\n args = ', '.join(map(display_as_type, typing_extensions.get_args(obj)))\n try:\n return f'{obj.__qualname__}[{args}]'\n except AttributeError:\n return str(obj) # handles TypeAliasType in 3.12\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/_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": 87, "end_line": 96, "span_ids": ["all_literal_values"], "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 all_literal_values(type_: type[Any]) -> list[Any]:\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": 109, "end_line": 164, "span_ids": ["is_classvar", "is_new_type", "is_finalvar", "impl:37", "_check_finalvar", "is_annotated", "is_namedtuple", "_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 \"\"\"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 \"\"\"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['): # type: ignore\n return True\n\n return False\n\n\ndef _check_finalvar(v: type[Any] | None) -> bool:\n \"\"\"Check if a given type is a `typing.Final` type.\"\"\"\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: 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": 157, "end_line": 174, "span_ids": ["parent_frame_namespace"], "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 parent_frame_namespace(*, parent_depth: int = 2) -> dict[str, Any] | None:\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_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": 201, "end_line": 213, "span_ids": ["get_cls_type_hints_lenient"], "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_cls_type_hints_lenient(obj: Any, globalns: dict[str, Any] | None = None) -> dict[str, Any]:\n \"\"\"Collect annotations from a class, including those from parent classes.\n\n Unlike `typing.get_type_hints`, this function will not error if a forward reference is not resolvable.\n \"\"\"\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 hints[name] = eval_type_lenient(value, globalns, localns)\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/_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": 120, "end_line": 139, "span_ids": ["unique_list"], "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 unique_list(\n input_list: list[T] | tuple[T, ...],\n *,\n name_factory: typing.Callable[[T], str] = str,\n) -> list[T]:\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. model 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": 151, "end_line": 183, "span_ids": ["ValueItems.is_included", "ValueItems.for_element", "ValueItems.is_excluded", "ValueItems.__init__", "ValueItems"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValueItems(_repr.Representation):\n \"\"\"Class for more convenient calculation of excluded or included fields on values.\"\"\"\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)) # type: ignore\n\n self._items: MappingIntStrAny = items # type: ignore\n\n def is_excluded(self, item: Any) -> bool:\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 \"\"\"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 \"\"\":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 item = self._items.get(e) # type: ignore\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": 185, "end_line": 220, "span_ids": ["ValueItems._normalize_indexes"], "tokens": 407}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValueItems(_repr.Representation):\n\n def _normalize_indexes(self, items: MappingIntStrAny, v_length: int) -> dict[int | str, Any]:\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 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": 222, "end_line": 258, "span_ids": ["ValueItems.merge"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValueItems(_repr.Representation):\n\n @classmethod\n def merge(cls, base: Any, override: Any, intersect: bool = False) -> Any:\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": 251, "end_line": 273, "span_ids": ["ValueItems._coerce_items", "ValueItems._coerce_value", "ValueItems.__repr_args__", "ValueItems.is_true"], "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 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, ...) # type: ignore\n else:\n class_name = getattr(items, '__class__', '???')\n raise TypeError(f'Unexpected type of exclude value {class_name}')\n return items # type: ignore\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": 285, "end_line": 307, "span_ids": ["impl:14"], "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": "if typing.TYPE_CHECKING:\n\n def ClassAttribute(name: str, value: T) -> T:\n ...\n\nelse:\n\n class ClassAttribute:\n \"\"\"Hide class attribute from its instances.\"\"\"\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": 302, "end_line": 318, "span_ids": ["smart_deepcopy"], "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 smart_deepcopy(obj: Obj) -> Obj:\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 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() # tuple doesn't have copy method # type: ignore\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/_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": 158, "end_line": 185, "span_ids": ["ip_v6_address_validator", "compile_pattern", "impl", "ip_v4_address_validator"], "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": "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 ip_v4_address_validator(input_value: Any, /) -> 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, /) -> 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": 188, "end_line": 200, "span_ids": ["ip_v4_network_validator"], "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 ip_v4_network_validator(input_value: Any, /) -> IPv4Network:\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": 203, "end_line": 215, "span_ids": ["ip_v6_network_validator"], "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 ip_v6_network_validator(input_value: Any, /) -> IPv6Network:\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": 218, "end_line": 290, "span_ids": ["ip_v6_interface_validator", "less_than_validator", "forbid_inf_nan_check", "multiple_of_validator", "greater_than_or_equal_validator", "less_than_or_equal_validator", "ip_v4_interface_validator", "min_length_validator", "max_length_validator", "greater_than_validator"], "tokens": 538}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ip_v4_interface_validator(input_value: Any, /) -> 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, /) -> 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')\n\n\ndef greater_than_validator(x: Any, gt: Any) -> Any:\n if not (x > gt):\n raise PydanticKnownError('greater_than', {'gt': gt})\n return x\n\n\ndef greater_than_or_equal_validator(x: Any, ge: Any) -> Any:\n if not (x >= ge):\n raise PydanticKnownError('greater_than_equal', {'ge': ge})\n return x\n\n\ndef less_than_validator(x: Any, lt: Any) -> Any:\n if not (x < lt):\n raise PydanticKnownError('less_than', {'lt': lt})\n return x\n\n\ndef less_than_or_equal_validator(x: Any, le: Any) -> Any:\n if not (x <= le):\n raise PydanticKnownError('less_than_equal', {'le': le})\n return x\n\n\ndef multiple_of_validator(x: Any, multiple_of: Any) -> Any:\n if not (x % multiple_of == 0):\n raise PydanticKnownError('multiple_of', {'multiple_of': multiple_of})\n return x\n\n\ndef min_length_validator(x: Any, min_length: Any) -> Any:\n if not (len(x) >= min_length):\n raise PydanticKnownError(\n 'too_short',\n {'field_type': 'Value', 'min_length': min_length, 'actual_length': len(x)},\n )\n return x\n\n\ndef max_length_validator(x: Any, max_length: Any) -> Any:\n if len(x) > max_length:\n raise PydanticKnownError(\n 'too_long',\n {'field_type': 'Value', 'max_length': max_length, 'actual_length': len(x)},\n )\n return x\n\n\ndef forbid_inf_nan_check(x: Any) -> Any:\n if not math.isfinite(x):\n raise PydanticKnownError('finite_number')\n return x", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_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": 30, "end_line": 44, "span_ids": ["RGBA", "RGBA.__getitem__", "RGBA.__init__"], "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 RGBA:\n \"\"\"Internal use only as a representation of a color.\"\"\"\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": 49, "end_line": 68, "span_ids": ["RGBA.__getitem__", "impl:28", "impl:8"], "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 = rf'\\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 = rf'\\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 = rf'\\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 = rf'\\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.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": 137, "end_line": 153, "span_ids": ["Color.as_hex"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n\n def as_hex(self) -> str:\n \"\"\"Returns the hexadecimal representation of the color.\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 Returns:\n The hexadecimal representation of the color.\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": 155, "end_line": 163, "span_ids": ["Color.as_rgb"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n\n def as_rgb(self) -> str:\n \"\"\"Color as an `rgb(, , )` or `rgba(, , , )` string.\"\"\"\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": 165, "end_line": 189, "span_ids": ["Color.as_rgb_tuple"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n\n def as_rgb_tuple(self, *, alpha: Optional[bool] = None) -> ColorTuple:\n \"\"\"Returns the color as an RGB or RGBA tuple.\n\n Args:\n alpha: Whether to include the alpha channel. There are three options for this input:\n\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 Returns:\n A tuple that contains the values of the red, green, and blue channels in the range 0 to 255.\n If alpha is included, it is in the range 0 to 1.\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": 191, "end_line": 198, "span_ids": ["Color.as_hsl"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n\n def as_hsl(self) -> str:\n \"\"\"Color as an `hsl(, , )` or `hsl(, , , )` string.\"\"\"\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": 200, "end_line": 227, "span_ids": ["Color.as_hsl_tuple"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n\n def as_hsl_tuple(self, *, alpha: Optional[bool] = None) -> HslColorTuple:\n \"\"\"Returns the color as an HSL or HSLA tuple.\n\n Args:\n alpha: Whether to include the alpha channel.\n\n - `None` (default): Include the alpha channel only if it's set (e.g. not `None`).\n - `True`: Always include alpha.\n - `False`: Always omit alpha.\n\n Returns:\n The color as a tuple of hue, saturation, lightness, and alpha (if included).\n All elements are in the range 0 to 1.\n\n Note:\n This is HSL as used in HTML and most other places, not HLS as used in Python's `colorsys`.\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": 229, "end_line": 254, "span_ids": ["Color._alpha_float", "Color.__hash__", "Color.__get_pydantic_core_schema__", "Color.__repr_args__", "Color.__eq__", "Color.__str__", "Color._validate"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass 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__(\n cls, source: Type[Any], handler: Callable[[Any], CoreSchema]\n ) -> core_schema.CoreSchema:\n return core_schema.with_info_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": 265, "end_line": 284, "span_ids": ["parse_tuple"], "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 parse_tuple(value: Tuple[Any, ...]) -> RGBA:\n \"\"\"Parse a tuple or list to get RGBA values.\n\n Args:\n value: A tuple or list.\n\n Returns:\n An `RGBA` tuple parsed from the input tuple.\n\n Raises:\n PydanticCustomError: If tuple is not valid.\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": 276, "end_line": 332, "span_ids": ["parse_str"], "tokens": 511}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_str(value: str) -> RGBA:\n \"\"\"Parse a string representing a color to an RGBA tuple.\n\n Possible formats for the input string include:\n\n * named color, see `COLORS_BY_NAME`\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 Args:\n value: A string representing a color.\n\n Returns:\n An `RGBA` tuple parsed from the input string.\n\n Raises:\n ValueError: If the input string cannot be parsed to an RGBA tuple.\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/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": 26, "span_ids": ["imports"], "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": "from __future__ import annotations as _annotations\n\nimport typing\nfrom copy import deepcopy\nfrom enum import Enum\nfrom typing import Any, Tuple\n\nimport typing_extensions\n\nfrom .._internal import (\n _model_construction,\n _typing_extra,\n _utils,\n)\n\nif typing.TYPE_CHECKING:\n from .. import BaseModel\n from .._internal._utils import AbstractSetIntStr, MappingIntStrAny\n\n AnyClassMethod = classmethod[Any, Any, 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: typing_extensions.TypeAlias = '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__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": 98, "end_line": 120, "span_ids": ["_copy_and_set_values"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _copy_and_set_values(\n self: Model,\n values: dict[str, Any],\n fields_set: set[str],\n extra: dict[str, Any] | None = None,\n private: dict[str, Any] | None = None,\n *,\n deep: bool, # 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 extra = deepcopy(extra)\n private = deepcopy(private)\n\n cls = self.__class__\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', values)\n _object_setattr(m, '__pydantic_extra__', extra)\n _object_setattr(m, '__pydantic_fields_set__', fields_set)\n _object_setattr(m, '__pydantic_private__', private)\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": 113, "end_line": 185, "span_ids": ["_get_value"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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 .. 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, # type: ignore\n exclude=exclude, # type: ignore\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": 201, "end_line": 228, "span_ids": ["_calculate_keys"], "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 _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.__pydantic_fields_set__.copy()\n else:\n keys = set(self.__dict__.keys())\n keys = keys | (self.__pydantic_extra__ or {}).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": 29, "span_ids": ["imports", "isoformat"], "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": "import datetime\nimport warnings\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 TYPE_CHECKING, Any, Callable, Dict, Type, Union\nfrom uuid import UUID\n\nfrom typing_extensions import deprecated\n\nfrom ..color import Color\nfrom ..networks import NameEmail\nfrom ..types import SecretBytes, SecretStr\nfrom ..warnings import PydanticDeprecatedSince20\n\nif not TYPE_CHECKING:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\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": 26, "end_line": 44, "span_ids": ["decimal_encoder"], "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 decimal_encoder(dec_value: Decimal) -> Union[int, float]:\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": 53, "end_line": 78, "span_ids": ["impl:6"], "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": 81, "end_line": 108, "span_ids": ["pydantic_encoder"], "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": "@deprecated(\n '`pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.',\n category=None,\n)\ndef pydantic_encoder(obj: Any) -> Any:\n warnings.warn(\n '`pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.',\n category=PydanticDeprecatedSince20,\n stacklevel=2,\n )\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/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": 59, "end_line": 81, "span_ids": ["load_file"], "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": "@deprecated('`load_file` is deprecated.', category=None)\ndef load_file(\n path: str | Path,\n *,\n content_type: str | None = None,\n encoding: str = 'utf8',\n proto: Protocol | None = None,\n allow_pickle: bool = False,\n json_loads: Callable[[str], Any] = json.loads,\n) -> Any:\n warnings.warn('`load_file` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)\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/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": 289, "end_line": 333, "span_ids": ["BaseModel.model_dump"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.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 \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/serialization/#modelmodel_dump\n\n Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.\n\n Args:\n mode: The mode in which `to_python` should run.\n If mode is 'json', the output will only contain JSON serializable types.\n If mode is 'python', the output may contain non-JSON-serializable Python objects.\n include: A set of fields to include in the output.\n exclude: A set of fields to exclude from the output.\n by_alias: Whether to use the field's alias in the dictionary key if defined.\n exclude_unset: Whether to exclude fields that have not been explicitly set.\n exclude_defaults: Whether to exclude fields that are set to their default value.\n exclude_none: Whether to exclude fields that have a value of `None`.\n round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].\n warnings: Whether to log warnings when invalid fields are encountered.\n\n Returns:\n A dictionary representation of the model.\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": 327, "end_line": 369, "span_ids": ["BaseModel.model_dump_json"], "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 BaseModel(metaclass=_model_construction.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 \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/serialization/#modelmodel_dump_json\n\n Generates a JSON representation of the model using Pydantic's `to_json` method.\n\n Args:\n indent: Indentation to use in the JSON output. If None is passed, the output will be compact.\n include: Field(s) to include in the JSON output.\n exclude: Field(s) to exclude from the JSON output.\n by_alias: Whether to serialize using field aliases.\n exclude_unset: Whether to exclude fields that have not been explicitly set.\n exclude_defaults: Whether to exclude fields that are set to their default value.\n exclude_none: Whether to exclude fields that have a value of `None`.\n round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].\n warnings: Whether to log warnings when invalid fields are encountered.\n\n Returns:\n A JSON string representation of the model.\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": 199, "end_line": 259, "span_ids": ["BaseModel.model_construct"], "tokens": 678}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def model_construct(cls: type[Model], _fields_set: set[str] | None = None, **values: Any) -> Model:\n \"\"\"Creates a new instance of the `Model` class with validated data.\n\n Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data.\n Default values are respected, but no other validation is performed.\n\n !!! note\n `model_construct()` generally respects the `model_config.extra` setting on the provided model.\n That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__`\n and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored.\n Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in\n an error if extra values are passed, but they will be ignored.\n\n Args:\n _fields_set: The set of field names accepted for the Model instance.\n values: Trusted or pre-validated data dictionary.\n\n Returns:\n A new instance of the `Model` class with validated data.\n \"\"\"\n m = cls.__new__(cls)\n fields_values: dict[str, Any] = {}\n fields_set = set()\n\n for name, field in cls.model_fields.items():\n if field.alias and field.alias in values:\n fields_values[name] = values.pop(field.alias)\n fields_set.add(name)\n elif name in values:\n fields_values[name] = values.pop(name)\n fields_set.add(name)\n elif not field.is_required():\n fields_values[name] = field.get_default(call_default_factory=True)\n if _fields_set is None:\n _fields_set = fields_set\n\n _extra: dict[str, Any] | None = None\n if cls.model_config.get('extra') == 'allow':\n _extra = {}\n for k, v in values.items():\n _extra[k] = v\n _object_setattr(m, '__dict__', fields_values)\n _object_setattr(m, '__pydantic_fields_set__', _fields_set)\n if not cls.__pydantic_root_model__:\n _object_setattr(m, '__pydantic_extra__', _extra)\n\n if cls.__pydantic_post_init__:\n m.model_post_init(None)\n # update private attributes with values set\n if hasattr(m, '__pydantic_private__') and m.__pydantic_private__ is not None:\n for k, v in values.items():\n if k in m.__private_attributes__:\n m.__pydantic_private__[k] = v\n\n elif not cls.__pydantic_root_model__:\n # Note: if there are any private attributes, cls.__pydantic_post_init__ would exist\n # Since it doesn't, that means that `__pydantic_private__` should be set to None\n _object_setattr(m, '__pydantic_private__', None)\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/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": 423, "end_line": 477, "span_ids": ["BaseModel.model_rebuild"], "tokens": 550}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.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 _types_namespace: dict[str, Any] | None = None,\n ) -> bool | None:\n \"\"\"Try to rebuild the pydantic-core schema for the model.\n\n This may be necessary when one of the annotations is a ForwardRef which could not be resolved during\n the initial attempt to build the schema, and automatic rebuilding fails.\n\n Args:\n force: Whether to force the rebuilding of the model schema, defaults to `False`.\n raise_errors: Whether to raise errors, defaults to `True`.\n _parent_namespace_depth: The depth level of the parent namespace, defaults to 2.\n _types_namespace: The types namespace, defaults to `None`.\n\n Returns:\n Returns `None` if the schema is already \"complete\" and rebuilding was not required.\n If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`.\n \"\"\"\n if not force and cls.__pydantic_complete__:\n return None\n else:\n if '__pydantic_core_schema__' in cls.__dict__:\n delattr(cls, '__pydantic_core_schema__') # delete cached value to ensure full rebuild happens\n if _types_namespace is not None:\n types_namespace: dict[str, Any] | None = _types_namespace.copy()\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 = (\n _model_construction.unpack_lenient_weakvaluedict(cls.__pydantic_parent_namespace__) or {}\n )\n types_namespace = {**cls_parent_ns, **frame_parent_ns}\n cls.__pydantic_parent_namespace__ = _model_construction.build_lenient_weakvaluedict(types_namespace)\n else:\n types_namespace = _model_construction.unpack_lenient_weakvaluedict(\n cls.__pydantic_parent_namespace__\n )\n\n types_namespace = _typing_extra.get_cls_types_namespace(cls, types_namespace)\n\n # manually override defer_build so complete_model_class doesn't skip building the model again\n config = {**cls.model_config, 'defer_build': False}\n return _model_construction.complete_model_class(\n cls,\n cls.__name__,\n _config.ConfigWrapper(config, check=False),\n raise_errors=raise_errors,\n types_namespace=types_namespace,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 705, "end_line": 767, "span_ids": ["BaseModel.__class_getitem__"], "tokens": 656}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(metaclass=_model_construction.ModelMetaclass):\n\n def __class_getitem__(\n cls, typevar_values: type[Any] | tuple[type[Any], ...]\n ) -> type[BaseModel] | _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_metadata__['parameters'] and typing.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_metadata__['parameters'], 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_metadata__['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_metadata__['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: Make sure validation fails if there are still undefined types, perhaps using MockValidator\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.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": 1028, "end_line": 1066, "span_ids": ["BaseModel.json", "BaseModel.parse_obj"], "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(metaclass=_model_construction.ModelMetaclass):\n\n @typing_extensions.deprecated('The `json` method is deprecated; use `model_dump_json` instead.', category=None)\n def json( # noqa: D102\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 encoder: typing.Callable[[Any], Any] | None = PydanticUndefined, # type: ignore[assignment]\n models_as_dict: bool = PydanticUndefined, # type: ignore[assignment]\n **dumps_kwargs: Any,\n ) -> str:\n warnings.warn(\n 'The `json` method is deprecated; use `model_dump_json` instead.', category=PydanticDeprecatedSince20\n )\n if encoder is not PydanticUndefined:\n raise TypeError('The `encoder` argument is no longer supported; use field serializers instead.')\n if models_as_dict is not PydanticUndefined:\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 @typing_extensions.deprecated('The `parse_obj` method is deprecated; use `model_validate` instead.', category=None)\n def parse_obj(cls: type[Model], obj: Any) -> Model: # noqa: D102\n warnings.warn(\n 'The `parse_obj` method is deprecated; use `model_validate` instead.', category=PydanticDeprecatedSince20\n )\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": 1068, "end_line": 1119, "span_ids": ["BaseModel.parse_raw"], "tokens": 461}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated(\n 'The `parse_raw` method is deprecated; if your data is JSON use `model_validate_json`, '\n 'otherwise load the data then use `model_validate` instead.',\n category=None,\n )\n def parse_raw( # noqa: D102\n cls: type[Model],\n b: str | bytes,\n *,\n content_type: str | None = None,\n encoding: str = 'utf8',\n proto: DeprecatedParseProtocol | None = None,\n allow_pickle: bool = False,\n ) -> Model: # pragma: no cover\n warnings.warn(\n 'The `parse_raw` method is deprecated; if your data is JSON use `model_validate_json`, '\n 'otherwise load the data then use `model_validate` instead.',\n category=PydanticDeprecatedSince20,\n )\n from .deprecated import parse\n\n try:\n obj = 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 # The type: ignore on the next line is to ignore the requirement of LiteralString\n 'type': pydantic_core.PydanticCustomError(type_str, str(exc)), # type: ignore\n 'loc': ('__root__',),\n 'input': b,\n }\n raise pydantic_core.ValidationError.from_exception_data(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": 1121, "end_line": 1150, "span_ids": ["BaseModel.parse_file"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated(\n 'The `parse_file` method is deprecated; load the data from file, then if your data is JSON '\n 'use `model_validate_json`, otherwise `model_validate` instead.',\n category=None,\n )\n def parse_file( # noqa: D102\n cls: type[Model],\n path: str | Path,\n *,\n content_type: str | None = None,\n encoding: str = 'utf8',\n proto: DeprecatedParseProtocol | None = 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_validate_json`, otherwise `model_validate` instead.',\n category=PydanticDeprecatedSince20,\n )\n from .deprecated import parse\n\n obj = 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/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": 176, "end_line": 222, "span_ids": ["PydanticPlugin._pydantic_field_callback"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticPlugin(Plugin):\n\n def _pydantic_field_callback(self, ctx: FunctionContext) -> Type:\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": 252, "end_line": 295, "span_ids": ["PydanticPluginConfig.__init__", "PydanticPluginConfig", "PydanticPluginConfig.to_data"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticPluginConfig:\n \"\"\"A Pydantic mypy plugin config holder.\n\n Attributes:\n init_forbid_extra: Whether to add a `**kwargs` at the end of the generated `__init__` signature.\n init_typed: Whether to annotate fields in the generated `__init__`.\n warn_required_dynamic_aliases: Whether to raise required dynamic aliases error.\n debug_dataclass_transform: Whether to not reset `dataclass_transform_spec` attribute\n of `ModelMetaclass` for testing purposes.\n \"\"\"\n\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 \"\"\"Returns a dict of config names to their values.\"\"\"\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": 293, "end_line": 313, "span_ids": ["from_attributes_callback"], "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 from_attributes_callback(ctx: MethodContext) -> Type:\n \"\"\"Raise an error if from_attributes is not enabled.\"\"\"\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(model_type.type.name, 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.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": 523, "end_line": 597, "span_ids": ["PydanticModelTransformer.collect_config"], "tokens": 618}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def collect_config(self) -> ModelConfigData: # noqa: C901 (ignore complexity)\n \"\"\"Collects the values of the config attributes that are used by the plugin, accounting for parent classes.\"\"\"\n cls = self._cls\n config = ModelConfigData()\n\n has_config_kwargs = False\n has_config_from_namespace = False\n\n # Handle `class MyModel(BaseModel, =, ...):`\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 # Handle `model_config`\n stmt: Statement | None = None\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':\n continue\n\n if isinstance(stmt.rvalue, CallExpr): # calls to `dict` or `ConfigDict`\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, lax_extra=True))\n elif isinstance(stmt.rvalue, DictExpr): # dict literals\n for key_expr, value_expr in stmt.rvalue.items:\n if not isinstance(key_expr, StrExpr):\n continue\n config.update(self.get_config_update(key_expr.value, value_expr))\n\n elif 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 self._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 stmt\n and 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(self._api, stmt)\n\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 self._api.add_plugin_dependency(make_wildcard_trigger(info.fullname))\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.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": 833, "end_line": 861, "span_ids": ["PydanticModelTransformer.add_model_construct_method"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def add_model_construct_method(\n self, fields: list[PydanticModelField], config: ModelConfigData, is_settings: bool\n ) -> None:\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 set_str = self._api.named_type(f'{BUILTINS_NAME}.set', [self._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 with state.strict_optional_set(self._api.options.strict_optional):\n args = self.get_field_arguments(\n fields, typed=True, requires_dynamic_aliases=False, use_alias=False, is_settings=is_settings\n )\n if not self.should_init_forbid_extra(fields, config):\n var = Var('kwargs')\n args.append(Argument(var, AnyType(TypeOfAny.explicit), None, ARG_STAR2))\n\n args = [fields_set_argument] + args\n\n add_method(\n self._api,\n self._cls,\n 'model_construct',\n args=args,\n return_type=fill_typevars(self._cls.info),\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.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": 947, "end_line": 980, "span_ids": ["PydanticModelTransformer.get_config_update"], "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": "class PydanticModelTransformer:\n\n def get_config_update(self, name: str, arg: Expression, lax_extra: bool = False) -> ModelConfigData | None:\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 if not lax_extra:\n # Only emit an error for other types of `arg` (e.g., `NameExpr`, `ConditionalExpr`, etc.) when\n # reading from a config class, etc. If a ConfigDict is used, then we don't want to emit an error\n # because you'll get type checking from the ConfigDict itself.\n #\n # It would be nice if we could introspect the types better otherwise, but I don't know what the API\n # is to evaluate an expr into its type and then check if that type is compatible with the expected\n # type. Note that you can still get proper type checking via: `model_config = ConfigDict(...)`, just\n # if you don't use an explicit string, the plugin won't be able to infer whether extra is forbidden.\n error_invalid_config_value(name, self._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._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_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": 637, "end_line": 663, "span_ids": ["PydanticModelTransformer.get_alias_info"], "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 PydanticModelTransformer:\n\n @staticmethod\n def get_alias_info(stmt: AssignmentStmt) -> tuple[str | None, bool]:\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": 1032, "end_line": 1056, "span_ids": ["PydanticModelTransformer.get_field_arguments"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def get_field_arguments(\n self,\n fields: list[PydanticModelField],\n typed: bool,\n use_alias: bool,\n requires_dynamic_aliases: bool,\n is_settings: bool,\n ) -> list[Argument]:\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._cls.info\n arguments = [\n field.to_argument(\n info,\n typed=typed,\n force_optional=requires_dynamic_aliases or is_settings,\n use_alias=use_alias,\n api=self._api,\n )\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": 680, "end_line": 705, "span_ids": ["PydanticModelTransformer.should_init_forbid_extra", "PydanticModelTransformer.is_dynamic_alias_present"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def should_init_forbid_extra(self, fields: list[PydanticModelField], config: ModelConfigData) -> bool:\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 \"\"\"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_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": 804, "end_line": 838, "span_ids": ["ModelConfigData", "ModelConfigData.update", "ModelConfigData.__init__", "ModelConfigData.setdefault", "ModelConfigData.get_values_dict"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelConfigData:\n \"\"\"Pydantic mypy plugin model config class.\"\"\"\n\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 get_values_dict(self) -> dict[str, Any]:\n \"\"\"Returns a dict of Pydantic model config names to their values.\n\n It includes the config if config value is not `None`.\n \"\"\"\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 \"\"\"Update Pydantic model config values.\"\"\"\n if config is None:\n return\n for k, v in config.get_values_dict().items():\n setattr(self, k, v)\n\n def setdefault(self, key: str, value: Any) -> None:\n \"\"\"Set default value for Pydantic model config if config value is `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": 1057, "end_line": 1081, "span_ids": ["error_from_attributes", "impl:29", "error_invalid_config_value", "error_required_dynamic_aliases"], "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": "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')\nERROR_EXTRA_FIELD_ROOT_MODEL = ErrorCode('pydantic-field', 'Extra field on RootModel subclass', 'Pydantic')\n\n\ndef error_from_attributes(model_name: str, api: CheckerPluginInterface, context: Context) -> None:\n \"\"\"Emits an error when the model does not have `from_attributes=True`.\"\"\"\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 \"\"\"Emits an error when the config value is invalid.\"\"\"\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 \"\"\"Emits required dynamic aliases error.\n\n This will be called when `warn_required_dynamic_aliases=True`.\n \"\"\"\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_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": 1163, "end_line": 1248, "span_ids": ["add_method"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_method(\n api: SemanticAnalyzerPluginInterface | CheckerPluginInterface,\n cls: ClassDef,\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) -> None:\n \"\"\"Very closely related to `mypy.plugins.common.add_method_to_class`, with a few pydantic-specific changes.\"\"\"\n info = cls.info\n\n # First remove any previously generated methods with the same name\n # to avoid clashes and problems in the semantic analyzer.\n if name in info.names:\n sym = info.names[name]\n if sym.plugin_generated and isinstance(sym.node, FuncDef):\n cls.defs.body.remove(sym.node) # pragma: no cover\n\n if isinstance(api, SemanticAnalyzerPluginInterface):\n function_type = api.named_type('builtins.function')\n else:\n function_type = api.named_generic_type('builtins.function', [])\n\n if is_classmethod:\n self_type = self_type or TypeType(fill_typevars(info))\n first = [Argument(Var('_cls'), self_type, None, ARG_POS, True)]\n else:\n self_type = self_type or fill_typevars(info)\n # `self` is positional *ONLY* here, but this can't be expressed\n # fully in the mypy internal API. ARG_POS is the closest we can get.\n # Using ARG_POS will, however, give mypy errors if a `self` field\n # is present on a model:\n #\n # Name \"self\" already defined (possibly by an import) [no-redef]\n #\n # As a workaround, we give this argument a name that will\n # never conflict. By its positional nature, this name will not\n # be used or exposed to users.\n first = [Argument(Var('__pydantic_self__'), self_type, None, ARG_POS)]\n args = first + args\n\n arg_types, arg_names, arg_kinds = [], [], []\n for arg in args:\n assert arg.type_annotation, 'All arguments must be fully typed.'\n arg_types.append(arg.type_annotation)\n arg_names.append(arg.variable.name)\n arg_kinds.append(arg.kind)\n\n signature = CallableType(arg_types, arg_kinds, arg_names, return_type, function_type)\n if tvar_def:\n signature.variables = [tvar_def]\n\n func = FuncDef(name, args, Block([PassStmt()]))\n func.info = info\n func.type = set_callable_name(signature, func)\n func.is_class = is_classmethod\n func._fullname = info.fullname + '.' + name\n func.line = info.line\n\n # NOTE: we would like the plugin generated node to dominate, but we still\n # need to keep any existing definitions so they get semantically analyzed.\n if name in info.names:\n # Get a nice unique name instead.\n r_name = get_unique_redefinition_name(name, info.names)\n info.names[r_name] = info.names[name]\n\n # Add decorator for is_classmethod\n # The dataclasses plugin claims this is unnecessary for classmethods, but not including it results in a\n # signature incompatible with the superclass, which causes mypy errors to occur for every subclass of BaseModel.\n if is_classmethod:\n func.is_decorated = True\n v = Var(name, func.type)\n v.info = info\n v._fullname = func._fullname\n v.is_classmethod = True\n dec = Decorator(func, [NameExpr('classmethod')], v)\n dec.line = info.line\n sym = SymbolTableNode(MDEF, dec)\n else:\n sym = SymbolTableNode(MDEF, func)\n sym.plugin_generated = True\n info.names[name] = sym\n\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_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": 986, "end_line": 1007, "span_ids": ["parse_toml"], "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 parse_toml(config_file: str) -> dict[str, Any] | None:\n \"\"\"Returns a dict of config keys to values.\n\n It reads configs from toml file and returns `None` if the file is not a toml file.\n \"\"\"\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_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": 526, "end_line": 590, "span_ids": ["IPvAnyAddress.__get_pydantic_core_schema__", "IPvAnyAddress.__get_pydantic_json_schema__", "IPvAnyAddress._validate", "IPvAnyAddress.__new__", "IPvAnyAddress"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPvAnyAddress:\n \"\"\"Validate an IPv4 or IPv6 address.\n\n ```py\n from pydantic import BaseModel\n from pydantic.networks import IPvAnyAddress\n\n class IpModel(BaseModel):\n ip: IPvAnyAddress\n\n print(IpModel(ip='127.0.0.1'))\n #> ip=IPv4Address('127.0.0.1')\n\n try:\n IpModel(ip='http://www.example.com')\n except ValueError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'ip_any_address',\n 'loc': ('ip',),\n 'msg': 'value is not a valid IPv4 or IPv6 address',\n 'input': 'http://www.example.com',\n }\n ]\n '''\n ```\n \"\"\"\n\n __slots__ = ()\n\n def __new__(cls, value: Any) -> IPv4Address | IPv6Address:\n \"\"\"Validate an IPv4 or IPv6 address.\"\"\"\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 __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: _schema_generation_shared.GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = {}\n field_schema.update(type='string', format='ipvanyaddress')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n _source: type[Any],\n _handler: GetCoreSchemaHandler,\n ) -> core_schema.CoreSchema:\n return core_schema.no_info_plain_validator_function(\n cls._validate, serialization=core_schema.to_string_ser_schema()\n )\n\n @classmethod\n def _validate(cls, input_value: Any, /) -> 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": 593, "end_line": 630, "span_ids": ["IPvAnyInterface.__new__", "IPvAnyInterface.__get_pydantic_json_schema__", "IPvAnyInterface", "IPvAnyInterface.__get_pydantic_core_schema__", "IPvAnyInterface._validate"], "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 IPvAnyInterface:\n \"\"\"Validate an IPv4 or IPv6 interface.\"\"\"\n\n __slots__ = ()\n\n def __new__(cls, value: NetworkType) -> IPv4Interface | IPv6Interface:\n \"\"\"Validate an IPv4 or IPv6 interface.\"\"\"\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 __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: _schema_generation_shared.GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = {}\n field_schema.update(type='string', format='ipvanyinterface')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n _source: type[Any],\n _handler: GetCoreSchemaHandler,\n ) -> core_schema.CoreSchema:\n return core_schema.no_info_plain_validator_function(\n cls._validate, serialization=core_schema.to_string_ser_schema()\n )\n\n @classmethod\n def _validate(cls, input_value: NetworkType, /) -> 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": 595, "end_line": 612, "span_ids": ["IPvAnyNetwork.__new__", "IPvAnyNetwork"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPvAnyNetwork:\n \"\"\"Validate an IPv4 or IPv6 network.\"\"\"\n\n __slots__ = ()\n\n def __new__(cls, value: NetworkType) -> IPv4Network | IPv6Network:\n \"\"\"Validate an IPv4 or IPv6 network.\"\"\"\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/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": 1618, "end_line": 1634, "span_ids": ["PaymentCardNumber.validate_luhn_check_digit"], "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": "@deprecated(\n 'The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_payment/#pydantic_extra_types.payment.PaymentCardNumber.',\n category=PydanticDeprecatedSince20,\n)\nclass PaymentCardNumber(str):\n\n @classmethod\n def validate_luhn_check_digit(cls, card_number: str) -> str:\n \"\"\"Based on: https://en.wikipedia.org/wiki/Luhn_algorithm.\"\"\"\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": 1636, "end_line": 1669, "span_ids": ["PaymentCardNumber.validate_brand"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@deprecated(\n 'The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_payment/#pydantic_extra_types.payment.PaymentCardNumber.',\n category=PydanticDeprecatedSince20,\n)\nclass PaymentCardNumber(str):\n\n @staticmethod\n def validate_brand(card_number: str) -> PaymentCardBrand:\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/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": 40}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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={'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": 22, "span_ids": ["impl:3", "WrapperModel", "Model", "docstring"], "tokens": 96}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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": 50, "span_ids": ["Model.validate_3", "impl", "imports", "Model.validate_2", "Model.validate_1", "impl:10", "bar", "Model", "impl:8", "foo"], "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": "from typing import Any\n\nfrom pydantic import BaseModel, root_validator, validate_call\n\n\n@validate_call\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_call\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\n\n\nModel.non_existent_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/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/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": 58, "span_ids": ["Flags.__str__", "Flags", "docstring"], "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": "\"\"\"\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, ClassVar, 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 FilePath,\n FutureDate,\n FutureDatetime,\n ImportString,\n Json,\n NaiveDatetime,\n NegativeFloat,\n NegativeInt,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n PastDate,\n PastDatetime,\n PositiveFloat,\n PositiveInt,\n StrictBool,\n StrictBytes,\n StrictFloat,\n StrictInt,\n StrictStr,\n UrlConstraints,\n WrapValidator,\n create_model,\n field_validator,\n model_validator,\n root_validator,\n validate_call,\n)\nfrom pydantic.fields import Field, PrivateAttr\nfrom pydantic.json_schema import Examples\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": 77, "end_line": 187, "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_call\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_call(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": 192, "end_line": 243, "span_ids": ["impl:56", "PydanticTypes", "MyPrivateAttr"], "tokens": 575}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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(validate_default=True)\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 import_string_str: 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 = 'a8098c1a-f86e-11da-bd1a-00112444be1e'\n # Path\n my_file_path: FilePath = Path(__file__)\n my_file_path_str: FilePath = __file__\n my_dir_path: DirectoryPath = Path('.')\n my_dir_path_str: DirectoryPath = '.'\n # Json\n my_json: Json[Dict[str, str]] = '{\"hello\": \"world\"}'\n my_json_list: 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_past_datetime: PastDatetime = datetime.now() - timedelta(1)\n my_future_datetime: FutureDatetime = datetime.now() + timedelta(1)\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": 249, "end_line": 324, "span_ids": ["SomeDict", "WrapValidatorModel", "CustomPath", "impl:73", "Abstract", "Square", "two_dim_shape_validator", "Concrete", "CustomPath.__fspath__", "impl:76", "UrlModel", "impl:80", "double", "impl:62", "CustomPath.__init__"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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='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\nDynamicModel = create_model('DynamicModel')\n\nexamples = Examples({})\n\n\ndef double(value: Any, handler: Any) -> int:\n return handler(value) * 2\n\n\nclass WrapValidatorModel(BaseModel):\n x: Annotated[int, WrapValidator(double)]\n\n\nclass Abstract(BaseModel):\n class_id: ClassVar\n\n\nclass Concrete(Abstract):\n class_id = 1\n\n\ndef two_dim_shape_validator(v: Dict[str, Any]) -> Dict[str, Any]:\n assert 'volume' not in v, 'shape is 2d, cannot have volume'\n return v\n\n\nclass Square(BaseModel):\n width: float\n height: float\n\n free_validator = model_validator(mode='before')(two_dim_shape_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/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/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": 59, "span_ids": ["Square.area", "Knight", "MyModel", "impl", "Square2.area", "Square", "impl:7", "Square.area_1", "impl:5", "docstring", "Square2", "impl:13"], "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": "\"\"\"\nThis file is used to test pyright's ability to check pydantic code.\n\"\"\"\n\nfrom functools import cached_property\nfrom typing import List\n\nfrom pydantic import BaseModel, Field, computed_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\n\n\nclass Square(BaseModel):\n side: float\n\n @computed_field\n @property\n def area(self) -> float:\n return self.side**2\n\n @area.setter\n def area(self, area: float) -> None:\n self.side = area**0.5\n\n\nsq = Square(side=10)\ny = 12.4 + sq.area\nz = 'x' + sq.area # type: ignore\n\n\nclass Square2(BaseModel):\n side: float\n\n @computed_field\n @cached_property\n def area(self) -> float:\n return self.side**2\n\n\nsq = Square(side=10)\ny = 12.4 + sq.area\nz = 'x' + sq.area # 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/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": 49, "span_ids": ["imports", "test_model_subclassing_abstract_base_classes", "test_model_subclassing_abstract_base_classes_without_implementation_raises_exception"], "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": "import abc\nimport sys\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\n@pytest.mark.skipif(sys.version_info < (3, 12), reason='error value different on older versions')\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 without an implementation for 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": 33, "span_ids": ["imports", "test_alias_generator"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from contextlib import nullcontext as does_not_raise\nfrom inspect import signature\nfrom typing import Any, ContextManager, List, Optional\n\nimport pytest\nfrom dirty_equals import IsStr\n\nfrom pydantic import (\n AliasChoices,\n AliasGenerator,\n AliasPath,\n BaseModel,\n ConfigDict,\n Field,\n ValidationError,\n computed_field,\n)\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_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": 62, "end_line": 77, "span_ids": ["test_alias_error"], "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_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(include_url=False) == [\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": 80, "end_line": 107, "span_ids": ["test_alias_error_loc_by_alias", "test_annotation_config"], "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_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(include_url=False) == [\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": 110, "end_line": 126, "span_ids": ["test_pop_by_field_name"], "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_pop_by_field_name():\n class Model(BaseModel):\n model_config = ConfigDict(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(include_url=False) == [\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": 129, "end_line": 171, "span_ids": ["test_alias_override_behavior"], "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_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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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_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_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": 49, "span_ids": ["_pformat_lines", "_assert_eq", "test_assert_raises_validation_error", "docstring"], "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": "\"\"\"\nPYTEST_DONT_REWRITE\n\"\"\"\nimport difflib\nimport pprint\n\nimport pytest\nfrom dirty_equals import HasRepr\n\nfrom pydantic import BaseModel, ValidationError, field_validator\n\n\ndef _pformat_lines(obj):\n return pprint.pformat(obj).splitlines(keepends=True)\n\n\ndef _assert_eq(left, right):\n if left != right:\n pytest.fail('\\n' + '\\n'.join(difflib.ndiff(_pformat_lines(left), _pformat_lines(right))))\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 _assert_eq(\n [\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('invalid a')))},\n 'input': 'snap',\n 'loc': ('a',),\n 'msg': 'Assertion failed, invalid a',\n 'type': 'assertion_error',\n }\n ],\n exc_info.value.errors(include_url=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_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": 74, "span_ids": ["test_color_success", "imports"], "tokens": 1292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\npytestmark = pytest.mark.filterwarnings(\n 'ignore:The `Color` class is deprecated, use `pydantic_extra_types` instead.*:DeprecationWarning'\n)\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": 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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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__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.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": 101, "end_line": 119, "span_ids": ["TestsBaseConfig.test_base_config_custom_init_signature"], "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 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 model_config = ConfigDict(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": 121, "end_line": 176, "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": 447}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 model_config = ConfigDict(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 model_config = ConfigDict(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 model_config = ConfigDict(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 model_config = ConfigDict(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 model_config = ConfigDict(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 model_config = ConfigDict(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_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": 196, "end_line": 209, "span_ids": ["TestsBaseConfig.test_base_config_parse_model_with_strict_config_disabled"], "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 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 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_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": 211, "end_line": 228, "span_ids": ["TestsBaseConfig.test_finite_float_config"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestsBaseConfig:\n\n def test_finite_float_config(self):\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 230, "end_line": 245, "span_ids": ["TestsBaseConfig.test_str_strip_whitespace"], "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 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 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_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": 247, "end_line": 293, "span_ids": ["TestsBaseConfig.test_namedtuple_arbitrary_type", "TestsBaseConfig.test_str_to_lower", "TestsBaseConfig.test_str_to_upper"], "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 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 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 @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 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 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 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 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": 295, "end_line": 327, "span_ids": ["TestsBaseConfig.test_populate_by_name_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": "class 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 model_config = dict(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_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": 380, "end_line": 395, "span_ids": ["TestsBaseConfig.test_config_class_missing_attributes"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestsBaseConfig:\n\n @pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\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": 407, "end_line": 465, "span_ids": ["test_config_key_deprecation"], "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_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* 'schema_extra' has been renamed to 'json_schema_extra'\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* '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_call(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_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": 86, "span_ids": ["test_construct_misuse", "test_construct_fields_set", "test_construct_ignore_extra", "test_simple_construct", "imports", "test_construct_keep_order", "test_large_any_str", "Model", "test_construct_allow_extra"], "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": "import pickle\nfrom typing import Any, List, Optional\n\nimport pytest\nfrom pydantic_core import PydanticUndefined, ValidationError\n\nfrom pydantic import BaseModel, ConfigDict, Field, PrivateAttr, PydanticDeprecatedSince20\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.model_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.model_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 only in the case of extra='allow'\"\"\"\n\n class Foo(BaseModel, extra='allow'):\n x: int\n\n model = Foo.model_construct(x=1, y=2)\n assert model.x == 1\n assert model.y == 2\n\n\n@pytest.mark.parametrize('extra', ['ignore', 'forbid'])\ndef test_construct_ignore_extra(extra: str) -> None:\n \"\"\"model_construct() should ignore extra fields only in the case of extra='ignore' or extra='forbid'\"\"\"\n\n class Foo(BaseModel, extra=extra):\n x: int\n\n model = Foo.model_construct(x=1, y=2)\n assert model.x == 1\n assert model.__pydantic_extra__ is None\n assert 'y' not in model.__dict__\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": 77, "end_line": 89, "span_ids": ["deprecated_copy"], "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 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 PydanticDeprecatedSince20,\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": 258, "end_line": 288, "span_ids": ["test_copy_deep_extra", "test_copy_set_fields", "ExtraModel", "test_copy_update_unset"], "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_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\nclass ExtraModel(BaseModel, extra='allow'):\n pass\n\n\ndef test_copy_deep_extra(copy_method):\n class Foo(BaseModel, extra='allow'):\n pass\n\n m = Foo(extra=[])\n assert copy_method(m).extra is m.extra\n assert copy_method(m, deep=True).extra == m.extra\n assert copy_method(m, deep=True).extra is not m.extra\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": 330, "end_line": 353, "span_ids": ["test_pickle_undefined"], "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_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_ = PydanticUndefined\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_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": 396, "end_line": 419, "span_ids": ["test_copy_update_exclude"], "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_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 PydanticDeprecatedSince20,\n 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": 440, "end_line": 532, "span_ids": ["test_retain_order_of_fields", "test_dunder_copy", "test_construct_default_factory", "test_pydantic_extra", "test_model_copy", "test_dunder_deepcopy", "test_copy_with_excluded_fields", "test_initialize_with_private_attr"], "tokens": 612}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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.model_fields_set\n assert 'dob' not in user_copy.model_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\n\n\ndef test_pydantic_extra():\n class Model(BaseModel):\n model_config = dict(extra='allow')\n x: int\n\n m = Model.model_construct(x=1, y=2)\n assert m.__pydantic_extra__ == {'y': 2}\n\n\ndef test_retain_order_of_fields():\n class MyModel(BaseModel):\n a: str = 'a'\n b: str\n\n m = MyModel.model_construct(b='b')\n\n assert m.model_dump_json() == '{\"a\":\"a\",\"b\":\"b\"}'\n\n\ndef test_initialize_with_private_attr():\n class MyModel(BaseModel):\n _a: str\n\n m = MyModel.model_construct(_a='a')\n\n assert m._a == 'a'\n assert '_a' in m.__pydantic_private__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 96, "end_line": 131, "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(ValidationError):\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='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": 185, "end_line": 195, "span_ids": ["test_inheritance_validators_all"], "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_inheritance_validators_all():\n with pytest.warns(PydanticDeprecatedSince20, 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": 180, "end_line": 188, "span_ids": ["test_funky_name"], "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_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(include_url=False) == [\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_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": 65, "span_ids": ["imports", "test_model_name", "test_simple"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import dataclasses\nimport inspect\nimport pickle\nimport re\nimport sys\nimport traceback\nfrom collections.abc import Hashable\nfrom dataclasses import InitVar\nfrom datetime import date, datetime\nfrom pathlib import Path\nfrom typing import Any, Callable, ClassVar, Dict, FrozenSet, Generic, List, Optional, Set, TypeVar, Union\n\nimport pytest\nfrom dirty_equals import HasRepr\nfrom pydantic_core import ArgsKwargs, CoreSchema, SchemaValidator, core_schema\nfrom typing_extensions import Annotated, Literal\n\nimport pydantic\nfrom pydantic import (\n BaseModel,\n BeforeValidator,\n ConfigDict,\n GenerateSchema,\n PydanticDeprecatedSince20,\n PydanticUndefinedAnnotation,\n PydanticUserError,\n RootModel,\n TypeAdapter,\n ValidationError,\n ValidationInfo,\n computed_field,\n field_serializer,\n field_validator,\n model_validator,\n with_config,\n)\nfrom pydantic._internal._mock_val_ser import MockValSer\nfrom pydantic.dataclasses import is_pydantic_dataclass, rebuild_dataclass\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": 46, "end_line": 63, "span_ids": ["test_value_error"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 90, "end_line": 106, "span_ids": ["test_validate_assignment_error"], "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_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(include_url=False) == [\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": 138, "end_line": 161, "span_ids": ["test_validate_assignment_extra_unknown_field_assigned_allowed"], "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 'config',\n [\n ConfigDict(validate_assignment=False),\n ConfigDict(extra=None),\n ConfigDict(extra='forbid'),\n ConfigDict(extra='ignore'),\n ConfigDict(validate_assignment=False, extra=None),\n ConfigDict(validate_assignment=False, extra='forbid'),\n ConfigDict(validate_assignment=False, extra='ignore'),\n ConfigDict(validate_assignment=False, extra='allow'),\n ConfigDict(validate_assignment=True, 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": 164, "end_line": 192, "span_ids": ["test_validate_assignment_extra_unknown_field_assigned_errors"], "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 'config',\n [\n ConfigDict(validate_assignment=True),\n ConfigDict(validate_assignment=True, extra=None),\n ConfigDict(validate_assignment=True, extra='forbid'),\n ConfigDict(validate_assignment=True, 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(include_url=False) == [\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": 315, "end_line": 342, "span_ids": ["test_post_init_assignment", "test_post_init_post_parse"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_post_init_post_parse():\n with pytest.warns(PydanticDeprecatedSince20, 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": 347, "end_line": 364, "span_ids": ["test_validate_long_string_error"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 367, "end_line": 395, "span_ids": ["test_validate_assignment_long_string_error", "test_no_validate_assignment_long_string_error"], "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_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(include_url=False) == [\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": 419, "end_line": 458, "span_ids": ["test_nested_dataclass"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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': {'class_name': 'Nested'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Outer(n={'number': 'x'})\n assert exc_info.value.errors(include_url=False) == [\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": 440, "end_line": 464, "span_ids": ["test_arbitrary_types_allowed"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 519, "end_line": 536, "span_ids": ["test_default_factory_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.parametrize('field_constructor', [dataclasses.field, pydantic.dataclasses.Field])\ndef test_default_factory_field(field_constructor: Callable):\n @pydantic.dataclasses.dataclass\n class User:\n id: int\n other: Dict[str, str] = field_constructor(default_factory=lambda: {'John': 'Joey'})\n\n user = User(id=123)\n\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": 558, "end_line": 584, "span_ids": ["test_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_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 '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_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": 644, "end_line": 660, "span_ids": ["test_initvars_post_init"], "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_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_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": 816, "end_line": 855, "span_ids": ["test_override_builtin_dataclass_nested"], "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_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 FileChecked = pydantic.dataclasses.dataclass(File, config=ConfigDict(revalidate_instances='always'))\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 # insert_assert(e.value.errors(include_url=False))\n assert e.value.errors(include_url=False) == [\n {'type': 'int_type', 'loc': ('meta', 'seen_count'), 'msg': 'Input should be a valid integer', 'input': ['7']}\n ]\n\n class Foo(\n BaseModel,\n ):\n file: File\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": 868, "end_line": 901, "span_ids": ["test_inherit_builtin_dataclass", "test_forward_stdlib_dataclass_params"], "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_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\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": 958, "end_line": 981, "span_ids": ["test_pickle_overridden_builtin_dataclass"], "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_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(config=pydantic.config.ConfigDict(validate_assignment=True))\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_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": 1341, "end_line": 1382, "span_ids": ["test_discriminated_union_basemodel_instance_value"], "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": "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 # insert_assert(model_json_schema(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': {\n 'properties': {'l': {'const': 'a', 'enum': ['a'], 'title': 'L', 'type': 'string'}},\n 'required': ['l'],\n 'title': 'A',\n 'type': 'object',\n },\n 'B': {\n 'properties': {'l': {'const': 'b', 'enum': ['b'], 'title': 'L', 'type': 'string'}},\n 'required': ['l'],\n 'title': 'B',\n 'type': 'object',\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_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_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": 1358, "end_line": 1386, "span_ids": ["test_ignore_extra", "test_ignore_extra_subclass", "test_allow_extra"], "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_ignore_extra():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra='ignore'))\n class Foo:\n x: int\n\n foo = Foo(**{'x': '1', 'y': '2'})\n assert foo.__dict__ == {'x': 1}\n\n\ndef test_ignore_extra_subclass():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra='ignore'))\n class Foo:\n x: int\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(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='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_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": 1849, "end_line": 1884, "span_ids": ["test_config_as_type_deprecated", "test_validator_info_field_name_data_before"], "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_config_as_type_deprecated():\n class Config:\n validate_assignment = True\n\n with pytest.warns(\n PydanticDeprecatedSince20, match='Support for class-based `config` is deprecated, use ConfigDict instead.'\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: ValidationInfo) -> 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": 1866, "end_line": 1904, "span_ids": ["test_inheritance_replace"], "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": "@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, [], ['parent before', 'child', 'parent after', 'child before', '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')\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 # ... 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": 1906, "end_line": 1927, "span_ids": ["test_inheritance_replace"], "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 '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, [], ['parent before', 'child', 'parent after', 'child before', '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')\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 == 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_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": 156, "end_line": 197, "span_ids": ["test_datetime_parsing"], "tokens": 1087}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, tzinfo=timezone.utc)),\n (1_494_012_444, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),\n # values in ms\n (1_494_012_444_000, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),\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, tzinfo=timezone.utc)),\n # Numeric inputs as strings\n ('1494012444.883309', datetime(2017, 5, 5, 19, 27, 24, 883309, tzinfo=timezone.utc)),\n ('1494012444', datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),\n (b'1494012444', datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),\n ('1494012444000.883309', datetime(2017, 5, 5, 19, 27, 24, 883301, tzinfo=timezone.utc)),\n ('-1494012444000.883309', datetime(1922, 8, 29, 4, 32, 35, 999000, tzinfo=timezone.utc)),\n (19_999_999_999, datetime(2603, 10, 11, 11, 33, 19, tzinfo=timezone.utc)), # just before watershed\n (20_000_000_001, datetime(1970, 8, 20, 11, 33, 20, 1000, tzinfo=timezone.utc)), # just after watershed\n (1_549_316_052, datetime(2019, 2, 4, 21, 34, 12, 0, tzinfo=timezone.utc)), # nowish in s\n (1_549_316_052_104, datetime(2019, 2, 4, 21, 34, 12, 104_000, tzinfo=timezone.utc)), # nowish in ms\n # Invalid inputs\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 (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": 205, "end_line": 266, "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": 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_aware_datetime_validation_success(aware_datetime_type):\n class Model(BaseModel):\n foo: aware_datetime_type\n\n value = datetime.now(tz=timezone.utc)\n\n assert Model(foo=value).foo == value\n\n\ndef test_aware_datetime_validation_fails(aware_datetime_type):\n class Model(BaseModel):\n foo: aware_datetime_type\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(include_url=False) == [\n {\n 'type': 'timezone_aware',\n 'loc': ('foo',),\n 'msg': 'Input should have timezone info',\n 'input': value,\n }\n ]\n\n\ndef test_naive_datetime_validation_success(naive_datetime_type):\n class Model(BaseModel):\n foo: naive_datetime_type\n\n value = datetime.now()\n\n assert Model(foo=value).foo == value\n\n\ndef test_naive_datetime_validation_fails(naive_datetime_type):\n class Model(BaseModel):\n foo: naive_datetime_type\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(include_url=False) == [\n {\n 'type': 'timezone_naive',\n 'loc': ('foo',),\n 'msg': 'Input 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": 339, "end_line": 367, "span_ids": ["test_model_type_errors"], "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 '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(include_url=False)) == 1\n error = exc_info.value.errors(include_url=False)[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": 370, "end_line": 407, "span_ids": ["test_unicode_decode_error", "test_nan"], "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('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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 433, "end_line": 469, "span_ids": ["test_past_date_validation_fails", "test_past_date_validation_success"], "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": "@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, past_date_type):\n class Model(BaseModel):\n foo: past_date_type\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, past_date_type):\n class Model(BaseModel):\n foo: past_date_type\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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": 42, "span_ids": ["imports", "deprecated_from_orm"], "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": "import platform\nimport re\nfrom datetime import date, timedelta\nfrom pathlib import Path\nfrom types import SimpleNamespace\nfrom typing import Any, Dict, Iterable, List, Type\n\nimport pytest\nfrom pydantic_core import CoreSchema, core_schema\nfrom typing_extensions import Literal\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n Field,\n GetCoreSchemaHandler,\n GetJsonSchemaHandler,\n PydanticDeprecatedSince20,\n PydanticUserError,\n ValidationError,\n conlist,\n root_validator,\n)\nfrom pydantic.config import Extra\nfrom pydantic.deprecated.decorator import validate_arguments\nfrom pydantic.deprecated.json import custom_pydantic_encoder, pydantic_encoder, timedelta_isoformat\nfrom pydantic.deprecated.parse import load_file, load_str_bytes\nfrom pydantic.deprecated.tools import parse_obj_as, schema_json_of, schema_of\nfrom pydantic.functional_serializers import model_serializer\nfrom pydantic.json_schema import JsonSchemaValue\nfrom pydantic.type_adapter import TypeAdapter\n\n\ndef deprecated_from_orm(model_type: Type[BaseModel], obj: Any) -> Any:\n with pytest.warns(\n PydanticDeprecatedSince20,\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_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_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": 260, "end_line": 284, "span_ids": ["test_nested_orm", "test_parse_raw_pass"], "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_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(PydanticDeprecatedSince20, 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_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": 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_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 = TypeAdapter(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(include_url=False) == [\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_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": 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_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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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": 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_discriminated_annotated_union():\n # ... other code\n assert exc_info.value.errors(include_url=False) == [\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": 315, "span_ids": ["test_discriminated_union_basemodel_instance_value_with_alias"], "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_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\n assert exc_info.value.errors(include_url=False) == [\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": 348, "end_line": 369, "span_ids": ["test_discriminated_union_int"], "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_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(include_url=False) == [\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": 342, "end_line": 360, "span_ids": ["FooStrEnum", "impl", "FooIntEnum"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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}),\n pytest.param(Enum, {'a': 'v_a', 'b': 'v_b'}),\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": 363, "end_line": 393, "span_ids": ["test_discriminated_union_enum"], "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": "@pytest.mark.skipif(sys.version_info[:2] == (3, 8), reason='https://github.com/python/cpython/issues/103592')\n@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 if isinstance(EnumValue.b, (int, str)):\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!r}, {EnumValue.b!r}'\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'union_tag_invalid',\n 'loc': ('sub',),\n 'msg': f\"Input tag '3' found using 'm' does not match any of the expected tags: {expected_tags}\",\n 'input': {'m': 3},\n 'ctx': {'discriminator': \"'m'\", 'tag': '3', 'expected_tags': expected_tags},\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": 452, "end_line": 495, "span_ids": ["test_generic"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 with pytest.raises(ValidationError, match=r'Container\\[str\\]\\nresult\\.Success\\.data') as exc_info:\n Container[str].model_validate({'result': {'type': 'Success'}})\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False) == [\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": 542, "span_ids": ["test_optional_union"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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(include_url=False) == [\n {'input': {}, 'loc': ('pet',), 'msg': 'Field required', 'type': 'missing'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Pet(pet={'name': 'Benji'})\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False) == [\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": 545, "end_line": 584, "span_ids": ["test_optional_union_with_defaults"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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(include_url=False) == [\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(include_url=False) == [\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": 626, "end_line": 672, "span_ids": ["test_nested_optional_unions"], "tokens": 545}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'union_tag_invalid',\n 'loc': ('pet',),\n 'msg': \"Input tag 'None' found using 'pet_type' does not match any of the expected tags: 'cat', 'dog', 'lizard', 'reptile'\",\n 'input': {'pet_type': None},\n 'ctx': {'discriminator': \"'pet_type'\", 'tag': 'None', 'expected_tags': \"'cat', 'dog', 'lizard', 'reptile'\"},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Pet.model_validate({'pet': {'pet_type': 'fox'}})\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'union_tag_invalid',\n 'loc': ('pet',),\n 'msg': \"Input tag 'fox' found using 'pet_type' does not match any of the expected tags: 'cat', 'dog', 'lizard', 'reptile'\",\n 'input': {'pet_type': 'fox'},\n 'ctx': {'discriminator': \"'pet_type'\", 'tag': 'fox', 'expected_tags': \"'cat', 'dog', 'lizard', 'reptile'\"},\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": 675, "end_line": 710, "span_ids": ["test_nested_discriminated_union"], "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_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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'union_tag_invalid',\n 'loc': ('pet',),\n 'msg': \"Input tag 'reptile' found using 'pet_type' does not match any of the expected tags: 'cat', 'CAT', 'dog', 'DOG', 'lizard', 'LIZARD'\",\n 'input': {'pet_type': 'reptile'},\n 'ctx': {\n 'discriminator': \"'pet_type'\",\n 'tag': 'reptile',\n 'expected_tags': \"'cat', 'CAT', 'dog', 'DOG', 'lizard', 'LIZARD'\",\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_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": 736, "end_line": 760, "span_ids": ["test_union_discriminator_literals"], "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_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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'union_tag_invalid',\n 'loc': ('pet',),\n 'msg': \"Input tag 'Cat' found using 'pet_type' | 'typeOfPet' does not match any of the expected tags: 'cat', 'CAT', 'dog'\",\n 'input': {'typeOfPet': 'Cat'},\n 'ctx': {'discriminator': \"'pet_type' | 'typeOfPet'\", 'tag': 'Cat', 'expected_tags': \"'cat', 'CAT', 'dog'\"},\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": 730, "end_line": 751, "span_ids": ["test_none_schema"], "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_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(include_url=False) == [\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": 754, "end_line": 782, "span_ids": ["test_nested_unwrapping"], "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_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(include_url=False) == [\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_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_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": 879, "end_line": 910, "span_ids": ["test_wrap_function_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": "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.with_info_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': 'with-info',\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": 913, "end_line": 943, "span_ids": ["test_invalid_str_choice_discriminator_values", "test_plain_function_schema_is_invalid"], "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_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.with_info_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.with_info_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": 963, "end_line": 1025, "span_ids": ["test_lax_or_strict_definitions"], "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_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 # insert_assert(discriminated_schema)\n assert discriminated_schema == {\n 'type': 'tagged-union',\n 'choices': {\n 'cat': {\n 'type': 'typed-dict',\n 'fields': {'kind': {'type': 'typed-dict-field', 'schema': {'type': 'literal', 'expected': ['cat']}}},\n },\n 'DOG': {\n 'type': 'lax-or-strict',\n 'lax_schema': {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {'type': 'typed-dict-field', 'schema': {'type': 'literal', 'expected': ['DOG']}}\n },\n },\n 'strict_schema': {\n 'type': 'definitions',\n 'schema': {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {'type': 'typed-dict-field', 'schema': {'type': 'literal', 'expected': ['dog']}}\n },\n },\n 'definitions': [{'type': 'int', 'ref': 'my-int-definition'}],\n },\n },\n 'dog': {\n 'type': 'lax-or-strict',\n 'lax_schema': {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {'type': 'typed-dict-field', 'schema': {'type': 'literal', 'expected': ['DOG']}}\n },\n },\n 'strict_schema': {\n 'type': 'definitions',\n 'schema': {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {'type': 'typed-dict-field', 'schema': {'type': 'literal', 'expected': ['dog']}}\n },\n },\n 'definitions': [{'type': 'int', 'ref': 'my-int-definition'}],\n },\n },\n },\n 'discriminator': 'kind',\n 'strict': False,\n 'from_attributes': 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_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": 50, "end_line": 81, "span_ids": ["test_str_bytes", "test_str_bytes_none"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 84, "end_line": 128, "span_ids": ["test_union_int_any", "test_union_int_str"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 131, "end_line": 161, "span_ids": ["test_typed_list"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 164, "end_line": 181, "span_ids": ["test_typed_set"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 217, "end_line": 244, "span_ids": ["test_typed_dict_error"], "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": "@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(include_url=False) == 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": 247, "end_line": 271, "span_ids": ["test_dict_key_error", "test_tuple"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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": 388, "end_line": 416, "span_ids": ["test_tuple_length_error", "test_tuple_invalid"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False) == [\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": 422, "end_line": 448, "span_ids": ["test_tuple_value_error"], "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_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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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': 'x',\n },\n {\n 'type': 'float_parsing',\n 'loc': ('v', 1),\n 'msg': 'Input should be a valid number, unable to parse string as a number',\n 'input': 'y',\n },\n {\n 'type': 'decimal_parsing',\n 'loc': ('v', 2),\n 'msg': 'Input should be a valid decimal',\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_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": 451, "end_line": 479, "span_ids": ["test_recursive_list"], "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_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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('v', 0),\n 'msg': 'Input should be a valid dictionary or instance of SubModel',\n 'input': 'x',\n 'ctx': {'class_name': 'SubModel'},\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_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": 466, "end_line": 493, "span_ids": ["test_recursive_list_error", "test_list_unions"], "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 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(include_url=False) == [\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(include_url=False) == [\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": 542, "end_line": 563, "span_ids": ["test_include_exclude_unset"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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.model_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": 566, "end_line": 599, "span_ids": ["test_include_exclude_defaults"], "tokens": 563}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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.model_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": 602, "end_line": 621, "span_ids": ["test_advanced_exclude"], "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_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": 624, "end_line": 649, "span_ids": ["test_advanced_exclude_by_alias"], "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_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": 652, "end_line": 669, "span_ids": ["test_advanced_value_include"], "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_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": 672, "end_line": 694, "span_ids": ["test_advanced_value_exclude_include"], "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_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": 888, "end_line": 903, "span_ids": ["test_field_set_ignore_extra"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_field_set_ignore_extra():\n class Model(BaseModel):\n model_config = ConfigDict(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.model_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.model_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": 906, "end_line": 921, "span_ids": ["test_field_set_allow_extra"], "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_field_set_allow_extra():\n class Model(BaseModel):\n model_config = ConfigDict(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.model_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.model_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": 1030, "end_line": 1063, "span_ids": ["test_invalid_string_types", "test_inheritance_config"], "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(\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(include_url=False) == 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": 1066, "end_line": 1096, "span_ids": ["test_partial_inheritance_config"], "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_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(include_url=False) == [\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(include_url=False) == [\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": 1111, "end_line": 1135, "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": 1126, "end_line": 1181, "span_ids": ["test_string_none", "test_optional_required"], "tokens": 566}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_string_none():\n class Model(BaseModel):\n model_config = ConfigDict(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(include_url=False) == [\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(include_url=False) == [\n {'input': {}, 'loc': ('bar',), '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_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": 1196, "end_line": 1207, "span_ids": ["test_unable_to_infer"], "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_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": 1210, "end_line": 1240, "span_ids": ["test_multiple_errors"], "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_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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 a number',\n 'input': 'foobar',\n },\n {\n 'type': 'decimal_parsing',\n 'loc': ('a', 'decimal'),\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_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": 1285, "end_line": 1316, "span_ids": ["test_no_name_conflict_in_constructor", "test_self_recursive", "test_self"], "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_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_no_name_conflict_in_constructor():\n class Model(BaseModel):\n self: int\n\n m = Model(**{'__pydantic_self__': 4, 'self': 2})\n assert m.self == 2\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_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": 1392, "end_line": 1421, "span_ids": ["test_assign_type"], "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_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(include_url=False) == [\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": 1424, "end_line": 1448, "span_ids": ["test_optional_subfields"], "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_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(include_url=False) == [\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(include_url=False) == [\n {'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}\n ]\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": 1451, "end_line": 1480, "span_ids": ["test_validated_optional_subfields"], "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_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(include_url=False) == [\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(include_url=False) == [\n {'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}\n ]\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": 1483, "end_line": 1497, "span_ids": ["test_optional_field_constraints"], "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_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(include_url=False) == [\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_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": 1587, "end_line": 1614, "span_ids": ["test_type_var_constraint"], "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_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(include_url=False) == [\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(include_url=False) == [\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": 1617, "end_line": 1640, "span_ids": ["test_type_var_bound"], "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_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(include_url=False) == [\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(include_url=False) == [\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": 1771, "end_line": 1791, "span_ids": ["test_optional_validator"], "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_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(include_url=False) == [\n {'input': {}, 'loc': ('something',), 'msg': 'Field required', 'type': 'missing'}\n ]\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": 1794, "end_line": 1827, "span_ids": ["test_required_optional"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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": 1830, "end_line": 1897, "span_ids": ["test_required_any"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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.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": 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_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(include_url=False) == [\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(include_url=False) == [\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": 1979, "end_line": 2015, "span_ids": ["test_custom_generic_arbitrary_allowed"], "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_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(include_url=False) == [\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'Set `arbitrary_types_allowed=True` in the model_config to ignore 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": 2038, "end_line": 2052, "span_ids": ["test_hashable_required"], "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_hashable_required():\n class Model(BaseModel):\n v: Hashable\n\n Model(v=None)\n with pytest.raises(ValidationError) as exc_info:\n Model(v=[])\n assert exc_info.value.errors(include_url=False) == [\n {'input': [], 'loc': ('v',), 'msg': 'Input should be hashable', 'type': 'is_hashable'}\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model()\n assert exc_info.value.errors(include_url=False) == [\n {'input': {}, 'loc': ('v',), '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_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": 2135, "end_line": 2162, "span_ids": ["test_resolve_annotations_module_missing", "test_iter_coverage"], "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_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 PydanticDeprecatedSince20, 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": 2169, "end_line": 2200, "span_ids": ["test_frozen_config_and_field"], "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_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 c: Annotated[str, Field(frozen=True)]\n\n assert Bar.model_fields['a'].frozen\n\n b = Bar(a='x', c='z')\n with pytest.raises(ValidationError) as exc_info:\n b.a = 'y'\n assert exc_info.value.errors(include_url=False) == [\n {'input': 'y', 'loc': ('a',), 'msg': 'Field is frozen', 'type': 'frozen_field'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n b.c = 'y'\n assert exc_info.value.errors(include_url=False) == [\n {'input': 'y', 'loc': ('c',), 'msg': 'Field is frozen', 'type': 'frozen_field'}\n ]\n\n assert b.model_dump() == {'a': 'x', 'c': '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_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": 2230, "end_line": 2258, "span_ids": ["test_model_issubclass", "test_int_subclass"], "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_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 # This is expected behavior in `V2` because in pydantic-core we cast the value to a rust i64,\n # 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 assert isinstance(m.my_int, int)\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_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": 26, "span_ids": ["_ErrorKey", "docstring"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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\n\nfrom pydantic import BaseModel, ConfigDict\nfrom pydantic._internal._core_metadata import CoreMetadataHandler\nfrom pydantic._internal._core_utils import CoreSchemaOrField\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": 48, "end_line": 57, "span_ids": ["FastAPIGenerateJsonSchema.handle_invalid_for_json_schema"], "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 FastAPIGenerateJsonSchema(GenerateJsonSchema):\n\n def handle_invalid_for_json_schema(self, schema: CoreSchemaOrField, 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": 38, "span_ids": ["imports", "test_postponed_annotations", "test_postponed_annotations_auto_model_rebuild"], "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": "import dataclasses\nimport re\nimport sys\nimport typing\nfrom typing import Any, 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": 41, "end_line": 75, "span_ids": ["test_forward_ref_auto_update_no_model"], "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_forward_ref_auto_update_no_model(create_module):\n @create_module\n def module():\n from typing import Optional\n\n import pytest\n\n from pydantic import BaseModel, PydanticUserError\n\n class Foo(BaseModel):\n a: Optional['Bar'] = None\n\n with pytest.raises(PydanticUserError, match='`Foo` is not fully defined; you should define `Bar`,'):\n Foo(a={'b': {'a': {}}})\n\n class Bar(BaseModel):\n b: 'Foo'\n\n assert module.Bar.__pydantic_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[Bar, NoneType], required=False, default=None)'\n )\n\n assert module.Foo.__pydantic_complete__ is False\n # Foo gets auto-rebuilt during the first attempt at validation\n f = module.Foo(a={'b': {'a': {'b': {'a': None}}}})\n assert module.Foo.__pydantic_complete__ is True\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": 77, "end_line": 108, "span_ids": ["test_basic_forward_ref", "test_forward_ref_one_of_fields_not_defined"], "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_forward_ref_one_of_fields_not_defined(create_module):\n @create_module\n def module():\n from pydantic import BaseModel\n\n class Foo(BaseModel):\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": 129, "end_line": 168, "span_ids": ["test_self_forward_ref_collection"], "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": "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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('c', 0, 'b'),\n 'msg': 'Input should be a valid dictionary or instance of Foo',\n 'input': 234,\n 'ctx': {'class_name': 'Foo'},\n }\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, default=None)'\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": 295, "end_line": 326, "span_ids": ["test_self_reference_json_schema_with_future_annotations"], "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_self_reference_json_schema_with_future_annotations(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\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": 325, "end_line": 366, "span_ids": ["test_circular_reference_json_schema"], "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_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 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": 416, "span_ids": ["test_circular_reference_json_schema_with_future_annotations"], "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_circular_reference_json_schema_with_future_annotations(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\nclass Owner(BaseModel):\n account: Account\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": 419, "end_line": 465, "span_ids": ["test_forward_ref_with_field", "test_forward_ref_optional"], "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_forward_ref_with_field(create_module):\n @create_module\n def module():\n from typing import ForwardRef, List\n\n import pytest\n\n from pydantic import BaseModel, Field\n\n Foo = ForwardRef('Foo')\n\n with pytest.raises(TypeError, match=r'The following constraints cannot be applied.*\\'gt\\''):\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\n\n\nclass Spec(BaseModel):\n spec_fields: list[str] = Field(..., alias=\"fields\")\n filter: str | None = None\n sort: str | None\n\n\nclass PSpec(Spec):\n g: GSpec | None = None\n\n\nclass GSpec(Spec):\n p: PSpec | None\n\n# PSpec.model_rebuild()\n\nclass Filter(BaseModel):\n g: GSpec | None = None\n p: PSpec | None\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": 514, "end_line": 569, "span_ids": ["test_discriminated_union_forward_ref"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 class Cat(BaseModel):\n type: Literal['cat']\n\n class Dog(BaseModel):\n type: Literal['dog']\n\n assert module.Pet.__pydantic_complete__ is False\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 # Ensure the rebuild has happened automatically despite validation failure\n assert module.Pet.__pydantic_complete__ is True\n\n # insert_assert(module.Pet.model_json_schema())\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', 'enum': ['cat'], 'title': 'Type', 'type': 'string'}},\n 'required': ['type'],\n },\n 'Dog': {\n 'title': 'Dog',\n 'type': 'object',\n 'properties': {'type': {'const': 'dog', 'enum': ['dog'], 'title': 'Type', 'type': 'string'}},\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": 567, "end_line": 614, "span_ids": ["test_json_encoder_str", "test_class_var_as_string"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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\ndef test_json_encoder_str(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import BaseModel, ConfigDict, field_serializer\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 foo_user: FooUser\n user: User\n\n @field_serializer('user')\n def serialize_user(self, v):\n return f'User({v.y})'\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() == '{\"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_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": 651, "end_line": 676, "span_ids": ["test_pep585_recursive_generics"], "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": "@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\n\n HeroRef = ForwardRef('Hero')\n\n class Team(BaseModel):\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[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_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": 732, "end_line": 753, "span_ids": ["test_force_rebuild", "test_rebuild_subclass_of_built_model"], "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_force_rebuild():\n class Foobar(BaseModel):\n b: int\n\n assert Foobar.__pydantic_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\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": 756, "end_line": 798, "span_ids": ["test_nested_annotation", "test_nested_more_annotation"], "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_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_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\n\n def nested():\n class Foo(BaseModel):\n a: int\n\n def more_nested():\n class Bar(BaseModel):\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_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": 826, "end_line": 844, "span_ids": ["test_nested_model_rebuild"], "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_nested_model_rebuild(create_module):\n @create_module\n def module():\n from pydantic import BaseModel\n\n def nested():\n class Bar(BaseModel):\n b: 'Foo'\n\n class Foo(BaseModel):\n a: int\n\n assert Bar.__pydantic_complete__ is False\n Bar.model_rebuild()\n return Bar\n\n bar_model = module.nested()\n assert bar_model.__pydantic_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_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": 910, "end_line": 924, "span_ids": ["test_undefined_types_warning_1b_suppressed_via_config_2a_future_annotations"], "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_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# Because we don't instantiate the type, no error for an undefined type is raised\nclass Foobar(BaseModel):\n a: UndefinedType\n\"\"\"\n )\n # Since we're testing the absence of an error, it's important to confirm pydantic was actually run.\n # The presence of the `__pydantic_complete__` is a good indicator of this.\n assert module.Foobar.__pydantic_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_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": 108, "span_ids": ["imports", "test_double_parameterize_error", "test_generic_name", "clean_cache"], "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": "import gc\nimport itertools\nimport json\nimport platform\nimport re\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 NamedTuple,\n Optional,\n OrderedDict,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\n\nimport pytest\nfrom dirty_equals import HasRepr, IsStr\nfrom pydantic_core import CoreSchema, core_schema\nfrom typing_extensions import (\n Annotated,\n Literal,\n NotRequired,\n ParamSpec,\n TypedDict,\n TypeVarTuple,\n Unpack,\n get_args,\n)\nfrom typing_extensions import (\n TypeVar as TypingExtensionsTypeVar,\n)\n\nfrom pydantic import (\n BaseModel,\n Field,\n GetCoreSchemaHandler,\n Json,\n PositiveInt,\n PydanticSchemaGenerationError,\n PydanticUserError,\n TypeAdapter,\n ValidationError,\n ValidationInfo,\n computed_field,\n field_validator,\n model_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.warnings import GenericBeforeBaseModelWarning\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_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": 441, "end_line": 464, "span_ids": ["test_enum_generic", "test_generic_config"], "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_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(ValidationError):\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": 537, "end_line": 579, "span_ids": ["test_generic"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError()))},\n 'input': -1,\n 'loc': ('positive_number',),\n 'msg': 'Value error, ',\n 'type': 'value_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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('Must not provide both data and error')))},\n 'input': Error(message='error'),\n 'loc': ('error',),\n 'msg': 'Value error, Must not provide both data and error',\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_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": 538, "end_line": 609, "span_ids": ["test_required_value", "test_child_schema", "test_complex_nesting", "test_optional_value", "test_alongside_concrete_generics", "test_custom_schema"], "tokens": 437}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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(include_url=False) == [\n {'input': {}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}\n ]\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": 672, "end_line": 735, "span_ids": ["test_nested"], "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": "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 # Should 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(include_url=False) == [\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('i',),\n 'msg': 'Input should be a valid dictionary or instance of InnerT[int]',\n 'input': InnerT[str](a='ate'),\n 'ctx': {'class_name': 'InnerT[int]'},\n }\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(include_url=False) == [\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('i',),\n 'msg': 'Input should be a valid dictionary or instance of InnerT[int]',\n 'input': InnerT[Any](a={}),\n 'ctx': {'class_name': 'InnerT[int]'},\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_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": 680, "end_line": 701, "span_ids": ["test_partial_specification"], "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_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(include_url=False) == [\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_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": 738, "end_line": 760, "span_ids": ["test_partial_specification_instantiation"], "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_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(include_url=False) == [\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": 763, "end_line": 794, "span_ids": ["test_partial_specification_instantiation_bounded"], "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_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(include_url=False) == [\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(include_url=False) == [\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": 797, "end_line": 823, "span_ids": ["test_typevar_parametrization"], "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_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(include_url=False) == [\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": 826, "end_line": 843, "span_ids": ["test_multiple_specification"], "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_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(include_url=False) == [\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.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": 1259, "end_line": 1306, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "tokens": 608}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 set_field={True, False},\n tuple_field=(True,),\n long_tuple_field=(True, 42),\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 CustomCounter\n # assert type(m.default_dict_field) is CustomDefaultDict\n assert type(m.deque_field) is CustomDeque\n assert type(m.dict_field) is CustomDict\n assert type(m.frozenset_field) is CustomFrozenset\n assert type(m.iterable_field) is CustomIterable\n assert type(m.list_field) is CustomList\n assert type(m.mapping_field) is dict # this is determined in CustomMapping.__get_pydantic_core_schema__\n assert type(m.ordered_dict_field) is CustomOrderedDict\n assert type(m.set_field) is CustomSet\n assert type(m.tuple_field) is CustomTuple\n assert type(m.long_tuple_field) is CustomLongTuple\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(IsStr(regex=r'SerializationIterator\\(index=0, iterator=.*CustomIterable.*')),\n 'list_field': [True, False],\n 'mapping_field': {'a': 2},\n 'ordered_dict_field': {'a': 1},\n 'set_field': {False, True},\n 'tuple_field': (True,),\n 'long_tuple_field': (True, 42),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 1260, "end_line": 1274, "span_ids": ["test_deep_generic_with_inner_typevar"], "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_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_metadata__['parameters'] # i.e., InnerModel[int] is concrete\n assert InnerModel.__pydantic_generic_metadata__['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": 1277, "end_line": 1295, "span_ids": ["test_deep_generic_with_referenced_generic"], "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_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_metadata__['parameters']\n assert InnerModel.__pydantic_generic_metadata__['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": 1298, "end_line": 1317, "span_ids": ["test_deep_generic_with_referenced_inner_generic"], "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_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_metadata__['parameters']\n assert InnerModel.__pydantic_generic_metadata__['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": 1367, "end_line": 1403, "span_ids": ["test_deep_generic_with_multiple_inheritance"], "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_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(include_url=False) == [\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_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": 1585, "end_line": 1633, "span_ids": ["test_generic_recursive_models"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 class Model2(BaseModel, Generic[T]):\n ref: Union[T, Model1[T]]\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'string_type',\n 'loc': ('ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'ref': {'ref': 123}},\n },\n {\n 'type': 'string_type',\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': 123,\n },\n {\n 'type': 'model_type',\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'Model1[str]'),\n 'msg': 'Input should be a valid dictionary or instance of Model1[str]',\n 'input': 123,\n 'ctx': {'class_name': 'Model1[str]'},\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": 1636, "end_line": 1695, "span_ids": ["test_generic_recursive_models_separate_parameters"], "tokens": 648}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_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 S = TypeVar('S')\n\n class Model2(BaseModel, Generic[S]):\n ref: Union[S, Model1[S]]\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'string_type',\n 'loc': ('ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'ref': {'ref': 123}},\n },\n {\n 'type': 'string_type',\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': 123,\n },\n {\n 'type': 'model_type',\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'Model1[str]'),\n 'msg': 'Input should be a valid dictionary or instance of Model1[str]',\n 'input': 123,\n 'ctx': {'class_name': 'Model1[str]'},\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": 1569, "end_line": 1588, "span_ids": ["test_generic_recursive_models_repeated_separate_parameters"], "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_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 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 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": 1719, "end_line": 1751, "span_ids": ["test_generic_recursive_models_repeated_separate_parameters"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'string_type',\n 'loc': ('ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'ref': {'ref': 123}},\n },\n {\n 'type': 'string_type',\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': 123,\n },\n {\n 'type': 'model_type',\n 'loc': ('ref', 'ref', 'Model1[str]', 'ref', 'ref', 'Model1[str]'),\n 'msg': 'Input should be a valid dictionary or instance of Model1[str]',\n 'input': 123,\n 'ctx': {'class_name': 'Model1[str]'},\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": 1623, "end_line": 1643, "span_ids": ["test_generic_recursive_models_triple"], "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_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 class A2(BaseModel, Generic[T2]):\n a2: 'A3[T2]'\n\n class A3(BaseModel, Generic[T3]):\n a3: Union['A1[T3]', T3]\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": 1776, "end_line": 1792, "span_ids": ["test_generic_recursive_models_triple"], "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_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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('a1', 'a2', 'a3', 'A1[str]'),\n 'msg': 'Input should be a valid dictionary or instance of A1[str]',\n 'input': 1,\n 'ctx': {'class_name': 'A1[str]'},\n },\n {'type': 'string_type', 'loc': ('a1', 'a2', 'a3', 'str'), 'msg': 'Input should be a valid string', 'input': 1},\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": 1795, "end_line": 1818, "span_ids": ["test_generic_recursive_models_with_a_concrete_parameter"], "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_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 class M2(BaseModel, Generic[V3]):\n m: Union[M1[int, V3], V3]\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__) 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_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": 1821, "end_line": 1878, "span_ids": ["test_generic_recursive_models_complicated"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_generic_recursive_models_complicated(create_module):\n \"\"\"\n Note: 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 class A2(BaseModel, Generic[T2]):\n a2: 'A3[T2]'\n\n class A3(BaseModel, Generic[T3]):\n a3: Union[A1[T3], T3]\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 class B2(BaseModel, Generic[S2]):\n a2: 'B1[S2]'\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 class M2(BaseModel, Generic[V3]):\n m: Union[M1[V3, int], V3]\n\n M1.model_rebuild()\n\n M1 = module.M1\n\n assert collect_invalid_schemas(M1.__pydantic_core_schema__) 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_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_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_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_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": 2151, "end_line": 2176, "span_ids": ["test_construct_generic_model_with_validation"], "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_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(include_url=False) == [\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_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": 54, "span_ids": ["imports", "MyEnum", "MyModel"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 Any, Generator, List, Optional, Pattern, Union\nfrom uuid import UUID\n\nimport pytest\nfrom pydantic_core import CoreSchema, SchemaSerializer, core_schema\nfrom typing_extensions import Annotated\n\nfrom pydantic import (\n AfterValidator,\n BaseModel,\n ConfigDict,\n GetCoreSchemaHandler,\n GetJsonSchemaHandler,\n NameEmail,\n PlainSerializer,\n)\nfrom pydantic._internal._config import ConfigWrapper\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.functional_serializers import (\n field_serializer,\n)\nfrom pydantic.json_schema import JsonSchemaValue\nfrom pydantic.type_adapter import TypeAdapter\nfrom pydantic.types import DirectoryPath, FilePath, SecretBytes, SecretStr, condecimal\n\ntry:\n import email_validator\nexcept ImportError:\n email_validator = None\n\n\npytestmark = pytest.mark.filterwarnings('ignore::DeprecationWarning')\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_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": 87, "end_line": 110, "span_ids": ["test_path_encoding", "test_json_serialization_email"], "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": "@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\ndef test_json_serialization_email():\n config_wrapper = ConfigWrapper({'arbitrary_types_allowed': False})\n gen = GenerateSchema(config_wrapper, 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": 120, "end_line": 134, "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": 131, "end_line": 146, "span_ids": ["test_subclass_encoding"], "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_subclass_encoding():\n class SubDate(datetime):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n def val(v: datetime) -> SubDate:\n return SubDate.fromtimestamp(v.timestamp())\n\n return core_schema.no_info_after_validator_function(val, handler(datetime))\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": 149, "end_line": 179, "span_ids": ["test_subclass_custom_encoding"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_subclass_custom_encoding():\n class SubDt(datetime):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n def val(v: datetime) -> SubDt:\n return SubDt.fromtimestamp(v.timestamp())\n\n return core_schema.no_info_after_validator_function(val, handler(datetime))\n\n class SubDelta(timedelta):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n def val(v: timedelta) -> SubDelta:\n return cls(seconds=v.total_seconds())\n\n return core_schema.no_info_after_validator_function(val, handler(timedelta))\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_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_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": 108, "span_ids": ["imports:27", "imports"], "tokens": 556}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nimport math\nimport re\nimport sys\nimport typing\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 Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\nfrom uuid import UUID\n\nimport pytest\nfrom dirty_equals import HasRepr\nfrom pydantic_core import CoreSchema, SchemaValidator, core_schema, to_json\nfrom typing_extensions import Annotated, Literal, Self, TypedDict\n\nimport pydantic\nfrom pydantic import (\n AfterValidator,\n BaseModel,\n Field,\n GetCoreSchemaHandler,\n GetJsonSchemaHandler,\n ImportString,\n InstanceOf,\n PydanticDeprecatedSince20,\n PydanticUserError,\n RootModel,\n ValidationError,\n WithJsonSchema,\n computed_field,\n field_serializer,\n field_validator,\n)\nfrom pydantic._internal._core_metadata import CoreMetadataHandler, build_metadata_dict\nfrom pydantic.color import Color\nfrom pydantic.config import ConfigDict\nfrom pydantic.dataclasses import dataclass\nfrom pydantic.errors import PydanticInvalidForJsonSchema\nfrom pydantic.json_schema import (\n DEFAULT_REF_TEMPLATE,\n Examples,\n GenerateJsonSchema,\n JsonSchemaValue,\n PydanticJsonSchemaWarning,\n SkipJsonSchema,\n model_json_schema,\n models_json_schema,\n)\nfrom pydantic.networks import AnyUrl, EmailStr, IPvAnyAddress, IPvAnyInterface, IPvAnyNetwork, MultiHostUrl, NameEmail\nfrom pydantic.type_adapter import TypeAdapter\nfrom pydantic.types import (\n UUID1,\n UUID3,\n UUID4,\n UUID5,\n ByteSize,\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": 105, "end_line": 121, "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": 241, "end_line": 269, "span_ids": ["test_choices"], "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_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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'BarEnum': {'enum': [1, 2], 'title': 'BarEnum', 'type': 'integer'},\n 'FooEnum': {'enum': ['f', 'b'], 'title': 'FooEnum', 'type': 'string'},\n 'SpamEnum': {'enum': ['f', 'b'], 'title': 'SpamEnum', 'type': 'string'},\n },\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 '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": 311, "end_line": 341, "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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'type': 'object',\n 'properties': {\n 'pikalias': {\n 'title': 'Pikapika!',\n 'description': 'Pika is definitely the best!',\n 'allOf': [{'$ref': '#/$defs/FooBarEnum'}],\n },\n 'bulbialias': {\n 'allOf': [{'$ref': '#/$defs/FooBarEnum'}],\n 'default': 'foo',\n 'title': 'Bulbibulbi!',\n 'description': 'Bulbi is not...',\n },\n 'cara': {'$ref': '#/$defs/FooBarEnum'},\n },\n 'required': ['pikalias', 'cara'],\n 'title': 'Model',\n '$defs': {'FooBarEnum': {'enum': ['foo', 'bar'], 'title': 'FooBarEnum', 'type': 'string'}},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 344, "end_line": 395, "span_ids": ["test_enum_and_model_have_same_behaviour"], "tokens": 386}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 # insert_assert(Foo.model_json_schema())\n assert Foo.model_json_schema() == {\n 'type': 'object',\n 'properties': {\n 'enum': {'$ref': '#/$defs/Names'},\n 'titled_enum': {\n 'title': 'Title of enum',\n 'description': 'Description of enum',\n 'allOf': [{'$ref': '#/$defs/Names'}],\n },\n 'model': {'$ref': '#/$defs/Pika'},\n 'titled_model': {\n 'title': 'Title of model',\n 'description': 'Description of model',\n 'allOf': [{'$ref': '#/$defs/Pika'}],\n },\n },\n 'required': ['enum', 'titled_enum', 'model', 'titled_model'],\n 'title': 'Foo',\n '$defs': {\n 'Names': {'enum': ['Rick', 'Morty', 'Summer'], 'title': 'Names', 'type': 'string'},\n 'Pika': {\n 'type': 'object',\n 'properties': {'a': {'type': 'string', 'title': 'A'}},\n 'required': ['a'],\n 'title': 'Pika',\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_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_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_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": 723, "end_line": 783, "span_ids": ["test_list_union_dict"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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 (\n Union[int, int],\n {'properties': {'a': {'title': 'A', 'type': 'integer'}}, 'required': ['a']},\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": 786, "end_line": 804, "span_ids": ["test_date_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": "@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': 'string', 'format': 'duration'}),\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": 908, "end_line": 926, "span_ids": ["test_special_str_types"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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 (MultiHostUrl, {'title': 'A', 'type': 'string', 'format': 'multi-host-uri', 'minLength': 1}),\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": 953, "end_line": 977, "span_ids": ["test_special_float_types"], "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": "@pytest.mark.parametrize(\n 'field_type,expected_schema',\n [\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 ],\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_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_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": 1416, "end_line": 1493, "span_ids": ["test_schema_from_models"], "tokens": 529}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 json_schemas_map, model_schema = models_json_schema(\n [(Model, 'validation'), (Pizza, 'validation')],\n title='Multi-model schema',\n description='Single JSON Schema with multiple definitions',\n )\n assert json_schemas_map == {\n (Pizza, 'validation'): {'$ref': '#/$defs/Pizza'},\n (Model, 'validation'): {'$ref': '#/$defs/Model'},\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": 1496, "end_line": 1534, "span_ids": ["test_schema_with_refs"], "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_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 keys_map, model_schema = models_json_schema([(Bar, 'validation'), (Baz, 'validation')], ref_template=ref_template)\n assert keys_map == {\n (Bar, 'validation'): {'$ref': '#/components/schemas/Bar'},\n (Baz, 'validation'): {'$ref': '#/components/schemas/Baz'},\n }\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": 1537, "end_line": 1575, "span_ids": ["test_schema_with_custom_ref_template"], "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_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 keys_map, model_schema = models_json_schema(\n [(Bar, 'validation'), (Baz, 'validation')], ref_template='/schemas/{model}.json#/'\n )\n assert keys_map == {\n (Bar, 'validation'): {'$ref': '/schemas/Bar.json#/'},\n (Baz, 'validation'): {'$ref': '/schemas/Baz.json#/'},\n }\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_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_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_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": 2252, "end_line": 2270, "span_ids": ["test_literal_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": "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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'properties': {\n 'a': {'const': 1, 'enum': [1], 'title': 'A', 'type': 'integer'},\n 'b': {'const': 'a', 'enum': ['a'], 'title': 'B', 'type': 'string'},\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": 2273, "end_line": 2291, "span_ids": ["test_literal_enum"], "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_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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'properties': {\n 'kind': {'const': 'foo', 'enum': ['foo'], 'title': 'Kind', 'type': 'string'},\n 'other': {'enum': ['foo', 'bar'], 'title': 'Other', 'type': 'string'},\n },\n 'required': ['kind', 'other'],\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_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": 2590, "end_line": 2614, "span_ids": ["test_dataclass"], "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_dataclass():\n @dataclass\n class Model:\n a: bool\n\n assert models_json_schema([(Model, 'validation')]) == (\n {(Model, 'validation'): {'$ref': '#/$defs/Model'}},\n {\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\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": 2402, "end_line": 2431, "span_ids": ["test_schema_attributes"], "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_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 # insert_assert(Example.model_json_schema())\n assert Example.model_json_schema() == {\n '$defs': {\n 'ExampleEnum': {\n 'description': 'This is a test description.',\n 'enum': ['GT', 'LT', 'GE', 'LE', 'ML', 'MO', 'RE'],\n 'title': 'ExampleEnum',\n 'type': 'string',\n }\n },\n 'properties': {'example': {'$ref': '#/$defs/ExampleEnum'}},\n 'required': ['example'],\n 'title': 'Example',\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_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": 2386, "end_line": 2414, "span_ids": ["test_path_modify_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": "def test_path_modify_schema():\n class MyPath(Path):\n @classmethod\n def __get_pydantic_core_schema__(cls, _source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return handler(Path)\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n schema = handler(core_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_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.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": 2301, "end_line": 2343, "span_ids": ["test_schema_for_generic_field"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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.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 __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_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": 3177, "end_line": 3199, "span_ids": ["test_namedtuple_default"], "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_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 '$defs': {\n 'Coordinates': {\n 'maxItems': 2,\n 'minItems': 2,\n 'prefixItems': [{'title': 'X', 'type': 'number'}, {'title': 'Y', 'type': 'number'}],\n 'type': 'array',\n }\n },\n 'properties': {'coords': {'allOf': [{'$ref': '#/$defs/Coordinates'}], 'default': [34, 42]}},\n 'title': 'LocationBase',\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_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": 2455, "end_line": 2476, "span_ids": ["test_advanced_generic_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_advanced_generic_schema():\n # ... other code\n\n class CustomType(Enum):\n A = 'a'\n B = 'b'\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> core_schema.CoreSchema:\n json_schema = handler(core_schema)\n json_schema.update(title='CustomType title', type='string')\n return json_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_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_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": 2638, "end_line": 2658, "span_ids": ["test_modify_schema_dict_keys"], "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_modify_schema_dict_keys() -> None:\n class MyType:\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n return {'test': 'passed'}\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": 3628, "end_line": 3681, "span_ids": ["test_discriminated_union"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'Cat': {\n 'properties': {'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'}},\n 'required': ['pet_type'],\n 'title': 'Cat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {'pet_type': {'const': 'dog', 'enum': ['dog'], 'title': 'Pet Type', 'type': 'string'}},\n 'required': ['pet_type'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'Lizard': {\n 'properties': {'pet_type': {'enum': ['reptile', 'lizard'], 'title': 'Pet Type', 'type': 'string'}},\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': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}, {'$ref': '#/$defs/Lizard'}],\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": 3684, "end_line": 3737, "span_ids": ["test_discriminated_annotated_union"], "tokens": 451}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'Cat': {\n 'properties': {'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'}},\n 'required': ['pet_type'],\n 'title': 'Cat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {'pet_type': {'const': 'dog', 'enum': ['dog'], 'title': 'Pet Type', 'type': 'string'}},\n 'required': ['pet_type'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'Lizard': {\n 'properties': {'pet_type': {'enum': ['reptile', 'lizard'], 'title': 'Pet Type', 'type': 'string'}},\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': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}, {'$ref': '#/$defs/Lizard'}],\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": 3740, "end_line": 3827, "span_ids": ["test_nested_discriminated_union"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 # insert_assert(Cat.model_json_schema())\n assert Cat.model_json_schema() == {\n '$defs': {\n 'BlackCatWithHeight': {\n 'properties': {\n 'color': {'const': 'black', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'height': {'title': 'Height', 'type': 'number'},\n 'info': {'const': 'height', 'enum': ['height'], 'title': 'Info', 'type': 'string'},\n },\n 'required': ['color', 'info', 'height'],\n 'title': 'BlackCatWithHeight',\n 'type': 'object',\n },\n 'BlackCatWithWeight': {\n 'properties': {\n 'color': {'const': 'black', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'info': {'const': 'weight', 'enum': ['weight'], 'title': 'Info', 'type': 'string'},\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', 'enum': ['white'], 'title': 'Color', 'type': 'string'},\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.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": 3863, "end_line": 3999, "span_ids": ["test_deeper_nested_discriminated_annotated_union"], "tokens": 1146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 assert Model.model_json_schema() == {\n '$defs': {\n 'BlackCatWithHeight': {\n 'properties': {\n 'black_infos': {'title': 'Black Infos', 'type': 'string'},\n 'color': {'const': 'black', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'info': {'const': 'height', 'enum': ['height'], 'title': 'Info', 'type': 'string'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'info': {'const': 'weight', 'enum': ['weight'], 'title': 'Info', 'type': 'string'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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', 'enum': ['dog'], 'title': 'Pet Type', 'type': 'string'},\n },\n 'required': ['pet_type', 'dog_name'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'enum': ['white'], 'title': 'Color', 'type': 'string'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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.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": 4047, "end_line": 4180, "span_ids": ["test_discriminated_annotated_union_literal_enum"], "tokens": 1140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 assert Model.model_json_schema() == {\n '$defs': {\n 'BlackCatWithHeight': {\n 'properties': {\n 'black_infos': {'title': 'Black Infos', 'type': 'string'},\n 'color': {'const': 'black', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'info': {'const': 0, 'enum': [0], 'title': 'Info', 'type': 'integer'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'info': {'const': 1, 'enum': [1], 'title': 'Info', 'type': 'integer'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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', 'enum': ['dog'], 'title': 'Pet Type', 'type': 'string'},\n },\n 'required': ['pet_type', 'dog_name'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'enum': ['white'], 'title': 'Color', 'type': 'string'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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": 4183, "end_line": 4229, "span_ids": ["test_alias_same"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'Cat': {\n 'properties': {\n 'c': {'title': 'C', 'type': 'string'},\n 'typeOfPet': {'const': 'cat', 'enum': ['cat'], 'title': 'Typeofpet', 'type': 'string'},\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', 'enum': ['dog'], 'title': 'Typeofpet', 'type': 'string'},\n },\n 'required': ['typeOfPet', 'd'],\n 'title': 'Dog',\n 'type': 'object',\n },\n },\n 'properties': {\n 'number': {'title': 'Number', 'type': 'integer'},\n 'pet': {\n 'oneOf': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}],\n 'title': 'Pet',\n 'discriminator': {'mapping': {'cat': '#/$defs/Cat', 'dog': '#/$defs/Dog'}, 'propertyName': 'typeOfPet'},\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_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": 4232, "end_line": 4267, "span_ids": ["test_nested_python_dataclasses"], "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_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 # insert_assert(model_json_schema(dataclass(NestedModel)))\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": 4270, "end_line": 4358, "span_ids": ["test_discriminated_union_in_list"], "tokens": 755}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'BlackCat': {\n 'properties': {\n 'black_name': {'title': 'Black Name', 'type': 'string'},\n 'color': {'const': 'black', 'enum': ['black'], 'title': 'Color', 'type': 'string'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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', 'enum': ['dog'], 'title': 'Pet Type', 'type': 'string'},\n },\n 'required': ['pet_type', 'name'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'WhiteCat': {\n 'properties': {\n 'color': {'const': 'white', 'enum': ['white'], 'title': 'Color', 'type': 'string'},\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\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_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": 69, "span_ids": ["test_success", "imports", "ultra_simple_model_fixture"], "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": "import json\nimport platform\nimport re\nfrom collections import defaultdict\nfrom copy import deepcopy\nfrom dataclasses import dataclass\nfrom datetime import date, datetime\nfrom enum import Enum\nfrom functools import partial\nfrom typing import (\n Any,\n Callable,\n ClassVar,\n Dict,\n Final,\n Generic,\n List,\n Mapping,\n Optional,\n Set,\n Type,\n TypeVar,\n Union,\n get_type_hints,\n)\nfrom uuid import UUID, uuid4\n\nimport pytest\nfrom pydantic_core import CoreSchema, core_schema\nfrom typing_extensions import Annotated, Literal\n\nfrom pydantic import (\n AfterValidator,\n BaseModel,\n ConfigDict,\n Field,\n GenerateSchema,\n GetCoreSchemaHandler,\n PrivateAttr,\n PydanticUndefinedAnnotation,\n PydanticUserError,\n SecretStr,\n StringConstraints,\n TypeAdapter,\n ValidationError,\n ValidationInfo,\n constr,\n field_validator,\n)\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": 61, "end_line": 71, "span_ids": ["test_ultra_simple_missing"], "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_ultra_simple_missing(UltraSimpleModel):\n with pytest.raises(ValidationError) as exc_info:\n UltraSimpleModel()\n assert exc_info.value.errors(include_url=False) == [\n {'loc': ('a',), 'msg': 'Field required', 'type': 'missing', 'input': {}}\n ]\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": 86, "end_line": 102, "span_ids": ["test_ultra_simple_failed"], "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_ultra_simple_failed(UltraSimpleModel):\n with pytest.raises(ValidationError) as exc_info:\n UltraSimpleModel(a='x', b='x')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'float_parsing',\n 'loc': ('a',),\n 'msg': 'Input should be a valid number, unable to parse string as a 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": 149, "end_line": 170, "span_ids": ["test_nullable_strings_fails"], "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_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(include_url=False) == [\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_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": 263, "end_line": 283, "span_ids": ["test_forbidden_extra_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": "def test_forbidden_extra_fails():\n class ForbiddenExtra(BaseModel):\n model_config = ConfigDict(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(include_url=False) == [\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_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_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": 611, "end_line": 636, "span_ids": ["test_literal_enum_values"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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": 689, "end_line": 706, "span_ids": ["test_arbitrary_type_allowed_validation_fails"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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": 973, "end_line": 1061, "span_ids": ["test_model_export_nested_list"], "tokens": 813}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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}]},\n None,\n id='negative indexes',\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_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": 1527, "end_line": 1551, "span_ids": ["test_model_export_inclusion_inheritance"], "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": "@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 independently\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": 1511, "end_line": 1526, "span_ids": ["test_untyped_fields_warning"], "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_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_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": 1506, "end_line": 1520, "span_ids": ["test_default_factory_validate_children"], "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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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_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": 1692, "end_line": 1705, "span_ids": ["test_class_kwargs_config"], "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_class_kwargs_config():\n class Base(BaseModel, extra='forbid', alias_generator=str.upper):\n a: int\n\n assert Base.model_config['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'] == '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": 1708, "end_line": 1726, "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'] == '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_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_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": 2073, "end_line": 2105, "span_ids": ["test_model_validate_strict"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 # there's no such thing on the model itself\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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({'x': '1'})\n assert exc_info.value.errors(include_url=False) == [\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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": 2066, "end_line": 2095, "span_ids": ["test_model_validate_json_strict"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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_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": 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_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='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": 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_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='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": 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_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='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='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='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='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": 172, "end_line": 193, "span_ids": ["test_annotated_field", "test_annotated_optional_field"], "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": "@pytest.mark.skipif(sys.version_info < (3, 12), 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: 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_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": 112, "end_line": 150, "span_ids": ["test_any_url_invalid"], "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": "@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, input is empty'),\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(include_url=False)) == 1, exc_info.value.errors(include_url=False)\n error = exc_info.value.errors(include_url=False)[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_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_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": 420, "end_line": 482, "span_ids": ["test_postgres_dsns_validation_error"], "tokens": 524}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(include_url=False)[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": 507, "end_line": 523, "span_ids": ["test_cockroach_dsns"], "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_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(include_url=False)[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": 526, "end_line": 554, "span_ids": ["test_amqp_dsns"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False)[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": 557, "end_line": 588, "span_ids": ["test_redis_dsns"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False)[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": 591, "end_line": 615, "span_ids": ["test_mongodb_dsns"], "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_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(include_url=False)[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": 618, "end_line": 637, "span_ids": ["test_kafka_dsns"], "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_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(include_url=False)[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_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": 722, "end_line": 759, "span_ids": ["test_address_valid"], "tokens": 775}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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 ('\"first.last\" ', 'first.last', 'first.last@example.com'),\n (\"Shaquille O'Neal \", \"Shaquille O'Neal\", 'shaq@example.com'),\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_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": 629}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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(include_url=False) == 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": 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', ['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(include_url=False)[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": 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": "@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(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 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": "@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(include_url=False)[0])\n assert exc_info.value.errors(include_url=False)[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": 37, "span_ids": ["imports", "test_model_validate_fails", "test_obj", "Model", "test_model_validate_submodel"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List, Tuple\n\nimport pytest\nfrom pydantic_core import CoreSchema\n\nfrom pydantic import BaseModel, GetJsonSchemaHandler, ValidationError, model_validator, parse_obj_as\nfrom pydantic.functional_serializers import model_serializer\nfrom pydantic.json_schema import JsonSchemaValue\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(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of Model',\n 'input': [1, 2, 3],\n 'ctx': {'class_name': 'Model'},\n }\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": 40, "end_line": 69, "span_ids": ["test_model_validate_wrong_model", "test_root_model_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": "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(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of Model',\n 'input': Foo(),\n 'ctx': {'class_name': 'Model'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate(Foo().model_dump())\n assert exc_info.value.errors(include_url=False) == [\n {'input': {'c': 123}, 'loc': ('a',), 'msg': 'Field required', 'type': 'missing'}\n ]\n\n\ndef test_root_model_error():\n with pytest.raises(\n TypeError, match=\"To define root models, use `pydantic.RootModel` rather than a field called '__root__'\"\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_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": 98, "end_line": 122, "span_ids": ["test_parse_root_list"], "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_parse_root_list():\n class MyModel(BaseModel):\n root: List[str]\n\n @model_validator(mode='before')\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": 125, "end_line": 154, "span_ids": ["test_parse_nested_root_list"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_parse_nested_root_list():\n class NestedData(BaseModel):\n id: str\n\n class NestedModel(BaseModel):\n root: List[NestedData]\n\n @model_validator(mode='before')\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": 171, "end_line": 205, "span_ids": ["test_parse_nested_root_tuple"], "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": "@pytest.mark.filterwarnings('ignore:`parse_obj_as` is deprecated.*:DeprecationWarning')\ndef test_parse_nested_root_tuple():\n class NestedData(BaseModel):\n id: str\n\n class NestedModel(BaseModel):\n root: Tuple[int, NestedData]\n\n @model_validator(mode='before')\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": 194, "end_line": 245, "span_ids": ["test_json", "test_parse_nested_custom_root"], "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_parse_nested_custom_root():\n class NestedModel(BaseModel):\n root: List[str]\n\n @model_validator(mode='before')\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 @model_validator(mode='before')\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_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": 66, "end_line": 94, "span_ids": ["test_private_attribute_annotation"], "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_private_attribute_annotation():\n class Model(BaseModel):\n \"\"\"The best model\"\"\"\n\n _foo: str\n\n assert Model.__private_attributes__ == {'_foo': PrivateAttr(PydanticUndefined)}\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": 97, "end_line": 117, "span_ids": ["test_underscore_attrs_are_private"], "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_underscore_attrs_are_private():\n class Model(BaseModel):\n _foo: str = 'abc'\n _bar: ClassVar[str] = 'cba'\n\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": 143, "end_line": 170, "span_ids": ["test_private_attribute_invalid_name", "test_private_attribute_intersection_with_extra_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_private_attribute_intersection_with_extra_field():\n class Model(BaseModel):\n _foo = PrivateAttr('private_attribute')\n\n model_config = ConfigDict(extra='allow')\n\n assert set(Model.__private_attributes__) == {'_foo'}\n m = Model(_foo='field')\n assert m._foo == 'private_attribute'\n assert m.__dict__ == {}\n assert m.__pydantic_extra__ == {'_foo': 'field'}\n assert m.model_dump() == {'_foo': 'field'}\n\n m._foo = 'still_private'\n assert m._foo == 'still_private'\n assert m.__dict__ == {}\n assert m.__pydantic_extra__ == {'_foo': 'field'}\n assert m.model_dump() == {'_foo': 'field'}\n\n\ndef test_private_attribute_invalid_name():\n with pytest.raises(\n NameError,\n match=\"Private attributes must not use valid field names; use sunder names, e.g. '_foo' instead of '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": 196, "end_line": 224, "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(TypeError, 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": 210, "end_line": 263, "span_ids": ["test_private_attribute_multiple_inheritance"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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.__private_attributes__ == {\n '_foo': PrivateAttr(default),\n }\n assert ParentBModel.__private_attributes__ == {\n '_foo': PrivateAttr(default),\n '_bar': PrivateAttr(default),\n }\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_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": 39, "span_ids": ["imports", "user_fixture", "test_rich_repr", "test_rich_repr_color"], "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": "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\n@pytest.mark.filterwarnings('ignore::DeprecationWarning')\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_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": 168, "end_line": 178, "span_ids": ["test_serialize_decorator_json"], "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_serialize_decorator_json():\n class MyModel(BaseModel):\n x: int\n\n @field_serializer('x', when_used='json')\n def customise_x_serialization(v) -> str:\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": 181, "end_line": 194, "span_ids": ["test_serialize_decorator_unless_none"], "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_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_serialization(v):\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": 201, "end_line": 223, "span_ids": ["test_annotated_customisation"], "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_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, _source, _handler):\n # here we ignore the schema argument (which is just `{'type': 'int'}`) and return our own\n return core_schema.with_info_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": 263, "end_line": 366, "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": 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": "def test_invalid_signature_no_params() -> None:\n with pytest.raises(TypeError, match='Unrecognized field_serializer function signature'):\n\n class _(BaseModel):\n x: int\n\n # caught by type checkers\n @field_serializer('x')\n def no_args() -> Any:\n ...\n\n\ndef test_invalid_signature_single_params() -> None:\n with pytest.raises(TypeError, match='Unrecognized field_serializer function 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:\n ...\n\n\ndef test_invalid_signature_too_many_params_1() -> None:\n with pytest.raises(TypeError, match='Unrecognized field_serializer function 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:\n ...\n\n\ndef test_invalid_signature_too_many_params_2() -> None:\n with pytest.raises(TypeError, match='Unrecognized field_serializer function 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:\n ...\n\n\ndef test_invalid_signature_bad_plain_signature() -> None:\n with pytest.raises(TypeError, match='Unrecognized field_serializer function 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:\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')\n def customise_x_serialization(self, v, info) -> str:\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')\n def customise_x_serialization(self, v) -> str:\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_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": 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": "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(include_url=False) == [\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": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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": 50, "span_ids": ["imports", "test_parse_obj", "test_parse_obj_fails", "test_parse_obj_as_model", "test_parse_obj_preserves_subclasses"], "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": "from typing import Dict, List, Mapping, Union\n\nimport pytest\n\nfrom pydantic import BaseModel, PydanticDeprecatedSince20, ValidationError\nfrom pydantic.dataclasses import dataclass\nfrom pydantic.deprecated.tools import parse_obj_as, schema_json_of, schema_of\n\npytestmark = pytest.mark.filterwarnings('ignore::DeprecationWarning')\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(include_url=False) == [\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": 53, "end_line": 75, "span_ids": ["test_parse_mapping_as", "test_parse_as_dataclass", "test_parsing_model_naming"], "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_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(PydanticDeprecatedSince20, 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_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": 23, "span_ids": ["imports", "test_namedtuple_simple"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from collections import namedtuple\nfrom typing import Generic, NamedTuple, Optional, Tuple, TypeVar\n\nimport pytest\nfrom typing_extensions import NamedTuple as TypingExtensionsNamedTuple\n\nfrom pydantic import BaseModel, ConfigDict, PositiveInt, TypeAdapter, 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": 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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': ('event', 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": 55, "end_line": 96, "span_ids": ["test_namedtuple_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": "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 '$defs': {\n 'Position1': {\n 'maxItems': 2,\n 'minItems': 2,\n 'prefixItems': [{'title': 'X', 'type': 'integer'}, {'title': 'Y', 'type': 'integer'}],\n 'type': 'array',\n },\n 'Position2': {\n 'maxItems': 2,\n 'minItems': 2,\n 'prefixItems': [{'title': 'X'}, {'title': 'Y'}],\n 'type': 'array',\n },\n },\n 'properties': {\n 'pos1': {'$ref': '#/$defs/Position1'},\n 'pos2': {'$ref': '#/$defs/Position2'},\n 'pos3': {\n 'maxItems': 2,\n 'minItems': 2,\n 'prefixItems': [{'type': 'integer'}, {'type': 'integer'}],\n 'title': 'Pos3',\n 'type': 'array',\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": 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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'unexpected_positional_argument',\n 'loc': ('p', 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_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": 42, "span_ids": ["imports", "payment_card_model_fixture", "test_validate_digits"], "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": "from collections import namedtuple\nfrom typing import Any\n\nimport pytest\nfrom pydantic_core import PydanticCustomError\n\nfrom pydantic import BaseModel, ValidationError\nfrom pydantic.types import PaymentCardBrand, PaymentCardNumber\n\npytestmark = pytest.mark.filterwarnings(\n 'ignore:' 'The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead.*' ':DeprecationWarning'\n)\n\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": 44, "span_ids": ["fixture_typed_dict_all", "docstring"], "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": "\"\"\"\nTests for TypedDict\n\"\"\"\nimport sys\nimport typing\nfrom typing import Any, Dict, Generic, List, Optional, TypeVar\n\nimport pytest\nimport typing_extensions\nfrom annotated_types import Lt\nfrom pydantic_core import CoreSchema, core_schema\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n Field,\n GenerateSchema,\n GetCoreSchemaHandler,\n PositiveInt,\n PydanticUserError,\n ValidationError,\n with_config,\n)\nfrom pydantic._internal._decorators import get_attribute_from_bases\nfrom pydantic.functional_serializers import field_serializer, model_serializer\nfrom pydantic.functional_validators import field_validator, model_validator\nfrom pydantic.type_adapter import TypeAdapter\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": 46, "end_line": 57, "span_ids": ["fixture_typed_dict"], "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": "@pytest.fixture(name='TypedDict')\ndef fixture_typed_dict(TypedDictAll):\n class TestTypedDict(TypedDictAll):\n foo: str\n\n if sys.version_info < (3, 12) and TypedDictAll.__module__ == 'typing':\n pytest.skip('typing.TypedDict does not support all pydantic features in Python < 3.12')\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": 50, "end_line": 76, "span_ids": ["fixture_req_no_req", "test_typeddict_all"], "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.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 PydanticUserError as e:\n assert e.message == 'Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.12.'\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": 77, "end_line": 94, "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": 97, "end_line": 110, "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": 113, "end_line": 130, "span_ids": ["test_typeddict"], "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_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(include_url=False) == [\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_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_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": 472, "end_line": 495, "span_ids": ["test_recursive_typeddict"], "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_recursive_typeddict():\n from typing import Optional\n\n from typing_extensions import TypedDict\n\n from pydantic import BaseModel\n\n class RecursiveTypedDict(TypedDict):\n foo: Optional['RecursiveTypedDict']\n\n class RecursiveTypedDictModel(BaseModel):\n rec: RecursiveTypedDict\n\n assert RecursiveTypedDictModel(rec={'foo': {'foo': None}}).rec == {'foo': {'foo': None}}\n with pytest.raises(ValidationError) as exc_info:\n RecursiveTypedDictModel(rec={'foo': {'foo': {'foo': 1}}})\n assert exc_info.value.errors(include_url=False) == [\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": 443, "end_line": 465, "span_ids": ["test_generic_typeddict_in_concrete_model", "impl"], "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": "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(include_url=False) == [\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": 468, "end_line": 487, "span_ids": ["test_generic_typeddict_in_generic_model"], "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_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(include_url=False) == [\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": 490, "end_line": 527, "span_ids": ["test_recursive_generic_typeddict_in_module"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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\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(include_url=False) == [\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": 530, "end_line": 563, "span_ids": ["test_recursive_generic_typeddict_in_function_1"], "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_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\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(include_url=False) == [\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": 566, "end_line": 596, "span_ids": ["test_recursive_generic_typeddict_in_function_2"], "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_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\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(include_url=False) == [\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_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": 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": "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, PydanticUndefined, core_schema\nfrom typing_extensions import Annotated, Literal\n\nfrom pydantic import BaseModel\nfrom pydantic._internal import _repr\nfrom pydantic._internal._core_utils import _WalkCoreSchema\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 unique_list,\n)\nfrom pydantic._internal._validators import import_string\nfrom pydantic.alias_generators import to_camel, to_pascal, to_snake\nfrom pydantic.color import Color\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: No module named 'xx'\"):\n import_string('xx')\n\n\ndef test_import_no_attr():\n with pytest.raises(PydanticCustomError, match=\"cannot import name 'foobar' from 'os'\"):\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_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": 290, "end_line": 316, "span_ids": ["test_devtools_output", "test_pretty_color"], "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": "@pytest.mark.filterwarnings('ignore::DeprecationWarning')\ndef 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": 351, "end_line": 390, "span_ids": ["test_all_literal_values", "test_deep_update_is_not_mutating", "test_class_attribute", "test_undefined_repr", "test_undefined_copy"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(PydanticUndefined) == 'PydanticUndefined'\n\n\ndef test_undefined_copy():\n assert copy(PydanticUndefined) is PydanticUndefined\n assert deepcopy(PydanticUndefined) is PydanticUndefined\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_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": 188, "end_line": 217, "span_ids": ["test_int_validation"], "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_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(include_url=False) == [\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(include_url=False) == [\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\n assert Model(a=(2**63) + 100).a == (2**63) + 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_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": 219, "end_line": 244, "span_ids": ["test_int_overflow_validation", "test_frozenset_validation"], "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": "@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(include_url=False) == [\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(include_url=False) == [\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": 248, "end_line": 280, "span_ids": ["test_deque_validation"], "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_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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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\n assert Model(a={'1'}).a == deque([1])\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": 346, "end_line": 375, "span_ids": ["test_validate_pre_error"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('a1 broken')))},\n 'input': [1, 3],\n 'loc': ('a',),\n 'msg': 'Value error, a1 broken',\n 'type': 'value_error',\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('a2 broken')))},\n 'input': [6, 10],\n 'loc': ('a',),\n 'msg': 'Value error, a2 broken',\n 'type': 'value_error',\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": 354, "end_line": 376, "span_ids": ["validate_assignment_model_fixture"], "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": "@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='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": 403, "end_line": 450, "span_ids": ["test_validating_assignment_ok", "test_validating_assignment_fail", "test_validating_assignment_value_change", "test_validating_assignment_dict", "test_validating_assignment_extra"], "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_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 assert p.model_dump()['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 assert p.model_dump()['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(include_url=False) == [\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": 453, "end_line": 474, "span_ids": ["test_validating_assignment_values_dict"], "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 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: ValidationInfo):\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": 477, "end_line": 509, "span_ids": ["test_validate_multiple"], "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_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: ValidationInfo) -> 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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('a is too short')))},\n 'input': 'x',\n 'loc': ('a',),\n 'msg': 'Assertion failed, a is too short',\n 'type': 'assertion_error',\n },\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('b is too short')))},\n 'input': 'x',\n 'loc': ('b',),\n 'msg': 'Assertion failed, b is too short',\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.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": 595, "end_line": 629, "span_ids": ["test_validate_always", "test_field_validator_bad_fields_throws_configerror"], "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_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(PydanticDeprecatedSince20, 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": 632, "end_line": 670, "span_ids": ["test_validate_always_on_inheritance", "test_field_validator_validate_default"], "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_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(PydanticDeprecatedSince20, 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_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": 753, "end_line": 787, "span_ids": ["test_wildcard_validator_error"], "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 'decorator, pytest_warns',\n [\n (validator, pytest.warns(PydanticDeprecatedSince20, match=V1_VALIDATOR_DEPRECATION_MATCH)),\n (field_validator, contextlib.nullcontext()),\n ],\n)\ndef test_wildcard_validator_error(decorator, pytest_warns):\n with pytest_warns:\n\n class Model(BaseModel):\n a: str\n b: str\n\n @decorator('*')\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('\"foobar\" not found in a')))},\n 'input': 'snap',\n 'loc': ('a',),\n 'msg': 'Value error, \"foobar\" not found in a',\n 'type': 'value_error',\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_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": 915, "end_line": 971, "span_ids": ["test_inheritance_keep", "test_validate_parent_all"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_validate_parent_all():\n with pytest.warns(PydanticDeprecatedSince20, 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 class Parent(BaseModel):\n a: str\n\n @field_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_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": 1025, "end_line": 1065, "span_ids": ["test_validation_each_item_invalid_type", "test_validation_each_item", "test_validation_each_item_nullable"], "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_validation_each_item():\n with pytest.warns(PydanticDeprecatedSince20, 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_invalid_type():\n with pytest.raises(\n TypeError, match=re.escape('@validator(..., each_item=True)` cannot be applied to fields with a schema of int')\n ):\n with pytest.warns(PydanticDeprecatedSince20, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n foobar: int\n\n @validator('foobar', each_item=True)\n @classmethod\n def check_foobar(cls, v: Any):\n ...\n\n\ndef test_validation_each_item_nullable():\n with pytest.warns(PydanticDeprecatedSince20, 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": 1068, "end_line": 1081, "span_ids": ["test_validation_each_item_one_sublevel"], "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_validation_each_item_one_sublevel():\n with pytest.warns(PydanticDeprecatedSince20, 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": 1084, "end_line": 1114, "span_ids": ["test_key_validation", "test_validator_always_optional"], "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_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(PydanticDeprecatedSince20, 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": 1136, "end_line": 1171, "span_ids": ["test_validator_always_pre", "test_field_validator_validate_default_pre"], "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_validator_always_pre():\n check_calls = 0\n\n class Model(BaseModel):\n a: str = None\n\n with pytest.warns(PydanticDeprecatedSince20, 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": 1174, "end_line": 1189, "span_ids": ["test_validator_always_post"], "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_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(PydanticDeprecatedSince20, 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": 1192, "end_line": 1230, "span_ids": ["test_field_validator_validate_default_post_optional", "test_validator_always_post_optional", "test_field_validator_validate_default_post"], "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 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(PydanticDeprecatedSince20, 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": 1233, "end_line": 1253, "span_ids": ["test_datetime_validator"], "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_datetime_validator():\n check_calls = 0\n\n class Model(BaseModel):\n d: datetime = None\n\n with pytest.warns(PydanticDeprecatedSince20, 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_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": 1349, "end_line": 1378, "span_ids": ["test_root_validator"], "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_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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('foobar')))},\n 'input': {'b': 'snap dragon', 'c': 'snap dragon2'},\n 'loc': (),\n 'msg': 'Value error, foobar',\n 'type': 'value_error',\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(include_url=False) == [\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_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": 1461, "end_line": 1480, "span_ids": ["test_root_validator_types"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_root_validator_types():\n root_val_values = None\n\n class Model(BaseModel):\n a: int = 1\n b: str\n\n with pytest.warns(PydanticDeprecatedSince20):\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, repr(values)\n return values\n\n model_config = ConfigDict(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": 1483, "end_line": 1526, "span_ids": ["test_reuse_global_validators", "test_model_validator_returns_ignore", "test_root_validator_returns_none_exception", "reusable_validator"], "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_root_validator_returns_none_exception():\n class Model(BaseModel):\n a: int = 1\n\n with pytest.warns(PydanticDeprecatedSince20):\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 test_model_validator_returns_ignore():\n # This is weird, and I don't understand entirely why it's happening, but it kind of makes sense\n\n class Model(BaseModel):\n a: int = 1\n\n @model_validator(mode='after') # type: ignore\n def model_validator_return_none(self) -> None:\n return None\n\n m = Model(a=2)\n assert m.model_dump() == {'a': 2}\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')(reusable_validator)\n double_y = field_validator('y')(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_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": 1556, "end_line": 1581, "span_ids": ["test_root_validator_classmethod"], "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('validator_classmethod,root_validator_classmethod', product(*[[True, False]] * 2))\ndef test_root_validator_classmethod(validator_classmethod, root_validator_classmethod):\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('foobar')))},\n 'input': {'b': 'snap dragon'},\n 'loc': (),\n 'msg': 'Value error, foobar',\n 'type': 'value_error',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='broken', b='bar')\n assert exc_info.value.errors(include_url=False) == [\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": 1585, "end_line": 1622, "span_ids": ["test_literal_validator", "test_assignment_validator_cls"], "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_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(include_url=False) == [\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": 1602, "end_line": 1620, "span_ids": ["test_literal_validator_str_enum"], "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_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 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_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": 1740, "end_line": 1773, "span_ids": ["test_overridden_root_validators"], "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_overridden_root_validators():\n validate_stub = MagicMock()\n\n class A(BaseModel):\n x: str\n\n @model_validator(mode='before')\n def pre_root(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n validate_stub('A', 'pre')\n return values\n\n @model_validator(mode='after')\n def post_root(self) -> 'A':\n validate_stub('A', 'post')\n return self\n\n class B(A):\n @model_validator(mode='before')\n def pre_root(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n validate_stub('B', 'pre')\n return values\n\n @model_validator(mode='after')\n def post_root(self) -> 'B':\n validate_stub('B', 'post')\n return self\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": 1776, "end_line": 1801, "span_ids": ["test_validating_assignment_pre_root_validator_fail"], "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_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 with pytest.warns(PydanticDeprecatedSince20):\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('values cannot be a string')))},\n 'input': {'current_value': '100', 'max_value': 200.0},\n 'loc': (),\n 'msg': 'Value error, values cannot be a string',\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.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": 1927, "end_line": 1946, "span_ids": ["test_info_field_name_data_before"], "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_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: ValidationInfo) -> 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_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": 2025, "end_line": 2038, "span_ids": ["test_v1_validator_signature_kwargs1"], "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_v1_validator_signature_kwargs1() -> None:\n with pytest.warns(PydanticDeprecatedSince20, 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": 2041, "end_line": 2055, "span_ids": ["test_v1_validator_signature_kwargs2"], "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_v1_validator_signature_kwargs2() -> None:\n with pytest.warns(PydanticDeprecatedSince20, 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": 2058, "end_line": 2071, "span_ids": ["test_v1_validator_signature_with_values"], "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_with_values() -> None:\n with pytest.warns(PydanticDeprecatedSince20, 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": 2074, "end_line": 2087, "span_ids": ["test_v1_validator_signature_with_values_kw_only"], "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_v1_validator_signature_with_values_kw_only() -> None:\n with pytest.warns(PydanticDeprecatedSince20, 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_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": 44, "end_line": 76, "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 @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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('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': HasRepr(repr(ValueError('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/docs/plugins/main.py_from___future___import_an_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_from___future___import_an_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": 40, "span_ids": ["imports", "on_files", "on_pre_build"], "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": "from __future__ import annotations as _annotations\n\nimport json\nimport logging\nimport os\nimport re\nimport textwrap\nfrom pathlib import Path\nfrom textwrap import indent\n\nimport autoflake\nimport pyupgrade._main as pyupgrade_main # type: ignore\nimport tomli\nimport yaml\nfrom jinja2 import Template # type: ignore\nfrom mkdocs.config import Config\nfrom mkdocs.structure.files import Files\nfrom mkdocs.structure.pages import Page\n\nfrom .conversion_table import conversion_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 add_mkdocs_run_deps()\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/pydantic/_internal/_config.py_ConfigWrapper.for_model_ConfigWrapper.if_not_TYPE_CHECKING_.__getattr__.try_.except_KeyError_.try_.except_KeyError_.raise_AttributeError_f_Co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapper.for_model_ConfigWrapper.if_not_TYPE_CHECKING_.__getattr__.try_.except_KeyError_.try_.except_KeyError_.raise_AttributeError_f_Co", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 149, "span_ids": ["ConfigWrapper:43", "ConfigWrapper.for_model"], "tokens": 460}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigWrapper:\n\n @classmethod\n def for_model(cls, bases: tuple[type[Any], ...], namespace: dict[str, Any], kwargs: dict[str, Any]) -> Self:\n \"\"\"Build a new `ConfigWrapper` instance for a `BaseModel`.\n\n The config wrapper built based on (in descending order of priority):\n - options from `kwargs`\n - options from the `namespace`\n - options from the base classes (`bases`)\n\n Args:\n bases: A tuple of base classes.\n namespace: The namespace of the class being created.\n kwargs: The kwargs passed to the class being created.\n\n Returns:\n A `ConfigWrapper` instance for `BaseModel`.\n \"\"\"\n config_new = ConfigDict()\n for base in bases:\n config = getattr(base, 'model_config', None)\n if config:\n config_new.update(config.copy())\n\n config_class_from_namespace = namespace.get('Config')\n config_dict_from_namespace = namespace.get('model_config')\n\n raw_annotations = namespace.get('__annotations__', {})\n if raw_annotations.get('model_config') and not config_dict_from_namespace:\n raise PydanticUserError(\n '`model_config` cannot be used as a model field name. Use `model_config` for model configuration.',\n code='model-config-invalid-field-name',\n )\n\n if config_class_from_namespace and config_dict_from_namespace:\n raise PydanticUserError('\"Config\" and \"model_config\" cannot be used together', code='config-both')\n\n config_from_namespace = config_dict_from_namespace or prepare_config(config_class_from_namespace)\n\n config_new.update(config_from_namespace)\n\n for k in list(kwargs.keys()):\n if k in config_keys:\n config_new[k] = kwargs.pop(k)\n\n return cls(config_new)\n\n # we don't show `__getattr__` to type checkers so missing attributes cause errors\n if not TYPE_CHECKING: # pragma: no branch\n\n def __getattr__(self, name: str) -> Any:\n try:\n return self.config_dict[name]\n except KeyError:\n try:\n return config_defaults[name]\n except KeyError:\n raise AttributeError(f'Config has no attribute {name!r}') from 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/_config.py_ConfigWrapper.core_config_ConfigWrapper.__repr__.return.f_ConfigWrapper_c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapper.core_config_ConfigWrapper.__repr__.return.f_ConfigWrapper_c_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 189, "span_ids": ["ConfigWrapper.__repr__", "ConfigWrapper.core_config"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigWrapper:\n\n def core_config(self, obj: Any) -> core_schema.CoreConfig:\n \"\"\"Create a pydantic-core config, `obj` is just used to populate `title` if not set in config.\n\n Pass `obj=None` if you do not want to attempt to infer the `title`.\n\n We don't use getattr here since we don't want to populate with defaults.\n\n Args:\n obj: An object used to populate `title` if not set in config.\n\n Returns:\n A `CoreConfig` object created from config.\n \"\"\"\n\n def dict_not_none(**kwargs: Any) -> Any:\n return {k: v for k, v in kwargs.items() if v is not None}\n\n core_config = core_schema.CoreConfig(\n **dict_not_none(\n title=self.config_dict.get('title') or (obj and obj.__name__),\n extra_fields_behavior=self.config_dict.get('extra'),\n allow_inf_nan=self.config_dict.get('allow_inf_nan'),\n populate_by_name=self.config_dict.get('populate_by_name'),\n str_strip_whitespace=self.config_dict.get('str_strip_whitespace'),\n str_to_lower=self.config_dict.get('str_to_lower'),\n str_to_upper=self.config_dict.get('str_to_upper'),\n strict=self.config_dict.get('strict'),\n ser_json_timedelta=self.config_dict.get('ser_json_timedelta'),\n ser_json_bytes=self.config_dict.get('ser_json_bytes'),\n ser_json_inf_nan=self.config_dict.get('ser_json_inf_nan'),\n from_attributes=self.config_dict.get('from_attributes'),\n loc_by_alias=self.config_dict.get('loc_by_alias'),\n revalidate_instances=self.config_dict.get('revalidate_instances'),\n validate_default=self.config_dict.get('validate_default'),\n str_max_length=self.config_dict.get('str_max_length'),\n str_min_length=self.config_dict.get('str_min_length'),\n hide_input_in_errors=self.config_dict.get('hide_input_in_errors'),\n coerce_numbers_to_str=self.config_dict.get('coerce_numbers_to_str'),\n regex_engine=self.config_dict.get('regex_engine'),\n validation_error_cause=self.config_dict.get('validation_error_cause'),\n )\n )\n return core_config\n\n def __repr__(self):\n c = ', '.join(f'{k}={v!r}' for k, v in self.config_dict.items())\n return f'ConfigWrapper({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/pydantic/_internal/_config.py_config_defaults_config_defaults.ConfigDict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_config_defaults_config_defaults.ConfigDict_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 258, "span_ids": ["impl:7"], "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": "config_defaults = 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 populate_by_name=False,\n use_enum_values=False,\n validate_assignment=False,\n arbitrary_types_allowed=False,\n from_attributes=False,\n loc_by_alias=True,\n alias_generator=None,\n ignored_types=(),\n allow_inf_nan=True,\n json_schema_extra=None,\n strict=False,\n revalidate_instances='never',\n ser_json_timedelta='iso8601',\n ser_json_bytes='utf8',\n ser_json_inf_nan='null',\n validate_default=False,\n validate_return=False,\n protected_namespaces=('model_',),\n hide_input_in_errors=False,\n json_encoders=None,\n defer_build=False,\n plugin_settings=None,\n schema_generator=None,\n json_schema_serialization_defaults_required=False,\n json_schema_mode_override=None,\n coerce_numbers_to_str=False,\n regex_engine='rust-regex',\n validation_error_cause=False,\n use_attribute_docstrings=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/pydantic/_internal/_config.py_prepare_config_prepare_config.return.config_dict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_prepare_config_prepare_config.return.config_dict", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 205, "span_ids": ["prepare_config"], "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 prepare_config(config: ConfigDict | dict[str, Any] | type[Any] | None) -> ConfigDict:\n \"\"\"Create a `ConfigDict` instance from an existing dict, a class (e.g. old class-based config) or None.\n\n Args:\n config: The input config.\n\n Returns:\n A ConfigDict object created from config.\n \"\"\"\n if config is None:\n return ConfigDict()\n\n if not isinstance(config, dict):\n warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning)\n config = {k: getattr(config, k) for k in dir(config) if not k.startswith('__')}\n\n config_dict = cast(ConfigDict, config)\n check_deprecated(config_dict)\n return config_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/pydantic/_internal/_config.py_config_keys_V2_RENAMED_KEYS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_config_keys_V2_RENAMED_KEYS._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 307, "span_ids": ["impl:9"], "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": "config_keys = set(ConfigDict.__annotations__.keys())\n\n\nV2_REMOVED_KEYS = {\n 'allow_mutation',\n 'error_msg_templates',\n 'fields',\n 'getter_dict',\n 'smart_union',\n 'underscore_attrs_are_private',\n 'json_loads',\n 'json_dumps',\n 'copy_on_model_validation',\n 'post_init_call',\n}\nV2_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 'schema_extra': 'json_schema_extra',\n 'validate_all': '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/_internal/_config.py_check_deprecated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_check_deprecated_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 252, "span_ids": ["check_deprecated"], "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 check_deprecated(config_dict: ConfigDict) -> None:\n \"\"\"Check for deprecated config keys and warn the user.\n\n Args:\n config_dict: The input config.\n \"\"\"\n deprecated_removed_keys = V2_REMOVED_KEYS & config_dict.keys()\n deprecated_renamed_keys = V2_RENAMED_KEYS.keys() & config_dict.keys()\n if deprecated_removed_keys or deprecated_renamed_keys:\n renamings = {k: 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_": {"__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_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_metadata.py", "file_name": "_core_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 67, "end_line": 93, "span_ids": ["build_metadata_dict"], "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 build_metadata_dict(\n *, # force keyword arguments to make it easier to modify this signature in a backwards-compatible way\n js_functions: list[GetJsonSchemaFunction] | None = None,\n js_annotation_functions: list[GetJsonSchemaFunction] | None = None,\n js_prefer_positional_arguments: bool | None = None,\n typed_dict_cls: type[Any] | None = None,\n initial_metadata: Any | None = None,\n) -> Any:\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_js_functions=js_functions or [],\n pydantic_js_annotation_functions=js_annotation_functions or [],\n pydantic_js_prefer_positional_arguments=js_prefer_positional_arguments,\n pydantic_typed_dict_cls=typed_dict_cls,\n )\n metadata = {k: v for k, v in metadata.items() if v is not None}\n\n if initial_metadata is not None:\n metadata = {**initial_metadata, **metadata}\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/_decorators.py_PydanticDescriptorProxy_PydanticDescriptorProxy.__getattr__.return.getattr_self_wrapped___n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_PydanticDescriptorProxy_PydanticDescriptorProxy.__getattr__.return.getattr_self_wrapped___n", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 195, "span_ids": ["PydanticDescriptorProxy.__get__", "PydanticDescriptorProxy", "PydanticDescriptorProxy.__set_name__", "PydanticDescriptorProxy.__getattr__", "PydanticDescriptorProxy._call_wrapped_attr", "PydanticDescriptorProxy.__post_init__"], "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": "@dataclass # can't use slots here since we set attributes on `__post_init__`\nclass PydanticDescriptorProxy(Generic[ReturnType]):\n \"\"\"Wrap a classmethod, staticmethod, property 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 Attributes:\n wrapped: The decorator that has to be wrapped.\n decorator_info: The decorator info.\n shim: A wrapper function to wrap V1 style function.\n \"\"\"\n\n wrapped: DecoratedType[ReturnType]\n decorator_info: DecoratorInfo\n shim: Callable[[Callable[..., Any]], Callable[..., Any]] | None = None\n\n def __post_init__(self):\n for attr in 'setter', 'deleter':\n if hasattr(self.wrapped, attr):\n f = partial(self._call_wrapped_attr, name=attr)\n setattr(self, attr, f)\n\n def _call_wrapped_attr(self, func: Callable[[Any], None], *, name: str) -> PydanticDescriptorProxy[ReturnType]:\n self.wrapped = getattr(self.wrapped, name)(func)\n return self\n\n def __get__(self, obj: object | None, obj_type: type[object] | None = None) -> PydanticDescriptorProxy[ReturnType]:\n try:\n return self.wrapped.__get__(obj, obj_type)\n except AttributeError:\n # not a descriptor, e.g. a partial object\n return self.wrapped # type: ignore[return-value]\n\n def __set_name__(self, instance: Any, name: str) -> None:\n if hasattr(self.wrapped, '__set_name__'):\n self.wrapped.__set_name__(instance, name) # pyright: ignore[reportFunctionMemberAccess]\n\n def __getattr__(self, __name: str) -> Any:\n \"\"\"Forward checks for __isabstractmethod__ and such.\"\"\"\n return getattr(self.wrapped, __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/_internal/_decorators.py_DecoratorInfos_DecoratorInfos.computed_fields.field_default_factory_dic": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfos_DecoratorInfos.computed_fields.field_default_factory_dic", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 417, "span_ids": ["DecoratorInfos"], "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": "@dataclass(**slots_true)\nclass DecoratorInfos:\n \"\"\"Mapping of name in the class namespace to decorator info.\n\n note that the name in the class namespace is the function or attribute name\n not the field name!\n \"\"\"\n\n validators: dict[str, Decorator[ValidatorDecoratorInfo]] = field(default_factory=dict)\n field_validators: dict[str, Decorator[FieldValidatorDecoratorInfo]] = field(default_factory=dict)\n root_validators: dict[str, Decorator[RootValidatorDecoratorInfo]] = field(default_factory=dict)\n field_serializers: dict[str, Decorator[FieldSerializerDecoratorInfo]] = field(default_factory=dict)\n model_serializers: dict[str, Decorator[ModelSerializerDecoratorInfo]] = field(default_factory=dict)\n model_validators: dict[str, Decorator[ModelValidatorDecoratorInfo]] = field(default_factory=dict)\n computed_fields: dict[str, Decorator[ComputedFieldInfo]] = field(default_factory=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/pydantic/_internal/_decorators.py_DecoratorInfos.build.for_var_name_var_value_i_DecoratorInfos.build.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfos.build.for_var_name_var_value_i_DecoratorInfos.build.return.res", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 506, "span_ids": ["DecoratorInfos.build"], "tokens": 678}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclass(**slots_true)\nclass DecoratorInfos:\n\n @staticmethod\n def build(model_dc: type[Any]) -> DecoratorInfos:\n # ... other code\n\n for var_name, var_value in vars(model_dc).items():\n if isinstance(var_value, PydanticDescriptorProxy):\n info = var_value.decorator_info\n if isinstance(info, ValidatorDecoratorInfo):\n res.validators[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=var_value.shim, info=info\n )\n elif isinstance(info, FieldValidatorDecoratorInfo):\n res.field_validators[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=var_value.shim, info=info\n )\n elif isinstance(info, RootValidatorDecoratorInfo):\n res.root_validators[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=var_value.shim, info=info\n )\n elif isinstance(info, FieldSerializerDecoratorInfo):\n # check whether a serializer function is already registered for fields\n for field_serializer_decorator in res.field_serializers.values():\n # check that each field has at most one serializer function.\n # serializer functions for the same field in subclasses are allowed,\n # and are treated as overrides\n if field_serializer_decorator.cls_var_name == var_name:\n continue\n for f in info.fields:\n if f in field_serializer_decorator.info.fields:\n raise PydanticUserError(\n 'Multiple field serializer functions were defined '\n f'for field {f!r}, this is not allowed.',\n code='multiple-field-serializers',\n )\n res.field_serializers[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=var_value.shim, info=info\n )\n elif isinstance(info, ModelValidatorDecoratorInfo):\n res.model_validators[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=var_value.shim, info=info\n )\n elif isinstance(info, ModelSerializerDecoratorInfo):\n res.model_serializers[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=var_value.shim, info=info\n )\n else:\n from ..fields import ComputedFieldInfo\n\n isinstance(var_value, ComputedFieldInfo)\n res.computed_fields[var_name] = Decorator.build(\n model_dc, cls_var_name=var_name, shim=None, info=info\n )\n to_replace.append((var_name, var_value.wrapped))\n if to_replace:\n # If we can save `__pydantic_decorators__` on the class we'll be able to check for it above\n # so then we don't need to re-process the type, which means we can discard our descriptor wrappers\n # and replace them with the thing they are wrapping (see the other setattr call below)\n # which allows validator class methods to also function as regular class methods\n setattr(model_dc, '__pydantic_decorators__', res)\n for name, value in to_replace:\n setattr(model_dc, name, value)\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_inspect_validator_inspect_validator.raise_PydanticUserError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_validator_inspect_validator.raise_PydanticUserError_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 509, "end_line": 544, "span_ids": ["inspect_validator"], "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 inspect_validator(validator: Callable[..., Any], mode: FieldValidatorModes) -> bool:\n \"\"\"Look at a field or model validator function and determine whether it takes an info argument.\n\n An error is raised if the function has an invalid signature.\n\n Args:\n validator: The validator function to inspect.\n mode: The proposed validator mode.\n\n Returns:\n Whether the validator takes an info argument.\n \"\"\"\n try:\n sig = signature(validator)\n except ValueError:\n # builtins and some C extensions don't have signatures\n # assume that they don't take an info argument and only take a single argument\n # e.g. `str.strip` or `datetime.datetime`\n return False\n n_positional = count_positional_params(sig)\n if mode == 'wrap':\n if n_positional == 3:\n return True\n elif n_positional == 2:\n return False\n else:\n assert mode in {'before', 'after', 'plain'}, f\"invalid mode: {mode!r}, expected 'before', 'after' or 'plain\"\n if n_positional == 2:\n return True\n elif n_positional == 1:\n return False\n\n raise PydanticUserError(\n f'Unrecognized field_validator function signature for {validator} with `mode={mode}`:{sig}',\n code='validator-signature',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_annotated_serializer_inspect_annotated_serializer.if_info_arg_is_None_.else_.return.info_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_annotated_serializer_inspect_annotated_serializer.if_info_arg_is_None_.else_.return.info_arg", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 534, "end_line": 554, "span_ids": ["inspect_annotated_serializer"], "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 inspect_annotated_serializer(serializer: Callable[..., Any], mode: Literal['plain', 'wrap']) -> bool:\n \"\"\"Look at a serializer function used via `Annotated` and determine whether it takes an info argument.\n\n An error is raised if the function has an invalid signature.\n\n Args:\n serializer: The serializer function to check.\n mode: The serializer mode, either 'plain' or 'wrap'.\n\n Returns:\n info_arg\n \"\"\"\n sig = signature(serializer)\n info_arg = _serializer_info_arg(mode, count_positional_params(sig))\n if info_arg is None:\n raise PydanticUserError(\n f'Unrecognized field_serializer function signature for {serializer} with `mode={mode}`:{sig}',\n code='field-serializer-signature',\n )\n else:\n return info_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/_decorators.py_inspect_model_serializer_inspect_model_serializer.if_info_arg_is_None_.else_.return.info_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_model_serializer_inspect_model_serializer.if_info_arg_is_None_.else_.return.info_arg", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 557, "end_line": 582, "span_ids": ["inspect_model_serializer"], "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 inspect_model_serializer(serializer: Callable[..., Any], mode: Literal['plain', 'wrap']) -> bool:\n \"\"\"Look at a model serializer function and determine whether it takes an info argument.\n\n An error is raised if the function has an invalid signature.\n\n Args:\n serializer: The serializer function to check.\n mode: The serializer mode, either 'plain' or 'wrap'.\n\n Returns:\n `info_arg` - whether the function expects an info argument.\n \"\"\"\n if isinstance(serializer, (staticmethod, classmethod)) or not is_instance_method_from_sig(serializer):\n raise PydanticUserError(\n '`@model_serializer` must be applied to instance methods', code='model-serializer-instance-method'\n )\n\n sig = signature(serializer)\n info_arg = _serializer_info_arg(mode, count_positional_params(sig))\n if info_arg is None:\n raise PydanticUserError(\n f'Unrecognized model_serializer function signature for {serializer} with `mode={mode}`:{sig}',\n code='model-serializer-signature',\n )\n else:\n return info_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/_decorators.py__serializer_info_arg__serializer_info_arg.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py__serializer_info_arg__serializer_info_arg.return.None", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 635, "end_line": 652, "span_ids": ["_serializer_info_arg"], "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 _serializer_info_arg(mode: Literal['plain', 'wrap'], n_positional: int) -> bool | None:\n if mode == 'plain':\n if n_positional == 1:\n # (input_value: Any, /) -> Any\n return False\n elif n_positional == 2:\n # (model: Any, input_value: Any, /) -> Any\n return True\n else:\n assert mode == 'wrap', f\"invalid mode: {mode!r}, expected 'plain' or 'wrap'\"\n if n_positional == 2:\n # (input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any\n return False\n elif n_positional == 3:\n # (input_value: Any, serializer: SerializerFunctionWrapHandler, info: SerializationInfo, /) -> Any\n return True\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/_decorators.py_unwrap_wrapped_function_unwrap_wrapped_function.return.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_unwrap_wrapped_function_unwrap_wrapped_function.return.func", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 703, "end_line": 742, "span_ids": ["unwrap_wrapped_function"], "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 unwrap_wrapped_function(\n func: Any,\n *,\n unwrap_partial: bool = True,\n unwrap_class_static_method: bool = True,\n) -> Any:\n \"\"\"Recursively unwraps a wrapped function until the underlying function is reached.\n This handles property, functools.partial, functools.partialmethod, staticmethod and classmethod.\n\n Args:\n func: The function to unwrap.\n unwrap_partial: If True (default), unwrap partial and partialmethod decorators, otherwise don't.\n decorators.\n unwrap_class_static_method: If True (default), also unwrap classmethod and staticmethod\n decorators. If False, only unwrap partial and partialmethod decorators.\n\n Returns:\n The underlying function of the wrapped function.\n \"\"\"\n all: set[Any] = {property, cached_property}\n\n if unwrap_partial:\n all.update({partial, partialmethod})\n\n if unwrap_class_static_method:\n all.update({staticmethod, classmethod})\n\n while isinstance(func, tuple(all)):\n if unwrap_class_static_method and isinstance(func, (classmethod, staticmethod)):\n func = func.__func__\n elif isinstance(func, (partial, partialmethod)):\n func = func.func\n elif isinstance(func, property):\n func = func.fget # arbitrary choice, convenient for computed fields\n else:\n # Make coverage happy as it can only get here in the last possible case\n assert isinstance(func, cached_property)\n func = func.func # type: ignore\n\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_v1.py_make_generic_v1_field_validator_make_generic_v1_field_validator.if_needs_values_kw_.else_.return.wrapper2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_make_generic_v1_field_validator_make_generic_v1_field_validator.if_needs_values_kw_.else_.return.wrapper2", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators_v1.py", "file_name": "_decorators_v1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 109, "span_ids": ["make_generic_v1_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 make_generic_v1_field_validator(validator: V1Validator) -> core_schema.WithInfoValidatorFunction:\n \"\"\"Wrap a V1 style field validator for V2 compatibility.\n\n Args:\n validator: The V1 style field validator.\n\n Returns:\n A wrapped V2 style field validator.\n\n Raises:\n PydanticUserError: If the signature is not supported or the parameters are\n not available in Pydantic V2.\n \"\"\"\n sig = signature(validator)\n\n needs_values_kw = False\n\n for param_num, (param_name, parameter) in enumerate(sig.parameters.items()):\n if can_be_keyword(parameter) and param_name in ('field', 'config'):\n raise PydanticUserError(\n 'The `field` and `config` parameters are not available in Pydantic V2, '\n 'please use the `info` parameter instead.',\n code='validator-field-config-info',\n )\n if parameter.kind is Parameter.VAR_KEYWORD:\n needs_values_kw = True\n elif can_be_keyword(parameter) and param_name == 'values':\n needs_values_kw = True\n elif can_be_positional(parameter) and param_num == 0:\n # value\n continue\n elif parameter.default is Parameter.empty: # ignore params with defaults e.g. bound by functools.partial\n raise PydanticUserError(\n f'Unsupported signature for V1 style validator {validator}: {sig} is not supported.',\n code='validator-v1-signature',\n )\n\n if needs_values_kw:\n # (v, **kwargs), (v, values, **kwargs), (v, *, values, **kwargs) or (v, *, values)\n val1 = cast(V1ValidatorWithValues, validator)\n\n def wrapper1(value: Any, info: core_schema.ValidationInfo) -> Any:\n return val1(value, values=info.data)\n\n return wrapper1\n else:\n val2 = cast(V1OnlyValueValidator, validator)\n\n def wrapper2(value: Any, _: core_schema.ValidationInfo) -> Any:\n return val2(value)\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_v1.py_RootValidatorValues_V2CoreAfterRootValidator.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_RootValidatorValues_V2CoreAfterRootValidator.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators_v1.py", "file_name": "_decorators_v1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 137, "span_ids": ["impl:3", "V1RootValidatorFunction.__call__", "V2CoreBeforeRootValidator.__call__", "V2CoreBeforeRootValidator", "V1RootValidatorFunction", "V2CoreAfterRootValidator", "V2CoreAfterRootValidator.__call__"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "RootValidatorValues = Dict[str, Any]\n# technically tuple[model_dict, model_extra, fields_set] | tuple[dataclass_dict, init_vars]\nRootValidatorFieldsTuple = Tuple[Any, ...]\n\n\nclass V1RootValidatorFunction(Protocol):\n \"\"\"A simple root validator, supported for V1 validators and V2 validators.\"\"\"\n\n def __call__(self, __values: RootValidatorValues) -> RootValidatorValues:\n ...\n\n\nclass V2CoreBeforeRootValidator(Protocol):\n \"\"\"V2 validator with mode='before'.\"\"\"\n\n def __call__(self, __values: RootValidatorValues, __info: core_schema.ValidationInfo) -> RootValidatorValues:\n ...\n\n\nclass V2CoreAfterRootValidator(Protocol):\n \"\"\"V2 validator with mode='after'.\"\"\"\n\n def __call__(\n self, __fields_tuple: RootValidatorFieldsTuple, __info: core_schema.ValidationInfo\n ) -> RootValidatorFieldsTuple:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_": {"__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_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 448, "end_line": 488, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_inner_schema"], "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": "class _ApplyInferredDiscriminator:\n\n def _infer_discriminator_values_for_inner_schema(\n self, schema: core_schema.CoreSchema, source: str\n ) -> list[str | int]:\n \"\"\"When inferring discriminator values for a field, we typically extract the expected values from a literal\n schema. This function does that, but also handles nested unions and defaults.\n \"\"\"\n if schema['type'] == 'literal':\n return schema['expected']\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: list[Any] = []\n for choice in schema['choices']:\n choice_schema = choice[0] if isinstance(choice, tuple) else choice\n choice_values = self._infer_discriminator_values_for_inner_schema(choice_schema, 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 elif schema['type'] == 'function-after':\n # After validators don't affect the discriminator values\n return self._infer_discriminator_values_for_inner_schema(schema['schema'], source)\n\n elif schema['type'] in {'function-before', 'function-wrap', 'function-plain'}:\n validator_type = repr(schema['type'].split('-')[1])\n raise PydanticUserError(\n f'Cannot use a mode={validator_type} validator in the'\n f' discriminator field {self.discriminator!r} of {source}',\n code='discriminator-validator',\n )\n\n else:\n raise PydanticUserError(\n f'{source} needs field {self.discriminator!r} to be of type `Literal`',\n code='discriminator-needs-literal',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_model_fields_collect_model_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_model_fields_collect_model_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": 64, "end_line": 103, "span_ids": ["collect_model_fields"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def collect_model_fields( # noqa: C901\n cls: type[BaseModel],\n bases: tuple[type[Any], ...],\n config_wrapper: ConfigWrapper,\n types_namespace: dict[str, Any] | None,\n *,\n typevars_map: dict[Any, Any] | None = None,\n) -> tuple[dict[str, FieldInfo], set[str]]:\n \"\"\"Collect the fields of a nascent pydantic model.\n\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 Args:\n cls: BaseModel or dataclass.\n bases: Parents of the class, generally `cls.__bases__`.\n config_wrapper: The config wrapper instance.\n types_namespace: Optional extra namespace to look for types in.\n typevars_map: A dictionary mapping type variables to their concrete types.\n\n Returns:\n A tuple contains fields and class variables.\n\n Raises:\n NameError:\n - If there is a conflict between a field name and protected namespaces.\n - If there is a field other than `root` in `RootModel`.\n - If a field shadows an attribute in the parent model.\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 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_model_fields.for_ann_name_ann_type_in_collect_model_fields.return.fields_class_vars": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_collect_model_fields.for_ann_name_ann_type_in_collect_model_fields.return.fields_class_vars", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 245, "span_ids": ["collect_model_fields"], "tokens": 1175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_model_fields( # noqa: C901\n cls: type[BaseModel],\n bases: tuple[type[Any], ...],\n config_wrapper: ConfigWrapper,\n types_namespace: dict[str, Any] | None,\n *,\n typevars_map: dict[Any, Any] | None = None,\n) -> tuple[dict[str, FieldInfo], set[str]]:\n # ... other code\n for ann_name, ann_type in type_hints.items():\n if ann_name == 'model_config':\n # We never want to treat `model_config` as a field\n # Note: we may need to change this logic if/when we introduce a `BareModel` class with no\n # protected namespaces (where `model_config` might be allowed as a field name)\n continue\n for protected_namespace in config_wrapper.protected_namespaces:\n if ann_name.startswith(protected_namespace):\n for b in bases:\n if hasattr(b, ann_name):\n from ..main import BaseModel\n\n if not (issubclass(b, BaseModel) and ann_name in b.model_fields):\n raise NameError(\n f'Field \"{ann_name}\" conflicts with member {getattr(b, ann_name)}'\n f' of protected namespace \"{protected_namespace}\".'\n )\n else:\n valid_namespaces = tuple(\n x for x in config_wrapper.protected_namespaces if not ann_name.startswith(x)\n )\n warnings.warn(\n f'Field \"{ann_name}\" has conflict with protected namespace \"{protected_namespace}\".'\n '\\n\\nYou may be able to resolve this warning by setting'\n f\" `model_config['protected_namespaces'] = {valid_namespaces}`.\",\n UserWarning,\n )\n if is_classvar(ann_type):\n class_vars.add(ann_name)\n continue\n if _is_finalvar_with_default_val(ann_type, getattr(cls, ann_name, PydanticUndefined)):\n class_vars.add(ann_name)\n continue\n if not is_valid_field_name(ann_name):\n continue\n if cls.__pydantic_root_model__ and ann_name != 'root':\n raise NameError(\n f\"Unexpected field with name {ann_name!r}; only 'root' is allowed as a field of a `RootModel`\"\n )\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_metadata__', {}).get('origin')\n for base in bases:\n dataclass_fields = {\n field.name for field in (dataclasses.fields(base) if dataclasses.is_dataclass(base) else ())\n }\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\n if ann_name in dataclass_fields:\n # Don't error when inheriting stdlib dataclasses whose fields are \"shadowed\" by defaults being set\n # on the class instance.\n continue\n warnings.warn(\n f'Field name \"{ann_name}\" shadows an attribute in parent \"{base.__qualname__}\"; ',\n UserWarning,\n )\n\n try:\n default = getattr(cls, ann_name, PydanticUndefined)\n if default is PydanticUndefined:\n raise AttributeError\n except AttributeError:\n if ann_name in annotations:\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 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 except AttributeError:\n pass # indicates the attribute was on a parent class\n\n # Use cls.__dict__['__pydantic_decorators__'] instead of cls.__pydantic_decorators__\n # to make sure the decorators have already been built for this exact class\n decorators: DecoratorInfos = cls.__dict__['__pydantic_decorators__']\n if ann_name in decorators.computed_fields:\n raise ValueError(\"you can't override a field with a computed field\")\n fields[ann_name] = field_info\n\n if typevars_map:\n for field in fields.values():\n field.apply_typevars_map(typevars_map, types_namespace)\n\n _update_fields_from_docstrings(cls, fields, config_wrapper)\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/_fields.py__is_finalvar_with_default_val_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__is_finalvar_with_default_val_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 339, "span_ids": ["collect_dataclass_fields", "is_valid_field_name", "_is_finalvar_with_default_val", "is_valid_privateattr_name"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _is_finalvar_with_default_val(type_: type[Any], val: Any) -> bool:\n from ..fields import FieldInfo\n\n if not is_finalvar(type_):\n return False\n elif val is PydanticUndefined:\n return False\n elif isinstance(val, FieldInfo) and (val.default is PydanticUndefined and val.default_factory is None):\n return False\n else:\n return True\n\n\ndef collect_dataclass_fields(\n cls: type[StandardDataclass],\n types_namespace: dict[str, Any] | None,\n *,\n typevars_map: dict[Any, Any] | None = None,\n config_wrapper: ConfigWrapper | None = None,\n) -> dict[str, FieldInfo]:\n \"\"\"Collect the fields of a dataclass.\n\n Args:\n cls: dataclass.\n types_namespace: Optional extra namespace to look for types in.\n typevars_map: A dictionary mapping type variables to their concrete types.\n config_wrapper: The config wrapper instance.\n\n Returns:\n The dataclass fields.\n \"\"\"\n from ..fields import FieldInfo\n\n fields: dict[str, FieldInfo] = {}\n dataclass_fields: dict[str, dataclasses.Field] = cls.__dataclass_fields__\n cls_localns = dict(vars(cls)) # this matches get_cls_type_hints_lenient, but all tests pass with `= None` instead\n\n source_module = sys.modules.get(cls.__module__)\n if source_module is not None:\n types_namespace = {**source_module.__dict__, **(types_namespace or {})}\n\n for ann_name, dataclass_field in dataclass_fields.items():\n ann_type = _typing_extra.eval_type_lenient(dataclass_field.type, types_namespace, cls_localns)\n if is_classvar(ann_type):\n continue\n\n if (\n not dataclass_field.init\n and dataclass_field.default == dataclasses.MISSING\n and dataclass_field.default_factory == dataclasses.MISSING\n ):\n # TODO: We should probably do something with this so that validate_assignment behaves properly\n # Issue: https://github.com/pydantic/pydantic/issues/5470\n continue\n\n if isinstance(dataclass_field.default, FieldInfo):\n if dataclass_field.default.init_var:\n if dataclass_field.default.init is False:\n raise PydanticUserError(\n f'Dataclass field {ann_name} has init=False and init_var=True, but these are mutually exclusive.',\n code='clashing-init-and-init-var',\n )\n\n # TODO: same note as above re validate_assignment\n continue\n field_info = FieldInfo.from_annotated_attribute(ann_type, dataclass_field.default)\n else:\n field_info = FieldInfo.from_annotated_attribute(ann_type, dataclass_field)\n\n fields[ann_name] = field_info\n\n if field_info.default is not PydanticUndefined and isinstance(getattr(cls, ann_name, field_info), FieldInfo):\n # We need this to fix the default when the \"default\" from __dataclass_fields__ is a pydantic.FieldInfo\n setattr(cls, ann_name, field_info.default)\n\n if typevars_map:\n for field in fields.values():\n field.apply_typevars_map(typevars_map, types_namespace)\n\n if config_wrapper is not None:\n _update_fields_from_docstrings(cls, fields, config_wrapper)\n\n return fields\n\n\ndef is_valid_field_name(name: str) -> bool:\n return not name.startswith('_')\n\n\ndef is_valid_privateattr_name(name: str) -> bool:\n return name.startswith('_') and not name.startswith('__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 503, "end_line": 520, "span_ids": ["GenerateSchema._generate_td_field_schema"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 \"\"\"Prepare a TypedDictField to represent a model or typeddict field.\"\"\"\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": 933, "end_line": 952, "span_ids": ["GenerateSchema._generate_dc_field_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 _generate_dc_field_schema(\n self,\n name: str,\n field_info: FieldInfo,\n decorators: DecoratorInfos,\n ) -> core_schema.DataclassField:\n \"\"\"Prepare a DataclassField to represent the parameter/field, of a dataclass.\"\"\"\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=field_info.init,\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 frozen=common_field['frozen'],\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._callable_schema_GenerateSchema._callable_schema.return.core_schema_call_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._callable_schema_GenerateSchema._callable_schema.return.core_schema_call_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": 1432, "end_line": 1483, "span_ids": ["GenerateSchema._callable_schema"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _callable_schema(self, function: Callable[..., Any]) -> core_schema.CallSchema:\n \"\"\"Generate schema for a Callable.\n\n TODO support functional validators once we support them in Config\n \"\"\"\n sig = signature(function)\n\n type_hints = _typing_extra.get_function_type_hints(function)\n\n mode_lookup: dict[_ParameterKind, Literal['positional_only', 'positional_or_keyword', 'keyword_only']] = {\n Parameter.POSITIONAL_ONLY: 'positional_only',\n Parameter.POSITIONAL_OR_KEYWORD: 'positional_or_keyword',\n Parameter.KEYWORD_ONLY: 'keyword_only',\n }\n\n arguments_list: list[core_schema.ArgumentsParameter] = []\n var_args_schema: core_schema.CoreSchema | None = None\n var_kwargs_schema: core_schema.CoreSchema | None = None\n\n for name, p in sig.parameters.items():\n if p.annotation is sig.empty:\n annotation = Any\n else:\n annotation = type_hints[name]\n\n parameter_mode = mode_lookup.get(p.kind)\n if parameter_mode is not None:\n arg_schema = self._generate_parameter_schema(name, annotation, p.default, parameter_mode)\n arguments_list.append(arg_schema)\n elif p.kind == Parameter.VAR_POSITIONAL:\n var_args_schema = self.generate_schema(annotation)\n else:\n assert p.kind == Parameter.VAR_KEYWORD, p.kind\n var_kwargs_schema = self.generate_schema(annotation)\n\n return_schema: core_schema.CoreSchema | None = None\n config_wrapper = self._config_wrapper\n if config_wrapper.validate_return:\n return_hint = type_hints.get('return')\n if return_hint is not None:\n return_schema = self.generate_schema(return_hint)\n\n return core_schema.call_schema(\n core_schema.arguments_schema(\n arguments_list,\n var_args_schema=var_args_schema,\n var_kwargs_schema=var_kwargs_schema,\n populate_by_name=config_wrapper.populate_by_name,\n ),\n function,\n return_schema=return_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_apply_model_validators_apply_model_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_model_validators_apply_model_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": 1909, "end_line": 1953, "span_ids": ["apply_model_validators"], "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": "def apply_model_validators(\n schema: core_schema.CoreSchema,\n validators: Iterable[Decorator[ModelValidatorDecoratorInfo]],\n mode: Literal['inner', 'outer', 'all'],\n) -> core_schema.CoreSchema:\n \"\"\"Apply model validators to a schema.\n\n If mode == 'inner', only \"before\" validators are applied\n If mode == 'outer', validators other than \"before\" are applied\n If mode == 'all', all validators are applied\n\n Args:\n schema: The schema to apply validators on.\n validators: An iterable of validators.\n mode: The validator mode.\n\n Returns:\n The updated schema.\n \"\"\"\n ref: str | None = schema.pop('ref', None) # type: ignore\n for validator in validators:\n if mode == 'inner' and validator.info.mode != 'before':\n continue\n if mode == 'outer' and validator.info.mode == 'before':\n continue\n info_arg = inspect_validator(validator.func, validator.info.mode)\n if validator.info.mode == 'wrap':\n if info_arg:\n schema = core_schema.with_info_wrap_validator_function(function=validator.func, schema=schema)\n else:\n schema = core_schema.no_info_wrap_validator_function(function=validator.func, schema=schema)\n elif validator.info.mode == 'before':\n if info_arg:\n schema = core_schema.with_info_before_validator_function(function=validator.func, schema=schema)\n else:\n schema = core_schema.no_info_before_validator_function(function=validator.func, schema=schema)\n else:\n assert validator.info.mode == 'after'\n if info_arg:\n schema = core_schema.with_info_after_validator_function(function=validator.func, schema=schema)\n else:\n schema = core_schema.no_info_after_validator_function(function=validator.func, schema=schema)\n if ref:\n schema['ref'] = ref # 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/_generics.py_get_args_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_get_args_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": 203, "end_line": 214, "span_ids": ["get_args", "get_origin"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_args(v: Any) -> Any:\n pydantic_generic_metadata: PydanticGenericMetadata | None = getattr(v, '__pydantic_generic_metadata__', None)\n if pydantic_generic_metadata:\n return pydantic_generic_metadata.get('args')\n return typing_extensions.get_args(v)\n\n\ndef get_origin(v: Any) -> Any:\n pydantic_generic_metadata: PydanticGenericMetadata | None = getattr(v, '__pydantic_generic_metadata__', None)\n if pydantic_generic_metadata:\n return pydantic_generic_metadata.get('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_get_standard_typevars_map_get_standard_typevars_map.return.dict_zip_parameters_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_standard_typevars_map_get_standard_typevars_map.return.dict_zip_parameters_args", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 239, "span_ids": ["get_standard_typevars_map"], "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 get_standard_typevars_map(cls: type[Any]) -> dict[TypeVarType, Any] | None:\n \"\"\"Package a generic type's typevars and parametrization (if present) into a dictionary compatible with the\n `replace_types` function. Specifically, this works with standard typing generics and typing._GenericAlias.\n \"\"\"\n origin = get_origin(cls)\n if origin is None:\n return None\n if not hasattr(origin, '__parameters__'):\n return None\n\n # In this case, we know that cls is a _GenericAlias, and origin is the generic type\n # So it is safe to access cls.__args__ and origin.__parameters__\n args: tuple[Any, ...] = cls.__args__ # type: ignore\n parameters: tuple[TypeVarType, ...] = origin.__parameters__\n return dict(zip(parameters, 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/_generics.py_get_model_typevars_map_get_model_typevars_map.return.dict_zip_iter_contained_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_get_model_typevars_map_get_model_typevars_map.return.dict_zip_iter_contained_t", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 239, "span_ids": ["get_model_typevars_map"], "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 get_model_typevars_map(cls: type[BaseModel]) -> dict[TypeVarType, Any] | None:\n \"\"\"Package a generic BaseModel's typevars and concrete parametrization (if present) into a dictionary compatible\n with the `replace_types` function.\n\n Since BaseModel.__class_getitem__ does not produce a typing._GenericAlias, and the BaseModel generic info is\n stored in the __pydantic_generic_metadata__ attribute, we need special handling here.\n \"\"\"\n # TODO: This could be unified with `get_standard_typevars_map` if we stored the generic metadata\n # in the __origin__, __args__, and __parameters__ attributes of the model.\n generic_metadata = cls.__pydantic_generic_metadata__\n origin = generic_metadata['origin']\n args = generic_metadata['args']\n return dict(zip(iter_contained_typevars(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/_schema_generation_shared.py_GenerateJsonSchemaHandler.resolve_ref_schema_GenerateJsonSchemaHandler.resolve_ref_schema.return.json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_GenerateJsonSchemaHandler.resolve_ref_schema_GenerateJsonSchemaHandler.resolve_ref_schema.return.json_schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_schema_generation_shared.py", "file_name": "_schema_generation_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 61, "span_ids": ["GenerateJsonSchemaHandler.resolve_ref_schema"], "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 GenerateJsonSchemaHandler(GetJsonSchemaHandler):\n\n def resolve_ref_schema(self, maybe_ref_json_schema: JsonSchemaValue) -> JsonSchemaValue:\n \"\"\"Resolves `$ref` in the json schema.\n\n This returns the input json schema if there is no `$ref` in json schema.\n\n Args:\n maybe_ref_json_schema: The input json schema that may contains `$ref`.\n\n Returns:\n Resolved json schema.\n\n Raises:\n LookupError: If it can't find the definition for `$ref`.\n \"\"\"\n if '$ref' not in maybe_ref_json_schema:\n return maybe_ref_json_schema\n ref = maybe_ref_json_schema['$ref']\n json_schema = self.generate_json_schema.get_schema_from_definitions(ref)\n if json_schema is None:\n raise LookupError(\n f'Could not find a ref for {ref}.'\n ' Maybe you tried to call resolve_ref_schema from within a recursive model?'\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/_internal/_typing_extra.py_add_module_globals_get_cls_types_namespace.return.ns": {"__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_get_cls_types_namespace.return.ns", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 231, "span_ids": ["get_cls_types_namespace", "add_module_globals"], "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 add_module_globals(obj: Any, globalns: dict[str, Any] | None = 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 {}\n\n\ndef get_cls_types_namespace(cls: type[Any], parent_namespace: dict[str, Any] | None = None) -> dict[str, Any]:\n ns = add_module_globals(cls, parent_namespace)\n ns[cls.__name__] = cls\n return ns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_eval_type_lenient_eval_type_lenient.try_.except_NameError_.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_eval_type_lenient_eval_type_lenient.try_.except_NameError_.return.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": 216, "end_line": 227, "span_ids": ["eval_type_lenient"], "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 eval_type_lenient(value: Any, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None) -> Any:\n \"\"\"Behaves like typing._eval_type, except it won't raise an error if a forward reference can't be resolved.\"\"\"\n if value is None:\n value = NoneType\n elif isinstance(value, str):\n value = _make_forward_ref(value, is_argument=False, is_class=True)\n\n try:\n return eval_type_backport(value, globalns, localns)\n except NameError:\n # the point of this function is to be tolerant to this case\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/_internal/_typing_extra.py_if_sys_version_info_3_if_sys_version_info_3.else_.get_type_hints.None_4": {"__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.None_4", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 331, "end_line": 464, "span_ids": ["impl:39"], "tokens": 1280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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 \"\"\"Taken verbatim from python 3.10.8 unchanged, except:\n * type annotations of the function definition above.\n * prefixing `typing.` where appropriate\n * Use `_make_forward_ref` instead of `typing.ForwardRef` to handle the `is_class` argument.\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 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 = _make_forward_ref(value, is_argument=False, is_class=True)\n\n value = eval_type_backport(value, base_globals, base_locals)\n hints[name] = value\n if not include_extras and hasattr(typing, '_strip_annotations'):\n return {\n k: typing._strip_annotations(t) # type: ignore\n for k, t in hints.items()\n }\n else:\n return hints\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): # type: ignore\n return {}\n else:\n raise TypeError(f'{obj!r} is not a module, class, method, ' 'or function.')\n defaults = typing._get_defaults(obj) # type: ignore\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 = _make_forward_ref(\n value,\n is_argument=not isinstance(obj, types.ModuleType),\n is_class=False,\n )\n value = eval_type_backport(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()} # 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/class_validators.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/class_validators.py__", "embedding": null, "metadata": {"file_path": "pydantic/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 32}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"`class_validators` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/color.py_Color.as_named_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.as_named_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": 111, "end_line": 135, "span_ids": ["Color.as_named"], "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": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n\n def as_named(self, *, fallback: bool = False) -> str:\n \"\"\"Returns the name of the color if it can be found in `COLORS_BY_VALUE` dictionary,\n otherwise returns the hexadecimal representation of the color or raises `ValueError`.\n\n Args:\n fallback: If True, falls back to returning the hexadecimal representation of\n the color instead of raising a ValueError when no named color is found.\n\n Returns:\n The name of the color, or the hexadecimal representation of the color.\n\n Raises:\n ValueError: When no named color is found and fallback is `False`.\n \"\"\"\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_ints_to_rgba_ints_to_rgba.return.RGBA_parse_color_value_r_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_ints_to_rgba_ints_to_rgba.return.RGBA_parse_color_value_r_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 347, "span_ids": ["ints_to_rgba"], "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 ints_to_rgba(r: Union[int, str], g: Union[int, str], b: Union[int, str], alpha: Optional[float] = None) -> RGBA:\n \"\"\"Converts integer or string values for RGB color and an optional alpha value to an `RGBA` object.\n\n Args:\n r: An integer or string representing the red color value.\n g: An integer or string representing the green color value.\n b: An integer or string representing the blue color value.\n alpha: A float representing the alpha value. Defaults to None.\n\n Returns:\n An instance of the `RGBA` class with the corresponding color and alpha values.\n \"\"\"\n return RGBA(parse_color_value(r), parse_color_value(g), parse_color_value(b), parse_float_alpha(alpha))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_color_value_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_parse_color_value_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": 350, "end_line": 374, "span_ids": ["parse_color_value"], "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 parse_color_value(value: Union[int, str], max_val: int = 255) -> float:\n \"\"\"Parse the color value provided and return a number between 0 and 1.\n\n Args:\n value: An integer or string color value.\n max_val: Maximum range value. Defaults to 255.\n\n Raises:\n PydanticCustomError: If the value is not a valid color.\n\n Returns:\n A number between 0 and 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_hsl_parse_hsl.return.RGBA_r_g_b_parse_float": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_hsl_parse_hsl.return.RGBA_r_g_b_parse_float", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 407, "end_line": 432, "span_ids": ["parse_hsl"], "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 parse_hsl(h: str, h_units: str, sat: str, light: str, alpha: Optional[float] = None) -> RGBA:\n \"\"\"Parse raw hue, saturation, lightness, and alpha values and convert to RGBA.\n\n Args:\n h: The hue value.\n h_units: The unit for hue value.\n sat: The saturation value.\n light: The lightness value.\n alpha: Alpha value.\n\n Returns:\n An instance of `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))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_float_to_255_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_float_to_255_", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 435, "end_line": 601, "span_ids": ["impl:36", "float_to_255", "impl:34"], "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 float_to_255(c: float) -> int:\n \"\"\"Converts a float value between 0 and 1 (inclusive) to an integer between 0 and 255 (inclusive).\n\n Args:\n c: The float value to be converted. Must be between 0 and 1 (inclusive).\n\n Returns:\n The integer equivalent of the given float value rounded to the nearest whole number.\n\n Raises:\n ValueError: If the given float value is outside the acceptable range of 0 to 1 (inclusive).\n \"\"\"\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/datetime_parse.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/datetime_parse.py__", "embedding": null, "metadata": {"file_path": "pydantic/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 32}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `datetime_parse` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/decorator.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/decorator.py__", "embedding": null, "metadata": {"file_path": "pydantic/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 32}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `decorator` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/deprecated/config.py_from___future___import_an__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/deprecated/config.py_from___future___import_an__ConfigMetaclass.__getattr__.try_.except_KeyError_as_exc_.raise_AttributeError_f_ty", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["imports", "_ConfigMetaclass.__getattr__", "_ConfigMetaclass"], "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": "from __future__ import annotations as _annotations\n\nimport warnings\nfrom typing import TYPE_CHECKING, Any\n\nfrom typing_extensions import Literal, deprecated\n\nfrom .._internal import _config\nfrom ..warnings import PydanticDeprecatedSince20\n\nif not TYPE_CHECKING:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n\n__all__ = 'BaseConfig', 'Extra'\n\n\nclass _ConfigMetaclass(type):\n def __getattr__(self, item: str) -> Any:\n try:\n obj = _config.config_defaults[item]\n warnings.warn(_config.DEPRECATION_MESSAGE, DeprecationWarning)\n return obj\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/deprecated/decorator.py_warnings_validate_arguments_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_warnings_validate_arguments_1._", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["validate_arguments", "imports", "validate_arguments_1"], "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 warnings\nfrom functools import wraps\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload\n\nfrom typing_extensions import deprecated\n\nfrom .._internal import _config, _typing_extra\nfrom ..alias_generators import to_pascal\nfrom ..errors import PydanticUserError\nfrom ..functional_validators import field_validator\nfrom ..main import BaseModel, create_model\nfrom ..warnings import PydanticDeprecatedSince20\n\nif not TYPE_CHECKING:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\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/deprecated/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/deprecated/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 72, "span_ids": ["impl:13", "validate_arguments_2"], "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": "@deprecated(\n 'The `validate_arguments` method is deprecated; use `validate_call` instead.',\n category=None,\n)\ndef validate_arguments(func: Optional['AnyCallableT'] = None, *, config: 'ConfigType' = None) -> Any:\n \"\"\"Decorator to validate the arguments passed to a function.\"\"\"\n warnings.warn(\n 'The `validate_arguments` method is deprecated; use `validate_call` instead.',\n PydanticDeprecatedSince20,\n stacklevel=2,\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/deprecated/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/deprecated/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 75, "end_line": 150, "span_ids": ["ValidatedFunction", "ValidatedFunction.__init__", "ValidatedFunction.call", "ValidatedFunction.init_model_instance"], "tokens": 706}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidatedFunction:\n def __init__(self, function: 'AnyCallable', 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 code=None,\n )\n\n self.raw_function = function\n self.arg_mapping: Dict[int, str] = {}\n self.positional_only_args: set[str] = 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\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/deprecated/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/deprecated/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 184, "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/deprecated/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/deprecated/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/deprecated/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 213, "span_ids": ["ValidatedFunction.execute"], "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 ValidatedFunction:\n\n def execute(self, m: BaseModel) -> Any:\n d = {k: v for k, v in m.__dict__.items() if k in m.__pydantic_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/deprecated/decorator.py_ValidatedFunction.create_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/decorator.py_ValidatedFunction.create_model_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 216, "end_line": 272, "span_ids": ["ValidatedFunction.create_model"], "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": "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_wrapper = _config.ConfigWrapper(config)\n\n if config_wrapper.alias_generator:\n raise PydanticUserError(\n 'Setting the \"alias_generator\" property on custom Config for '\n '@validate_arguments is not yet supported, please remove.',\n code=None,\n )\n if config_wrapper.extra is None:\n config_wrapper.config_dict['extra'] = 'forbid'\n\n class DecoratorBaseModel(BaseModel):\n @field_validator(self.v_args_name, check_fields=False)\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)\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)\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)\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_wrapper.config_dict\n\n self.model = create_model(to_pascal(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/deprecated/json.py__TODO_Add_a_suggested_m_custom_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.return.pydantic_encoder_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py__TODO_Add_a_suggested_m_custom_pydantic_encoder.for_base_in_obj___class__.else_We_have_exited_t.return.pydantic_encoder_obj_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 131, "span_ids": ["pydantic_encoder", "custom_pydantic_encoder"], "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": "# TODO: Add a suggested migration path once there is a way to use custom encoders\n@deprecated(\n '`custom_pydantic_encoder` is deprecated, use `BaseModel.model_dump` instead.',\n category=None,\n)\ndef custom_pydantic_encoder(type_encoders: Dict[Any, Callable[[Type[Any]], Any]], obj: Any) -> Any:\n warnings.warn(\n '`custom_pydantic_encoder` is deprecated, use `BaseModel.model_dump` instead.',\n category=PydanticDeprecatedSince20,\n stacklevel=2,\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 = 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_timedelta_isoformat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/json.py_timedelta_isoformat_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 141, "span_ids": ["timedelta_isoformat"], "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": "@deprecated('`timedelta_isoformat` is deprecated.', category=None)\ndef timedelta_isoformat(td: datetime.timedelta) -> str:\n \"\"\"ISO 8601 encoding for Python timedelta object.\"\"\"\n warnings.warn('`timedelta_isoformat` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)\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/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/deprecated/tools.py_schema_of_schema_of.return.res", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 78, "span_ids": ["schema_of"], "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": "@deprecated(\n '`schema_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.',\n category=None,\n)\ndef 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 warnings.warn(\n '`schema_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.',\n category=PydanticDeprecatedSince20,\n stacklevel=2,\n )\n res = TypeAdapter(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/deprecated/tools.py_schema_json_of_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_schema_json_of_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 104, "span_ids": ["schema_json_of"], "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": "@deprecated(\n '`schema_json_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.',\n category=None,\n)\ndef 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 warnings.warn(\n '`schema_json_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.',\n category=PydanticDeprecatedSince20,\n stacklevel=2,\n )\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/env_settings.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/env_settings.py__", "embedding": null, "metadata": {"file_path": "pydantic/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 32}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `env_settings` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/error_wrappers.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/error_wrappers.py__", "embedding": null, "metadata": {"file_path": "pydantic/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 33}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `error_wrappers` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/errors.py_PydanticUndefinedAnnotation_PydanticUndefinedAnnotation.from_name_error.return.cls_name_name_message_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticUndefinedAnnotation_PydanticUndefinedAnnotation.from_name_error.return.cls_name_name_message_st", "embedding": null, "metadata": {"file_path": "pydantic/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 109, "span_ids": ["PydanticUndefinedAnnotation", "PydanticUndefinedAnnotation.__init__", "PydanticUndefinedAnnotation.from_name_error"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticUndefinedAnnotation(PydanticErrorMixin, NameError):\n \"\"\"A subclass of `NameError` raised when handling undefined annotations during `CoreSchema` generation.\n\n Attributes:\n name: Name of the error.\n message: Description of the error.\n \"\"\"\n\n def __init__(self, name: str, message: str) -> None:\n self.name = name\n super().__init__(message=message, code='undefined-annotation')\n\n @classmethod\n def from_name_error(cls, name_error: NameError) -> Self:\n \"\"\"Convert a `NameError` to a `PydanticUndefinedAnnotation` error.\n\n Args:\n name_error: `NameError` to be converted.\n\n Returns:\n Converted `PydanticUndefinedAnnotation` error.\n \"\"\"\n try:\n name = name_error.name # type: ignore # python > 3.10\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))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_PydanticImportError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticImportError_", "embedding": null, "metadata": {"file_path": "pydantic/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 146, "span_ids": ["PydanticInvalidForJsonSchema", "PydanticSchemaGenerationError.__init__", "PydanticImportError.__init__", "impl:7", "PydanticImportError", "PydanticSchemaGenerationError", "PydanticInvalidForJsonSchema.__init__"], "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 PydanticImportError(PydanticErrorMixin, ImportError):\n \"\"\"An error raised when an import fails due to module changes between V1 and V2.\n\n Attributes:\n message: Description of the error.\n \"\"\"\n\n def __init__(self, message: str) -> None:\n super().__init__(message, code='import-error')\n\n\nclass PydanticSchemaGenerationError(PydanticUserError):\n \"\"\"An error raised during failures to generate a `CoreSchema` for some type.\n\n Attributes:\n message: Description of the error.\n \"\"\"\n\n def __init__(self, message: str) -> None:\n super().__init__(message, code='schema-for-unknown-type')\n\n\nclass PydanticInvalidForJsonSchema(PydanticUserError):\n \"\"\"An error raised during failures to generate a JSON schema for some `CoreSchema`.\n\n Attributes:\n message: Description of the error.\n \"\"\"\n\n def __init__(self, message: str) -> None:\n super().__init__(message, code='invalid-for-json-schema')\n\n\n__getattr__ = getattr_migration(__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/fields.py_FieldInfo.get_default_FieldInfo.get_default.if_self_default_factory_i.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.get_default_FieldInfo.get_default.if_self_default_factory_i.else_.return.None", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 441, "end_line": 459, "span_ids": ["FieldInfo.get_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": "class FieldInfo(_repr.Representation):\n\n def get_default(self, *, call_default_factory: bool = False) -> Any:\n \"\"\"Get the default value.\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 Args:\n call_default_factory: Whether to call the default_factory or not. Defaults to `False`.\n\n Returns:\n The default value, calling the default factory if requested or `None` if not set.\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.get_default_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.get_default_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": 785, "end_line": 801, "span_ids": ["ModelPrivateAttr.get_default", "ModelPrivateAttr.__eq__"], "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 ModelPrivateAttr(_repr.Representation):\n\n def get_default(self) -> Any:\n \"\"\"Retrieve the default value of the object.\n\n If `self.default_factory` is `None`, the method will return a deep copy of the `self.default` object.\n\n If `self.default_factory` is not `None`, it will call `self.default_factory` and return the value returned.\n\n Returns:\n The default value of the object.\n \"\"\"\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_PrivateAttr.return.ModelPrivateAttr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_PrivateAttr_PrivateAttr.return.ModelPrivateAttr_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 881, "end_line": 912, "span_ids": ["PrivateAttr"], "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 PrivateAttr(\n default: Any = PydanticUndefined,\n *,\n default_factory: typing.Callable[[], Any] | None = None,\n) -> Any:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/models/#private-model-attributes\n\n Indicates that an attribute is intended for private use and not handled during normal validation/serialization.\n\n Private attributes are not validated by Pydantic, so it's up to you to ensure they are used in a type-safe manner.\n\n Private attributes are stored in `__private_attributes__` on the model.\n\n Args:\n default: The attribute's default value. Defaults to Undefined.\n default_factory: Callable that will be\n called when a default value is needed for this attribute.\n If both `default` and `default_factory` are set, an error will be raised.\n\n Returns:\n An instance of [`ModelPrivateAttr`][pydantic.fields.ModelPrivateAttr] class.\n\n Raises:\n ValueError: If both `default` and `default_factory` are set.\n \"\"\"\n if default is not PydanticUndefined and default_factory is not None:\n raise TypeError('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/generics.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/generics.py__", "embedding": null, "metadata": {"file_path": "pydantic/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 32}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `generics` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/json.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/json.py__", "embedding": null, "metadata": {"file_path": "pydantic/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `json` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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.__pydantic_init_subclass___BaseModel.__pydantic_init_subclass__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__pydantic_init_subclass___BaseModel.__pydantic_init_subclass__.pass", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 604, "end_line": 621, "span_ids": ["BaseModel.__pydantic_init_subclass__"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def __pydantic_init_subclass__(cls, **kwargs: Any) -> None:\n \"\"\"This is intended to behave just like `__init_subclass__`, but is called by `ModelMetaclass`\n only after the class is actually fully initialized. In particular, attributes like `model_fields` will\n be present when this is called.\n\n This is necessary because `__init_subclass__` will always be called by `type.__new__`,\n and it would require a prohibitively large refactor to the `ModelMetaclass` to ensure that\n `type.__new__` was called in such a manner that the class would already be sufficiently initialized.\n\n This will receive the same `kwargs` that would be passed to the standard `__init_subclass__`, namely,\n any kwargs passed to the class definition that aren't used internally by pydantic.\n\n Args:\n **kwargs: Any keyword arguments passed to the class definition that aren't used internally\n by pydantic.\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/main.py_BaseModel.model_copy_BaseModel.model_copy.return.copied": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.model_copy_BaseModel.model_copy.return.copied", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 279, "span_ids": ["BaseModel.model_copy"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def model_copy(self: Model, *, update: dict[str, Any] | None = None, deep: bool = False) -> Model:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/serialization/#model_copy\n\n Returns a copy of the model.\n\n Args:\n update: Values to change/add in the new model. Note: the data is not validated\n before creating the new model. You should trust this data.\n deep: Set to `True` to make a deep copy of the model.\n\n Returns:\n New model instance.\n \"\"\"\n copied = self.__deepcopy__() if deep else self.__copy__()\n if update:\n if self.model_config.get('extra') == 'allow':\n for k, v in update.items():\n if k in self.model_fields:\n copied.__dict__[k] = v\n else:\n if copied.__pydantic_extra__ is None:\n copied.__pydantic_extra__ = {}\n copied.__pydantic_extra__[k] = v\n else:\n copied.__dict__.update(update)\n copied.__pydantic_fields_set__.update(update.keys())\n return copied", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.m": {"__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.m", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 633, "end_line": 650, "span_ids": ["BaseModel.__copy__"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def __copy__(self: Model) -> Model:\n \"\"\"Returns a shallow copy of the model.\"\"\"\n cls = type(self)\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', copy(self.__dict__))\n _object_setattr(m, '__pydantic_extra__', copy(self.__pydantic_extra__))\n _object_setattr(m, '__pydantic_fields_set__', copy(self.__pydantic_fields_set__))\n\n if self.__pydantic_private__ is None:\n _object_setattr(m, '__pydantic_private__', None)\n else:\n _object_setattr(\n m,\n '__pydantic_private__',\n {k: v for k, v in self.__pydantic_private__.items() if v is not PydanticUndefined},\n )\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/parse.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/parse.py__", "embedding": null, "metadata": {"file_path": "pydantic/parse.py", "file_name": "parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `parse` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/schema.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/schema.py__", "embedding": null, "metadata": {"file_path": "pydantic/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `schema` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/tools.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/tools.py__", "embedding": null, "metadata": {"file_path": "pydantic/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `tools` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/typing.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/typing.py__", "embedding": null, "metadata": {"file_path": "pydantic/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 30}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/utils.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/utils.py__", "embedding": null, "metadata": {"file_path": "pydantic/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `utils` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/validators.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validators.py__", "embedding": null, "metadata": {"file_path": "pydantic/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The `validators` module is a backport module from V1.\"\"\"\nfrom ._migration import getattr_migration\n\n__getattr__ = getattr_migration(__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/tests/mypy/modules/computed_fields.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/computed_fields.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/computed_fields.py", "file_name": "computed_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["Square.area", "impl", "imports", "Square", "Square.area_1"], "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": "from pydantic import BaseModel, computed_field\n\n\nclass Square(BaseModel):\n side: float\n\n @computed_field\n @property\n def area(self) -> float:\n return self.side**2\n\n @area.setter\n def area(self, area: float) -> None:\n self.side = area**0.5\n\n\nsq = Square(side=10)\ny = 12.4 + sq.area\nz = 'x' + sq.area\n\ntry:\n from functools import cached_property\nexcept ImportError:\n pass\nelse:\n\n class Square2(BaseModel):\n side: float\n\n @computed_field\n @cached_property\n def area(self) -> float:\n return self.side**2\n\n sq = Square(side=10)\n y = 12.4 + sq.area\n z = 'x' + sq.area", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_field_info_repr_with_aliases.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_field_info_repr_with_aliases.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": 28, "end_line": 59, "span_ids": ["test_alias_generator_wrong_type_error", "test_field_info_repr_with_aliases", "test_basic_alias"], "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_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 )\n\n\ndef test_field_info_repr_with_aliases():\n class Model(BaseModel):\n a: str = Field('foobar', alias='_a', validation_alias='a_val', serialization_alias='a_ser')\n\n assert repr(Model.model_fields['a']) == (\n \"FieldInfo(annotation=str, required=False, default='foobar', alias='_a', \"\n \"alias_priority=2, validation_alias='a_val', serialization_alias='a_ser')\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_low_priority_alias_test_low_priority_alias.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_low_priority_alias_test_low_priority_alias.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": 300, "end_line": 320, "span_ids": ["test_low_priority_alias"], "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": "@pytest.mark.parametrize('alias_generator', upper_alias_generator)\ndef test_low_priority_alias(alias_generator):\n class Parent(BaseModel):\n w: bool = Field(..., alias='w_', validation_alias='w_val_alias', serialization_alias='w_ser_alias')\n x: bool = Field(\n ..., alias='abc', alias_priority=1, validation_alias='x_val_alias', serialization_alias='x_ser_alias'\n )\n y: str\n\n class Child(Parent):\n model_config = ConfigDict(alias_generator=alias_generator)\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.validation_alias for f in Parent.model_fields.values()] == ['w_val_alias', 'x_val_alias', None]\n assert [f.serialization_alias for f in Parent.model_fields.values()] == ['w_ser_alias', 'x_ser_alias', None]\n assert [f.alias for f in Child.model_fields.values()] == ['w_', 'X', 'Y', 'Z']\n assert [f.validation_alias for f in Child.model_fields.values()] == ['w_val_alias', 'X', 'Y', 'Z']\n assert [f.serialization_alias for f in Child.model_fields.values()] == ['w_ser_alias', '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_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_aliases.py_test_empty_string_alias_test_populate_by_name_config.with_expectation_.assert_f_bar__expected", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 244, "end_line": 285, "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_aliases.py_test_validation_alias_test_validation_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_aliases.py_test_validation_alias_test_validation_alias.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": 288, "end_line": 305, "span_ids": ["test_validation_alias"], "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_validation_alias():\n class Model(BaseModel):\n x: str = Field(validation_alias='foo')\n\n data = {'foo': 'bar'}\n m = Model(**data)\n assert m.x == 'bar'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x='bar')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing',\n 'loc': ('foo',),\n 'msg': 'Field required',\n 'input': {'x': '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_aliases.py_test_validation_alias_with_alias_test_validation_alias_with_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_aliases.py_test_validation_alias_with_alias_test_validation_alias_with_alias.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": 308, "end_line": 327, "span_ids": ["test_validation_alias_with_alias"], "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_alias_with_alias():\n class Model(BaseModel):\n x: str = Field(alias='x_alias', validation_alias='foo')\n\n data = {'foo': 'bar'}\n m = Model(**data)\n assert m.x == 'bar'\n sig = signature(Model)\n assert 'x_alias' in sig.parameters\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x='bar')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing',\n 'loc': ('foo',),\n 'msg': 'Field required',\n 'input': {'x': '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_aliases.py_test_validation_alias_from_str_alias_test_validation_alias_from_str_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_aliases.py_test_validation_alias_from_str_alias_test_validation_alias_from_str_alias.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": 330, "end_line": 349, "span_ids": ["test_validation_alias_from_str_alias"], "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_validation_alias_from_str_alias():\n class Model(BaseModel):\n x: str = Field(alias='foo')\n\n data = {'foo': 'bar'}\n m = Model(**data)\n assert m.x == 'bar'\n sig = signature(Model)\n assert 'foo' in sig.parameters\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x='bar')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing',\n 'loc': ('foo',),\n 'msg': 'Field required',\n 'input': {'x': '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_aliases.py_test_validation_alias_from_list_alias_test_validation_alias_from_list_alias.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_from_list_alias_test_validation_alias_from_list_alias.None_3", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 352, "end_line": 369, "span_ids": ["test_validation_alias_from_list_alias"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_validation_alias_from_list_alias():\n class Model(BaseModel):\n x: str = Field(alias=['foo', 'bar'])\n\n data = {'foo': {'bar': 'test'}}\n m = Model(**data)\n assert m.x == 'test'\n sig = signature(Model)\n assert 'x' in sig.parameters\n\n class Model(BaseModel):\n x: str = Field(alias=['foo', 1])\n\n data = {'foo': ['bar0', 'bar1']}\n m = Model(**data)\n assert m.x == 'bar1'\n sig = signature(Model)\n assert 'x' in sig.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_aliases.py_test_validation_alias_path_test_validation_alias_invalid_value_type.with_pytest_raises_TypeEr.Model.x.Field_validation_alias_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_validation_alias_path_test_validation_alias_invalid_value_type.with_pytest_raises_TypeEr.Model.x.Field_validation_alias_12", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 490, "end_line": 511, "span_ids": ["test_validation_alias_invalid_value_type", "test_validation_alias_path"], "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.parametrize(\n 'value',\n [\n 'a',\n AliasPath('a', 'b', 1),\n AliasChoices('a', 'b'),\n AliasChoices('a', AliasPath('b', 1)),\n ],\n)\ndef test_validation_alias_path(value):\n class Model(BaseModel):\n x: str = Field(validation_alias=value)\n\n assert Model.model_fields['x'].validation_alias == value\n\n\ndef test_validation_alias_invalid_value_type():\n m = 'Invalid `validation_alias` type. it should be `str`, `AliasChoices`, or `AliasPath`'\n with pytest.raises(TypeError, match=m):\n\n class Model(BaseModel):\n x: str = Field(validation_alias=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_annotated.py_test_annotated_alias_test_annotated_alias.assert_MyModel_b_def_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_alias_test_annotated_alias.assert_MyModel_b_def_e", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 151, "end_line": 175, "span_ids": ["test_annotated_alias"], "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": "@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': \"FieldInfo(annotation=List[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=3)])]], required=True, description='foo')\",\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_annotated.py_test_modify_get_schema_annotated_test_modify_get_schema_annotated.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_modify_get_schema_annotated_test_modify_get_schema_annotated.None_1", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 204, "end_line": 257, "span_ids": ["test_modify_get_schema_annotated"], "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": "def test_modify_get_schema_annotated() -> None:\n calls: List[str] = []\n\n class CustomType:\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n calls.append('CustomType:before')\n with pytest.raises(PydanticSchemaGenerationError):\n handler(source)\n schema = core_schema.no_info_plain_validator_function(lambda _: CustomType())\n calls.append('CustomType:after')\n return schema\n\n class PydanticMetadata:\n def __get_pydantic_core_schema__(self, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n calls.append('PydanticMetadata:before')\n schema = handler(source)\n calls.append('PydanticMetadata:after')\n return schema\n\n class GroupedMetadataMarker(GroupedMetadata):\n def __iter__(self) -> Iterator[BaseMetadata]:\n # no way to actually hook into schema building\n # so just register when our iter is called\n calls.append('GroupedMetadataMarker:iter')\n yield from []\n\n class _(BaseModel):\n x: Annotated[CustomType, GroupedMetadataMarker(), PydanticMetadata()]\n\n # insert_assert(calls)\n assert calls == [\n 'GroupedMetadataMarker:iter',\n 'PydanticMetadata:before',\n 'CustomType:before',\n 'CustomType:after',\n 'PydanticMetadata:after',\n ]\n\n calls.clear()\n\n class _(BaseModel):\n x: Annotated[CustomType, PydanticMetadata(), GroupedMetadataMarker()]\n\n # insert_assert(calls)\n assert calls == [\n 'GroupedMetadataMarker:iter',\n 'PydanticMetadata:before',\n 'CustomType:before',\n 'CustomType:after',\n 'PydanticMetadata:after',\n ]\n\n calls.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_set_test_computed_fields_set.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_set_test_computed_fields_set.None_1", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 114, "end_line": 139, "span_ids": ["test_computed_fields_set"], "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_computed_fields_set():\n class Square(BaseModel):\n side: float\n\n @computed_field\n @property\n def area(self) -> float:\n return self.side**2\n\n @computed_field\n @property\n def area_string(self) -> str:\n return f'{self.area} square units'\n\n @field_serializer('area_string')\n def serialize_area_string(self, area_string):\n return area_string.upper()\n\n @area.setter\n def area(self, new_area: int):\n self.side = new_area**0.5\n\n s = Square(side=10)\n assert s.model_dump() == {'side': 10.0, 'area': 100.0, 'area_string': '100.0 SQUARE UNITS'}\n s.area = 64\n assert s.model_dump() == {'side': 8.0, 'area': 64.0, 'area_string': '64.0 SQUARE UNITS'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_del_test_computed_fields_del.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_del_test_computed_fields_del.None_3", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 146, "span_ids": ["test_computed_fields_del"], "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_computed_fields_del():\n class User(BaseModel):\n first: str\n last: str\n\n @computed_field\n def fullname(self) -> str:\n return f'{self.first} {self.last}'\n\n @fullname.setter\n def fullname(self, new_fullname: str) -> None:\n self.first, self.last = new_fullname.split()\n\n @fullname.deleter\n def fullname(self):\n self.first = ''\n self.last = ''\n\n user = User(first='John', last='Smith')\n assert user.model_dump() == {'first': 'John', 'last': 'Smith', 'fullname': 'John Smith'}\n user.fullname = 'Pika Chu'\n assert user.model_dump() == {'first': 'Pika', 'last': 'Chu', 'fullname': 'Pika Chu'}\n del user.fullname\n assert user.model_dump() == {'first': '', 'last': '', 'fullname': ' '}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_cached_property_test_cached_property.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_cached_property_test_cached_property.None_6", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 149, "end_line": 178, "span_ids": ["test_cached_property"], "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": "@pytest.mark.skipif(cached_property is None, reason='cached_property not available')\ndef test_cached_property():\n class Model(BaseModel):\n minimum: int = Field(alias='min')\n maximum: int = Field(alias='max')\n\n @computed_field(alias='the magic number')\n @cached_property\n def random_number(self) -> int:\n \"\"\"An awesome area\"\"\"\n return random.randint(self.minimum, self.maximum)\n\n @cached_property\n def cached_property_2(self) -> int:\n return 42\n\n @cached_property\n def _cached_property_3(self) -> int:\n return 43\n\n rect = Model(min=10, max=10_000)\n assert rect.__private_attributes__ == {}\n assert rect.cached_property_2 == 42\n assert rect._cached_property_3 == 43\n first_n = rect.random_number\n second_n = rect.random_number\n assert first_n == second_n\n assert rect.model_dump() == {'minimum': 10, 'maximum': 10_000, 'random_number': first_n}\n assert rect.model_dump(by_alias=True) == {'min': 10, 'max': 10_000, 'the magic number': first_n}\n assert rect.model_dump(by_alias=True, exclude={'random_number'}) == {'min': 10, 'max': 10000}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_properties_and_computed_fields_test_properties_and_computed_fields.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_properties_and_computed_fields_test_properties_and_computed_fields.None_3", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 181, "end_line": 205, "span_ids": ["test_properties_and_computed_fields"], "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_properties_and_computed_fields():\n class Model(BaseModel):\n x: str\n _private_float: float = PrivateAttr(0)\n\n @property\n def public_int(self) -> int:\n return int(self._private_float)\n\n @public_int.setter\n def public_int(self, v: float) -> None:\n self._private_float = v\n\n @computed_field\n @property\n def public_str(self) -> str:\n return f'public {self.public_int}'\n\n m = Model(x='pika')\n assert m.model_dump() == {'x': 'pika', 'public_str': 'public 0'}\n m._private_float = 3.1\n assert m.model_dump() == {'x': 'pika', 'public_str': 'public 3'}\n m.public_int = 2\n assert m._private_float == 2.0\n assert m.model_dump() == {'x': 'pika', 'public_str': 'public 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_computed_fields.py_test_computed_fields_repr_test_functools.assert_m_neg_True_is_Fal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_repr_test_functools.assert_m_neg_True_is_Fal", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 208, "end_line": 250, "span_ids": ["test_functools", "test_computed_fields_repr"], "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_computed_fields_repr():\n class Model(BaseModel):\n x: int\n\n @computed_field(repr=False)\n @property\n def double(self) -> int:\n return self.x * 2\n\n @computed_field # repr=True by default\n @property\n def triple(self) -> int:\n return self.x * 3\n\n assert repr(Model(x=2)) == 'Model(x=2, triple=6)'\n\n\n@pytest.mark.skipif(singledispatchmethod is None, reason='singledispatchmethod not available')\ndef test_functools():\n class Model(BaseModel, frozen=True):\n x: int\n\n @lru_cache\n def x_pow(self, p):\n return self.x**p\n\n @singledispatchmethod\n def neg(self, arg):\n raise NotImplementedError('Cannot negate a')\n\n @neg.register\n def _(self, arg: int):\n return -arg\n\n @neg.register\n def _(self, arg: bool):\n return not arg\n\n m = Model(x=2)\n assert m.x_pow(1) == 2\n assert m.x_pow(2) == 4\n assert m.neg(1) == -1\n assert m.neg(True) 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_computed_fields.py_test_include_exclude_test_include_exclude.assert_m_model_dump_exclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_include_exclude_test_include_exclude.assert_m_model_dump_exclu", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 261, "end_line": 278, "span_ids": ["test_include_exclude"], "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_include_exclude():\n class Model(BaseModel):\n x: int\n y: int\n\n @computed_field\n def x_list(self) -> List[int]:\n return [self.x, self.x + 1]\n\n @computed_field\n def y_list(self) -> List[int]:\n return [self.y, self.y + 1, self.y + 2]\n\n m = Model(x=1, y=2)\n assert m.model_dump() == {'x': 1, 'y': 2, 'x_list': [1, 2], 'y_list': [2, 3, 4]}\n assert m.model_dump(include={'x'}) == {'x': 1}\n assert m.model_dump(include={'x': None, 'x_list': {0}}) == {'x': 1, 'x_list': [1]}\n assert m.model_dump(exclude={'x': ..., 'y_list': {2}}) == {'y': 2, 'x_list': [1, 2], 'y_list': [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_computed_fields.py_test_expected_type_test_expected_type.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_expected_type_test_expected_type.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 281, "end_line": 298, "span_ids": ["test_expected_type"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_expected_type():\n class Model(BaseModel):\n x: int\n y: int\n\n @computed_field\n def x_list(self) -> List[int]:\n return [self.x, self.x + 1]\n\n @computed_field\n def y_str(self) -> bytes:\n s = f'y={self.y}'\n return s.encode()\n\n m = Model(x=1, y=2)\n assert m.model_dump() == {'x': 1, 'y': 2, 'x_list': [1, 2], 'y_str': b'y=2'}\n assert m.model_dump(mode='json') == {'x': 1, 'y': 2, 'x_list': [1, 2], 'y_str': 'y=2'}\n assert m.model_dump_json() == '{\"x\":1,\"y\":2,\"x_list\":[1,2],\"y_str\":\"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_computed_fields.py_test_inheritance_test_inheritance.assert_c_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_inheritance_test_inheritance.assert_c_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 310, "end_line": 328, "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 class Base(BaseModel):\n x: int\n\n @computed_field\n def double(self) -> int:\n return self.x * 2\n\n class Child(Base):\n y: int\n\n @computed_field\n def triple(self) -> int:\n return self.y * 3\n\n c = Child(x=2, y=3)\n assert c.double == 4\n assert c.triple == 9\n assert c.model_dump() == {'x': 2, 'y': 3, 'double': 4, 'triple': 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_computed_fields.py_test_dataclass_test_free_function.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_dataclass_test_free_function.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 339, "end_line": 367, "span_ids": ["test_free_function", "test_dataclass"], "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_dataclass():\n @dataclasses.dataclass\n class MyDataClass:\n x: int\n\n @computed_field\n def double(self) -> int:\n return self.x * 2\n\n m = MyDataClass(x=2)\n assert m.double == 4\n assert TypeAdapter(MyDataClass).dump_python(m) == {'x': 2, 'double': 4}\n\n\ndef test_free_function():\n @property\n def double_func(self) -> int:\n return self.x * 2\n\n class MyModel(BaseModel):\n x: int\n double = computed_field(double_func)\n\n m = MyModel(x=2)\n assert set(m.model_fields) == {'x'}\n assert m.__private_attributes__ == {}\n assert m.double == 4\n assert repr(m) == 'MyModel(x=2, double=4)'\n assert m.model_dump() == {'x': 2, 'double': 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_computed_fields.py_test_private_computed_field_test_classmethod.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_private_computed_field_test_classmethod.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 401, "end_line": 430, "span_ids": ["test_private_computed_field", "test_classmethod"], "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_private_computed_field():\n class MyModel(BaseModel):\n x: int\n\n @computed_field(repr=True)\n def _double(self) -> int:\n return self.x * 2\n\n m = MyModel(x=2)\n assert repr(m) == 'MyModel(x=2, _double=4)'\n assert m.__private_attributes__ == {}\n assert m._double == 4\n assert m.model_dump() == {'x': 2, '_double': 4}\n\n\n@pytest.mark.skipif(sys.version_info < (3, 9), reason='@computed_field @classmethod @property only works in 3.9+')\ndef test_classmethod():\n class MyModel(BaseModel):\n x: int\n y: ClassVar[int] = 4\n\n @computed_field\n @classmethod\n @property\n def two_y(cls) -> int:\n return cls.y * 2\n\n m = MyModel(x=1)\n assert m.two_y == 8\n assert m.model_dump() == {'x': 1, 'two_y': 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_computed_fields.py_test_validate_assignment_test_validate_assignment.None_1.m.area.3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_validate_assignment_test_validate_assignment.None_1.m.area.3", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 415, "end_line": 444, "span_ids": ["test_validate_assignment"], "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_assignment():\n class Square(BaseModel, validate_assignment=True):\n side: float\n\n @field_validator('side')\n def small_side(cls, s):\n if s < 2:\n raise ValueError('must be >=2')\n return float(round(s))\n\n @computed_field\n @property\n def area(self) -> float:\n return self.side**2\n\n @area.setter\n def area(self, new_area: int):\n self.side = new_area**0.5\n\n with pytest.raises(ValidationError, match=r'side\\s+Value error, must be >=2'):\n Square(side=1)\n\n m = Square(side=4.0)\n assert m.area == 16.0\n assert m.model_dump() == {'side': 4.0, 'area': 16.0}\n m.area = 10.0\n assert m.side == 3.0\n\n with pytest.raises(ValidationError, match=r'side\\s+Value error, must be >=2'):\n m.area = 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_config.py_TestsBaseConfig_TestsBaseConfig.test_base_config_properly_converted_to_dict.assert_str_to_lower_not": {"__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.assert_str_to_lower_not", "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": 99, "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": 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 TestsBaseConfig:\n @pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\n def test_base_config_equality_defaults_of_config_dict_class(self):\n for key, value in config_defaults.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 @pytest.mark.filterwarnings('ignore:.* is deprecated.*:DeprecationWarning')\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 MyModel.model_config['title'] = 'MyTitle'\n MyModel.model_config['frozen'] = True\n assert 'str_to_lower' not in MyModel.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_config.py_test_invalid_extra_test_invalid_config_keys.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_invalid_extra_test_invalid_config_keys.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": 459, "end_line": 484, "span_ids": ["test_invalid_config_keys", "test_invalid_extra"], "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_invalid_extra():\n extra_error = re.escape(\n \"Input should be 'allow', 'forbid' or 'ignore'\"\n \" [type=literal_error, input_value='invalid-value', input_type=str]\"\n )\n config_dict = {'extra': 'invalid-value'}\n\n with pytest.raises(SchemaError, match=extra_error):\n\n class MyModel(BaseModel):\n model_config = config_dict\n\n with pytest.raises(SchemaError, match=extra_error):\n create_model('MyCreatedModel', __config__=config_dict)\n\n with pytest.raises(SchemaError, match=extra_error):\n\n @pydantic_dataclass(config=config_dict)\n class MyDataclass:\n pass\n\n\ndef test_invalid_config_keys():\n @validate_call(config={'alias_generator': lambda x: x})\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_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_config.py_test_multiple_inheritance_config_test_multiple_inheritance_config.None_15", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 492, "end_line": 520, "span_ids": ["test_multiple_inheritance_config"], "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_multiple_inheritance_config():\n class Parent(BaseModel):\n model_config = ConfigDict(frozen=True, 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.get('frozen') is None\n assert BaseModel.model_config.get('populate_by_name') is None\n assert BaseModel.model_config.get('extra') is None\n assert BaseModel.model_config.get('use_enum_values') is None\n\n assert Parent.model_config.get('frozen') is True\n assert Parent.model_config.get('populate_by_name') is None\n assert Parent.model_config.get('extra') == 'forbid'\n assert Parent.model_config.get('use_enum_values') is None\n\n assert Mixin.model_config.get('frozen') is None\n assert Mixin.model_config.get('populate_by_name') is None\n assert Mixin.model_config.get('extra') is None\n assert Mixin.model_config.get('use_enum_values') is True\n\n assert Child.model_config.get('frozen') is True\n assert Child.model_config.get('populate_by_name') is True\n assert Child.model_config.get('extra') == 'forbid'\n assert Child.model_config.get('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_dataclasses.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_dataclasses.py_test_hashable_required_test_hashable_required.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": 696, "end_line": 713, "span_ids": ["test_hashable_required"], "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_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(include_url=False) == [\n {'input': [], 'loc': ('v',), 'msg': 'Input should be hashable', 'type': 'is_hashable'}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n # Should this raise a TypeError instead? https://github.com/pydantic/pydantic/issues/5487\n MyDataclass()\n assert exc_info.value.errors(include_url=False) == [\n {'input': HasRepr('ArgsKwargs(())'), 'loc': ('v',), '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_dataclasses.py_lazy_cases_for_dataclass_equality_checks_lazy_cases_for_dataclass_equality_checks.return._case_i_for_i_in_range_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_lazy_cases_for_dataclass_equality_checks_lazy_cases_for_dataclass_equality_checks.return._case_i_for_i_in_range_4", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 984, "end_line": 1045, "span_ids": ["lazy_cases_for_dataclass_equality_checks"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lazy_cases_for_dataclass_equality_checks():\n \"\"\"\n The reason for the convoluted structure of this function is to avoid\n creating the classes while collecting tests, which may trigger breakpoints\n etc. while working on one specific test.\n \"\"\"\n cases = []\n\n def get_cases():\n if cases:\n return cases # cases already \"built\"\n\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 cases.append((foo, StdLibBar(c=foo)))\n\n foo = PydanticFoo(a='Foo', b=1)\n cases.append((foo, PydanticBar(c=foo)))\n\n foo = PydanticFoo(a='Foo', b=1)\n cases.append((foo, StdLibBaz(c=foo)))\n\n foo = StdLibFoo(a='Foo', b=1)\n cases.append((foo, PydanticBaz(c=foo)))\n\n return cases\n\n case_ids = ['stdlib_stdlib', 'pydantic_pydantic', 'pydantic_stdlib', 'stdlib_pydantic']\n\n def case(i):\n def get_foo_bar():\n return get_cases()[i]\n\n get_foo_bar.__name__ = case_ids[i] # get nice names in pytest output\n return get_foo_bar\n\n return [case(i) for i in range(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_dataclass_equality_for_field_values_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_dataclass_equality_for_field_values_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": 1048, "end_line": 1108, "span_ids": ["test_issue_2383", "test_dataclass_equality_for_field_values", "test_issue_2424", "test_issue_2398"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize('foo_bar_getter', lazy_cases_for_dataclass_equality_checks())\ndef test_dataclass_equality_for_field_values(foo_bar_getter):\n # Related to issue #2162\n foo, bar = foo_bar_getter()\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_allow_extra_subclass_test_forbid_extra.with_pytest_raises_Valida.Foo_x_1_y_2_": {"__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_forbid_extra.with_pytest_raises_Valida.Foo_x_1_y_2_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1389, "end_line": 1410, "span_ids": ["test_allow_extra_subclass", "test_forbid_extra"], "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_allow_extra_subclass():\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra='allow'))\n class Foo:\n x: int\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(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'}\n\n\ndef test_forbid_extra():\n @pydantic.dataclasses.dataclass(config=ConfigDict(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'})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_self_reference_dataclass_test_self_reference_dataclass.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_self_reference_dataclass_test_self_reference_dataclass.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": 1488, "end_line": 1512, "span_ids": ["test_self_reference_dataclass"], "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_self_reference_dataclass():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n self_reference: Optional['MyDataclass'] = None\n\n assert MyDataclass.__pydantic_fields__['self_reference'].annotation == Optional[MyDataclass]\n\n instance = MyDataclass(self_reference=MyDataclass(self_reference=MyDataclass()))\n assert TypeAdapter(MyDataclass).dump_python(instance) == {\n 'self_reference': {'self_reference': {'self_reference': None}}\n }\n\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(self_reference=1)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'dataclass_type',\n 'loc': ('self_reference',),\n 'msg': 'Input should be a dictionary or an instance of MyDataclass',\n 'input': 1,\n 'ctx': {'class_name': 'MyDataclass'},\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_dataclass_config_validate_default_test_dataclass_config_validate_default.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_dataclass_config_validate_default_test_dataclass_config_validate_default.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": 1985, "end_line": 2012, "span_ids": ["test_dataclass_config_validate_default"], "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_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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('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_dataclasses.py_test_unparametrized_generic_dataclass_test_unparametrized_generic_dataclass.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_unparametrized_generic_dataclass_test_unparametrized_generic_dataclass.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": 1770, "end_line": 1789, "span_ids": ["test_unparametrized_generic_dataclass"], "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('dataclass_decorator', **dataclass_decorators())\ndef test_unparametrized_generic_dataclass(dataclass_decorator):\n T = TypeVar('T')\n\n @dataclass_decorator\n class GenericDataclass(Generic[T]):\n x: T\n\n # In principle we could call GenericDataclass(...) below, but this won't do validation\n # for standard dataclasses, so we just use TypeAdapter to get validation for each.\n validator = pydantic.TypeAdapter(GenericDataclass)\n\n assert validator.validate_python({'x': None}).x is None\n assert validator.validate_python({'x': 1}).x == 1\n\n with pytest.raises(ValidationError) as exc_info:\n validator.validate_python({'y': None})\n assert exc_info.value.errors(include_url=False) == [\n {'input': {'y': None}, 'loc': ('x',), '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_dataclasses.py_test_parametrized_generic_dataclass_test_parametrized_generic_dataclass.if_not_error_.else_.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_parametrized_generic_dataclass_test_parametrized_generic_dataclass.if_not_error_.else_.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": 1792, "end_line": 1829, "span_ids": ["test_parametrized_generic_dataclass"], "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('dataclass_decorator', **dataclass_decorators())\n@pytest.mark.parametrize(\n 'annotation,input_value,error,output_value',\n [\n (int, 1, False, 1),\n (str, 'a', False, 'a'),\n (\n int,\n 'a',\n True,\n [\n {\n 'input': 'a',\n 'loc': ('x',),\n 'msg': 'Input should be a valid integer, unable to parse string as an ' 'integer',\n 'type': 'int_parsing',\n }\n ],\n ),\n ],\n)\ndef test_parametrized_generic_dataclass(dataclass_decorator, annotation, input_value, error, output_value):\n T = TypeVar('T')\n\n @dataclass_decorator\n class GenericDataclass(Generic[T]):\n x: T\n\n # Need to use TypeAdapter here because GenericDataclass[annotation] will be a GenericAlias, which delegates\n # method calls to the (non-parametrized) origin class. This is essentially a limitation of typing._GenericAlias.\n validator = pydantic.TypeAdapter(GenericDataclass[annotation])\n\n if not error:\n assert validator.validate_python({'x': input_value}).x == output_value\n else:\n with pytest.raises(ValidationError) as exc_info:\n validator.validate_python({'x': input_value})\n assert exc_info.value.errors(include_url=False) == 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_dataclasses.py_test_pydantic_dataclass_preserves_metadata_test_pydantic_dataclass_preserves_metadata.assert_FooPydantic___qual": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_dataclass_preserves_metadata_test_pydantic_dataclass_preserves_metadata.assert_FooPydantic___qual", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2056, "end_line": 2066, "span_ids": ["test_pydantic_dataclass_preserves_metadata"], "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": "@pytest.mark.parametrize('dataclass_decorator', **dataclass_decorators(include_identity=True))\ndef test_pydantic_dataclass_preserves_metadata(dataclass_decorator: Callable[[Any], Any]) -> None:\n @dataclass_decorator\n class FooStd:\n \"\"\"Docstring\"\"\"\n\n FooPydantic = pydantic.dataclasses.dataclass(FooStd)\n\n assert FooPydantic.__module__ == FooStd.__module__\n assert FooPydantic.__name__ == FooStd.__name__\n assert FooPydantic.__qualname__ == FooStd.__qualname__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_date_model_fixture.return.DateModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_re_date_model_fixture.return.DateModel", "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": 62, "span_ids": ["aware_datetime_type", "imports", "future_date_type", "date_model_fixture", "create_tz", "future_datetime_type", "past_date_type", "naive_datetime_type", "past_datetime_type"], "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": "import re\nfrom datetime import date, datetime, time, timedelta, timezone\n\nimport pytest\nfrom dirty_equals import HasRepr\nfrom typing_extensions import Annotated\n\nfrom pydantic import (\n AwareDatetime,\n BaseModel,\n FutureDate,\n FutureDatetime,\n NaiveDatetime,\n PastDate,\n PastDatetime,\n ValidationError,\n condate,\n)\n\nfrom .conftest import Err\n\n\ndef create_tz(minutes):\n return timezone(timedelta(minutes=minutes))\n\n\n@pytest.fixture(scope='module', params=[FutureDate, Annotated[date, FutureDate()]])\ndef future_date_type(request):\n return request.param\n\n\n@pytest.fixture(scope='module', params=[PastDate, Annotated[date, PastDate()]])\ndef past_date_type(request):\n return request.param\n\n\n@pytest.fixture(scope='module', params=[FutureDatetime, Annotated[datetime, FutureDatetime()]])\ndef future_datetime_type(request):\n return request.param\n\n\n@pytest.fixture(scope='module', params=[PastDatetime, Annotated[datetime, PastDatetime()]])\ndef past_datetime_type(request):\n return request.param\n\n\n@pytest.fixture(scope='module', params=[AwareDatetime, Annotated[datetime, AwareDatetime()]])\ndef aware_datetime_type(request):\n return request.param\n\n\n@pytest.fixture(scope='module', params=[NaiveDatetime, Annotated[datetime, NaiveDatetime()]])\ndef naive_datetime_type(request):\n return request.param\n\n\n@pytest.fixture(scope='module', name='DateModel')\ndef date_model_fixture():\n class DateModel(BaseModel):\n d: date\n\n return DateModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_allow_from_orm.assert_not_hasattr_model_": {"__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_allow_from_orm.assert_not_hasattr_model_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 221, "end_line": 251, "span_ids": ["test_properties", "test_extra_allow_from_orm"], "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_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.parametrize('extra', ['ignore', 'forbid', 'allow'])\ndef test_extra_allow_from_orm(extra: Literal['ignore', 'forbid', 'allow']):\n class TestCls:\n x = 1\n y = 2\n\n class Model(BaseModel):\n model_config = ConfigDict(from_attributes=True, extra=extra)\n x: int\n\n model = deprecated_from_orm(Model, TestCls())\n assert model.x == 1\n assert not hasattr(model, '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_deprecated.py_test_parse_raw_pass_fail_test_parse_raw_pass_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_deprecated.py_test_parse_raw_pass_fail_test_parse_raw_pass_fail.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 305, "span_ids": ["test_parse_raw_pass_fail"], "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(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(PydanticDeprecatedSince20, 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_deprecated.py_test_field_min_items_deprecation_test_field_min_items_deprecation.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_min_items_deprecation_test_field_min_items_deprecation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 347, "end_line": 364, "span_ids": ["test_field_min_items_deprecation"], "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_field_min_items_deprecation():\n m = '`min_items` is deprecated and will be removed. use `min_length` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: List[int] = Field(None, min_items=1)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=[])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_short',\n 'loc': ('x',),\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_deprecated.py_test_field_min_items_with_min_length_test_field_min_items_with_min_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_deprecated.py_test_field_min_items_with_min_length_test_field_min_items_with_min_length.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 367, "end_line": 384, "span_ids": ["test_field_min_items_with_min_length"], "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_field_min_items_with_min_length():\n m = '`min_items` is deprecated and will be removed. use `min_length` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: List[int] = Field(None, min_items=1, min_length=2)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=[1])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_short',\n 'loc': ('x',),\n 'msg': 'List should have at least 2 items after validation, not 1',\n 'input': [1],\n 'ctx': {'field_type': 'List', 'min_length': 2, 'actual_length': 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_deprecated.py_test_field_max_items_test_field_max_items.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_max_items_test_field_max_items.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 387, "end_line": 404, "span_ids": ["test_field_max_items"], "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_field_max_items():\n m = '`max_items` is deprecated and will be removed. use `max_length` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: List[int] = Field(None, max_items=1)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=[1, 2])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': ('x',),\n 'msg': 'List should have at most 1 item after validation, not 2',\n 'input': [1, 2],\n 'ctx': {'field_type': 'List', 'max_length': 1, 'actual_length': 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_deprecated.py_test_field_max_items_with_max_length_test_field_max_items_with_max_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_deprecated.py_test_field_max_items_with_max_length_test_field_max_items_with_max_length.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 407, "end_line": 424, "span_ids": ["test_field_max_items_with_max_length"], "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_field_max_items_with_max_length():\n m = '`max_items` is deprecated and will be removed. use `max_length` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: List[int] = Field(None, max_items=1, max_length=2)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=[1, 2, 3])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': ('x',),\n 'msg': 'List should have at most 2 items after validation, not 3',\n 'input': [1, 2, 3],\n 'ctx': {'field_type': 'List', 'max_length': 2, 'actual_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_deprecated.py_test_parse_obj_test_copy_and_set_values.assert_m2_x_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_parse_obj_test_copy_and_set_values.assert_m2_x_2", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 637, "end_line": 698, "span_ids": ["test_copy_and_set_values", "test_validate", "test_parse_obj", "test_construct", "test_parse_file", "test_json_schema", "test_update_forward_refs"], "tokens": 491}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_parse_obj():\n with pytest.warns(\n PydanticDeprecatedSince20, match='^The `parse_obj` method is deprecated; use `model_validate` instead.'\n ):\n m = SimpleModel.parse_obj({'x': 1})\n\n assert m.model_dump() == {'x': 1}\n\n\ndef test_parse_file(tmp_path):\n path = tmp_path / 'test.json'\n path.write_text('{\"x\": 12}')\n with pytest.warns(\n PydanticDeprecatedSince20, match='^The `parse_file` method is deprecated; load the data from file,'\n ):\n assert SimpleModel.parse_file(str(path)).model_dump() == {'x': 12}\n\n\ndef test_construct():\n with pytest.warns(\n PydanticDeprecatedSince20, match='The `construct` method is deprecated; use `model_construct` instead.'\n ):\n m = SimpleModel.construct(x='not an int')\n\n assert m.x == 'not an int'\n\n\ndef test_json_schema():\n m = SimpleModel(x=1)\n with pytest.warns(\n PydanticDeprecatedSince20, match='^The `schema` method is deprecated; use `model_json_schema` instead.'\n ):\n assert m.schema() == {\n 'title': 'SimpleModel',\n 'type': 'object',\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n }\n\n\ndef test_validate():\n with pytest.warns(\n PydanticDeprecatedSince20, match='^The `validate` method is deprecated; use `model_validate` instead.'\n ):\n m = SimpleModel.validate({'x': 1})\n\n assert m.model_dump() == {'x': 1}\n\n\ndef test_update_forward_refs():\n with pytest.warns(PydanticDeprecatedSince20, match='^The `update_forward_refs` method is deprecated;'):\n SimpleModel.update_forward_refs()\n\n\ndef test_copy_and_set_values():\n m = SimpleModel(x=1)\n with pytest.warns(\n PydanticDeprecatedSince20, match='^The private method `_copy_and_set_values` will be removed and '\n ):\n m2 = m._copy_and_set_values(values={'x': 2}, fields_set={'x'}, deep=False)\n\n assert m2.x == 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_get_value_test_get_value.assert_v_1_2_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_get_value_test_get_value.assert_v_1_2_3_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 701, "end_line": 714, "span_ids": ["test_get_value"], "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_get_value():\n m = SimpleModel(x=1)\n with pytest.warns(PydanticDeprecatedSince20, match='^The private method `_get_value` will be removed and '):\n v = m._get_value(\n [1, 2, 3],\n to_dict=False,\n by_alias=False,\n include=None,\n exclude=None,\n exclude_unset=False,\n exclude_defaults=False,\n exclude_none=False,\n )\n assert 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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_args_test_args.None_5.foo_1_2_a_3_b_4_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 24, "end_line": 62, "span_ids": ["test_args"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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(include_url=False) == [\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(include_url=False) == [\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_wrap_test_wrap.assert_repr_inspect_signa", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 83, "span_ids": ["test_wrap"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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_deprecated_validate_arguments'\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_kwargs_test_untyped.assert_foo_1_x_2_c", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 116, "span_ids": ["test_untyped", "test_kwargs"], "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_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(include_url=False) == [\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_var_args_kwargs_test_var_args_kwargs.None_7", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 134, "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_deprecated_validate_arguments.py_test_field_can_provide_factory_test_positional_only.None_2.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_deprecated_validate_arguments.py_test_field_can_provide_factory_test_positional_only.None_2.module_foo_a_1_b_2_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 136, "end_line": 164, "span_ids": ["test_field_can_provide_factory", "test_positional_only"], "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_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\ndef test_positional_only(create_module):\n with pytest.warns(PydanticDeprecatedSince20):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic.deprecated.decorator 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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_args_name_test_args_name.None_2.foo_1_2_3_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 169, "end_line": 184, "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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_v_args_test_v_args.None_3.foo4.pass", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 222, "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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_async_test_async.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 225, "end_line": 239, "span_ids": ["test_async"], "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_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(include_url=False) == [\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 259, "span_ids": ["test_string_annotation"], "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_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(include_url=False) == [\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_item_method_test_item_method.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 282, "span_ids": ["test_item_method"], "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_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(include_url=False) == [\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_class_method_test_class_method.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 285, "end_line": 303, "span_ids": ["test_class_method"], "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_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(include_url=False) == [\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_deprecated_validate_arguments.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_deprecated_validate_arguments.py_test_config_title_test_config_fields.with_pytest_raises_Pydant.foo.return.f_a_b_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 304, "end_line": 332, "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_deprecated_validate_arguments.py_test_config_arbitrary_types_allowed_test_config_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_deprecated_validate_arguments.py_test_config_arbitrary_types_allowed_test_config_arbitrary_types_allowed.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 337, "end_line": 358, "span_ids": ["test_config_arbitrary_types_allowed"], "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_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(include_url=False) == [\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 ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_validate_arguments.py_test_validate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_test_validate_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 359, "end_line": 389, "span_ids": ["test_validate", "test_populate_by_name", "test_use_of_alias"], "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_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()\n\n\ndef 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_force_extra.assert_Model_model_config": {"__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_force_extra.assert_Model_model_config", "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": 1251, "end_line": 1270, "span_ids": ["test_force_extra", "test_validate_default"], "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_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(include_url=False) == [\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'] == '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_edge_cases.py_test_hashable_optional_test_hashable_json_schema.with_pytest_raises_.Model_model_json_schema_": {"__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_hashable_json_schema.with_pytest_raises_.Model_model_json_schema_", "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": 2029, "end_line": 2064, "span_ids": ["test_hashable_serialization", "test_hashable_json_schema", "test_hashable_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": "@pytest.mark.parametrize('default', [1, None])\ndef test_hashable_optional(default):\n class Model(BaseModel):\n v: Hashable = default\n\n Model(v=None)\n Model()\n\n\ndef test_hashable_serialization():\n class Model(BaseModel):\n v: Hashable\n\n class HashableButNotSerializable:\n def __hash__(self):\n return 0\n\n assert Model(v=(1,)).model_dump_json() == '{\"v\":[1]}'\n m = Model(v=HashableButNotSerializable())\n with pytest.raises(\n PydanticSerializationError, match='Unable to serialize unknown type:.*HashableButNotSerializable'\n ):\n m.model_dump_json()\n\n\ndef test_hashable_json_schema():\n class Model(BaseModel):\n v: Hashable\n\n with pytest.raises(\n PydanticInvalidForJsonSchema,\n match=re.escape(\n \"Cannot generate a JsonSchema for core_schema.IsInstanceSchema ()\"\n ),\n ):\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_edge_cases.py_test_default_factory_called_once_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_default_factory_called_once_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": 2093, "end_line": 2119, "span_ids": ["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 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(include_url=False) == [\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_forward_ref.py_test_class_var_forward_ref_test_recursive_model.assert_f_y_model_fields_s": {"__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_model_fields_s", "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": 676, "end_line": 707, "span_ids": ["test_class_var_forward_ref", "test_recursive_model"], "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_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.model_fields_set == {'x', 'y'}\n assert f.y.model_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_generics.py_test_custom_sequence_behavior_test_replace_types_identity_on_unchanged.assert_replace_types_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_custom_sequence_behavior_test_replace_types_identity_on_unchanged.assert_replace_types_type", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1255, "end_line": 1279, "span_ids": ["test_replace_types_identity_on_unchanged", "test_custom_sequence_behavior"], "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_custom_sequence_behavior():\n T = TypeVar('T')\n\n class CustomSequence(Sequence[T]):\n pass\n\n with pytest.raises(\n PydanticSchemaGenerationError,\n match=(\n r'Unable to generate pydantic-core schema for .*'\n ' Set `arbitrary_types_allowed=True` in the model_config to ignore this error'\n ' or implement `__get_pydantic_core_schema__` on your type to fully support it'\n ),\n ):\n\n class Model(BaseModel, Generic[T]):\n x: CustomSequence[T]\n\n\ndef 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_", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_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_deep_generic_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": 1229, "end_line": 1257, "span_ids": ["test_deep_generic"], "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_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_metadata__['parameters'] # i.e., InnerModel is not concrete\n assert not inner_model.__pydantic_generic_metadata__['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_generic_with_partial_callable_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_partial_callable_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": 1417, "end_line": 1428, "span_ids": ["test_generic_with_partial_callable"], "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_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_metadata__['parameters'] == (U,)\n assert not Model[str, int].__pydantic_generic_metadata__['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_construct_other_generic_model_with_validation_test_construct_other_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_other_generic_model_with_validation_test_construct_other_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": 2179, "end_line": 2206, "span_ids": ["test_construct_other_generic_model_with_validation"], "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_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(include_url=False) == [\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_generics.py_test_generic_enum_bound_test_generic_enum_bound.assert_Model_MyEnum_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_enum_bound_test_generic_enum_bound.assert_Model_MyEnum_mode", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2394, "end_line": 2443, "span_ids": ["test_generic_enum_bound"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_generic_enum_bound():\n T = TypeVar('T', bound=Enum)\n\n class MyEnum(Enum):\n a = 1\n\n class OtherEnum(Enum):\n b = 2\n\n class Model(BaseModel, Generic[T]):\n x: T\n\n m = Model(x=MyEnum.a)\n assert m.x == MyEnum.a\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=1)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'Enum'},\n 'input': 1,\n 'loc': ('x',),\n 'msg': 'Input should be an instance of Enum',\n 'type': 'is_instance_of',\n }\n ]\n\n m2 = Model[MyEnum](x=MyEnum.a)\n assert m2.x == MyEnum.a\n\n with pytest.raises(ValidationError) as exc_info:\n Model[MyEnum](x=OtherEnum.b)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'expected': '1'},\n 'input': OtherEnum.b,\n 'loc': ('x',),\n 'msg': 'Input should be 1',\n 'type': 'enum',\n }\n ]\n\n # insert_assert(Model[MyEnum].model_json_schema())\n assert Model[MyEnum].model_json_schema() == {\n '$defs': {'MyEnum': {'const': 1, 'enum': [1], 'title': 'MyEnum', 'type': 'integer'}},\n 'properties': {'x': {'$ref': '#/$defs/MyEnum'}},\n 'required': ['x'],\n 'title': 'Model[test_generic_enum_bound..MyEnum]',\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.py_test_encode_dataclass_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_encode_dataclass_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": 239, "end_line": 256, "span_ids": ["test_encode_dataclass", "test_encode_pydantic_dataclass"], "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_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_schema.py_test_enum_modify_schema_test_enum_modify_schema.SpamEnum.__get_pydantic_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_enum_modify_schema_test_enum_modify_schema.SpamEnum.__get_pydantic_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": 270, "end_line": 288, "span_ids": ["test_enum_modify_schema"], "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_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 __get_pydantic_json_schema__(\n cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\n field_schema = handler.resolve_ref_schema(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 field_schema['tsEnumNames'] = [e.name for e in cls]\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_enum_modify_schema.Model_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.Model_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": 290, "end_line": 308, "span_ids": ["test_enum_modify_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": "def test_enum_modify_schema():\n # ... other code\n\n class Model(BaseModel):\n spam: Optional[SpamEnum] = Field(None)\n\n # insert_assert(Model.model_json_schema())\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_advanced_generic_schema_test_advanced_generic_schema.Gen.__get_pydantic_core_schema__.if_hasattr_source___arg.else_.return.handler_source_": {"__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.__get_pydantic_core_schema__.if_hasattr_source___arg.else_.return.handler_source_", "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": 3232, "end_line": 3263, "span_ids": ["test_advanced_generic_schema"], "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_advanced_generic_schema(): # noqa: C901\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__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n if hasattr(source, '__args__'):\n arg = source.__args__[0]\n\n def js_func(s, h):\n # ignore the schema we were given and get a new CoreSchema\n s = handler.generate_schema(Optional[arg])\n return h(s)\n\n return core_schema.with_info_plain_validator_function(\n Gen,\n metadata={'pydantic_js_annotation_functions': [js_func]},\n )\n else:\n return handler(source)\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.Gen.__get_pydantic_json_schema___test_advanced_generic_schema.Gen.__get_pydantic_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.Gen.__get_pydantic_json_schema___test_advanced_generic_schema.Gen.__get_pydantic_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": 2407, "end_line": 2417, "span_ids": ["test_advanced_generic_schema"], "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_advanced_generic_schema():\n\n class Gen(Generic[T]):\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n try:\n field_schema = handler(core_schema)\n except PydanticInvalidForJsonSchema:\n 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.__get_pydantic_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.__get_pydantic_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": 3277, "end_line": 3311, "span_ids": ["test_advanced_generic_schema"], "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_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, handler: GetCoreSchemaHandler, **_kwargs: Any\n ) -> core_schema.CoreSchema:\n if hasattr(source, '__args__'):\n # the js_function ignores the schema we were given and gets a new Tuple CoreSchema\n metadata = build_metadata_dict(js_functions=[lambda _c, h: h(handler(Tuple[source.__args__]))])\n return core_schema.with_info_plain_validator_function(\n GenTwoParams,\n metadata=metadata,\n )\n return handler(source)\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_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_override_generate_json_schema_test_override_generate_json_schema.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_override_generate_json_schema_test_override_generate_json_schema.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": 3559, "end_line": 3586, "span_ids": ["test_override_generate_json_schema"], "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_override_generate_json_schema():\n class MyGenerateJsonSchema(GenerateJsonSchema):\n def generate(self, schema, mode='validation'):\n json_schema = super().generate(schema, mode=mode)\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 mode='validation',\n ) -> Dict[str, Any]:\n return super().model_json_schema(by_alias, ref_template, schema_generator, mode)\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_json_schema.py_test_nested_default_json_schema_test_nested_default_json_schema.assert_OuterModel_model_j": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_nested_default_json_schema_test_nested_default_json_schema.assert_OuterModel_model_j", "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": 3470, "end_line": 3494, "span_ids": ["test_nested_default_json_schema"], "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_nested_default_json_schema():\n class InnerModel(BaseModel):\n foo: str = 'bar'\n baz: str = Field(default='foobar', alias='my_alias')\n\n class OuterModel(BaseModel):\n nested_field: InnerModel = InnerModel()\n\n assert OuterModel.model_json_schema() == {\n '$defs': {\n 'InnerModel': {\n 'properties': {\n 'foo': {'default': 'bar', 'title': 'Foo', 'type': 'string'},\n 'my_alias': {'default': 'foobar', 'title': 'My Alias', 'type': 'string'},\n },\n 'title': 'InnerModel',\n 'type': 'object',\n }\n },\n 'properties': {\n 'nested_field': {'allOf': [{'$ref': '#/$defs/InnerModel'}], 'default': {'my_alias': 'foobar', 'foo': 'bar'}}\n },\n 'title': 'OuterModel',\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_get_pydantic_core_schema_calls_test_get_pydantic_core_schema_calls.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_get_pydantic_core_schema_calls_test_get_pydantic_core_schema_calls.None_4", "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": 3616, "end_line": 3734, "span_ids": ["test_get_pydantic_core_schema_calls"], "tokens": 853}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(\n reason=(\n 'We are calling __get_pydantic_json_schema__ too many times.'\n ' The second time we analyze a model we get the CoreSchema from __pydantic_core_schema__.'\n ' But then we proceed to append to the metadata json schema functions.'\n )\n)\ndef test_get_pydantic_core_schema_calls() -> None:\n \"\"\"Verify when/how many times `__get_pydantic_core_schema__` gets called\"\"\"\n\n calls: List[str] = []\n\n class Model(BaseModel):\n @classmethod\n def __get_pydantic_json_schema__(cls, schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n calls.append('Model::before')\n json_schema = handler(schema)\n calls.append('Model::after')\n return json_schema\n\n schema = Model.model_json_schema()\n expected: JsonSchemaValue = {'type': 'object', 'properties': {}, 'title': 'Model'}\n\n assert schema == expected\n assert calls == ['Model::before', 'Model::after']\n\n calls.clear()\n\n class CustomAnnotation(NamedTuple):\n name: str\n\n def __get_pydantic_json_schema__(self, schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n calls.append(f'CustomAnnotation({self.name})::before')\n json_schema = handler(schema)\n calls.append(f'CustomAnnotation({self.name})::after')\n return json_schema\n\n AnnotatedType = Annotated[str, CustomAnnotation('foo'), CustomAnnotation('bar')]\n\n schema = TypeAdapter(AnnotatedType).json_schema()\n expected: JsonSchemaValue = {'type': 'string'}\n\n assert schema == expected\n assert calls == [\n 'CustomAnnotation(bar)::before',\n 'CustomAnnotation(foo)::before',\n 'CustomAnnotation(foo)::after',\n 'CustomAnnotation(bar)::after',\n ]\n\n calls.clear()\n\n class OuterModel(BaseModel):\n x: Model\n\n @classmethod\n def __get_pydantic_json_schema__(cls, schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n calls.append('OuterModel::before')\n json_schema = handler(schema)\n calls.append('OuterModel::after')\n return json_schema\n\n schema = OuterModel.model_json_schema()\n expected: JsonSchemaValue = {\n 'type': 'object',\n 'properties': {'x': {'$ref': '#/$defs/Model'}},\n 'required': ['x'],\n 'title': 'OuterModel',\n '$defs': {'Model': {'type': 'object', 'properties': {}, 'title': 'Model'}},\n }\n\n assert schema == expected\n assert calls == [\n 'OuterModel::before',\n 'Model::before',\n 'Model::after',\n 'OuterModel::after',\n ]\n\n calls.clear()\n\n AnnotatedModel = Annotated[Model, CustomAnnotation('foo')]\n\n schema = TypeAdapter(AnnotatedModel).json_schema()\n expected: JsonSchemaValue = {}\n\n assert schema == expected\n assert calls == [\n 'CustomAnnotation(foo)::before',\n 'Model::before',\n 'Model::after',\n 'CustomAnnotation(foo)::after',\n ]\n\n calls.clear()\n\n class OuterModelWithAnnotatedField(BaseModel):\n x: AnnotatedModel\n\n schema = OuterModelWithAnnotatedField.model_json_schema()\n expected: JsonSchemaValue = {\n 'type': 'object',\n 'properties': {'x': {'$ref': '#/$defs/Model'}},\n 'required': ['x'],\n 'title': 'OuterModel',\n '$defs': {'Model': {'type': 'object', 'properties': {}, 'title': 'Model'}},\n }\n\n assert schema == expected\n assert calls == [\n 'OuterModel::before',\n 'CustomAnnotation(foo)::before',\n 'Model::before',\n 'Model::after',\n 'CustomAnnotation(foo)::after',\n 'OuterModel::after',\n ]\n\n calls.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_field_order_is_preserved_with_extra_test_field_order_is_preserved_with_extra.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_field_order_is_preserved_with_extra_test_field_order_is_preserved_with_extra.None_2", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 328, "end_line": 341, "span_ids": ["test_field_order_is_preserved_with_extra"], "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_field_order_is_preserved_with_extra():\n \"\"\"This test covers https://github.com/pydantic/pydantic/issues/1234.\"\"\"\n\n class Model(BaseModel):\n model_config = ConfigDict(extra='allow')\n\n a: int\n b: str\n c: float\n\n model = Model(a=1, b='2', c=3.0, d=4)\n assert repr(model) == \"Model(a=1, b='2', c=3.0, d=4)\"\n assert str(model.model_dump()) == \"{'a': 1, 'b': '2', 'c': 3.0, 'd': 4}\"\n assert str(model.model_dump_json()) == '{\"a\":1,\"b\":\"2\",\"c\":3.0,\"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_main.py_test_revalidate_instances_always_test_revalidate_instances_always_list_of_model_instance.None_1": {"__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_list_of_model_instance.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": 1121, "end_line": 1159, "span_ids": ["test_revalidate_instances_always", "test_revalidate_instances_always_list_of_model_instance"], "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_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')\n\n\ndef test_revalidate_instances_always_list_of_model_instance():\n class A(BaseModel):\n model_config = ConfigDict(revalidate_instances='always')\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_untyped_fields_error_test_custom_init_subclass_params.assert_NewModel_something": {"__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_custom_init_subclass_params.assert_NewModel_something", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1336, "end_line": 1356, "span_ids": ["test_custom_init_subclass_params", "test_untyped_fields_error"], "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_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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_recursive_model_test_recursive_cycle_with_repeated_field.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_recursive_model_test_recursive_cycle_with_repeated_field.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": 1396, "end_line": 1419, "span_ids": ["test_recursive_cycle_with_repeated_field", "test_recursive_model"], "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_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_recursive_cycle_with_repeated_field():\n class A(BaseModel):\n b: 'B'\n\n class B(BaseModel):\n a1: Optional[A] = None\n a2: Optional[A] = None\n\n A.model_rebuild()\n\n assert A.model_validate({'b': {'a1': {'b': {'a1': None}}}}) == A(b=B(a1=A(b=B(a1=None))))\n with pytest.raises(ValidationError) as exc_info:\n A.model_validate({'b': {'a1': {'a1': None}}})\n assert exc_info.value.errors(include_url=False) == [\n {'input': {'a1': None}, 'loc': ('b', 'a1', '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_main.py_test_two_defaults_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_two_defaults_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": 1387, "end_line": 1428, "span_ids": ["test_two_defaults", "test_default_factory"], "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_two_defaults():\n with pytest.raises(TypeError, match='^cannot specify both default and default_factory$'):\n\n class Model(BaseModel):\n a: int = Field(default=3, default_factory=lambda: 3)\n\n\ndef 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_final_field_decl_with_default_val_test_annotated_final.None_3": {"__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_annotated_final.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": 1886, "end_line": 1932, "span_ids": ["test_field_by_default_is_not_frozen", "test_annotated_final", "test_final_field_reassignment", "test_final_field_decl_with_default_val"], "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 '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 assert 'a' in Model.__class_vars__\n assert 'a' not in Model.model_fields\n\n\ndef test_final_field_reassignment():\n class Model(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n\n a: Final[int]\n\n obj = Model(a=10)\n\n with pytest.raises(ValidationError) as exc_info:\n obj.a = 20\n assert exc_info.value.errors(include_url=False) == [\n {'input': 20, 'loc': ('a',), 'msg': 'Field is frozen', 'type': 'frozen_field'}\n ]\n\n\ndef test_field_by_default_is_not_frozen():\n class Model(BaseModel):\n a: int\n\n assert not Model.model_fields['a'].frozen\n\n\ndef test_annotated_final():\n class Model(BaseModel):\n a: Annotated[Final[int], Field(title='abc')]\n\n assert Model.model_fields['a'].frozen\n assert Model.model_fields['a'].title == 'abc'\n\n class Model2(BaseModel):\n a: Final[Annotated[int, Field(title='def')]]\n\n assert Model2.model_fields['a'].frozen\n assert Model2.model_fields['a'].title == 'def'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_test_post_init.None_3": {"__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.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": 1817, "end_line": 1851, "span_ids": ["test_post_init"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_post_init():\n calls = []\n\n class InnerModel(BaseModel):\n a: int\n b: int\n\n def model_post_init(self, __context) -> None:\n super().model_post_init(__context) # this is included just to show it doesn't error\n assert self.model_dump() == {'a': 3, 'b': 4}\n calls.append('inner_model_post_init')\n\n class Model(BaseModel):\n c: int\n d: int\n sub: InnerModel\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 calls == ['inner_model_post_init', 'model_post_init']\n assert m.model_dump() == {'c': 1, 'd': 2, 'sub': {'a': 3, 'b': 4}}\n\n class SubModel(Model):\n def model_post_init(self, __context) -> None:\n assert self.model_dump() == {'c': 1, 'd': 2, 'sub': {'a': 3, 'b': 4}}\n super().model_post_init(__context)\n calls.append('submodel_post_init')\n\n calls.clear()\n m = SubModel(c=1, d='2', sub={'a': 3, 'b': '4'})\n assert calls == ['inner_model_post_init', 'model_post_init', 'submodel_post_init']\n assert m.model_dump() == {'c': 1, 'd': 2, 'sub': {'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_main.py_test_post_init_call_signatures_test_post_init_call_signatures.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_call_signatures_test_post_init_call_signatures.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": 1854, "end_line": 1870, "span_ids": ["test_post_init_call_signatures"], "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": "@pytest.mark.parametrize('include_private_attribute', [True, False])\ndef test_post_init_call_signatures(include_private_attribute):\n calls = []\n\n class Model(BaseModel):\n a: int\n b: int\n if include_private_attribute:\n _x: int = PrivateAttr(1)\n\n def model_post_init(self, *args, **kwargs) -> None:\n calls.append((args, kwargs))\n\n Model(a=1, b=2)\n assert calls == [((None,), {})]\n Model.model_construct(a=3, b=4)\n assert calls == [((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_main.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_main.py_test_validate_json_context_test_validate_json_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": 2153, "end_line": 2167, "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_main.py_test_pydantic_init_subclass_test_pydantic_init_subclass.assert_calls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_pydantic_init_subclass_test_pydantic_init_subclass.assert_calls_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2170, "end_line": 2189, "span_ids": ["test_pydantic_init_subclass"], "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_pydantic_init_subclass() -> None:\n calls = []\n\n class MyModel(BaseModel):\n def __init_subclass__(cls, **kwargs):\n super().__init_subclass__() # can't pass kwargs to object.__init_subclass__, weirdly\n calls.append((cls.__name__, '__init_subclass__', kwargs))\n\n @classmethod\n def __pydantic_init_subclass__(cls, **kwargs):\n super().__pydantic_init_subclass__(**kwargs)\n calls.append((cls.__name__, '__pydantic_init_subclass__', kwargs))\n\n class MySubModel(MyModel, a=1):\n pass\n\n assert calls == [\n ('MySubModel', '__init_subclass__', {'a': 1}),\n ('MySubModel', '__pydantic_init_subclass__', {'a': 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_migration.py_importlib_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_migration.py_importlib_", "embedding": null, "metadata": {"file_path": "tests/test_migration.py", "file_name": "test_migration.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 55, "span_ids": ["test_getattr_migration", "imports", "test_base_settings_removed", "test_moved_on_v2", "import_from", "test_redirect_to_v1", "test_removed_on_v2", "test_moved_but_not_warn_on_v2"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import importlib\n\nimport pytest\n\nfrom pydantic._migration import DEPRECATED_MOVED_IN_V2, MOVED_IN_V2, REDIRECT_TO_V1, REMOVED_IN_V2, getattr_migration\nfrom pydantic.errors import PydanticImportError\n\n\ndef import_from(dotted_path: str):\n if ':' in dotted_path:\n module, obj_name = dotted_path.rsplit(':', 1)\n module = importlib.import_module(module)\n return getattr(module, obj_name)\n else:\n return importlib.import_module(dotted_path)\n\n\n@pytest.mark.filterwarnings('ignore::UserWarning')\n@pytest.mark.parametrize('module', MOVED_IN_V2.keys())\ndef test_moved_on_v2(module: str):\n import_from(module)\n\n\n@pytest.mark.parametrize('module', DEPRECATED_MOVED_IN_V2.keys())\ndef test_moved_but_not_warn_on_v2(module: str):\n import_from(module)\n\n\n@pytest.mark.filterwarnings('ignore::UserWarning')\n@pytest.mark.parametrize('module', REDIRECT_TO_V1.keys())\ndef test_redirect_to_v1(module: str):\n import_from(module)\n\n\n@pytest.mark.parametrize('module', REMOVED_IN_V2)\ndef test_removed_on_v2(module: str):\n with pytest.raises(PydanticImportError, match=f'`{module}` has been removed in V2.'):\n import_from(module)\n assert False, f'{module} should not be importable'\n\n\ndef test_base_settings_removed():\n with pytest.raises(PydanticImportError, match='`BaseSettings` has been moved to the `pydantic-settings` package. '):\n import_from('pydantic:BaseSettings')\n assert False, 'pydantic:BaseSettings should not be importable'\n\n\ndef test_getattr_migration():\n get_attr = getattr_migration(__name__)\n\n assert callable(get_attr('test_getattr_migration')) is True\n\n with pytest.raises(AttributeError, match=\"module 'tests.test_migration' has no attribute 'foo'\"):\n get_attr('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_model_validator.py_test_model_validator_before_test_model_validator_before.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_model_validator_before_test_model_validator_before.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_model_validator.py", "file_name": "test_model_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 58, "span_ids": ["test_model_validator_before"], "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('classmethod_decorator', [classmethod, lambda x: x])\ndef test_model_validator_before(classmethod_decorator: Any) -> None:\n class Model(BaseModel):\n x: int\n y: int\n\n @model_validator(mode='before')\n @classmethod_decorator\n def val_model(cls, values: Any, info: ValidationInfo) -> dict[str, Any] | Model:\n assert not info.context\n if isinstance(values, dict):\n values = cast(Dict[str, Any], values)\n values['x'] += 1\n values['y'] += 1\n else:\n assert isinstance(values, Model)\n values.x += 1\n values.y += 1\n return values\n\n m = Model(x=1, y=2)\n assert m.model_dump() == {'x': 2, 'y': 3}\n # model not changed because we don't revalidate m\n assert Model.model_validate(m).model_dump() == {'x': 2, 'y': 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_serialize.py___test_serialize_extra_allow_subclass_1.assert_json_loads_m_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py___test_serialize_extra_allow_subclass_1.assert_json_loads_m_model", "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": 58, "span_ids": ["test_serialize_extra_allow_subclass_1", "test_serialize_extra_allow", "docstring"], "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": "\"\"\"\nNew tests for v2 of serialization logic.\n\"\"\"\nimport json\nimport re\nimport sys\nfrom enum import Enum\nfrom functools import partial, partialmethod\nfrom typing import Any, Callable, ClassVar, Dict, List, Optional, Pattern, Union\n\nimport pytest\nfrom pydantic_core import PydanticSerializationError, core_schema, to_jsonable_python\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import (\n BaseModel,\n Field,\n FieldSerializationInfo,\n PydanticUserError,\n SecretStr,\n SerializationInfo,\n SerializeAsAny,\n SerializerFunctionWrapHandler,\n TypeAdapter,\n computed_field,\n errors,\n field_serializer,\n model_serializer,\n)\nfrom pydantic.config import ConfigDict\nfrom pydantic.functional_serializers import PlainSerializer, WrapSerializer\n\n\ndef test_serialize_extra_allow() -> None:\n class Model(BaseModel):\n x: int\n model_config = ConfigDict(extra='allow')\n\n m = Model(x=1, y=2)\n assert m.y == 2\n assert m.model_dump() == {'x': 1, 'y': 2}\n assert json.loads(m.model_dump_json()) == {'x': 1, 'y': 2}\n\n\ndef test_serialize_extra_allow_subclass_1() -> None:\n class Parent(BaseModel):\n x: int\n\n class Child(Parent):\n model_config = ConfigDict(extra='allow')\n\n class Model(BaseModel):\n inner: Parent\n\n m = Model(inner=Child(x=1, y=2))\n assert m.inner.y == 2\n assert m.model_dump() == {'inner': {'x': 1}}\n assert json.loads(m.model_dump_json()) == {'inner': {'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_serialize.py_test_serializer_annotated_plain_always_test_serializer_annotated_plain_always.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_plain_always_test_serializer_annotated_plain_always.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": 84, "end_line": 92, "span_ids": ["test_serializer_annotated_plain_always"], "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_serializer_annotated_plain_always():\n FancyInt = Annotated[int, PlainSerializer(lambda x: f'{x:,}', return_type=str)]\n\n class MyModel(BaseModel):\n x: FancyInt\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\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_serializer_annotated_plain_json_test_serializer_annotated_plain_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_serializer_annotated_plain_json_test_serializer_annotated_plain_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": 95, "end_line": 103, "span_ids": ["test_serializer_annotated_plain_json"], "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_serializer_annotated_plain_json():\n FancyInt = Annotated[int, PlainSerializer(lambda x: f'{x:,}', return_type=str, when_used='json')]\n\n class MyModel(BaseModel):\n x: FancyInt\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_serializer_annotated_wrap_always_test_serializer_annotated_wrap_always.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_wrap_always_test_serializer_annotated_wrap_always.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": 106, "end_line": 117, "span_ids": ["test_serializer_annotated_wrap_always"], "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_serializer_annotated_wrap_always():\n def ser_wrap(v: Any, nxt: SerializerFunctionWrapHandler) -> str:\n return f'{nxt(v + 1):,}'\n\n FancyInt = Annotated[int, WrapSerializer(ser_wrap, return_type=str)]\n\n class MyModel(BaseModel):\n x: FancyInt\n\n assert MyModel(x=1234).model_dump() == {'x': '1,235'}\n assert MyModel(x=1234).model_dump(mode='json') == {'x': '1,235'}\n assert MyModel(x=1234).model_dump_json() == '{\"x\":\"1,235\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_serializer_annotated_wrap_json_test_serializer_annotated_wrap_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_serializer_annotated_wrap_json_test_serializer_annotated_wrap_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": 120, "end_line": 131, "span_ids": ["test_serializer_annotated_wrap_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_serializer_annotated_wrap_json():\n def ser_wrap(v: Any, nxt: SerializerFunctionWrapHandler) -> str:\n return f'{nxt(v + 1):,}'\n\n FancyInt = Annotated[int, WrapSerializer(ser_wrap, when_used='json')]\n\n class MyModel(BaseModel):\n x: FancyInt\n\n assert MyModel(x=1234).model_dump() == {'x': 1234}\n assert MyModel(x=1234).model_dump(mode='json') == {'x': '1,235'}\n assert MyModel(x=1234).model_dump_json() == '{\"x\":\"1,235\"}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_serializer_annotated_typing_cache_test_serializer_annotated_typing_cache.assert_FancyIntModel_x_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_annotated_typing_cache_test_serializer_annotated_typing_cache.assert_FancyIntModel_x_12", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 132, "span_ids": ["test_serializer_annotated_typing_cache"], "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(\n 'serializer, func',\n [\n (PlainSerializer, lambda v: f'{v + 1:,}'),\n (WrapSerializer, lambda v, nxt: f'{nxt(v + 1):,}'),\n ],\n)\ndef test_serializer_annotated_typing_cache(serializer, func):\n FancyInt = Annotated[int, serializer(func)]\n\n class FancyIntModel(BaseModel):\n x: Optional[FancyInt]\n\n assert FancyIntModel(x=1234).model_dump() == {'x': '1,235'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_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_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": 145, "end_line": 165, "span_ids": ["test_serialize_decorator_always"], "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_serialize_decorator_always():\n class MyModel(BaseModel):\n x: Optional[int]\n\n @field_serializer('x')\n def customise_x_serialization(v, _info) -> str:\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_serialization`: '\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_model_serializer_wrong_args_test_field_multiple_serializer.with_pytest_raises_TypeEr.MyModel.serializer2.return.v": {"__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_test_field_multiple_serializer.with_pytest_raises_TypeEr.MyModel.serializer2.return.v", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 492, "end_line": 544, "span_ids": ["test_model_serializer_no_self", "test_field_multiple_serializer", "test_model_serializer_wrong_args", "test_model_serializer_classmethod"], "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_model_serializer_wrong_args():\n m = (\n r'Unrecognized model_serializer function signature for '\n r'<.+MyModel._serialize at 0x\\w+> with `mode=plain`:\\(self, x, y, z\\)'\n )\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\n\n\ndef test_field_multiple_serializer():\n m = \"Multiple field serializer functions were defined for field 'x', this is not allowed.\"\n with pytest.raises(TypeError, match=m):\n\n class MyModel(BaseModel):\n x: int\n y: int\n\n @field_serializer('x', 'y')\n def serializer1(v) -> str:\n return f'{v:,}'\n\n @field_serializer('x')\n def serializer2(v) -> str:\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_serialize.py_test_field_multiple_serializer_subclass_test_field_multiple_serializer_subclass.assert_MySubModel_x_1234_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_field_multiple_serializer_subclass_test_field_multiple_serializer_subclass.assert_MySubModel_x_1234_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 547, "end_line": 561, "span_ids": ["test_field_multiple_serializer_subclass"], "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_field_multiple_serializer_subclass():\n class MyModel(BaseModel):\n x: int\n\n @field_serializer('x')\n def serializer1(v) -> str:\n return f'{v:,}'\n\n class MySubModel(MyModel):\n @field_serializer('x')\n def serializer1(v) -> str:\n return f'{v}'\n\n assert MyModel(x=1234).model_dump() == {'x': '1,234'}\n assert MySubModel(x=1234).model_dump() == {'x': '1234'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_partial_test_serialize_partial.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_serialize_partial_test_serialize_partial.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": 600, "end_line": 621, "span_ids": ["test_serialize_partial"], "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 'func',\n [\n int_ser_func_with_info1,\n int_ser_func_with_info2,\n int_ser_func_without_info1,\n int_ser_func_without_info2,\n int_ser_instance_method_with_info1,\n int_ser_instance_method_with_info2,\n int_ser_instance_method_without_info1,\n int_ser_instance_method_without_info2,\n ],\n)\ndef test_serialize_partial(\n func: Any,\n):\n class MyModel(BaseModel):\n x: int\n\n ser = field_serializer('x', return_type=str)(partial(func, expected=1234))\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_serialize_partialmethod_test_serialize_partialmethod.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_serialize_partialmethod_test_serialize_partialmethod.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": 624, "end_line": 645, "span_ids": ["test_serialize_partialmethod"], "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.parametrize(\n 'func',\n [\n int_ser_func_with_info1,\n int_ser_func_with_info2,\n int_ser_func_without_info1,\n int_ser_func_without_info2,\n int_ser_instance_method_with_info1,\n int_ser_instance_method_with_info2,\n int_ser_instance_method_without_info1,\n int_ser_instance_method_without_info2,\n ],\n)\ndef test_serialize_partialmethod(\n func: Any,\n):\n class MyModel(BaseModel):\n x: int\n\n ser = field_serializer('x', return_type=str)(partialmethod(func, expected=1234))\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_serializer_allow_reuse_inheritance_override_test_serializer_allow_reuse_inheritance_override.None_1._.other_func_name.return._parent_encoder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_inheritance_override_test_serializer_allow_reuse_inheritance_override.None_1._.other_func_name.return._parent_encoder_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 634, "end_line": 678, "span_ids": ["test_serializer_allow_reuse_inheritance_override"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_serializer_allow_reuse_inheritance_override():\n class Parent(BaseModel):\n x: int\n\n @field_serializer('x')\n def ser_x(self, _v: int, _info: SerializationInfo) -> str:\n return 'parent_encoder'\n\n # overriding a serializer with a function / class var\n # of the same name is allowed\n # to mimic how inheritance works\n # the serializer in the child class replaces the parent\n # (without modifying the parent class itself)\n class Child1(Parent):\n @field_serializer('x')\n def ser_x(self, _v: int, _info: SerializationInfo) -> str:\n return 'child1_encoder' + ' ' + super().ser_x(_v, _info)\n\n assert Parent(x=1).model_dump_json() == '{\"x\":\"parent_encoder\"}'\n assert Child1(x=1).model_dump_json() == '{\"x\":\"child1_encoder parent_encoder\"}'\n\n # defining an _different_ serializer on the other hand is not allowed\n # because they would both \"exist\" thus causing confusion\n # since it's not clear if both or just one will run\n msg = 'Multiple field serializer functions were defined ' \"for field 'x', this is not allowed.\"\n with pytest.raises(TypeError, match=msg):\n\n class _(Parent):\n @field_serializer('x')\n def ser_x_other(self, _v: int) -> str:\n return 'err'\n\n # the same thing applies if defined on the same class\n with pytest.raises(TypeError, match=msg):\n\n class _(BaseModel):\n x: int\n\n @field_serializer('x')\n def ser_x(self, _v: int) -> str:\n return 'parent_encoder'\n\n @field_serializer('x')\n def other_func_name(self, _v: int) -> str:\n return 'parent_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_serialize.py_test_serializer_allow_reuse_same_field_test_serializer_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_same_field_test_serializer_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 694, "end_line": 708, "span_ids": ["test_serializer_allow_reuse_same_field"], "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_serializer_allow_reuse_same_field():\n with pytest.warns(UserWarning, match='`ser_x` overrides an existing Pydantic `@field_serializer` decorator'):\n\n class Model(BaseModel):\n x: int\n\n @field_serializer('x')\n def ser_x(self, _v: int) -> str:\n return 'ser_1'\n\n @field_serializer('x')\n def ser_x(self, _v: int) -> str:\n return 'ser_2'\n\n assert Model(x=1).model_dump() == {'x': 'ser_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_serialize.py_test_serializer_allow_reuse_different_field_1_test_serializer_allow_reuse_different_field_1.assert_Model_x_1_y_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_1_test_serializer_allow_reuse_different_field_1.assert_Model_x_1_y_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 711, "end_line": 726, "span_ids": ["test_serializer_allow_reuse_different_field_1"], "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_serializer_allow_reuse_different_field_1():\n with pytest.warns(UserWarning, match='`ser` overrides an existing Pydantic `@field_serializer` decorator'):\n\n class Model(BaseModel):\n x: int\n y: int\n\n @field_serializer('x')\n def ser(self, _v: int) -> str:\n return 'x'\n\n @field_serializer('y')\n def ser(self, _v: int) -> str:\n return 'y'\n\n assert Model(x=1, y=2).model_dump() == {'x': 1, 'y': '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_serialize.py_test_serializer_allow_reuse_different_field_2_test_serializer_allow_reuse_different_field_2.assert_Model_x_1_y_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_2_test_serializer_allow_reuse_different_field_2.assert_Model_x_1_y_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 729, "end_line": 745, "span_ids": ["test_serializer_allow_reuse_different_field_2"], "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_serializer_allow_reuse_different_field_2():\n with pytest.warns(UserWarning, match='`ser_x` overrides an existing Pydantic `@field_serializer` decorator'):\n\n def ser(self: Any, _v: int, _info: Any) -> str:\n return 'ser'\n\n class Model(BaseModel):\n x: int\n y: int\n\n @field_serializer('x')\n def ser_x(self, _v: int) -> str:\n return 'ser_x'\n\n ser_x = field_serializer('y')(ser)\n\n assert Model(x=1, y=2).model_dump() == {'x': 1, 'y': 'ser'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_serializer_allow_reuse_different_field_3_test_serializer_allow_reuse_different_field_3.assert_Model_x_1_y_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_3_test_serializer_allow_reuse_different_field_3.assert_Model_x_1_y_2_mo", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 735, "end_line": 751, "span_ids": ["test_serializer_allow_reuse_different_field_3"], "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_serializer_allow_reuse_different_field_3():\n with pytest.warns(UserWarning, match='`ser_x` overrides an existing Pydantic `@field_serializer` decorator'):\n\n def ser1(self: Any, _v: int, _info: Any) -> str:\n return 'ser1'\n\n def ser2(self: Any, _v: int, _info: Any) -> str:\n return 'ser2'\n\n class Model(BaseModel):\n x: int\n y: int\n\n ser_x = field_serializer('x')(ser1)\n ser_x = field_serializer('y')(ser2)\n\n assert Model(x=1, y=2).model_dump() == {'x': 1, 'y': 'ser2'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_optional_test_optional.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_optional_test_optional.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 81, "span_ids": ["test_optional"], "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_optional():\n @validate_call\n def foo_bar(a: int = None):\n return f'a={a}'\n\n assert foo_bar() == 'a=None'\n assert foo_bar(1) == 'a=1'\n with pytest.raises(ValidationError) as exc_info:\n foo_bar(None)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'int_type', 'loc': (0,), 'msg': 'Input should be a valid integer', '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_validate_call.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_validate_call.py_test_wrap_test_wrap.assert_repr_inspect_signa", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 97, "span_ids": ["test_wrap"], "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_wrap():\n @validate_call\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_validate_call'\n assert foo_bar.__qualname__ == 'test_wrap..foo_bar'\n assert callable(foo_bar.raw_function)\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_validate_call.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_validate_call.py_test_kwargs_test_untyped.assert_foo_1_x_2_c", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 146, "span_ids": ["test_untyped", "test_kwargs"], "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_kwargs():\n @validate_call\n def foo(*, a: int, b: int):\n return a + b\n\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(include_url=False) == [\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(ValidationError) as exc_info:\n foo(1, 'x')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing_keyword_only_argument',\n 'loc': ('a',),\n 'msg': 'Missing required keyword only argument',\n 'input': ArgsKwargs((1, 'x')),\n },\n {\n 'type': 'missing_keyword_only_argument',\n 'loc': ('b',),\n 'msg': 'Missing required keyword only argument',\n 'input': ArgsKwargs((1, 'x')),\n },\n {'type': 'unexpected_positional_argument', 'loc': (0,), 'msg': 'Unexpected positional argument', 'input': 1},\n {'type': 'unexpected_positional_argument', 'loc': (1,), 'msg': 'Unexpected positional argument', 'input': 'x'},\n ]\n\n\ndef test_untyped():\n @validate_call\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_validate_call.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_validate_call.py_test_var_args_kwargs_test_var_args_kwargs.None_7", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 163, "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_call(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_validate_call.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_validate_call.py_test_field_can_provide_factory_test_annotated_field_can_provide_factory.assert_foo2_1_100", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 182, "span_ids": ["test_annotated_field_can_provide_factory", "test_field_can_provide_factory"], "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_field_can_provide_factory() -> None:\n @validate_call\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\ndef test_annotated_field_can_provide_factory() -> None:\n @validate_call\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_validate_call.py_test_positional_only_test_positional_only.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_positional_only_test_positional_only.None_4", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 188, "end_line": 233, "span_ids": ["test_positional_only"], "tokens": 468}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_positional_only(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import validate_call\n\n@validate_call\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(ValidationError) as exc_info:\n module.foo(1, b=2)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing_positional_only_argument',\n 'loc': (1,),\n 'msg': 'Missing required positional only argument',\n 'input': ArgsKwargs((1,), {'b': 2}),\n },\n {'type': 'unexpected_keyword_argument', 'loc': ('b',), 'msg': 'Unexpected keyword argument', 'input': 2},\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n module.foo(a=1, b=2)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing_positional_only_argument',\n 'loc': (0,),\n 'msg': 'Missing required positional only argument',\n 'input': ArgsKwargs((), {'a': 1, 'b': 2}),\n },\n {\n 'type': 'missing_positional_only_argument',\n 'loc': (1,),\n 'msg': 'Missing required positional only argument',\n 'input': ArgsKwargs((), {'a': 1, 'b': 2}),\n },\n {'type': 'unexpected_keyword_argument', 'loc': ('a',), 'msg': 'Unexpected keyword argument', 'input': 1},\n {'type': 'unexpected_keyword_argument', 'loc': ('b',), 'msg': 'Unexpected keyword argument', 'input': 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_validate_call.py_test_args_name_test_args_name.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_args_name_test_args_name.None_2", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 235, "end_line": 260, "span_ids": ["test_args_name"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_args_name():\n @validate_call\n def foo(args: int, kwargs: int):\n return f'args={args!r}, kwargs={kwargs!r}'\n\n assert foo(1, 2) == 'args=1, kwargs=2'\n\n with pytest.raises(ValidationError, match=r'apple\\s+Unexpected keyword argument'):\n foo(1, 2, apple=4)\n\n with pytest.raises(ValidationError) as exc_info:\n foo(1, 2, apple=4, banana=5)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'unexpected_keyword_argument', 'loc': ('apple',), 'msg': 'Unexpected keyword argument', 'input': 4},\n {'type': 'unexpected_keyword_argument', 'loc': ('banana',), 'msg': 'Unexpected keyword argument', 'input': 5},\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n foo(1, 2, 3)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'unexpected_positional_argument', 'loc': (2,), 'msg': 'Unexpected positional argument', '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_validate_call.py_test_v_args_test_v_args.assert_foo4_123_123": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_v_args_test_v_args.assert_foo4_123_123", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 285, "span_ids": ["test_v_args"], "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_v_args():\n @validate_call\n def foo1(v__args: int):\n return v__args\n\n assert foo1(123) == 123\n\n @validate_call\n def foo2(v__kwargs: int):\n return v__kwargs\n\n assert foo2(123) == 123\n\n @validate_call\n def foo3(v__positional_only: int):\n return v__positional_only\n\n assert foo3(123) == 123\n\n @validate_call\n def foo4(v__duplicate_kwargs: int):\n return v__duplicate_kwargs\n\n assert foo4(123) == 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_validate_call.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_validate_call.py_test_async_test_async.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 289, "end_line": 304, "span_ids": ["test_async"], "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_async():\n @validate_call\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing_argument', 'loc': ('b',), 'msg': 'Missing required argument', 'input': ArgsKwargs(('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_validate_call.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_validate_call.py_test_string_annotation_test_string_annotation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 307, "end_line": 326, "span_ids": ["test_string_annotation"], "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_string_annotation():\n @validate_call\n def foo(a: 'List[int]', b: 'float'):\n return f'a={a!r} b={b!r}'\n\n assert foo([1, 2, 3], 22) == 'a=[1, 2, 3] b=22.0'\n\n with pytest.raises(ValidationError) as exc_info:\n foo(['x'])\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': (0, 0),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'x',\n },\n {'type': 'missing_argument', 'loc': ('b',), 'msg': 'Missing required argument', 'input': ArgsKwargs((['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_validate_call.py_test_local_annotation_test_local_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_validate_call.py_test_local_annotation_test_local_annotation.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 329, "end_line": 349, "span_ids": ["test_local_annotation"], "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_local_annotation():\n ListInt = List[int]\n\n @validate_call\n def foo(a: ListInt):\n return f'a={a!r}'\n\n assert foo([1, 2, 3]) == 'a=[1, 2, 3]'\n\n with pytest.raises(ValidationError) as exc_info:\n foo(['x'])\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': (0, 0),\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_validate_call.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_validate_call.py_test_item_method_test_item_method.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 351, "end_line": 372, "span_ids": ["test_item_method"], "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_item_method():\n class X:\n def __init__(self, v):\n self.v = v\n\n @validate_call\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing_argument', 'loc': ('a',), 'msg': 'Missing required argument', 'input': ArgsKwargs((x,))},\n {'type': 'missing_argument', 'loc': ('b',), 'msg': 'Missing required argument', 'input': ArgsKwargs((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_validate_call.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_validate_call.py_test_class_method_test_class_method.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 372, "end_line": 391, "span_ids": ["test_class_method"], "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_class_method():\n class X:\n @classmethod\n @validate_call\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing_argument', 'loc': ('a',), 'msg': 'Missing required argument', 'input': ArgsKwargs((X,))},\n {'type': 'missing_argument', 'loc': ('b',), 'msg': 'Missing required argument', 'input': ArgsKwargs((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_validate_call.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_validate_call.py_test_annotated_use_of_alias_test_annotated_use_of_alias.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 459, "end_line": 485, "span_ids": ["test_annotated_use_of_alias"], "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_annotated_use_of_alias():\n @validate_call\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing_argument',\n 'loc': ('b',),\n 'msg': 'Missing required argument',\n 'input': ArgsKwargs((), {'a': 10, 'c': 12, 'd': 1}),\n },\n {\n 'type': 'missing_argument',\n 'loc': ('',),\n 'msg': 'Missing required argument',\n 'input': ArgsKwargs((), {'a': 10, 'c': 12, 'd': 1}),\n },\n {'type': 'unexpected_keyword_argument', 'loc': ('a',), 'msg': 'Unexpected keyword argument', 'input': 10},\n {'type': 'unexpected_keyword_argument', 'loc': ('d',), 'msg': 'Unexpected keyword argument', '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_validate_call.py_test_use_of_alias_test_populate_by_name.assert_foo_a_10_c_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_use_of_alias_test_populate_by_name.assert_foo_a_10_c_1_", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 488, "end_line": 504, "span_ids": ["test_use_of_alias", "test_populate_by_name"], "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_use_of_alias():\n @validate_call\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_call(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(b=10, d=1) == 11\n assert foo(a=10, d=1) == 11\n assert foo(b=10, c=1) == 11\n assert foo(a=10, c=1) == 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_validators.py_test_annotated_validator_wrap_test_annotated_validator_wrap.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_annotated_validator_wrap_test_annotated_validator_wrap.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": 91, "end_line": 119, "span_ids": ["test_annotated_validator_wrap"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_annotated_validator_wrap() -> None:\n def sixties_validator(val: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> date:\n if val == 'epoch':\n return date.fromtimestamp(0)\n newval = handler(val)\n if not date.fromisoformat('1960-01-01') <= newval < date.fromisoformat('1970-01-01'):\n raise ValueError(f'{val} is not in the sixties!')\n return newval\n\n SixtiesDateTime = Annotated[date, WrapValidator(sixties_validator)]\n\n class Model(BaseModel):\n x: SixtiesDateTime\n\n assert Model(x='epoch').x == date.fromtimestamp(0)\n assert Model(x='1962-01-13').x == date(year=1962, month=1, day=13)\n assert Model(x=datetime(year=1962, month=1, day=13)).x == date(year=1962, month=1, day=13)\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=date(year=1970, month=4, day=17))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('1970-04-17 is not in the sixties!')))},\n 'input': date(1970, 4, 17),\n 'loc': ('x',),\n 'msg': 'Value error, 1970-04-17 is not in the sixties!',\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.py_test_annotated_validator_nested_test_annotated_validator_nested.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_annotated_validator_nested_test_annotated_validator_nested.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": 122, "end_line": 146, "span_ids": ["test_annotated_validator_nested"], "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_annotated_validator_nested() -> None:\n MyInt = Annotated[int, AfterValidator(lambda x: x if x != -1 else 0)]\n\n def non_decreasing_list(data: List[int]) -> List[int]:\n for prev, cur in zip(data, data[1:]):\n assert cur >= prev\n return data\n\n class Model(BaseModel):\n x: Annotated[List[MyInt], AfterValidator(non_decreasing_list)]\n\n assert Model(x=[0, -1, 2]).x == [0, 0, 2]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=[0, -1, -2])\n\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('assert -2 >= 0')))},\n 'input': [0, -1, -2],\n 'loc': ('x',),\n 'msg': 'Assertion failed, assert -2 >= 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.py_test_annotated_validator_runs_before_field_validators_test_annotated_validator_typing_cache.assert_FancyIntModel_x_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_runs_before_field_validators_test_annotated_validator_typing_cache.assert_FancyIntModel_x_0_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 122, "end_line": 153, "span_ids": ["test_annotated_validator_typing_cache", "test_annotated_validator_runs_before_field_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_annotated_validator_runs_before_field_validators() -> None:\n MyInt = Annotated[int, AfterValidator(lambda x: x if x != -1 else 0)]\n\n class Model(BaseModel):\n x: MyInt\n\n @field_validator('x')\n def val_x(cls, v: int) -> int:\n assert v != -1\n return v\n\n assert Model(x=-1).x == 0\n\n\n@pytest.mark.parametrize(\n 'validator, func',\n [\n (PlainValidator, lambda x: x if x != -1 else 0),\n (WrapValidator, lambda x, nxt: x if x != -1 else 0),\n (BeforeValidator, lambda x: x if x != -1 else 0),\n (AfterValidator, lambda x: x if x != -1 else 0),\n ],\n)\ndef test_annotated_validator_typing_cache(validator, func):\n FancyInt = Annotated[int, validator(func)]\n\n class FancyIntModel(BaseModel):\n x: Optional[FancyInt]\n\n assert FancyIntModel(x=1234).x == 1234\n assert FancyIntModel(x=-1).x == 0\n assert FancyIntModel(x=0).x == 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_validators.py_test_simple_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_test_simple_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": 183, "end_line": 206, "span_ids": ["test_simple"], "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_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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('\"foobar\" not found in a')))},\n 'input': 'snap',\n 'loc': ('a',),\n 'msg': 'Value error, \"foobar\" not found in a',\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.py_test_root_validator_subclass_test_root_validator_subclass.assert_Child3_x_1_expect": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_subclass_test_root_validator_subclass.assert_Child3_x_1_expect", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1381, "end_line": 1420, "span_ids": ["test_root_validator_subclass"], "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_root_validator_subclass():\n \"\"\"\n https://github.com/pydantic/pydantic/issues/5388\n \"\"\"\n\n class Parent(BaseModel):\n x: int\n expected: Any\n with pytest.warns(PydanticDeprecatedSince20):\n\n @root_validator(skip_on_failure=True)\n @classmethod\n def root_val(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n assert cls is values['expected']\n return values\n\n class Child1(Parent):\n pass\n\n class Child2(Parent):\n with pytest.warns(PydanticDeprecatedSince20):\n\n @root_validator(skip_on_failure=True)\n @classmethod\n def root_val(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n assert cls is Child2\n values['x'] = values['x'] * 2\n return values\n\n class Child3(Parent):\n @classmethod\n def root_val(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n assert cls is Child3\n values['x'] = values['x'] * 3\n return values\n\n assert Parent(x=1, expected=Parent).x == 1\n assert Child1(x=1, expected=Child1).x == 1\n assert Child2(x=1, expected=Child2).x == 2\n assert Child3(x=1, expected=Child3).x == 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_nested_literal_validator_test_nested_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_nested_literal_validator_test_nested_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": 1646, "end_line": 1665, "span_ids": ["test_nested_literal_validator"], "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_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(include_url=False) == [\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 ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_test_model_config_validate_default.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_model_config_validate_default_test_model_config_validate_default.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": 2116, "end_line": 2141, "span_ids": ["test_model_config_validate_default"], "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_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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('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.py_partial_val_func1_test_functools_partialmethod_validator_v2.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_partial_val_func1_test_functools_partialmethod_validator_v2.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2144, "end_line": 2300, "span_ids": ["partial_cls_values_val_func2", "partial_cls_val_func2", "partial_val_func2", "partial_values_val_func2", "partial_info_val_func", "partial_val_func1", "test_functools_partialmethod_validator_v2", "partial_cls_values_val_func1", "partial_cls_val_func1", "test_functools_partial_validator_v2", "partial_values_val_func1", "partial_cls_info_val_func"], "tokens": 714}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def partial_val_func1(\n value: int,\n allowed: int,\n) -> int:\n assert value == allowed\n return value\n\n\ndef partial_val_func2(\n value: int,\n *,\n allowed: int,\n) -> int:\n assert value == allowed\n return value\n\n\ndef partial_values_val_func1(\n value: int,\n values: Dict[str, Any],\n *,\n allowed: int,\n) -> int:\n assert isinstance(values, dict)\n assert value == allowed\n return value\n\n\ndef partial_values_val_func2(\n value: int,\n *,\n values: Dict[str, Any],\n allowed: int,\n) -> int:\n assert isinstance(values, dict)\n assert value == allowed\n return value\n\n\ndef partial_info_val_func(\n value: int,\n info: ValidationInfo,\n *,\n allowed: int,\n) -> int:\n assert isinstance(info.data, dict)\n assert value == allowed\n return value\n\n\ndef partial_cls_val_func1(\n cls: Any,\n value: int,\n allowed: int,\n expected_cls: Any,\n) -> int:\n assert cls.__name__ == expected_cls\n assert value == allowed\n return value\n\n\ndef partial_cls_val_func2(\n cls: Any,\n value: int,\n *,\n allowed: int,\n expected_cls: Any,\n) -> int:\n assert cls.__name__ == expected_cls\n assert value == allowed\n return value\n\n\ndef partial_cls_values_val_func1(\n cls: Any,\n value: int,\n values: Dict[str, Any],\n *,\n allowed: int,\n expected_cls: Any,\n) -> int:\n assert cls.__name__ == expected_cls\n assert isinstance(values, dict)\n assert value == allowed\n return value\n\n\ndef partial_cls_values_val_func2(\n cls: Any,\n value: int,\n *,\n values: Dict[str, Any],\n allowed: int,\n expected_cls: Any,\n) -> int:\n assert cls.__name__ == expected_cls\n assert isinstance(values, dict)\n assert value == allowed\n return value\n\n\ndef partial_cls_info_val_func(\n cls: Any,\n value: int,\n info: ValidationInfo,\n *,\n allowed: int,\n expected_cls: Any,\n) -> int:\n assert cls.__name__ == expected_cls\n assert isinstance(info.data, dict)\n assert value == allowed\n return value\n\n\n@pytest.mark.parametrize(\n 'func',\n [\n partial_val_func1,\n partial_val_func2,\n partial_info_val_func,\n ],\n)\ndef test_functools_partial_validator_v2(\n func: Callable[..., Any],\n) -> None:\n class Model(BaseModel):\n x: int\n\n val = field_validator('x')(partial(func, allowed=42))\n\n Model(x=42)\n\n with pytest.raises(ValidationError):\n Model(x=123)\n\n\n@pytest.mark.parametrize(\n 'func',\n [\n partial_val_func1,\n partial_val_func2,\n partial_info_val_func,\n ],\n)\ndef test_functools_partialmethod_validator_v2(\n func: Callable[..., Any],\n) -> None:\n class Model(BaseModel):\n x: int\n\n val = field_validator('x')(partialmethod(func, allowed=42))\n\n Model(x=42)\n\n with pytest.raises(ValidationError):\n Model(x=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_functools_partialmethod_validator_v2_cls_method_test_functools_partialmethod_validator_v2_cls_method.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partialmethod_validator_v2_cls_method_test_functools_partialmethod_validator_v2_cls_method.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2176, "end_line": 2198, "span_ids": ["test_functools_partialmethod_validator_v2_cls_method"], "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.parametrize(\n 'func',\n [\n partial_cls_val_func1,\n partial_cls_val_func2,\n partial_cls_info_val_func,\n ],\n)\ndef test_functools_partialmethod_validator_v2_cls_method(\n func: Callable[..., Any],\n) -> None:\n class Model(BaseModel):\n x: int\n\n # note that you _have_ to wrap your function with classmethod\n # it's partialmethod not us that requires it\n # otherwise it creates a bound instance method\n val = field_validator('x')(partialmethod(classmethod(func), allowed=42, expected_cls='Model'))\n\n Model(x=42)\n\n with pytest.raises(ValidationError):\n Model(x=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_functools_partial_validator_v1_test_functools_partial_validator_v1.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partial_validator_v1_test_functools_partial_validator_v1.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2328, "end_line": 2350, "span_ids": ["test_functools_partial_validator_v1"], "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 'func',\n [\n partial_val_func1,\n partial_val_func2,\n partial_values_val_func1,\n partial_values_val_func2,\n ],\n)\ndef test_functools_partial_validator_v1(\n func: Callable[..., Any],\n) -> None:\n with pytest.warns(PydanticDeprecatedSince20, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n x: int\n\n val = validator('x')(partial(func, allowed=42))\n\n Model(x=42)\n\n with pytest.raises(ValidationError):\n Model(x=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_functools_partialmethod_validator_v1_cls_method_test_functools_partialmethod_validator_v1_cls_method.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partialmethod_validator_v1_cls_method_test_functools_partialmethod_validator_v1_cls_method.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2378, "end_line": 2403, "span_ids": ["test_functools_partialmethod_validator_v1_cls_method"], "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 'func',\n [\n partial_cls_val_func1,\n partial_cls_val_func2,\n partial_cls_values_val_func1,\n partial_cls_values_val_func2,\n ],\n)\ndef test_functools_partialmethod_validator_v1_cls_method(\n func: Callable[..., Any],\n) -> None:\n with pytest.warns(PydanticDeprecatedSince20, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n x: int\n\n # note that you _have_ to wrap your function with classmethod\n # it's partialmethod not us that requires it\n # otherwise it creates a bound instance method\n val = validator('x')(partialmethod(classmethod(func), allowed=42, expected_cls='Model'))\n\n Model(x=42)\n\n with pytest.raises(ValidationError):\n Model(x=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_validator_allow_reuse_inheritance_test_validator_allow_reuse_inheritance.assert_Child_x_1_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_inheritance_test_validator_allow_reuse_inheritance.assert_Child_x_1_model_d", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2279, "end_line": 2296, "span_ids": ["test_validator_allow_reuse_inheritance"], "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_validator_allow_reuse_inheritance():\n class Parent(BaseModel):\n x: int\n\n @field_validator('x')\n def val(cls, v: int) -> int:\n return v + 1\n\n class Child(Parent):\n @field_validator('x')\n def val(cls, v: int) -> int:\n assert v == 1\n v = super().val(v)\n assert v == 2\n return 4\n\n assert Parent(x=1).model_dump() == {'x': 2}\n assert Child(x=1).model_dump() == {'x': 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_validator_allow_reuse_same_field_test_validator_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_same_field_test_validator_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2426, "end_line": 2440, "span_ids": ["test_validator_allow_reuse_same_field"], "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_validator_allow_reuse_same_field():\n with pytest.warns(UserWarning, match='`val_x` overrides an existing Pydantic `@field_validator` decorator'):\n\n class Model(BaseModel):\n x: int\n\n @field_validator('x')\n def val_x(cls, v: int) -> int:\n return v + 1\n\n @field_validator('x')\n def val_x(cls, v: int) -> int:\n return v + 2\n\n assert Model(x=1).model_dump() == {'x': 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_validator_allow_reuse_different_field_1_test_validator_allow_reuse_different_field_1.assert_Model_x_1_y_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_different_field_1_test_validator_allow_reuse_different_field_1.assert_Model_x_1_y_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": 2443, "end_line": 2458, "span_ids": ["test_validator_allow_reuse_different_field_1"], "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_validator_allow_reuse_different_field_1():\n with pytest.warns(UserWarning, match='`val` overrides an existing Pydantic `@field_validator` decorator'):\n\n class Model(BaseModel):\n x: int\n y: int\n\n @field_validator('x')\n def val(cls, v: int) -> int:\n return v + 1\n\n @field_validator('y')\n def val(cls, v: int) -> int:\n return v + 2\n\n assert Model(x=1, y=2).model_dump() == {'x': 1, 'y': 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_validator_allow_reuse_different_field_2_test_validator_allow_reuse_different_field_2.assert_Model_x_1_y_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_different_field_2_test_validator_allow_reuse_different_field_2.assert_Model_x_1_y_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": 2461, "end_line": 2477, "span_ids": ["test_validator_allow_reuse_different_field_2"], "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_validator_allow_reuse_different_field_2():\n with pytest.warns(UserWarning, match='`val_x` overrides an existing Pydantic `@field_validator` decorator'):\n\n def val(cls: Any, v: int) -> int:\n return v + 2\n\n class Model(BaseModel):\n x: int\n y: int\n\n @field_validator('x')\n def val_x(cls, v: int) -> int:\n return v + 1\n\n val_x = field_validator('y')(val)\n\n assert Model(x=1, y=2).model_dump() == {'x': 1, 'y': 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_validator_allow_reuse_different_field_3_test_validator_allow_reuse_different_field_4.assert_Model_x_1_y_2_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_allow_reuse_different_field_3_test_validator_allow_reuse_different_field_4.assert_Model_x_1_y_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": 2353, "end_line": 2383, "span_ids": ["test_validator_allow_reuse_different_field_4", "test_validator_allow_reuse_different_field_3"], "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_validator_allow_reuse_different_field_3():\n with pytest.warns(UserWarning, match='`val_x` overrides an existing Pydantic `@field_validator` decorator'):\n\n def val1(v: int) -> int:\n return v + 1\n\n def val2(v: int) -> int:\n return v + 2\n\n class Model(BaseModel):\n x: int\n y: int\n\n val_x = field_validator('x')(val1)\n val_x = field_validator('y')(val2)\n\n assert Model(x=1, y=2).model_dump() == {'x': 1, 'y': 4}\n\n\ndef test_validator_allow_reuse_different_field_4():\n def val(v: int) -> int:\n return v + 1\n\n class Model(BaseModel):\n x: int\n y: int\n\n val_x = field_validator('x')(val)\n not_val_x = field_validator('y')(val)\n\n assert Model(x=1, y=2).model_dump() == {'x': 2, 'y': 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_allow_reuse_same_field_test_root_validator_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_allow_reuse_same_field_test_root_validator_allow_reuse_same_field.with_pytest_warns_UserWar.assert_Model_x_1_model_d", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2513, "end_line": 2529, "span_ids": ["test_root_validator_allow_reuse_same_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": "def test_root_validator_allow_reuse_same_field():\n with pytest.warns(UserWarning, match='`root_val` overrides an existing Pydantic `@root_validator` decorator'):\n\n class Model(BaseModel):\n x: int\n\n @root_validator(skip_on_failure=True)\n def root_val(cls, v: Dict[str, Any]) -> Dict[str, Any]:\n v['x'] += 1\n return v\n\n @root_validator(skip_on_failure=True)\n def root_val(cls, v: Dict[str, Any]) -> Dict[str, Any]:\n v['x'] += 2\n return v\n\n assert Model(x=1).model_dump() == {'x': 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_dataclass.py_from_dataclasses_import_a_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_from_dataclasses_import_a_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": 21, "span_ids": ["imports", "test_simple"], "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": "from dataclasses import asdict, is_dataclass\nfrom typing import Any, List\n\nimport pytest\nfrom dirty_equals import HasRepr\n\nfrom pydantic import ValidationError, field_validator, model_validator\nfrom pydantic.dataclasses import dataclass\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/pydantic/_internal/_core_utils.py_collect_invalid_schemas_Walk.Callable_core_schema_Cor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_collect_invalid_schemas_Walk.Callable_core_schema_Cor", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 178, "span_ids": ["impl:19", "collect_invalid_schemas"], "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 collect_invalid_schemas(schema: core_schema.CoreSchema) -> bool:\n invalid = False\n\n def _is_schema_valid(s: core_schema.CoreSchema, recurse: Recurse) -> core_schema.CoreSchema:\n nonlocal invalid\n if 'metadata' in s:\n metadata = s['metadata']\n if HAS_INVALID_SCHEMAS_METADATA_KEY in metadata:\n invalid = metadata[HAS_INVALID_SCHEMAS_METADATA_KEY]\n return s\n return recurse(s, _is_schema_valid)\n\n walk_core_schema(schema, _is_schema_valid)\n return invalid\n\n\nT = TypeVar('T')\n\n\nRecurse = Callable[[core_schema.CoreSchema, 'Walk'], core_schema.CoreSchema]\nWalk = Callable[[core_schema.CoreSchema, Recurse], core_schema.CoreSchema]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__WalkCoreSchema.handle_definitions_schema__WalkCoreSchema.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__WalkCoreSchema.handle_definitions_schema__WalkCoreSchema.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": 254, "span_ids": ["_WalkCoreSchema.handle_definitions_schema"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _WalkCoreSchema:\n\n def handle_definitions_schema(self, schema: core_schema.DefinitionsSchema, f: Walk) -> core_schema.CoreSchema:\n new_definitions: list[core_schema.CoreSchema] = []\n for definition in schema['definitions']:\n if 'schema_ref' in definition and 'ref' in definition:\n # This indicates a purposely indirect reference\n # We want to keep such references around for implications related to JSON schema, etc.:\n new_definitions.append(definition)\n # However, we still need to walk the referenced definition:\n self.walk(definition, f)\n continue\n\n updated_definition = self.walk(definition, f)\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'], f)\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__WalkCoreSchema.handle_arguments_schema__WalkCoreSchema.handle_call_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__WalkCoreSchema.handle_arguments_schema__WalkCoreSchema.handle_call_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": 391, "end_line": 408, "span_ids": ["_WalkCoreSchema.handle_arguments_schema", "_WalkCoreSchema.handle_call_schema"], "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 _WalkCoreSchema:\n\n def handle_arguments_schema(self, schema: core_schema.ArgumentsSchema, f: Walk) -> core_schema.CoreSchema:\n replaced_arguments_schema: list[core_schema.ArgumentsParameter] = []\n for param in schema['arguments_schema']:\n replaced_param = param.copy()\n replaced_param['schema'] = self.walk(param['schema'], f)\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'], f)\n if 'var_kwargs_schema' in schema:\n schema['var_kwargs_schema'] = self.walk(schema['var_kwargs_schema'], f)\n return schema\n\n def handle_call_schema(self, schema: core_schema.CallSchema, f: Walk) -> core_schema.CoreSchema:\n schema['arguments_schema'] = self.walk(schema['arguments_schema'], f)\n if 'return_schema' in schema:\n schema['return_schema'] = self.walk(schema['return_schema'], f)\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__dispatch_walk_core_schema.return.f_schema_copy__dispatc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__dispatch_walk_core_schema.return.f_schema_copy__dispatc", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 397, "end_line": 414, "span_ids": ["walk_core_schema", "impl:25"], "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": "_dispatch = _WalkCoreSchema().walk\n\n\ndef walk_core_schema(schema: core_schema.CoreSchema, f: Walk) -> core_schema.CoreSchema:\n \"\"\"Recursively traverse a CoreSchema.\n\n Args:\n schema (core_schema.CoreSchema): The CoreSchema to process, it will not be modified.\n f (Walk): A function to apply. This function takes two arguments:\n 1. The current CoreSchema that is being processed\n (not the same one you passed into this function, one level down).\n 2. The \"next\" `f` to call. This lets you for example use `f=functools.partial(some_method, some_context)`\n to pass data down the recursive calls without using globals or other mutable state.\n\n Returns:\n core_schema.CoreSchema: A processed CoreSchema.\n \"\"\"\n return f(schema.copy(), _dispatch)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_model_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_model_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_model_choice__ApplyInferredDiscriminator._infer_discriminator_values_for_model_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": 306, "end_line": 315, "span_ids": ["_ApplyInferredDiscriminator._infer_discriminator_values_for_model_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_model_choice(\n self, choice: core_schema.ModelFieldsSchema, source_name: str | None = None\n ) -> list[str | int]:\n source = 'ModelFields' 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(\n f'{source} needs a discriminator field for key {self.discriminator!r}', code='discriminator-no-field'\n )\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/_generate_schema.py_GenerateSchema._generate_md_field_schema_GenerateSchema._generate_md_field_schema.return.core_schema_model_field_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_md_field_schema_GenerateSchema._generate_md_field_schema.return.core_schema_model_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": 522, "end_line": 537, "span_ids": ["GenerateSchema._generate_md_field_schema"], "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 GenerateSchema:\n\n def _generate_md_field_schema(\n self,\n name: str,\n field_info: FieldInfo,\n decorators: DecoratorInfos,\n ) -> core_schema.ModelField:\n \"\"\"Prepare a ModelField to represent a model field.\"\"\"\n common_field = self._common_field_schema(name, field_info, decorators)\n return core_schema.model_field(\n common_field['schema'],\n serialization_exclude=common_field['serialization_exclude'],\n validation_alias=common_field['validation_alias'],\n serialization_alias=common_field['serialization_alias'],\n frozen=common_field['frozen'],\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._get_wrapped_inner_schema_GenerateSchema._get_wrapped_inner_schema.return.CallbackGetCoreSchemaHand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._get_wrapped_inner_schema_GenerateSchema._get_wrapped_inner_schema.return.CallbackGetCoreSchemaHand", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1727, "end_line": 1747, "span_ids": ["GenerateSchema._get_wrapped_inner_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 GenerateSchema:\n\n def _get_wrapped_inner_schema(\n self,\n get_inner_schema: GetCoreSchemaHandler,\n annotation: Any,\n pydantic_js_annotation_functions: list[GetJsonSchemaFunction],\n ) -> CallbackGetCoreSchemaHandler:\n metadata_get_schema: GetCoreSchemaFunction = getattr(annotation, '__get_pydantic_core_schema__', None) or (\n lambda source, handler: handler(source)\n )\n\n def new_handler(source: Any) -> core_schema.CoreSchema:\n schema = metadata_get_schema(source, get_inner_schema)\n schema = self._apply_single_annotation(schema, annotation)\n schema = self._apply_single_annotation_json_schema(schema, annotation)\n\n metadata_js_function = _extract_get_pydantic_json_schema(annotation, schema)\n if metadata_js_function is not None:\n pydantic_js_annotation_functions.append(metadata_js_function)\n return schema\n\n return CallbackGetCoreSchemaHandler(new_handler, 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/_generate_schema.py__extract_get_pydantic_json_schema__extract_get_pydantic_json_schema.return.js_modify_function": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__extract_get_pydantic_json_schema__extract_get_pydantic_json_schema.return.js_modify_function", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2111, "end_line": 2139, "span_ids": ["_extract_get_pydantic_json_schema"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _extract_get_pydantic_json_schema(tp: Any, schema: CoreSchema) -> GetJsonSchemaFunction | None:\n \"\"\"Extract `__get_pydantic_json_schema__` from a type, handling the deprecated `__modify_schema__`.\"\"\"\n js_modify_function = getattr(tp, '__get_pydantic_json_schema__', None)\n\n if hasattr(tp, '__modify_schema__'):\n from pydantic import BaseModel # circular reference\n\n has_custom_v2_modify_js_func = (\n js_modify_function is not None\n and BaseModel.__get_pydantic_json_schema__.__func__ # type: ignore\n not in (js_modify_function, getattr(js_modify_function, '__func__', None))\n )\n\n if not has_custom_v2_modify_js_func:\n cls_name = getattr(tp, '__name__', None)\n raise PydanticUserError(\n f'The `__modify_schema__` method is not supported in Pydantic v2. '\n f'Use `__get_pydantic_json_schema__` instead{f\" in class `{cls_name}`\" if cls_name else \"\"}.',\n code='custom-json-schema',\n )\n\n # handle GenericAlias' but ignore Annotated which \"lies\" about its origin (in this case it would be `int`)\n if hasattr(tp, '__origin__') and not isinstance(tp, type(Annotated[int, 'placeholder'])):\n return _extract_get_pydantic_json_schema(tp.__origin__, schema)\n\n if js_modify_function is None:\n return None\n\n return 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/_known_annotated_metadata.py_collect_known_metadata_collect_known_metadata.return.res_remaining": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_collect_known_metadata_collect_known_metadata.return.res_remaining", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 391, "span_ids": ["collect_known_metadata"], "tokens": 551}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_known_metadata(annotations: Iterable[Any]) -> tuple[dict[str, Any], list[Any]]:\n \"\"\"Split `annotations` into known metadata and unknown annotations.\n\n Args:\n annotations: An iterable of annotations.\n\n Returns:\n A tuple contains a dict of known metadata and a list of unknown annotations.\n\n Example:\n ```py\n from annotated_types import Gt, Len\n\n from pydantic._internal._known_annotated_metadata import collect_known_metadata\n\n print(collect_known_metadata([Gt(1), Len(42), ...]))\n #> ({'gt': 1, 'min_length': 42}, [Ellipsis])\n ```\n \"\"\"\n import annotated_types as at\n\n annotations = expand_grouped_metadata(annotations)\n\n res: dict[str, Any] = {}\n remaining: list[Any] = []\n for annotation in annotations:\n # isinstance(annotation, PydanticMetadata) also covers ._fields:_PydanticGeneralMetadata\n if isinstance(annotation, PydanticMetadata):\n res.update(annotation.__dict__)\n # we don't use dataclasses.asdict because that recursively calls asdict on the field values\n elif isinstance(annotation, at.MinLen):\n res.update({'min_length': annotation.min_length})\n elif isinstance(annotation, at.MaxLen):\n res.update({'max_length': annotation.max_length})\n elif isinstance(annotation, at.Gt):\n res.update({'gt': annotation.gt})\n elif isinstance(annotation, at.Ge):\n res.update({'ge': annotation.ge})\n elif isinstance(annotation, at.Lt):\n res.update({'lt': annotation.lt})\n elif isinstance(annotation, at.Le):\n res.update({'le': annotation.le})\n elif isinstance(annotation, at.MultipleOf):\n res.update({'multiple_of': annotation.multiple_of})\n elif isinstance(annotation, type) and issubclass(annotation, PydanticMetadata):\n # also support PydanticMetadata classes being used without initialisation,\n # e.g. `Annotated[int, Strict]` as well as `Annotated[int, Strict()]`\n res.update({k: v for k, v in vars(annotation).items() if not k.startswith('_')})\n else:\n remaining.append(annotation)\n # Nones can sneak in but pydantic-core will reject them\n # it'd be nice to clean things up so we don't put in None (we probably don't _need_ to, it was just easier)\n # but this is simple enough to kick that can down the road\n res = {k: v for k, v in res.items() if v is not None}\n return res, remaining", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_known_annotated_metadata.py_check_metadata_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_check_metadata_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 224, "end_line": 241, "span_ids": ["check_metadata"], "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 check_metadata(metadata: dict[str, Any], allowed: Iterable[str], source_type: Any) -> None:\n \"\"\"A small utility function to validate that the given metadata can be applied to the target.\n More than saving lines of code, this gives us a consistent error message for all of our internal implementations.\n\n Args:\n metadata: A dict of metadata.\n allowed: An iterable of allowed metadata.\n source_type: The source type.\n\n Raises:\n TypeError: If there is metadatas that can't be applied on source type.\n \"\"\"\n unknown = metadata.keys() - set(allowed)\n if unknown:\n raise TypeError(\n f'The following constraints cannot be applied to {source_type!r}: {\", \".join([f\"{k!r}\" for k in unknown])}'\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_prepare_pydantic_annotations_path_schema_prepare_pydantic_annotations.return._": {"__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_prepare_pydantic_annotations_path_schema_prepare_pydantic_annotations.return._", "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": 213, "end_line": 272, "span_ids": ["path_schema_prepare_pydantic_annotations"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def path_schema_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n import pathlib\n\n if source_type not in {\n os.PathLike,\n pathlib.Path,\n pathlib.PurePath,\n pathlib.PosixPath,\n pathlib.PurePosixPath,\n pathlib.PureWindowsPath,\n }:\n return None\n\n metadata, remaining_annotations = _known_annotated_metadata.collect_known_metadata(annotations)\n _known_annotated_metadata.check_metadata(metadata, _known_annotated_metadata.STR_CONSTRAINTS, source_type)\n\n construct_path = pathlib.PurePath if source_type is os.PathLike else source_type\n\n def path_validator(input_value: str) -> os.PathLike[Any]:\n try:\n return construct_path(input_value)\n except TypeError as e:\n raise PydanticCustomError('path_type', 'Input is not a valid path') from e\n\n constrained_str_schema = core_schema.str_schema(**metadata)\n\n instance_schema = core_schema.json_or_python_schema(\n json_schema=core_schema.no_info_after_validator_function(path_validator, constrained_str_schema),\n python_schema=core_schema.is_instance_schema(source_type),\n )\n\n strict: bool | None = None\n for annotation in annotations:\n if isinstance(annotation, Strict):\n strict = annotation.strict\n\n schema = core_schema.lax_or_strict_schema(\n lax_schema=core_schema.union_schema(\n [\n instance_schema,\n core_schema.no_info_after_validator_function(path_validator, constrained_str_schema),\n ],\n custom_error_type='path_type',\n custom_error_message='Input is not a valid path',\n strict=True,\n ),\n strict_schema=instance_schema,\n serialization=core_schema.to_string_ser_schema(),\n strict=strict,\n )\n\n return (\n source_type,\n [\n InnerSchemaValidator(schema, js_core_schema=constrained_str_schema, js_schema_update={'format': 'path'}),\n *remaining_annotations,\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_dequeue_validator_dequeue_validator.if_isinstance_input_value.else_.return.collections_deque_handler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_dequeue_validator_dequeue_validator.if_isinstance_input_value.else_.return.collections_deque_handler", "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": 455, "end_line": 464, "span_ids": ["dequeue_validator"], "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 dequeue_validator(\n input_value: Any, handler: core_schema.ValidatorFunctionWrapHandler, maxlen: None | int\n) -> collections.deque[Any]:\n if isinstance(input_value, collections.deque):\n maxlens = [v for v in (input_value.maxlen, maxlen) if v is not None]\n if maxlens:\n maxlen = min(maxlens)\n return collections.deque(handler(input_value), maxlen=maxlen)\n else:\n return collections.deque(handler(input_value), maxlen=maxlen)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_SequenceValidator_SequenceValidator.serialize_sequence_via_list.if_info_mode_is_json_.else_.return.self_mapped_origin_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SequenceValidator_SequenceValidator.serialize_sequence_via_list.if_info_mode_is_json_.else_.return.self_mapped_origin_items_", "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": 287, "end_line": 310, "span_ids": ["SequenceValidator", "SequenceValidator.serialize_sequence_via_list"], "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": "@dataclasses.dataclass(**slots_true)\nclass SequenceValidator:\n mapped_origin: type[Any]\n item_source_type: type[Any]\n min_length: int | None = None\n max_length: int | None = None\n strict: bool = False\n\n def serialize_sequence_via_list(\n self, v: Any, handler: core_schema.SerializerFunctionWrapHandler, info: core_schema.SerializationInfo\n ) -> Any:\n items: list[Any] = []\n for index, item in enumerate(v):\n try:\n v = handler(item, index)\n except PydanticOmit:\n pass\n else:\n items.append(v)\n\n if info.mode_is_json():\n return items\n else:\n return self.mapped_origin(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_SequenceValidator.__get_pydantic_core_schema___SequenceValidator.__get_pydantic_core_schema__.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SequenceValidator.__get_pydantic_core_schema___SequenceValidator.__get_pydantic_core_schema__.return.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": 312, "end_line": 365, "span_ids": ["SequenceValidator.__get_pydantic_core_schema__"], "tokens": 519}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclasses.dataclass(**slots_true)\nclass SequenceValidator:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n if self.item_source_type is Any:\n items_schema = None\n else:\n items_schema = handler.generate_schema(self.item_source_type)\n\n metadata = {'min_length': self.min_length, 'max_length': self.max_length, 'strict': self.strict}\n\n if self.mapped_origin in (list, set, frozenset):\n if self.mapped_origin is list:\n constrained_schema = core_schema.list_schema(items_schema, **metadata)\n elif self.mapped_origin is set:\n constrained_schema = core_schema.set_schema(items_schema, **metadata)\n else:\n assert self.mapped_origin is frozenset # safety check in case we forget to add a case\n constrained_schema = core_schema.frozenset_schema(items_schema, **metadata)\n\n schema = constrained_schema\n else:\n # safety check in case we forget to add a case\n assert self.mapped_origin in (collections.deque, collections.Counter)\n\n if self.mapped_origin is collections.deque:\n # if we have a MaxLen annotation might as well set that as the default maxlen on the deque\n # this lets us re-use existing metadata annotations to let users set the maxlen on a dequeue\n # that e.g. comes from JSON\n coerce_instance_wrap = partial(\n core_schema.no_info_wrap_validator_function,\n partial(dequeue_validator, maxlen=metadata.get('max_length', None)),\n )\n else:\n coerce_instance_wrap = partial(core_schema.no_info_after_validator_function, self.mapped_origin)\n\n constrained_schema = core_schema.list_schema(items_schema, **metadata)\n\n check_instance = core_schema.json_or_python_schema(\n json_schema=core_schema.list_schema(),\n python_schema=core_schema.is_instance_schema(self.mapped_origin),\n )\n\n serialization = core_schema.wrap_serializer_function_ser_schema(\n self.serialize_sequence_via_list, schema=items_schema or core_schema.any_schema(), info_arg=True\n )\n\n strict = core_schema.chain_schema([check_instance, coerce_instance_wrap(constrained_schema)])\n\n if metadata.get('strict', False):\n schema = strict\n else:\n lax = coerce_instance_wrap(constrained_schema)\n schema = core_schema.lax_or_strict_schema(lax_schema=lax, strict_schema=strict)\n schema['serialization'] = serialization\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/_std_types_schema.py_SEQUENCE_ORIGIN_MAP_identity.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SEQUENCE_ORIGIN_MAP_identity.return.s", "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": 573, "end_line": 594, "span_ids": ["impl:4", "identity"], "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": "SEQUENCE_ORIGIN_MAP: dict[Any, Any] = {\n typing.Deque: collections.deque,\n collections.deque: collections.deque,\n list: list,\n typing.List: list,\n set: set,\n typing.AbstractSet: set,\n typing.Set: set,\n frozenset: frozenset,\n typing.FrozenSet: frozenset,\n typing.Sequence: list,\n typing.MutableSequence: list,\n typing.MutableSet: set,\n # this doesn't handle subclasses of these\n # parametrized typing.Set creates one of these\n collections.abc.MutableSet: set,\n collections.abc.Set: frozenset,\n}\n\n\ndef identity(s: CoreSchema) -> CoreSchema:\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/_std_types_schema.py_MAPPING_ORIGIN_MAP_defaultdict_validator.if_isinstance_input_value.else_.return.collections_defaultdict_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_MAPPING_ORIGIN_MAP_defaultdict_validator.if_isinstance_input_value.else_.return.collections_defaultdict_d", "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": 416, "end_line": 441, "span_ids": ["defaultdict_validator", "impl:6"], "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": "MAPPING_ORIGIN_MAP: dict[Any, Any] = {\n typing.DefaultDict: collections.defaultdict,\n collections.defaultdict: collections.defaultdict,\n collections.OrderedDict: collections.OrderedDict,\n typing_extensions.OrderedDict: collections.OrderedDict,\n dict: dict,\n typing.Dict: dict,\n collections.Counter: collections.Counter,\n typing.Counter: collections.Counter,\n # this doesn't handle subclasses of these\n typing.Mapping: dict,\n typing.MutableMapping: dict,\n # parametrized typing.{Mutable}Mapping creates one of these\n collections.abc.MutableMapping: dict,\n collections.abc.Mapping: dict,\n}\n\n\ndef defaultdict_validator(\n input_value: Any, handler: core_schema.ValidatorFunctionWrapHandler, default_default_factory: Callable[[], Any]\n) -> collections.defaultdict[Any, Any]:\n if isinstance(input_value, collections.defaultdict):\n default_factory = input_value.default_factory\n return collections.defaultdict(default_factory, handler(input_value))\n else:\n return collections.defaultdict(default_default_factory, handler(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/_std_types_schema.py_get_defaultdict_default_default_factory_get_defaultdict_default_default_factory.return.default_default_factory": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_get_defaultdict_default_default_factory_get_defaultdict_default_default_factory.return.default_default_factory", "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": 444, "end_line": 498, "span_ids": ["get_defaultdict_default_default_factory"], "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": "def get_defaultdict_default_default_factory(values_source_type: Any) -> Callable[[], Any]:\n def infer_default() -> Callable[[], Any]:\n allowed_default_types: dict[Any, Any] = {\n typing.Tuple: tuple,\n tuple: tuple,\n collections.abc.Sequence: tuple,\n collections.abc.MutableSequence: list,\n typing.List: list,\n list: list,\n typing.Sequence: list,\n typing.Set: set,\n set: set,\n typing.MutableSet: set,\n collections.abc.MutableSet: set,\n collections.abc.Set: frozenset,\n typing.MutableMapping: dict,\n typing.Mapping: dict,\n collections.abc.Mapping: dict,\n collections.abc.MutableMapping: dict,\n float: float,\n int: int,\n str: str,\n bool: bool,\n }\n values_type_origin = get_origin(values_source_type) or values_source_type\n instructions = 'set using `DefaultDict[..., Annotated[..., Field(default_factory=...)]]`'\n if isinstance(values_type_origin, TypeVar):\n\n def type_var_default_factory() -> None:\n raise RuntimeError(\n 'Generic defaultdict cannot be used without a concrete value type or an'\n ' explicit default factory, ' + instructions\n )\n\n return type_var_default_factory\n elif values_type_origin not in allowed_default_types:\n # a somewhat subjective set of types that have reasonable default values\n allowed_msg = ', '.join([t.__name__ for t in set(allowed_default_types.values())])\n raise PydanticSchemaGenerationError(\n f'Unable to infer a default factory for keys of type {values_source_type}.'\n f' Only {allowed_msg} are supported, other types require an explicit default factory'\n ' ' + instructions\n )\n return allowed_default_types[values_type_origin]\n\n # Assume Annotated[..., Field(...)]\n if _typing_extra.is_annotated(values_source_type):\n field_info = next((v for v in get_args(values_source_type) if isinstance(v, FieldInfo)), None)\n else:\n field_info = None\n if field_info and field_info.default_factory:\n default_default_factory = field_info.default_factory\n else:\n default_default_factory = infer_default()\n return default_default_factory", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_mapping_like_prepare_pydantic_annotations_mapping_like_prepare_pydantic_annotations.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_mapping_like_prepare_pydantic_annotations_mapping_like_prepare_pydantic_annotations.return._", "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": 767, "end_line": 799, "span_ids": ["mapping_like_prepare_pydantic_annotations"], "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 mapping_like_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n origin: Any = get_origin(source_type)\n\n mapped_origin = MAPPING_ORIGIN_MAP.get(origin, None) if origin else MAPPING_ORIGIN_MAP.get(source_type, None)\n if mapped_origin is None:\n return None\n\n args = get_args(source_type)\n\n if not args:\n args = (Any, Any)\n elif mapped_origin is collections.Counter:\n # a single generic\n if len(args) != 1:\n raise ValueError('Expected Counter to have exactly 1 generic parameter')\n args = (args[0], int) # keys are always an int\n elif len(args) != 2:\n raise ValueError('Expected mapping to have exactly 2 generic parameters')\n\n keys_source_type, values_source_type = args\n\n metadata, remaining_annotations = _known_annotated_metadata.collect_known_metadata(annotations)\n _known_annotated_metadata.check_metadata(metadata, _known_annotated_metadata.SEQUENCE_CONSTRAINTS, source_type)\n\n return (\n source_type,\n [\n MappingValidator(mapped_origin, keys_source_type, values_source_type, **metadata),\n *remaining_annotations,\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/_migration.py_REMOVED_IN_V2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_migration.py_REMOVED_IN_V2_", "embedding": null, "metadata": {"file_path": "pydantic/_migration.py", "file_name": "_migration.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 309, "span_ids": ["getattr_migration", "impl:7"], "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": "REMOVED_IN_V2 =\n # ... other code\n\n\ndef getattr_migration(module: str) -> Callable[[str], Any]:\n \"\"\"Implement PEP 562 for objects that were either moved or removed on the migration\n to V2.\n\n Args:\n module: The module name.\n\n Returns:\n A callable that will raise an error if the object is not found.\n \"\"\"\n # This avoids circular import with errors.py.\n from .errors import PydanticImportError\n\n def wrapper(name: str) -> object:\n \"\"\"Raise an error if the object is not found, or warn if it was moved.\n\n In case it was moved, it still returns the object.\n\n Args:\n name: The object name.\n\n Returns:\n The object.\n \"\"\"\n if name == '__path__':\n raise AttributeError(f'module {module!r} has no attribute {name!r}')\n\n import warnings\n\n from ._internal._validators import import_string\n\n import_path = f'{module}:{name}'\n if import_path in MOVED_IN_V2.keys():\n new_location = MOVED_IN_V2[import_path]\n warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')\n return import_string(MOVED_IN_V2[import_path])\n if import_path in DEPRECATED_MOVED_IN_V2:\n # skip the warning here because a deprecation warning will be raised elsewhere\n return import_string(DEPRECATED_MOVED_IN_V2[import_path])\n if import_path in REDIRECT_TO_V1:\n new_location = REDIRECT_TO_V1[import_path]\n warnings.warn(\n f'`{import_path}` has been removed. We are importing from `{new_location}` instead.'\n 'See the migration guide for more details: https://docs.pydantic.dev/latest/migration/'\n )\n return import_string(REDIRECT_TO_V1[import_path])\n if import_path == 'pydantic:BaseSettings':\n raise PydanticImportError(\n '`BaseSettings` has been moved to the `pydantic-settings` package. '\n f'See https://docs.pydantic.dev/{version_short()}/migration/#basesettings-has-moved-to-pydantic-settings '\n 'for more details.'\n )\n if import_path in REMOVED_IN_V2:\n raise PydanticImportError(f'`{import_path}` has been removed in V2.')\n globals: Dict[str, Any] = sys.modules[module].__dict__\n if name in globals:\n return globals[name]\n raise AttributeError(f'module {module!r} has no attribute {name!r}')\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/alias_generators.py_to_snake_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/alias_generators.py_to_snake_", "embedding": null, "metadata": {"file_path": "pydantic/alias_generators.py", "file_name": "alias_generators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 51, "span_ids": ["to_snake"], "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 to_snake(camel: str) -> str:\n \"\"\"Convert a PascalCase or camelCase string to snake_case.\n\n Args:\n camel: The string to convert.\n\n Returns:\n The converted string in snake_case.\n \"\"\"\n # Handle the sequence of uppercase letters followed by a lowercase letter\n snake = re.sub(r'([A-Z]+)([A-Z][a-z])', lambda m: f'{m.group(1)}_{m.group(2)}', camel)\n # Insert an underscore between a lowercase letter and an uppercase letter\n snake = re.sub(r'([a-z])([A-Z])', lambda m: f'{m.group(1)}_{m.group(2)}', snake)\n # Insert an underscore between a digit and an uppercase letter\n snake = re.sub(r'([0-9])([A-Z])', lambda m: f'{m.group(1)}_{m.group(2)}', snake)\n # Insert an underscore between a lowercase letter and a digit\n snake = re.sub(r'([a-z])([0-9])', lambda m: f'{m.group(1)}_{m.group(2)}', snake)\n return snake.lower()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/class_validators.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/deprecated/class_validators.py_validator_validator.mode._before_if_pre_is_True_e", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 142, "span_ids": ["validator"], "tokens": 642}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@deprecated(\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 category=None,\n)\ndef 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 \"\"\"Decorate methods on the class indicating that they should be used to validate fields.\n\n Args:\n __field (str): The first field the validator should be called on; this is separate\n from `fields` to ensure an error is raised if you don't pass at least one.\n *fields (str): Additional field(s) the validator should be called on.\n pre (bool, optional): Whether this validator should be called before the standard\n validators (else after). Defaults to False.\n each_item (bool, optional): For complex objects (sets, lists etc.) whether to validate\n individual elements rather than the whole object. Defaults to False.\n always (bool, optional): Whether this method and other validators should be called even if\n the value is missing. Defaults to False.\n check_fields (bool | None, optional): Whether to check that the fields actually exist on the model.\n Defaults to None.\n allow_reuse (bool, optional): Whether to track and raise an error if another validator refers to\n the decorated function. Defaults to False.\n\n Returns:\n Callable: A decorator that can be used to decorate a\n function to be used as a validator.\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 if allow_reuse is True: # pragma: no cover\n warn(_ALLOW_REUSE_WARNING_MESSAGE, DeprecationWarning)\n fields = tuple((__field, *fields))\n if isinstance(fields[0], FunctionType):\n raise PydanticUserError(\n '`@validator` should be used with fields and keyword arguments, not bare. '\n \"E.g. usage should be `@validator('', ...)`\",\n code='validator-no-fields',\n )\n elif not all(isinstance(field, str) for field in fields):\n raise PydanticUserError(\n '`@validator` fields should be passed as separate string args. '\n \"E.g. usage should be `@validator('', '', ...)`\",\n code='validator-invalid-fields',\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/deprecated/class_validators.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/deprecated/class_validators.py_validator.dec_validator._type_ignore_return_val", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 161, "span_ids": ["validator"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@deprecated(\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 category=None,\n)\ndef 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.PydanticDescriptorProxy[Any]:\n if _decorators.is_instance_method_from_sig(f):\n raise PydanticUserError(\n '`@validator` cannot be applied to instance methods', code='validator-instance-method'\n )\n # auto apply the @classmethod decorator\n f = _decorators.ensure_classmethod_based_on_signature(f)\n wrap = _decorators_v1.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.PydanticDescriptorProxy(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/deprecated/class_validators.py_root_validator_root_validator_3._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_root_validator_root_validator_3._", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 198, "span_ids": ["root_validator", "root_validator_3", "root_validator_2"], "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": "@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[\n [_V1RootValidatorFunctionType],\n _V1RootValidatorFunctionType,\n]:\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[\n [_V1RootValidatorFunctionType],\n _V1RootValidatorFunctionType,\n]:\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[\n [_V1RootValidatorFunctionType],\n _V1RootValidatorFunctionType,\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/deprecated/class_validators.py_root_validator_4_root_validator_4.wrap.partial__decorators_v1_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_root_validator_4_root_validator_4.wrap.partial__decorators_v1_ma", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 255, "span_ids": ["root_validator_4"], "tokens": 499}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@deprecated(\n 'Pydantic V1 style `@root_validator` validators are deprecated.'\n ' You should migrate to Pydantic V2 style `@model_validator` validators,'\n ' see the migration guide for more details',\n category=None,\n)\ndef root_validator(\n *__args,\n pre: bool = False,\n skip_on_failure: bool = False,\n allow_reuse: bool = False,\n) -> Any:\n \"\"\"Decorate methods on a model indicating that they should be used to validate (and perhaps\n modify) data either before or after standard model parsing/validation is performed.\n\n Args:\n pre (bool, optional): Whether this validator should be called before the standard\n validators (else after). Defaults to False.\n skip_on_failure (bool, optional): Whether to stop validation and return as soon as a\n failure is encountered. Defaults to False.\n allow_reuse (bool, optional): Whether to track and raise an error if another validator\n refers to the decorated function. Defaults to False.\n\n Returns:\n Any: A decorator that can be used to decorate a function to be used as a root_validator.\n \"\"\"\n warn(\n 'Pydantic V1 style `@root_validator` validators are deprecated.'\n ' You should migrate to Pydantic V2 style `@model_validator` validators,'\n ' see the migration guide for more details',\n DeprecationWarning,\n stacklevel=2,\n )\n\n if __args:\n # Ensure a nice error is raised if someone attempts to use the bare decorator\n return root_validator()(*__args) # type: ignore\n\n if allow_reuse is True: # pragma: no cover\n warn(_ALLOW_REUSE_WARNING_MESSAGE, DeprecationWarning)\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 PydanticUserError(\n 'If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`.'\n ' Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.',\n code='root-validator-pre-skip',\n )\n\n wrap = partial(_decorators_v1.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/deprecated/class_validators.py_root_validator_4.dec_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py_root_validator_4.dec_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 266, "span_ids": ["root_validator_4"], "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": "@deprecated(\n 'Pydantic V1 style `@root_validator` validators are deprecated.'\n ' You should migrate to Pydantic V2 style `@model_validator` validators,'\n ' see the migration guide for more details',\n category=None,\n)\ndef root_validator(\n *__args,\n pre: bool = False,\n skip_on_failure: bool = False,\n allow_reuse: bool = False,\n) -> Any:\n # ... other code\n\n def dec(f: Callable[..., Any] | classmethod[Any, Any, Any] | staticmethod[Any, Any]) -> Any:\n if _decorators.is_instance_method_from_sig(f):\n raise TypeError('`@root_validator` cannot be applied to instance methods')\n # auto apply the @classmethod decorator\n res = _decorators.ensure_classmethod_based_on_signature(f)\n dec_info = _decorators.RootValidatorDecoratorInfo(mode=mode)\n return _decorators.PydanticDescriptorProxy(res, dec_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/deprecated/copy_internals.py__iter__iter.for_field_key_v_in_items.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_items.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": 29, "end_line": 95, "span_ids": ["_iter"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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: True for k in self.model_fields}, 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 if self.__pydantic_extra__:\n yield from self.__pydantic_extra__.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 if self.__pydantic_extra__ is None:\n items = self.__dict__.items()\n else:\n items = list(self.__dict__.items()) + list(self.__pydantic_extra__.items())\n\n for field_key, v in 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(\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/functional_serializers.py_if_TYPE_CHECKING__field_serializer_2._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_if_TYPE_CHECKING__field_serializer_2._", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 220, "span_ids": ["field_serializer_2", "field_serializer_1", "impl", "field_serializer"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if TYPE_CHECKING:\n _PartialClsOrStaticMethod: TypeAlias = Union[classmethod[Any, Any, Any], staticmethod[Any, Any], partialmethod[Any]]\n _PlainSerializationFunction = Union[_core_schema.SerializerFunction, _PartialClsOrStaticMethod]\n _WrapSerializationFunction = Union[_core_schema.WrapSerializerFunction, _PartialClsOrStaticMethod]\n _PlainSerializeMethodType = TypeVar('_PlainSerializeMethodType', bound=_PlainSerializationFunction)\n _WrapSerializeMethodType = TypeVar('_WrapSerializeMethodType', bound=_WrapSerializationFunction)\n\n\n@overload\ndef field_serializer(\n field: str,\n /,\n *fields: str,\n return_type: Any = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = ...,\n check_fields: bool | None = ...,\n) -> Callable[[_PlainSerializeMethodType], _PlainSerializeMethodType]:\n ...\n\n\n@overload\ndef field_serializer(\n field: str,\n /,\n *fields: str,\n mode: Literal['plain'],\n return_type: Any = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = ...,\n check_fields: bool | None = ...,\n) -> Callable[[_PlainSerializeMethodType], _PlainSerializeMethodType]:\n ...\n\n\n@overload\ndef field_serializer(\n field: str,\n /,\n *fields: str,\n mode: Literal['wrap'],\n return_type: Any = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = ...,\n check_fields: bool | None = ...,\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/functional_validators.py_if_TYPE_CHECKING__FieldValidatorModes.Literal_before_after_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_if_TYPE_CHECKING__FieldValidatorModes.Literal_before_after_", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 296, "span_ids": ["field_validator_1", "field_validator", "impl:6", "impl:17"], "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": "if TYPE_CHECKING:\n\n class _OnlyValueValidatorClsMethod(Protocol):\n def __call__(self, cls: Any, value: Any, /) -> Any:\n ...\n\n class _V2ValidatorClsMethod(Protocol):\n def __call__(self, cls: Any, value: Any, info: _core_schema.ValidationInfo, /) -> Any:\n ...\n\n class _V2WrapValidatorClsMethod(Protocol):\n def __call__(\n self,\n cls: Any,\n value: Any,\n handler: _core_schema.ValidatorFunctionWrapHandler,\n info: _core_schema.ValidationInfo,\n /,\n ) -> Any:\n ...\n\n _V2Validator = Union[\n _V2ValidatorClsMethod,\n _core_schema.WithInfoValidatorFunction,\n _OnlyValueValidatorClsMethod,\n _core_schema.NoInfoValidatorFunction,\n ]\n\n _V2WrapValidator = Union[\n _V2WrapValidatorClsMethod,\n _core_schema.WithInfoWrapValidatorFunction,\n ]\n\n _PartialClsOrStaticMethod: TypeAlias = Union[classmethod[Any, Any, Any], staticmethod[Any, Any], partialmethod[Any]]\n\n _V2BeforeAfterOrPlainValidatorType = TypeVar(\n '_V2BeforeAfterOrPlainValidatorType',\n _V2Validator,\n _PartialClsOrStaticMethod,\n )\n _V2WrapValidatorType = TypeVar('_V2WrapValidatorType', _V2WrapValidator, _PartialClsOrStaticMethod)\n\n\n@overload\ndef field_validator(\n field: str,\n /,\n *fields: str,\n mode: Literal['before', 'after', 'plain'] = ...,\n check_fields: bool | None = ...,\n) -> Callable[[_V2BeforeAfterOrPlainValidatorType], _V2BeforeAfterOrPlainValidatorType]:\n ...\n\n\n@overload\ndef field_validator(\n field: str,\n /,\n *fields: str,\n mode: Literal['wrap'],\n check_fields: bool | None = ...,\n) -> Callable[[_V2WrapValidatorType], _V2WrapValidatorType]:\n ...\n\n\nFieldValidatorModes: TypeAlias = Literal['before', 'after', 'wrap', 'plain']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_field_validator_2_field_validator_2.if_not_all_isinstance_fie.raise_PydanticUserError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_field_validator_2_field_validator_2.if_not_all_isinstance_fie.raise_PydanticUserError_", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 374, "span_ids": ["field_validator_2"], "tokens": 611}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def field_validator(\n field: str,\n /,\n *fields: str,\n mode: FieldValidatorModes = 'after',\n check_fields: bool | None = None,\n) -> Callable[[Any], Any]:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validators/#field-validators\n\n Decorate methods on the class indicating that they should be used to validate fields.\n\n Example usage:\n ```py\n from typing import Any\n\n from pydantic import (\n BaseModel,\n ValidationError,\n field_validator,\n )\n\n class Model(BaseModel):\n a: str\n\n @field_validator('a')\n @classmethod\n def ensure_foobar(cls, v: Any):\n if 'foobar' not in v:\n raise ValueError('\"foobar\" not found in a')\n return v\n\n print(repr(Model(a='this is foobar good')))\n #> Model(a='this is foobar good')\n\n try:\n Model(a='snap')\n except ValidationError as exc_info:\n print(exc_info)\n '''\n 1 validation error for Model\n a\n Value error, \"foobar\" not found in a [type=value_error, input_value='snap', input_type=str]\n '''\n ```\n\n For more in depth examples, see [Field Validators](../concepts/validators.md#field-validators).\n\n Args:\n field: The first field the `field_validator` should be called on; this is separate\n from `fields` to ensure an error is raised if you don't pass at least one.\n *fields: Additional field(s) the `field_validator` should be called on.\n mode: Specifies whether to validate the fields before or after validation.\n check_fields: Whether to check that the fields actually exist on the model.\n\n Returns:\n A decorator that can be used to decorate a function to be used as a field_validator.\n\n Raises:\n PydanticUserError:\n - If `@field_validator` is used bare (with no fields).\n - If the args passed to `@field_validator` as fields are not strings.\n - If `@field_validator` applied to instance methods.\n \"\"\"\n if isinstance(field, FunctionType):\n raise PydanticUserError(\n '`@field_validator` should be used with fields and keyword arguments, not bare. '\n \"E.g. usage should be `@validator('', ...)`\",\n code='validator-no-fields',\n )\n fields = field, *fields\n if not all(isinstance(field, str) for field in fields):\n raise PydanticUserError(\n '`@field_validator` fields should be passed as separate string args. '\n \"E.g. usage should be `@validator('', '', ...)`\",\n code='validator-invalid-fields',\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/functional_validators.py_field_validator_2.dec_field_validator_2.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_field_validator_2.dec_field_validator_2.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 376, "end_line": 390, "span_ids": ["field_validator_2"], "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 field_validator(\n field: str,\n /,\n *fields: str,\n mode: FieldValidatorModes = 'after',\n check_fields: bool | None = None,\n) -> Callable[[Any], Any]:\n # ... other code\n\n def dec(\n f: Callable[..., Any] | staticmethod[Any, Any] | classmethod[Any, Any, Any],\n ) -> _decorators.PydanticDescriptorProxy[Any]:\n if _decorators.is_instance_method_from_sig(f):\n raise PydanticUserError(\n '`@field_validator` cannot be applied to instance methods', code='validator-instance-method'\n )\n\n # auto apply the @classmethod decorator\n f = _decorators.ensure_classmethod_based_on_signature(f)\n\n dec_info = _decorators.FieldValidatorDecoratorInfo(fields=fields, mode=mode, check_fields=check_fields)\n return _decorators.PydanticDescriptorProxy(f, dec_info)\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/main.py_BaseModel.model_validate_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.model_validate_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": 478, "end_line": 505, "span_ids": ["BaseModel.model_validate"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def model_validate(\n cls: type[Model],\n obj: Any,\n *,\n strict: bool | None = None,\n from_attributes: bool | None = None,\n context: dict[str, Any] | None = None,\n ) -> Model:\n \"\"\"Validate a pydantic model instance.\n\n Args:\n obj: The object to validate.\n strict: Whether to enforce types strictly.\n from_attributes: Whether to extract data from object attributes.\n context: Additional context to pass to the validator.\n\n Raises:\n ValidationError: If the object could not be validated.\n\n Returns:\n The validated model instance.\n \"\"\"\n # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\n __tracebackhide__ = True\n return cls.__pydantic_validator__.validate_python(\n obj, strict=strict, from_attributes=from_attributes, context=context\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_": {"__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_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 366, "end_line": 388, "span_ids": ["BaseModel.model_json_schema"], "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(metaclass=_model_construction.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 mode: JsonSchemaMode = 'validation',\n ) -> dict[str, Any]:\n \"\"\"Generates a JSON schema for a model class.\n\n Args:\n by_alias: Whether to use attribute aliases or not.\n ref_template: The reference template.\n schema_generator: To override the logic used to generate the JSON schema, as a subclass of\n `GenerateJsonSchema` with your desired modifications\n mode: The mode in which to generate the schema.\n\n Returns:\n The JSON schema for the given model class.\n \"\"\"\n return model_json_schema(\n cls, by_alias=by_alias, ref_template=ref_template, schema_generator=schema_generator, mode=mode\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.__deepcopy__.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__deepcopy___BaseModel.__deepcopy__.return.m", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 652, "end_line": 671, "span_ids": ["BaseModel.__deepcopy__"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def __deepcopy__(self: Model, memo: dict[int, Any] | None = None) -> Model:\n \"\"\"Returns a deep copy of the model.\"\"\"\n cls = type(self)\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', deepcopy(self.__dict__, memo=memo))\n _object_setattr(m, '__pydantic_extra__', deepcopy(self.__pydantic_extra__, memo=memo))\n # This next line doesn't need a deepcopy because __pydantic_fields_set__ is a set[str],\n # and attempting a deepcopy would be marginally slower.\n _object_setattr(m, '__pydantic_fields_set__', copy(self.__pydantic_fields_set__))\n\n if self.__pydantic_private__ is None:\n _object_setattr(m, '__pydantic_private__', None)\n else:\n _object_setattr(\n m,\n '__pydantic_private__',\n deepcopy({k: v for k, v in self.__pydantic_private__.items() if v is not PydanticUndefined}, memo=memo),\n )\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/main.py_BaseModel.__repr_args___BaseModel.__repr_args__.yield_from_k_getattr_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__repr_args___BaseModel.__repr_args__.yield_from_k_getattr_s", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 917, "end_line": 934, "span_ids": ["BaseModel.__repr_args__"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def __repr_args__(self) -> _repr.ReprArgs:\n for k, v in self.__dict__.items():\n field = self.model_fields.get(k)\n if field and field.repr:\n yield k, v\n\n # `__pydantic_extra__` can fail to be set if the model is not yet fully initialized.\n # This can happen if a `ValidationError` is raised during initialization and the instance's\n # repr is generated as part of the exception handling. Therefore, we use `getattr` here\n # with a fallback, even though the type hints indicate the attribute will always be present.\n try:\n pydantic_extra = object.__getattribute__(self, '__pydantic_extra__')\n except AttributeError:\n pydantic_extra = None\n\n if pydantic_extra is not None:\n yield from ((k, v) for k, v in pydantic_extra.items())\n yield from ((k, getattr(self, k)) for k, v in self.model_computed_fields.items() if v.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/main.py_BaseModel.schema_BaseModel.schema.return.cls_model_json_schema_by_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_BaseModel.schema.return.cls_model_json_schema_by_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1254, "end_line": 1262, "span_ids": ["BaseModel.schema"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated('The `schema` method is deprecated; use `model_json_schema` instead.', category=None)\n def schema( # noqa: D102\n cls, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE\n ) -> typing.Dict[str, Any]: # noqa UP006\n warnings.warn(\n 'The `schema` method is deprecated; use `model_json_schema` instead.', category=PydanticDeprecatedSince20\n )\n return cls.model_json_schema(by_alias=by_alias, ref_template=ref_template)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.schema_json_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_json_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": 1264, "end_line": 1284, "span_ids": ["BaseModel.schema_json"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated(\n 'The `schema_json` method is deprecated; use `model_json_schema` and json.dumps instead.',\n category=None,\n )\n def schema_json( # noqa: D102\n cls, *, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, **dumps_kwargs: Any\n ) -> str: # pragma: no cover\n warnings.warn(\n 'The `schema_json` method is deprecated; use `model_json_schema` and json.dumps instead.',\n category=PydanticDeprecatedSince20,\n )\n import json\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/networks.py_UrlConstraints_UrlConstraints.__hash__.return.hash_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_UrlConstraints_UrlConstraints.__hash__.return.hash_", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 78, "span_ids": ["UrlConstraints", "UrlConstraints.__hash__"], "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": "@_dataclasses.dataclass\nclass UrlConstraints(_fields.PydanticMetadata):\n \"\"\"Url constraints.\n\n Attributes:\n max_length: The maximum length of the url. Defaults to `None`.\n allowed_schemes: The allowed schemes. Defaults to `None`.\n host_required: Whether the host is required. Defaults to `None`.\n default_host: The default host. Defaults to `None`.\n default_port: The default port. Defaults to `None`.\n default_path: The default path. Defaults to `None`.\n \"\"\"\n\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 def __hash__(self) -> int:\n return hash(\n (\n self.max_length,\n tuple(self.allowed_schemes) if self.allowed_schemes is not None else None,\n self.host_required,\n self.default_host,\n self.default_port,\n self.default_path,\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/type_adapter.py_TypeAdapter.validate_python_TypeAdapter.validate_python.return.self_validator_validate_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.validate_python_TypeAdapter.validate_python.return.self_validator_validate_p", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 260, "span_ids": ["TypeAdapter.validate_python"], "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": "@final\nclass TypeAdapter(Generic[T]):\n\n def validate_python(\n self,\n object: Any,\n /,\n *,\n strict: bool | None = None,\n from_attributes: bool | None = None,\n context: dict[str, Any] | None = None,\n ) -> T:\n \"\"\"Validate a Python object against the model.\n\n Args:\n object: The Python object to validate against the model.\n strict: Whether to strictly check types.\n from_attributes: Whether to extract data from object attributes.\n context: Additional context to pass to the validator.\n\n !!! note\n When using `TypeAdapter` with a Pydantic `dataclass`, the use of the `from_attributes`\n argument is not supported.\n\n Returns:\n The validated object.\n \"\"\"\n return self.validator.validate_python(object, strict=strict, from_attributes=from_attributes, 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/type_adapter.py_TypeAdapter.validate_json_TypeAdapter.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/type_adapter.py_TypeAdapter.validate_json_TypeAdapter.validate_json.return.self_validator_validate_j", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 277, "span_ids": ["TypeAdapter.validate_json"], "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": "@final\nclass TypeAdapter(Generic[T]):\n\n def validate_json(\n self, data: str | bytes, /, *, strict: bool | None = None, context: dict[str, Any] | None = None\n ) -> T:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/json/#json-parsing\n\n Validate a JSON string or bytes against the model.\n\n Args:\n data: The JSON data to validate against the model.\n strict: Whether to strictly check types.\n context: Additional context to use during validation.\n\n Returns:\n The validated object.\n \"\"\"\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/type_adapter.py_TypeAdapter.dump_python_TypeAdapter.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/type_adapter.py_TypeAdapter.dump_python_TypeAdapter.dump_python.return.self_serializer_to_python", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 347, "span_ids": ["TypeAdapter.dump_python"], "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": "@final\nclass TypeAdapter(Generic[T]):\n\n def dump_python(\n self,\n instance: T,\n /,\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 \"\"\"Dump an instance of the adapted type to a Python object.\n\n Args:\n instance: The Python object to serialize.\n mode: The output format.\n include: Fields to include in the output.\n exclude: Fields to exclude from the output.\n by_alias: Whether to use alias names for field names.\n exclude_unset: Whether to exclude unset fields.\n exclude_defaults: Whether to exclude fields with default values.\n exclude_none: Whether to exclude fields with None values.\n round_trip: Whether to output the serialized data in a way that is compatible with deserialization.\n warnings: Whether to display serialization warnings.\n\n Returns:\n The serialized object.\n \"\"\"\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/type_adapter.py_TypeAdapter.dump_json_TypeAdapter.dump_json.return.self_serializer_to_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.dump_json_TypeAdapter.dump_json.return.self_serializer_to_json_", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 394, "span_ids": ["TypeAdapter.dump_json"], "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": "@final\nclass TypeAdapter(Generic[T]):\n\n def dump_json(\n self,\n instance: T,\n /,\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 \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/json/#json-serialization\n\n Serialize an instance of the adapted type to JSON.\n\n Args:\n instance: The instance to be serialized.\n indent: Number of spaces for JSON indentation.\n include: Fields to include.\n exclude: Fields to exclude.\n by_alias: Whether to use alias names for field names.\n exclude_unset: Whether to exclude unset fields.\n exclude_defaults: Whether to exclude fields with default values.\n exclude_none: Whether to exclude fields with a value of `None`.\n round_trip: Whether to serialize and deserialize the instance to ensure round-tripping.\n warnings: Whether to emit serialization warnings.\n\n Returns:\n The JSON representation of the given instance as bytes.\n \"\"\"\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.json_schema_TypeAdapter.json_schema.return.schema_generator_instance": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.json_schema_TypeAdapter.json_schema.return.schema_generator_instance", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 390, "end_line": 410, "span_ids": ["TypeAdapter.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": "@final\nclass TypeAdapter(Generic[T]):\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 mode: JsonSchemaMode = 'validation',\n ) -> dict[str, Any]:\n \"\"\"Generate a JSON schema for the adapted type.\n\n Args:\n by_alias: Whether to use alias names for field names.\n ref_template: The format string used for generating $ref strings.\n schema_generator: The generator class used for creating the schema.\n mode: The mode to use for schema generation.\n\n Returns:\n The JSON schema for the model as a dictionary.\n \"\"\"\n schema_generator_instance = schema_generator(by_alias=by_alias, ref_template=ref_template)\n return schema_generator_instance.generate(self.core_schema, 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/type_adapter.py_TypeAdapter.json_schemas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.json_schemas_", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 418, "end_line": 466, "span_ids": ["TypeAdapter.json_schemas"], "tokens": 456}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@final\nclass TypeAdapter(Generic[T]):\n\n @staticmethod\n def json_schemas(\n inputs: Iterable[tuple[JsonSchemaKeyT, JsonSchemaMode, TypeAdapter[Any]]],\n /,\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 ) -> tuple[dict[tuple[JsonSchemaKeyT, JsonSchemaMode], JsonSchemaValue], JsonSchemaValue]:\n \"\"\"Generate a JSON schema including definitions from multiple type adapters.\n\n Args:\n inputs: Inputs to schema generation. The first two items will form the keys of the (first)\n output mapping; the type adapters will provide the core schemas that get converted into\n definitions in the output JSON schema.\n by_alias: Whether to use alias names.\n title: The title for the schema.\n description: The description for the schema.\n ref_template: The format string used for generating $ref strings.\n schema_generator: The generator class used for creating the schema.\n\n Returns:\n A tuple where:\n\n - The first element is a dictionary whose keys are tuples of JSON schema key type and JSON mode, and\n whose values are the JSON schema corresponding to that pair of inputs. (These schemas may have\n JsonRef references to definitions that are defined in the second returned element.)\n - The second element is a JSON schema containing all definitions referenced in the first returned\n element, along with the optional title and description keys.\n\n \"\"\"\n schema_generator_instance = schema_generator(by_alias=by_alias, ref_template=ref_template)\n\n inputs_ = [(key, mode, adapter.core_schema) for key, mode, adapter in inputs]\n\n json_schemas_map, definitions = schema_generator_instance.generate_definitions(inputs_)\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_schemas_map, 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/types.py_Base64Encoder_Base64Encoder.get_json_format.return._base64_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Base64Encoder_Base64Encoder.get_json_format.return._base64_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2008, "end_line": 2045, "span_ids": ["Base64Encoder", "Base64Encoder.get_json_format", "Base64Encoder.decode", "Base64Encoder.encode"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Base64Encoder(EncoderProtocol):\n \"\"\"Standard (non-URL-safe) Base64 encoder.\"\"\"\n\n @classmethod\n def decode(cls, data: bytes) -> bytes:\n \"\"\"Decode the data from base64 encoded bytes to original bytes data.\n\n Args:\n data: The data to decode.\n\n Returns:\n The decoded data.\n \"\"\"\n try:\n return base64.decodebytes(data)\n except ValueError as e:\n raise PydanticCustomError('base64_decode', \"Base64 decoding error: '{error}'\", {'error': str(e)})\n\n @classmethod\n def encode(cls, value: bytes) -> bytes:\n \"\"\"Encode the data from bytes to a base64 encoded bytes.\n\n Args:\n value: The data to encode.\n\n Returns:\n The encoded data.\n \"\"\"\n return base64.encodebytes(value)\n\n @classmethod\n def get_json_format(cls) -> Literal['base64']:\n \"\"\"Get the JSON format for the encoded data.\n\n Returns:\n The JSON format for the encoded data.\n \"\"\"\n return 'base64'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_EncodedBytes_EncodedBytes.__hash__.return.hash_self_encoder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_EncodedBytes_EncodedBytes.__hash__.return.hash_self_encoder_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2088, "end_line": 2182, "span_ids": ["EncodedBytes.__get_pydantic_json_schema__", "EncodedBytes.__get_pydantic_core_schema__", "EncodedBytes.decode", "EncodedBytes.encode", "EncodedBytes.__hash__", "EncodedBytes"], "tokens": 630}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass EncodedBytes:\n \"\"\"A bytes type that is encoded and decoded using the specified encoder.\n\n `EncodedBytes` needs an encoder that implements `EncoderProtocol` to operate.\n\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, EncodedBytes, EncoderProtocol, ValidationError\n\n class MyEncoder(EncoderProtocol):\n @classmethod\n def decode(cls, data: bytes) -> bytes:\n if data == b'**undecodable**':\n raise ValueError('Cannot decode data')\n return data[13:]\n\n @classmethod\n def encode(cls, value: bytes) -> bytes:\n return b'**encoded**: ' + value\n\n @classmethod\n def get_json_format(cls) -> str:\n return 'my-encoder'\n\n MyEncodedBytes = Annotated[bytes, EncodedBytes(encoder=MyEncoder)]\n\n class Model(BaseModel):\n my_encoded_bytes: MyEncodedBytes\n\n # Initialize the model with encoded data\n m = Model(my_encoded_bytes=b'**encoded**: some bytes')\n\n # Access decoded value\n print(m.my_encoded_bytes)\n #> b'some bytes'\n\n # Serialize into the encoded form\n print(m.model_dump())\n #> {'my_encoded_bytes': b'**encoded**: some bytes'}\n\n # Validate encoded data\n try:\n Model(my_encoded_bytes=b'**undecodable**')\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n my_encoded_bytes\n Value error, Cannot decode data [type=value_error, input_value=b'**undecodable**', input_type=bytes]\n '''\n ```\n \"\"\"\n\n encoder: type[EncoderProtocol]\n\n def __get_pydantic_json_schema__(\n self, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\n field_schema.update(type='string', format=self.encoder.get_json_format())\n return field_schema\n\n def __get_pydantic_core_schema__(self, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n return core_schema.with_info_after_validator_function(\n function=self.decode,\n schema=core_schema.bytes_schema(),\n serialization=core_schema.plain_serializer_function_ser_schema(function=self.encode),\n )\n\n def decode(self, data: bytes, _: core_schema.ValidationInfo) -> bytes:\n \"\"\"Decode the data using the specified encoder.\n\n Args:\n data: The data to decode.\n\n Returns:\n The decoded data.\n \"\"\"\n return self.encoder.decode(data)\n\n def encode(self, value: bytes) -> bytes:\n \"\"\"Encode the data using the specified encoder.\n\n Args:\n value: The data to encode.\n\n Returns:\n The encoded data.\n \"\"\"\n return self.encoder.encode(value)\n\n def __hash__(self) -> int:\n return hash(self.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/conftest.py_importlib_disable_error_urls.os_environ_PYDANTIC_ERRO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_importlib_disable_error_urls.os_environ_PYDANTIC_ERRO", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["_extract_source_code_from_function", "_create_module_file", "imports", "pytest_addoption", "disable_error_urls"], "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": "import importlib\nimport inspect\nimport os\nimport re\nimport secrets\nimport subprocess\nimport sys\nimport textwrap\nfrom dataclasses import dataclass\nfrom pathlib import Path\nfrom types import FunctionType\nfrom typing import Any, Optional\n\nimport pytest\nfrom _pytest.assertion.rewrite import AssertionRewritingHook\n\n\ndef pytest_addoption(parser: pytest.Parser):\n parser.addoption('--test-mypy', action='store_true', help='run mypy tests')\n parser.addoption('--update-mypy', action='store_true', help='update 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)\n\n\n@pytest.fixture(scope='session', autouse=True)\ndef disable_error_urls():\n # Don't add URLs during docs tests when printing\n # Otherwise we'll get version numbers in the URLs that will update frequently\n os.environ['PYDANTIC_ERRORS_OMIT_URL'] = '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/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": 307, "span_ids": ["impl:54", "impl:61", "foo", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "impl:47", "Response", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 671}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_random_try_.except_ImportError_.singledispatchmethod.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_random_try_.except_ImportError_.singledispatchmethod.None", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports"], "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": "import random\nimport sys\nfrom abc import ABC, abstractmethod\nfrom typing import Any, Callable, ClassVar, Generic, List, Tuple, TypeVar\n\nimport pytest\nfrom pydantic_core import ValidationError, core_schema\nfrom typing_extensions import TypedDict\n\nfrom pydantic import (\n BaseModel,\n Field,\n GetCoreSchemaHandler,\n PrivateAttr,\n TypeAdapter,\n computed_field,\n dataclasses,\n field_serializer,\n field_validator,\n)\nfrom pydantic.alias_generators import to_camel\nfrom pydantic.errors import PydanticUserError\n\ntry:\n from functools import cached_property, lru_cache, singledispatchmethod\nexcept ImportError:\n cached_property = None\n lru_cache = None\n singledispatchmethod = 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_computed_fields.py_test_expected_type_wrong_test_expected_type_wrong.None_2.m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_expected_type_wrong_test_expected_type_wrong.None_2.m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 301, "end_line": 315, "span_ids": ["test_expected_type_wrong"], "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_expected_type_wrong():\n class Model(BaseModel):\n x: int\n\n @computed_field\n def x_list(self) -> List[int]:\n return 'not a list'\n\n m = Model(x=1)\n with pytest.warns(UserWarning, match=r'Expected `list\\[int\\]` but got `str`'):\n m.model_dump()\n with pytest.warns(UserWarning, match=r'Expected `list\\[int\\]` but got `str`'):\n m.model_dump(mode='json')\n with pytest.warns(UserWarning, match=r'Expected `list\\[int\\]` but got `str`'):\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_computed_fields.py_test_frozen_test_frozen.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_frozen_test_frozen.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 402, "end_line": 423, "span_ids": ["test_frozen"], "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_frozen():\n class Square(BaseModel, frozen=True):\n side: float\n\n @computed_field\n @property\n def area(self) -> float:\n return self.side**2\n\n @area.setter\n def area(self, new_area: int):\n self.side = new_area**0.5\n\n m = Square(side=4)\n assert m.area == 16.0\n assert m.model_dump() == {'side': 4.0, 'area': 16.0}\n\n with pytest.raises(ValidationError) as exc_info:\n m.area = 4\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_instance', 'loc': ('area',), 'msg': 'Instance is frozen', 'input': 4}\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_CustomType_test_computed_fields_infer_return_type.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_CustomType_test_computed_fields_infer_return_type.None_1", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 503, "end_line": 518, "span_ids": ["CustomType.__get_pydantic_core_schema__", "CustomType", "test_computed_fields_infer_return_type"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CustomType(str):\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n schema = handler(str)\n schema['serialization'] = core_schema.plain_serializer_function_ser_schema(lambda x: '123')\n return schema\n\n\ndef test_computed_fields_infer_return_type():\n class Model(BaseModel):\n @computed_field\n def cfield(self) -> CustomType:\n return CustomType('abc')\n\n assert Model().model_dump() == {'cfield': '123'}\n assert Model().model_dump_json() == '{\"cfield\":\"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_config.py_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field_TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field.None_8": {"__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_8", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 178, "end_line": 194, "span_ids": ["TestsBaseConfig.test_base_config_private_attribute_intersection_with_extra_field"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 model_config = ConfigDict(extra='allow')\n\n assert set(Model.__private_attributes__) == {'_foo'}\n m = Model(_foo='field')\n assert m._foo == 'private_attribute'\n assert m.__dict__ == {}\n assert m.__pydantic_extra__ == {'_foo': 'field'}\n assert m.model_dump() == {'_foo': 'field'}\n m._foo = 'still_private'\n assert m._foo == 'still_private'\n assert m.__dict__ == {}\n assert m.__pydantic_extra__ == {'_foo': 'field'}\n assert 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_dataclasses.py_test_override_builtin_dataclass_test_override_builtin_dataclass.assert_e_value_errors_inc": {"__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_inc", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 738, "end_line": 770, "span_ids": ["test_override_builtin_dataclass"], "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_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(include_url=False) == [\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_recursive_dataclasses_gh_4509_test_recursive_dataclasses_gh_4509.assert_me_recipes_bur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_recursive_dataclasses_gh_4509_test_recursive_dataclasses_gh_4509.assert_me_recipes_bur", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1845, "end_line": 1871, "span_ids": ["test_recursive_dataclasses_gh_4509"], "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_recursive_dataclasses_gh_4509(create_module) -> None:\n @create_module\n def module():\n import dataclasses\n from typing import List\n\n import pydantic\n\n @dataclasses.dataclass\n class Recipe:\n author: 'Cook'\n\n @dataclasses.dataclass\n class Cook:\n recipes: List[Recipe]\n\n @pydantic.dataclasses.dataclass\n class Foo(Cook):\n pass\n\n gordon = module.Cook([])\n\n burger = module.Recipe(author=gordon)\n\n me = module.Foo([burger])\n\n assert me.recipes == [burger]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_test_future_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_future_date_validation_success_test_future_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": 472, "end_line": 508, "span_ids": ["test_future_date_validation_success", "test_future_date_validation_fails"], "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 '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, future_date_type):\n class Model(BaseModel):\n foo: future_date_type\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, future_date_type):\n class Model(BaseModel):\n foo: future_date_type\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_datetime.py_test_past_datetime_validation_success_test_past_datetime_validation_success.assert_Model_foo_value_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_past_datetime_validation_success_test_past_datetime_validation_success.assert_Model_foo_value_f", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 511, "end_line": 522, "span_ids": ["test_past_datetime_validation_success"], "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 ('1996-01-22T10:20:30', datetime(1996, 1, 22, 10, 20, 30)),\n (datetime(1996, 1, 22, 10, 20, 30), datetime(1996, 1, 22, 10, 20, 30)),\n ),\n)\ndef test_past_datetime_validation_success(value, result, past_datetime_type):\n class Model(BaseModel):\n foo: past_datetime_type\n\n assert Model(foo=value).foo == 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_past_datetime_validation_fails_test_future_datetime_validation_success.assert_Model_foo_2064_06": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_past_datetime_validation_fails_test_future_datetime_validation_success.assert_Model_foo_2064_06", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 526, "end_line": 555, "span_ids": ["test_future_datetime_validation_success", "test_past_datetime_validation_fails"], "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.parametrize(\n 'value',\n (\n datetime.now() + timedelta(1),\n '2064-06-01T10:20:30',\n ),\n)\ndef test_past_datetime_validation_fails(value, past_datetime_type):\n class Model(BaseModel):\n foo: past_datetime_type\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'datetime_past',\n 'loc': ('foo',),\n 'msg': 'Input should be in the past',\n 'input': value,\n }\n ]\n\n\ndef test_future_datetime_validation_success(future_datetime_type):\n class Model(BaseModel):\n foo: future_datetime_type\n\n d = datetime.now() + timedelta(1)\n assert Model(foo=d).foo == d\n assert Model(foo='2064-06-01T10:20:30').foo == datetime(2064, 6, 1, 10, 20, 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_decorators.py_pytest_test_inspect_validator_error_wrap.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorators.py_pytest_test_inspect_validator_error_wrap.None_1", "embedding": null, "metadata": {"file_path": "tests/test_decorators.py", "file_name": "test_decorators.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "test_inspect_validator_error_wrap"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom pydantic import PydanticUserError\nfrom pydantic._internal._decorators import inspect_annotated_serializer, inspect_validator\n\n\ndef test_inspect_validator_error_wrap():\n def validator1(arg1):\n pass\n\n def validator4(arg1, arg2, arg3, arg4):\n pass\n\n with pytest.raises(PydanticUserError) as e:\n inspect_validator(validator1, mode='wrap')\n\n assert e.value.code == 'validator-signature'\n\n with pytest.raises(PydanticUserError) as e:\n inspect_validator(validator4, mode='wrap')\n\n assert e.value.code == 'validator-signature'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorators.py_test_inspect_validator_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_decorators.py_test_inspect_validator_error_", "embedding": null, "metadata": {"file_path": "tests/test_decorators.py", "file_name": "test_decorators.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 54, "span_ids": ["test_inspect_annotated_serializer", "test_inspect_validator_error"], "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": "@pytest.mark.parametrize('mode', ['before', 'after', 'plain'])\ndef test_inspect_validator_error(mode):\n def validator():\n pass\n\n def validator3(arg1, arg2, arg3):\n pass\n\n with pytest.raises(PydanticUserError) as e:\n inspect_validator(validator, mode=mode)\n\n assert e.value.code == 'validator-signature'\n\n with pytest.raises(PydanticUserError) as e:\n inspect_validator(validator3, mode=mode)\n\n assert e.value.code == 'validator-signature'\n\n\n@pytest.mark.parametrize('mode', ['plain', 'wrap'])\ndef test_inspect_annotated_serializer(mode):\n # TODO: add more erroneous cases\n def serializer():\n pass\n\n with pytest.raises(PydanticUserError) as e:\n inspect_annotated_serializer(serializer, mode=mode)\n\n assert e.value.code == 'field-serializer-signature'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_from_attributes_root_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_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": 51, "end_line": 126, "span_ids": ["test_from_attributes_root"], "tokens": 574}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 with pytest.warns(\n PydanticDeprecatedSince20, match='Pydantic V1 style `@root_validator` validators are deprecated.'\n ):\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\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\n with pytest.warns(\n PydanticDeprecatedSince20, match='Pydantic V1 style `@root_validator` validators are deprecated.'\n ):\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_docs.py_GroupModuleGlobals_print_callback.return.re_sub_r_https_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_GroupModuleGlobals_print_callback.return.re_sub_r_https_errors_", "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": 78, "span_ids": ["GroupModuleGlobals", "MockedDatetime", "impl:7", "GroupModuleGlobals.set", "MockedDatetime.now", "GroupModuleGlobals.__init__", "impl:9", "print_callback", "GroupModuleGlobals.get"], "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 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, tz=None, **kwargs):\n return datetime(2032, 1, 2, 3, 4, 5, 6, tzinfo=tz)\n\n\nskip_reason = skip_docs_tests()\nLINE_LENGTH = 80\n\n\ndef print_callback(print_statement: str) -> str:\n return re.sub(r'(https://errors.pydantic.dev)/.+?/', r'\\1/2/', print_statement)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_init_test_custom_init.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_custom_init_test_custom_init.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": 1318, "end_line": 1332, "span_ids": ["test_custom_init"], "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_custom_init():\n class Model(BaseModel):\n x: int\n\n def __init__(self, x: int, y: int):\n if isinstance(y, str):\n y = len(y)\n super().__init__(x=x + int(y))\n\n assert Model(x=1, y=1).x == 2\n assert Model.model_validate({'x': 1, 'y': 1}).x == 2\n assert Model.model_validate_json('{\"x\": 1, \"y\": 2}').x == 3\n\n # For documentation purposes: type hints on __init__ are not currently used for validation:\n assert Model.model_validate({'x': 1, 'y': 'abc'}).x == 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_nested_custom_init_test_init_inspection.assert_calls_x_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_nested_custom_init_test_init_inspection.assert_calls_x_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": 1335, "end_line": 1369, "span_ids": ["test_nested_custom_init", "test_init_inspection"], "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_nested_custom_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 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\n\n\ndef test_init_inspection():\n calls = []\n\n class Foobar(BaseModel):\n x: int\n\n def __init__(self, **data) -> None:\n with pytest.raises(AttributeError):\n calls.append(data)\n assert self.x\n super().__init__(**data)\n\n Foobar(x=1)\n Foobar.model_validate({'x': 2})\n Foobar.model_validate_json('{\"x\": 3}')\n assert calls == [{'x': 1}, {'x': 2}, {'x': 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_type_on_annotation_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_type_on_annotation_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": 1372, "end_line": 1387, "span_ids": ["test_type_on_annotation"], "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_type_on_annotation():\n class FooBar:\n pass\n\n class Model(BaseModel):\n a: Type[int]\n b: Type[int] = int\n c: Type[FooBar]\n d: Type[FooBar] = FooBar\n e: Sequence[Type[FooBar]] = [FooBar]\n f: Union[Type[FooBar], Sequence[Type[FooBar]]] = FooBar\n g: Union[Type[FooBar], Sequence[Type[FooBar]]] = [FooBar]\n\n model_config = dict(arbitrary_types_allowed=True)\n\n assert Model.model_fields.keys() == set('abcdefg')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_forward_ref_model_test_invalid_forward_ref_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_edge_cases.py_test_invalid_forward_ref_model_test_invalid_forward_ref_model.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": 2428, "end_line": 2475, "span_ids": ["test_invalid_forward_ref_model"], "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_invalid_forward_ref_model():\n \"\"\"\n This test is to document the fact that forward refs to a type with the same name as that of a field\n can cause problems, and to demonstrate a way to work around this.\n \"\"\"\n # The problem:\n if sys.version_info >= (3, 11):\n # See PR #8243, this was a RecursionError raised by Python, but is now caught on the Pydantic side\n error = errors.PydanticUserError\n else:\n error = TypeError\n with pytest.raises(error):\n\n class M(BaseModel):\n B: ForwardRef('B') = Field(default=None)\n\n # The solution:\n class A(BaseModel):\n B: ForwardRef('__types[\"B\"]') = Field() # F821\n\n assert A.model_fields['B'].annotation == ForwardRef('__types[\"B\"]') # F821\n A.model_rebuild(raise_errors=False)\n assert A.model_fields['B'].annotation == ForwardRef('__types[\"B\"]') # F821\n\n class B(BaseModel):\n pass\n\n class C(BaseModel):\n pass\n\n assert not A.__pydantic_complete__\n types = {'B': B}\n A.model_rebuild(_types_namespace={'__types': types})\n assert A.__pydantic_complete__\n\n assert A(B=B()).B == B()\n with pytest.raises(ValidationError) as exc_info:\n A(B=C())\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('B',),\n 'msg': 'Input should be a valid dictionary or instance of B',\n 'input': C(),\n 'ctx': {'class_name': '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_forward_ref.py_pytest_raises_user_error_for_undefined_type_pytest_raises_user_error_for_undefined_type.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_user_error_for_undefined_type_pytest_raises_user_error_for_undefined_type.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": 854, "end_line": 867, "span_ids": ["pytest_raises_user_error_for_undefined_type"], "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 pytest_raises_user_error_for_undefined_type(defining_class_name, missing_type_name):\n \"\"\"\n Returns a `pytest.raises` context manager that checks the error message when an undefined type is present.\n\n usage: `with pytest_raises_user_error_for_undefined_type(class_name='Foobar', missing_class_name='UndefinedType'):`\n \"\"\"\n\n return pytest.raises(\n PydanticUserError,\n match=re.escape(\n f'`{defining_class_name}` is not fully defined; you should define `{missing_type_name}`, then call'\n f' `{defining_class_name}.model_rebuild()`.'\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_user_e.module.Foobar_a_1_": {"__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_user_e.module.Foobar_a_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": 863, "end_line": 907, "span_ids": ["pytest_raises_user_error_for_undefined_type", "test_undefined_types_warning_1a_raised_by_default_2b_forward_ref", "test_undefined_types_warning_1a_raised_by_default_2a_future_annotations"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# 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 straightforward due to the use of the\n# `create_module` fixture and the requirement that `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_user_error_for_undefined_type(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# Trigger the error for an undefined type:\nFoobar(a=1)\n\"\"\"\n )\n\n\ndef test_undefined_types_warning_1a_raised_by_default_2b_forward_ref(create_module):\n with pytest_raises_user_error_for_undefined_type(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\n\n # Trigger the error for an undefined type\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_test_value_validation_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_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": 111, "end_line": 165, "span_ids": ["test_value_validation"], "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 test_value_validation():\n T = TypeVar('T', bound=Dict[Any, Any])\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 @model_validator(mode='after')\n def validate_sum(self) -> 'Response[T]':\n data = self.data\n if sum(data.values()) > 5:\n raise ValueError('sum too large')\n return self\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(include_url=False) == [\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('some value is zero')))},\n 'input': {1: 0},\n 'loc': ('data',),\n 'msg': 'Value error, some value is zero',\n 'type': 'value_error',\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('sum too large')))},\n 'input': {'data': {1: 3, 2: 6}},\n 'loc': (),\n 'msg': 'Value error, sum too large',\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_generics.py_test_methods_are_inherited_test_config_is_inherited.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_methods_are_inherited_test_config_is_inherited.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": 153, "end_line": 183, "span_ids": ["test_config_is_inherited", "test_methods_are_inherited"], "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_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(ValidationError) as exc_info:\n instance.data = 2\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_instance', 'loc': ('data',), 'msg': 'Instance is frozen', 'input': 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_default_argument_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_default_argument_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": 201, "end_line": 300, "span_ids": ["test_subclass_can_be_genericized", "test_default_argument", "test_parameters_placed_on_generic", "test_default_argument_for_typevar", "test_non_annotated_field", "test_must_inherit_from_generic", "test_non_generic_field", "test_parameters_must_be_typevar", "test_classvar"], "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 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_generic_with_user_defined_generic_field_test_generic_with_user_defined_generic_field.with_pytest_raises_Valida.model.Model_int_field_a_": {"__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_generic_with_user_defined_generic_field.with_pytest_raises_Valida.model.Model_int_field_a_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1858, "end_line": 1873, "span_ids": ["test_generic_with_user_defined_generic_field"], "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_generic_with_user_defined_generic_field():\n T = TypeVar('T')\n\n class GenericList(List[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(GenericList, handler(List[get_args(source_type)[0]]))\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'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_intenum_bound_test_generic_intenum_bound.assert_Model_MyEnum_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_intenum_bound_test_generic_intenum_bound.assert_Model_MyEnum_mode", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2446, "end_line": 2495, "span_ids": ["test_generic_intenum_bound"], "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_generic_intenum_bound():\n T = TypeVar('T', bound=IntEnum)\n\n class MyEnum(IntEnum):\n a = 1\n\n class OtherEnum(IntEnum):\n b = 2\n\n class Model(BaseModel, Generic[T]):\n x: T\n\n m = Model(x=MyEnum.a)\n assert m.x == MyEnum.a\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=1)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'IntEnum'},\n 'input': 1,\n 'loc': ('x',),\n 'msg': 'Input should be an instance of IntEnum',\n 'type': 'is_instance_of',\n }\n ]\n\n m2 = Model[MyEnum](x=MyEnum.a)\n assert m2.x == MyEnum.a\n\n with pytest.raises(ValidationError) as exc_info:\n Model[MyEnum](x=OtherEnum.b)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'expected': '1'},\n 'input': 2,\n 'loc': ('x',),\n 'msg': 'Input should be 1',\n 'type': 'enum',\n }\n ]\n\n # insert_assert(Model[MyEnum].model_json_schema())\n assert Model[MyEnum].model_json_schema() == {\n '$defs': {'MyEnum': {'const': 1, 'enum': [1], 'title': 'MyEnum', 'type': 'integer'}},\n 'properties': {'x': {'$ref': '#/$defs/MyEnum'}},\n 'required': ['x'],\n 'title': 'Model[test_generic_intenum_bound..MyEnum]',\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_generics.py_test_variadic_generic_init_test_variadic_generic_init.assert_my_toolbox_all_com": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_variadic_generic_init_test_variadic_generic_init.assert_my_toolbox_all_com", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2380, "end_line": 2413, "span_ids": ["test_variadic_generic_init"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(sys.version_info < (3, 11), reason='requires python 3.11 or higher')\n@pytest.mark.xfail(\n reason='TODO: Variadic generic parametrization is not supported yet;'\n ' Issue: https://github.com/pydantic/pydantic/issues/5804'\n)\ndef test_variadic_generic_init():\n class ComponentModel(BaseModel):\n pass\n\n class Wrench(ComponentModel):\n pass\n\n class Screwdriver(ComponentModel):\n pass\n\n ComponentVar = TypeVar('ComponentVar', bound=ComponentModel)\n NumberOfComponents = TypeVarTuple('NumberOfComponents')\n\n class VariadicToolbox(BaseModel, Generic[ComponentVar, Unpack[NumberOfComponents]]):\n main_component: ComponentVar\n left_component_pocket: Optional[list[ComponentVar]] = Field(default_factory=list)\n right_component_pocket: Optional[list[ComponentVar]] = Field(default_factory=list)\n\n @computed_field\n @property\n def all_components(self) -> tuple[ComponentVar, Unpack[NumberOfComponents]]:\n return (self.main_component, *self.left_component_pocket, *self.right_component_pocket)\n\n sa, sb, w = Screwdriver(), Screwdriver(), Wrench()\n my_toolbox = VariadicToolbox[Screwdriver, Screwdriver, Wrench](\n main_component=sa, left_component_pocket=[w], right_component_pocket=[sb]\n )\n\n assert my_toolbox.all_components == [sa, w, sb]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py_test_representation_integrations_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py_test_representation_integrations_", "embedding": null, "metadata": {"file_path": "tests/test_internal.py", "file_name": "test_internal.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 209, "span_ids": ["test_schema_is_valid", "test_representation_integrations"], "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_representation_integrations():\n devtools = pytest.importorskip('devtools')\n\n @dataclass\n class Obj(Representation):\n int_attr: int = 42\n str_attr: str = 'Marvin'\n\n obj = Obj()\n\n assert str(devtools.debug.format(obj)).split('\\n')[1:] == [\n ' Obj(',\n ' int_attr=42,',\n \" str_attr='Marvin',\",\n ' ) (Obj)',\n ]\n assert list(obj.__rich_repr__()) == [('int_attr', 42), ('str_attr', 'Marvin')]\n\n\ndef test_schema_is_valid():\n assert collect_invalid_schemas(cs.none_schema()) is False\n assert (\n collect_invalid_schemas(cs.nullable_schema(cs.int_schema(metadata={HAS_INVALID_SCHEMAS_METADATA_KEY: True})))\n is 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_json_schema.py_test_special_decimal_types_test_special_decimal_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_decimal_types_test_special_decimal_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": 980, "end_line": 1000, "span_ids": ["test_special_decimal_types"], "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.parametrize(\n 'field_type,expected_schema',\n [\n (condecimal(gt=5, lt=10), {'exclusiveMinimum': 5, 'exclusiveMaximum': 10}),\n (condecimal(ge=5, le=10), {'minimum': 5, 'maximum': 10}),\n (condecimal(multiple_of=5), {'multipleOf': 5}),\n ],\n)\ndef test_special_decimal_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': {'anyOf': [{'type': 'number'}, {'type': 'string'}], 'title': 'A'}},\n 'required': ['a'],\n }\n base_schema['properties']['a']['anyOf'][0].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_constraints_schema_validation_test_constraints_schema_validation.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_validation_test_constraints_schema_validation.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": 1601, "end_line": 1641, "span_ids": ["test_constraints_schema_validation"], "tokens": 723}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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, {'anyOf': [{'exclusiveMinimum': 2.0, 'type': 'number'}, {'type': 'string'}]}),\n ({'lt': 5}, Decimal, {'anyOf': [{'type': 'number', 'exclusiveMaximum': 5}, {'type': 'string'}]}),\n ({'ge': 2}, Decimal, {'anyOf': [{'type': 'number', 'minimum': 2}, {'type': 'string'}]}),\n ({'le': 5}, Decimal, {'anyOf': [{'type': 'number', 'maximum': 5}, {'type': 'string'}]}),\n ({'multiple_of': 5}, Decimal, {'anyOf': [{'type': 'number', 'multipleOf': 5}, {'type': 'string'}]}),\n ],\n)\ndef test_constraints_schema_validation(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(mode='validation') == 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_serialization_test_constraints_schema_serialization.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_serialization_test_constraints_schema_serialization.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": 1887, "end_line": 1927, "span_ids": ["test_constraints_schema_serialization"], "tokens": 629}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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': 'string'}),\n ({'lt': 5}, Decimal, {'type': 'string'}),\n ({'ge': 2}, Decimal, {'type': 'string'}),\n ({'le': 5}, Decimal, {'type': 'string'}),\n ({'multiple_of': 5}, Decimal, {'type': 'string'}),\n ],\n)\ndef test_constraints_schema_serialization(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(mode='serialization') == 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_passes_test_constraints_schema_validation_passes.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_passes_test_constraints_schema_validation_passes.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": 1688, "end_line": 1724, "span_ids": ["test_constraints_schema_validation_passes"], "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": "@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_passes(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_annotated_get_json_schema_test_annotated_get_json_schema.assert_sum_calls_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_annotated_get_json_schema_test_annotated_get_json_schema.assert_sum_calls_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": 3737, "end_line": 3755, "span_ids": ["test_annotated_get_json_schema"], "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_annotated_get_json_schema() -> None:\n calls: List[int] = []\n\n class CustomType(str):\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source_type: Any, handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n return handler(str)\n\n @classmethod\n def __get_pydantic_json_schema__(cls, schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n calls.append(1)\n json_schema = handler(schema)\n return json_schema\n\n TypeAdapter(Annotated[CustomType, 123]).json_schema()\n\n assert sum(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_json_schema.py_test_serialization_validation_interaction_test_serialization_validation_interaction.assert_vs_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_serialization_validation_interaction_test_serialization_validation_interaction.assert_vs_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": 4666, "end_line": 4751, "span_ids": ["test_serialization_validation_interaction"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_serialization_validation_interaction():\n class Inner(BaseModel):\n x: Json[int]\n\n class Outer(BaseModel):\n inner: Inner\n\n _, v_schema = models_json_schema([(Outer, 'validation')])\n assert v_schema == {\n '$defs': {\n 'Inner': {\n 'properties': {\n 'x': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'type': 'integer'},\n 'title': 'X',\n 'type': 'string',\n }\n },\n 'required': ['x'],\n 'title': 'Inner',\n 'type': 'object',\n },\n 'Outer': {\n 'properties': {'inner': {'$ref': '#/$defs/Inner'}},\n 'required': ['inner'],\n 'title': 'Outer',\n 'type': 'object',\n },\n }\n }\n\n _, s_schema = models_json_schema([(Outer, 'serialization')])\n assert s_schema == {\n '$defs': {\n 'Inner': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Inner',\n 'type': 'object',\n },\n 'Outer': {\n 'properties': {'inner': {'$ref': '#/$defs/Inner'}},\n 'required': ['inner'],\n 'title': 'Outer',\n 'type': 'object',\n },\n }\n }\n\n _, vs_schema = models_json_schema([(Outer, 'validation'), (Outer, 'serialization')])\n assert vs_schema == {\n '$defs': {\n 'Inner-Input': {\n 'properties': {\n 'x': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'type': 'integer'},\n 'title': 'X',\n 'type': 'string',\n }\n },\n 'required': ['x'],\n 'title': 'Inner',\n 'type': 'object',\n },\n 'Inner-Output': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Inner',\n 'type': 'object',\n },\n 'Outer-Input': {\n 'properties': {'inner': {'$ref': '#/$defs/Inner-Input'}},\n 'required': ['inner'],\n 'title': 'Outer',\n 'type': 'object',\n },\n 'Outer-Output': {\n 'properties': {'inner': {'$ref': '#/$defs/Inner-Output'}},\n 'required': ['inner'],\n 'title': 'Outer',\n 'type': 'object',\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_computed_field_test_computed_field.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_computed_field_test_computed_field.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": 4768, "end_line": 4791, "span_ids": ["test_computed_field"], "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_computed_field():\n class Model(BaseModel):\n x: int\n\n @computed_field\n @property\n def double_x(self) -> int:\n return 2 * self.x\n\n assert Model.model_json_schema(mode='validation') == {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Model',\n 'type': 'object',\n }\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {\n 'double_x': {'readOnly': True, 'title': 'Double X', 'type': 'integer'},\n 'x': {'title': 'X', 'type': 'integer'},\n },\n 'required': ['x', 'double_x'],\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_serialization_schema_with_exclude_test_serialization_schema_with_exclude.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_serialization_schema_with_exclude_test_serialization_schema_with_exclude.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": 4794, "end_line": 4817, "span_ids": ["test_serialization_schema_with_exclude"], "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_serialization_schema_with_exclude():\n class MyGenerateJsonSchema(GenerateJsonSchema):\n def field_is_present(self, field) -> bool:\n # Always include fields in the JSON schema, even if excluded from serialization\n return True\n\n class Model(BaseModel):\n x: int\n y: int = Field(exclude=True)\n\n assert Model(x=1, y=1).model_dump() == {'x': 1}\n\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Model',\n 'type': 'object',\n }\n assert Model.model_json_schema(mode='serialization', schema_generator=MyGenerateJsonSchema) == {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}, 'y': {'title': 'Y', 'type': 'integer'}},\n 'required': ['x', 'y'],\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_main.py_test_extra_broken_via_pydantic_extra_interference_test_extra_broken_via_pydantic_extra_interference.assert_e_value_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_broken_via_pydantic_extra_interference_test_extra_broken_via_pydantic_extra_interference.assert_e_value_args_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 353, "end_line": 375, "span_ids": ["test_extra_broken_via_pydantic_extra_interference"], "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_extra_broken_via_pydantic_extra_interference():\n \"\"\"\n At the time of writing this test there is `_model_construction.model_extra_getattr` being assigned to model's\n `__getattr__`. The method then expects `BaseModel.__pydantic_extra__` isn't `None`. Both this actions happen when\n `model_config.extra` is set to `True`. However, this behavior could be accidentally broken in a subclass of\n `BaseModel`. In that case `AttributeError` should be thrown when `__getattr__` is being accessed essentially\n disabling the `extra` functionality.\n \"\"\"\n\n class BrokenExtraBaseModel(BaseModel):\n def model_post_init(self, __context: Any) -> None:\n super().model_post_init(__context)\n object.__setattr__(self, '__pydantic_extra__', None)\n\n class Model(BrokenExtraBaseModel):\n model_config = ConfigDict(extra='allow')\n\n m = Model(extra_field='some extra value')\n\n with pytest.raises(AttributeError) as e:\n m.extra_field\n\n assert e.value.args == (\"'Model' object has no attribute 'extra_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_main.py_test_mapping_subclass_as_input_test_mapping_subclass_as_input.assert_v_one_1_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_mapping_subclass_as_input_test_mapping_subclass_as_input.assert_v_one_1_t", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1614, "end_line": 1632, "span_ids": ["test_mapping_subclass_as_input"], "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_mapping_subclass_as_input():\n class CustomMap(dict):\n pass\n\n class Model(BaseModel):\n x: Mapping[str, int]\n\n d = CustomMap()\n d['one'] = 1\n d['two'] = 2\n\n v = Model(x=d).x\n # we don't promise that this will or will not be a CustomMap\n # all we promise is that it _will_ be a mapping\n assert isinstance(v, Mapping)\n # but the current behavior is that it will be a dict, not a CustomMap\n # so document that here\n assert not isinstance(v, CustomMap)\n assert v == {'one': 1, 'two': 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_typing_coercion_dict_MyDict.__repr__.return.f_MyDict_super___repr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_typing_coercion_dict_MyDict.__repr__.return.f_MyDict_super___repr_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1635, "end_line": 1649, "span_ids": ["MyDict.__repr__", "MyDict", "test_typing_coercion_dict", "impl"], "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_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__()})'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_with_context_test_model_validate_with_context.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_with_context_test_model_validate_with_context.None_2", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2154, "end_line": 2167, "span_ids": ["test_model_validate_with_context"], "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_model_validate_with_context():\n class InnerModel(BaseModel):\n x: int\n\n @field_validator('x')\n def validate(cls, value, info):\n return value * info.context.get('multiplier', 1)\n\n class OuterModel(BaseModel):\n inner: InnerModel\n\n assert OuterModel.model_validate({'inner': {'x': 2}}, context={'multiplier': 1}).inner.x == 2\n assert OuterModel.model_validate({'inner': {'x': 2}}, context={'multiplier': 2}).inner.x == 4\n assert OuterModel.model_validate({'inner': {'x': 2}}, context={'multiplier': 3}).inner.x == 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_networks.py_test_nullable_http_url_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_nullable_http_url_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": 278, "end_line": 309, "span_ids": ["test_http_url_invalid", "test_nullable_http_url"], "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_nullable_http_url():\n class Model(BaseModel):\n v: Union[HttpUrl, None]\n\n assert Model(v=None).v is None\n assert str(Model(v='http://example.org').v) == 'http://example.org/'\n\n\n@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(include_url=False)) == 1, exc_info.value.errors(include_url=False)\n error = exc_info.value.errors(include_url=False)[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_custom_schemes_test_custom_schemes.None_2.Model_v_ws_foo_bar_": {"__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_custom_schemes.None_2.Model_v_ws_foo_bar_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 640, "end_line": 657, "span_ids": ["test_custom_schemes"], "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_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')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_url_constraints_hash_equal_test_url_constraints_hash_equal.assert_hash_UrlConstraint": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_url_constraints_hash_equal_test_url_constraints_hash_equal.assert_hash_UrlConstraint", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 660, "end_line": 682, "span_ids": ["test_url_constraints_hash_equal"], "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": "@pytest.mark.parametrize(\n 'options',\n [\n # Ensures the hash is generated correctly when a field is null\n {'max_length': None},\n {'allowed_schemes': None},\n {'host_required': None},\n {'default_host': None},\n {'default_port': None},\n {'default_path': None},\n ],\n)\ndef test_url_constraints_hash_equal(options):\n defaults = {\n 'max_length': 1,\n 'allowed_schemes': ['scheme'],\n 'host_required': False,\n 'default_host': 'host',\n 'default_port': 0,\n 'default_path': 'path',\n }\n options = {**defaults, **options}\n assert hash(UrlConstraints(**options)) == hash(UrlConstraints(**options))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_url_constraints_hash_inequal_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_url_constraints_hash_inequal_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": 685, "end_line": 719, "span_ids": ["test_json", "test_url_constraints_hash_inequal"], "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": "@pytest.mark.parametrize(\n 'changes',\n [\n {'max_length': 2},\n {'allowed_schemes': ['new-scheme']},\n {'host_required': True},\n {'default_host': 'new-host'},\n {'default_port': 1},\n {'default_path': 'new-path'},\n {'max_length': None},\n {'allowed_schemes': None},\n {'host_required': None},\n {'default_host': None},\n {'default_port': None},\n {'default_path': None},\n ],\n)\ndef test_url_constraints_hash_inequal(changes):\n options = {\n 'max_length': 1,\n 'allowed_schemes': ['scheme'],\n 'host_required': False,\n 'default_host': 'host',\n 'default_port': 0,\n 'default_path': 'path',\n }\n assert hash(UrlConstraints(**options)) != hash(UrlConstraints(**{**options, **changes}))\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_private_attributes.py_test_private_attributes_not_dunder_test_ignored_types_are_ignored.assert_sorted_MyModel___p": {"__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_test_ignored_types_are_ignored.assert_sorted_MyModel___p", "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": 289, "end_line": 317, "span_ids": ["test_private_attributes_not_dunder", "test_ignored_types_are_ignored"], "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_private_attributes_not_dunder() -> None:\n with pytest.raises(\n NameError,\n match='Private attributes must not use dunder names;' \" use a single underscore prefix instead of '__foo__'.\",\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, which is to make them into PrivateAttrs\n # this can be updated if the current behavior is not the desired behavior\n _e: int\n _f: int = 1\n _g = 1\n\n assert sorted(MyModel.__private_attributes__.keys()) == ['_e', '_f', '_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_serialize.py_test_serialize_extra_allow_subclass_2_test_serialize_extra_allow_subclass_2.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_extra_allow_subclass_2_test_serialize_extra_allow_subclass_2.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": 53, "end_line": 72, "span_ids": ["test_serialize_extra_allow_subclass_2"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_serialize_extra_allow_subclass_2() -> None:\n class Parent(BaseModel):\n x: int\n model_config = ConfigDict(extra='allow')\n\n class Child(Parent):\n y: int\n\n class Model(BaseModel):\n inner: Parent\n\n m = Model(inner=Child(x=1, y=2))\n assert m.inner.y == 2\n assert m.model_dump() == {'inner': {'x': 1}}\n assert json.loads(m.model_dump_json()) == {'inner': {'x': 1}}\n\n m = Model(inner=Parent(x=1, y=2))\n assert m.inner.y == 2\n assert m.model_dump() == {'inner': {'x': 1, 'y': 2}}\n assert json.loads(m.model_dump_json()) == {'inner': {'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_serialize.py_test_serializer_allow_reuse_different_field_4_test_serializer_allow_reuse_different_field_4.assert_Model_x_1_000_y_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serializer_allow_reuse_different_field_4_test_serializer_allow_reuse_different_field_4.assert_Model_x_1_000_y_2", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 760, "end_line": 771, "span_ids": ["test_serializer_allow_reuse_different_field_4"], "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_serializer_allow_reuse_different_field_4():\n def ser(self: Any, _v: int, _info: Any) -> str:\n return f'{_v:,}'\n\n class Model(BaseModel):\n x: int\n y: int\n\n ser_x = field_serializer('x')(ser)\n not_ser_x = field_serializer('y')(ser)\n\n assert Model(x=1_000, y=2_000).model_dump() == {'x': '1,000', 'y': '2,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_any_model_test_serialize_any_model.assert_AnyModel_x_m_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_any_model_test_serialize_any_model.assert_AnyModel_x_m_mode", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 774, "end_line": 788, "span_ids": ["test_serialize_any_model"], "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_serialize_any_model():\n class Model(BaseModel):\n m: str\n\n @field_serializer('m')\n def ser_m(self, v: str, _info: SerializationInfo) -> str:\n return f'custom:{v}'\n\n class AnyModel(BaseModel):\n x: Any\n\n m = Model(m='test')\n assert m.model_dump() == {'m': 'custom:test'}\n assert to_jsonable_python(AnyModel(x=m)) == {'x': {'m': 'custom:test'}}\n assert AnyModel(x=m).model_dump() == {'x': {'m': 'custom: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_types_typeddict.py_test_typeddict_from_attributes_test_typeddict_from_attributes.None_1.FromAttributesModel_u_Use": {"__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.None_1.FromAttributesModel_u_Use", "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": 290, "span_ids": ["test_typeddict_from_attributes"], "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_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 FromAttributesCls:\n def __init__(self, u: User):\n self.u = u\n\n class Model(BaseModel):\n u: Annotated[User, Field(strict=False)]\n\n class FromAttributesModel(BaseModel, from_attributes=True):\n u: Annotated[User, Field(strict=False)]\n\n # You can validate the TypedDict from attributes from a type that has a field with an appropriate attribute\n assert FromAttributesModel.model_validate(FromAttributesCls(u={'name': 'foo', 'age': 15}))\n\n # The normal case: you can't populate a TypedDict from attributes with the relevant config setting disabled\n with pytest.raises(ValidationError, match='Input should be a valid dictionary'):\n Model(u=UserCls('foo', 15))\n\n # Going further: even with from_attributes allowed, it won't attempt to populate a TypedDict from attributes\n with pytest.raises(ValidationError, match='Input should be a valid dictionary'):\n FromAttributesModel(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_utils.py_test_all_identical_test_all_identical.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_all_identical_test_all_identical.assert_", "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": 443, "span_ids": ["test_all_identical"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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.'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_undefined_pickle_test_snake2camel_start_lower.assert_to_camel_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_undefined_pickle_test_snake2camel_start_lower.assert_to_camel_value_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 466, "end_line": 498, "span_ids": ["test_on_lower_camel_many_length", "test_on_lower_camel_one_length", "test_on_lower_camel_zero_length", "test_snake2camel_start_lower", "test_undefined_pickle"], "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_undefined_pickle():\n undefined2 = pickle.loads(pickle.dumps(PydanticUndefined))\n assert undefined2 is PydanticUndefined\n\n\ndef test_on_lower_camel_zero_length():\n assert to_camel('') == ''\n\n\ndef test_on_lower_camel_one_length():\n assert to_camel('a') == 'a'\n\n\ndef test_on_lower_camel_many_length():\n assert to_camel('i_like_turtles') == 'iLikeTurtles'\n\n\n@pytest.mark.parametrize(\n 'value,result',\n [\n ('snake_to_camel', 'snakeToCamel'),\n ('snake_2_camel', 'snake2Camel'),\n ('snake2camel', 'snake2Camel'),\n ('_snake_to_camel', '_snakeToCamel'),\n ('snake_to_camel_', 'snakeToCamel_'),\n ('__snake_to_camel__', '__snakeToCamel__'),\n ('snake_2', 'snake2'),\n ('_snake_2', '_snake2'),\n ('snake_2_', 'snake2_'),\n ],\n)\ndef test_snake2camel_start_lower(value: str, result: str) -> None:\n assert to_camel(value) == 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_utils.py_test_snake2camel_test_snake2camel.assert_to_pascal_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_snake2camel_test_snake2camel.assert_to_pascal_value_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 481, "end_line": 496, "span_ids": ["test_snake2camel"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n ('snake_to_camel', 'SnakeToCamel'),\n ('snake_2_camel', 'Snake2Camel'),\n ('snake2camel', 'Snake2Camel'),\n ('_snake_to_camel', '_SnakeToCamel'),\n ('snake_to_camel_', 'SnakeToCamel_'),\n ('__snake_to_camel__', '__SnakeToCamel__'),\n ('snake_2', 'Snake2'),\n ('_snake_2', '_Snake2'),\n ('snake_2_', 'Snake2_'),\n ],\n)\ndef test_snake2camel(value: str, result: str) -> None:\n assert to_pascal(value) == 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_validators.py_test_wildcard_validators_test_wildcard_validators.assert_calls_": {"__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_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 712, "end_line": 750, "span_ids": ["test_wildcard_validators"], "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 'decorator, pytest_warns',\n [\n (validator, pytest.warns(PydanticDeprecatedSince20, match=V1_VALIDATOR_DEPRECATION_MATCH)),\n (field_validator, contextlib.nullcontext()),\n ],\n)\ndef test_wildcard_validators(decorator, pytest_warns):\n calls: list[tuple[str, Any]] = []\n\n with pytest_warns:\n\n class Model(BaseModel):\n a: str\n b: int\n\n @decorator('a')\n def check_a(cls, v: Any) -> Any:\n calls.append(('check_a', v))\n return v\n\n @decorator('*')\n def check_all(cls, v: Any) -> Any:\n calls.append(('check_all', v))\n return v\n\n @decorator('*', 'a')\n def check_all_a(cls, v: Any) -> Any:\n calls.append(('check_all_a', v))\n return v\n\n assert Model(a='abc', b='123').model_dump() == dict(a='abc', b=123)\n assert calls == [\n ('check_a', 'abc'),\n ('check_all', 'abc'),\n ('check_all_a', 'abc'),\n ('check_all', 123),\n ('check_all_a', 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_validators.py_test_invalid_field_test_invalid_field.with_pytest_raises_errors.Model.check_b.return.v": {"__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_invalid_field.with_pytest_raises_errors.Model.check_b.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": 769, "end_line": 782, "span_ids": ["test_invalid_field"], "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_invalid_field():\n msg = (\n r'Decorators defined with incorrect fields:'\n r' tests.test_validators.test_invalid_field..Model:\\d+.check_b'\n r\" \\(use check_fields=False if you're inheriting from the model and intended this\\)\"\n )\n with pytest.raises(errors.PydanticUserError, match=msg):\n\n class Model(BaseModel):\n a: str\n\n @field_validator('b')\n def check_b(cls, v: Any):\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_validate_child_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_validate_child_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": 785, "end_line": 800, "span_ids": ["test_validate_child"], "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_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_inheritance_replace_root_validator_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_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": 978, "end_line": 1022, "span_ids": ["test_inheritance_replace_root_validator"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_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 with pytest.warns(PydanticDeprecatedSince20):\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\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_root_validator_pre.assert_Model_a_123_b__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.assert_Model_a_123_b__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": 1444, "end_line": 1458, "span_ids": ["test_root_validator_pre"], "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_root_validator_pre():\n # ... other code\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('foobar')))},\n 'input': {'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_validators.py_test_union_literal_with_constraints_test_union_literal_with_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_validators.py_test_union_literal_with_constraints_test_union_literal_with_constraints.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": 1639, "end_line": 1648, "span_ids": ["test_union_literal_with_constraints"], "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": "def 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(ValidationError) as exc_info:\n m.x += 1\n assert exc_info.value.errors(include_url=False) == [\n {'input': 43, 'loc': ('x',), 'msg': 'Field is frozen', 'type': 'frozen_field'}\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 1683, "end_line": 1703, "span_ids": ["test_field_that_is_being_validated_is_excluded_from_validator_values"], "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_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: ValidationInfo) -> Any:\n check_values({**info.data})\n return v\n\n @field_validator('bar')\n @classmethod\n def validate_bar(cls, v: Any, info: ValidationInfo) -> 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_validating_assignment_model_validator_before_fail_test_validating_assignment_model_validator_before_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_model_validator_before_fail_test_validating_assignment_model_validator_before_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": 1804, "end_line": 1829, "span_ids": ["test_validating_assignment_model_validator_before_fail"], "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_validating_assignment_model_validator_before_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 @model_validator(mode='before')\n def values_are_not_string(cls, values: Dict[str, Any]) -> Dict[str, Any]:\n assert isinstance(values, dict)\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('values cannot be a string')))},\n 'input': {'current_value': '100', 'max_value': 200.0},\n 'loc': (),\n 'msg': 'Value error, values cannot be a string',\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.py_test_model_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_model_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": 1872, "end_line": 1897, "span_ids": ["test_model_validator_many_values_change", "_get_source_line"], "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_model_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 @model_validator(mode='after')\n def set_area(self) -> 'Rectangle':\n self.__dict__['area'] = self.width * self.height\n return self\n\n r = Rectangle(width=1, height=1)\n assert r.area == 1\n r.height = 5\n assert r.area == 5\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_dataclass.py_test_model_validator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators_dataclass.py_test_model_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": 152, "end_line": 188, "span_ids": ["test_model_validator"], "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_model_validator():\n root_val_values: list[Any] = []\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: str) -> str:\n return v * 2\n\n @model_validator(mode='after')\n def root_validator(self) -> 'MyDataclass':\n root_val_values.append(asdict(self))\n if 'snap' in self.b:\n raise ValueError('foobar')\n self.b = 'changed'\n return self\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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('foobar')))},\n 'input': HasRepr(\"ArgsKwargs((1,), {'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/pydantic/_internal/_core_utils.py_from___future___import_an_is_list_like_schema_with_items_schema.return.schema_type_in__LIST_L": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_from___future___import_an_is_list_like_schema_with_items_schema.return.schema_type_in__LIST_L", "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": 74, "span_ids": ["imports", "is_list_like_schema_with_items_schema", "is_core_schema_field", "is_core_schema", "is_function_with_inner_schema"], "tokens": 524}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 os\nfrom collections import defaultdict\nfrom typing import (\n Any,\n Callable,\n Hashable,\n TypeVar,\n Union,\n)\n\nfrom pydantic_core import CoreSchema, core_schema\nfrom pydantic_core import validate_core_schema as _validate_core_schema\nfrom typing_extensions import TypeAliasType, TypeGuard, get_args, get_origin\n\nfrom . import _repr\nfrom ._typing_extra import is_generic_alias\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\nCoreSchemaField = Union[\n core_schema.ModelField, core_schema.DataclassField, core_schema.TypedDictField, core_schema.ComputedField\n]\nCoreSchemaOrField = Union[core_schema.CoreSchema, CoreSchemaField]\n\n_CORE_SCHEMA_FIELD_TYPES = {'typed-dict-field', 'dataclass-field', 'model-field', 'computed-field'}\n_FUNCTION_WITH_INNER_SCHEMA_TYPES = {'function-before', 'function-after', 'function-wrap'}\n_LIST_LIKE_SCHEMA_WITH_ITEMS_TYPES = {'list', 'set', 'frozenset'}\n\nTAGGED_UNION_TAG_KEY = 'pydantic.internal.tagged_union_tag'\n\"\"\"\nUsed in a `Tag` schema to specify the tag used for a discriminated union.\n\"\"\"\nHAS_INVALID_SCHEMAS_METADATA_KEY = 'pydantic.internal.invalid'\n\"\"\"Used to mark a schema that is invalid because it refers to a definition that was not yet defined when the\nschema was first encountered.\n\"\"\"\n\n\ndef is_core_schema(\n schema: CoreSchemaOrField,\n) -> TypeGuard[CoreSchema]:\n return schema['type'] not in _CORE_SCHEMA_FIELD_TYPES\n\n\ndef is_core_schema_field(\n schema: CoreSchemaOrField,\n) -> TypeGuard[CoreSchemaField]:\n return schema['type'] in _CORE_SCHEMA_FIELD_TYPES\n\n\ndef is_function_with_inner_schema(\n schema: CoreSchemaOrField,\n) -> TypeGuard[FunctionSchemaWithInnerSchema]:\n return schema['type'] in _FUNCTION_WITH_INNER_SCHEMA_TYPES\n\n\ndef is_list_like_schema_with_items_schema(\n schema: CoreSchema,\n) -> TypeGuard[core_schema.ListSchema | core_schema.SetSchema | core_schema.FrozenSetSchema]:\n return schema['type'] in _LIST_LIKE_SCHEMA_WITH_ITEMS_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/pydantic/_internal/_core_utils.py__WalkCoreSchema.handle_typed_dict_schema__WalkCoreSchema.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__WalkCoreSchema.handle_typed_dict_schema__WalkCoreSchema.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": 359, "end_line": 376, "span_ids": ["_WalkCoreSchema.handle_typed_dict_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": "class _WalkCoreSchema:\n\n def handle_typed_dict_schema(self, schema: core_schema.TypedDictSchema, f: Walk) -> core_schema.CoreSchema:\n extras_schema = schema.get('extras_schema')\n if extras_schema is not None:\n schema['extras_schema'] = self.walk(extras_schema, f)\n replaced_computed_fields: list[core_schema.ComputedField] = []\n for computed_field in schema.get('computed_fields', ()):\n replaced_field = computed_field.copy()\n replaced_field['return_schema'] = self.walk(computed_field['return_schema'], f)\n replaced_computed_fields.append(replaced_field)\n if replaced_computed_fields:\n schema['computed_fields'] = replaced_computed_fields\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'], f)\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__WalkCoreSchema.handle_dataclass_args_schema__WalkCoreSchema.handle_dataclass_args_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__WalkCoreSchema.handle_dataclass_args_schema__WalkCoreSchema.handle_dataclass_args_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": 378, "end_line": 392, "span_ids": ["_WalkCoreSchema.handle_dataclass_args_schema"], "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 _WalkCoreSchema:\n\n def handle_dataclass_args_schema(self, schema: core_schema.DataclassArgsSchema, f: Walk) -> core_schema.CoreSchema:\n replaced_fields: list[core_schema.DataclassField] = []\n replaced_computed_fields: list[core_schema.ComputedField] = []\n for computed_field in schema.get('computed_fields', ()):\n replaced_field = computed_field.copy()\n replaced_field['return_schema'] = self.walk(computed_field['return_schema'], f)\n replaced_computed_fields.append(replaced_field)\n if replaced_computed_fields:\n schema['computed_fields'] = replaced_computed_fields\n for field in schema['fields']:\n replaced_field = field.copy()\n replaced_field['schema'] = self.walk(field['schema'], f)\n replaced_fields.append(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/_decorators.py_DecoratorInfos.build_DecoratorInfos.build.to_replace._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfos.build_DecoratorInfos.build.to_replace._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 419, "end_line": 447, "span_ids": ["DecoratorInfos.build"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclass(**slots_true)\nclass DecoratorInfos:\n\n @staticmethod\n def build(model_dc: type[Any]) -> DecoratorInfos: # noqa: C901 (ignore complexity)\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 # reminder: dicts are ordered and replacement does not alter the order\n res = DecoratorInfos()\n for base in reversed(mro(model_dc)[1:]):\n existing: DecoratorInfos | None = base.__dict__.get('__pydantic_decorators__')\n if existing is None:\n existing = DecoratorInfos.build(base)\n res.validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.validators.items()})\n res.field_validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.field_validators.items()})\n res.root_validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.root_validators.items()})\n res.field_serializers.update({k: v.bind_to_cls(model_dc) for k, v in existing.field_serializers.items()})\n res.model_serializers.update({k: v.bind_to_cls(model_dc) for k, v in existing.model_serializers.items()})\n res.model_validators.update({k: v.bind_to_cls(model_dc) for k, v in existing.model_validators.items()})\n res.computed_fields.update({k: v.bind_to_cls(model_dc) for k, v in existing.computed_fields.items()})\n\n to_replace: list[tuple[str, Any]] = []\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_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": 1129, "end_line": 1154, "span_ids": ["GenerateSchema._union_schema"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _union_schema(self, union_type: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for a Union.\"\"\"\n args = self._get_args_resolving_forward_refs(union_type, required=True)\n choices: list[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 choices_with_tags: list[CoreSchema | tuple[CoreSchema, str]] = []\n for choice in choices:\n tag = choice.get('metadata', {}).get(_core_utils.TAGGED_UNION_TAG_KEY)\n if tag is not None:\n choices_with_tags.append((choice, tag))\n else:\n choices_with_tags.append(choice)\n s = core_schema.union_schema(choices_with_tags)\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._type_alias_type_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._type_alias_type_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": 1134, "end_line": 1160, "span_ids": ["GenerateSchema._type_alias_type_schema", "GenerateSchema._literal_schema"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _type_alias_type_schema(\n self,\n obj: Any, # TypeAliasType\n ) -> CoreSchema:\n with self.defs.get_schema_or_ref(obj) as (ref, maybe_schema):\n if maybe_schema is not None:\n return maybe_schema\n\n origin = get_origin(obj) or obj\n\n annotation = origin.__value__\n typevars_map = get_standard_typevars_map(obj)\n\n with self._types_namespace_stack.push(origin):\n annotation = _typing_extra.eval_type_lenient(annotation, self._types_namespace)\n annotation = replace_types(annotation, typevars_map)\n schema = self.generate_schema(annotation)\n assert schema['type'] != 'definitions'\n schema['ref'] = ref # type: ignore\n self.defs.definitions[ref] = schema\n return core_schema.definition_reference_schema(ref)\n\n def _literal_schema(self, literal_type: Any) -> CoreSchema:\n \"\"\"Generate schema for a Literal.\"\"\"\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._pattern_schema_GenerateSchema._hashable_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._pattern_schema_GenerateSchema._hashable_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": 1327, "end_line": 1360, "span_ids": ["GenerateSchema._pattern_schema", "GenerateSchema._hashable_schema"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _pattern_schema(self, pattern_type: Any) -> core_schema.CoreSchema:\n from . import _validators\n\n metadata = build_metadata_dict(js_functions=[lambda _1, _2: {'type': 'string', 'format': 'regex'}])\n ser = core_schema.plain_serializer_function_ser_schema(\n attrgetter('pattern'), when_used='json', return_schema=core_schema.str_schema()\n )\n if pattern_type == typing.Pattern or pattern_type == re.Pattern:\n # bare type\n return core_schema.no_info_plain_validator_function(\n _validators.pattern_either_validator, serialization=ser, metadata=metadata\n )\n\n param = self._get_args_resolving_forward_refs(\n pattern_type,\n required=True,\n )[0]\n if param == str:\n return core_schema.no_info_plain_validator_function(\n _validators.pattern_str_validator, serialization=ser, metadata=metadata\n )\n elif param == bytes:\n return core_schema.no_info_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}.')\n\n def _hashable_schema(self) -> core_schema.CoreSchema:\n return core_schema.custom_error_schema(\n core_schema.is_instance_schema(collections.abc.Hashable),\n custom_error_type='is_hashable',\n custom_error_message='Input should be hashable',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._apply_annotations.inner_handler_GenerateSchema._apply_annotations.inner_handler.return.transform_inner_schema_sc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_annotations.inner_handler_GenerateSchema._apply_annotations.inner_handler.return.transform_inner_schema_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": 1767, "end_line": 1778, "span_ids": ["GenerateSchema._apply_annotations"], "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 _apply_annotations(\n self,\n source_type: Any,\n annotations: list[Any],\n transform_inner_schema: Callable[[CoreSchema], CoreSchema] = lambda x: x,\n ) -> CoreSchema:\n # ... other code\n\n def inner_handler(obj: Any) -> CoreSchema:\n from_property = self._generate_schema_from_property(obj, obj)\n if from_property is None:\n schema = self._generate_schema_inner(obj)\n else:\n schema = from_property\n metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)\n if metadata_js_function is not None:\n metadata_schema = resolve_original_schema(schema, self.defs.definitions)\n if metadata_schema is not None:\n self._add_js_function(metadata_schema, metadata_js_function)\n return transform_inner_schema(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/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_field_serializers_GenerateSchema._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_GenerateSchema._apply_field_serializers_GenerateSchema._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": 1749, "end_line": 1802, "span_ids": ["GenerateSchema._apply_field_serializers"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _apply_field_serializers(\n self,\n schema: core_schema.CoreSchema,\n serializers: list[Decorator[FieldSerializerDecoratorInfo]],\n computed_field: bool = False,\n ) -> core_schema.CoreSchema:\n \"\"\"Apply field serializers to a schema.\"\"\"\n if serializers:\n schema = copy(schema)\n if schema['type'] == 'definitions':\n inner_schema = schema['schema']\n schema['schema'] = self._apply_field_serializers(inner_schema, serializers)\n return schema\n else:\n ref = typing.cast('str|None', schema.get('ref', None))\n if ref is not None:\n schema = core_schema.definition_reference_schema(ref)\n\n # use the last serializer to make it easy to override a serializer set on a parent model\n serializer = serializers[-1]\n is_field_serializer, info_arg = inspect_field_serializer(\n serializer.func, serializer.info.mode, computed_field=computed_field\n )\n\n try:\n return_type = _decorators.get_function_return_type(\n serializer.func, serializer.info.return_type, self._types_namespace\n )\n except NameError as e:\n raise PydanticUndefinedAnnotation.from_name_error(e) from e\n\n if return_type is PydanticUndefined:\n return_schema = None\n else:\n return_schema = self.generate_schema(return_type)\n\n if serializer.info.mode == 'wrap':\n schema['serialization'] = core_schema.wrap_serializer_function_ser_schema(\n serializer.func,\n is_field_serializer=is_field_serializer,\n info_arg=info_arg,\n return_schema=return_schema,\n when_used=serializer.info.when_used,\n )\n else:\n assert serializer.info.mode == 'plain'\n schema['serialization'] = core_schema.plain_serializer_function_ser_schema(\n serializer.func,\n is_field_serializer=is_field_serializer,\n info_arg=info_arg,\n return_schema=return_schema,\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_GenerateSchema._apply_model_serializers_GenerateSchema._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_GenerateSchema._apply_model_serializers_GenerateSchema._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": 1804, "end_line": 1842, "span_ids": ["GenerateSchema._apply_model_serializers"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _apply_model_serializers(\n self, schema: core_schema.CoreSchema, serializers: Iterable[Decorator[ModelSerializerDecoratorInfo]]\n ) -> core_schema.CoreSchema:\n \"\"\"Apply model serializers to a schema.\"\"\"\n ref: str | None = schema.pop('ref', None) # type: ignore\n if serializers:\n serializer = list(serializers)[-1]\n info_arg = inspect_model_serializer(serializer.func, serializer.info.mode)\n\n try:\n return_type = _decorators.get_function_return_type(\n serializer.func, serializer.info.return_type, self._types_namespace\n )\n except NameError as e:\n raise PydanticUndefinedAnnotation.from_name_error(e) from e\n if return_type is PydanticUndefined:\n return_schema = None\n else:\n return_schema = self.generate_schema(return_type)\n\n if serializer.info.mode == 'wrap':\n ser_schema: core_schema.SerSchema = core_schema.wrap_serializer_function_ser_schema(\n serializer.func,\n info_arg=info_arg,\n return_schema=return_schema,\n when_used=serializer.info.when_used,\n )\n else:\n # plain\n ser_schema = core_schema.plain_serializer_function_ser_schema(\n serializer.func,\n info_arg=info_arg,\n return_schema=return_schema,\n when_used=serializer.info.when_used,\n )\n schema['serialization'] = ser_schema\n if ref:\n schema['ref'] = ref # 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/_known_annotated_metadata.py_expand_grouped_metadata_expand_grouped_metadata.for_annotation_in_annotat.if_isinstance_annotation_.else_.yield_annotation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_expand_grouped_metadata_expand_grouped_metadata.for_annotation_in_annotat.if_isinstance_annotation_.else_.yield_annotation", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 153, "span_ids": ["expand_grouped_metadata"], "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 expand_grouped_metadata(annotations: Iterable[Any]) -> Iterable[Any]:\n \"\"\"Expand the annotations.\n\n Args:\n annotations: An iterable of annotations.\n\n Returns:\n An iterable of expanded annotations.\n\n Example:\n ```py\n from annotated_types import Ge, Len\n\n from pydantic._internal._known_annotated_metadata import expand_grouped_metadata\n\n print(list(expand_grouped_metadata([Ge(4), Len(5)])))\n #> [Ge(ge=4), MinLen(min_length=5)]\n ```\n \"\"\"\n import annotated_types as at\n\n from pydantic.fields import FieldInfo # circular import\n\n for annotation in annotations:\n if isinstance(annotation, at.GroupedMetadata):\n yield from annotation\n elif isinstance(annotation, FieldInfo):\n yield from annotation.metadata\n # this is a bit problematic in that it results in duplicate metadata\n # all of our \"consumers\" can handle it, but it is not ideal\n # we probably should split up FieldInfo into:\n # - annotated types metadata\n # - individual metadata known only to Pydantic\n annotation = copy(annotation)\n annotation.metadata = []\n yield annotation\n else:\n yield 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/_internal/_model_construction.py__ModelNamespaceDict__ModelNamespaceDict.__setitem__.return.super___setitem___k_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__ModelNamespaceDict__ModelNamespaceDict.__setitem__.return.super___setitem___k_v_", "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": 54, "span_ids": ["_ModelNamespaceDict", "_ModelNamespaceDict.__setitem__"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _ModelNamespaceDict(dict):\n \"\"\"A dictionary subclass that intercepts attribute setting on model classes and\n warns about overriding of decorators.\n \"\"\"\n\n def __setitem__(self, k: str, v: object) -> None:\n existing: Any = self.get(k, None)\n if existing and v is not existing and isinstance(existing, PydanticDescriptorProxy):\n warnings.warn(f'`{k}` overrides an existing Pydantic `{existing.decorator_info.decorator_repr}` decorator')\n\n return super().__setitem__(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/pydantic/_internal/_model_construction.py_ModelMetaclass_ModelMetaclass.__new__._call_we_re_in_the_middl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass_ModelMetaclass.__new__._call_we_re_in_the_middl", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 85, "span_ids": ["ModelMetaclass.__new__", "ModelMetaclass"], "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": "@dataclass_transform(kw_only_default=True, field_specifiers=(PydanticModelField,))\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_metadata__: PydanticGenericMetadata | None = None,\n __pydantic_reset_parent_namespace__: bool = True,\n _create_model_module: str | None = None,\n **kwargs: Any,\n ) -> type:\n \"\"\"Metaclass for creating Pydantic models.\n\n Args:\n cls_name: The name of the class to be created.\n bases: The base classes of the class to be created.\n namespace: The attribute dictionary of the class to be created.\n __pydantic_generic_metadata__: Metadata for generic models.\n __pydantic_reset_parent_namespace__: Reset parent namespace.\n _create_model_module: The module of the class to be created, if created by `create_model`.\n **kwargs: Catch-all for any other keyword arguments.\n\n Returns:\n The new class created by the metaclass.\n \"\"\"\n # Note `ModelMetaclass` refers to `BaseModel`, but is also used to *create* `BaseModel`, so we rely on the fact\n # that `BaseModel` itself won't have any bases, but any subclass of it will, to determine whether the `__new__`\n # call we're in the middle of is for the `BaseModel` class.\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/_model_construction.py_ModelMetaclass.__new__.if_bases__ModelMetaclass.__new__.if_bases_.else_.return.super___new___mcs_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass.__new__.if_bases__ModelMetaclass.__new__.if_bases_.else_.return.super___new___mcs_cls_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 224, "span_ids": ["ModelMetaclass.__new__"], "tokens": 1577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(kw_only_default=True, field_specifiers=(PydanticModelField,))\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_metadata__: PydanticGenericMetadata | None = None,\n __pydantic_reset_parent_namespace__: bool = True,\n _create_model_module: str | None = None,\n **kwargs: Any,\n ) -> type:\n if bases:\n base_field_names, class_vars, base_private_attributes = mcs._collect_bases_data(bases)\n\n config_wrapper = ConfigWrapper.for_model(bases, namespace, kwargs)\n namespace['model_config'] = config_wrapper.config_dict\n private_attributes = inspect_namespace(\n namespace, config_wrapper.ignored_types, class_vars, base_field_names\n )\n if private_attributes:\n original_model_post_init = get_model_post_init(namespace, bases)\n if original_model_post_init is not None:\n # if there are private_attributes and a model_post_init function, we handle both\n\n def wrapped_model_post_init(self: BaseModel, __context: Any) -> None:\n \"\"\"We need to both initialize private attributes and call the user-defined model_post_init\n method.\n \"\"\"\n init_private_attributes(self, __context)\n original_model_post_init(self, __context)\n\n namespace['model_post_init'] = wrapped_model_post_init\n else:\n namespace['model_post_init'] = init_private_attributes\n\n namespace['__class_vars__'] = class_vars\n namespace['__private_attributes__'] = {**base_private_attributes, **private_attributes}\n\n cls: type[BaseModel] = super().__new__(mcs, cls_name, bases, namespace, **kwargs) # type: ignore\n\n from ..main import BaseModel\n\n mro = cls.__mro__\n if Generic in mro and mro.index(Generic) < mro.index(BaseModel):\n warnings.warn(\n GenericBeforeBaseModelWarning(\n 'Classes should inherit from `BaseModel` before generic classes (e.g. `typing.Generic[T]`) '\n 'for pydantic generics to work properly.'\n ),\n stacklevel=2,\n )\n\n cls.__pydantic_custom_init__ = not getattr(cls.__init__, '__pydantic_base_init__', False)\n cls.__pydantic_post_init__ = None if cls.model_post_init is BaseModel.model_post_init else 'model_post_init'\n\n cls.__pydantic_decorators__ = DecoratorInfos.build(cls)\n\n # Use the getattr below to grab the __parameters__ from the `typing.Generic` parent class\n if __pydantic_generic_metadata__:\n cls.__pydantic_generic_metadata__ = __pydantic_generic_metadata__\n else:\n parent_parameters = getattr(cls, '__pydantic_generic_metadata__', {}).get('parameters', ())\n parameters = getattr(cls, '__parameters__', None) or parent_parameters\n if parameters and parent_parameters and not all(x in parameters for x in parent_parameters):\n from ..root_model import RootModelRootType\n\n missing_parameters = tuple(x for x in parameters if x not in parent_parameters)\n if RootModelRootType in parent_parameters and RootModelRootType not in parameters:\n # This is a special case where the user has subclassed `RootModel`, but has not parametrized\n # RootModel with the generic type identifiers being used. Ex:\n # class MyModel(RootModel, Generic[T]):\n # root: T\n # Should instead just be:\n # class MyModel(RootModel[T]):\n # root: T\n parameters_str = ', '.join([x.__name__ for x in missing_parameters])\n error_message = (\n f'{cls.__name__} is a subclass of `RootModel`, but does not include the generic type identifier(s) '\n f'{parameters_str} in its parameters. '\n f'You should parametrize RootModel directly, e.g., `class {cls.__name__}(RootModel[{parameters_str}]): ...`.'\n )\n else:\n combined_parameters = parent_parameters + missing_parameters\n parameters_str = ', '.join([str(x) for x in combined_parameters])\n generic_type_label = f'typing.Generic[{parameters_str}]'\n error_message = (\n f'All parameters must be present on typing.Generic;'\n f' you should inherit from {generic_type_label}.'\n )\n if Generic not in bases: # pragma: no cover\n # We raise an error here not because it is desirable, but because some cases are mishandled.\n # It would be nice to remove this error and still have things behave as expected, it's just\n # challenging because we are using a custom `__class_getitem__` to parametrize generic models,\n # and not returning a typing._GenericAlias from it.\n bases_str = ', '.join([x.__name__ for x in bases] + [generic_type_label])\n error_message += (\n f' Note: `typing.Generic` must go last: `class {cls.__name__}({bases_str}): ...`)'\n )\n raise TypeError(error_message)\n\n cls.__pydantic_generic_metadata__ = {\n 'origin': None,\n 'args': (),\n 'parameters': parameters,\n }\n\n cls.__pydantic_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 obj.__set_name__(cls, name)\n\n if __pydantic_reset_parent_namespace__:\n cls.__pydantic_parent_namespace__ = build_lenient_weakvaluedict(parent_frame_namespace())\n parent_namespace = getattr(cls, '__pydantic_parent_namespace__', None)\n if isinstance(parent_namespace, dict):\n parent_namespace = unpack_lenient_weakvaluedict(parent_namespace)\n\n types_namespace = get_cls_types_namespace(cls, parent_namespace)\n set_model_fields(cls, bases, config_wrapper, types_namespace)\n\n if config_wrapper.frozen and '__hash__' not in namespace:\n set_default_hash_func(cls, bases)\n\n complete_model_class(\n cls,\n cls_name,\n config_wrapper,\n raise_errors=False,\n types_namespace=types_namespace,\n create_model_module=_create_model_module,\n )\n\n # If this is placed before the complete_model_class call above,\n # the generic computed fields return type is set to PydanticUndefined\n cls.model_computed_fields = {k: v.info for k, v in cls.__pydantic_decorators__.computed_fields.items()}\n\n set_deprecated_descriptors(cls)\n\n # using super(cls, cls) on the next line ensures we only call the parent class's __pydantic_init_subclass__\n # I believe the `type: ignore` is only necessary because mypy doesn't realize that this code branch is\n # only hit for _proper_ subclasses of BaseModel\n super(cls, cls).__pydantic_init_subclass__(**kwargs) # type: ignore[misc]\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.__repr__.return.f_self___repr_name___": {"__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.__repr__.return.f_self___repr_name___", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_repr.py", "file_name": "_repr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 82, "span_ids": ["Representation.__repr_str__", "Representation.__rich_repr__", "Representation.__str__", "Representation.__repr__", "Representation.__pretty__", "Representation.__repr_name__"], "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": "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 \"\"\"Name of the instance's class, used in __repr__.\"\"\"\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 \"\"\"Used by devtools (https://python-devtools.helpmanual.io/) to pretty print objects.\"\"\"\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 __rich_repr__(self) -> RichReprResult:\n \"\"\"Used by Rich (https://rich.readthedocs.io/en/stable/pretty.html) to pretty print objects.\"\"\"\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\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__(\", \")})'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_SchemaTransformer_SchemaTransformer.__get_pydantic_json_schema__.return.self_get_json_schema_sche": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_SchemaTransformer_SchemaTransformer.__get_pydantic_json_schema__.return.self_get_json_schema_sche", "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": 47, "end_line": 56, "span_ids": ["SchemaTransformer", "SchemaTransformer.__get_pydantic_core_schema__", "SchemaTransformer.__get_pydantic_json_schema__"], "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": "@dataclasses.dataclass(**slots_true)\nclass SchemaTransformer:\n get_core_schema: Callable[[Any, GetCoreSchemaHandler], CoreSchema]\n get_json_schema: Callable[[CoreSchema, GetJsonSchemaHandler], JsonSchemaValue]\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return self.get_core_schema(source_type, handler)\n\n def __get_pydantic_json_schema__(self, schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n return self.get_json_schema(schema, handler)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_InnerSchemaValidator_InnerSchemaValidator.__get_pydantic_core_schema__.return.self_core_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_InnerSchemaValidator_InnerSchemaValidator.__get_pydantic_core_schema__.return.self_core_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": 140, "end_line": 158, "span_ids": ["InnerSchemaValidator.__get_pydantic_json_schema__", "InnerSchemaValidator.__get_pydantic_core_schema__", "InnerSchemaValidator"], "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": "@dataclasses.dataclass(**slots_true)\nclass InnerSchemaValidator:\n \"\"\"Use a fixed CoreSchema, avoiding interference from outward annotations.\"\"\"\n\n core_schema: CoreSchema\n js_schema: JsonSchemaValue | None = None\n js_core_schema: CoreSchema | None = None\n js_schema_update: JsonSchemaValue | None = None\n\n def __get_pydantic_json_schema__(self, _schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n if self.js_schema is not None:\n return self.js_schema\n js_schema = handler(self.js_core_schema or self.core_schema)\n if self.js_schema_update is not None:\n js_schema.update(self.js_schema_update)\n return js_schema\n\n def __get_pydantic_core_schema__(self, _source_type: Any, _handler: GetCoreSchemaHandler) -> CoreSchema:\n return 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/_internal/_std_types_schema.py_sequence_like_prepare_pydantic_annotations_sequence_like_prepare_pydantic_annotations.return._source_type_SequenceVa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_sequence_like_prepare_pydantic_annotations_sequence_like_prepare_pydantic_annotations.return._source_type_SequenceVa", "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": 597, "end_line": 618, "span_ids": ["sequence_like_prepare_pydantic_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 sequence_like_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n origin: Any = get_origin(source_type)\n\n mapped_origin = SEQUENCE_ORIGIN_MAP.get(origin, None) if origin else SEQUENCE_ORIGIN_MAP.get(source_type, None)\n if mapped_origin is None:\n return None\n\n args = get_args(source_type)\n\n if not args:\n args = (Any,)\n elif len(args) != 1:\n raise ValueError('Expected sequence to have exactly 1 generic parameter')\n\n item_source_type = args[0]\n\n metadata, remaining_annotations = _known_annotated_metadata.collect_known_metadata(annotations)\n _known_annotated_metadata.check_metadata(metadata, _known_annotated_metadata.SEQUENCE_CONSTRAINTS, source_type)\n\n return (source_type, [SequenceValidator(mapped_origin, item_source_type, **metadata), *remaining_annotations])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_MappingValidator_MappingValidator.__get_pydantic_core_schema__.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_MappingValidator_MappingValidator.__get_pydantic_core_schema__.return.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": 501, "end_line": 560, "span_ids": ["MappingValidator.__get_pydantic_core_schema__", "MappingValidator.serialize_mapping_via_dict", "MappingValidator"], "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": "@dataclasses.dataclass(**slots_true)\nclass MappingValidator:\n mapped_origin: type[Any]\n keys_source_type: type[Any]\n values_source_type: type[Any]\n min_length: int | None = None\n max_length: int | None = None\n strict: bool = False\n\n def serialize_mapping_via_dict(self, v: Any, handler: core_schema.SerializerFunctionWrapHandler) -> Any:\n return handler(v)\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n if self.keys_source_type is Any:\n keys_schema = None\n else:\n keys_schema = handler.generate_schema(self.keys_source_type)\n if self.values_source_type is Any:\n values_schema = None\n else:\n values_schema = handler.generate_schema(self.values_source_type)\n\n metadata = {'min_length': self.min_length, 'max_length': self.max_length, 'strict': self.strict}\n\n if self.mapped_origin is dict:\n schema = core_schema.dict_schema(keys_schema, values_schema, **metadata)\n else:\n constrained_schema = core_schema.dict_schema(keys_schema, values_schema, **metadata)\n check_instance = core_schema.json_or_python_schema(\n json_schema=core_schema.dict_schema(),\n python_schema=core_schema.is_instance_schema(self.mapped_origin),\n )\n\n if self.mapped_origin is collections.defaultdict:\n default_default_factory = get_defaultdict_default_default_factory(self.values_source_type)\n coerce_instance_wrap = partial(\n core_schema.no_info_wrap_validator_function,\n partial(defaultdict_validator, default_default_factory=default_default_factory),\n )\n else:\n coerce_instance_wrap = partial(core_schema.no_info_after_validator_function, self.mapped_origin)\n\n serialization = core_schema.wrap_serializer_function_ser_schema(\n self.serialize_mapping_via_dict,\n schema=core_schema.dict_schema(\n keys_schema or core_schema.any_schema(), values_schema or core_schema.any_schema()\n ),\n info_arg=False,\n )\n\n strict = core_schema.chain_schema([check_instance, coerce_instance_wrap(constrained_schema)])\n\n if metadata.get('strict', False):\n schema = strict\n else:\n lax = coerce_instance_wrap(constrained_schema)\n schema = core_schema.lax_or_strict_schema(lax_schema=lax, strict_schema=strict)\n schema['serialization'] = serialization\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/_std_types_schema.py_ip_prepare_pydantic_annotations_ip_prepare_pydantic_annotations.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_ip_prepare_pydantic_annotations_ip_prepare_pydantic_annotations.return.None", "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": 802, "end_line": 885, "span_ids": ["ip_prepare_pydantic_annotations"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ip_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n def make_strict_ip_schema(tp: type[Any]) -> CoreSchema:\n return core_schema.json_or_python_schema(\n json_schema=core_schema.no_info_after_validator_function(tp, core_schema.str_schema()),\n python_schema=core_schema.is_instance_schema(tp),\n )\n\n if source_type is IPv4Address:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.lax_or_strict_schema(\n lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v4_address_validator),\n strict_schema=make_strict_ip_schema(IPv4Address),\n serialization=core_schema.to_string_ser_schema(),\n ),\n lambda _1, _2: {'type': 'string', 'format': 'ipv4'},\n ),\n *annotations,\n ]\n if source_type is IPv4Network:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.lax_or_strict_schema(\n lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v4_network_validator),\n strict_schema=make_strict_ip_schema(IPv4Network),\n serialization=core_schema.to_string_ser_schema(),\n ),\n lambda _1, _2: {'type': 'string', 'format': 'ipv4network'},\n ),\n *annotations,\n ]\n if source_type is IPv4Interface:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.lax_or_strict_schema(\n lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v4_interface_validator),\n strict_schema=make_strict_ip_schema(IPv4Interface),\n serialization=core_schema.to_string_ser_schema(),\n ),\n lambda _1, _2: {'type': 'string', 'format': 'ipv4interface'},\n ),\n *annotations,\n ]\n\n if source_type is IPv6Address:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.lax_or_strict_schema(\n lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v6_address_validator),\n strict_schema=make_strict_ip_schema(IPv6Address),\n serialization=core_schema.to_string_ser_schema(),\n ),\n lambda _1, _2: {'type': 'string', 'format': 'ipv6'},\n ),\n *annotations,\n ]\n if source_type is IPv6Network:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.lax_or_strict_schema(\n lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v6_network_validator),\n strict_schema=make_strict_ip_schema(IPv6Network),\n serialization=core_schema.to_string_ser_schema(),\n ),\n lambda _1, _2: {'type': 'string', 'format': 'ipv6network'},\n ),\n *annotations,\n ]\n if source_type is IPv6Interface:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.lax_or_strict_schema(\n lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v6_interface_validator),\n strict_schema=make_strict_ip_schema(IPv6Interface),\n serialization=core_schema.to_string_ser_schema(),\n ),\n lambda _1, _2: {'type': 'string', 'format': 'ipv6interface'},\n ),\n *annotations,\n ]\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/_validators.py__import_string_logic__import_string_logic.if_len_components_1_.else_.return.module": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py__import_string_logic__import_string_logic.if_len_components_1_.else_.return.module", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 105, "span_ids": ["_import_string_logic"], "tokens": 541}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _import_string_logic(dotted_path: str) -> Any:\n \"\"\"Inspired by uvicorn \u2014 dotted paths should include a colon before the final item if that item is not a module.\n (This is necessary to distinguish between a submodule and an attribute when there is a conflict.).\n\n If the dotted path does not include a colon and the final item is not a valid module, importing as an attribute\n rather than a submodule will be attempted automatically.\n\n So, for example, the following values of `dotted_path` result in the following returned values:\n * 'collections': \n * 'collections.abc': \n * 'collections.abc:Mapping': \n * `collections.abc.Mapping`: (though this is a bit slower than the previous line)\n\n An error will be raised under any of the following scenarios:\n * `dotted_path` contains more than one colon (e.g., 'collections:abc:Mapping')\n * the substring of `dotted_path` before the colon is not a valid module in the environment (e.g., '123:Mapping')\n * the substring of `dotted_path` after the colon is not an attribute of the module (e.g., 'collections:abc123')\n \"\"\"\n from importlib import import_module\n\n components = dotted_path.strip().split(':')\n if len(components) > 2:\n raise ImportError(f\"Import strings should have at most one ':'; received {dotted_path!r}\")\n\n module_path = components[0]\n if not module_path:\n raise ImportError(f'Import strings should have a nonempty module name; received {dotted_path!r}')\n\n try:\n module = import_module(module_path)\n except ModuleNotFoundError as e:\n if '.' in module_path:\n # Check if it would be valid if the final item was separated from its module with a `:`\n maybe_module_path, maybe_attribute = dotted_path.strip().rsplit('.', 1)\n try:\n return _import_string_logic(f'{maybe_module_path}:{maybe_attribute}')\n except ImportError:\n pass\n raise ImportError(f'No module named {module_path!r}') from e\n raise e\n\n if len(components) > 1:\n attribute = components[1]\n try:\n return getattr(module, attribute)\n except AttributeError as e:\n raise ImportError(f'cannot import name {attribute!r} from {module_path!r}') from e\n else:\n return module", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_rebuild_dataclass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_rebuild_dataclass_", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 254, "end_line": 313, "span_ids": ["is_pydantic_dataclass", "rebuild_dataclass"], "tokens": 550}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def rebuild_dataclass(\n cls: type[PydanticDataclass],\n *,\n force: bool = False,\n raise_errors: bool = True,\n _parent_namespace_depth: int = 2,\n _types_namespace: dict[str, Any] | None = None,\n) -> bool | None:\n \"\"\"Try to rebuild the pydantic-core schema for the dataclass.\n\n This may be necessary when one of the annotations is a ForwardRef which could not be resolved during\n the initial attempt to build the schema, and automatic rebuilding fails.\n\n This is analogous to `BaseModel.model_rebuild`.\n\n Args:\n cls: The class to rebuild the pydantic-core schema for.\n force: Whether to force the rebuilding of the schema, defaults to `False`.\n raise_errors: Whether to raise errors, defaults to `True`.\n _parent_namespace_depth: The depth level of the parent namespace, defaults to 2.\n _types_namespace: The types namespace, defaults to `None`.\n\n Returns:\n Returns `None` if the schema is already \"complete\" and rebuilding was not required.\n If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`.\n \"\"\"\n if not force and cls.__pydantic_complete__:\n return None\n else:\n if _types_namespace is not None:\n types_namespace: dict[str, Any] | None = _types_namespace.copy()\n else:\n if _parent_namespace_depth > 0:\n frame_parent_ns = _typing_extra.parent_frame_namespace(parent_depth=_parent_namespace_depth) or {}\n # Note: we may need to add something similar to cls.__pydantic_parent_namespace__ from BaseModel\n # here when implementing handling of recursive generics. See BaseModel.model_rebuild for reference.\n types_namespace = frame_parent_ns\n else:\n types_namespace = {}\n\n types_namespace = _typing_extra.get_cls_types_namespace(cls, types_namespace)\n return _pydantic_dataclasses.complete_dataclass(\n cls,\n _config.ConfigWrapper(cls.__pydantic_config__, check=False),\n raise_errors=raise_errors,\n types_namespace=types_namespace,\n )\n\n\ndef is_pydantic_dataclass(__cls: type[Any]) -> TypeGuard[type[PydanticDataclass]]:\n \"\"\"Whether a class is a pydantic dataclass.\n\n Args:\n __cls: The class.\n\n Returns:\n `True` if the class is a pydantic dataclass, `False` otherwise.\n \"\"\"\n return dataclasses.is_dataclass(__cls) and '__pydantic_validator__' in __cls.__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/pydantic/fields.py__FromFieldInfoInputs__FieldInfoInputs.default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__FromFieldInfoInputs__FieldInfoInputs.default", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 86, "span_ids": ["_FromFieldInfoInputs", "_FieldInfoInputs"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _FromFieldInfoInputs(typing_extensions.TypedDict, total=False):\n \"\"\"This class exists solely to add type checking for the `**kwargs` in `FieldInfo.from_field`.\"\"\"\n\n annotation: type[Any] | None\n default_factory: typing.Callable[[], Any] | None\n alias: str | None\n alias_priority: int | None\n validation_alias: str | AliasPath | AliasChoices | None\n serialization_alias: str | None\n title: str | None\n description: str | None\n examples: list[Any] | None\n exclude: bool | None\n gt: float | None\n ge: float | None\n lt: float | None\n le: float | None\n multiple_of: float | None\n strict: bool | None\n min_length: int | None\n max_length: int | None\n pattern: str | None\n allow_inf_nan: bool | None\n max_digits: int | None\n decimal_places: int | None\n union_mode: Literal['smart', 'left_to_right'] | None\n discriminator: str | types.Discriminator | None\n deprecated: Deprecated | str | bool | None\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None\n frozen: bool | None\n validate_default: bool | None\n repr: bool\n init: bool | None\n init_var: bool | None\n kw_only: bool | None\n\n\nclass _FieldInfoInputs(_FromFieldInfoInputs, total=False):\n \"\"\"This class exists solely to add type checking for the `**kwargs` in `FieldInfo.__init__`.\"\"\"\n\n default: 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/fields.py_FieldInfo.is_required_FieldInfo.rebuild_annotation.if_not_self_metadata_.else_._type_ignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.is_required_FieldInfo.rebuild_annotation.if_not_self_metadata_.else_._type_ignore", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 500, "end_line": 525, "span_ids": ["FieldInfo.is_required", "FieldInfo.rebuild_annotation"], "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 FieldInfo(_repr.Representation):\n\n def is_required(self) -> bool:\n \"\"\"Check if the field is required (i.e., does not have a default value or factory).\n\n Returns:\n `True` if the field is required, `False` otherwise.\n \"\"\"\n return self.default is PydanticUndefined and self.default_factory is None\n\n def rebuild_annotation(self) -> Any:\n \"\"\"Attempts to rebuild the original annotation for use in function signatures.\n\n If metadata is present, it adds it to the original annotation using\n `Annotated`. Otherwise, it returns the original annotation as-is.\n\n Note that because the metadata has been flattened, the original annotation\n may not be reconstructed exactly as originally provided, e.g. if the original\n type had unrecognized annotations, or was annotated with a call to `pydantic.Field`.\n\n Returns:\n The rebuilt annotation.\n \"\"\"\n if not self.metadata:\n return self.annotation\n else:\n # Annotated arguments must be a tuple\n return typing_extensions.Annotated[(self.annotation, *self.metadata)] # 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/fields.py_FieldInfo.apply_typevars_map_FieldInfo.apply_typevars_map.self.annotation._generics_replace_types_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.apply_typevars_map_FieldInfo.apply_typevars_map.self.annotation._generics_replace_types_a", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 534, "end_line": 550, "span_ids": ["FieldInfo.apply_typevars_map"], "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 FieldInfo(_repr.Representation):\n\n def apply_typevars_map(self, typevars_map: dict[Any, Any] | None, types_namespace: dict[str, Any] | None) -> None:\n \"\"\"Apply a `typevars_map` to the annotation.\n\n This method is used when analyzing parametrized generic types to replace typevars with their concrete types.\n\n This method applies the `typevars_map` to the annotation in place.\n\n Args:\n typevars_map: A dictionary mapping type variables to their concrete types.\n types_namespace (dict | None): A dictionary containing related types to the annotated type.\n\n See Also:\n pydantic._internal._generics.replace_types is used for replacing the typevars with\n their concrete types.\n \"\"\"\n annotation = _typing_extra.eval_type_lenient(self.annotation, types_namespace)\n self.annotation = _generics.replace_types(annotation, typevars_map)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_PlainSerializer.__get_pydantic_core_schema___PlainSerializer.__get_pydantic_core_schema__.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_PlainSerializer.__get_pydantic_core_schema___PlainSerializer.__get_pydantic_core_schema__.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 56, "span_ids": ["PlainSerializer.__get_pydantic_core_schema__"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true, frozen=True)\nclass PlainSerializer:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n \"\"\"Gets the Pydantic core schema.\n\n Args:\n source_type: The source type.\n handler: The `GetCoreSchemaHandler` instance.\n\n Returns:\n The Pydantic core schema.\n \"\"\"\n schema = handler(source_type)\n try:\n return_type = _decorators.get_function_return_type(\n self.func, self.return_type, handler._get_types_namespace()\n )\n except NameError as e:\n raise PydanticUndefinedAnnotation.from_name_error(e) from e\n return_schema = None if return_type is PydanticUndefined else handler.generate_schema(return_type)\n schema['serialization'] = core_schema.plain_serializer_function_ser_schema(\n function=self.func,\n info_arg=_decorators.inspect_annotated_serializer(self.func, 'plain'),\n return_schema=return_schema,\n when_used=self.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/functional_serializers.py_WrapSerializer_WrapSerializer.when_used._always_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_WrapSerializer_WrapSerializer.when_used._always_", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 148, "span_ids": ["WrapSerializer"], "tokens": 614}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(**_internal_dataclass.slots_true, frozen=True)\nclass WrapSerializer:\n \"\"\"Wrap serializers receive the raw inputs along with a handler function that applies the standard serialization\n logic, and can modify the resulting value before returning it as the final output of serialization.\n\n For example, here's a scenario in which a wrap serializer transforms timezones to UTC **and** utilizes the existing `datetime` serialization logic.\n\n ```python\n from datetime import datetime, timezone\n from typing import Any, Dict\n\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, WrapSerializer\n\n class EventDatetime(BaseModel):\n start: datetime\n end: datetime\n\n def convert_to_utc(value: Any, handler, info) -> Dict[str, datetime]:\n # Note that `helper` can actually help serialize the `value` for further custom serialization in case it's a subclass.\n partial_result = handler(value, info)\n if info.mode == 'json':\n return {\n k: datetime.fromisoformat(v).astimezone(timezone.utc)\n for k, v in partial_result.items()\n }\n return {k: v.astimezone(timezone.utc) for k, v in partial_result.items()}\n\n UTCEventDatetime = Annotated[EventDatetime, WrapSerializer(convert_to_utc)]\n\n class EventModel(BaseModel):\n event_datetime: UTCEventDatetime\n\n dt = EventDatetime(\n start='2024-01-01T07:00:00-08:00', end='2024-01-03T20:00:00+06:00'\n )\n event = EventModel(event_datetime=dt)\n print(event.model_dump())\n '''\n {\n 'event_datetime': {\n 'start': datetime.datetime(\n 2024, 1, 1, 15, 0, tzinfo=datetime.timezone.utc\n ),\n 'end': datetime.datetime(\n 2024, 1, 3, 14, 0, tzinfo=datetime.timezone.utc\n ),\n }\n }\n '''\n\n print(event.model_dump_json())\n '''\n {\"event_datetime\":{\"start\":\"2024-01-01T15:00:00Z\",\"end\":\"2024-01-03T14:00:00Z\"}}\n '''\n ```\n\n Attributes:\n func: The serializer function to be wrapped.\n return_type: The return type for the function. If omitted it will be inferred from the type annotation.\n when_used: Determines when this serializer should be used. Accepts a string with values `'always'`,\n `'unless-none'`, `'json'`, and `'json-unless-none'`. Defaults to 'always'.\n \"\"\"\n\n func: core_schema.WrapSerializerFunction\n return_type: Any = PydanticUndefined\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_WrapSerializer.__get_pydantic_core_schema___WrapSerializer.__get_pydantic_core_schema__.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_WrapSerializer.__get_pydantic_core_schema___WrapSerializer.__get_pydantic_core_schema__.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 75, "end_line": 99, "span_ids": ["WrapSerializer.__get_pydantic_core_schema__"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true, frozen=True)\nclass WrapSerializer:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n \"\"\"This method is used to get the Pydantic core schema of the class.\n\n Args:\n source_type: Source type.\n handler: Core schema handler.\n\n Returns:\n The generated core schema of the class.\n \"\"\"\n schema = handler(source_type)\n try:\n return_type = _decorators.get_function_return_type(\n self.func, self.return_type, handler._get_types_namespace()\n )\n except NameError as e:\n raise PydanticUndefinedAnnotation.from_name_error(e) from e\n return_schema = None if return_type is PydanticUndefined else handler.generate_schema(return_type)\n schema['serialization'] = core_schema.wrap_serializer_function_ser_schema(\n function=self.func,\n info_arg=_decorators.inspect_annotated_serializer(self.func, 'wrap'),\n return_schema=return_schema,\n when_used=self.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/functional_serializers.py_FuncType_model_serializer_5._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_FuncType_model_serializer_5._", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 198, "span_ids": ["model_serializer_5", "impl:12", "model_serializer"], "tokens": 103}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "FuncType = TypeVar('FuncType', bound=Callable[..., Any])\n\n\n@overload\ndef model_serializer(__f: FuncType) -> FuncType:\n ...\n\n\n@overload\ndef model_serializer(\n *,\n mode: Literal['plain', 'wrap'] = ...,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always',\n return_type: Any = ...,\n) -> Callable[[FuncType], FuncType]:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.dict_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.dict_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": 1007, "end_line": 1026, "span_ids": ["BaseModel.dict"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @typing_extensions.deprecated('The `dict` method is deprecated; use `model_dump` instead.', category=None)\n def dict( # noqa: D102\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.', category=PydanticDeprecatedSince20)\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.validate_BaseModel.update_forward_refs.cls_model_rebuild_force_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.validate_BaseModel.update_forward_refs.cls_model_rebuild_force_T", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1286, "end_line": 1306, "span_ids": ["BaseModel.validate", "BaseModel.update_forward_refs"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated('The `validate` method is deprecated; use `model_validate` instead.', category=None)\n def validate(cls: type[Model], value: Any) -> Model: # noqa: D102\n warnings.warn(\n 'The `validate` method is deprecated; use `model_validate` instead.', category=PydanticDeprecatedSince20\n )\n return cls.model_validate(value)\n\n @classmethod\n @typing_extensions.deprecated(\n 'The `update_forward_refs` method is deprecated; use `model_rebuild` instead.',\n category=None,\n )\n def update_forward_refs(cls, **localns: Any) -> None: # noqa: D102\n warnings.warn(\n 'The `update_forward_refs` method is deprecated; use `model_rebuild` instead.',\n category=PydanticDeprecatedSince20,\n )\n if localns: # pragma: no cover\n raise TypeError('`localns` arguments are not longer accepted.')\n cls.model_rebuild(force=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/type_adapter.py_TypeAdapter.get_default_value_TypeAdapter.get_default_value.return.self_validator_get_defaul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.get_default_value_TypeAdapter.get_default_value.return.self_validator_get_defaul", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 298, "span_ids": ["TypeAdapter.get_default_value"], "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": "@final\nclass TypeAdapter(Generic[T]):\n\n def get_default_value(self, *, strict: bool | None = None, context: dict[str, Any] | None = None) -> Some[T] | None:\n \"\"\"Get the default value for the wrapped type.\n\n Args:\n strict: Whether to strictly check types.\n context: Additional context to pass to the validator.\n\n Returns:\n The default value wrapped in a `Some` if there is one or None if not.\n \"\"\"\n return self.validator.get_default_value(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/types.py_PathType.validate_file_PathType.__hash__.return.hash_type_self_path_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PathType.validate_file_PathType.__hash__.return.hash_type_self_path_type_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 417, "end_line": 441, "span_ids": ["PathType.validate_directory", "PathType.validate_new", "PathType.__hash__", "PathType.validate_file"], "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": "@_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\n\n def __hash__(self) -> int:\n return hash(type(self.path_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/v1/__init__.py__flake8_noqa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/__init__.py__flake8_noqa_", "embedding": null, "metadata": {"file_path": "pydantic/v1/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 132, "span_ids": ["docstring"], "tokens": 747}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# flake8: noqa\nfrom . import dataclasses\nfrom .annotated_types import create_model_from_namedtuple, create_model_from_typeddict\nfrom .class_validators import root_validator, validator\nfrom .config import BaseConfig, ConfigDict, Extra\nfrom .decorator import validate_arguments\nfrom .env_settings import BaseSettings\nfrom .error_wrappers import ValidationError\nfrom .errors import *\nfrom .fields import Field, PrivateAttr, Required\nfrom .main import *\nfrom .networks import *\nfrom .parse import Protocol\nfrom .tools import *\nfrom .types import *\nfrom .version import VERSION, compiled\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 # annotated types utils\n 'create_model_from_namedtuple',\n 'create_model_from_typeddict',\n # dataclasses\n 'dataclasses',\n # class_validators\n 'root_validator',\n 'validator',\n # config\n 'BaseConfig',\n 'ConfigDict',\n 'Extra',\n # decorator\n 'validate_arguments',\n # env_settings\n 'BaseSettings',\n # error_wrappers\n 'ValidationError',\n # fields\n 'Field',\n 'Required',\n # main\n 'BaseModel',\n 'create_model',\n 'validate_model',\n # network\n 'AnyUrl',\n 'AnyHttpUrl',\n 'FileUrl',\n 'HttpUrl',\n 'stricturl',\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 # parse\n 'Protocol',\n # tools\n 'parse_file_as',\n 'parse_obj_as',\n 'parse_raw_as',\n 'schema_of',\n 'schema_json_of',\n # types\n 'NoneStr',\n 'NoneBytes',\n 'StrBytes',\n 'NoneStrBytes',\n 'StrictStr',\n 'ConstrainedBytes',\n 'conbytes',\n 'ConstrainedList',\n 'conlist',\n 'ConstrainedSet',\n 'conset',\n 'ConstrainedFrozenSet',\n 'confrozenset',\n 'ConstrainedStr',\n 'constr',\n 'PyObject',\n 'ConstrainedInt',\n 'conint',\n 'PositiveInt',\n 'NegativeInt',\n 'NonNegativeInt',\n 'NonPositiveInt',\n 'ConstrainedFloat',\n 'confloat',\n 'PositiveFloat',\n 'NegativeFloat',\n 'NonNegativeFloat',\n 'NonPositiveFloat',\n 'FiniteFloat',\n 'ConstrainedDecimal',\n 'condecimal',\n 'ConstrainedDate',\n 'condate',\n 'UUID1',\n 'UUID3',\n 'UUID4',\n 'UUID5',\n 'FilePath',\n 'DirectoryPath',\n 'Json',\n 'JsonWrapper',\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 # version\n 'compiled',\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/v1/_hypothesis_plugin.py____PyObject_dotted_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py____PyObject_dotted_names", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 79, "span_ids": ["docstring:16", "docstring"], "tokens": 806}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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, Union, cast, overload\n\nimport hypothesis.strategies as st\n\nimport pydantic\nimport pydantic.color\nimport pydantic.types\nfrom pydantic.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# We are rethinking Hypothesis compatibility in Pydantic v2.\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.\nst.register_type_strategy(pydantic.UUID1, st.uuids(version=1))\nst.register_type_strategy(pydantic.SecretBytes, st.binary().map(pydantic.SecretBytes))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_st_register_type_strategy_None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_st_register_type_strategy_None_7", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 150, "span_ids": ["impl:11", "add_luhn_digit", "docstring:16"], "tokens": 747}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#\n#\nst.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\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_rgba,\n pydantic.color.r_hsl,\n pydantic.color.r_hsla,\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\nst.register_type_strategy(pydantic.UUID1, st.uuids(version=1))\nst.register_type_strategy(pydantic.UUID3, st.uuids(version=3))\nst.register_type_strategy(pydantic.UUID4, st.uuids(version=4))\nst.register_type_strategy(pydantic.UUID5, st.uuids(version=5))\n\n# Secrets\nst.register_type_strategy(pydantic.SecretBytes, st.binary().map(pydantic.SecretBytes))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_None_8__registered_2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_None_8__registered_2.pass", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 191, "span_ids": ["impl:11", "_registered_2", "impl:26", "_registered"], "tokens": 407}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "st.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)\nst.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.\nst.register_type_strategy(pydantic.StrictBool, st.booleans())\nst.register_type_strategy(pydantic.StrictStr, st.text())\n\n\n# FutureDate, PastDate\nst.register_type_strategy(pydantic.FutureDate, st.dates(min_value=datetime.date.today() + datetime.timedelta(days=1)))\nst.register_type_strategy(pydantic.PastDate, st.dates(max_value=datetime.date.today() - datetime.timedelta(days=1)))\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]\n\n\n@overload\ndef _registered(typ: Type[pydantic.types.T]) -> Type[pydantic.types.T]:\n pass\n\n\n@overload\ndef _registered(typ: pydantic.types.ConstrainedNumberMeta) -> pydantic.types.ConstrainedNumberMeta:\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/v1/_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/v1/_hypothesis_plugin.py__registered_3_resolves.return.inner", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 211, "span_ids": ["resolves", "_registered_3"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _registered(\n typ: Union[Type[pydantic.types.T], pydantic.types.ConstrainedNumberMeta]\n) -> Union[Type[pydantic.types.T], pydantic.types.ConstrainedNumberMeta]:\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)) # type: ignore\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, pydantic.types.ConstrainedNumberMeta]\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/v1/_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/v1/_hypothesis_plugin.py__Type_to_strategy_resolv_resolve_json.return.st_builds_", "embedding": null, "metadata": {"file_path": "pydantic/v1/_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": 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": "# 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/v1/_hypothesis_plugin.py_resolve_conbytes_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/v1/_hypothesis_plugin.py_resolve_conbytes_resolve_conbytes.return.st_from_regex_pattern_enc", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 255, "span_ids": ["resolve_conbytes"], "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": "@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/v1/_hypothesis_plugin.py_resolve_condecimal_resolve_condecimal.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_condecimal_resolve_condecimal.return.s", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 273, "span_ids": ["resolve_condecimal"], "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": "@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/v1/_hypothesis_plugin.py_resolve_confloat_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/v1/_hypothesis_plugin.py_resolve_confloat_resolve_confloat.return.st_integers_min_value_ma", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 276, "end_line": 305, "span_ids": ["resolve_confloat"], "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": "@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/v1/_hypothesis_plugin.py_resolve_conint_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/v1/_hypothesis_plugin.py_resolve_conint_resolve_conint.return.st_integers_min_value_ma", "embedding": null, "metadata": {"file_path": "pydantic/v1/_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"], "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": "@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/v1/_hypothesis_plugin.py_resolve_condate_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/v1/_hypothesis_plugin.py_resolve_condate_resolve_condate.return.st_dates_min_value_max_v", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 331, "end_line": 347, "span_ids": ["resolve_condate"], "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": "@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/v1/_hypothesis_plugin.py_resolve_constr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/_hypothesis_plugin.py_resolve_constr_", "embedding": null, "metadata": {"file_path": "pydantic/v1/_hypothesis_plugin.py", "file_name": "_hypothesis_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 392, "span_ids": ["impl:30", "resolve_constr"], "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": "@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\nfor 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/v1/annotated_types.py_sys_if_sys_version_info_3_.else_.is_legacy_typeddict.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/annotated_types.py_sys_if_sys_version_info_3_.else_.is_legacy_typeddict.return.False", "embedding": null, "metadata": {"file_path": "pydantic/v1/annotated_types.py", "file_name": "annotated_types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["imports"], "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": "import sys\nfrom typing import TYPE_CHECKING, Any, Dict, FrozenSet, NamedTuple, Type\n\nfrom .fields import Required\nfrom .main import BaseModel, create_model\nfrom .typing import is_typeddict, is_typeddict_special\n\nif TYPE_CHECKING:\n from typing_extensions import TypedDict\n\nif sys.version_info < (3, 11):\n\n def is_legacy_typeddict(typeddict_cls: Type['TypedDict']) -> bool: # type: ignore[valid-type]\n return is_typeddict(typeddict_cls) and type(typeddict_cls).__module__ == 'typing'\n\nelse:\n\n def is_legacy_typeddict(_: Any) -> Any:\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/v1/annotated_types.py_create_model_from_typeddict_create_model_from_typeddict.return.create_model_typeddict_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/annotated_types.py_create_model_from_typeddict_create_model_from_typeddict.return.create_model_typeddict_cl", "embedding": null, "metadata": {"file_path": "pydantic/v1/annotated_types.py", "file_name": "annotated_types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 55, "span_ids": ["create_model_from_typeddict"], "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 create_model_from_typeddict(\n # Mypy bug: `Type[TypedDict]` is resolved as `Any` https://github.com/python/mypy/issues/11030\n typeddict_cls: Type['TypedDict'], # type: ignore[valid-type]\n **kwargs: Any,\n) -> Type['BaseModel']:\n \"\"\"\n Create a `BaseModel` based on the fields of a `TypedDict`.\n Since `typing.TypedDict` in Python 3.8 does not store runtime information about optional keys,\n we raise an error if this happens (see https://bugs.python.org/issue38834).\n \"\"\"\n field_definitions: Dict[str, Any]\n\n # Best case scenario: with python 3.9+ or when `TypedDict` is imported from `typing_extensions`\n if not hasattr(typeddict_cls, '__required_keys__'):\n raise TypeError(\n 'You should use `typing_extensions.TypedDict` instead of `typing.TypedDict` with Python < 3.9.2. '\n 'Without it, there is no way to differentiate required and optional fields when subclassed.'\n )\n\n if is_legacy_typeddict(typeddict_cls) and any(\n is_typeddict_special(t) for t in typeddict_cls.__annotations__.values()\n ):\n raise TypeError(\n 'You should use `typing_extensions.TypedDict` instead of `typing.TypedDict` with Python < 3.11. '\n 'Without it, there is no way to reflect Required/NotRequired keys.'\n )\n\n required_keys: FrozenSet[str] = typeddict_cls.__required_keys__ # type: ignore[attr-defined]\n field_definitions = {\n field_name: (field_type, Required if field_name in required_keys else None)\n for field_name, field_type in typeddict_cls.__annotations__.items()\n }\n\n return create_model(typeddict_cls.__name__, **kwargs, **field_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/v1/annotated_types.py_create_model_from_namedtuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/annotated_types.py_create_model_from_namedtuple_", "embedding": null, "metadata": {"file_path": "pydantic/v1/annotated_types.py", "file_name": "annotated_types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 73, "span_ids": ["create_model_from_namedtuple"], "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 create_model_from_namedtuple(namedtuple_cls: Type['NamedTuple'], **kwargs: Any) -> Type['BaseModel']:\n \"\"\"\n Create a `BaseModel` based on the fields of a named tuple.\n A named tuple can be created with `typing.NamedTuple` and declared annotations\n but also with `collections.namedtuple`, in this case we consider all fields\n to have type `Any`.\n \"\"\"\n # With python 3.10+, `__annotations__` always exists but can be empty hence the `getattr... or...` logic\n namedtuple_annotations: Dict[str, Type[Any]] = getattr(namedtuple_cls, '__annotations__', None) or {\n k: Any for k in namedtuple_cls._fields\n }\n field_definitions: Dict[str, Any] = {\n field_name: (field_type, Required) for field_name, field_type in namedtuple_annotations.items()\n }\n return create_model(namedtuple_cls.__name__, **kwargs, **field_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/v1/class_validators.py_warnings_Validator.__init__.self.skip_on_failure.skip_on_failure": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_warnings_Validator.__init__.self.skip_on_failure.skip_on_failure", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "Validator.__init__", "Validator"], "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": "import warnings\nfrom collections import ChainMap\nfrom functools import partial, partialmethod, wraps\nfrom itertools import chain\nfrom types import FunctionType\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload\n\nfrom .errors import ConfigError\nfrom .typing import AnyCallable\nfrom .utils import ROOT_KEY, in_ipython\n\nif TYPE_CHECKING:\n from .typing import AnyClassMethod\n\n\nclass Validator:\n __slots__ = 'func', 'pre', 'each_item', 'always', 'check_fields', 'skip_on_failure'\n\n def __init__(\n self,\n func: AnyCallable,\n pre: bool = False,\n each_item: bool = False,\n always: bool = False,\n check_fields: bool = False,\n skip_on_failure: bool = False,\n ):\n self.func = func\n self.pre = pre\n self.each_item = each_item\n self.always = always\n self.check_fields = check_fields\n self.skip_on_failure = skip_on_failure", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_None_1_ROOT_VALIDATOR_CONFIG_KEY.___root_validator_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_None_1_ROOT_VALIDATOR_CONFIG_KEY.___root_validator_config_", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 49, "span_ids": ["impl:2"], "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": "if TYPE_CHECKING:\n from inspect import Signature\n\n from .config import BaseConfig\n from .fields import ModelField\n from .types import ModelOrDc\n\n ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any]\n ValidatorsList = List[ValidatorCallable]\n ValidatorListDict = Dict[str, List[Validator]]\n\n_FUNCS: Set[str] = set()\nVALIDATOR_CONFIG_KEY = '__validator_config__'\nROOT_VALIDATOR_CONFIG_KEY = '__root_validator_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/v1/class_validators.py_validator_validator.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_validator_validator.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 104, "span_ids": ["validator"], "tokens": 516}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def validator(\n *fields: str,\n pre: bool = False,\n each_item: bool = False,\n always: bool = False,\n check_fields: bool = True,\n whole: Optional[bool] = None,\n allow_reuse: bool = False,\n) -> Callable[[AnyCallable], 'AnyClassMethod']:\n \"\"\"\n Decorate methods on the class indicating that they should be used to validate fields\n :param fields: which field(s) the method 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 if not fields:\n raise ConfigError('validator with no fields specified')\n elif isinstance(fields[0], FunctionType):\n raise ConfigError(\n \"validators should be used with fields and keyword arguments, not bare. \" # noqa: Q000\n \"E.g. usage should be `@validator('', ...)`\"\n )\n elif not all(isinstance(field, str) for field in fields):\n raise ConfigError(\n \"validator fields should be passed as separate string args. \" # noqa: Q000\n \"E.g. usage should be `@validator('', '', ...)`\"\n )\n\n if whole is not None:\n warnings.warn(\n 'The \"whole\" keyword argument is deprecated, use \"each_item\" (inverse meaning, default False) instead',\n DeprecationWarning,\n )\n assert each_item is False, '\"each_item\" and \"whole\" conflict, remove \"whole\"'\n each_item = not whole\n\n def dec(f: AnyCallable) -> 'AnyClassMethod':\n f_cls = _prepare_validator(f, allow_reuse)\n setattr(\n f_cls,\n VALIDATOR_CONFIG_KEY,\n (\n fields,\n Validator(func=f_cls.__func__, pre=pre, each_item=each_item, always=always, check_fields=check_fields),\n ),\n )\n return f_cls\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/v1/class_validators.py_root_validator_root_validator_3.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_root_validator_root_validator_3.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 140, "span_ids": ["root_validator", "root_validator_3", "root_validator_2"], "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": "@overload\ndef root_validator(_func: AnyCallable) -> 'AnyClassMethod':\n ...\n\n\n@overload\ndef root_validator(\n *, pre: bool = False, allow_reuse: bool = False, skip_on_failure: bool = False\n) -> Callable[[AnyCallable], 'AnyClassMethod']:\n ...\n\n\ndef root_validator(\n _func: Optional[AnyCallable] = None, *, pre: bool = False, allow_reuse: bool = False, skip_on_failure: bool = False\n) -> Union['AnyClassMethod', Callable[[AnyCallable], 'AnyClassMethod']]:\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 if _func:\n f_cls = _prepare_validator(_func, allow_reuse)\n setattr(\n f_cls, ROOT_VALIDATOR_CONFIG_KEY, Validator(func=f_cls.__func__, pre=pre, skip_on_failure=skip_on_failure)\n )\n return f_cls\n\n def dec(f: AnyCallable) -> 'AnyClassMethod':\n f_cls = _prepare_validator(f, allow_reuse)\n setattr(\n f_cls, ROOT_VALIDATOR_CONFIG_KEY, Validator(func=f_cls.__func__, pre=pre, skip_on_failure=skip_on_failure)\n )\n return f_cls\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/v1/class_validators.py__prepare_validator__prepare_validator.return.f_cls": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py__prepare_validator__prepare_validator.return.f_cls", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 158, "span_ids": ["_prepare_validator"], "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 _prepare_validator(function: AnyCallable, allow_reuse: bool) -> 'AnyClassMethod':\n \"\"\"\n Avoid validators with duplicated names since without this, validators can be overwritten silently\n which generally isn't the intended behaviour, don't run in ipython (see #312) or if allow_reuse is False.\n \"\"\"\n f_cls = function if isinstance(function, classmethod) else classmethod(function)\n if not in_ipython() and not allow_reuse:\n ref = (\n getattr(f_cls.__func__, '__module__', '')\n + '.'\n + getattr(f_cls.__func__, '__qualname__', f'')\n )\n if ref in _FUNCS:\n raise ConfigError(f'duplicate validator function \"{ref}\"; if this is intended, set `allow_reuse=True`')\n _FUNCS.add(ref)\n return f_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/v1/class_validators.py_ValidatorGroup_ValidatorGroup.get_validators.if_validators_.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_ValidatorGroup_ValidatorGroup.get_validators.if_validators_.else_.return.None", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 174, "span_ids": ["ValidatorGroup", "ValidatorGroup.get_validators", "ValidatorGroup.__init__"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidatorGroup:\n def __init__(self, validators: 'ValidatorListDict') -> None:\n self.validators = validators\n self.used_validators = {'*'}\n\n def get_validators(self, name: str) -> Optional[Dict[str, Validator]]:\n self.used_validators.add(name)\n validators = self.validators.get(name, [])\n if name != ROOT_KEY:\n validators += self.validators.get('*', [])\n if validators:\n return {getattr(v.func, '__name__', f''): v for v in validators}\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_ValidatorGroup.check_for_unused_extract_validators.return.validators": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_ValidatorGroup.check_for_unused_extract_validators.return.validators", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 206, "span_ids": ["extract_validators", "ValidatorGroup.check_for_unused"], "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 ValidatorGroup:\n\n def check_for_unused(self) -> None:\n unused_validators = set(\n chain.from_iterable(\n (\n getattr(v.func, '__name__', f'')\n for v in self.validators[f]\n if v.check_fields\n )\n for f in (self.validators.keys() - self.used_validators)\n )\n )\n if unused_validators:\n fn = ', '.join(unused_validators)\n raise ConfigError(\n f\"Validators defined with incorrect fields: {fn} \" # noqa: Q000\n f\"(use check_fields=False if you're inheriting from the model and intended this)\"\n )\n\n\ndef extract_validators(namespace: Dict[str, Any]) -> Dict[str, List[Validator]]:\n validators: Dict[str, List[Validator]] = {}\n for var_name, value in namespace.items():\n validator_config = getattr(value, VALIDATOR_CONFIG_KEY, None)\n if validator_config:\n fields, v = validator_config\n for field in fields:\n if field in validators:\n validators[field].append(v)\n else:\n validators[field] = [v]\n return 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/pydantic/v1/class_validators.py_extract_root_validators_inherit_validators.return.validators": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_extract_root_validators_inherit_validators.return.validators", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 239, "span_ids": ["inherit_validators", "extract_root_validators"], "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 extract_root_validators(namespace: Dict[str, Any]) -> Tuple[List[AnyCallable], List[Tuple[bool, AnyCallable]]]:\n from inspect import signature\n\n pre_validators: List[AnyCallable] = []\n post_validators: List[Tuple[bool, AnyCallable]] = []\n for name, value in namespace.items():\n validator_config: Optional[Validator] = getattr(value, ROOT_VALIDATOR_CONFIG_KEY, None)\n if validator_config:\n sig = signature(validator_config.func)\n args = list(sig.parameters.keys())\n if args[0] == 'self':\n raise ConfigError(\n f'Invalid signature for root validator {name}: {sig}, \"self\" not permitted as first argument, '\n f'should be: (cls, values).'\n )\n if len(args) != 2:\n raise ConfigError(f'Invalid signature for root validator {name}: {sig}, should be: (cls, values).')\n # check function signature\n if validator_config.pre:\n pre_validators.append(validator_config.func)\n else:\n post_validators.append((validator_config.skip_on_failure, validator_config.func))\n return pre_validators, post_validators\n\n\ndef inherit_validators(base_validators: 'ValidatorListDict', validators: 'ValidatorListDict') -> 'ValidatorListDict':\n for field, field_validators in base_validators.items():\n if field not in validators:\n validators[field] = []\n validators[field] += field_validators\n return 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/pydantic/v1/class_validators.py_make_generic_validator_all_kwargs._values_field_conf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py_make_generic_validator_all_kwargs._values_field_conf", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 285, "span_ids": ["make_generic_validator", "impl:19", "prep_validators"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_generic_validator(validator: AnyCallable) -> 'ValidatorCallable':\n \"\"\"\n Make a generic function which calls a validator with the right arguments.\n\n Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow,\n hence this laborious way of doing things.\n\n It's done like this so validators don't all need **kwargs in their signature, eg. any combination of\n the arguments \"values\", \"fields\" and/or \"config\" are permitted.\n \"\"\"\n from inspect import signature\n\n if not isinstance(validator, (partial, partialmethod)):\n # This should be the default case, so overhead is reduced\n sig = signature(validator)\n args = list(sig.parameters.keys())\n else:\n # Fix the generated argument lists of partial methods\n sig = signature(validator.func)\n args = [\n k\n for k in signature(validator.func).parameters.keys()\n if k not in validator.args | validator.keywords.keys()\n ]\n\n first_arg = args.pop(0)\n if first_arg == 'self':\n raise ConfigError(\n f'Invalid signature for validator {validator}: {sig}, \"self\" not permitted as first argument, '\n f'should be: (cls, value, values, config, field), \"values\", \"config\" and \"field\" are all optional.'\n )\n elif first_arg == 'cls':\n # assume the second argument is value\n return wraps(validator)(_generic_validator_cls(validator, sig, set(args[1:])))\n else:\n # assume the first argument was value which has already been removed\n return wraps(validator)(_generic_validator_basic(validator, sig, set(args)))\n\n\ndef prep_validators(v_funcs: Iterable[AnyCallable]) -> 'ValidatorsList':\n return [make_generic_validator(f) for f in v_funcs if f]\n\n\nall_kwargs = {'values', 'field', '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/v1/class_validators.py__generic_validator_cls__generic_validator_cls.if_has_kwargs_.else_.return.lambda_cls_v_values_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py__generic_validator_cls__generic_validator_cls.if_has_kwargs_.else_.return.lambda_cls_v_values_fi", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 319, "span_ids": ["_generic_validator_cls"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _generic_validator_cls(validator: AnyCallable, sig: 'Signature', args: Set[str]) -> 'ValidatorCallable':\n # assume the first argument is value\n has_kwargs = False\n if 'kwargs' in args:\n has_kwargs = True\n args -= {'kwargs'}\n\n if not args.issubset(all_kwargs):\n raise ConfigError(\n f'Invalid signature for validator {validator}: {sig}, should be: '\n f'(cls, value, values, config, field), \"values\", \"config\" and \"field\" are all optional.'\n )\n\n if has_kwargs:\n return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field, config=config)\n elif args == set():\n return lambda cls, v, values, field, config: validator(cls, v)\n elif args == {'values'}:\n return lambda cls, v, values, field, config: validator(cls, v, values=values)\n elif args == {'field'}:\n return lambda cls, v, values, field, config: validator(cls, v, field=field)\n elif args == {'config'}:\n return lambda cls, v, values, field, config: validator(cls, v, config=config)\n elif args == {'values', 'field'}:\n return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field)\n elif args == {'values', 'config'}:\n return lambda cls, v, values, field, config: validator(cls, v, values=values, config=config)\n elif args == {'field', 'config'}:\n return lambda cls, v, values, field, config: validator(cls, v, field=field, config=config)\n else:\n # args == {'values', 'field', 'config'}\n return lambda cls, v, values, field, config: validator(cls, v, values=values, field=field, config=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/v1/class_validators.py__generic_validator_basic_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/class_validators.py__generic_validator_basic_", "embedding": null, "metadata": {"file_path": "pydantic/v1/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 322, "end_line": 362, "span_ids": ["gather_all_validators", "_generic_validator_basic"], "tokens": 491}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _generic_validator_basic(validator: AnyCallable, sig: 'Signature', args: Set[str]) -> 'ValidatorCallable':\n has_kwargs = False\n if 'kwargs' in args:\n has_kwargs = True\n args -= {'kwargs'}\n\n if not args.issubset(all_kwargs):\n raise ConfigError(\n f'Invalid signature for validator {validator}: {sig}, should be: '\n f'(value, values, config, field), \"values\", \"config\" and \"field\" are all optional.'\n )\n\n if has_kwargs:\n return lambda cls, v, values, field, config: validator(v, values=values, field=field, config=config)\n elif args == set():\n return lambda cls, v, values, field, config: validator(v)\n elif args == {'values'}:\n return lambda cls, v, values, field, config: validator(v, values=values)\n elif args == {'field'}:\n return lambda cls, v, values, field, config: validator(v, field=field)\n elif args == {'config'}:\n return lambda cls, v, values, field, config: validator(v, config=config)\n elif args == {'values', 'field'}:\n return lambda cls, v, values, field, config: validator(v, values=values, field=field)\n elif args == {'values', 'config'}:\n return lambda cls, v, values, field, config: validator(v, values=values, config=config)\n elif args == {'field', 'config'}:\n return lambda cls, v, values, field, config: validator(v, field=field, config=config)\n else:\n # args == {'values', 'field', 'config'}\n return lambda cls, v, values, field, config: validator(v, values=values, field=field, config=config)\n\n\ndef gather_all_validators(type_: 'ModelOrDc') -> Dict[str, 'AnyClassMethod']:\n all_attributes = ChainMap(*[cls.__dict__ for cls in type_.__mro__]) # type: ignore[arg-type,var-annotated]\n return {\n k: v\n for k, v in all_attributes.items()\n if hasattr(v, VALIDATOR_CONFIG_KEY) or hasattr(v, ROOT_VALIDATOR_CONFIG_KEY)\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/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/v1/color.py___HslColorTuple.Union_Tuple_float_float_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["docstring"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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 TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast\n\nfrom .errors import ColorError\nfrom .utils import Representation, almost_equal_floats\n\nif TYPE_CHECKING:\n from .typing import CallableGenerator, ReprArgs\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/v1/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/v1/color.py_RGBA_RGBA.__getitem__.return.self__tuple_item_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 42, "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/v1/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/v1/color.py__these_are_not_compiled__rads.2_math_pi", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 60, "span_ids": ["RGBA.__getitem__", "impl:8"], "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": "# these are not compiled here to avoid import slowdown, they'll be compiled the first time they're used, then cached\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_r_255 = r'(\\d{1,3}(?:\\.\\d+)?)'\n_r_comma = r'\\s*,\\s*'\nr_rgb = fr'\\s*rgb\\(\\s*{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_255}\\)\\s*'\n_r_alpha = r'(\\d(?:\\.\\d+)?|\\.\\d+|\\d{1,2}%)'\nr_rgba = fr'\\s*rgba\\(\\s*{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_255}{_r_comma}{_r_alpha}\\s*\\)\\s*'\n_r_h = r'(-?\\d+(?:\\.\\d+)?|-?\\.\\d+)(deg|rad|turn)?'\n_r_sl = r'(\\d{1,3}(?:\\.\\d+)?)%'\nr_hsl = fr'\\s*hsl\\(\\s*{_r_h}{_r_comma}{_r_sl}{_r_comma}{_r_sl}\\s*\\)\\s*'\nr_hsla = fr'\\s*hsl\\(\\s*{_r_h}{_r_comma}{_r_sl}{_r_comma}{_r_sl}{_r_comma}{_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/v1/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/v1/color.py_Color_Color.as_named.if_self__rgba_alpha_is_No.else_.return.self_as_hex_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 103, "span_ids": ["Color.original", "Color.__modify_schema__", "Color.__init__", "Color.as_named", "Color"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Color(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 ColorError(reason='value must be a tuple, list or string')\n\n # if we've got here value must be a valid color\n self._original = value\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format='color')\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/v1/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/v1/color.py_Color.as_hex_Color.as_hex.return._as_hex", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 117, "span_ids": ["Color.as_hex"], "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 Color(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/v1/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/v1/color.py_Color.as_rgb_Color.as_rgb.if_self__rgba_alpha_is_No.else_.return._", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 129, "span_ids": ["Color.as_rgb"], "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 Color(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/v1/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/v1/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/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 151, "span_ids": ["Color.as_rgb_tuple"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Color(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/v1/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/v1/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/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 162, "span_ids": ["Color.as_hsl"], "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 Color(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/v1/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/v1/color.py_Color.as_hsl_tuple_Color.as_hsl_tuple.if_alpha_.else_.return.h_s_l", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 186, "span_ids": ["Color.as_hsl_tuple"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Color(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)\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/v1/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/v1/color.py_Color._alpha_float_Color.__hash__.return.hash_self_as_rgb_tuple_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 188, "end_line": 205, "span_ids": ["Color._alpha_float", "Color.__get_validators__", "Color.__hash__", "Color.__repr_args__", "Color.__eq__", "Color.__str__"], "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(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_validators__(cls) -> 'CallableGenerator':\n yield cls\n\n def __str__(self) -> str:\n return self.as_named(fallback=True)\n\n def __repr_args__(self) -> 'ReprArgs':\n return [(None, self.as_named(fallback=True))] + [('rgb', self.as_rgb_tuple())] # type: ignore\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/v1/color.py_parse_tuple_parse_tuple.if_len_value_3_.else_.raise_ColorError_reason_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_tuple_parse_tuple.if_len_value_3_.else_.raise_ColorError_reason_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 219, "span_ids": ["parse_tuple"], "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 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 ColorError(reason='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/v1/color.py_parse_str_parse_str.raise_ColorError_reason_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_str_parse_str.raise_ColorError_reason_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 277, "span_ids": ["parse_str"], "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 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)\n if m:\n return ints_to_rgba(*m.groups(), None) # type: ignore\n\n m = re.fullmatch(r_rgba, value_lower)\n if m:\n return ints_to_rgba(*m.groups()) # type: ignore\n\n m = re.fullmatch(r_hsl, value_lower)\n if m:\n h, h_units, s, l_ = m.groups()\n return parse_hsl(h, h_units, s, l_)\n\n m = re.fullmatch(r_hsla, value_lower)\n if m:\n h, h_units, s, l_, a = m.groups()\n return parse_hsl(h, h_units, s, l_, parse_float_alpha(a))\n\n raise ColorError(reason='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/v1/color.py_ints_to_rgba_parse_color_value.if_0_color_max_val_.else_.raise_ColorError_reason_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_ints_to_rgba_parse_color_value.if_0_color_max_val_.else_.raise_ColorError_reason_f", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 296, "span_ids": ["parse_color_value", "ints_to_rgba"], "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 ints_to_rgba(r: Union[int, str], g: Union[int, str], b: Union[int, str], alpha: Optional[float]) -> 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 ColorError(reason='color values must be a valid number')\n if 0 <= color <= max_val:\n return color / max_val\n else:\n raise ColorError(reason=f'color values must be in the range 0 to {max_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/pydantic/v1/color.py_parse_float_alpha_parse_float_alpha.if_almost_equal_floats_al.else_.raise_ColorError_reason_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_float_alpha_parse_float_alpha.if_almost_equal_floats_al.else_.raise_ColorError_reason_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 318, "span_ids": ["parse_float_alpha"], "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 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 ColorError(reason='alpha values must be a valid float')\n\n if almost_equal_floats(alpha, 1):\n return None\n elif 0 <= alpha <= 1:\n return alpha\n else:\n raise ColorError(reason='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/v1/color.py_parse_hsl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/color.py_parse_hsl_", "embedding": null, "metadata": {"file_path": "pydantic/v1/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 495, "span_ids": ["impl:36", "float_to_255", "impl:34", "parse_hsl"], "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 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, 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/v1/config.py_json_if_not_compiled_.else_._type_ignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_json_if_not_compiled_.else_._type_ignore", "embedding": null, "metadata": {"file_path": "pydantic/v1/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 77, "span_ids": ["impl:9", "imports", "Extra"], "tokens": 582}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom enum import Enum\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, ForwardRef, Optional, Tuple, Type, Union\n\nfrom typing_extensions import Literal, Protocol\n\nfrom .typing import AnyArgTCallable, AnyCallable\nfrom .utils import GetterDict\nfrom .version import compiled\n\nif TYPE_CHECKING:\n from typing import overload\n\n from .fields import ModelField\n from .main import BaseModel\n\n ConfigType = Type['BaseConfig']\n\n class SchemaExtraCallable(Protocol):\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', 'get_config', 'Extra', 'inherit_config', 'prepare_config'\n\n\nclass Extra(str, Enum):\n allow = 'allow'\n ignore = 'ignore'\n forbid = 'forbid'\n\n\n# https://github.com/cython/cython/issues/4003\n# Fixed in Cython 3 and Pydantic v1 won't support Cython 3.\n# Pydantic v2 doesn't depend on Cython at all.\nif not compiled:\n from typing_extensions import TypedDict\n\n class ConfigDict(TypedDict, total=False):\n title: Optional[str]\n anystr_lower: bool\n anystr_strip_whitespace: bool\n min_anystr_length: int\n max_anystr_length: Optional[int]\n validate_all: bool\n extra: Extra\n allow_mutation: bool\n frozen: bool\n allow_population_by_field_name: bool\n use_enum_values: bool\n fields: Dict[str, Union[str, Dict[str, str]]]\n validate_assignment: bool\n error_msg_templates: Dict[str, str]\n arbitrary_types_allowed: bool\n orm_mode: bool\n getter_dict: Type[GetterDict]\n alias_generator: Optional[Callable[[str], str]]\n keep_untouched: Tuple[type, ...]\n schema_extra: Union[Dict[str, object], 'SchemaExtraCallable']\n json_loads: Callable[[str], object]\n json_dumps: AnyArgTCallable[str]\n json_encoders: Dict[Type[object], AnyCallable]\n underscore_attrs_are_private: bool\n allow_inf_nan: bool\n copy_on_model_validation: Literal['none', 'deep', 'shallow']\n # whether dataclass `__post_init__` should be run after validation\n post_init_call: Literal['before_validation', 'after_validation']\n\nelse:\n ConfigDict = 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/v1/config.py_BaseConfig_BaseConfig.post_init_call._before_validation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_BaseConfig_BaseConfig.post_init_call._before_validation_", "embedding": null, "metadata": {"file_path": "pydantic/v1/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 114, "span_ids": ["BaseConfig"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseConfig:\n title: Optional[str] = None\n anystr_lower: bool = False\n anystr_upper: bool = False\n anystr_strip_whitespace: bool = False\n min_anystr_length: int = 0\n max_anystr_length: Optional[int] = None\n validate_all: bool = False\n extra: Extra = Extra.ignore\n allow_mutation: bool = True\n frozen: bool = False\n allow_population_by_field_name: bool = False\n use_enum_values: bool = False\n fields: Dict[str, Union[str, Dict[str, str]]] = {}\n validate_assignment: bool = False\n error_msg_templates: Dict[str, str] = {}\n arbitrary_types_allowed: bool = False\n orm_mode: bool = False\n getter_dict: Type[GetterDict] = GetterDict\n alias_generator: Optional[Callable[[str], str]] = None\n keep_untouched: Tuple[type, ...] = ()\n schema_extra: Union[Dict[str, Any], 'SchemaExtraCallable'] = {}\n json_loads: Callable[[str], Any] = json.loads\n json_dumps: Callable[..., str] = json.dumps\n json_encoders: Dict[Union[Type[Any], str, ForwardRef], AnyCallable] = {}\n underscore_attrs_are_private: bool = False\n allow_inf_nan: bool = True\n\n # whether inherited models as fields should be reconstructed as base model,\n # and whether such a copy should be shallow or deep\n copy_on_model_validation: Literal['none', 'deep', 'shallow'] = 'shallow'\n\n # whether `Union` should check all allowed types before even trying to coerce\n smart_union: bool = False\n # whether dataclass `__post_init__` should be run before or after validation\n post_init_call: Literal['before_validation', 'after_validation'] = 'before_validation'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_BaseConfig.get_field_info_BaseConfig.prepare_field.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_BaseConfig.get_field_info_BaseConfig.prepare_field.pass", "embedding": null, "metadata": {"file_path": "pydantic/v1/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 146, "span_ids": ["BaseConfig.prepare_field", "BaseConfig.get_field_info"], "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 BaseConfig:\n\n @classmethod\n def get_field_info(cls, name: str) -> Dict[str, Any]:\n \"\"\"\n Get properties of FieldInfo from the `fields` property of the config class.\n \"\"\"\n\n fields_value = cls.fields.get(name)\n\n if isinstance(fields_value, str):\n field_info: Dict[str, Any] = {'alias': fields_value}\n elif isinstance(fields_value, dict):\n field_info = fields_value\n else:\n field_info = {}\n\n if 'alias' in field_info:\n field_info.setdefault('alias_priority', 2)\n\n if field_info.get('alias_priority', 0) <= 1 and cls.alias_generator:\n alias = cls.alias_generator(name)\n if not isinstance(alias, str):\n raise TypeError(f'Config.alias_generator must return str, not {alias.__class__}')\n field_info.update(alias=alias, alias_priority=1)\n return field_info\n\n @classmethod\n def prepare_field(cls, field: 'ModelField') -> None:\n \"\"\"\n Optional hook to check or modify fields during model creation.\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/v1/config.py_get_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/config.py_get_config_", "embedding": null, "metadata": {"file_path": "pydantic/v1/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 191, "span_ids": ["inherit_config", "prepare_config", "get_config"], "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 get_config(config: Union[ConfigDict, Type[object], None]) -> Type[BaseConfig]:\n if config is None:\n return BaseConfig\n\n else:\n config_dict = (\n config\n if isinstance(config, dict)\n else {k: getattr(config, k) for k in dir(config) if not k.startswith('__')}\n )\n\n class Config(BaseConfig):\n ...\n\n for k, v in config_dict.items():\n setattr(Config, k, v)\n return Config\n\n\ndef inherit_config(self_config: 'ConfigType', parent_config: 'ConfigType', **namespace: Any) -> 'ConfigType':\n if not self_config:\n base_classes: Tuple['ConfigType', ...] = (parent_config,)\n elif self_config == parent_config:\n base_classes = (self_config,)\n else:\n base_classes = self_config, parent_config\n\n namespace['json_encoders'] = {\n **getattr(parent_config, 'json_encoders', {}),\n **getattr(self_config, 'json_encoders', {}),\n **namespace.get('json_encoders', {}),\n }\n\n return type('Config', base_classes, namespace)\n\n\ndef prepare_config(config: Type[BaseConfig], cls_name: str) -> None:\n if not isinstance(config.extra, Extra):\n try:\n config.extra = Extra(config.extra)\n except ValueError:\n raise ValueError(f'\"{cls_name}\": {config.extra} is not a valid value for \"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/pydantic/v1/datetime_parse.py___StrBytesIntFloat.Union_str_bytes_int_fl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py___StrBytesIntFloat.Union_str_bytes_int_fl", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["impl:15", "docstring"], "tokens": 711}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nFunctions to parse datetime objects.\n\nWe're using regular expressions rather than time.strptime because:\n- They provide both validation and parsing.\n- They're more flexible for datetimes.\n- The date/datetime/time constructors produce friendlier error messages.\n\nStolen from https://raw.githubusercontent.com/django/django/main/django/utils/dateparse.py at\n9718fa2e8abe430c3526a9278dd976443d4ae3c6\n\nChanged to:\n* use standard python datetime types not django.utils.timezone\n* raise ValueError when regex doesn't match rather than returning None\n* support parsing unix timestamps for dates and datetimes\n\"\"\"\nimport re\nfrom datetime import date, datetime, time, timedelta, timezone\nfrom typing import Dict, Optional, Type, Union\n\nfrom . import errors\n\ndate_expr = r'(?P\\d{4})-(?P\\d{1,2})-(?P\\d{1,2})'\ntime_expr = (\n r'(?P\\d{1,2}):(?P\\d{1,2})'\n r'(?::(?P\\d{1,2})(?:\\.(?P\\d{1,6})\\d{0,6})?)?'\n r'(?PZ|[+-]\\d{2}(?::?\\d{2})?)?$'\n)\n\ndate_re = re.compile(f'{date_expr}$')\ntime_re = re.compile(time_expr)\ndatetime_re = re.compile(f'{date_expr}[T ]{time_expr}')\n\nstandard_duration_re = re.compile(\n r'^'\n r'(?:(?P-?\\d+) (days?, )?)?'\n r'((?:(?P-?\\d+):)(?=\\d+:\\d+))?'\n r'(?:(?P-?\\d+):)?'\n r'(?P-?\\d+)'\n r'(?:\\.(?P\\d{1,6})\\d{0,6})?'\n r'$'\n)\n\n# Support the sections of ISO 8601 date representation that are accepted by timedelta\niso8601_duration_re = re.compile(\n r'^(?P[-+]?)'\n r'P'\n r'(?:(?P\\d+(.\\d+)?)D)?'\n r'(?:T'\n r'(?:(?P\\d+(.\\d+)?)H)?'\n r'(?:(?P\\d+(.\\d+)?)M)?'\n r'(?:(?P\\d+(.\\d+)?)S)?'\n r')?'\n r'$'\n)\n\nEPOCH = datetime(1970, 1, 1)\n# if greater than this, the number is in ms, if less than or equal it's in seconds\n# (in seconds this is 11th October 2603, in ms it's 20th August 1970)\nMS_WATERSHED = int(2e10)\n# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9\nMAX_NUMBER = int(3e20)\nStrBytesIntFloat = Union[str, bytes, 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/pydantic/v1/datetime_parse.py_get_numeric_from_unix_seconds.return.dt_replace_tzinfo_timezon": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_get_numeric_from_unix_seconds.return.dt_replace_tzinfo_timezon", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 86, "span_ids": ["from_unix_seconds", "get_numeric"], "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_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]:\n if isinstance(value, (int, float)):\n return value\n try:\n return float(value)\n except ValueError:\n return None\n except TypeError:\n raise TypeError(f'invalid type; expected {native_expected_type}, string, bytes, int or float')\n\n\ndef from_unix_seconds(seconds: Union[int, float]) -> datetime:\n if seconds > MAX_NUMBER:\n return datetime.max\n elif seconds < -MAX_NUMBER:\n return datetime.min\n\n while abs(seconds) > MS_WATERSHED:\n seconds /= 1000\n dt = EPOCH + timedelta(seconds=seconds)\n return dt.replace(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/pydantic/v1/datetime_parse.py__parse_timezone__parse_timezone.if_value_Z_.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py__parse_timezone__parse_timezone.if_value_Z_.else_.return.None", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 102, "span_ids": ["_parse_timezone"], "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 _parse_timezone(value: Optional[str], error: Type[Exception]) -> Union[None, int, timezone]:\n if value == 'Z':\n return timezone.utc\n elif value is not None:\n offset_mins = int(value[-2:]) if len(value) > 3 else 0\n offset = 60 * int(value[1:3]) + offset_mins\n if value[0] == '-':\n offset = -offset\n try:\n return timezone(timedelta(minutes=offset))\n except ValueError:\n raise error()\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_date_parse_date.try_.except_ValueError_.raise_errors_DateError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_date_parse_date.try_.except_ValueError_.raise_errors_DateError_", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 134, "span_ids": ["parse_date"], "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 parse_date(value: Union[date, StrBytesIntFloat]) -> date:\n \"\"\"\n Parse a date/int/float/string and return a datetime.date.\n\n Raise ValueError if the input is well formatted but not a valid date.\n Raise ValueError if the input isn't well formatted.\n \"\"\"\n if isinstance(value, date):\n if isinstance(value, datetime):\n return value.date()\n else:\n return value\n\n number = get_numeric(value, 'date')\n if number is not None:\n return from_unix_seconds(number).date()\n\n if isinstance(value, bytes):\n value = value.decode()\n\n match = date_re.match(value) # type: ignore\n if match is None:\n raise errors.DateError()\n\n kw = {k: int(v) for k, v in match.groupdict().items()}\n\n try:\n return date(**kw)\n except ValueError:\n raise errors.DateError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_time_parse_time.try_.except_ValueError_.raise_errors_TimeError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_time_parse_time.try_.except_ValueError_.raise_errors_TimeError_", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 172, "span_ids": ["parse_time"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_time(value: Union[time, StrBytesIntFloat]) -> time:\n \"\"\"\n Parse a time/string and return a datetime.time.\n\n Raise ValueError if the input is well formatted but not a valid time.\n Raise ValueError if the input isn't well formatted, in particular if it contains an offset.\n \"\"\"\n if isinstance(value, time):\n return value\n\n number = get_numeric(value, 'time')\n if number is not None:\n if number >= 86400:\n # doesn't make sense since the time time loop back around to 0\n raise errors.TimeError()\n return (datetime.min + timedelta(seconds=number)).time()\n\n if isinstance(value, bytes):\n value = value.decode()\n\n match = time_re.match(value) # type: ignore\n if match is None:\n raise errors.TimeError()\n\n kw = match.groupdict()\n if kw['microsecond']:\n kw['microsecond'] = kw['microsecond'].ljust(6, '0')\n\n tzinfo = _parse_timezone(kw.pop('tzinfo'), errors.TimeError)\n kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None}\n kw_['tzinfo'] = tzinfo\n\n try:\n return time(**kw_) # type: ignore\n except ValueError:\n raise errors.TimeError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_datetime_parse_datetime.try_.except_ValueError_.raise_errors_DateTimeErro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_datetime_parse_datetime.try_.except_ValueError_.raise_errors_DateTimeErro", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 210, "span_ids": ["parse_datetime"], "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 parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:\n \"\"\"\n Parse a datetime/int/float/string and return a datetime.datetime.\n\n This function supports time zone offsets. When the input contains one,\n the output uses a timezone with a fixed offset from UTC.\n\n Raise ValueError if the input is well formatted but not a valid datetime.\n Raise ValueError if the input isn't well formatted.\n \"\"\"\n if isinstance(value, datetime):\n return value\n\n number = get_numeric(value, 'datetime')\n if number is not None:\n return from_unix_seconds(number)\n\n if isinstance(value, bytes):\n value = value.decode()\n\n match = datetime_re.match(value) # type: ignore\n if match is None:\n raise errors.DateTimeError()\n\n kw = match.groupdict()\n if kw['microsecond']:\n kw['microsecond'] = kw['microsecond'].ljust(6, '0')\n\n tzinfo = _parse_timezone(kw.pop('tzinfo'), errors.DateTimeError)\n kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None}\n kw_['tzinfo'] = tzinfo\n\n try:\n return datetime(**kw_) # type: ignore\n except ValueError:\n raise errors.DateTimeError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_duration_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/datetime_parse.py_parse_duration_", "embedding": null, "metadata": {"file_path": "pydantic/v1/datetime_parse.py", "file_name": "datetime_parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 249, "span_ids": ["parse_duration"], "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 parse_duration(value: StrBytesIntFloat) -> timedelta:\n \"\"\"\n Parse a duration int/float/string and return a datetime.timedelta.\n\n The preferred format for durations in Django is '%d %H:%M:%S.%f'.\n\n Also supports ISO 8601 representation.\n \"\"\"\n if isinstance(value, timedelta):\n return value\n\n if isinstance(value, (int, float)):\n # below code requires a string\n value = f'{value:f}'\n elif isinstance(value, bytes):\n value = value.decode()\n\n try:\n match = standard_duration_re.match(value) or iso8601_duration_re.match(value)\n except TypeError:\n raise TypeError('invalid type; expected timedelta, string, bytes, int or float')\n\n if not match:\n raise errors.DurationError()\n\n kw = match.groupdict()\n sign = -1 if kw.pop('sign', '+') == '-' else 1\n if kw.get('microseconds'):\n kw['microseconds'] = kw['microseconds'].ljust(6, '0')\n\n if kw.get('seconds') and kw.get('microseconds') and kw['seconds'].startswith('-'):\n kw['microseconds'] = '-' + kw['microseconds']\n\n kw_ = {k: float(v) for k, v in kw.items() if v is not None}\n\n return sign * timedelta(**kw_)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_from_functools_import_wra_validate_arguments_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_from_functools_import_wra_validate_arguments_1._", "embedding": null, "metadata": {"file_path": "pydantic/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["validate_arguments", "imports", "validate_arguments_1"], "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": "from functools import wraps\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload\n\nfrom . import validator\nfrom .config import Extra\nfrom .errors import ConfigError\nfrom .main import BaseModel, create_model\nfrom .typing import get_all_type_hints\nfrom .utils import to_camel\n\n__all__ = ('validate_arguments',)\n\nif TYPE_CHECKING:\n from .typing import AnyCallable\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/v1/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/v1/decorator.py_validate_arguments_2_V_DUPLICATE_KWARGS._v__duplicate_kwargs_", "embedding": null, "metadata": {"file_path": "pydantic/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 57, "span_ids": ["validate_arguments_2", "impl:8"], "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/v1/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/v1/decorator.py_ValidatedFunction_ValidatedFunction.call.return.self_execute_m_", "embedding": null, "metadata": {"file_path": "pydantic/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 134, "span_ids": ["ValidatedFunction", "ValidatedFunction.__init__", "ValidatedFunction.call", "ValidatedFunction.init_model_instance"], "tokens": 700}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidatedFunction:\n def __init__(self, function: 'AnyCallableT', config: 'ConfigType'): # noqa C901\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 ConfigError(\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 = get_all_type_hints(function)\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/v1/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/v1/decorator.py_ValidatedFunction.build_values_ValidatedFunction.build_values.return.values", "embedding": null, "metadata": {"file_path": "pydantic/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 177, "span_ids": ["ValidatedFunction.build_values"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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.__fields__.items()\n if name not in (self.v_args_name, self.v_kwargs_name)\n ]\n non_var_fields = set(self.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/v1/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/v1/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/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 206, "span_ids": ["ValidatedFunction.execute"], "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 ValidatedFunction:\n\n def execute(self, m: BaseModel) -> Any:\n d = {k: v for k, v in m._iter() if k in m.__fields_set__ or m.__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/v1/decorator.py_ValidatedFunction.create_model_ValidatedFunction.create_model.if_hasattr_CustomConfig_.raise_ConfigError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction.create_model_ValidatedFunction.create_model.if_hasattr_CustomConfig_.raise_ConfigError_", "embedding": null, "metadata": {"file_path": "pydantic/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 224, "span_ids": ["ValidatedFunction.create_model"], "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 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 class CustomConfig:\n pass\n\n if not TYPE_CHECKING: # pragma: no branch\n if isinstance(config, dict):\n CustomConfig = type('Config', (), config) # noqa: F811\n elif config is not None:\n CustomConfig = config # noqa: F811\n\n if hasattr(CustomConfig, 'fields') or hasattr(CustomConfig, 'alias_generator'):\n raise ConfigError(\n 'Setting the \"fields\" and \"alias_generator\" property on custom Config for '\n '@validate_arguments is not yet supported, please remove.'\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/v1/decorator.py_ValidatedFunction.create_model.DecoratorBaseModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/decorator.py_ValidatedFunction.create_model.DecoratorBaseModel_", "embedding": null, "metadata": {"file_path": "pydantic/v1/decorator.py", "file_name": "decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 226, "end_line": 265, "span_ids": ["ValidatedFunction.create_model"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidatedFunction:\n\n def create_model(self, fields: Dict[str, Any], takes_args: bool, takes_kwargs: bool, config: 'ConfigType') -> None:\n # ... other code\n\n class DecoratorBaseModel(BaseModel):\n @validator(self.v_args_name, check_fields=False, allow_reuse=True)\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 @validator(self.v_kwargs_name, check_fields=False, allow_reuse=True)\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 @validator(V_POSITIONAL_ONLY_NAME, check_fields=False, allow_reuse=True)\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 @validator(V_DUPLICATE_KWARGS, check_fields=False, allow_reuse=True)\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 class Config(CustomConfig):\n extra = getattr(CustomConfig, 'extra', Extra.forbid)\n\n self.model = create_model(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/v1/env_settings.py_os_SettingsError.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_os_SettingsError.pass", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "span_ids": ["imports", "SettingsError"], "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": "import os\nimport warnings\nfrom pathlib import Path\nfrom typing import AbstractSet, Any, Callable, ClassVar, Dict, List, Mapping, Optional, Tuple, Type, Union\n\nfrom .config import BaseConfig, Extra\nfrom .fields import ModelField\nfrom .main import BaseModel\nfrom .types import JsonWrapper\nfrom .typing import StrPath, display_as_type, get_origin, is_union\nfrom .utils import deep_update, lenient_issubclass, path_type, sequence_like\n\nenv_file_sentinel = str(object())\n\nSettingsSourceCallable = Callable[['BaseSettings'], Dict[str, Any]]\nDotenvType = Union[StrPath, List[StrPath], Tuple[StrPath, ...]]\n\n\nclass SettingsError(ValueError):\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/v1/env_settings.py_BaseSettings_BaseSettings.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_BaseSettings_BaseSettings.__init__.super___init___", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 47, "span_ids": ["BaseSettings", "BaseSettings.__init__"], "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 BaseSettings(BaseModel):\n \"\"\"\n Base class for settings, allowing values to be overridden by environment variables.\n\n This is useful in production for secrets you do not wish to save in code, it plays nicely with docker(-compose),\n Heroku and any 12 factor app design.\n \"\"\"\n\n def __init__(\n __pydantic_self__,\n _env_file: Optional[DotenvType] = env_file_sentinel,\n _env_file_encoding: Optional[str] = None,\n _env_nested_delimiter: Optional[str] = None,\n _secrets_dir: Optional[StrPath] = None,\n **values: Any,\n ) -> None:\n # Uses something other than `self` the first arg to allow \"self\" as a settable attribute\n super().__init__(\n **__pydantic_self__._build_values(\n values,\n _env_file=_env_file,\n _env_file_encoding=_env_file_encoding,\n _env_nested_delimiter=_env_nested_delimiter,\n _secrets_dir=_secrets_dir,\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/v1/env_settings.py_BaseSettings._build_values_BaseSettings._build_values.if_sources_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_BaseSettings._build_values_BaseSettings._build_values.if_sources_.else_.return._", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 79, "span_ids": ["BaseSettings._build_values"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseSettings(BaseModel):\n\n def _build_values(\n self,\n init_kwargs: Dict[str, Any],\n _env_file: Optional[DotenvType] = None,\n _env_file_encoding: Optional[str] = None,\n _env_nested_delimiter: Optional[str] = None,\n _secrets_dir: Optional[StrPath] = None,\n ) -> Dict[str, Any]:\n # Configure built-in sources\n init_settings = InitSettingsSource(init_kwargs=init_kwargs)\n env_settings = EnvSettingsSource(\n env_file=(_env_file if _env_file != env_file_sentinel else self.__config__.env_file),\n env_file_encoding=(\n _env_file_encoding if _env_file_encoding is not None else self.__config__.env_file_encoding\n ),\n env_nested_delimiter=(\n _env_nested_delimiter if _env_nested_delimiter is not None else self.__config__.env_nested_delimiter\n ),\n env_prefix_len=len(self.__config__.env_prefix),\n )\n file_secret_settings = SecretsSettingsSource(secrets_dir=_secrets_dir or self.__config__.secrets_dir)\n # Provide a hook to set built-in sources priority and add / remove sources\n sources = self.__config__.customise_sources(\n init_settings=init_settings, env_settings=env_settings, file_secret_settings=file_secret_settings\n )\n if sources:\n return deep_update(*reversed([source(self) for source in sources]))\n else:\n # no one should mean to do this, but I think returning an empty dict is marginally preferable\n # to an informative error and much better than a confusing error\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/v1/env_settings.py_BaseSettings.Config_BaseSettings.__config__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_BaseSettings.Config_BaseSettings.__config__", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 134, "span_ids": ["BaseSettings.Config.prepare_field", "BaseSettings.Config.parse_env_var", "BaseSettings.Config", "BaseSettings:3", "BaseSettings.Config.customise_sources"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseSettings(BaseModel):\n\n class Config(BaseConfig):\n env_prefix: str = ''\n env_file: Optional[DotenvType] = None\n env_file_encoding: Optional[str] = None\n env_nested_delimiter: Optional[str] = None\n secrets_dir: Optional[StrPath] = None\n validate_all: bool = True\n extra: Extra = Extra.forbid\n arbitrary_types_allowed: bool = True\n case_sensitive: bool = False\n\n @classmethod\n def prepare_field(cls, field: ModelField) -> None:\n env_names: Union[List[str], AbstractSet[str]]\n field_info_from_config = cls.get_field_info(field.name)\n\n env = field_info_from_config.get('env') or field.field_info.extra.get('env')\n if env is None:\n if field.has_alias:\n warnings.warn(\n 'aliases are no longer used by BaseSettings to define which environment variables to read. '\n 'Instead use the \"env\" field setting. '\n 'See https://pydantic-docs.helpmanual.io/usage/settings/#environment-variable-names',\n FutureWarning,\n )\n env_names = {cls.env_prefix + field.name}\n elif isinstance(env, str):\n env_names = {env}\n elif isinstance(env, (set, frozenset)):\n env_names = env\n elif sequence_like(env):\n env_names = list(env)\n else:\n raise TypeError(f'invalid field env: {env!r} ({display_as_type(env)}); should be string, list or set')\n\n if not cls.case_sensitive:\n env_names = env_names.__class__(n.lower() for n in env_names)\n field.field_info.extra['env_names'] = env_names\n\n @classmethod\n def customise_sources(\n cls,\n init_settings: SettingsSourceCallable,\n env_settings: SettingsSourceCallable,\n file_secret_settings: SettingsSourceCallable,\n ) -> Tuple[SettingsSourceCallable, ...]:\n return init_settings, env_settings, file_secret_settings\n\n @classmethod\n def parse_env_var(cls, field_name: str, raw_val: str) -> Any:\n return cls.json_loads(raw_val)\n\n # populated by the metaclass using the Config class defined above, annotated here to help IDEs only\n __config__: ClassVar[Type[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/v1/env_settings.py_InitSettingsSource_EnvSettingsSource.__init__.self.env_prefix_len.env_prefix_len": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_InitSettingsSource_EnvSettingsSource.__init__.self.env_prefix_len.env_prefix_len", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 163, "span_ids": ["InitSettingsSource", "InitSettingsSource.__init__", "InitSettingsSource.__repr__", "InitSettingsSource.__call__", "EnvSettingsSource", "EnvSettingsSource.__init__"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class InitSettingsSource:\n __slots__ = ('init_kwargs',)\n\n def __init__(self, init_kwargs: Dict[str, Any]):\n self.init_kwargs = init_kwargs\n\n def __call__(self, settings: BaseSettings) -> Dict[str, Any]:\n return self.init_kwargs\n\n def __repr__(self) -> str:\n return f'InitSettingsSource(init_kwargs={self.init_kwargs!r})'\n\n\nclass EnvSettingsSource:\n __slots__ = ('env_file', 'env_file_encoding', 'env_nested_delimiter', 'env_prefix_len')\n\n def __init__(\n self,\n env_file: Optional[DotenvType],\n env_file_encoding: Optional[str],\n env_nested_delimiter: Optional[str] = None,\n env_prefix_len: int = 0,\n ):\n self.env_file: Optional[DotenvType] = env_file\n self.env_file_encoding: Optional[str] = env_file_encoding\n self.env_nested_delimiter: Optional[str] = env_nested_delimiter\n self.env_prefix_len: int = env_prefix_len", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.__call___EnvSettingsSource.__call__.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.__call___EnvSettingsSource.__call__.return.d", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 210, "span_ids": ["EnvSettingsSource.__call__"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnvSettingsSource:\n\n def __call__(self, settings: BaseSettings) -> Dict[str, Any]: # noqa C901\n \"\"\"\n Build environment variables suitable for passing to the Model.\n \"\"\"\n d: Dict[str, Any] = {}\n\n if settings.__config__.case_sensitive:\n env_vars: Mapping[str, Optional[str]] = os.environ\n else:\n env_vars = {k.lower(): v for k, v in os.environ.items()}\n\n dotenv_vars = self._read_env_files(settings.__config__.case_sensitive)\n if dotenv_vars:\n env_vars = {**dotenv_vars, **env_vars}\n\n for field in settings.__fields__.values():\n env_val: Optional[str] = None\n for env_name in field.field_info.extra['env_names']:\n env_val = env_vars.get(env_name)\n if env_val is not None:\n break\n\n is_complex, allow_parse_failure = self.field_is_complex(field)\n if is_complex:\n if env_val is None:\n # field is complex but no value found so far, try explode_env_vars\n env_val_built = self.explode_env_vars(field, env_vars)\n if env_val_built:\n d[field.alias] = env_val_built\n else:\n # field is complex and there's a value, decode that as JSON, then add explode_env_vars\n try:\n env_val = settings.__config__.parse_env_var(field.name, env_val)\n except ValueError as e:\n if not allow_parse_failure:\n raise SettingsError(f'error parsing env var \"{env_name}\"') from e\n\n if isinstance(env_val, dict):\n d[field.alias] = deep_update(env_val, self.explode_env_vars(field, env_vars))\n else:\n d[field.alias] = env_val\n elif env_val is not None:\n # simplest case, field is not complex, we only need to add the value if it was found\n d[field.alias] = env_val\n\n return d", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.explode_env_vars_EnvSettingsSource.__repr__.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.explode_env_vars_EnvSettingsSource.__repr__.return._", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 243, "end_line": 268, "span_ids": ["EnvSettingsSource.explode_env_vars", "EnvSettingsSource.__repr__"], "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 EnvSettingsSource:\n\n def explode_env_vars(self, field: ModelField, env_vars: Mapping[str, Optional[str]]) -> Dict[str, Any]:\n \"\"\"\n Process env_vars and extract the values of keys containing env_nested_delimiter into nested dictionaries.\n\n This is applied to a single field, hence filtering by env_var prefix.\n \"\"\"\n prefixes = [f'{env_name}{self.env_nested_delimiter}' for env_name in field.field_info.extra['env_names']]\n result: Dict[str, Any] = {}\n for env_name, env_val in env_vars.items():\n if not any(env_name.startswith(prefix) for prefix in prefixes):\n continue\n # we remove the prefix before splitting in case the prefix has characters in common with the delimiter\n env_name_without_prefix = env_name[self.env_prefix_len :]\n _, *keys, last_key = env_name_without_prefix.split(self.env_nested_delimiter)\n env_var = result\n for key in keys:\n env_var = env_var.setdefault(key, {})\n env_var[last_key] = env_val\n\n return result\n\n def __repr__(self) -> str:\n return (\n f'EnvSettingsSource(env_file={self.env_file!r}, env_file_encoding={self.env_file_encoding!r}, '\n f'env_nested_delimiter={self.env_nested_delimiter!r})'\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_SecretsSettingsSource_SecretsSettingsSource.__repr__.return.f_SecretsSettingsSource_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_SecretsSettingsSource_SecretsSettingsSource.__repr__.return.f_SecretsSettingsSource_s", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 319, "span_ids": ["SecretsSettingsSource", "SecretsSettingsSource.__init__", "SecretsSettingsSource.__repr__", "SecretsSettingsSource.__call__"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SecretsSettingsSource:\n __slots__ = ('secrets_dir',)\n\n def __init__(self, secrets_dir: Optional[StrPath]):\n self.secrets_dir: Optional[StrPath] = secrets_dir\n\n def __call__(self, settings: BaseSettings) -> Dict[str, Any]:\n \"\"\"\n Build fields from \"secrets\" files.\n \"\"\"\n secrets: Dict[str, Optional[str]] = {}\n\n if self.secrets_dir is None:\n return secrets\n\n secrets_path = Path(self.secrets_dir).expanduser()\n\n if not secrets_path.exists():\n warnings.warn(f'directory \"{secrets_path}\" does not exist')\n return secrets\n\n if not secrets_path.is_dir():\n raise SettingsError(f'secrets_dir must reference a directory, not a {path_type(secrets_path)}')\n\n for field in settings.__fields__.values():\n for env_name in field.field_info.extra['env_names']:\n path = find_case_path(secrets_path, env_name, settings.__config__.case_sensitive)\n if not path:\n # path does not exist, we currently don't return a warning for this\n continue\n\n if path.is_file():\n secret_value = path.read_text().strip()\n if field.is_complex():\n try:\n secret_value = settings.__config__.parse_env_var(field.name, secret_value)\n except ValueError as e:\n raise SettingsError(f'error parsing env var \"{env_name}\"') from e\n\n secrets[field.alias] = secret_value\n else:\n warnings.warn(\n f'attempted to load secret file \"{path}\" but found a {path_type(path)} instead.',\n stacklevel=4,\n )\n return secrets\n\n def __repr__(self) -> str:\n return f'SecretsSettingsSource(secrets_dir={self.secrets_dir!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/v1/env_settings.py_read_env_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_read_env_file_", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 322, "end_line": 347, "span_ids": ["find_case_path", "read_env_file"], "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 read_env_file(\n file_path: StrPath, *, encoding: str = None, case_sensitive: bool = False\n) -> Dict[str, Optional[str]]:\n try:\n from dotenv import dotenv_values\n except ImportError as e:\n raise ImportError('python-dotenv is not installed, run `pip install pydantic[dotenv]`') from e\n\n file_vars: Dict[str, Optional[str]] = dotenv_values(file_path, encoding=encoding or 'utf8')\n if not case_sensitive:\n return {k.lower(): v for k, v in file_vars.items()}\n else:\n return file_vars\n\n\ndef find_case_path(dir_path: Path, file_name: str, case_sensitive: bool) -> Optional[Path]:\n \"\"\"\n Find a file within path's directory matching filename, optionally ignoring case.\n \"\"\"\n for f in dir_path.iterdir():\n if f.name == file_name:\n return f\n elif not case_sensitive and f.name.lower() == file_name.lower():\n return f\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/v1/error_wrappers.py_json___all__._ErrorWrapper_Validati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_json___all__._ErrorWrapper_Validati", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["imports"], "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": "import json\nfrom typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Sequence, Tuple, Type, Union\n\nfrom .json import pydantic_encoder\nfrom .utils import Representation\n\nif TYPE_CHECKING:\n from typing_extensions import TypedDict\n\n from .config import BaseConfig\n from .types import ModelOrDc\n from .typing import ReprArgs\n\n Loc = Tuple[Union[int, str], ...]\n\n class _ErrorDictRequired(TypedDict):\n loc: Loc\n msg: str\n type: str\n\n class ErrorDict(_ErrorDictRequired, total=False):\n ctx: Dict[str, Any]\n\n\n__all__ = 'ErrorWrapper', 'ValidationError'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_ErrorWrapper_ErrorList.Union_Sequence_Any_Erro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_ErrorWrapper_ErrorList.Union_Sequence_Any_Erro", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 47, "span_ids": ["ErrorWrapper.loc_tuple", "ErrorWrapper", "ErrorWrapper.__init__", "impl:6", "ErrorWrapper.__repr_args__"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ErrorWrapper(Representation):\n __slots__ = 'exc', '_loc'\n\n def __init__(self, exc: Exception, loc: Union[str, 'Loc']) -> None:\n self.exc = exc\n self._loc = loc\n\n def loc_tuple(self) -> 'Loc':\n if isinstance(self._loc, tuple):\n return self._loc\n else:\n return (self._loc,)\n\n def __repr_args__(self) -> 'ReprArgs':\n return [('exc', self.exc), ('loc', self.loc_tuple())]\n\n\n# ErrorList is something like Union[List[Union[List[ErrorWrapper], ErrorWrapper]], ErrorWrapper]\n# but recursive, therefore just use:\nErrorList = Union[Sequence[Any], ErrorWrapper]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_ValidationError_ValidationError.__repr_args__.return._model_self_model___n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_ValidationError_ValidationError.__repr_args__.return._model_self_model___n", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 79, "span_ids": ["ValidationError.json", "ValidationError.__init__", "ValidationError.__str__", "ValidationError.errors", "ValidationError", "ValidationError.__repr_args__"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidationError(Representation, ValueError):\n __slots__ = 'raw_errors', 'model', '_error_cache'\n\n def __init__(self, errors: Sequence[ErrorList], model: 'ModelOrDc') -> None:\n self.raw_errors = errors\n self.model = model\n self._error_cache: Optional[List['ErrorDict']] = None\n\n def errors(self) -> List['ErrorDict']:\n if self._error_cache is None:\n try:\n config = self.model.__config__ # type: ignore\n except AttributeError:\n config = self.model.__pydantic_model__.__config__ # type: ignore\n self._error_cache = list(flatten_errors(self.raw_errors, config))\n return self._error_cache\n\n def json(self, *, indent: Union[None, int, str] = 2) -> str:\n return json.dumps(self.errors(), indent=indent, default=pydantic_encoder)\n\n def __str__(self) -> str:\n errors = self.errors()\n no_errors = len(errors)\n return (\n f'{no_errors} validation error{\"\" if no_errors == 1 else \"s\"} for {self.model.__name__}\\n'\n f'{display_errors(errors)}'\n )\n\n def __repr_args__(self) -> 'ReprArgs':\n return [('model', self.model.__name__), ('errors', self.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/pydantic/v1/error_wrappers.py_display_errors__display_error_type_and_ctx.if_ctx_.else_.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_display_errors__display_error_type_and_ctx.if_ctx_.else_.return.t", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 96, "span_ids": ["_display_error_loc", "display_errors", "_display_error_type_and_ctx"], "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 display_errors(errors: List['ErrorDict']) -> str:\n return '\\n'.join(f'{_display_error_loc(e)}\\n {e[\"msg\"]} ({_display_error_type_and_ctx(e)})' for e in errors)\n\n\ndef _display_error_loc(error: 'ErrorDict') -> str:\n return ' -> '.join(str(e) for e in error['loc'])\n\n\ndef _display_error_type_and_ctx(error: 'ErrorDict') -> str:\n t = 'type=' + error['type']\n ctx = error.get('ctx')\n if ctx:\n return t + ''.join(f'; {k}={v}' for k, v in ctx.items())\n else:\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_flatten_errors_flatten_errors.for_error_in_errors_.if_isinstance_error_Erro.else_.raise_RuntimeError_f_Unkn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_flatten_errors_flatten_errors.for_error_in_errors_.if_isinstance_error_Erro.else_.raise_RuntimeError_f_Unkn", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 116, "span_ids": ["flatten_errors"], "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 flatten_errors(\n errors: Sequence[Any], config: Type['BaseConfig'], loc: Optional['Loc'] = None\n) -> Generator['ErrorDict', None, None]:\n for error in errors:\n if isinstance(error, ErrorWrapper):\n if loc:\n error_loc = loc + error.loc_tuple()\n else:\n error_loc = error.loc_tuple()\n\n if isinstance(error.exc, ValidationError):\n yield from flatten_errors(error.exc.raw_errors, config, error_loc)\n else:\n yield error_dict(error.exc, config, error_loc)\n elif isinstance(error, list):\n yield from flatten_errors(error, config, loc=loc)\n else:\n raise RuntimeError(f'Unknown error object: {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/pydantic/v1/error_wrappers.py_error_dict_get_exc_type.try_.except_KeyError_.return.r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py_error_dict_get_exc_type.try_.except_KeyError_.return.r", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 147, "span_ids": ["impl:8", "get_exc_type", "error_dict"], "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 error_dict(exc: Exception, config: Type['BaseConfig'], loc: 'Loc') -> 'ErrorDict':\n type_ = get_exc_type(exc.__class__)\n msg_template = config.error_msg_templates.get(type_) or getattr(exc, 'msg_template', None)\n ctx = exc.__dict__\n if msg_template:\n msg = msg_template.format(**ctx)\n else:\n msg = str(exc)\n\n d: 'ErrorDict' = {'loc': loc, 'msg': msg, 'type': type_}\n\n if ctx:\n d['ctx'] = ctx\n\n return d\n\n\n_EXC_TYPE_CACHE: Dict[Type[Exception], str] = {}\n\n\ndef get_exc_type(cls: Type[Exception]) -> str:\n # slightly more efficient than using lru_cache since we don't need to worry about the cache filling up\n try:\n return _EXC_TYPE_CACHE[cls]\n except KeyError:\n r = _get_exc_type(cls)\n _EXC_TYPE_CACHE[cls] = r\n return 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/v1/error_wrappers.py__get_exc_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/error_wrappers.py__get_exc_type_", "embedding": null, "metadata": {"file_path": "pydantic/v1/error_wrappers.py", "file_name": "error_wrappers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 163, "span_ids": ["_get_exc_type"], "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 _get_exc_type(cls: Type[Exception]) -> str:\n if issubclass(cls, AssertionError):\n return 'assertion_error'\n\n base_name = 'type_error' if issubclass(cls, TypeError) else 'value_error'\n if cls in (TypeError, ValueError):\n # just TypeError or ValueError, no extra code\n return base_name\n\n # if it's not a TypeError or ValueError, we just take the lowercase of the exception name\n # no chaining or snake case logic, use \"code\" for more complex error types.\n code = getattr(cls, 'code', None) or cls.__name__.replace('Error', '').lower()\n return base_name + '.' + 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/v1/errors.py_from_decimal_import_Decim___all__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_from_decimal_import_Decim___all__._", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 105, "span_ids": ["imports"], "tokens": 655}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from decimal import Decimal\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union\n\nfrom .typing import display_as_type\n\nif TYPE_CHECKING:\n from .typing import DictStrAny\n\n# explicitly state exports to avoid \"from .errors import *\" also importing Decimal, Path etc.\n__all__ = (\n 'PydanticTypeError',\n 'PydanticValueError',\n 'ConfigError',\n 'MissingError',\n 'ExtraError',\n 'NoneIsNotAllowedError',\n 'NoneIsAllowedError',\n 'WrongConstantError',\n 'NotNoneError',\n 'BoolError',\n 'BytesError',\n 'DictError',\n 'EmailError',\n 'UrlError',\n 'UrlSchemeError',\n 'UrlSchemePermittedError',\n 'UrlUserInfoError',\n 'UrlHostError',\n 'UrlHostTldError',\n 'UrlPortError',\n 'UrlExtraError',\n 'EnumError',\n 'IntEnumError',\n 'EnumMemberError',\n 'IntegerError',\n 'FloatError',\n 'PathError',\n 'PathNotExistsError',\n 'PathNotAFileError',\n 'PathNotADirectoryError',\n 'PyObjectError',\n 'SequenceError',\n 'ListError',\n 'SetError',\n 'FrozenSetError',\n 'TupleError',\n 'TupleLengthError',\n 'ListMinLengthError',\n 'ListMaxLengthError',\n 'ListUniqueItemsError',\n 'SetMinLengthError',\n 'SetMaxLengthError',\n 'FrozenSetMinLengthError',\n 'FrozenSetMaxLengthError',\n 'AnyStrMinLengthError',\n 'AnyStrMaxLengthError',\n 'StrError',\n 'StrRegexError',\n 'NumberNotGtError',\n 'NumberNotGeError',\n 'NumberNotLtError',\n 'NumberNotLeError',\n 'NumberNotMultipleError',\n 'DecimalError',\n 'DecimalIsNotFiniteError',\n 'DecimalMaxDigitsError',\n 'DecimalMaxPlacesError',\n 'DecimalWholeDigitsError',\n 'DateTimeError',\n 'DateError',\n 'DateNotInThePastError',\n 'DateNotInTheFutureError',\n 'TimeError',\n 'DurationError',\n 'HashableError',\n 'UUIDError',\n 'UUIDVersionError',\n 'ArbitraryTypeError',\n 'ClassError',\n 'SubclassError',\n 'JsonError',\n 'JsonTypeError',\n 'PatternError',\n 'DataclassTypeError',\n 'CallableError',\n 'IPvAnyAddressError',\n 'IPvAnyInterfaceError',\n 'IPvAnyNetworkError',\n 'IPv4AddressError',\n 'IPv6AddressError',\n 'IPv4NetworkError',\n 'IPv6NetworkError',\n 'IPv4InterfaceError',\n 'IPv6InterfaceError',\n 'ColorError',\n 'StrictBoolError',\n 'NotDigitError',\n 'LuhnValidationError',\n 'InvalidLengthForBrand',\n 'InvalidByteSize',\n 'InvalidByteSizeUnit',\n 'MissingDiscriminator',\n 'InvalidDiscriminator',\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_cls_kwargs_cls_kwargs.return.cls_ctx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_cls_kwargs_cls_kwargs.return.cls_ctx_", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 116, "span_ids": ["cls_kwargs"], "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 cls_kwargs(cls: Type['PydanticErrorMixin'], ctx: 'DictStrAny') -> 'PydanticErrorMixin':\n \"\"\"\n For built-in exceptions like ValueError or TypeError, we need to implement\n __reduce__ to override the default behaviour (instead of __getstate__/__setstate__)\n By default pickle protocol 2 calls `cls.__new__(cls, *args)`.\n Since we only use kwargs, we need a little constructor to change that.\n Note: the callable can't be a lambda as pickle looks in the namespace to find it\n \"\"\"\n return cls(**ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_PydanticErrorMixin__PathValueError.__init__.super___init___path_str": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_PydanticErrorMixin__PathValueError.__init__.super___init___path_str", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 256, "span_ids": ["MissingError", "_PathValueError.__init__", "WrongConstantError", "EnumMemberError", "PydanticValueError", "BytesError", "EmailError", "UrlSchemeError", "PydanticTypeError", "DictError", "UrlError", "UrlSchemePermittedError.__init__", "UrlHostTldError", "PydanticErrorMixin.__str__", "PydanticErrorMixin.__reduce__", "WrongConstantError.__str__", "EnumMemberError.__str__", "NoneIsAllowedError", "UrlPortError", "BoolError", "UrlHostError", "NoneIsNotAllowedError", "_PathValueError", "PydanticErrorMixin", "IntegerError", "UrlSchemePermittedError", "ExtraError", "PydanticErrorMixin.__init__", "FloatError", "UrlUserInfoError", "PathError", "ConfigError", "NotNoneError", "UrlExtraError"], "tokens": 823}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticErrorMixin:\n code: str\n msg_template: str\n\n def __init__(self, **ctx: Any) -> None:\n self.__dict__ = ctx\n\n def __str__(self) -> str:\n return self.msg_template.format(**self.__dict__)\n\n def __reduce__(self) -> Tuple[Callable[..., 'PydanticErrorMixin'], Tuple[Type['PydanticErrorMixin'], 'DictStrAny']]:\n return cls_kwargs, (self.__class__, self.__dict__)\n\n\nclass PydanticTypeError(PydanticErrorMixin, TypeError):\n pass\n\n\nclass PydanticValueError(PydanticErrorMixin, ValueError):\n pass\n\n\nclass ConfigError(RuntimeError):\n pass\n\n\nclass MissingError(PydanticValueError):\n msg_template = 'field required'\n\n\nclass ExtraError(PydanticValueError):\n msg_template = 'extra fields not permitted'\n\n\nclass NoneIsNotAllowedError(PydanticTypeError):\n code = 'none.not_allowed'\n msg_template = 'none is not an allowed value'\n\n\nclass NoneIsAllowedError(PydanticTypeError):\n code = 'none.allowed'\n msg_template = 'value is not none'\n\n\nclass WrongConstantError(PydanticValueError):\n code = 'const'\n\n def __str__(self) -> str:\n permitted = ', '.join(repr(v) for v in self.permitted) # type: ignore\n return f'unexpected value; permitted: {permitted}'\n\n\nclass NotNoneError(PydanticTypeError):\n code = 'not_none'\n msg_template = 'value is not None'\n\n\nclass BoolError(PydanticTypeError):\n msg_template = 'value could not be parsed to a boolean'\n\n\nclass BytesError(PydanticTypeError):\n msg_template = 'byte type expected'\n\n\nclass DictError(PydanticTypeError):\n msg_template = 'value is not a valid dict'\n\n\nclass EmailError(PydanticValueError):\n msg_template = 'value is not a valid email address'\n\n\nclass UrlError(PydanticValueError):\n code = 'url'\n\n\nclass UrlSchemeError(UrlError):\n code = 'url.scheme'\n msg_template = 'invalid or missing URL scheme'\n\n\nclass UrlSchemePermittedError(UrlError):\n code = 'url.scheme'\n msg_template = 'URL scheme not permitted'\n\n def __init__(self, allowed_schemes: Set[str]):\n super().__init__(allowed_schemes=allowed_schemes)\n\n\nclass UrlUserInfoError(UrlError):\n code = 'url.userinfo'\n msg_template = 'userinfo required in URL but missing'\n\n\nclass UrlHostError(UrlError):\n code = 'url.host'\n msg_template = 'URL host invalid'\n\n\nclass UrlHostTldError(UrlError):\n code = 'url.host'\n msg_template = 'URL host invalid, top level domain required'\n\n\nclass UrlPortError(UrlError):\n code = 'url.port'\n msg_template = 'URL port invalid, port cannot exceed 65535'\n\n\nclass UrlExtraError(UrlError):\n code = 'url.extra'\n msg_template = 'URL invalid, extra characters found after valid URL: {extra!r}'\n\n\nclass EnumMemberError(PydanticTypeError):\n code = 'enum'\n\n def __str__(self) -> str:\n permitted = ', '.join(repr(v.value) for v in self.enum_values) # type: ignore\n return f'value is not a valid enumeration member; permitted: {permitted}'\n\n\nclass IntegerError(PydanticTypeError):\n msg_template = 'value is not a valid integer'\n\n\nclass FloatError(PydanticTypeError):\n msg_template = 'value is not a valid float'\n\n\nclass PathError(PydanticTypeError):\n msg_template = 'value is not a valid path'\n\n\nclass _PathValueError(PydanticValueError):\n def __init__(self, *, path: Path) -> None:\n super().__init__(path=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/pydantic/v1/errors.py_PathNotExistsError_FrozenSetMaxLengthError.__init__.super___init___limit_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_PathNotExistsError_FrozenSetMaxLengthError.__init__.super___init___limit_va", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 364, "span_ids": ["SetMinLengthError.__init__", "TupleLengthError", "DequeError", "FrozenSetMaxLengthError.__init__", "ListUniqueItemsError", "PathNotAFileError", "TupleLengthError.__init__", "IterableError", "SetError", "SetMinLengthError", "SetMaxLengthError.__init__", "FrozenSetMinLengthError", "ListMinLengthError", "ListMaxLengthError.__init__", "PathNotExistsError", "PathNotADirectoryError", "FrozenSetMaxLengthError", "SequenceError", "ListError", "SetMaxLengthError", "FrozenSetError", "ListMinLengthError.__init__", "FrozenSetMinLengthError.__init__", "ListMaxLengthError", "TupleError", "PyObjectError"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PathNotExistsError(_PathValueError):\n code = 'path.not_exists'\n msg_template = 'file or directory at path \"{path}\" does not exist'\n\n\nclass PathNotAFileError(_PathValueError):\n code = 'path.not_a_file'\n msg_template = 'path \"{path}\" does not point to a file'\n\n\nclass PathNotADirectoryError(_PathValueError):\n code = 'path.not_a_directory'\n msg_template = 'path \"{path}\" does not point to a directory'\n\n\nclass PyObjectError(PydanticTypeError):\n msg_template = 'ensure this value contains valid import path or valid callable: {error_message}'\n\n\nclass SequenceError(PydanticTypeError):\n msg_template = 'value is not a valid sequence'\n\n\nclass IterableError(PydanticTypeError):\n msg_template = 'value is not a valid iterable'\n\n\nclass ListError(PydanticTypeError):\n msg_template = 'value is not a valid list'\n\n\nclass SetError(PydanticTypeError):\n msg_template = 'value is not a valid set'\n\n\nclass FrozenSetError(PydanticTypeError):\n msg_template = 'value is not a valid frozenset'\n\n\nclass DequeError(PydanticTypeError):\n msg_template = 'value is not a valid deque'\n\n\nclass TupleError(PydanticTypeError):\n msg_template = 'value is not a valid tuple'\n\n\nclass TupleLengthError(PydanticValueError):\n code = 'tuple.length'\n msg_template = 'wrong tuple length {actual_length}, expected {expected_length}'\n\n def __init__(self, *, actual_length: int, expected_length: int) -> None:\n super().__init__(actual_length=actual_length, expected_length=expected_length)\n\n\nclass ListMinLengthError(PydanticValueError):\n code = 'list.min_items'\n msg_template = 'ensure this value has at least {limit_value} items'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass ListMaxLengthError(PydanticValueError):\n code = 'list.max_items'\n msg_template = 'ensure this value has at most {limit_value} items'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass ListUniqueItemsError(PydanticValueError):\n code = 'list.unique_items'\n msg_template = 'the list has duplicated items'\n\n\nclass SetMinLengthError(PydanticValueError):\n code = 'set.min_items'\n msg_template = 'ensure this value has at least {limit_value} items'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass SetMaxLengthError(PydanticValueError):\n code = 'set.max_items'\n msg_template = 'ensure this value has at most {limit_value} items'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass FrozenSetMinLengthError(PydanticValueError):\n code = 'frozenset.min_items'\n msg_template = 'ensure this value has at least {limit_value} items'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass FrozenSetMaxLengthError(PydanticValueError):\n code = 'frozenset.max_items'\n msg_template = 'ensure this value has at most {limit_value} items'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_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/v1/errors.py_AnyStrMinLengthError_DateError.msg_template._invalid_date_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_AnyStrMinLengthError_DateError.msg_template._invalid_date_format_", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 367, "end_line": 471, "span_ids": ["_NumberBoundError", "DecimalWholeDigitsError.__init__", "NumberNotLtError", "AnyStrMinLengthError", "DecimalMaxDigitsError.__init__", "NumberNotGtError", "NumberNotMultipleError.__init__", "NumberNotFiniteError", "StrRegexError.__init__", "AnyStrMaxLengthError", "NumberNotGeError", "AnyStrMaxLengthError.__init__", "DecimalMaxPlacesError.__init__", "DateError", "DecimalMaxPlacesError", "StrError", "NumberNotLeError", "NumberNotMultipleError", "StrRegexError", "DecimalMaxDigitsError", "DecimalWholeDigitsError", "AnyStrMinLengthError.__init__", "DecimalError", "_NumberBoundError.__init__", "DateTimeError", "DecimalIsNotFiniteError"], "tokens": 777}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyStrMinLengthError(PydanticValueError):\n code = 'any_str.min_length'\n msg_template = 'ensure this value has at least {limit_value} characters'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass AnyStrMaxLengthError(PydanticValueError):\n code = 'any_str.max_length'\n msg_template = 'ensure this value has at most {limit_value} characters'\n\n def __init__(self, *, limit_value: int) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass StrError(PydanticTypeError):\n msg_template = 'str type expected'\n\n\nclass StrRegexError(PydanticValueError):\n code = 'str.regex'\n msg_template = 'string does not match regex \"{pattern}\"'\n\n def __init__(self, *, pattern: str) -> None:\n super().__init__(pattern=pattern)\n\n\nclass _NumberBoundError(PydanticValueError):\n def __init__(self, *, limit_value: Union[int, float, Decimal]) -> None:\n super().__init__(limit_value=limit_value)\n\n\nclass NumberNotGtError(_NumberBoundError):\n code = 'number.not_gt'\n msg_template = 'ensure this value is greater than {limit_value}'\n\n\nclass NumberNotGeError(_NumberBoundError):\n code = 'number.not_ge'\n msg_template = 'ensure this value is greater than or equal to {limit_value}'\n\n\nclass NumberNotLtError(_NumberBoundError):\n code = 'number.not_lt'\n msg_template = 'ensure this value is less than {limit_value}'\n\n\nclass NumberNotLeError(_NumberBoundError):\n code = 'number.not_le'\n msg_template = 'ensure this value is less than or equal to {limit_value}'\n\n\nclass NumberNotFiniteError(PydanticValueError):\n code = 'number.not_finite_number'\n msg_template = 'ensure this value is a finite number'\n\n\nclass NumberNotMultipleError(PydanticValueError):\n code = 'number.not_multiple'\n msg_template = 'ensure this value is a multiple of {multiple_of}'\n\n def __init__(self, *, multiple_of: Union[int, float, Decimal]) -> None:\n super().__init__(multiple_of=multiple_of)\n\n\nclass DecimalError(PydanticTypeError):\n msg_template = 'value is not a valid decimal'\n\n\nclass DecimalIsNotFiniteError(PydanticValueError):\n code = 'decimal.not_finite'\n msg_template = 'value is not a valid decimal'\n\n\nclass DecimalMaxDigitsError(PydanticValueError):\n code = 'decimal.max_digits'\n msg_template = 'ensure that there are no more than {max_digits} digits in total'\n\n def __init__(self, *, max_digits: int) -> None:\n super().__init__(max_digits=max_digits)\n\n\nclass DecimalMaxPlacesError(PydanticValueError):\n code = 'decimal.max_places'\n msg_template = 'ensure that there are no more than {decimal_places} decimal places'\n\n def __init__(self, *, decimal_places: int) -> None:\n super().__init__(decimal_places=decimal_places)\n\n\nclass DecimalWholeDigitsError(PydanticValueError):\n code = 'decimal.whole_digits'\n msg_template = 'ensure that there are no more than {whole_digits} digits before the decimal point'\n\n def __init__(self, *, whole_digits: int) -> None:\n super().__init__(whole_digits=whole_digits)\n\n\nclass DateTimeError(PydanticValueError):\n msg_template = 'invalid datetime format'\n\n\nclass DateError(PydanticValueError):\n msg_template = 'invalid date format'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_DateNotInThePastError_ColorError.msg_template._value_is_not_a_valid_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_DateNotInThePastError_ColorError.msg_template._value_is_not_a_valid_col", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 599, "span_ids": ["DateNotInThePastError", "ColorError", "IPv4NetworkError", "IPv6AddressError", "IPv6InterfaceError", "IPv4InterfaceError", "IPv4AddressError", "SubclassError.__init__", "HashableError", "PatternError", "UUIDError", "IPvAnyInterfaceError", "SubclassError", "TimeError", "IntEnumError", "JsonError", "DateNotInTheFutureError", "CallableError", "IPvAnyAddressError", "JsonTypeError", "DurationError", "ArbitraryTypeError", "EnumError", "UUIDVersionError", "UUIDVersionError.__init__", "ClassError", "DataclassTypeError", "ArbitraryTypeError.__init__", "IPv6NetworkError", "IPvAnyNetworkError"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DateNotInThePastError(PydanticValueError):\n code = 'date.not_in_the_past'\n msg_template = 'date is not in the past'\n\n\nclass DateNotInTheFutureError(PydanticValueError):\n code = 'date.not_in_the_future'\n msg_template = 'date is not in the future'\n\n\nclass TimeError(PydanticValueError):\n msg_template = 'invalid time format'\n\n\nclass DurationError(PydanticValueError):\n msg_template = 'invalid duration format'\n\n\nclass HashableError(PydanticTypeError):\n msg_template = 'value is not a valid hashable'\n\n\nclass UUIDError(PydanticTypeError):\n msg_template = 'value is not a valid uuid'\n\n\nclass UUIDVersionError(PydanticValueError):\n code = 'uuid.version'\n msg_template = 'uuid version {required_version} expected'\n\n def __init__(self, *, required_version: int) -> None:\n super().__init__(required_version=required_version)\n\n\nclass ArbitraryTypeError(PydanticTypeError):\n code = 'arbitrary_type'\n msg_template = 'instance of {expected_arbitrary_type} expected'\n\n def __init__(self, *, expected_arbitrary_type: Type[Any]) -> None:\n super().__init__(expected_arbitrary_type=display_as_type(expected_arbitrary_type))\n\n\nclass ClassError(PydanticTypeError):\n code = 'class'\n msg_template = 'a class is expected'\n\n\nclass SubclassError(PydanticTypeError):\n code = 'subclass'\n msg_template = 'subclass of {expected_class} expected'\n\n def __init__(self, *, expected_class: Type[Any]) -> None:\n super().__init__(expected_class=display_as_type(expected_class))\n\n\nclass JsonError(PydanticValueError):\n msg_template = 'Invalid JSON'\n\n\nclass JsonTypeError(PydanticTypeError):\n code = 'json'\n msg_template = 'JSON object must be str, bytes or bytearray'\n\n\nclass PatternError(PydanticValueError):\n code = 'regex_pattern'\n msg_template = 'Invalid regular expression'\n\n\nclass DataclassTypeError(PydanticTypeError):\n code = 'dataclass'\n msg_template = 'instance of {class_name}, tuple or dict expected'\n\n\nclass CallableError(PydanticTypeError):\n msg_template = '{value} is not callable'\n\n\nclass EnumError(PydanticTypeError):\n code = 'enum_instance'\n msg_template = '{value} is not a valid Enum instance'\n\n\nclass IntEnumError(PydanticTypeError):\n code = 'int_enum_instance'\n msg_template = '{value} is not a valid IntEnum instance'\n\n\nclass IPvAnyAddressError(PydanticValueError):\n msg_template = 'value is not a valid IPv4 or IPv6 address'\n\n\nclass IPvAnyInterfaceError(PydanticValueError):\n msg_template = 'value is not a valid IPv4 or IPv6 interface'\n\n\nclass IPvAnyNetworkError(PydanticValueError):\n msg_template = 'value is not a valid IPv4 or IPv6 network'\n\n\nclass IPv4AddressError(PydanticValueError):\n msg_template = 'value is not a valid IPv4 address'\n\n\nclass IPv6AddressError(PydanticValueError):\n msg_template = 'value is not a valid IPv6 address'\n\n\nclass IPv4NetworkError(PydanticValueError):\n msg_template = 'value is not a valid IPv4 network'\n\n\nclass IPv6NetworkError(PydanticValueError):\n msg_template = 'value is not a valid IPv6 network'\n\n\nclass IPv4InterfaceError(PydanticValueError):\n msg_template = 'value is not a valid IPv4 interface'\n\n\nclass IPv6InterfaceError(PydanticValueError):\n msg_template = 'value is not a valid IPv6 interface'\n\n\nclass ColorError(PydanticValueError):\n msg_template = 'value is not a valid color: {reason}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_StrictBoolError_MissingDiscriminator.msg_template._Discriminator_discrimin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_StrictBoolError_MissingDiscriminator.msg_template._Discriminator_discrimin", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 602, "end_line": 631, "span_ids": ["InvalidByteSize", "NotDigitError", "InvalidByteSizeUnit", "StrictBoolError", "InvalidLengthForBrand", "LuhnValidationError", "MissingDiscriminator"], "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 StrictBoolError(PydanticValueError):\n msg_template = 'value is not a valid boolean'\n\n\nclass NotDigitError(PydanticValueError):\n code = 'payment_card_number.digits'\n msg_template = 'card number is not all digits'\n\n\nclass LuhnValidationError(PydanticValueError):\n code = 'payment_card_number.luhn_check'\n msg_template = 'card number is not luhn valid'\n\n\nclass InvalidLengthForBrand(PydanticValueError):\n code = 'payment_card_number.invalid_length_for_brand'\n msg_template = 'Length for a {brand} card must be {required_length}'\n\n\nclass InvalidByteSize(PydanticValueError):\n msg_template = 'could not parse value and unit from byte string'\n\n\nclass InvalidByteSizeUnit(PydanticValueError):\n msg_template = 'could not interpret byte unit: {unit}'\n\n\nclass MissingDiscriminator(PydanticValueError):\n code = 'discriminated_union.missing_discriminator'\n msg_template = 'Discriminator {discriminator_key!r} is missing in 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/v1/errors.py_InvalidDiscriminator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/errors.py_InvalidDiscriminator_", "embedding": null, "metadata": {"file_path": "pydantic/v1/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 634, "end_line": 647, "span_ids": ["InvalidDiscriminator.__init__", "InvalidDiscriminator"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class InvalidDiscriminator(PydanticValueError):\n code = 'discriminated_union.invalid_discriminator'\n msg_template = (\n 'No match for discriminator {discriminator_key!r} and value {discriminator_value!r} '\n '(allowed values: {allowed_values})'\n )\n\n def __init__(self, *, discriminator_key: str, discriminator_value: Any, allowed_values: Sequence[Any]) -> None:\n super().__init__(\n discriminator_key=discriminator_key,\n discriminator_value=discriminator_value,\n allowed_values=', '.join(map(repr, allowed_values)),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_copy_if_TYPE_CHECKING_.BoolUndefined.Union_bool_UndefinedType": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_copy_if_TYPE_CHECKING_.BoolUndefined.Union_bool_UndefinedType", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["UndefinedType.__reduce__", "imports", "UndefinedType", "UndefinedType.__copy__", "UndefinedType.__repr__", "UndefinedType.__deepcopy__", "impl:6"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import copy\nimport re\nfrom collections import Counter as CollectionCounter, defaultdict, deque\nfrom collections.abc import Callable, Hashable as CollectionsHashable, Iterable as CollectionsIterable\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Counter,\n DefaultDict,\n Deque,\n Dict,\n ForwardRef,\n FrozenSet,\n Generator,\n Iterable,\n Iterator,\n List,\n Mapping,\n Optional,\n Pattern,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\n\nfrom typing_extensions import Annotated, Final\n\nfrom . import errors as errors_\nfrom .class_validators import Validator, make_generic_validator, prep_validators\nfrom .error_wrappers import ErrorWrapper\nfrom .errors import ConfigError, InvalidDiscriminator, MissingDiscriminator, NoneIsNotAllowedError\nfrom .types import Json, JsonWrapper\nfrom .typing import (\n NoArgAnyCallable,\n convert_generics,\n display_as_type,\n get_args,\n get_origin,\n is_finalvar,\n is_literal_type,\n is_new_type,\n is_none_type,\n is_typeddict,\n is_typeddict_special,\n is_union,\n new_type_supertype,\n)\nfrom .utils import (\n PyObjectStr,\n Representation,\n ValueItems,\n get_discriminator_alias_and_values,\n get_unique_discriminator_alias,\n lenient_isinstance,\n lenient_issubclass,\n sequence_like,\n smart_deepcopy,\n)\nfrom .validators import constant_validator, dict_validator, find_validators, validate_json\n\nRequired: Any = Ellipsis\n\nT = TypeVar('T')\n\n\nclass UndefinedType:\n def __repr__(self) -> str:\n return 'PydanticUndefined'\n\n def __copy__(self: T) -> T:\n return self\n\n def __reduce__(self) -> str:\n return 'Undefined'\n\n def __deepcopy__(self: T, _: Any) -> T:\n return self\n\n\nUndefined = UndefinedType()\n\nif TYPE_CHECKING:\n from .class_validators import ValidatorsList\n from .config import BaseConfig\n from .error_wrappers import ErrorList\n from .types import ModelOrDc\n from .typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs\n\n ValidateReturn = Tuple[Optional[Any], Optional[ErrorList]]\n LocStr = Union[Tuple[Union[int, str], ...], str]\n BoolUndefined = Union[bool, 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/pydantic/v1/fields.py_FieldInfo_FieldInfo.get_constraints.return._attr_for_attr_default_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_FieldInfo_FieldInfo.get_constraints.return._attr_for_attr_default_i", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 195, "span_ids": ["FieldInfo.get_constraints", "FieldInfo", "FieldInfo.__init__", "FieldInfo.__repr_args__"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(Representation):\n \"\"\"\n Captures extra information about a field.\n \"\"\"\n\n __slots__ = (\n 'default',\n 'default_factory',\n 'alias',\n 'alias_priority',\n 'title',\n 'description',\n 'exclude',\n 'include',\n 'const',\n 'gt',\n 'ge',\n 'lt',\n 'le',\n 'multiple_of',\n 'allow_inf_nan',\n 'max_digits',\n 'decimal_places',\n 'min_items',\n 'max_items',\n 'unique_items',\n 'min_length',\n 'max_length',\n 'allow_mutation',\n 'repr',\n 'regex',\n 'discriminator',\n 'extra',\n )\n\n # field constraints with the default value, it's also used in update_from_config below\n __field_constraints__ = {\n 'min_length': None,\n 'max_length': None,\n 'regex': None,\n 'gt': None,\n 'lt': None,\n 'ge': None,\n 'le': None,\n 'multiple_of': None,\n 'allow_inf_nan': None,\n 'max_digits': None,\n 'decimal_places': None,\n 'min_items': None,\n 'max_items': None,\n 'unique_items': None,\n 'allow_mutation': True,\n }\n\n def __init__(self, default: Any = Undefined, **kwargs: Any) -> None:\n self.default = default\n self.default_factory = kwargs.pop('default_factory', None)\n self.alias = kwargs.pop('alias', None)\n self.alias_priority = kwargs.pop('alias_priority', 2 if self.alias is not None else None)\n self.title = kwargs.pop('title', None)\n self.description = kwargs.pop('description', None)\n self.exclude = kwargs.pop('exclude', None)\n self.include = kwargs.pop('include', None)\n self.const = kwargs.pop('const', None)\n self.gt = kwargs.pop('gt', None)\n self.ge = kwargs.pop('ge', None)\n self.lt = kwargs.pop('lt', None)\n self.le = kwargs.pop('le', None)\n self.multiple_of = kwargs.pop('multiple_of', None)\n self.allow_inf_nan = kwargs.pop('allow_inf_nan', None)\n self.max_digits = kwargs.pop('max_digits', None)\n self.decimal_places = kwargs.pop('decimal_places', None)\n self.min_items = kwargs.pop('min_items', None)\n self.max_items = kwargs.pop('max_items', None)\n self.unique_items = kwargs.pop('unique_items', None)\n self.min_length = kwargs.pop('min_length', None)\n self.max_length = kwargs.pop('max_length', None)\n self.allow_mutation = kwargs.pop('allow_mutation', True)\n self.regex = kwargs.pop('regex', None)\n self.discriminator = kwargs.pop('discriminator', None)\n self.repr = kwargs.pop('repr', True)\n self.extra = kwargs\n\n def __repr_args__(self) -> 'ReprArgs':\n field_defaults_to_hide: Dict[str, Any] = {\n 'repr': True,\n **self.__field_constraints__,\n }\n\n attrs = ((s, getattr(self, s)) for s in self.__slots__)\n return [(a, v) for a, v in attrs if v != field_defaults_to_hide.get(a, None)]\n\n def get_constraints(self) -> Set[str]:\n \"\"\"\n Gets the constraints set on the field by comparing the constraint value with its default value\n\n :return: the constraints set on field_info\n \"\"\"\n return {attr for attr, default in self.__field_constraints__.items() if getattr(self, attr) != 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/v1/fields.py_FieldInfo.update_from_config_FieldInfo._validate.if_self_default_is_not_Un.raise_ValueError_cannot_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_FieldInfo.update_from_config_FieldInfo._validate.if_self_default_is_not_Un.raise_ValueError_cannot_", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 219, "span_ids": ["FieldInfo.update_from_config", "FieldInfo._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 FieldInfo(Representation):\n\n def update_from_config(self, from_config: Dict[str, Any]) -> None:\n \"\"\"\n Update this FieldInfo based on a dict from get_field_info, only fields which have not been set are dated.\n \"\"\"\n for attr_name, value in from_config.items():\n try:\n current_value = getattr(self, attr_name)\n except AttributeError:\n # attr_name is not an attribute of FieldInfo, it should therefore be added to extra\n # (except if extra already has this value!)\n self.extra.setdefault(attr_name, value)\n else:\n if current_value is self.__field_constraints__.get(attr_name, None):\n setattr(self, attr_name, value)\n elif attr_name == 'exclude':\n self.exclude = ValueItems.merge(value, current_value)\n elif attr_name == 'include':\n self.include = ValueItems.merge(value, current_value, intersect=True)\n\n def _validate(self) -> None:\n if self.default is not Undefined and self.default_factory is not None:\n raise ValueError('cannot specify both default and default_factory')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_Field_Field._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_Field_Field._", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 301, "span_ids": ["Field"], "tokens": 1175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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: Optional[NoArgAnyCallable] = None,\n alias: Optional[str] = None,\n title: Optional[str] = None,\n description: Optional[str] = None,\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny', Any]] = None,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny', Any]] = None,\n const: Optional[bool] = None,\n gt: Optional[float] = None,\n ge: Optional[float] = None,\n lt: Optional[float] = None,\n le: Optional[float] = None,\n multiple_of: Optional[float] = None,\n allow_inf_nan: Optional[bool] = None,\n max_digits: Optional[int] = None,\n decimal_places: Optional[int] = None,\n min_items: Optional[int] = None,\n max_items: Optional[int] = None,\n unique_items: Optional[bool] = None,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n allow_mutation: bool = True,\n regex: Optional[str] = None,\n discriminator: Optional[str] = None,\n repr: bool = True,\n **extra: Any,\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\u2019s 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 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 const: this field is required and *must* take it's default value\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 unique_items: only applies to lists, requires the field not to have duplicated\n elements. The schema will have a ``uniqueItems`` 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 allow_mutation: 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 regex: 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 **extra: any additional keyword arguments will be added as is to the schema\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/v1/fields.py_Field.field_info_Field.return.field_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_Field.field_info_Field.return.field_info", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 331, "span_ids": ["Field"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def Field(\n default: Any = Undefined,\n *,\n default_factory: Optional[NoArgAnyCallable] = None,\n alias: Optional[str] = None,\n title: Optional[str] = None,\n description: Optional[str] = None,\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny', Any]] = None,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny', Any]] = None,\n const: Optional[bool] = None,\n gt: Optional[float] = None,\n ge: Optional[float] = None,\n lt: Optional[float] = None,\n le: Optional[float] = None,\n multiple_of: Optional[float] = None,\n allow_inf_nan: Optional[bool] = None,\n max_digits: Optional[int] = None,\n decimal_places: Optional[int] = None,\n min_items: Optional[int] = None,\n max_items: Optional[int] = None,\n unique_items: Optional[bool] = None,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n allow_mutation: bool = True,\n regex: Optional[str] = None,\n discriminator: Optional[str] = None,\n repr: bool = True,\n **extra: Any,\n) -> Any:\n field_info = FieldInfo(\n default,\n default_factory=default_factory,\n alias=alias,\n title=title,\n description=description,\n exclude=exclude,\n include=include,\n const=const,\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 unique_items=unique_items,\n min_length=min_length,\n max_length=max_length,\n allow_mutation=allow_mutation,\n regex=regex,\n discriminator=discriminator,\n repr=repr,\n **extra,\n )\n field_info._validate()\n return field_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/v1/fields.py__used_to_be_an_enum_but__MAPPING_LIKE_SHAPES._SHAPE_DEFAULTDICT_SHAPE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py__used_to_be_an_enum_but__MAPPING_LIKE_SHAPES._SHAPE_DEFAULTDICT_SHAPE", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 362, "span_ids": ["impl:20", "Field"], "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": "# used to be an enum but changed to int's for small performance improvement as less access overhead\nSHAPE_SINGLETON = 1\nSHAPE_LIST = 2\nSHAPE_SET = 3\nSHAPE_MAPPING = 4\nSHAPE_TUPLE = 5\nSHAPE_TUPLE_ELLIPSIS = 6\nSHAPE_SEQUENCE = 7\nSHAPE_FROZENSET = 8\nSHAPE_ITERABLE = 9\nSHAPE_GENERIC = 10\nSHAPE_DEQUE = 11\nSHAPE_DICT = 12\nSHAPE_DEFAULTDICT = 13\nSHAPE_COUNTER = 14\nSHAPE_NAME_LOOKUP = {\n SHAPE_LIST: 'List[{}]',\n SHAPE_SET: 'Set[{}]',\n SHAPE_TUPLE_ELLIPSIS: 'Tuple[{}, ...]',\n SHAPE_SEQUENCE: 'Sequence[{}]',\n SHAPE_FROZENSET: 'FrozenSet[{}]',\n SHAPE_ITERABLE: 'Iterable[{}]',\n SHAPE_DEQUE: 'Deque[{}]',\n SHAPE_DICT: 'Dict[{}]',\n SHAPE_DEFAULTDICT: 'DefaultDict[{}]',\n SHAPE_COUNTER: 'Counter[{}]',\n}\n\nMAPPING_LIKE_SHAPES: Set[int] = {SHAPE_DEFAULTDICT, SHAPE_DICT, SHAPE_MAPPING, SHAPE_COUNTER}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField_ModelField.get_default.return.smart_deepcopy_self_defau": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField_ModelField.get_default.return.smart_deepcopy_self_defau", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 364, "end_line": 437, "span_ids": ["ModelField.get_default", "ModelField", "ModelField.__init__"], "tokens": 587}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n __slots__ = (\n 'type_',\n 'outer_type_',\n 'annotation',\n 'sub_fields',\n 'sub_fields_mapping',\n 'key_field',\n 'validators',\n 'pre_validators',\n 'post_validators',\n 'default',\n 'default_factory',\n 'required',\n 'final',\n 'model_config',\n 'name',\n 'alias',\n 'has_alias',\n 'field_info',\n 'discriminator_key',\n 'discriminator_alias',\n 'validate_always',\n 'allow_none',\n 'shape',\n 'class_validators',\n 'parse_json',\n )\n\n def __init__(\n self,\n *,\n name: str,\n type_: Type[Any],\n class_validators: Optional[Dict[str, Validator]],\n model_config: Type['BaseConfig'],\n default: Any = None,\n default_factory: Optional[NoArgAnyCallable] = None,\n required: 'BoolUndefined' = Undefined,\n final: bool = False,\n alias: Optional[str] = None,\n field_info: Optional[FieldInfo] = None,\n ) -> None:\n self.name: str = name\n self.has_alias: bool = alias is not None\n self.alias: str = alias if alias is not None else name\n self.annotation = type_\n self.type_: Any = convert_generics(type_)\n self.outer_type_: Any = type_\n self.class_validators = class_validators or {}\n self.default: Any = default\n self.default_factory: Optional[NoArgAnyCallable] = default_factory\n self.required: 'BoolUndefined' = required\n self.final: bool = final\n self.model_config = model_config\n self.field_info: FieldInfo = field_info or FieldInfo(default)\n self.discriminator_key: Optional[str] = self.field_info.discriminator\n self.discriminator_alias: Optional[str] = self.discriminator_key\n\n self.allow_none: bool = False\n self.validate_always: bool = False\n self.sub_fields: Optional[List[ModelField]] = None\n self.sub_fields_mapping: Optional[Dict[str, 'ModelField']] = None # used for discriminated union\n self.key_field: Optional[ModelField] = None\n self.validators: 'ValidatorsList' = []\n self.pre_validators: Optional['ValidatorsList'] = None\n self.post_validators: Optional['ValidatorsList'] = None\n self.parse_json: bool = False\n self.shape: int = SHAPE_SINGLETON\n self.model_config.prepare_field(self)\n self.prepare()\n\n def get_default(self) -> Any:\n return smart_deepcopy(self.default) if self.default_factory is None else self.default_factory()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._get_field_info_ModelField._get_field_info.return.field_info_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._get_field_info_ModelField._get_field_info.return.field_info_value", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 441, "end_line": 483, "span_ids": ["ModelField._get_field_info"], "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 ModelField(Representation):\n\n @staticmethod\n def _get_field_info(\n field_name: str, annotation: Any, value: Any, config: Type['BaseConfig']\n ) -> Tuple[FieldInfo, Any]:\n \"\"\"\n Get a FieldInfo from a root typing.Annotated annotation, value, or config default.\n\n The FieldInfo may be set in typing.Annotated or the value, but not both. If neither contain\n a FieldInfo, a new one will be created using the config.\n\n :param field_name: name of the field for use in error messages\n :param annotation: a type hint such as `str` or `Annotated[str, Field(..., min_length=5)]`\n :param value: the field's assigned value\n :param config: the model's config object\n :return: the FieldInfo contained in the `annotation`, the value, or a new one from the config.\n \"\"\"\n field_info_from_config = config.get_field_info(field_name)\n\n field_info = None\n if get_origin(annotation) is Annotated:\n field_infos = [arg for arg in get_args(annotation)[1:] if isinstance(arg, FieldInfo)]\n if len(field_infos) > 1:\n raise ValueError(f'cannot specify multiple `Annotated` `Field`s for {field_name!r}')\n field_info = next(iter(field_infos), None)\n if field_info is not None:\n field_info = copy.copy(field_info)\n field_info.update_from_config(field_info_from_config)\n if field_info.default not in (Undefined, Required):\n raise ValueError(f'`Field` default cannot be set in `Annotated` for {field_name!r}')\n if value is not Undefined and value is not Required:\n # check also `Required` because of `validate_arguments` that sets `...` as default value\n field_info.default = value\n\n if isinstance(value, FieldInfo):\n if field_info is not None:\n raise ValueError(f'cannot specify `Annotated` and value `Field`s together for {field_name!r}')\n field_info = value\n field_info.update_from_config(field_info_from_config)\n elif field_info is None:\n field_info = FieldInfo(value, **field_info_from_config)\n value = None if field_info.default_factory is not None else field_info.default\n field_info._validate()\n return field_info, 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/v1/fields.py_ModelField.infer_ModelField.infer.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.infer_ModelField.infer.return.cls_", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 516, "span_ids": ["ModelField.infer"], "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 ModelField(Representation):\n\n @classmethod\n def infer(\n cls,\n *,\n name: str,\n value: Any,\n annotation: Any,\n class_validators: Optional[Dict[str, Validator]],\n config: Type['BaseConfig'],\n ) -> 'ModelField':\n from .schema import get_annotation_from_field_info\n\n field_info, value = cls._get_field_info(name, annotation, value, config)\n required: 'BoolUndefined' = Undefined\n if value is Required:\n required = True\n value = None\n elif value is not Undefined:\n required = False\n annotation = get_annotation_from_field_info(annotation, field_info, name, config.validate_assignment)\n\n return cls(\n name=name,\n type_=annotation,\n alias=field_info.alias,\n class_validators=class_validators,\n default=value,\n default_factory=field_info.default_factory,\n required=required,\n model_config=config,\n field_info=field_info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.set_config_ModelField.set_config.if_new_include_is_not_Non.self.field_info.include.ValueItems_merge_self_fie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.set_config_ModelField.set_config.if_new_include_is_not_Non.self.field_info.include.ValueItems_merge_self_fie", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 533, "span_ids": ["ModelField.set_config"], "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 ModelField(Representation):\n\n def set_config(self, config: Type['BaseConfig']) -> None:\n self.model_config = config\n info_from_config = config.get_field_info(self.name)\n config.prepare_field(self)\n new_alias = info_from_config.get('alias')\n new_alias_priority = info_from_config.get('alias_priority') or 0\n if new_alias and new_alias_priority >= (self.field_info.alias_priority or 0):\n self.field_info.alias = new_alias\n self.field_info.alias_priority = new_alias_priority\n self.alias = new_alias\n new_exclude = info_from_config.get('exclude')\n if new_exclude is not None:\n self.field_info.exclude = ValueItems.merge(self.field_info.exclude, new_exclude)\n new_include = info_from_config.get('include')\n if new_include is not None:\n self.field_info.include = ValueItems.merge(self.field_info.include, new_include, intersect=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/v1/fields.py_ModelField.alt_alias_ModelField.prepare.self_populate_validators_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.alt_alias_ModelField.prepare.self_populate_validators_", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 535, "end_line": 557, "span_ids": ["ModelField.alt_alias", "ModelField.prepare"], "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 ModelField(Representation):\n\n @property\n def alt_alias(self) -> bool:\n return self.name != self.alias\n\n def prepare(self) -> None:\n \"\"\"\n Prepare the field but inspecting self.default, self.type_ etc.\n\n Note: this method is **not** idempotent (because _type_analysis is not idempotent),\n e.g. calling it it multiple times may modify the field and configure it incorrectly.\n \"\"\"\n self._set_default_and_type()\n if self.type_.__class__ is ForwardRef or self.type_.__class__ is DeferredType:\n # self.type_ is currently a ForwardRef and there's nothing we can do now,\n # user will need to call model.update_forward_refs()\n return\n\n self._type_analysis()\n if self.required is Undefined:\n self.required = True\n if self.default is Undefined and self.default_factory is None:\n self.default = None\n self.populate_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/pydantic/v1/fields.py_ModelField._set_default_and_type_ModelField._set_default_and_type.if_self_required_is_False.self.allow_none.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._set_default_and_type_ModelField._set_default_and_type.if_self_required_is_False.self.allow_none.True", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 559, "end_line": 581, "span_ids": ["ModelField._set_default_and_type"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _set_default_and_type(self) -> None:\n \"\"\"\n Set the default value, infer the type if needed and check if `None` value is valid.\n \"\"\"\n if self.default_factory is not None:\n if self.type_ is Undefined:\n raise errors_.ConfigError(\n f'you need to set the type of field {self.name!r} when using `default_factory`'\n )\n return\n\n default_value = self.get_default()\n\n if default_value is not None and self.type_ is Undefined:\n self.type_ = default_value.__class__\n self.outer_type_ = self.type_\n self.annotation = self.type_\n\n if self.type_ is Undefined:\n raise errors_.ConfigError(f'unable to infer type for attribute \"{self.name}\"')\n\n if self.required is False and default_value is None:\n self.allow_none = 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/v1/fields.py_ModelField._type_analysis_ModelField._type_analysis._add_extra_check_for_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_analysis_ModelField._type_analysis._add_extra_check_for_co", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 583, "end_line": 635, "span_ids": ["ModelField._type_analysis"], "tokens": 453}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _type_analysis(self) -> None: # noqa: C901 (ignore complexity)\n # typing interface is horrible, we have to do some ugly checks\n if lenient_issubclass(self.type_, JsonWrapper):\n self.type_ = self.type_.inner_type\n self.parse_json = True\n elif lenient_issubclass(self.type_, Json):\n self.type_ = Any\n self.parse_json = True\n elif isinstance(self.type_, TypeVar):\n if self.type_.__bound__:\n self.type_ = self.type_.__bound__\n elif self.type_.__constraints__:\n self.type_ = Union[self.type_.__constraints__]\n else:\n self.type_ = Any\n elif is_new_type(self.type_):\n self.type_ = new_type_supertype(self.type_)\n\n if self.type_ is Any or self.type_ is object:\n if self.required is Undefined:\n self.required = False\n self.allow_none = True\n return\n elif self.type_ is Pattern or self.type_ is re.Pattern:\n # python 3.7 only, Pattern is a typing object but without sub fields\n return\n elif is_literal_type(self.type_):\n return\n elif is_typeddict(self.type_):\n return\n\n if is_finalvar(self.type_):\n self.final = True\n\n if self.type_ is Final:\n self.type_ = Any\n else:\n self.type_ = get_args(self.type_)[0]\n\n self._type_analysis()\n return\n\n origin = get_origin(self.type_)\n\n if origin is Annotated or is_typeddict_special(origin):\n self.type_ = get_args(self.type_)[0]\n self._type_analysis()\n return\n\n if self.discriminator_key is not None and not is_union(origin):\n raise TypeError('`discriminator` can only be used with `Union` type with more than one variant')\n\n # add extra check for `collections.abc.Hashable` for python 3.10+ where origin is not `None`\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_analysis.if_origin_is_None_or_orig_ModelField._type_analysis.self.sub_fields._self__create_sub_type_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_analysis.if_origin_is_None_or_orig_ModelField._type_analysis.self.sub_fields._self__create_sub_type_se", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 636, "end_line": 758, "span_ids": ["ModelField._type_analysis"], "tokens": 1370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _type_analysis(self) -> None:\n # ... other code\n if origin is None or origin is CollectionsHashable:\n # field is not \"typing\" object eg. Union, Dict, List etc.\n # allow None for virtual superclasses of NoneType, e.g. Hashable\n if isinstance(self.type_, type) and isinstance(None, self.type_):\n self.allow_none = True\n return\n elif origin is Callable:\n return\n elif is_union(origin):\n types_ = []\n for type_ in get_args(self.type_):\n if is_none_type(type_) or type_ is Any or type_ is object:\n if self.required is Undefined:\n self.required = False\n self.allow_none = True\n if is_none_type(type_):\n continue\n types_.append(type_)\n\n if len(types_) == 1:\n # Optional[]\n self.type_ = types_[0]\n # this is the one case where the \"outer type\" isn't just the original type\n self.outer_type_ = self.type_\n # re-run to correctly interpret the new self.type_\n self._type_analysis()\n else:\n self.sub_fields = [self._create_sub_type(t, f'{self.name}_{display_as_type(t)}') for t in types_]\n\n if self.discriminator_key is not None:\n self.prepare_discriminated_union_sub_fields()\n return\n elif issubclass(origin, Tuple): # type: ignore\n # origin == Tuple without item type\n args = get_args(self.type_)\n if not args: # plain tuple\n self.type_ = Any\n self.shape = SHAPE_TUPLE_ELLIPSIS\n elif len(args) == 2 and args[1] is Ellipsis: # e.g. Tuple[int, ...]\n self.type_ = args[0]\n self.shape = SHAPE_TUPLE_ELLIPSIS\n self.sub_fields = [self._create_sub_type(args[0], f'{self.name}_0')]\n elif args == ((),): # Tuple[()] means empty tuple\n self.shape = SHAPE_TUPLE\n self.type_ = Any\n self.sub_fields = []\n else:\n self.shape = SHAPE_TUPLE\n self.sub_fields = [self._create_sub_type(t, f'{self.name}_{i}') for i, t in enumerate(args)]\n return\n elif issubclass(origin, List):\n # Create self validators\n get_validators = getattr(self.type_, '__get_validators__', None)\n if get_validators:\n self.class_validators.update(\n {f'list_{i}': Validator(validator, pre=True) for i, validator in enumerate(get_validators())}\n )\n\n self.type_ = get_args(self.type_)[0]\n self.shape = SHAPE_LIST\n elif issubclass(origin, Set):\n # Create self validators\n get_validators = getattr(self.type_, '__get_validators__', None)\n if get_validators:\n self.class_validators.update(\n {f'set_{i}': Validator(validator, pre=True) for i, validator in enumerate(get_validators())}\n )\n\n self.type_ = get_args(self.type_)[0]\n self.shape = SHAPE_SET\n elif issubclass(origin, FrozenSet):\n # Create self validators\n get_validators = getattr(self.type_, '__get_validators__', None)\n if get_validators:\n self.class_validators.update(\n {f'frozenset_{i}': Validator(validator, pre=True) for i, validator in enumerate(get_validators())}\n )\n\n self.type_ = get_args(self.type_)[0]\n self.shape = SHAPE_FROZENSET\n elif issubclass(origin, Deque):\n self.type_ = get_args(self.type_)[0]\n self.shape = SHAPE_DEQUE\n elif issubclass(origin, Sequence):\n self.type_ = get_args(self.type_)[0]\n self.shape = SHAPE_SEQUENCE\n # priority to most common mapping: dict\n elif origin is dict or origin is Dict:\n self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True)\n self.type_ = get_args(self.type_)[1]\n self.shape = SHAPE_DICT\n elif issubclass(origin, DefaultDict):\n self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True)\n self.type_ = get_args(self.type_)[1]\n self.shape = SHAPE_DEFAULTDICT\n elif issubclass(origin, Counter):\n self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True)\n self.type_ = int\n self.shape = SHAPE_COUNTER\n elif issubclass(origin, Mapping):\n self.key_field = self._create_sub_type(get_args(self.type_)[0], 'key_' + self.name, for_keys=True)\n self.type_ = get_args(self.type_)[1]\n self.shape = SHAPE_MAPPING\n # Equality check as almost everything inherits form Iterable, including str\n # check for Iterable and CollectionsIterable, as it could receive one even when declared with the other\n elif origin in {Iterable, CollectionsIterable}:\n self.type_ = get_args(self.type_)[0]\n self.shape = SHAPE_ITERABLE\n self.sub_fields = [self._create_sub_type(self.type_, f'{self.name}_type')]\n elif issubclass(origin, Type): # type: ignore\n return\n elif hasattr(origin, '__get_validators__') or self.model_config.arbitrary_types_allowed:\n # Is a Pydantic-compatible generic that handles itself\n # or we have arbitrary_types_allowed = True\n self.shape = SHAPE_GENERIC\n self.sub_fields = [self._create_sub_type(t, f'{self.name}_{i}') for i, t in enumerate(get_args(self.type_))]\n self.type_ = origin\n return\n else:\n raise TypeError(f'Fields of type \"{origin}\" are not supported.')\n\n # type_ has been refined eg. as the type of a List and sub_fields needs to be populated\n self.sub_fields = [self._create_sub_type(self.type_, '_' + self.name)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.prepare_discriminated_union_sub_fields_ModelField.prepare_discriminated_union_sub_fields.self.discriminator_alias.get_unique_discriminator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.prepare_discriminated_union_sub_fields_ModelField.prepare_discriminated_union_sub_fields.self.discriminator_alias.get_unique_discriminator_", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 760, "end_line": 786, "span_ids": ["ModelField.prepare_discriminated_union_sub_fields"], "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 ModelField(Representation):\n\n def prepare_discriminated_union_sub_fields(self) -> None:\n \"\"\"\n Prepare the mapping -> and update `sub_fields`\n Note that this process can be aborted if a `ForwardRef` is encountered\n \"\"\"\n assert self.discriminator_key is not None\n\n if self.type_.__class__ is DeferredType:\n return\n\n assert self.sub_fields is not None\n sub_fields_mapping: Dict[str, 'ModelField'] = {}\n all_aliases: Set[str] = set()\n\n for sub_field in self.sub_fields:\n t = sub_field.type_\n if t.__class__ is ForwardRef:\n # Stopping everything...will need to call `update_forward_refs`\n return\n\n alias, discriminator_values = get_discriminator_alias_and_values(t, self.discriminator_key)\n all_aliases.add(alias)\n for discriminator_value in discriminator_values:\n sub_fields_mapping[discriminator_value] = sub_field\n\n self.sub_fields_mapping = sub_fields_mapping\n self.discriminator_alias = get_unique_discriminator_alias(all_aliases, self.discriminator_key)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._create_sub_type_ModelField._create_sub_type.return.self___class___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._create_sub_type_ModelField._create_sub_type.return.self___class___", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 788, "end_line": 814, "span_ids": ["ModelField._create_sub_type"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _create_sub_type(self, type_: Type[Any], name: str, *, for_keys: bool = False) -> 'ModelField':\n if for_keys:\n class_validators = None\n else:\n # validators for sub items should not have `each_item` as we want to check only the first sublevel\n class_validators = {\n k: Validator(\n func=v.func,\n pre=v.pre,\n each_item=False,\n always=v.always,\n check_fields=v.check_fields,\n skip_on_failure=v.skip_on_failure,\n )\n for k, v in self.class_validators.items()\n if v.each_item\n }\n\n field_info, _ = self._get_field_info(name, type_, None, self.model_config)\n\n return self.__class__(\n type_=type_,\n name=name,\n class_validators=class_validators,\n model_config=self.model_config,\n field_info=field_info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.populate_validators_ModelField.populate_validators.self.post_validators_5.self_post_validators_or_N": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.populate_validators_ModelField.populate_validators.self.post_validators_5.self_post_validators_or_N", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 814, "end_line": 848, "span_ids": ["ModelField.populate_validators"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def populate_validators(self) -> None:\n \"\"\"\n Prepare self.pre_validators, self.validators, and self.post_validators based on self.type_'s __get_validators__\n and class validators. This method should be idempotent, e.g. it should be safe to call multiple times\n without mis-configuring the field.\n \"\"\"\n self.validate_always = getattr(self.type_, 'validate_always', False) or any(\n v.always for v in self.class_validators.values()\n )\n\n class_validators_ = self.class_validators.values()\n if not self.sub_fields or self.shape == SHAPE_GENERIC:\n get_validators = getattr(self.type_, '__get_validators__', None)\n v_funcs = (\n *[v.func for v in class_validators_ if v.each_item and v.pre],\n *(get_validators() if get_validators else list(find_validators(self.type_, self.model_config))),\n *[v.func for v in class_validators_ if v.each_item and not v.pre],\n )\n self.validators = prep_validators(v_funcs)\n\n self.pre_validators = []\n self.post_validators = []\n\n if self.field_info and self.field_info.const:\n self.post_validators.append(make_generic_validator(constant_validator))\n\n if class_validators_:\n self.pre_validators += prep_validators(v.func for v in class_validators_ if not v.each_item and v.pre)\n self.post_validators += prep_validators(v.func for v in class_validators_ if not v.each_item and not v.pre)\n\n if self.parse_json:\n self.pre_validators.append(make_generic_validator(validate_json))\n\n self.pre_validators = self.pre_validators or None\n self.post_validators = self.post_validators or 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/v1/fields.py_ModelField.validate_ModelField.validate.return.v_errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField.validate_ModelField.validate.return.v_errors", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 850, "end_line": 896, "span_ids": ["ModelField.validate"], "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 ModelField(Representation):\n\n def validate(\n self, v: Any, values: Dict[str, Any], *, loc: 'LocStr', cls: Optional['ModelOrDc'] = None\n ) -> 'ValidateReturn':\n assert self.type_.__class__ is not DeferredType\n\n if self.type_.__class__ is ForwardRef:\n assert cls is not None\n raise ConfigError(\n f'field \"{self.name}\" not yet prepared so type is still a ForwardRef, '\n f'you might need to call {cls.__name__}.update_forward_refs().'\n )\n\n errors: Optional['ErrorList']\n if self.pre_validators:\n v, errors = self._apply_validators(v, values, loc, cls, self.pre_validators)\n if errors:\n return v, errors\n\n if v is None:\n if is_none_type(self.type_):\n # keep validating\n pass\n elif self.allow_none:\n if self.post_validators:\n return self._apply_validators(v, values, loc, cls, self.post_validators)\n else:\n return None, None\n else:\n return v, ErrorWrapper(NoneIsNotAllowedError(), loc)\n\n if self.shape == SHAPE_SINGLETON:\n v, errors = self._validate_singleton(v, values, loc, cls)\n elif self.shape in MAPPING_LIKE_SHAPES:\n v, errors = self._validate_mapping_like(v, values, loc, cls)\n elif self.shape == SHAPE_TUPLE:\n v, errors = self._validate_tuple(v, values, loc, cls)\n elif self.shape == SHAPE_ITERABLE:\n v, errors = self._validate_iterable(v, values, loc, cls)\n elif self.shape == SHAPE_GENERIC:\n v, errors = self._apply_validators(v, values, loc, cls, self.validators)\n else:\n # sequence, list, set, generator, tuple with ellipsis, frozen set\n v, errors = self._validate_sequence_like(v, values, loc, cls)\n\n if not errors and self.post_validators:\n v, errors = self._apply_validators(v, values, loc, cls, self.post_validators)\n return v, 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/pydantic/v1/fields.py_ModelField._validate_sequence_like_ModelField._validate_sequence_like.return.converted_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_sequence_like_ModelField._validate_sequence_like.return.converted_None", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 901, "end_line": 956, "span_ids": ["ModelField._validate_sequence_like"], "tokens": 509}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _validate_sequence_like( # noqa: C901 (ignore complexity)\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc']\n ) -> 'ValidateReturn':\n \"\"\"\n Validate sequence-like containers: lists, tuples, sets and generators\n Note that large if-else blocks are necessary to enable Cython\n optimization, which is why we disable the complexity check above.\n \"\"\"\n if not sequence_like(v):\n e: errors_.PydanticTypeError\n if self.shape == SHAPE_LIST:\n e = errors_.ListError()\n elif self.shape in (SHAPE_TUPLE, SHAPE_TUPLE_ELLIPSIS):\n e = errors_.TupleError()\n elif self.shape == SHAPE_SET:\n e = errors_.SetError()\n elif self.shape == SHAPE_FROZENSET:\n e = errors_.FrozenSetError()\n else:\n e = errors_.SequenceError()\n return v, ErrorWrapper(e, loc)\n\n loc = loc if isinstance(loc, tuple) else (loc,)\n result = []\n errors: List[ErrorList] = []\n for i, v_ in enumerate(v):\n v_loc = *loc, i\n r, ee = self._validate_singleton(v_, values, v_loc, cls)\n if ee:\n errors.append(ee)\n else:\n result.append(r)\n\n if errors:\n return v, errors\n\n converted: Union[List[Any], Set[Any], FrozenSet[Any], Tuple[Any, ...], Iterator[Any], Deque[Any]] = result\n\n if self.shape == SHAPE_SET:\n converted = set(result)\n elif self.shape == SHAPE_FROZENSET:\n converted = frozenset(result)\n elif self.shape == SHAPE_TUPLE_ELLIPSIS:\n converted = tuple(result)\n elif self.shape == SHAPE_DEQUE:\n converted = deque(result, maxlen=getattr(v, 'maxlen', None))\n elif self.shape == SHAPE_SEQUENCE:\n if isinstance(v, tuple):\n converted = tuple(result)\n elif isinstance(v, set):\n converted = set(result)\n elif isinstance(v, Generator):\n converted = iter(result)\n elif isinstance(v, deque):\n converted = deque(result, maxlen=getattr(v, 'maxlen', None))\n return converted, 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/v1/fields.py_ModelField._validate_iterable_ModelField._validate_tuple.if_errors_.else_.return.tuple_result_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_iterable_ModelField._validate_tuple.if_errors_.else_.return.tuple_result_None", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 958, "end_line": 1001, "span_ids": ["ModelField._validate_tuple", "ModelField._validate_iterable"], "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 ModelField(Representation):\n\n def _validate_iterable(\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc']\n ) -> 'ValidateReturn':\n \"\"\"\n Validate Iterables.\n\n This intentionally doesn't validate values to allow infinite generators.\n \"\"\"\n\n try:\n iterable = iter(v)\n except TypeError:\n return v, ErrorWrapper(errors_.IterableError(), loc)\n return iterable, None\n\n def _validate_tuple(\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc']\n ) -> 'ValidateReturn':\n e: Optional[Exception] = None\n if not sequence_like(v):\n e = errors_.TupleError()\n else:\n actual_length, expected_length = len(v), len(self.sub_fields) # type: ignore\n if actual_length != expected_length:\n e = errors_.TupleLengthError(actual_length=actual_length, expected_length=expected_length)\n\n if e:\n return v, ErrorWrapper(e, loc)\n\n loc = loc if isinstance(loc, tuple) else (loc,)\n result = []\n errors: List[ErrorList] = []\n for i, (v_, field) in enumerate(zip(v, self.sub_fields)): # type: ignore\n v_loc = *loc, i\n r, ee = field.validate(v_, values, loc=v_loc, cls=cls)\n if ee:\n errors.append(ee)\n else:\n result.append(r)\n\n if errors:\n return v, errors\n else:\n return tuple(result), 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/v1/fields.py_ModelField._validate_mapping_like_ModelField._validate_mapping_like.if_errors_.else_.return.self__get_mapping_value_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_mapping_like_ModelField._validate_mapping_like.if_errors_.else_.return.self__get_mapping_value_v", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1003, "end_line": 1036, "span_ids": ["ModelField._validate_mapping_like"], "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 ModelField(Representation):\n\n def _validate_mapping_like(\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc']\n ) -> 'ValidateReturn':\n try:\n v_iter = dict_validator(v)\n except TypeError as exc:\n return v, ErrorWrapper(exc, loc)\n\n loc = loc if isinstance(loc, tuple) else (loc,)\n result, errors = {}, []\n for k, v_ in v_iter.items():\n v_loc = *loc, '__key__'\n key_result, key_errors = self.key_field.validate(k, values, loc=v_loc, cls=cls) # type: ignore\n if key_errors:\n errors.append(key_errors)\n continue\n\n v_loc = *loc, k\n value_result, value_errors = self._validate_singleton(v_, values, v_loc, cls)\n if value_errors:\n errors.append(value_errors)\n continue\n\n result[key_result] = value_result\n if errors:\n return v, errors\n elif self.shape == SHAPE_DICT:\n return result, None\n elif self.shape == SHAPE_DEFAULTDICT:\n return defaultdict(self.type_, result), None\n elif self.shape == SHAPE_COUNTER:\n return CollectionCounter(result), None\n else:\n return self._get_mapping_value(v, result), 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/v1/fields.py_ModelField._get_mapping_value_ModelField._get_mapping_value.if_original_cls_dict_o.else_.try_.except_TypeError_.raise_RuntimeError_f_Coul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._get_mapping_value_ModelField._get_mapping_value.if_original_cls_dict_o.else_.try_.except_TypeError_.raise_RuntimeError_f_Coul", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1038, "end_line": 1054, "span_ids": ["ModelField._get_mapping_value"], "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 ModelField(Representation):\n\n def _get_mapping_value(self, original: T, converted: Dict[Any, Any]) -> Union[T, Dict[Any, Any]]:\n \"\"\"\n When type is `Mapping[KT, KV]` (or another unsupported mapping), we try to avoid\n coercing to `dict` unwillingly.\n \"\"\"\n original_cls = original.__class__\n\n if original_cls == dict or original_cls == Dict:\n return converted\n elif original_cls in {defaultdict, DefaultDict}:\n return defaultdict(self.type_, converted)\n else:\n try:\n # Counter, OrderedDict, UserDict, ...\n return original_cls(converted) # type: ignore\n except TypeError:\n raise RuntimeError(f'Could not convert dictionary to {original_cls.__name__!r}') from 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/v1/fields.py_ModelField._validate_singleton_ModelField._validate_singleton.if_self_sub_fields_.else_.return.self__apply_validators_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_singleton_ModelField._validate_singleton.if_self_sub_fields_.else_.return.self__apply_validators_v_", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1056, "end_line": 1101, "span_ids": ["ModelField._validate_singleton"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _validate_singleton(\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc']\n ) -> 'ValidateReturn':\n if self.sub_fields:\n if self.discriminator_key is not None:\n return self._validate_discriminated_union(v, values, loc, cls)\n\n errors = []\n\n if self.model_config.smart_union and is_union(get_origin(self.type_)):\n # 1st pass: check if the value is an exact instance of one of the Union types\n # (e.g. to avoid coercing a bool into an int)\n for field in self.sub_fields:\n if v.__class__ is field.outer_type_:\n return v, None\n\n # 2nd pass: check if the value is an instance of any subclass of the Union types\n for field in self.sub_fields:\n # This whole logic will be improved later on to support more complex `isinstance` checks\n # It will probably be done once a strict mode is added and be something like:\n # ```\n # value, error = field.validate(v, values, strict=True)\n # if error is None:\n # return value, None\n # ```\n try:\n if isinstance(v, field.outer_type_):\n return v, None\n except TypeError:\n # compound type\n if lenient_isinstance(v, get_origin(field.outer_type_)):\n value, error = field.validate(v, values, loc=loc, cls=cls)\n if not error:\n return value, None\n\n # 1st pass by default or 3rd pass with `smart_union` enabled:\n # check if the value can be coerced into one of the Union types\n for field in self.sub_fields:\n value, error = field.validate(v, values, loc=loc, cls=cls)\n if error:\n errors.append(error)\n else:\n return value, None\n return v, errors\n else:\n return self._apply_validators(v, values, loc, cls, self.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/pydantic/v1/fields.py_ModelField._validate_discriminated_union_ModelField._validate_discriminated_union.None_1.else_.return.sub_field_validate_v_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._validate_discriminated_union_ModelField._validate_discriminated_union.None_1.else_.return.sub_field_validate_v_val", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1103, "end_line": 1150, "span_ids": ["ModelField._validate_discriminated_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": "class ModelField(Representation):\n\n def _validate_discriminated_union(\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc']\n ) -> 'ValidateReturn':\n assert self.discriminator_key is not None\n assert self.discriminator_alias is not None\n\n try:\n try:\n discriminator_value = v[self.discriminator_alias]\n except KeyError:\n if self.model_config.allow_population_by_field_name:\n discriminator_value = v[self.discriminator_key]\n else:\n raise\n except KeyError:\n return v, ErrorWrapper(MissingDiscriminator(discriminator_key=self.discriminator_key), loc)\n except TypeError:\n try:\n # BaseModel or dataclass\n discriminator_value = getattr(v, self.discriminator_key)\n except (AttributeError, TypeError):\n return v, ErrorWrapper(MissingDiscriminator(discriminator_key=self.discriminator_key), loc)\n\n if self.sub_fields_mapping is None:\n assert cls is not None\n raise ConfigError(\n f'field \"{self.name}\" not yet prepared so type is still a ForwardRef, '\n f'you might need to call {cls.__name__}.update_forward_refs().'\n )\n\n try:\n sub_field = self.sub_fields_mapping[discriminator_value]\n except (KeyError, TypeError):\n # KeyError: `discriminator_value` is not in the dictionary.\n # TypeError: `discriminator_value` is unhashable.\n assert self.sub_fields_mapping is not None\n return v, ErrorWrapper(\n InvalidDiscriminator(\n discriminator_key=self.discriminator_key,\n discriminator_value=discriminator_value,\n allowed_values=list(self.sub_fields_mapping),\n ),\n loc,\n )\n else:\n if not isinstance(loc, tuple):\n loc = (loc,)\n return sub_field.validate(v, values, loc=(*loc, display_as_type(sub_field.type_)), cls=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/v1/fields.py_ModelField._apply_validators_ModelField.is_complex.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._apply_validators_ModelField.is_complex.return._", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1152, "end_line": 1172, "span_ids": ["ModelField.is_complex", "ModelField._apply_validators"], "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 ModelField(Representation):\n\n def _apply_validators(\n self, v: Any, values: Dict[str, Any], loc: 'LocStr', cls: Optional['ModelOrDc'], validators: 'ValidatorsList'\n ) -> 'ValidateReturn':\n for validator in validators:\n try:\n v = validator(cls, v, values, self, self.model_config)\n except (ValueError, TypeError, AssertionError) as exc:\n return v, ErrorWrapper(exc, loc)\n return v, None\n\n def is_complex(self) -> bool:\n \"\"\"\n Whether the field is \"complex\" eg. env variables should be parsed as JSON.\n \"\"\"\n from .main import BaseModel\n\n return (\n self.shape != SHAPE_SINGLETON\n or hasattr(self.type_, '__pydantic_model__')\n or lenient_issubclass(self.type_, (BaseModel, list, set, frozenset, 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/v1/fields.py_ModelField._type_display_ModelField.__repr_args__.return.args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_ModelField._type_display_ModelField.__repr_args__.return.args", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1174, "end_line": 1204, "span_ids": ["ModelField._type_display", "ModelField.__repr_args__"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelField(Representation):\n\n def _type_display(self) -> PyObjectStr:\n t = display_as_type(self.type_)\n\n if self.shape in MAPPING_LIKE_SHAPES:\n t = f'Mapping[{display_as_type(self.key_field.type_)}, {t}]' # type: ignore\n elif self.shape == SHAPE_TUPLE:\n t = 'Tuple[{}]'.format(', '.join(display_as_type(f.type_) for f in self.sub_fields)) # type: ignore\n elif self.shape == SHAPE_GENERIC:\n assert self.sub_fields\n t = '{}[{}]'.format(\n display_as_type(self.type_), ', '.join(display_as_type(f.type_) for f in self.sub_fields)\n )\n elif self.shape != SHAPE_SINGLETON:\n t = SHAPE_NAME_LOOKUP[self.shape].format(t)\n\n if self.allow_none and (self.shape != SHAPE_SINGLETON or not self.sub_fields):\n t = f'Optional[{t}]'\n return PyObjectStr(t)\n\n def __repr_args__(self) -> 'ReprArgs':\n args = [('name', self.name), ('type', self._type_display()), ('required', self.required)]\n\n if not self.required:\n if self.default_factory is not None:\n args.append(('default_factory', f''))\n else:\n args.append(('default', self.default))\n\n if self.alt_alias:\n args.append(('alias', self.alias))\n return args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/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/v1/fields.py_ModelPrivateAttr_ModelPrivateAttr.__eq__.return.isinstance_other_self___", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1207, "end_line": 1221, "span_ids": ["ModelPrivateAttr.__init__", "ModelPrivateAttr.get_default", "ModelPrivateAttr", "ModelPrivateAttr.__eq__"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelPrivateAttr(Representation):\n __slots__ = ('default', 'default_factory')\n\n def __init__(self, default: Any = Undefined, *, default_factory: Optional[NoArgAnyCallable] = None) -> None:\n self.default = default\n self.default_factory = default_factory\n\n def get_default(self) -> Any:\n return 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/v1/fields.py_PrivateAttr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/fields.py_PrivateAttr_", "embedding": null, "metadata": {"file_path": "pydantic/v1/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1224, "end_line": 1257, "span_ids": ["DeferredType", "is_finalvar_with_default_val", "PrivateAttr"], "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 PrivateAttr(\n default: Any = Undefined,\n *,\n default_factory: Optional[NoArgAnyCallable] = 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 and it's up to you to keep them relevant.\n\n Private attrs are stored in model __slots__.\n\n :param default: the attribute\u2019s 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 )\n\n\nclass DeferredType:\n \"\"\"\n Used to postpone field preparation, while creating recursive generic models.\n \"\"\"\n\n\ndef is_finalvar_with_default_val(type_: Type[Any], val: Any) -> bool:\n return is_finalvar(type_) and val is not Undefined and not isinstance(val, 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/v1/generics.py_sys__assigned_parameters.AssignedParameters_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_sys__assigned_parameters.AssignedParameters_", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["imports", "impl:23"], "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": "import sys\nimport types\nimport typing\nfrom typing import (\n TYPE_CHECKING,\n Any,\n ClassVar,\n Dict,\n ForwardRef,\n Generic,\n Iterator,\n List,\n Mapping,\n Optional,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n)\nfrom weakref import WeakKeyDictionary, WeakValueDictionary\n\nfrom typing_extensions import Annotated, Literal as ExtLiteral\n\nfrom .class_validators import gather_all_validators\nfrom .fields import DeferredType\nfrom .main import BaseModel, create_model\nfrom .types import JsonWrapper\nfrom .typing import display_as_type, get_all_type_hints, get_args, get_origin, typing_base\nfrom .utils import all_identical, lenient_issubclass\n\nif sys.version_info >= (3, 10):\n from typing import _UnionGenericAlias\nif sys.version_info >= (3, 8):\n from typing import Literal\n\nGenericModelT = TypeVar('GenericModelT', bound='GenericModel')\nTypeVarType = Any # since mypy doesn't allow the use of TypeVar as a type\n\nCacheKey = Tuple[Type[Any], Any, Tuple[Any, ...]]\nParametrization = Mapping[TypeVarType, Type[Any]]\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[CacheKey, Type[BaseModel]]\n AssignedParameters = WeakKeyDictionary[Type[BaseModel], Parametrization]\nelse:\n GenericTypesCache = WeakValueDictionary\n AssignedParameters = WeakKeyDictionary\n\n# _generic_types_cache is a Mapping from __class_getitem__ arguments to the parametrized version of generic models.\n# This ensures multiple calls of e.g. A[B] return always the same class.\n_generic_types_cache = GenericTypesCache()\n\n# _assigned_parameters is a Mapping from parametrized version of generic models to assigned types of parametrizations\n# as captured during construction of the class (not instances).\n# E.g., for generic model `Model[A, B]`, when parametrized model `Model[int, str]` is created,\n# `Model[int, str]`: {A: int, B: str}` will be stored in `_assigned_parameters`.\n# (This information is only otherwise available after creation from the class name string).\n_assigned_parameters = AssignedParameters()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel_GenericModel._Setting_the_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel_GenericModel._Setting_the_return_type", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 71, "span_ids": ["GenericModel"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericModel(BaseModel):\n __slots__ = ()\n __concrete__: ClassVar[bool] = False\n\n if TYPE_CHECKING:\n # Putting this in a TYPE_CHECKING block allows us to replace `if Generic not in cls.__bases__` with\n # `not hasattr(cls, \"__parameters__\")`. This means we don't need to force non-concrete subclasses of\n # `GenericModel` to also inherit from `Generic`, which would require changes to the use of `create_model` below.\n __parameters__: ClassVar[Tuple[TypeVarType, ...]]\n\n # Setting the return type as Type[Any] instead of Type[BaseModel] prevents PyCharm warnings", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__class_getitem___GenericModel.__class_getitem__._If_none_are_left_the_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__class_getitem___GenericModel.__class_getitem__._If_none_are_left_the_m", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 145, "span_ids": ["GenericModel.__class_getitem__"], "tokens": 810}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericModel(BaseModel):\n def __class_getitem__(cls: Type[GenericModelT], params: Union[Type[Any], Tuple[Type[Any], ...]]) -> Type[Any]:\n \"\"\"Instantiates a new class from a generic class `cls` and type variables `params`.\n\n :param params: Tuple of types 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: New model class inheriting from `cls` with instantiated\n types described by `params`. If no parameters are given, `cls` is\n returned as is.\n\n \"\"\"\n\n def _cache_key(_params: Any) -> CacheKey:\n args = get_args(_params)\n # python returns a list for Callables, which is not hashable\n if len(args) == 2 and isinstance(args[0], list):\n args = (tuple(args[0]), args[1])\n return cls, _params, args\n\n cached = _generic_types_cache.get(_cache_key(params))\n if cached is not None:\n return cached\n if cls.__concrete__ and Generic not in cls.__bases__:\n raise TypeError('Cannot parameterize a concrete instantiation of a generic model')\n if not isinstance(params, tuple):\n params = (params,)\n if cls is GenericModel and any(isinstance(param, TypeVar) for param in params):\n raise TypeError('Type parameters should be placed on typing.Generic, not GenericModel')\n if not hasattr(cls, '__parameters__'):\n raise TypeError(f'Type {cls.__name__} must inherit from typing.Generic before being parameterized')\n\n check_parameters_count(cls, params)\n # Build map from generic typevars to passed params\n typevars_map: Dict[TypeVarType, Type[Any]] = dict(zip(cls.__parameters__, params))\n if all_identical(typevars_map.keys(), typevars_map.values()) and typevars_map:\n return cls # if arguments are equal to parameters it's the same object\n\n # Create new model with original model as parent inserting fields with DeferredType.\n model_name = cls.__concrete_name__(params)\n validators = gather_all_validators(cls)\n\n type_hints = get_all_type_hints(cls).items()\n instance_type_hints = {k: v for k, v in type_hints if get_origin(v) is not ClassVar}\n\n fields = {k: (DeferredType(), cls.__fields__[k].field_info) for k in instance_type_hints if k in cls.__fields__}\n\n model_module, called_globally = get_caller_frame_info()\n created_model = cast(\n Type[GenericModel], # casting ensures mypy is aware of the __concrete__ and __parameters__ attributes\n create_model(\n model_name,\n __module__=model_module or cls.__module__,\n __base__=(cls,) + tuple(cls.__parameterized_bases__(typevars_map)),\n __config__=None,\n __validators__=validators,\n __cls_kwargs__=None,\n **fields,\n ),\n )\n\n _assigned_parameters[created_model] = typevars_map\n\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 created_model.Config = cls.Config\n\n # Find any typevars that are still present in the model.\n # If none are left, the model is fully \"concrete\", otherwise the new\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/v1/generics.py_GenericModel.__class_getitem__._class_is_a_generic_clas_GenericModel.__class_getitem__.return.created_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__class_getitem__._class_is_a_generic_clas_GenericModel.__class_getitem__.return.created_model", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 165, "span_ids": ["GenericModel.__class_getitem__"], "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 GenericModel(BaseModel):\n def __class_getitem__(cls: Type[GenericModelT], params: Union[Type[Any], Tuple[Type[Any], ...]]) -> Type[Any]:\n # class is a generic class as well taking the found typevars as\n # parameters.\n new_params = tuple(\n {param: None for param in iter_contained_typevars(typevars_map.values())}\n ) # use dict as ordered set\n created_model.__concrete__ = not new_params\n if new_params:\n created_model.__parameters__ = new_params\n\n # Save created model in cache so we don't end up creating duplicate\n # models that should be identical.\n _generic_types_cache[_cache_key(params)] = created_model\n if len(params) == 1:\n _generic_types_cache[_cache_key(params[0])] = created_model\n\n # Recursively walk class type hints and replace generic typevars\n # with concrete types that were passed.\n _prepare_model_fields(created_model, fields, instance_type_hints, typevars_map)\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/v1/generics.py_GenericModel.__concrete_name___GenericModel.__concrete_name__.return.f_cls___name___params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__concrete_name___GenericModel.__concrete_name__.return.f_cls___name___params_", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 181, "span_ids": ["GenericModel.__concrete_name__"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericModel(BaseModel):\n\n @classmethod\n def __concrete_name__(cls: Type[Any], params: Tuple[Type[Any], ...]) -> str:\n \"\"\"Compute class name for child classes.\n\n :param params: Tuple of types 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 a 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 GenericModels.\n \"\"\"\n param_names = [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/v1/generics.py_GenericModel.__parameterized_bases___GenericModel.__parameterized_bases__.for_base_model_in_cls___b.if_not_issubclass_base_mo.else_.yield_from_build_base_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_GenericModel.__parameterized_bases___GenericModel.__parameterized_bases__.for_base_model_in_cls___b.if_not_issubclass_base_mo.else_.yield_from_build_base_mod", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 245, "span_ids": ["GenericModel.__parameterized_bases__"], "tokens": 634}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericModel(BaseModel):\n\n @classmethod\n def __parameterized_bases__(cls, typevars_map: Parametrization) -> Iterator[Type[Any]]:\n \"\"\"\n Returns unbound bases of cls parameterised to given type variables\n\n :param typevars_map: Dictionary of type applications for binding subclasses.\n Given a generic class `Model` with 2 type variables [S, T]\n and a concrete model `Model[str, int]`,\n the value `{S: str, T: int}` would be passed to `typevars_map`.\n :return: an iterator of generic sub classes, parameterised by `typevars_map`\n and other assigned parameters of `cls`\n\n e.g.:\n ```\n class A(GenericModel, Generic[T]):\n ...\n\n class B(A[V], Generic[V]):\n ...\n\n assert A[int] in B.__parameterized_bases__({V: int})\n ```\n \"\"\"\n\n def build_base_model(\n base_model: Type[GenericModel], mapped_types: Parametrization\n ) -> Iterator[Type[GenericModel]]:\n base_parameters = tuple(mapped_types[param] for param in base_model.__parameters__)\n parameterized_base = base_model.__class_getitem__(base_parameters)\n if parameterized_base is base_model or parameterized_base is cls:\n # Avoid duplication in MRO\n return\n yield parameterized_base\n\n for base_model in cls.__bases__:\n if not issubclass(base_model, GenericModel):\n # not a class that can be meaningfully parameterized\n continue\n elif not getattr(base_model, '__parameters__', None):\n # base_model is \"GenericModel\" (and has no __parameters__)\n # or\n # base_model is already concrete, and will be included transitively via cls.\n continue\n elif cls in _assigned_parameters:\n if base_model in _assigned_parameters:\n # cls is partially parameterised but not from base_model\n # e.g. cls = B[S], base_model = A[S]\n # B[S][int] should subclass A[int], (and will be transitively via B[int])\n # but it's not viable to consistently subclass types with arbitrary construction\n # So don't attempt to include A[S][int]\n continue\n else: # base_model not in _assigned_parameters:\n # cls is partially parameterized, base_model is original generic\n # e.g. cls = B[str, T], base_model = B[S, T]\n # Need to determine the mapping for the base_model parameters\n mapped_types: Parametrization = {\n key: typevars_map.get(value, value) for key, value in _assigned_parameters[cls].items()\n }\n yield from build_base_model(base_model, mapped_types)\n else:\n # cls is base generic, so base_class has a distinct base\n # can construct the Parameterised base model using typevars_map directly\n yield from build_base_model(base_model, typevars_map)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_check_parameters_count_iter_contained_typevars.if_isinstance_v_TypeVar_.else_.for_arg_in_args_.yield_from_iter_contained": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_check_parameters_count_iter_contained_typevars.if_isinstance_v_TypeVar_.else_.for_arg_in_args_.yield_from_iter_contained", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 356, "span_ids": ["iter_contained_typevars", "impl:25", "check_parameters_count"], "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 check_parameters_count(cls: Type[GenericModel], parameters: Tuple[Any, ...]) -> None:\n actual = len(parameters)\n expected = len(cls.__parameters__)\n if actual != expected:\n description = 'many' if actual > expected else 'few'\n raise TypeError(f'Too {description} parameters for {cls.__name__}; actual {actual}, expected {expected}')\n\n\nDictValues: Type[Any] = {}.values().__class__\n\n\ndef iter_contained_typevars(v: Any) -> Iterator[TypeVarType]:\n \"\"\"Recursively iterate through all subtypes and type args of `v` and yield any typevars that are found.\"\"\"\n if isinstance(v, TypeVar):\n yield v\n elif hasattr(v, '__parameters__') and not get_origin(v) and lenient_issubclass(v, GenericModel):\n yield from v.__parameters__\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_get_caller_frame_info_get_caller_frame_info.return.frame_globals_get___name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_get_caller_frame_info_get_caller_frame_info.return.frame_globals_get___name", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 364, "span_ids": ["get_caller_frame_info"], "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 get_caller_frame_info() -> Tuple[Optional[str], bool]:\n \"\"\"\n Used inside a function to check whether it was called globally\n\n Will only work against non-compiled code, therefore used only in pydantic.generics\n\n :returns Tuple[module_name, called_globally]\n \"\"\"\n try:\n previous_caller_frame = sys._getframe(2)\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py__prepare_model_fields_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py__prepare_model_fields_", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 367, "end_line": 391, "span_ids": ["_prepare_model_fields"], "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 _prepare_model_fields(\n created_model: Type[GenericModel],\n fields: Mapping[str, Any],\n instance_type_hints: Mapping[str, type],\n typevars_map: Mapping[Any, type],\n) -> None:\n \"\"\"\n Replace DeferredType fields with concrete type hints and prepare them.\n \"\"\"\n\n for key, field in created_model.__fields__.items():\n if key not in fields:\n assert field.type_.__class__ is not DeferredType\n # https://github.com/nedbat/coveragepy/issues/198\n continue # pragma: no cover\n\n assert field.type_.__class__ is DeferredType, field.type_.__class__\n\n field_type_hint = instance_type_hints[key]\n concrete_type = replace_types(field_type_hint, typevars_map)\n field.type_ = concrete_type\n field.outer_type_ = concrete_type\n field.prepare()\n created_model.__annotations__[key] = concrete_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/v1/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/v1/json.py_datetime_isoformat.return.o_isoformat_", "embedding": null, "metadata": {"file_path": "pydantic/v1/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/v1/json.py_decimal_encoder_decimal_encoder.if_dec_value_as_tuple_e.else_.return.float_dec_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_decimal_encoder_decimal_encoder.if_dec_value_as_tuple_e.else_.return.float_dec_value_", "embedding": null, "metadata": {"file_path": "pydantic/v1/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 23, "end_line": 41, "span_ids": ["decimal_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 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 if dec_value.as_tuple().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/v1/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/v1/json.py_ENCODERS_BY_TYPE_ENCODERS_BY_TYPE._", "embedding": null, "metadata": {"file_path": "pydantic/v1/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 69, "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/v1/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/v1/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/v1/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 90, "span_ids": ["pydantic_encoder"], "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 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.dict()\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/v1/json.py_custom_pydantic_encoder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/json.py_custom_pydantic_encoder_", "embedding": null, "metadata": {"file_path": "pydantic/v1/json.py", "file_name": "json.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 113, "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/v1/main.py_warnings__is_base_model_class_defined.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_warnings__is_base_model_class_defined.False", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 117, "span_ids": ["imports", "generate_hash_function", "validate_custom_root_type", "impl:8"], "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": "import warnings\nfrom abc import ABCMeta\nfrom copy import deepcopy\nfrom enum import Enum\nfrom functools import partial\nfrom pathlib import Path\nfrom types import FunctionType, prepare_class, resolve_bases\nfrom typing import (\n TYPE_CHECKING,\n AbstractSet,\n Any,\n Callable,\n ClassVar,\n Dict,\n List,\n Mapping,\n Optional,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n no_type_check,\n overload,\n)\n\nfrom typing_extensions import dataclass_transform\n\nfrom .class_validators import ValidatorGroup, extract_root_validators, extract_validators, inherit_validators\nfrom .config import BaseConfig, Extra, inherit_config, prepare_config\nfrom .error_wrappers import ErrorWrapper, ValidationError\nfrom .errors import ConfigError, DictError, ExtraError, MissingError\nfrom .fields import (\n MAPPING_LIKE_SHAPES,\n Field,\n ModelField,\n ModelPrivateAttr,\n PrivateAttr,\n Undefined,\n is_finalvar_with_default_val,\n)\nfrom .json import custom_pydantic_encoder, pydantic_encoder\nfrom .parse import Protocol, load_file, load_str_bytes\nfrom .schema import default_ref_template, model_schema\nfrom .types import PyObject, StrBytes\nfrom .typing import (\n AnyCallable,\n get_args,\n get_origin,\n is_classvar,\n is_namedtuple,\n is_union,\n resolve_annotations,\n update_model_forward_refs,\n)\nfrom .utils import (\n DUNDER_ATTRIBUTES,\n ROOT_KEY,\n ClassAttribute,\n GetterDict,\n Representation,\n ValueItems,\n generate_model_signature,\n is_valid_field,\n is_valid_private_name,\n lenient_issubclass,\n sequence_like,\n smart_deepcopy,\n unique_list,\n validate_field_name,\n)\n\nif TYPE_CHECKING:\n from inspect import Signature\n\n from .class_validators import ValidatorListDict\n from .types import ModelOrDc\n from .typing import (\n AbstractSetIntStr,\n AnyClassMethod,\n CallableGenerator,\n DictAny,\n DictStrAny,\n MappingIntStrAny,\n ReprArgs,\n SetStr,\n TupleGenerator,\n )\n\n Model = TypeVar('Model', bound='BaseModel')\n\n__all__ = 'BaseModel', 'create_model', 'validate_model'\n\n_T = TypeVar('_T')\n\n\ndef validate_custom_root_type(fields: Dict[str, ModelField]) -> None:\n if len(fields) > 1:\n raise ValueError(f'{ROOT_KEY} cannot be mixed with other fields')\n\n\ndef generate_hash_function(frozen: bool) -> Optional[Callable[[Any], int]]:\n def hash_function(self_: Any) -> int:\n return hash(self_.__class__) + hash(tuple(self_.__dict__.values()))\n\n return hash_function if frozen else None\n\n\n# If a field is of type `Callable`, its default value should be a function and cannot to ignored.\nANNOTATED_FIELD_UNTOUCHED_TYPES: Tuple[Any, ...] = (property, type, classmethod, staticmethod)\n# When creating a `BaseModel` instance, we bypass all the methods, properties... added to the model\nUNTOUCHED_TYPES: Tuple[Any, ...] = (FunctionType,) + ANNOTATED_FIELD_UNTOUCHED_TYPES\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_is_base_model_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/v1/main.py_ModelMetaclass_ModelMetaclass.__new__.is_untouched.return.isinstance_v_untouched_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_ModelMetaclass_ModelMetaclass.__new__.is_untouched.return.isinstance_v_untouched_t", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 175, "span_ids": ["ModelMetaclass.__new__", "ModelMetaclass"], "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": "@dataclass_transform(kw_only_default=True, field_specifiers=(Field,))\nclass ModelMetaclass(ABCMeta):\n @no_type_check # noqa C901\n def __new__(mcs, name, bases, namespace, **kwargs): # noqa C901\n fields: Dict[str, ModelField] = {}\n config = BaseConfig\n validators: 'ValidatorListDict' = {}\n\n pre_root_validators, post_root_validators = [], []\n private_attributes: Dict[str, ModelPrivateAttr] = {}\n base_private_attributes: Dict[str, ModelPrivateAttr] = {}\n slots: SetStr = namespace.get('__slots__', ())\n slots = {slots} if isinstance(slots, str) else set(slots)\n class_vars: SetStr = set()\n hash_func: Optional[Callable[[Any], int]] = None\n\n for base in reversed(bases):\n if _is_base_model_class_defined and issubclass(base, BaseModel) and base != BaseModel:\n fields.update(smart_deepcopy(base.__fields__))\n config = inherit_config(base.__config__, config)\n validators = inherit_validators(base.__validators__, validators)\n pre_root_validators += base.__pre_root_validators__\n post_root_validators += base.__post_root_validators__\n base_private_attributes.update(base.__private_attributes__)\n class_vars.update(base.__class_vars__)\n hash_func = base.__hash__\n\n resolve_forward_refs = kwargs.pop('__resolve_forward_refs__', True)\n allowed_config_kwargs: SetStr = {\n key\n for key in dir(config)\n if not (key.startswith('__') and key.endswith('__')) # skip dunder methods and attributes\n }\n config_kwargs = {key: kwargs.pop(key) for key in kwargs.keys() & allowed_config_kwargs}\n config_from_namespace = namespace.get('Config')\n if config_kwargs and config_from_namespace:\n raise TypeError('Specifying config in two places is ambiguous, use either Config attribute or class kwargs')\n config = inherit_config(config_from_namespace, config, **config_kwargs)\n\n validators = inherit_validators(extract_validators(namespace), validators)\n vg = ValidatorGroup(validators)\n\n for f in fields.values():\n f.set_config(config)\n extra_validators = vg.get_validators(f.name)\n if extra_validators:\n f.class_validators.update(extra_validators)\n # re-run prepare to add extra validators\n f.populate_validators()\n\n prepare_config(config, name)\n\n untouched_types = ANNOTATED_FIELD_UNTOUCHED_TYPES\n\n def is_untouched(v: Any) -> bool:\n return isinstance(v, untouched_types) or v.__class__.__name__ == 'cython_function_or_method'\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/v1/main.py_ModelMetaclass.__new__.if_namespace_get___modu_ModelMetaclass.__new__.exclude_from_namespace.fields_private_attribut": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_ModelMetaclass.__new__.if_namespace_get___modu_ModelMetaclass.__new__.exclude_from_namespace.fields_private_attribut", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 251, "span_ids": ["ModelMetaclass.__new__"], "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": "@dataclass_transform(kw_only_default=True, field_specifiers=(Field,))\nclass ModelMetaclass(ABCMeta):\n @no_type_check # noqa C901\n def __new__(mcs, name, bases, namespace, **kwargs):\n # ... other code\n\n if (namespace.get('__module__'), namespace.get('__qualname__')) != ('pydantic.main', 'BaseModel'):\n annotations = resolve_annotations(namespace.get('__annotations__', {}), namespace.get('__module__', None))\n # annotation only fields need to come first in fields\n for ann_name, ann_type in annotations.items():\n if is_classvar(ann_type):\n class_vars.add(ann_name)\n elif is_finalvar_with_default_val(ann_type, namespace.get(ann_name, Undefined)):\n class_vars.add(ann_name)\n elif is_valid_field(ann_name):\n validate_field_name(bases, ann_name)\n value = namespace.get(ann_name, Undefined)\n allowed_types = get_args(ann_type) if is_union(get_origin(ann_type)) else (ann_type,)\n if (\n is_untouched(value)\n and ann_type != PyObject\n and not any(\n lenient_issubclass(get_origin(allowed_type), Type) for allowed_type in allowed_types\n )\n ):\n continue\n fields[ann_name] = ModelField.infer(\n name=ann_name,\n value=value,\n annotation=ann_type,\n class_validators=vg.get_validators(ann_name),\n config=config,\n )\n elif ann_name not in namespace and config.underscore_attrs_are_private:\n private_attributes[ann_name] = PrivateAttr()\n\n untouched_types = UNTOUCHED_TYPES + config.keep_untouched\n for var_name, value in namespace.items():\n can_be_changed = var_name not in class_vars and not is_untouched(value)\n if isinstance(value, ModelPrivateAttr):\n if not is_valid_private_name(var_name):\n raise NameError(\n f'Private attributes \"{var_name}\" must not be a valid field name; '\n f'Use sunder or dunder names, e. g. \"_{var_name}\" or \"__{var_name}__\"'\n )\n private_attributes[var_name] = value\n elif config.underscore_attrs_are_private and is_valid_private_name(var_name) and can_be_changed:\n private_attributes[var_name] = PrivateAttr(default=value)\n elif is_valid_field(var_name) and var_name not in annotations and can_be_changed:\n validate_field_name(bases, var_name)\n inferred = ModelField.infer(\n name=var_name,\n value=value,\n annotation=annotations.get(var_name, Undefined),\n class_validators=vg.get_validators(var_name),\n config=config,\n )\n if var_name in fields:\n if lenient_issubclass(inferred.type_, fields[var_name].type_):\n inferred.type_ = fields[var_name].type_\n else:\n raise TypeError(\n f'The type of {name}.{var_name} differs from the new default value; '\n f'if you wish to change the type of this field, please use a type annotation'\n )\n fields[var_name] = inferred\n\n _custom_root_type = ROOT_KEY in fields\n if _custom_root_type:\n validate_custom_root_type(fields)\n vg.check_for_unused()\n if config.json_encoders:\n json_encoder = partial(custom_pydantic_encoder, config.json_encoders)\n else:\n json_encoder = pydantic_encoder\n pre_rv_new, post_rv_new = extract_root_validators(namespace)\n\n if hash_func is None:\n hash_func = generate_hash_function(config.frozen)\n\n exclude_from_namespace = fields | private_attributes.keys() | {'__slots__'}\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/v1/main.py_ModelMetaclass.__new__.new_namespace_ModelMetaclass.__instancecheck__.return.hasattr_instance___fiel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_ModelMetaclass.__new__.new_namespace_ModelMetaclass.__instancecheck__.return.hasattr_instance___fiel", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 304, "span_ids": ["ModelMetaclass.__instancecheck__", "ModelMetaclass.__new__"], "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": "@dataclass_transform(kw_only_default=True, field_specifiers=(Field,))\nclass ModelMetaclass(ABCMeta):\n @no_type_check # noqa C901\n def __new__(mcs, name, bases, namespace, **kwargs):\n # ... other code\n new_namespace = {\n '__config__': config,\n '__fields__': fields,\n '__exclude_fields__': {\n name: field.field_info.exclude for name, field in fields.items() if field.field_info.exclude is not None\n }\n or None,\n '__include_fields__': {\n name: field.field_info.include for name, field in fields.items() if field.field_info.include is not None\n }\n or None,\n '__validators__': vg.validators,\n '__pre_root_validators__': unique_list(\n pre_root_validators + pre_rv_new,\n name_factory=lambda v: v.__name__,\n ),\n '__post_root_validators__': unique_list(\n post_root_validators + post_rv_new,\n name_factory=lambda skip_on_failure_and_v: skip_on_failure_and_v[1].__name__,\n ),\n '__schema_cache__': {},\n '__json_encoder__': staticmethod(json_encoder),\n '__custom_root_type__': _custom_root_type,\n '__private_attributes__': {**base_private_attributes, **private_attributes},\n '__slots__': slots | private_attributes.keys(),\n '__hash__': hash_func,\n '__class_vars__': class_vars,\n **{n: v for n, v in namespace.items() if n not in exclude_from_namespace},\n }\n\n cls = super().__new__(mcs, name, bases, new_namespace, **kwargs)\n # set __signature__ attr only for model class, but not for its instances\n cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))\n if resolve_forward_refs:\n cls.__try_update_forward_refs__()\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 namespace.items():\n if name not in new_namespace:\n set_name = getattr(obj, '__set_name__', None)\n if callable(set_name):\n set_name(cls, name)\n\n return cls\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, '__fields__') 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/v1/main.py_object_setattr_BaseModel.__init__.__pydantic_self____init_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_object_setattr_BaseModel.__init__.__pydantic_self____init_p", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 349, "span_ids": ["BaseModel.__init__", "impl:14", "BaseModel"], "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": "object_setattr = object.__setattr__\n\n\nclass BaseModel(Representation, metaclass=ModelMetaclass):\n if TYPE_CHECKING:\n # populated by the metaclass, defined here to help IDEs only\n __fields__: ClassVar[Dict[str, ModelField]] = {}\n __include_fields__: ClassVar[Optional[Mapping[str, Any]]] = None\n __exclude_fields__: ClassVar[Optional[Mapping[str, Any]]] = None\n __validators__: ClassVar[Dict[str, AnyCallable]] = {}\n __pre_root_validators__: ClassVar[List[AnyCallable]]\n __post_root_validators__: ClassVar[List[Tuple[bool, AnyCallable]]]\n __config__: ClassVar[Type[BaseConfig]] = BaseConfig\n __json_encoder__: ClassVar[Callable[[Any], Any]] = lambda x: x\n __schema_cache__: ClassVar['DictAny'] = {}\n __custom_root_type__: ClassVar[bool] = False\n __signature__: ClassVar['Signature']\n __private_attributes__: ClassVar[Dict[str, ModelPrivateAttr]]\n __class_vars__: ClassVar[SetStr]\n __fields_set__: ClassVar[SetStr] = set()\n\n Config = BaseConfig\n __slots__ = ('__dict__', '__fields_set__')\n __doc__ = '' # Null out the Representation docstring\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` the first arg to allow \"self\" as a settable attribute\n values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data)\n if validation_error:\n raise validation_error\n try:\n object_setattr(__pydantic_self__, '__dict__', values)\n except TypeError as e:\n raise TypeError(\n 'Model values must be a dict; you may not have returned a dictionary from a root validator'\n ) from e\n object_setattr(__pydantic_self__, '__fields_set__', fields_set)\n __pydantic_self__._init_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/v1/main.py_BaseModel.__setattr___BaseModel.__setattr__.self___fields_set___add_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.__setattr___BaseModel.__setattr__.self___fields_set___add_n", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 405, "span_ids": ["BaseModel.__setattr__"], "tokens": 613}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @no_type_check\n def __setattr__(self, name, value): # noqa: C901 (ignore complexity)\n if name in self.__private_attributes__ or name in DUNDER_ATTRIBUTES:\n return object_setattr(self, name, value)\n\n if self.__config__.extra is not Extra.allow and name not in self.__fields__:\n raise ValueError(f'\"{self.__class__.__name__}\" object has no field \"{name}\"')\n elif not self.__config__.allow_mutation or self.__config__.frozen:\n raise TypeError(f'\"{self.__class__.__name__}\" is immutable and does not support item assignment')\n elif name in self.__fields__ and self.__fields__[name].final:\n raise TypeError(\n f'\"{self.__class__.__name__}\" object \"{name}\" field is final and does not support reassignment'\n )\n elif self.__config__.validate_assignment:\n new_values = {**self.__dict__, name: value}\n\n for validator in self.__pre_root_validators__:\n try:\n new_values = validator(self.__class__, new_values)\n except (ValueError, TypeError, AssertionError) as exc:\n raise ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], self.__class__)\n\n known_field = self.__fields__.get(name, None)\n if known_field:\n # We want to\n # - make sure validators are called without the current value for this field inside `values`\n # - keep other values (e.g. submodels) untouched (using `BaseModel.dict()` will change them into dicts)\n # - keep the order of the fields\n if not known_field.field_info.allow_mutation:\n raise TypeError(f'\"{known_field.name}\" has allow_mutation set to False and cannot be assigned')\n dict_without_original_value = {k: v for k, v in self.__dict__.items() if k != name}\n value, error_ = known_field.validate(value, dict_without_original_value, loc=name, cls=self.__class__)\n if error_:\n raise ValidationError([error_], self.__class__)\n else:\n new_values[name] = value\n\n errors = []\n for skip_on_failure, validator in self.__post_root_validators__:\n if skip_on_failure and errors:\n continue\n try:\n new_values = validator(self.__class__, new_values)\n except (ValueError, TypeError, AssertionError) as exc:\n errors.append(ErrorWrapper(exc, loc=ROOT_KEY))\n if errors:\n raise ValidationError(errors, self.__class__)\n\n # update the whole __dict__ as other values than just `value`\n # may be changed (e.g. with `root_validator`)\n object_setattr(self, '__dict__', new_values)\n else:\n self.__dict__[name] = value\n\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/v1/main.py_BaseModel.__getstate___BaseModel._init_private_attributes.for_name_private_attr_in.if_default_is_not_Undefin.object_setattr_self_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.__getstate___BaseModel._init_private_attributes.for_name_private_attr_in.if_default_is_not_Undefin.object_setattr_self_name", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 407, "end_line": 425, "span_ids": ["BaseModel._init_private_attributes", "BaseModel.__setstate__", "BaseModel.__getstate__"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n def __getstate__(self) -> 'DictAny':\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: 'DictAny') -> 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)\n\n def _init_private_attributes(self) -> None:\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/v1/main.py_BaseModel.dict_BaseModel.dict.return.dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.dict_BaseModel.dict.return.dict_", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 427, "end_line": 459, "span_ids": ["BaseModel.dict"], "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 BaseModel(Representation, metaclass=ModelMetaclass):\n\n def dict(\n self,\n *,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n by_alias: bool = False,\n skip_defaults: Optional[bool] = None,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n ) -> 'DictStrAny':\n \"\"\"\n Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.\n\n \"\"\"\n if skip_defaults is not None:\n warnings.warn(\n f'{self.__class__.__name__}.dict(): \"skip_defaults\" is deprecated and replaced by \"exclude_unset\"',\n DeprecationWarning,\n )\n exclude_unset = skip_defaults\n\n return dict(\n self._iter(\n to_dict=True,\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 )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.json_BaseModel.json.return.self___config___json_dump": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.json_BaseModel.json.return.self___config___json_dump", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 461, "end_line": 504, "span_ids": ["BaseModel.json"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n def json(\n self,\n *,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n by_alias: bool = False,\n skip_defaults: Optional[bool] = None,\n exclude_unset: bool = False,\n exclude_defaults: bool = False,\n exclude_none: bool = False,\n encoder: Optional[Callable[[Any], Any]] = None,\n models_as_dict: bool = True,\n **dumps_kwargs: Any,\n ) -> str:\n \"\"\"\n Generate a JSON representation of the model, `include` and `exclude` arguments as per `dict()`.\n\n `encoder` is an optional function to supply as `default` to json.dumps(), other arguments as per `json.dumps()`.\n \"\"\"\n if skip_defaults is not None:\n warnings.warn(\n f'{self.__class__.__name__}.json(): \"skip_defaults\" is deprecated and replaced by \"exclude_unset\"',\n DeprecationWarning,\n )\n exclude_unset = skip_defaults\n encoder = cast(Callable[[Any], Any], encoder or self.__json_encoder__)\n\n # We don't directly call `self.dict()`, which does exactly this with `to_dict=True`\n # because we want to be able to keep raw `BaseModel` instances and not as `dict`.\n # This allows users to write custom JSON encoders for given `BaseModel` classes.\n data = dict(\n self._iter(\n to_dict=models_as_dict,\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 )\n )\n if self.__custom_root_type__:\n data = data[ROOT_KEY]\n return self.__config__.json_dumps(data, default=encoder, **dumps_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/v1/main.py_BaseModel._enforce_dict_if_root_BaseModel.parse_obj.return.cls_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._enforce_dict_if_root_BaseModel.parse_obj.return.cls_obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 506, "end_line": 526, "span_ids": ["BaseModel._enforce_dict_if_root", "BaseModel.parse_obj"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def _enforce_dict_if_root(cls, obj: Any) -> Any:\n if cls.__custom_root_type__ and (\n not (isinstance(obj, dict) and obj.keys() == {ROOT_KEY})\n and not (isinstance(obj, BaseModel) and obj.__fields__.keys() == {ROOT_KEY})\n or cls.__fields__[ROOT_KEY].shape in MAPPING_LIKE_SHAPES\n ):\n return {ROOT_KEY: obj}\n else:\n return obj\n\n @classmethod\n def parse_obj(cls: Type['Model'], obj: Any) -> 'Model':\n obj = cls._enforce_dict_if_root(obj)\n if not isinstance(obj, dict):\n try:\n obj = dict(obj)\n except (TypeError, ValueError) as e:\n exc = TypeError(f'{cls.__name__} expected dict not {obj.__class__.__name__}')\n raise ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], cls) from e\n return cls(**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/v1/main.py_BaseModel.parse_raw_BaseModel.parse_raw.return.cls_parse_obj_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.parse_raw_BaseModel.parse_raw.return.cls_parse_obj_obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 528, "end_line": 549, "span_ids": ["BaseModel.parse_raw"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def parse_raw(\n cls: Type['Model'],\n b: StrBytes,\n *,\n content_type: str = None,\n encoding: str = 'utf8',\n proto: Protocol = None,\n allow_pickle: bool = False,\n ) -> 'Model':\n try:\n obj = load_str_bytes(\n b,\n proto=proto,\n content_type=content_type,\n encoding=encoding,\n allow_pickle=allow_pickle,\n json_loads=cls.__config__.json_loads,\n )\n except (ValueError, TypeError, UnicodeDecodeError) as e:\n raise ValidationError([ErrorWrapper(e, loc=ROOT_KEY)], cls)\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/v1/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/v1/main.py_BaseModel.parse_file_BaseModel.parse_file.return.cls_parse_obj_obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 551, "end_line": 569, "span_ids": ["BaseModel.parse_file"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def parse_file(\n cls: Type['Model'],\n path: Union[str, Path],\n *,\n content_type: str = None,\n encoding: str = 'utf8',\n proto: Protocol = None,\n allow_pickle: bool = False,\n ) -> 'Model':\n obj = load_file(\n path,\n proto=proto,\n content_type=content_type,\n encoding=encoding,\n allow_pickle=allow_pickle,\n json_loads=cls.__config__.json_loads,\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/v1/main.py_BaseModel.from_orm_BaseModel.from_orm.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.from_orm_BaseModel.from_orm.return.m", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 571, "end_line": 583, "span_ids": ["BaseModel.from_orm"], "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 BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def from_orm(cls: Type['Model'], obj: Any) -> 'Model':\n if not cls.__config__.orm_mode:\n raise ConfigError('You must have the config attribute orm_mode=True to use from_orm')\n obj = {ROOT_KEY: obj} if cls.__custom_root_type__ else cls._decompose_class(obj)\n m = cls.__new__(cls)\n values, fields_set, validation_error = validate_model(cls, obj)\n if validation_error:\n raise validation_error\n object_setattr(m, '__dict__', values)\n object_setattr(m, '__fields_set__', fields_set)\n m._init_private_attributes()\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/v1/main.py_BaseModel.construct_BaseModel.construct.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.construct_BaseModel.construct.return.m", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 585, "end_line": 607, "span_ids": ["BaseModel.construct"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def construct(cls: Type['Model'], _fields_set: Optional['SetStr'] = 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.__fields__.items():\n if field.alt_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.required:\n fields_values[name] = field.get_default()\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 m._init_private_attributes()\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/v1/main.py_BaseModel._copy_and_set_values_BaseModel._copy_and_set_values.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._copy_and_set_values_BaseModel._copy_and_set_values.return.m", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 609, "end_line": 625, "span_ids": ["BaseModel._copy_and_set_values"], "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 BaseModel(Representation, metaclass=ModelMetaclass):\n\n def _copy_and_set_values(self: 'Model', values: 'DictStrAny', fields_set: 'SetStr', *, deep: bool) -> '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/v1/main.py_BaseModel.copy_BaseModel.copy.return.self__copy_and_set_values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.copy_BaseModel.copy.return.self__copy_and_set_values", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 627, "end_line": 657, "span_ids": ["BaseModel.copy"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n def copy(\n self: 'Model',\n *,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n update: Optional['DictStrAny'] = None,\n deep: bool = False,\n ) -> 'Model':\n \"\"\"\n Duplicate a model, optionally choose which fields to include, exclude and change.\n\n :param include: fields to include in new model\n :param exclude: fields to exclude from new model, as with values this takes precedence over include\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\n values = dict(\n self._iter(to_dict=False, by_alias=False, include=include, exclude=exclude, exclude_unset=False),\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 return self._copy_and_set_values(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/v1/main.py_BaseModel.schema_BaseModel.__get_validators__.yield_cls_validate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.schema_BaseModel.__get_validators__.yield_cls_validate", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 659, "end_line": 680, "span_ids": ["BaseModel.schema", "BaseModel.__get_validators__", "BaseModel.schema_json"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def schema(cls, by_alias: bool = True, ref_template: str = default_ref_template) -> 'DictStrAny':\n cached = cls.__schema_cache__.get((by_alias, ref_template))\n if cached is not None:\n return cached\n s = model_schema(cls, by_alias=by_alias, ref_template=ref_template)\n cls.__schema_cache__[(by_alias, ref_template)] = s\n return s\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 from .json import pydantic_encoder\n\n return cls.__config__.json_dumps(\n cls.schema(by_alias=by_alias, ref_template=ref_template), default=pydantic_encoder, **dumps_kwargs\n )\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.validate_BaseModel._decompose_class.return.cls___config___getter_dic": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.validate_BaseModel._decompose_class.return.cls___config___getter_dic", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 682, "end_line": 725, "span_ids": ["BaseModel.validate", "BaseModel._decompose_class"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def validate(cls: Type['Model'], value: Any) -> 'Model':\n if isinstance(value, cls):\n copy_on_model_validation = cls.__config__.copy_on_model_validation\n # whether to deep or shallow copy the model on validation, None means do not copy\n deep_copy: Optional[bool] = None\n if copy_on_model_validation not in {'deep', 'shallow', 'none'}:\n # Warn about deprecated behavior\n warnings.warn(\n \"`copy_on_model_validation` should be a string: 'deep', 'shallow' or 'none'\", DeprecationWarning\n )\n if copy_on_model_validation:\n deep_copy = False\n\n if copy_on_model_validation == 'shallow':\n # shallow copy\n deep_copy = False\n elif copy_on_model_validation == 'deep':\n # deep copy\n deep_copy = True\n\n if deep_copy is None:\n return value\n else:\n return value._copy_and_set_values(value.__dict__, value.__fields_set__, deep=deep_copy)\n\n value = cls._enforce_dict_if_root(value)\n\n if isinstance(value, dict):\n return cls(**value)\n elif cls.__config__.orm_mode:\n return cls.from_orm(value)\n else:\n try:\n value_as_dict = dict(value)\n except (TypeError, ValueError) as e:\n raise DictError() from e\n return cls(**value_as_dict)\n\n @classmethod\n def _decompose_class(cls: Type['Model'], obj: Any) -> GetterDict:\n if isinstance(obj, GetterDict):\n return obj\n return cls.__config__.getter_dict(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/v1/main.py_BaseModel._get_value_BaseModel._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/v1/main.py_BaseModel._get_value_BaseModel._get_value.if_isinstance_v_dict_.else_.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 727, "end_line": 799, "span_ids": ["BaseModel._get_value"], "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": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n @no_type_check\n def _get_value(\n cls,\n v: Any,\n to_dict: bool,\n by_alias: bool,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']],\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']],\n exclude_unset: bool,\n exclude_defaults: bool,\n exclude_none: bool,\n ) -> Any:\n if isinstance(v, BaseModel):\n if to_dict:\n v_dict = v.dict(\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 if ROOT_KEY in v_dict:\n return v_dict[ROOT_KEY]\n return v_dict\n else:\n return v.copy(include=include, exclude=exclude)\n\n value_exclude = ValueItems(v, exclude) if exclude else None\n value_include = ValueItems(v, include) if include else None\n\n if isinstance(v, dict):\n return {\n k_: cls._get_value(\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 sequence_like(v):\n seq_args = (\n cls._get_value(\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 is_namedtuple(v.__class__) else v.__class__(seq_args)\n\n elif isinstance(v, Enum) and getattr(cls.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/v1/main.py_BaseModel.__try_update_forward_refs___BaseModel.__iter__.yield_from_self___dict___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel.__try_update_forward_refs___BaseModel.__iter__.yield_from_self___dict___", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 802, "end_line": 821, "span_ids": ["BaseModel.__try_update_forward_refs__", "BaseModel.__iter__", "BaseModel.update_forward_refs"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n @classmethod\n def __try_update_forward_refs__(cls, **localns: Any) -> None:\n \"\"\"\n Same as update_forward_refs but will not raise exception\n when forward references are not defined.\n \"\"\"\n update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,))\n\n @classmethod\n def update_forward_refs(cls, **localns: Any) -> None:\n \"\"\"\n Try to update ForwardRefs on fields based on this Model, globalns and localns.\n \"\"\"\n update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns)\n\n def __iter__(self) -> 'TupleGenerator':\n \"\"\"\n so `dict(model)` works\n \"\"\"\n yield from self.__dict__.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/v1/main.py_BaseModel._iter_BaseModel._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/v1/main.py_BaseModel._iter_BaseModel._iter.for_field_key_v_in_self_.yield_dict_key_v", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 822, "end_line": 876, "span_ids": ["BaseModel._iter"], "tokens": 534}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n def _iter(\n self,\n to_dict: bool = False,\n by_alias: bool = False,\n include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,\n exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = 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 or self.__exclude_fields__ is not None:\n exclude = ValueItems.merge(self.__exclude_fields__, exclude)\n\n if include is not None or self.__include_fields__ is not None:\n include = ValueItems.merge(self.__include_fields__, include, intersect=True)\n\n allowed_keys = self._calculate_keys(\n include=include, exclude=exclude, exclude_unset=exclude_unset # type: ignore\n )\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 = ValueItems(self, exclude) if exclude is not None else None\n value_include = 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 model_field = self.__fields__.get(field_key)\n if not getattr(model_field, 'required', True) and getattr(model_field, 'default', _missing) == v:\n continue\n\n if by_alias and field_key in self.__fields__:\n dict_key = self.__fields__[field_key].alias\n else:\n dict_key = field_key\n\n if to_dict or value_include or value_exclude:\n v = self._get_value(\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/v1/main.py_BaseModel._calculate_keys_BaseModel.__repr_args__.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_BaseModel._calculate_keys_BaseModel.__repr_args__.return._", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 880, "end_line": 918, "span_ids": ["BaseModel._calculate_keys", "BaseModel.__repr_args__", "BaseModel.__eq__"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(Representation, metaclass=ModelMetaclass):\n\n def _calculate_keys(\n self,\n include: Optional['MappingIntStrAny'],\n exclude: Optional['MappingIntStrAny'],\n exclude_unset: bool,\n update: Optional['DictStrAny'] = None,\n ) -> Optional[AbstractSet[str]]:\n if include is None and exclude is None and exclude_unset is False:\n return None\n\n keys: 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 ValueItems.is_true(v)}\n\n return keys\n\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, BaseModel):\n return self.dict() == other.dict()\n else:\n return self.dict() == other\n\n def __repr_args__(self) -> 'ReprArgs':\n return [\n (k, v)\n for k, v in self.__dict__.items()\n if k not in DUNDER_ATTRIBUTES and (k not in self.__fields__ or self.__fields__[k].field_info.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/v1/main.py__is_base_model_class_defined_6_create_model_3._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py__is_base_model_class_defined_6_create_model_3._", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 921, "end_line": 949, "span_ids": ["create_model_3", "create_model", "impl:16"], "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": "_is_base_model_class_defined = True\n\n\n@overload\ndef create_model(\n __model_name: str,\n *,\n __config__: Optional[Type[BaseConfig]] = 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['BaseModel']:\n ...\n\n\n@overload\ndef create_model(\n __model_name: str,\n *,\n __config__: Optional[Type[BaseConfig]] = None,\n __base__: Union[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/v1/main.py_create_model_4_create_model_4.return.meta___model_name_resolv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py_create_model_4_create_model_4.return.meta___model_name_resolv", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 952, "end_line": 1026, "span_ids": ["create_model_4"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_model(\n __model_name: str,\n *,\n __config__: Optional[Type[BaseConfig]] = None,\n __base__: Union[None, Type['Model'], Tuple[Type['Model'], ...]] = None,\n __module__: str = __name__,\n __validators__: Dict[str, 'AnyClassMethod'] = None,\n __cls_kwargs__: Dict[str, Any] = None,\n __slots__: Optional[Tuple[str, ...]] = 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 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 ConfigError('to avoid confusion __config__ and __base__ cannot be used together')\n if not isinstance(__base__, tuple):\n __base__ = (__base__,)\n else:\n __base__ = (cast(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 not is_valid_field(f_name):\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 ConfigError(\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: 'DictStrAny' = {'__annotations__': annotations, '__module__': __module__}\n if __validators__:\n namespace.update(__validators__)\n namespace.update(fields)\n if __config__:\n namespace['Config'] = inherit_config(__config__, BaseConfig)\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, **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/v1/main.py__missing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/main.py__missing_", "embedding": null, "metadata": {"file_path": "pydantic/v1/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1029, "end_line": 1110, "span_ids": ["validate_model", "impl:18"], "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": "_missing = object()\n\n\ndef validate_model( # noqa: C901 (ignore complexity)\n model: Type[BaseModel], input_data: 'DictStrAny', cls: 'ModelOrDc' = None\n) -> Tuple['DictStrAny', 'SetStr', Optional[ValidationError]]:\n \"\"\"\n validate data against a model.\n \"\"\"\n values = {}\n errors = []\n # input_data names, possibly alias\n names_used = set()\n # field names, never aliases\n fields_set = set()\n config = model.__config__\n check_extra = config.extra is not Extra.ignore\n cls_ = cls or model\n\n for validator in model.__pre_root_validators__:\n try:\n input_data = validator(cls_, input_data)\n except (ValueError, TypeError, AssertionError) as exc:\n return {}, set(), ValidationError([ErrorWrapper(exc, loc=ROOT_KEY)], cls_)\n\n for name, field in model.__fields__.items():\n value = input_data.get(field.alias, _missing)\n using_name = False\n if value is _missing and config.allow_population_by_field_name and field.alt_alias:\n value = input_data.get(field.name, _missing)\n using_name = True\n\n if value is _missing:\n if field.required:\n errors.append(ErrorWrapper(MissingError(), loc=field.alias))\n continue\n\n value = field.get_default()\n\n if not config.validate_all and not field.validate_always:\n values[name] = value\n continue\n else:\n fields_set.add(name)\n if check_extra:\n names_used.add(field.name if using_name else field.alias)\n\n v_, errors_ = field.validate(value, values, loc=field.alias, cls=cls_)\n if isinstance(errors_, ErrorWrapper):\n errors.append(errors_)\n elif isinstance(errors_, list):\n errors.extend(errors_)\n else:\n values[name] = v_\n\n if check_extra:\n if isinstance(input_data, GetterDict):\n extra = input_data.extra_keys() - names_used\n else:\n extra = input_data.keys() - names_used\n if extra:\n fields_set |= extra\n if config.extra is Extra.allow:\n for f in extra:\n values[f] = input_data[f]\n else:\n for f in sorted(extra):\n errors.append(ErrorWrapper(ExtraError(), loc=f))\n\n for skip_on_failure, validator in model.__post_root_validators__:\n if skip_on_failure and errors:\n continue\n try:\n values = validator(cls_, values)\n except (ValueError, TypeError, AssertionError) as exc:\n errors.append(ErrorWrapper(exc, loc=ROOT_KEY))\n\n if errors:\n return values, fields_set, ValidationError(errors, cls_)\n else:\n return values, fields_set, 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/v1/mypy.py_sys_plugin.return.PydanticPlugin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_sys_plugin.return.PydanticPlugin", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 104, "span_ids": ["plugin", "imports", "impl:17", "impl:19", "parse_mypy_version"], "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": "import sys\nfrom configparser import ConfigParser\nfrom typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type as TypingType, Union\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 FuncBase,\n FuncDef,\n JsonDict,\n MemberExpr,\n NameExpr,\n PassStmt,\n PlaceholderNode,\n RefExpr,\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 # type: ignore\nfrom mypy.server.trigger import make_wildcard_trigger\nfrom mypy.types import (\n AnyType,\n CallableType,\n Instance,\n NoneType,\n Overloaded,\n ProperType,\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\nfrom .utils import is_valid_field\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.910.\n from mypy.types import TypeVarType as TypeVarDef\n\nCONFIGFILE_KEY = 'pydantic-mypy'\nMETADATA_KEY = 'pydantic-mypy-metadata'\n_NAMESPACE = __name__[:-5] # 'pydantic' in 1.10.X, 'pydantic.v1' in v2.X\nBASEMODEL_FULLNAME = f'{_NAMESPACE}.main.BaseModel'\nBASESETTINGS_FULLNAME = f'{_NAMESPACE}.env_settings.BaseSettings'\nMODEL_METACLASS_FULLNAME = f'{_NAMESPACE}.main.ModelMetaclass'\nFIELD_FULLNAME = f'{_NAMESPACE}.fields.Field'\nDATACLASS_FULLNAME = f'{_NAMESPACE}.dataclasses.dataclass'\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) -> 'TypingType[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/v1/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/v1/mypy.py_PydanticPlugin_PydanticPlugin._pydantic_model_class_maker_callback.transformer_transform_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 154, "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) -> 'Optional[Callable[[ClassDefContext], 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) -> Optional[Callable[[ClassDefContext], 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) -> 'Optional[Callable[[FunctionContext], Type]]':\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) -> Optional[Callable[[MethodContext], Type]]:\n if fullname.endswith('.from_orm'):\n return from_orm_callback\n return None\n\n def get_class_decorator_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], 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/v1/mypy.py_PydanticPlugin._pydantic_model_metaclass_marker_callback_PydanticPlugin._pydantic_model_metaclass_marker_callback.if_getattr_info_metaclass._type_ignore_attr_defin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticPlugin._pydantic_model_metaclass_marker_callback_PydanticPlugin._pydantic_model_metaclass_marker_callback.if_getattr_info_metaclass._type_ignore_attr_defin", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 167, "span_ids": ["PydanticPlugin._pydantic_model_metaclass_marker_callback"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 # type: ignore[attr-defined]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/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/v1/mypy.py_PydanticPlugin._pydantic_field_callback_PydanticPlugin._pydantic_field_callback.return.default_any_type", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 220, "span_ids": ["PydanticPlugin._pydantic_field_callback"], "tokens": 552}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 if MYPY_VERSION_TUPLE > (0, 910):\n default_factory_type = default_factory_type.items[0]\n else:\n # Mypy0.910 exposes the items of overloaded types in a function\n default_factory_type = default_factory_type.items()[0] # type: ignore[operator]\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/v1/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/v1/mypy.py_PydanticPluginConfig_PydanticPluginConfig.to_data.return._key_getattr_self_key_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 257, "span_ids": ["PydanticPluginConfig.__init__", "PydanticPluginConfig", "PydanticPluginConfig.to_data"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticPluginConfig:\n __slots__ = (\n 'init_forbid_extra',\n 'init_typed',\n 'warn_required_dynamic_aliases',\n 'warn_untyped_fields',\n 'debug_dataclass_transform',\n )\n init_forbid_extra: bool\n init_typed: bool\n warn_required_dynamic_aliases: bool\n warn_untyped_fields: 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/v1/mypy.py_from_orm_callback_from_orm_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_from_orm_callback_from_orm_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 282, "span_ids": ["from_orm_callback"], "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 from_orm_callback(ctx: MethodContext) -> Type:\n \"\"\"\n Raise an error if orm_mode 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 orm_mode = pydantic_metadata.get('config', {}).get('orm_mode')\n if orm_mode is not True:\n error_from_orm(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/v1/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/v1/mypy.py_PydanticModelTransformer_PydanticModelTransformer.transform.info_metadata_METADATA_KE", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 285, "end_line": 322, "span_ids": ["PydanticModelTransformer.transform", "PydanticModelTransformer.__init__", "PydanticModelTransformer"], "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 PydanticModelTransformer:\n tracked_config_fields: Set[str] = {\n 'extra',\n 'allow_mutation',\n 'frozen',\n 'orm_mode',\n 'allow_population_by_field_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 allow_mutation = False or 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 = ctx.cls.info\n\n self.adjust_validator_signatures()\n config = self.collect_config()\n fields = self.collect_fields(config)\n is_settings = any(get_fullname(base) == BASESETTINGS_FULLNAME for base in info.mro[:-1])\n self.add_initializer(fields, config, is_settings)\n self.add_construct_method(fields)\n self.set_frozen(fields, frozen=config.allow_mutation is False or 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/v1/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/v1/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/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 325, "end_line": 341, "span_ids": ["PydanticModelTransformer.adjust_validator_signatures"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def adjust_validator_signatures(self) -> None:\n \"\"\"When we decorate a function `f` with `pydantic.validator(...), mypy sees\n `f` as a regular method taking a `self` instance, even though pydantic\n internally wraps `f` with `classmethod` if necessary.\n\n Teach mypy this by marking any function whose outermost decorator is a\n `validator()` 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 == f'{_NAMESPACE}.class_validators.validator'\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/v1/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/v1/mypy.py_PydanticModelTransformer.collect_config_PydanticModelTransformer.collect_config.return.config", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 342, "end_line": 371, "span_ids": ["PydanticModelTransformer.collect_config"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def collect_config(self) -> 'ModelConfigData':\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 for stmt in cls.defs.body:\n if not isinstance(stmt, ClassDef):\n continue\n if stmt.name == 'Config':\n for substmt in stmt.defs.body:\n if not isinstance(substmt, AssignmentStmt):\n continue\n config.update(self.get_config_update(substmt))\n if (\n config.has_alias_generator\n and not config.allow_population_by_field_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/v1/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/v1/mypy.py_PydanticModelTransformer.collect_fields_PydanticModelTransformer.collect_fields.return.all_fields", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 455, "span_ids": ["PydanticModelTransformer.collect_fields"], "tokens": 736}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 = [] # type: List[PydanticModelField]\n known_fields = set() # type: Set[str]\n for stmt in cls.defs.body:\n if not isinstance(stmt, AssignmentStmt): # `and stmt.new_syntax` to require annotation\n continue\n\n lhs = stmt.lvalues[0]\n if not isinstance(lhs, NameExpr) or not is_valid_field(lhs.name):\n continue\n\n if not stmt.new_syntax and self.plugin_config.warn_untyped_fields:\n error_untyped_fields(ctx.api, stmt)\n\n # if lhs.name == '__config__': # BaseConfig not well handled; I'm not sure why yet\n # continue\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 continue\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 continue\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 continue\n\n # x: ClassVar[int] is ignored by dataclasses.\n if node.is_classvar:\n continue\n\n is_required = self.get_is_required(cls, stmt, lhs)\n alias, has_dynamic_alias = self.get_alias_info(stmt)\n if (\n has_dynamic_alias\n and not model_config.allow_population_by_field_name\n and self.plugin_config.warn_required_dynamic_aliases\n ):\n error_required_dynamic_aliases(ctx.api, stmt)\n fields.append(\n 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 )\n )\n known_fields.add(lhs.name)\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/v1/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/v1/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.if___init___not_in_ctx_.add_method_ctx___init__", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 477, "span_ids": ["PydanticModelTransformer.add_initializer"], "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 PydanticModelTransformer:\n\n def add_initializer(self, fields: List['PydanticModelField'], config: 'ModelConfigData', is_settings: bool) -> 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.allow_population_by_field_name is not True\n force_all_optional = is_settings or bool(\n config.has_alias_generator and not config.allow_population_by_field_name\n )\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/v1/mypy.py_PydanticModelTransformer.add_construct_method_PydanticModelTransformer.add_construct_method.add_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.add_construct_method_PydanticModelTransformer.add_construct_method.add_method_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 479, "end_line": 531, "span_ids": ["PydanticModelTransformer.add_construct_method"], "tokens": 531}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def add_construct_method(self, fields: List['PydanticModelField']) -> None:\n \"\"\"\n Adds a fully typed `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 if MYPY_VERSION_TUPLE >= (1, 4):\n tvd = TypeVarType(\n self_tvar_name,\n tvar_fullname,\n -1,\n [],\n obj_type,\n AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]\n )\n self_tvar_expr = TypeVarExpr(\n self_tvar_name,\n tvar_fullname,\n [],\n obj_type,\n AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]\n )\n else:\n tvd = 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 # Backward-compatible with TypeVarDef from Mypy 0.910.\n if isinstance(tvd, TypeVarType):\n self_type = tvd\n else:\n self_type = TypeVarType(tvd)\n\n add_method(\n ctx,\n 'construct',\n construct_arguments,\n return_type=self_type,\n self_type=self_type,\n tvar_def=tvd,\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/v1/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/v1/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/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 547, "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/v1/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/v1/mypy.py_PydanticModelTransformer.get_config_update_PydanticModelTransformer.get_config_update.return.None", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 549, "end_line": 575, "span_ids": ["PydanticModelTransformer.get_config_update"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def get_config_update(self, substmt: AssignmentStmt) -> Optional['ModelConfigData']:\n \"\"\"\n Determines the config update due to a single statement in the Config class 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 lhs = substmt.lvalues[0]\n if not (isinstance(lhs, NameExpr) and lhs.name in self.tracked_config_fields):\n return None\n if lhs.name == 'extra':\n if isinstance(substmt.rvalue, StrExpr):\n forbid_extra = substmt.rvalue.value == 'forbid'\n elif isinstance(substmt.rvalue, MemberExpr):\n forbid_extra = substmt.rvalue.name == 'forbid'\n else:\n error_invalid_config_value(lhs.name, self._ctx.api, substmt)\n return None\n return ModelConfigData(forbid_extra=forbid_extra)\n if lhs.name == 'alias_generator':\n has_alias_generator = True\n if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname == 'builtins.None':\n has_alias_generator = False\n return ModelConfigData(has_alias_generator=has_alias_generator)\n if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname in ('builtins.True', 'builtins.False'):\n return ModelConfigData(**{lhs.name: substmt.rvalue.fullname == 'builtins.True'})\n error_invalid_config_value(lhs.name, self._ctx.api, substmt)\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/v1/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/v1/mypy.py_PydanticModelTransformer.get_is_required_PydanticModelTransformer.get_is_required.return.isinstance_expr_Ellipsis", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 577, "end_line": 601, "span_ids": ["PydanticModelTransformer.get_is_required"], "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 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 return not PydanticModelTransformer.type_has_implicit_default(value_type)\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 positional argument.\n if name is None or name == 'default':\n return arg.__class__ is EllipsisExpr\n if name == 'default_factory':\n return False\n # In this case, default and default_factory are not specified, so we need to look at the annotation\n value_type = get_proper_type(cls.info[lhs.name].type)\n return not PydanticModelTransformer.type_has_implicit_default(value_type)\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/v1/mypy.py_PydanticModelTransformer.type_has_implicit_default_PydanticModelTransformer.type_has_implicit_default.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_PydanticModelTransformer.type_has_implicit_default_PydanticModelTransformer.type_has_implicit_default.return.False", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 603, "end_line": 618, "span_ids": ["PydanticModelTransformer.type_has_implicit_default"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n @staticmethod\n def type_has_implicit_default(type_: Optional[ProperType]) -> bool:\n \"\"\"\n Returns True if the passed type will be given an implicit default value.\n\n In pydantic v1, this is the case for Optional types and Any (with default value None).\n \"\"\"\n if isinstance(type_, AnyType):\n # Annotated as Any\n return True\n if isinstance(type_, UnionType) and any(\n isinstance(item, NoneType) or isinstance(item, AnyType) for item in type_.items\n ):\n # Annotated as Optional, or otherwise having NoneType or AnyType in the union\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/v1/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/v1/mypy.py_PydanticModelTransformer.get_alias_info_PydanticModelTransformer.get_alias_info.return.None_False", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 620, "end_line": 647, "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[Optional[str], 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/v1/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/v1/mypy.py_PydanticModelTransformer.get_field_arguments_PydanticModelTransformer.get_field_arguments.return.arguments", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 649, "end_line": 663, "span_ids": ["PydanticModelTransformer.get_field_arguments"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 `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/v1/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/v1/mypy.py_PydanticModelTransformer.should_init_forbid_extra_PydanticModelTransformer.is_dynamic_alias_present.return.False", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 665, "end_line": 692, "span_ids": ["PydanticModelTransformer.should_init_forbid_extra", "PydanticModelTransformer.is_dynamic_alias_present"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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.allow_population_by_field_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/v1/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/v1/mypy.py_PydanticModelField_PydanticModelField.to_var.return.Var_name_info_self_name_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 695, "end_line": 710, "span_ids": ["PydanticModelField", "PydanticModelField.to_var", "PydanticModelField.__init__"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelField:\n def __init__(\n self, name: str, is_required: bool, alias: Optional[str], 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/v1/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/v1/mypy.py_PydanticModelField.to_argument_PydanticModelField.deserialize.return.cls_data_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 712, "end_line": 729, "span_ids": ["PydanticModelField.deserialize", "PydanticModelField.serialize", "PydanticModelField.to_argument"], "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 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/v1/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/v1/mypy.py_ModelConfigData_ModelConfigData.setdefault.if_getattr_self_key_is_.setattr_self_key_value_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 732, "end_line": 760, "span_ids": ["ModelConfigData", "ModelConfigData.update", "ModelConfigData.__init__", "ModelConfigData.setdefault", "ModelConfigData.set_values_dict"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelConfigData:\n def __init__(\n self,\n forbid_extra: Optional[bool] = None,\n allow_mutation: Optional[bool] = None,\n frozen: Optional[bool] = None,\n orm_mode: Optional[bool] = None,\n allow_population_by_field_name: Optional[bool] = None,\n has_alias_generator: Optional[bool] = None,\n ):\n self.forbid_extra = forbid_extra\n self.allow_mutation = allow_mutation\n self.frozen = frozen\n self.orm_mode = orm_mode\n self.allow_population_by_field_name = allow_population_by_field_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: Optional['ModelConfigData']) -> 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/v1/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/v1/mypy.py_ERROR_ORM_error_required_dynamic_aliases.api_fail_Required_dynami", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 781, "end_line": 798, "span_ids": ["error_from_orm", "error_invalid_config_value", "impl:25", "error_required_dynamic_aliases"], "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": "ERROR_ORM = ErrorCode('pydantic-orm', 'Invalid from_orm 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_orm(model_name: str, api: CheckerPluginInterface, context: Context) -> None:\n api.fail(f'\"{model_name}\" does not have orm_mode=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/v1/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/v1/mypy.py_error_unexpected_behavior_error_default_and_default_factory_specified.api_fail_Field_default_a", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 783, "end_line": 798, "span_ids": ["error_default_and_default_factory_specified", "error_unexpected_behavior", "error_untyped_fields"], "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 error_unexpected_behavior(\n detail: str, api: Union[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/v1/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/v1/mypy.py_add_method_add_method.info_defn_defs_body_appen", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 801, "end_line": 881, "span_ids": ["add_method"], "tokens": 720}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_method(\n ctx: ClassDefContext,\n name: str,\n args: List[Argument],\n return_type: Type,\n self_type: Optional[Type] = None,\n tvar_def: Optional[TypeVarDef] = None,\n 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/v1/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/v1/mypy.py_get_fullname_get_name.return.fn", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 884, "end_line": 901, "span_ids": ["get_fullname", "get_name"], "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 get_fullname(x: Union[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: Union[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/v1/mypy.py_parse_toml_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/mypy.py_parse_toml_", "embedding": null, "metadata": {"file_path": "pydantic/v1/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 904, "end_line": 927, "span_ids": ["parse_toml"], "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 parse_toml(config_file: str) -> Optional[Dict[str, Any]]:\n if not config_file.endswith('.toml'):\n return None\n\n read_mode = 'rb'\n if sys.version_info >= (3, 11):\n import tomllib as toml_\n else:\n try:\n import tomli as toml_\n except ImportError:\n # older versions of mypy have toml as a dependency, not tomli\n read_mode = 'r'\n try:\n import toml as toml_ # type: ignore[no-redef]\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, read_mode) as rf:\n return toml_.load(rf) # type: ignore[arg-type]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_re__fragment_regex.r_P_fragment_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_re__fragment_regex.r_P_fragment_s_", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 110, "span_ids": ["imports", "impl:23"], "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": "import re\nfrom ipaddress import (\n IPv4Address,\n IPv4Interface,\n IPv4Network,\n IPv6Address,\n IPv6Interface,\n IPv6Network,\n _BaseAddress,\n _BaseNetwork,\n)\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Collection,\n Dict,\n Generator,\n List,\n Match,\n Optional,\n Pattern,\n Set,\n Tuple,\n Type,\n Union,\n cast,\n no_type_check,\n)\n\nfrom . import errors\nfrom .utils import Representation, update_not_none\nfrom .validators import constr_length_validator, str_validator\n\nif TYPE_CHECKING:\n import email_validator\n from typing_extensions import TypedDict\n\n from .config import BaseConfig\n from .fields import ModelField\n from .typing import AnyCallable\n\n CallableGenerator = Generator[AnyCallable, None, None]\n\n class Parts(TypedDict, total=False):\n scheme: str\n user: Optional[str]\n password: Optional[str]\n ipv4: Optional[str]\n ipv6: Optional[str]\n domain: Optional[str]\n port: Optional[str]\n path: Optional[str]\n query: Optional[str]\n fragment: Optional[str]\n\n class HostParts(TypedDict, total=False):\n host: str\n tld: Optional[str]\n host_type: Optional[str]\n port: Optional[str]\n rebuild: bool\n\nelse:\n email_validator = None\n\n class Parts(dict):\n pass\n\n\nNetworkType = Union[str, bytes, int, Tuple[Union[str, bytes, int], Union[str, int]]]\n\n__all__ = [\n 'AnyUrl',\n 'AnyHttpUrl',\n 'FileUrl',\n 'HttpUrl',\n 'stricturl',\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]\n\n_url_regex_cache = None\n_multi_host_url_regex_cache = None\n_ascii_domain_regex_cache = None\n_int_domain_regex_cache = None\n_host_regex_cache = None\n\n_host_regex = (\n r'(?:'\n r'(?P(?:\\d{1,3}\\.){3}\\d{1,3})(?=$|[/:#?])|' # ipv4\n r'(?P\\[[A-F0-9]*:[A-F0-9:]+\\])(?=$|[/:#?])|' # ipv6\n r'(?P[^\\s/:?#]+)' # domain, validation occurs later\n r')?'\n r'(?::(?P\\d+))?' # port\n)\n_scheme_regex = r'(?:(?P[a-z][a-z0-9+\\-.]+)://)?' # scheme https://tools.ietf.org/html/rfc3986#appendix-A\n_user_info_regex = r'(?:(?P[^\\s:/]*)(?::(?P[^\\s/]*))?@)?'\n_path_regex = r'(?P/[^\\s?#]*)?'\n_query_regex = r'(?:\\?(?P[^\\s#]*))?'\n_fragment_regex = r'(?:#(?P[^\\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/v1/networks.py_url_regex_multi_host_url_regex.return._multi_host_url_regex_cac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_url_regex_multi_host_url_regex.return._multi_host_url_regex_cac", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 138, "span_ids": ["multi_host_url_regex", "url_regex"], "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 url_regex() -> Pattern[str]:\n global _url_regex_cache\n if _url_regex_cache is None:\n _url_regex_cache = re.compile(\n rf'{_scheme_regex}{_user_info_regex}{_host_regex}{_path_regex}{_query_regex}{_fragment_regex}',\n re.IGNORECASE,\n )\n return _url_regex_cache\n\n\ndef multi_host_url_regex() -> Pattern[str]:\n \"\"\"\n Compiled multi host url regex.\n\n Additionally to `url_regex` it allows to match multiple hosts.\n E.g. host1.db.net,host2.db.net\n \"\"\"\n global _multi_host_url_regex_cache\n if _multi_host_url_regex_cache is None:\n _multi_host_url_regex_cache = re.compile(\n rf'{_scheme_regex}{_user_info_regex}'\n r'(?P([^/]*))' # validation occurs later\n rf'{_path_regex}{_query_regex}{_fragment_regex}',\n re.IGNORECASE,\n )\n return _multi_host_url_regex_cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_ascii_domain_regex_ascii_domain_regex.return._ascii_domain_regex_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_ascii_domain_regex_ascii_domain_regex.return._ascii_domain_regex_cache", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 149, "span_ids": ["ascii_domain_regex"], "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 ascii_domain_regex() -> Pattern[str]:\n global _ascii_domain_regex_cache\n if _ascii_domain_regex_cache is None:\n ascii_chunk = r'[_0-9a-z](?:[-_0-9a-z]{0,61}[_0-9a-z])?'\n ascii_domain_ending = r'(?P\\.[a-z]{2,63})?\\.?'\n _ascii_domain_regex_cache = re.compile(\n fr'(?:{ascii_chunk}\\.)*?{ascii_chunk}{ascii_domain_ending}', re.IGNORECASE\n )\n return _ascii_domain_regex_cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_int_domain_regex_host_regex.return._host_regex_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_int_domain_regex_host_regex.return._host_regex_cache", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 168, "span_ids": ["int_domain_regex", "host_regex"], "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 int_domain_regex() -> Pattern[str]:\n global _int_domain_regex_cache\n if _int_domain_regex_cache is None:\n int_chunk = r'[_0-9a-\\U00040000](?:[-_0-9a-\\U00040000]{0,61}[_0-9a-\\U00040000])?'\n int_domain_ending = r'(?P(\\.[^\\W\\d_]{2,63})|(\\.(?:xn--)[_0-9a-z-]{2,63}))?\\.?'\n _int_domain_regex_cache = re.compile(fr'(?:{int_chunk}\\.)*?{int_chunk}{int_domain_ending}', re.IGNORECASE)\n return _int_domain_regex_cache\n\n\ndef host_regex() -> Pattern[str]:\n global _host_regex_cache\n if _host_regex_cache is None:\n _host_regex_cache = re.compile(\n _host_regex,\n re.IGNORECASE,\n )\n return _host_regex_cache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl_AnyUrl.__init__.self.fragment.fragment": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl_AnyUrl.__init__.self.fragment.fragment", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 212, "span_ids": ["AnyUrl", "AnyUrl.__init__", "AnyUrl.__new__"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyUrl(str):\n strip_whitespace = True\n min_length = 1\n max_length = 2**16\n allowed_schemes: Optional[Collection[str]] = None\n tld_required: bool = False\n user_required: bool = False\n host_required: bool = True\n hidden_parts: Set[str] = set()\n\n __slots__ = ('scheme', 'user', 'password', 'host', 'tld', 'host_type', 'port', 'path', 'query', 'fragment')\n\n @no_type_check\n def __new__(cls, url: Optional[str], **kwargs) -> object:\n return str.__new__(cls, cls.build(**kwargs) if url is None else url)\n\n def __init__(\n self,\n url: str,\n *,\n scheme: str,\n user: Optional[str] = None,\n password: Optional[str] = None,\n host: Optional[str] = None,\n tld: Optional[str] = None,\n host_type: str = 'domain',\n port: Optional[str] = None,\n path: Optional[str] = None,\n query: Optional[str] = None,\n fragment: Optional[str] = None,\n ) -> None:\n str.__init__(url)\n self.scheme = scheme\n self.user = user\n self.password = password\n self.host = host\n self.tld = tld\n self.host_type = host_type\n self.port = port\n self.path = path\n self.query = query\n self.fragment = fragment", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.build_AnyUrl.build.return.url": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.build_AnyUrl.build.return.url", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 256, "span_ids": ["AnyUrl.build"], "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 AnyUrl(str):\n\n @classmethod\n def build(\n cls,\n *,\n scheme: str,\n user: Optional[str] = None,\n password: Optional[str] = None,\n host: str,\n port: Optional[str] = None,\n path: Optional[str] = None,\n query: Optional[str] = None,\n fragment: Optional[str] = None,\n **_kwargs: str,\n ) -> str:\n parts = Parts(\n scheme=scheme,\n user=user,\n password=password,\n host=host,\n port=port,\n path=path,\n query=query,\n fragment=fragment,\n **_kwargs, # type: ignore[misc]\n )\n\n url = scheme + '://'\n if user:\n url += user\n if password:\n url += ':' + password\n if user or password:\n url += '@'\n url += host\n if port and ('port' not in cls.hidden_parts or cls.get_default_parts(parts).get('port') != port):\n url += ':' + port\n if path:\n url += path\n if query:\n url += '?' + query\n if fragment:\n url += '#' + fragment\n return url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.__modify_schema___AnyUrl.validate.return.cls__build_url_m_url_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.__modify_schema___AnyUrl.validate.return.cls__build_url_m_url_pa", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 286, "span_ids": ["AnyUrl.validate", "AnyUrl.__get_validators__", "AnyUrl.__modify_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 AnyUrl(str):\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(field_schema, minLength=cls.min_length, maxLength=cls.max_length, format='uri')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Any, field: 'ModelField', config: 'BaseConfig') -> 'AnyUrl':\n if value.__class__ == cls:\n return value\n value = str_validator(value)\n if cls.strip_whitespace:\n value = value.strip()\n url: str = cast(str, constr_length_validator(value, field, config))\n\n m = cls._match_url(url)\n # the regex should always match, if it doesn't please report with details of the URL tried\n assert m, 'URL regex failed unexpectedly'\n\n original_parts = cast('Parts', m.groupdict())\n parts = cls.apply_default_parts(original_parts)\n parts = cls.validate_parts(parts)\n\n if m.end() != len(url):\n raise errors.UrlExtraError(extra=url[m.end() :])\n\n return cls._build_url(m, url, parts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl._build_url_AnyUrl._build_url.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl._build_url_AnyUrl._build_url.return.cls_", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 308, "span_ids": ["AnyUrl._build_url"], "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 AnyUrl(str):\n\n @classmethod\n def _build_url(cls, m: Match[str], url: str, parts: 'Parts') -> 'AnyUrl':\n \"\"\"\n Validate hosts and build the AnyUrl object. Split from `validate` so this method\n can be altered in `MultiHostDsn`.\n \"\"\"\n host, tld, host_type, rebuild = cls.validate_host(parts)\n\n return cls(\n None if rebuild else url,\n scheme=parts['scheme'],\n user=parts['user'],\n password=parts['password'],\n host=host,\n tld=tld,\n host_type=host_type,\n port=parts['port'],\n path=parts['path'],\n query=parts['query'],\n fragment=parts['fragment'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl._match_url_AnyUrl.validate_parts.return.parts": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl._match_url_AnyUrl.validate_parts.return.parts", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 339, "span_ids": ["AnyUrl.validate_parts", "AnyUrl._match_url", "AnyUrl._validate_port"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyUrl(str):\n\n @staticmethod\n def _match_url(url: str) -> Optional[Match[str]]:\n return url_regex().match(url)\n\n @staticmethod\n def _validate_port(port: Optional[str]) -> None:\n if port is not None and int(port) > 65_535:\n raise errors.UrlPortError()\n\n @classmethod\n def validate_parts(cls, parts: 'Parts', validate_port: bool = True) -> 'Parts':\n \"\"\"\n A method used to validate parts of a URL.\n Could be overridden to set default values for parts if missing\n \"\"\"\n scheme = parts['scheme']\n if scheme is None:\n raise errors.UrlSchemeError()\n\n if cls.allowed_schemes and scheme.lower() not in cls.allowed_schemes:\n raise errors.UrlSchemePermittedError(set(cls.allowed_schemes))\n\n if validate_port:\n cls._validate_port(parts['port'])\n\n user = parts['user']\n if cls.user_required and user is None:\n raise errors.UrlUserInfoError()\n\n return parts", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.validate_host_AnyUrl.validate_host._type_ignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.validate_host_AnyUrl.validate_host._type_ignore", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 341, "end_line": 381, "span_ids": ["AnyUrl.validate_host"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyUrl(str):\n\n @classmethod\n def validate_host(cls, parts: 'Parts') -> Tuple[str, Optional[str], str, bool]:\n tld, host_type, rebuild = None, None, False\n for f in ('domain', 'ipv4', 'ipv6'):\n host = parts[f] # type: ignore[literal-required]\n if host:\n host_type = f\n break\n\n if host is None:\n if cls.host_required:\n raise errors.UrlHostError()\n elif host_type == 'domain':\n is_international = False\n d = ascii_domain_regex().fullmatch(host)\n if d is None:\n d = int_domain_regex().fullmatch(host)\n if d is None:\n raise errors.UrlHostError()\n is_international = True\n\n tld = d.group('tld')\n if tld is None and not is_international:\n d = int_domain_regex().fullmatch(host)\n assert d is not None\n tld = d.group('tld')\n is_international = True\n\n if tld is not None:\n tld = tld[1:]\n elif cls.tld_required:\n raise errors.UrlHostTldError()\n\n if is_international:\n host_type = 'int_domain'\n rebuild = True\n host = host.encode('idna').decode('ascii')\n if tld is not None:\n tld = tld.encode('idna').decode('ascii')\n\n return host, tld, host_type, rebuild # 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/v1/networks.py_AnyUrl.get_default_parts_AnyUrl.__repr__.return.f_self___class_____name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyUrl.get_default_parts_AnyUrl.__repr__.return.f_self___class_____name_", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 396, "span_ids": ["AnyUrl.get_default_parts", "AnyUrl.apply_default_parts", "AnyUrl.__repr__"], "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 AnyUrl(str):\n\n @staticmethod\n def get_default_parts(parts: 'Parts') -> 'Parts':\n return {}\n\n @classmethod\n def apply_default_parts(cls, parts: 'Parts') -> 'Parts':\n for key, value in cls.get_default_parts(parts).items():\n if not parts[key]: # type: ignore[literal-required]\n parts[key] = value # type: ignore[literal-required]\n return parts\n\n def __repr__(self) -> str:\n extra = ', '.join(f'{n}={getattr(self, n)!r}' for n in self.__slots__ if getattr(self, n) is not None)\n return f'{self.__class__.__name__}({super().__repr__()}, {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/pydantic/v1/networks.py_AnyHttpUrl_FileUrl.__slots__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_AnyHttpUrl_FileUrl.__slots__._", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 420, "span_ids": ["AnyHttpUrl", "HttpUrl", "HttpUrl.get_default_parts", "FileUrl"], "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 AnyHttpUrl(AnyUrl):\n allowed_schemes = {'http', 'https'}\n\n __slots__ = ()\n\n\nclass HttpUrl(AnyHttpUrl):\n tld_required = True\n # https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers\n max_length = 2083\n hidden_parts = {'port'}\n\n @staticmethod\n def get_default_parts(parts: 'Parts') -> 'Parts':\n return {'port': '80' if parts['scheme'] == 'http' else '443'}\n\n\nclass FileUrl(AnyUrl):\n allowed_schemes = {'file'}\n host_required = False\n\n __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/v1/networks.py_MultiHostDsn_MultiHostDsn.validate_parts.return.super_validate_parts_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_MultiHostDsn_MultiHostDsn.validate_parts.return.super_validate_parts_pa", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 423, "end_line": 436, "span_ids": ["MultiHostDsn._match_url", "MultiHostDsn.validate_parts", "MultiHostDsn.__init__", "MultiHostDsn"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MultiHostDsn(AnyUrl):\n __slots__ = AnyUrl.__slots__ + ('hosts',)\n\n def __init__(self, *args: Any, hosts: Optional[List['HostParts']] = None, **kwargs: Any):\n super().__init__(*args, **kwargs)\n self.hosts = hosts\n\n @staticmethod\n def _match_url(url: str) -> Optional[Match[str]]:\n return multi_host_url_regex().match(url)\n\n @classmethod\n def validate_parts(cls, parts: 'Parts', validate_port: bool = True) -> 'Parts':\n return super().validate_parts(parts, validate_port=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/v1/networks.py_MultiHostDsn._build_url_MultiHostDsn._build_url.if_len_hosts_parts_1_.else_.return.cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_MultiHostDsn._build_url_MultiHostDsn._build_url.if_len_hosts_parts_1_.else_.return.cls_", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 438, "end_line": 484, "span_ids": ["MultiHostDsn._build_url"], "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 MultiHostDsn(AnyUrl):\n\n @classmethod\n def _build_url(cls, m: Match[str], url: str, parts: 'Parts') -> 'MultiHostDsn':\n hosts_parts: List['HostParts'] = []\n host_re = host_regex()\n for host in m.groupdict()['hosts'].split(','):\n d: Parts = host_re.match(host).groupdict() # type: ignore\n host, tld, host_type, rebuild = cls.validate_host(d)\n port = d.get('port')\n cls._validate_port(port)\n hosts_parts.append(\n {\n 'host': host,\n 'host_type': host_type,\n 'tld': tld,\n 'rebuild': rebuild,\n 'port': port,\n }\n )\n\n if len(hosts_parts) > 1:\n return cls(\n None if any([hp['rebuild'] for hp in hosts_parts]) else url,\n scheme=parts['scheme'],\n user=parts['user'],\n password=parts['password'],\n path=parts['path'],\n query=parts['query'],\n fragment=parts['fragment'],\n host_type=None,\n hosts=hosts_parts,\n )\n else:\n # backwards compatibility with single host\n host_part = hosts_parts[0]\n return cls(\n None if host_part['rebuild'] else url,\n scheme=parts['scheme'],\n user=parts['user'],\n password=parts['password'],\n host=host_part['host'],\n tld=host_part['tld'],\n host_type=host_part['host_type'],\n port=host_part.get('port'),\n path=parts['path'],\n query=parts['query'],\n fragment=parts['fragment'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_PostgresDsn_KafkaDsn.get_default_parts.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_PostgresDsn_KafkaDsn.get_default_parts.return._", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 487, "end_line": 551, "span_ids": ["AmqpDsn", "RedisDsn.get_default_parts", "KafkaDsn.get_default_parts", "RedisDsn", "CockroachDsn", "KafkaDsn", "PostgresDsn", "MongoDsn", "MongoDsn.get_default_parts"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PostgresDsn(MultiHostDsn):\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 user_required = True\n\n __slots__ = ()\n\n\nclass CockroachDsn(AnyUrl):\n allowed_schemes = {\n 'cockroachdb',\n 'cockroachdb+psycopg2',\n 'cockroachdb+asyncpg',\n }\n user_required = True\n\n\nclass AmqpDsn(AnyUrl):\n allowed_schemes = {'amqp', 'amqps'}\n host_required = False\n\n\nclass RedisDsn(AnyUrl):\n __slots__ = ()\n allowed_schemes = {'redis', 'rediss'}\n host_required = False\n\n @staticmethod\n def get_default_parts(parts: 'Parts') -> 'Parts':\n return {\n 'domain': 'localhost' if not (parts['ipv4'] or parts['ipv6']) else '',\n 'port': '6379',\n 'path': '/0',\n }\n\n\nclass MongoDsn(AnyUrl):\n allowed_schemes = {'mongodb'}\n\n # TODO: Needed to generic \"Parts\" for \"Replica Set\", \"Sharded Cluster\", and other mongodb deployment modes\n @staticmethod\n def get_default_parts(parts: 'Parts') -> 'Parts':\n return {\n 'port': '27017',\n }\n\n\nclass KafkaDsn(AnyUrl):\n allowed_schemes = {'kafka'}\n\n @staticmethod\n def get_default_parts(parts: 'Parts') -> 'Parts':\n return {\n 'domain': 'localhost',\n 'port': '9092',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_stricturl_stricturl.return.type_UrlValue_AnyUrl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_stricturl_stricturl.return.type_UrlValue_AnyUrl_", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 554, "end_line": 572, "span_ids": ["stricturl"], "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 stricturl(\n *,\n strip_whitespace: bool = True,\n min_length: int = 1,\n max_length: int = 2**16,\n tld_required: bool = True,\n host_required: bool = True,\n allowed_schemes: Optional[Collection[str]] = None,\n) -> Type[AnyUrl]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(\n strip_whitespace=strip_whitespace,\n min_length=min_length,\n max_length=max_length,\n tld_required=tld_required,\n host_required=host_required,\n allowed_schemes=allowed_schemes,\n )\n return type('UrlValue', (AnyUrl,), namespace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_import_email_validator_EmailStr.validate.return.validate_email_value_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_import_email_validator_EmailStr.validate.return.validate_email_value_1_", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 575, "end_line": 598, "span_ids": ["EmailStr.__modify_schema__", "EmailStr", "EmailStr.validate", "EmailStr.__get_validators__", "import_email_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 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\nclass EmailStr(str):\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format='email')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n # included here and below so the error happens straight away\n import_email_validator()\n\n yield str_validator\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Union[str]) -> str:\n return validate_email(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/v1/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/v1/networks.py_NameEmail_NameEmail.__str__.return.f_self_name_self_emai", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 601, "end_line": 629, "span_ids": ["NameEmail.__str__", "NameEmail", "NameEmail.__modify_schema__", "NameEmail.__eq__", "NameEmail.validate", "NameEmail.__get_validators__", "NameEmail.__init__"], "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 NameEmail(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 __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format='name-email')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n import_email_validator()\n\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Any) -> 'NameEmail':\n if value.__class__ == cls:\n return value\n value = str_validator(value)\n return cls(*validate_email(value))\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/v1/networks.py_IPvAnyAddress_IPvAnyAddress.validate.None_1.except_ValueError_.raise_errors_IPvAnyAddres": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyAddress_IPvAnyAddress.validate.None_1.except_ValueError_.raise_errors_IPvAnyAddres", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 632, "end_line": 653, "span_ids": ["IPvAnyAddress", "IPvAnyAddress.__modify_schema__", "IPvAnyAddress.validate", "IPvAnyAddress.__get_validators__"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPvAnyAddress(_BaseAddress):\n __slots__ = ()\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format='ipvanyaddress')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Union[str, bytes, int]) -> Union[IPv4Address, IPv6Address]:\n try:\n return IPv4Address(value)\n except ValueError:\n pass\n\n try:\n return IPv6Address(value)\n except ValueError:\n raise errors.IPvAnyAddressError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyInterface_IPvAnyInterface.validate.None_1.except_ValueError_.raise_errors_IPvAnyInterf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyInterface_IPvAnyInterface.validate.None_1.except_ValueError_.raise_errors_IPvAnyInterf", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 656, "end_line": 677, "span_ids": ["IPvAnyInterface.validate", "IPvAnyInterface.__modify_schema__", "IPvAnyInterface", "IPvAnyInterface.__get_validators__"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPvAnyInterface(_BaseAddress):\n __slots__ = ()\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format='ipvanyinterface')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, value: NetworkType) -> Union[IPv4Interface, IPv6Interface]:\n try:\n return IPv4Interface(value)\n except ValueError:\n pass\n\n try:\n return IPv6Interface(value)\n except ValueError:\n raise errors.IPvAnyInterfaceError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/parse.py_json_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/v1/parse.py_json_load_str_bytes.if_proto_Protocol_json.else_.raise_TypeError_f_Unknown", "embedding": null, "metadata": {"file_path": "pydantic/v1/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": 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": "import json\nimport pickle\nfrom enum import Enum\nfrom pathlib import Path\nfrom typing import Any, Callable, Union\n\nfrom .types import StrBytes\n\n\nclass Protocol(str, Enum):\n json = 'json'\n pickle = 'pickle'\n\n\ndef load_str_bytes(\n b: StrBytes,\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/v1/parse.py_load_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/parse.py_load_file_", "embedding": null, "metadata": {"file_path": "pydantic/v1/parse.py", "file_name": "parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 67, "span_ids": ["load_file"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_file(\n path: Union[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/v1/schema.py_re__apply_modify_schema.if_field_in_args_or_kw.else_.modify_schema_field_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_re__apply_modify_schema.if_field_in_args_or_kw.else_.modify_schema_field_schem", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["imports", "_apply_modify_schema"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nimport warnings\nfrom collections import defaultdict\nfrom dataclasses import is_dataclass\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 Path\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n ForwardRef,\n FrozenSet,\n Generic,\n Iterable,\n List,\n Optional,\n Pattern,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n)\nfrom uuid import UUID\n\nfrom typing_extensions import Annotated, Literal\n\nfrom .fields import (\n MAPPING_LIKE_SHAPES,\n SHAPE_DEQUE,\n SHAPE_FROZENSET,\n SHAPE_GENERIC,\n SHAPE_ITERABLE,\n SHAPE_LIST,\n SHAPE_SEQUENCE,\n SHAPE_SET,\n SHAPE_SINGLETON,\n SHAPE_TUPLE,\n SHAPE_TUPLE_ELLIPSIS,\n FieldInfo,\n ModelField,\n)\nfrom .json import pydantic_encoder\nfrom .networks import AnyUrl, EmailStr\nfrom .types import (\n ConstrainedDecimal,\n ConstrainedFloat,\n ConstrainedFrozenSet,\n ConstrainedInt,\n ConstrainedList,\n ConstrainedSet,\n ConstrainedStr,\n SecretBytes,\n SecretStr,\n StrictBytes,\n StrictStr,\n conbytes,\n condecimal,\n confloat,\n confrozenset,\n conint,\n conlist,\n conset,\n constr,\n)\nfrom .typing import (\n all_literal_values,\n get_args,\n get_origin,\n get_sub_types,\n is_callable_type,\n is_literal_type,\n is_namedtuple,\n is_none_type,\n is_union,\n)\nfrom .utils import ROOT_KEY, get_model, lenient_issubclass\n\nif TYPE_CHECKING:\n from .dataclasses import Dataclass\n from .main import BaseModel\n\ndefault_prefix = '#/definitions/'\ndefault_ref_template = '#/definitions/{model}'\n\nTypeModelOrEnum = Union[Type['BaseModel'], Type[Enum]]\nTypeModelSet = Set[TypeModelOrEnum]\n\n\ndef _apply_modify_schema(\n modify_schema: Callable[..., None], field: Optional[ModelField], field_schema: Dict[str, Any]\n) -> None:\n from inspect import signature\n\n sig = signature(modify_schema)\n args = set(sig.parameters.keys())\n if 'field' in args or 'kwargs' in args:\n modify_schema(field_schema, field=field)\n else:\n modify_schema(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/pydantic/v1/schema.py_schema_schema.return.output_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_schema_schema.return.output_schema", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 159, "span_ids": ["schema"], "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": "def schema(\n models: Sequence[Union[Type['BaseModel'], Type['Dataclass']]],\n *,\n by_alias: bool = True,\n title: Optional[str] = None,\n description: Optional[str] = None,\n ref_prefix: Optional[str] = None,\n ref_template: str = default_ref_template,\n) -> Dict[str, Any]:\n \"\"\"\n Process a list of models and generate a single JSON Schema with all of them defined in the ``definitions``\n top-level JSON key, including their sub-models.\n\n :param models: a list of models to include in the generated JSON Schema\n :param by_alias: generate the schemas using the aliases defined, if any\n :param title: title for the generated schema that includes the definitions\n :param description: description for the generated schema\n :param ref_prefix: the JSON Pointer prefix for schema references with ``$ref``, if None, will be set to the\n default of ``#/definitions/``. Update it if you want the schemas to reference the definitions somewhere\n else, e.g. for OpenAPI use ``#/components/schemas/``. The resulting generated schemas will still be at the\n top-level key ``definitions``, so you can extract them from there. But all the references will have the set\n prefix.\n :param ref_template: Use a ``string.format()`` template for ``$ref`` instead of a prefix. This can be useful\n for references that cannot be represented by ``ref_prefix`` such as a definition stored in another file. For\n a sibling json file in a ``/schemas`` directory use ``\"/schemas/${model}.json#\"``.\n :return: dict with the JSON Schema with a ``definitions`` top-level key including the schema definitions for\n the models and sub-models passed in ``models``.\n \"\"\"\n clean_models = [get_model(model) for model in models]\n flat_models = get_flat_models_from_models(clean_models)\n model_name_map = get_model_name_map(flat_models)\n definitions = {}\n output_schema: Dict[str, Any] = {}\n if title:\n output_schema['title'] = title\n if description:\n output_schema['description'] = description\n for model in clean_models:\n m_schema, m_definitions, m_nested_models = model_process_schema(\n model,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n )\n definitions.update(m_definitions)\n model_name = model_name_map[model]\n definitions[model_name] = m_schema\n if definitions:\n output_schema['definitions'] = definitions\n return output_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/v1/schema.py_model_schema_model_schema.return.m_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_model_schema_model_schema.return.m_schema", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 197, "span_ids": ["model_schema"], "tokens": 468}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_schema(\n model: Union[Type['BaseModel'], Type['Dataclass']],\n by_alias: bool = True,\n ref_prefix: Optional[str] = None,\n ref_template: str = default_ref_template,\n) -> Dict[str, Any]:\n \"\"\"\n Generate a JSON Schema for one model. With all the sub-models defined in the ``definitions`` top-level\n JSON key.\n\n :param model: a Pydantic model (a class that inherits from BaseModel)\n :param by_alias: generate the schemas using the aliases defined, if any\n :param ref_prefix: the JSON Pointer prefix for schema references with ``$ref``, if None, will be set to the\n default of ``#/definitions/``. Update it if you want the schemas to reference the definitions somewhere\n else, e.g. for OpenAPI use ``#/components/schemas/``. The resulting generated schemas will still be at the\n top-level key ``definitions``, so you can extract them from there. But all the references will have the set\n prefix.\n :param ref_template: Use a ``string.format()`` template for ``$ref`` instead of a prefix. This can be useful for\n references that cannot be represented by ``ref_prefix`` such as a definition stored in another file. For a\n sibling json file in a ``/schemas`` directory use ``\"/schemas/${model}.json#\"``.\n :return: dict with the JSON Schema for the passed ``model``\n \"\"\"\n model = get_model(model)\n flat_models = get_flat_models_from_model(model)\n model_name_map = get_model_name_map(flat_models)\n model_name = model_name_map[model]\n m_schema, m_definitions, nested_models = model_process_schema(\n model, by_alias=by_alias, model_name_map=model_name_map, ref_prefix=ref_prefix, ref_template=ref_template\n )\n if model_name in nested_models:\n # model_name is in Nested models, it has circular references\n m_definitions[model_name] = m_schema\n m_schema = get_schema_ref(model_name, ref_prefix, ref_template, False)\n if m_definitions:\n m_schema.update({'definitions': m_definitions})\n return m_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/v1/schema.py_get_field_info_schema_get_field_info_schema.return.schema__schema_overrides": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_field_info_schema_get_field_info_schema.return.schema__schema_overrides", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 219, "span_ids": ["get_field_info_schema"], "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 get_field_info_schema(field: ModelField, schema_overrides: bool = False) -> Tuple[Dict[str, Any], bool]:\n # If no title is explicitly set, we don't set title in the schema for enums.\n # The behaviour is the same as `BaseModel` reference, where the default title\n # is in the definitions part of the schema.\n schema_: Dict[str, Any] = {}\n if field.field_info.title or not lenient_issubclass(field.type_, Enum):\n schema_['title'] = field.field_info.title or field.alias.title().replace('_', ' ')\n\n if field.field_info.title:\n schema_overrides = True\n\n if field.field_info.description:\n schema_['description'] = field.field_info.description\n schema_overrides = True\n\n if not field.required and field.default is not None and not is_callable_type(field.outer_type_):\n schema_['default'] = encode_default(field.default)\n schema_overrides = True\n\n return schema_, schema_overrides", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_schema_field_schema.if_ref_in_f_schema_.else_.return.s_f_definitions_f_neste": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_schema_field_schema.if_ref_in_f_schema_.else_.return.s_f_definitions_f_neste", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 271, "span_ids": ["field_schema"], "tokens": 535}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def field_schema(\n field: ModelField,\n *,\n by_alias: bool = True,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_prefix: Optional[str] = None,\n ref_template: str = default_ref_template,\n known_models: Optional[TypeModelSet] = None,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n \"\"\"\n Process a Pydantic field and return a tuple with a JSON Schema for it as the first item.\n Also return a dictionary of definitions with models as keys and their schemas as values. If the passed field\n is a model and has sub-models, and those sub-models don't have overrides (as ``title``, ``default``, etc), they\n will be included in the definitions and referenced in the schema instead of included recursively.\n\n :param field: a Pydantic ``ModelField``\n :param by_alias: use the defined alias (if any) in the returned schema\n :param model_name_map: used to generate the JSON Schema references to other models included in the definitions\n :param ref_prefix: the JSON Pointer prefix to use for references to other schemas, if None, the default of\n #/definitions/ will be used\n :param ref_template: Use a ``string.format()`` template for ``$ref`` instead of a prefix. This can be useful for\n references that cannot be represented by ``ref_prefix`` such as a definition stored in another file. For a\n sibling json file in a ``/schemas`` directory use ``\"/schemas/${model}.json#\"``.\n :param known_models: used to solve circular references\n :return: tuple of the schema for this field and additional definitions\n \"\"\"\n s, schema_overrides = get_field_info_schema(field)\n\n validation_schema = get_field_schema_validations(field)\n if validation_schema:\n s.update(validation_schema)\n schema_overrides = True\n\n f_schema, f_definitions, f_nested_models = field_type_schema(\n field,\n by_alias=by_alias,\n model_name_map=model_name_map,\n schema_overrides=schema_overrides,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models or set(),\n )\n\n # $ref will only be returned when there are no schema_overrides\n if '$ref' in f_schema:\n return f_schema, f_definitions, f_nested_models\n else:\n s.update(f_schema)\n return s, f_definitions, f_nested_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/pydantic/v1/schema.py_numeric_types__numeric_types_attrs._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_numeric_types__numeric_types_attrs._", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 287, "span_ids": ["impl:10"], "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": "numeric_types = (int, float, Decimal)\n_str_types_attrs: Tuple[Tuple[str, Union[type, Tuple[type, ...]], str], ...] = (\n ('max_length', numeric_types, 'maxLength'),\n ('min_length', numeric_types, 'minLength'),\n ('regex', str, 'pattern'),\n)\n\n_numeric_types_attrs: Tuple[Tuple[str, Union[type, Tuple[type, ...]], str], ...] = (\n ('gt', numeric_types, 'exclusiveMinimum'),\n ('lt', numeric_types, 'exclusiveMaximum'),\n ('ge', numeric_types, 'minimum'),\n ('le', numeric_types, 'maximum'),\n ('multiple_of', numeric_types, 'multipleOf'),\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_field_schema_validations_get_field_schema_validations.return.f_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_field_schema_validations_get_field_schema_validations.return.f_schema", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 320, "span_ids": ["get_field_schema_validations"], "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 get_field_schema_validations(field: ModelField) -> Dict[str, Any]:\n \"\"\"\n Get the JSON Schema validation keywords for a ``field`` with an annotation of\n a Pydantic ``FieldInfo`` with validation arguments.\n \"\"\"\n f_schema: Dict[str, Any] = {}\n\n if lenient_issubclass(field.type_, Enum):\n # schema is already updated by `enum_process_schema`; just update with field extra\n if field.field_info.extra:\n f_schema.update(field.field_info.extra)\n return f_schema\n\n if lenient_issubclass(field.type_, (str, bytes)):\n for attr_name, t, keyword in _str_types_attrs:\n attr = getattr(field.field_info, attr_name, None)\n if isinstance(attr, t):\n f_schema[keyword] = attr\n if lenient_issubclass(field.type_, numeric_types) and not issubclass(field.type_, bool):\n for attr_name, t, keyword in _numeric_types_attrs:\n attr = getattr(field.field_info, attr_name, None)\n if isinstance(attr, t):\n f_schema[keyword] = attr\n if field.field_info is not None and field.field_info.const:\n f_schema['const'] = field.default\n if field.field_info.extra:\n f_schema.update(field.field_info.extra)\n modify_schema = getattr(field.outer_type_, '__modify_schema__', None)\n if modify_schema:\n _apply_modify_schema(modify_schema, field, f_schema)\n return f_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/v1/schema.py_get_model_name_map_get_model_name_map.return._v_k_for_k_v_in_name_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_model_name_map_get_model_name_map.return._v_k_for_k_v_in_name_mo", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 323, "end_line": 347, "span_ids": ["get_model_name_map"], "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 get_model_name_map(unique_models: TypeModelSet) -> Dict[TypeModelOrEnum, str]:\n \"\"\"\n Process a set of models and generate unique names for them to be used as keys in the JSON Schema\n definitions. By default the names are the same as the class name. But if two models in different Python\n modules have the same name (e.g. \"users.Model\" and \"items.Model\"), the generated names will be\n based on the Python module path for those conflicting models to prevent name collisions.\n\n :param unique_models: a Python set of models\n :return: dict mapping models to names\n \"\"\"\n name_model_map = {}\n conflicting_names: Set[str] = set()\n for model in unique_models:\n model_name = normalize_name(model.__name__)\n if model_name in conflicting_names:\n model_name = get_long_model_name(model)\n name_model_map[model_name] = model\n elif model_name in name_model_map:\n conflicting_names.add(model_name)\n conflicting_model = name_model_map.pop(model_name)\n name_model_map[get_long_model_name(conflicting_model)] = conflicting_model\n name_model_map[get_long_model_name(model)] = model\n else:\n name_model_map[model_name] = model\n return {v: k for k, v in name_model_map.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/v1/schema.py_get_flat_models_from_model_get_flat_models_from_model.return.flat_models": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_model_get_flat_models_from_model.return.flat_models", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 367, "span_ids": ["get_flat_models_from_model"], "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 get_flat_models_from_model(model: Type['BaseModel'], known_models: Optional[TypeModelSet] = None) -> TypeModelSet:\n \"\"\"\n Take a single ``model`` and generate a set with itself and all the sub-models in the tree. I.e. if you pass\n model ``Foo`` (subclass of Pydantic ``BaseModel``) as ``model``, and it has a field of type ``Bar`` (also\n subclass of ``BaseModel``) and that model ``Bar`` has a field of type ``Baz`` (also subclass of ``BaseModel``),\n the return value will be ``set([Foo, Bar, Baz])``.\n\n :param model: a Pydantic ``BaseModel`` subclass\n :param known_models: used to solve circular references\n :return: a set with the initial model and all its sub-models\n \"\"\"\n known_models = known_models or set()\n flat_models: TypeModelSet = set()\n flat_models.add(model)\n known_models |= flat_models\n fields = cast(Sequence[ModelField], model.__fields__.values())\n flat_models |= get_flat_models_from_fields(fields, known_models=known_models)\n return flat_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/pydantic/v1/schema.py_get_flat_models_from_field_get_flat_models_from_field.return.flat_models": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_field_get_flat_models_from_field.return.flat_models", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 370, "end_line": 396, "span_ids": ["get_flat_models_from_field"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_flat_models_from_field(field: ModelField, known_models: TypeModelSet) -> TypeModelSet:\n \"\"\"\n Take a single Pydantic ``ModelField`` (from a model) that could have been declared as a subclass of BaseModel\n (so, it could be a submodel), and generate a set with its model and all the sub-models in the tree.\n I.e. if you pass a field that was declared to be of type ``Foo`` (subclass of BaseModel) as ``field``, and that\n model ``Foo`` has a field of type ``Bar`` (also subclass of ``BaseModel``) and that model ``Bar`` has a field of\n type ``Baz`` (also subclass of ``BaseModel``), the return value will be ``set([Foo, Bar, Baz])``.\n\n :param field: a Pydantic ``ModelField``\n :param known_models: used to solve circular references\n :return: a set with the model used in the declaration for this field, if any, and all its sub-models\n \"\"\"\n from .main import BaseModel\n\n flat_models: TypeModelSet = set()\n\n field_type = field.type_\n if lenient_issubclass(getattr(field_type, '__pydantic_model__', None), BaseModel):\n field_type = field_type.__pydantic_model__\n\n if field.sub_fields and not lenient_issubclass(field_type, BaseModel):\n flat_models |= get_flat_models_from_fields(field.sub_fields, known_models=known_models)\n elif lenient_issubclass(field_type, BaseModel) and field_type not in known_models:\n flat_models |= get_flat_models_from_model(field_type, known_models=known_models)\n elif lenient_issubclass(field_type, Enum):\n flat_models.add(field_type)\n return flat_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/pydantic/v1/schema.py_get_flat_models_from_fields_get_flat_models_from_fields.return.flat_models": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_fields_get_flat_models_from_fields.return.flat_models", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 414, "span_ids": ["get_flat_models_from_fields"], "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 get_flat_models_from_fields(fields: Sequence[ModelField], known_models: TypeModelSet) -> TypeModelSet:\n \"\"\"\n Take a list of Pydantic ``ModelField``s (from a model) that could have been declared as subclasses of ``BaseModel``\n (so, any of them could be a submodel), and generate a set with their models and all the sub-models in the tree.\n I.e. if you pass a the fields of a model ``Foo`` (subclass of ``BaseModel``) as ``fields``, and on of them has a\n field of type ``Bar`` (also subclass of ``BaseModel``) and that model ``Bar`` has a field of type ``Baz`` (also\n subclass of ``BaseModel``), the return value will be ``set([Foo, Bar, Baz])``.\n\n :param fields: a list of Pydantic ``ModelField``s\n :param known_models: used to solve circular references\n :return: a set with any model declared in the fields, and all their sub-models\n \"\"\"\n flat_models: TypeModelSet = set()\n for field in fields:\n flat_models |= get_flat_models_from_field(field, known_models=known_models)\n return flat_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/pydantic/v1/schema.py_get_flat_models_from_models_get_long_model_name.return.f_model___module______mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_flat_models_from_models_get_long_model_name.return.f_model___module______mo", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 417, "end_line": 430, "span_ids": ["get_flat_models_from_models", "get_long_model_name"], "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 get_flat_models_from_models(models: Sequence[Type['BaseModel']]) -> TypeModelSet:\n \"\"\"\n Take a list of ``models`` and generate a set with them and all their sub-models in their trees. I.e. if you pass\n a list of two models, ``Foo`` and ``Bar``, both subclasses of Pydantic ``BaseModel`` as models, and ``Bar`` has\n a field of type ``Baz`` (also subclass of ``BaseModel``), the return value will be ``set([Foo, Bar, Baz])``.\n \"\"\"\n flat_models: TypeModelSet = set()\n for model in models:\n flat_models |= get_flat_models_from_model(model)\n return flat_models\n\n\ndef get_long_model_name(model: TypeModelOrEnum) -> str:\n return f'{model.__module__}__{model.__qualname__}'.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/v1/schema.py_field_type_schema_field_type_schema.return.f_schema_definitions_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_type_schema_field_type_schema.return.f_schema_definitions_ne", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 433, "end_line": 549, "span_ids": ["field_type_schema"], "tokens": 991}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_type_schema(\n field: ModelField,\n *,\n by_alias: bool,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_template: str,\n schema_overrides: bool = False,\n ref_prefix: Optional[str] = None,\n known_models: TypeModelSet,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n \"\"\"\n Used by ``field_schema()``, you probably should be using that function.\n\n Take a single ``field`` and generate the schema for its type only, not including additional\n information as title, etc. Also return additional schema definitions, from sub-models.\n \"\"\"\n from .main import BaseModel # noqa: F811\n\n definitions = {}\n nested_models: Set[str] = set()\n f_schema: Dict[str, Any]\n if field.shape in {\n SHAPE_LIST,\n SHAPE_TUPLE_ELLIPSIS,\n SHAPE_SEQUENCE,\n SHAPE_SET,\n SHAPE_FROZENSET,\n SHAPE_ITERABLE,\n SHAPE_DEQUE,\n }:\n items_schema, f_definitions, f_nested_models = field_singleton_schema(\n field,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n definitions.update(f_definitions)\n nested_models.update(f_nested_models)\n f_schema = {'type': 'array', 'items': items_schema}\n if field.shape in {SHAPE_SET, SHAPE_FROZENSET}:\n f_schema['uniqueItems'] = True\n\n elif field.shape in MAPPING_LIKE_SHAPES:\n f_schema = {'type': 'object'}\n key_field = cast(ModelField, field.key_field)\n regex = getattr(key_field.type_, 'regex', None)\n items_schema, f_definitions, f_nested_models = field_singleton_schema(\n field,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n definitions.update(f_definitions)\n nested_models.update(f_nested_models)\n if regex:\n # Dict keys have a regex pattern\n # items_schema might be a schema or empty dict, add it either way\n f_schema['patternProperties'] = {ConstrainedStr._get_pattern(regex): items_schema}\n if items_schema:\n # The dict values are not simply Any, so they need a schema\n f_schema['additionalProperties'] = items_schema\n elif field.shape == SHAPE_TUPLE or (field.shape == SHAPE_GENERIC and not issubclass(field.type_, BaseModel)):\n sub_schema = []\n sub_fields = cast(List[ModelField], field.sub_fields)\n for sf in sub_fields:\n sf_schema, sf_definitions, sf_nested_models = field_type_schema(\n sf,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n definitions.update(sf_definitions)\n nested_models.update(sf_nested_models)\n sub_schema.append(sf_schema)\n\n sub_fields_len = len(sub_fields)\n if field.shape == SHAPE_GENERIC:\n all_of_schemas = sub_schema[0] if sub_fields_len == 1 else {'type': 'array', 'items': sub_schema}\n f_schema = {'allOf': [all_of_schemas]}\n else:\n f_schema = {\n 'type': 'array',\n 'minItems': sub_fields_len,\n 'maxItems': sub_fields_len,\n }\n if sub_fields_len >= 1:\n f_schema['items'] = sub_schema\n else:\n assert field.shape in {SHAPE_SINGLETON, SHAPE_GENERIC}, field.shape\n f_schema, f_definitions, f_nested_models = field_singleton_schema(\n field,\n by_alias=by_alias,\n model_name_map=model_name_map,\n schema_overrides=schema_overrides,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n definitions.update(f_definitions)\n nested_models.update(f_nested_models)\n\n # check field type to avoid repeated calls to the same __modify_schema__ method\n if field.type_ != field.outer_type_:\n if field.shape == SHAPE_GENERIC:\n field_type = field.type_\n else:\n field_type = field.outer_type_\n modify_schema = getattr(field_type, '__modify_schema__', None)\n if modify_schema:\n _apply_modify_schema(modify_schema, field, f_schema)\n return f_schema, definitions, nested_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/pydantic/v1/schema.py_model_process_schema_model_process_schema.return.s_m_definitions_nested_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_model_process_schema_model_process_schema.return.s_m_definitions_nested_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 552, "end_line": 599, "span_ids": ["model_process_schema"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def model_process_schema(\n model: TypeModelOrEnum,\n *,\n by_alias: bool = True,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_prefix: Optional[str] = None,\n ref_template: str = default_ref_template,\n known_models: Optional[TypeModelSet] = None,\n field: Optional[ModelField] = None,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n \"\"\"\n Used by ``model_schema()``, you probably should be using that function.\n\n Take a single ``model`` and generate its schema. Also return additional schema definitions, from sub-models. The\n sub-models of the returned schema will be referenced, but their definitions will not be included in the schema. All\n the definitions are returned as the second value.\n \"\"\"\n from inspect import getdoc, signature\n\n known_models = known_models or set()\n if lenient_issubclass(model, Enum):\n model = cast(Type[Enum], model)\n s = enum_process_schema(model, field=field)\n return s, {}, set()\n model = cast(Type['BaseModel'], model)\n s = {'title': model.__config__.title or model.__name__}\n doc = getdoc(model)\n if doc:\n s['description'] = doc\n known_models.add(model)\n m_schema, m_definitions, nested_models = model_type_schema(\n model,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n s.update(m_schema)\n schema_extra = model.__config__.schema_extra\n if callable(schema_extra):\n if len(signature(schema_extra).parameters) == 1:\n schema_extra(s)\n else:\n schema_extra(s, model)\n else:\n s.update(schema_extra)\n return s, m_definitions, nested_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/pydantic/v1/schema.py_model_type_schema_model_type_schema.return.out_schema_definitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_model_type_schema_model_type_schema.return.out_schema_definitions_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 602, "end_line": 653, "span_ids": ["model_type_schema"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def model_type_schema(\n model: Type['BaseModel'],\n *,\n by_alias: bool,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_template: str,\n ref_prefix: Optional[str] = None,\n known_models: TypeModelSet,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n \"\"\"\n You probably should be using ``model_schema()``, this function is indirectly used by that function.\n\n Take a single ``model`` and generate the schema for its type only, not including additional\n information as title, etc. Also return additional schema definitions, from sub-models.\n \"\"\"\n properties = {}\n required = []\n definitions: Dict[str, Any] = {}\n nested_models: Set[str] = set()\n for k, f in model.__fields__.items():\n try:\n f_schema, f_definitions, f_nested_models = field_schema(\n f,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n except SkipField as skip:\n warnings.warn(skip.message, UserWarning)\n continue\n definitions.update(f_definitions)\n nested_models.update(f_nested_models)\n if by_alias:\n properties[f.alias] = f_schema\n if f.required:\n required.append(f.alias)\n else:\n properties[k] = f_schema\n if f.required:\n required.append(k)\n if ROOT_KEY in properties:\n out_schema = properties[ROOT_KEY]\n out_schema['title'] = model.__config__.title or model.__name__\n else:\n out_schema = {'type': 'object', 'properties': properties}\n if required:\n out_schema['required'] = required\n if model.__config__.extra == 'forbid':\n out_schema['additionalProperties'] = False\n return out_schema, definitions, nested_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/pydantic/v1/schema.py_enum_process_schema_enum_process_schema.return.schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_enum_process_schema_enum_process_schema.return.schema_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 656, "end_line": 679, "span_ids": ["enum_process_schema"], "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 enum_process_schema(enum: Type[Enum], *, field: Optional[ModelField] = None) -> Dict[str, Any]:\n \"\"\"\n Take a single `enum` and generate its schema.\n\n This is similar to the `model_process_schema` function, but applies to ``Enum`` objects.\n \"\"\"\n import inspect\n\n schema_: Dict[str, Any] = {\n 'title': enum.__name__,\n # Python assigns all enums a default docstring value of 'An enumeration', so\n # all enums will have a description field even if not explicitly provided.\n 'description': inspect.cleandoc(enum.__doc__ or 'An enumeration.'),\n # Add enum values and the enum field type to the schema.\n 'enum': [item.value for item in cast(Iterable[Enum], enum)],\n }\n\n add_field_type_to_schema(enum, schema_)\n\n modify_schema = getattr(enum, '__modify_schema__', None)\n if modify_schema:\n _apply_modify_schema(modify_schema, field, 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/v1/schema.py_field_singleton_sub_fields_schema_field_singleton_sub_fields_schema.nested_models.set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_sub_fields_schema_field_singleton_sub_fields_schema.nested_models.set_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 682, "end_line": 700, "span_ids": ["field_singleton_sub_fields_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": "def field_singleton_sub_fields_schema(\n field: ModelField,\n *,\n by_alias: bool,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_template: str,\n schema_overrides: bool = False,\n ref_prefix: Optional[str] = None,\n known_models: TypeModelSet,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n \"\"\"\n This function is indirectly used by ``field_schema()``, you probably should be using that function.\n\n Take a list of Pydantic ``ModelField`` from the declaration of a type with parameters, and generate their\n schema. I.e., fields used as \"type parameters\", like ``str`` and ``int`` in ``Tuple[str, int]``.\n \"\"\"\n sub_fields = cast(List[ModelField], field.sub_fields)\n definitions = {}\n nested_models: 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/v1/schema.py_field_singleton_sub_fields_schema.if_len_sub_fields_1__field_singleton_sub_fields_schema.if_len_sub_fields_1_.else_.return.s_definitions_nested_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_sub_fields_schema.if_len_sub_fields_1__field_singleton_sub_fields_schema.if_len_sub_fields_1_.else_.return.s_definitions_nested_mo", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 701, "end_line": 770, "span_ids": ["field_singleton_sub_fields_schema"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def field_singleton_sub_fields_schema(\n field: ModelField,\n *,\n by_alias: bool,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_template: str,\n schema_overrides: bool = False,\n ref_prefix: Optional[str] = None,\n known_models: TypeModelSet,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n # ... other code\n if len(sub_fields) == 1:\n return field_type_schema(\n sub_fields[0],\n by_alias=by_alias,\n model_name_map=model_name_map,\n schema_overrides=schema_overrides,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n else:\n s: Dict[str, Any] = {}\n # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminator-object\n field_has_discriminator: bool = field.discriminator_key is not None\n if field_has_discriminator:\n assert field.sub_fields_mapping is not None\n\n discriminator_models_refs: Dict[str, Union[str, Dict[str, Any]]] = {}\n\n for discriminator_value, sub_field in field.sub_fields_mapping.items():\n if isinstance(discriminator_value, Enum):\n discriminator_value = str(discriminator_value.value)\n # sub_field is either a `BaseModel` or directly an `Annotated` `Union` of many\n if is_union(get_origin(sub_field.type_)):\n sub_models = get_sub_types(sub_field.type_)\n discriminator_models_refs[discriminator_value] = {\n model_name_map[sub_model]: get_schema_ref(\n model_name_map[sub_model], ref_prefix, ref_template, False\n )\n for sub_model in sub_models\n }\n else:\n sub_field_type = sub_field.type_\n if hasattr(sub_field_type, '__pydantic_model__'):\n sub_field_type = sub_field_type.__pydantic_model__\n\n discriminator_model_name = model_name_map[sub_field_type]\n discriminator_model_ref = get_schema_ref(discriminator_model_name, ref_prefix, ref_template, False)\n discriminator_models_refs[discriminator_value] = discriminator_model_ref['$ref']\n\n s['discriminator'] = {\n 'propertyName': field.discriminator_alias,\n 'mapping': discriminator_models_refs,\n }\n\n sub_field_schemas = []\n for sf in sub_fields:\n sub_schema, sub_definitions, sub_nested_models = field_type_schema(\n sf,\n by_alias=by_alias,\n model_name_map=model_name_map,\n schema_overrides=schema_overrides,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n definitions.update(sub_definitions)\n if schema_overrides and 'allOf' in sub_schema:\n # if the sub_field is a referenced schema we only need the referenced\n # object. Otherwise we will end up with several allOf inside anyOf/oneOf.\n # See https://github.com/pydantic/pydantic/issues/1209\n sub_schema = sub_schema['allOf'][0]\n\n if sub_schema.keys() == {'discriminator', 'oneOf'}:\n # we don't want discriminator information inside oneOf choices, this is dealt with elsewhere\n sub_schema.pop('discriminator')\n sub_field_schemas.append(sub_schema)\n nested_models.update(sub_nested_models)\n s['oneOf' if field_has_discriminator else 'anyOf'] = sub_field_schemas\n return s, definitions, nested_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/pydantic/v1/schema.py__Order_is_important_e_g_json_scheme._type_string_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py__Order_is_important_e_g_json_scheme._type_string_forma", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 773, "end_line": 802, "span_ids": ["impl:16", "field_singleton_sub_fields_schema"], "tokens": 457}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Order is important, e.g. subclasses of str must go before str\n# this is used only for standard library types, custom types should use __modify_schema__ instead\nfield_class_to_schema: Tuple[Tuple[Any, Dict[str, Any]], ...] = (\n (Path, {'type': 'string', 'format': 'path'}),\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 (IPv4Network, {'type': 'string', 'format': 'ipv4network'}),\n (IPv6Network, {'type': 'string', 'format': 'ipv6network'}),\n (IPv4Interface, {'type': 'string', 'format': 'ipv4interface'}),\n (IPv6Interface, {'type': 'string', 'format': 'ipv6interface'}),\n (IPv4Address, {'type': 'string', 'format': 'ipv4'}),\n (IPv6Address, {'type': 'string', 'format': 'ipv6'}),\n (Pattern, {'type': 'string', 'format': 'regex'}),\n (str, {'type': 'string'}),\n (bytes, {'type': 'string', 'format': 'binary'}),\n (bool, {'type': 'boolean'}),\n (int, {'type': 'integer'}),\n (float, {'type': 'number'}),\n (Decimal, {'type': 'number'}),\n (UUID, {'type': 'string', 'format': 'uuid'}),\n (dict, {'type': 'object'}),\n (list, {'type': 'array', 'items': {}}),\n (tuple, {'type': 'array', 'items': {}}),\n (set, {'type': 'array', 'items': {}, 'uniqueItems': True}),\n (frozenset, {'type': 'array', 'items': {}, 'uniqueItems': True}),\n)\n\njson_scheme = {'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/v1/schema.py_add_field_type_to_schema_get_schema_ref.return._allOf_schema_ref_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_add_field_type_to_schema_get_schema_ref.return._allOf_schema_ref_i", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 805, "end_line": 824, "span_ids": ["add_field_type_to_schema", "get_schema_ref"], "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 add_field_type_to_schema(field_type: Any, schema_: Dict[str, Any]) -> None:\n \"\"\"\n Update the given `schema` with the type-specific metadata for the given `field_type`.\n\n This function looks through `field_class_to_schema` for a class that matches the given `field_type`,\n and then modifies the given `schema` with the information from that type.\n \"\"\"\n for type_, t_schema in field_class_to_schema:\n # Fallback for `typing.Pattern` and `re.Pattern` as they are not a valid class\n if lenient_issubclass(field_type, type_) or field_type is type_ is Pattern:\n schema_.update(t_schema)\n break\n\n\ndef get_schema_ref(name: str, ref_prefix: Optional[str], ref_template: str, schema_overrides: bool) -> Dict[str, Any]:\n if ref_prefix:\n schema_ref = {'$ref': ref_prefix + name}\n else:\n schema_ref = {'$ref': ref_template.format(model=name)}\n return {'allOf': [schema_ref]} if schema_overrides else schema_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/v1/schema.py_field_singleton_schema_field_singleton_schema.if_field_field_info_is_no.f_schema_const_field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_schema_field_singleton_schema.if_field_field_info_is_no.f_schema_const_field", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 827, "end_line": 870, "span_ids": ["field_singleton_schema"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def field_singleton_schema( # noqa: C901 (ignore complexity)\n field: ModelField,\n *,\n by_alias: bool,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_template: str,\n schema_overrides: bool = False,\n ref_prefix: Optional[str] = None,\n known_models: TypeModelSet,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n \"\"\"\n This function is indirectly used by ``field_schema()``, you should probably be using that function.\n\n Take a single Pydantic ``ModelField``, and return its schema and any additional definitions from sub-models.\n \"\"\"\n from .main import BaseModel\n\n definitions: Dict[str, Any] = {}\n nested_models: Set[str] = set()\n field_type = field.type_\n\n # Recurse into this field if it contains sub_fields and is NOT a\n # BaseModel OR that BaseModel is a const\n if field.sub_fields and (\n (field.field_info and field.field_info.const) or not lenient_issubclass(field_type, BaseModel)\n ):\n return field_singleton_sub_fields_schema(\n field,\n by_alias=by_alias,\n model_name_map=model_name_map,\n schema_overrides=schema_overrides,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n if field_type is Any or field_type is object or field_type.__class__ == TypeVar or get_origin(field_type) is type:\n return {}, definitions, nested_models # no restrictions\n if is_none_type(field_type):\n return {'type': 'null'}, definitions, nested_models\n if is_callable_type(field_type):\n raise SkipField(f'Callable {field.name} was excluded from schema since JSON schema has no equivalent type.')\n f_schema: Dict[str, Any] = {}\n if field.field_info is not None and field.field_info.const:\n f_schema['const'] = field.default\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_schema.if_is_literal_type_field__field_singleton_schema.raise_ValueError_f_Value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_field_singleton_schema.if_is_literal_type_field__field_singleton_schema.raise_ValueError_f_Value_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 872, "end_line": 952, "span_ids": ["field_singleton_schema"], "tokens": 783}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def field_singleton_schema( # noqa: C901 (ignore complexity)\n field: ModelField,\n *,\n by_alias: bool,\n model_name_map: Dict[TypeModelOrEnum, str],\n ref_template: str,\n schema_overrides: bool = False,\n ref_prefix: Optional[str] = None,\n known_models: TypeModelSet,\n) -> Tuple[Dict[str, Any], Dict[str, Any], Set[str]]:\n # ... other code\n\n if is_literal_type(field_type):\n values = tuple(x.value if isinstance(x, Enum) else x for x in all_literal_values(field_type))\n\n if len({v.__class__ for v in values}) > 1:\n return field_schema(\n multitypes_literal_field_for_schema(values, field),\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n )\n\n # All values have the same type\n field_type = values[0].__class__\n f_schema['enum'] = list(values)\n add_field_type_to_schema(field_type, f_schema)\n elif lenient_issubclass(field_type, Enum):\n enum_name = model_name_map[field_type]\n f_schema, schema_overrides = get_field_info_schema(field, schema_overrides)\n f_schema.update(get_schema_ref(enum_name, ref_prefix, ref_template, schema_overrides))\n definitions[enum_name] = enum_process_schema(field_type, field=field)\n elif is_namedtuple(field_type):\n sub_schema, *_ = model_process_schema(\n field_type.__pydantic_model__,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n field=field,\n )\n items_schemas = list(sub_schema['properties'].values())\n f_schema.update(\n {\n 'type': 'array',\n 'items': items_schemas,\n 'minItems': len(items_schemas),\n 'maxItems': len(items_schemas),\n }\n )\n elif not hasattr(field_type, '__pydantic_model__'):\n add_field_type_to_schema(field_type, f_schema)\n\n modify_schema = getattr(field_type, '__modify_schema__', None)\n if modify_schema:\n _apply_modify_schema(modify_schema, field, f_schema)\n\n if f_schema:\n return f_schema, definitions, nested_models\n\n # Handle dataclass-based models\n if lenient_issubclass(getattr(field_type, '__pydantic_model__', None), BaseModel):\n field_type = field_type.__pydantic_model__\n\n if issubclass(field_type, BaseModel):\n model_name = model_name_map[field_type]\n if field_type not in known_models:\n sub_schema, sub_definitions, sub_nested_models = model_process_schema(\n field_type,\n by_alias=by_alias,\n model_name_map=model_name_map,\n ref_prefix=ref_prefix,\n ref_template=ref_template,\n known_models=known_models,\n field=field,\n )\n definitions.update(sub_definitions)\n definitions[model_name] = sub_schema\n nested_models.update(sub_nested_models)\n else:\n nested_models.add(model_name)\n schema_ref = get_schema_ref(model_name, ref_prefix, ref_template, schema_overrides)\n return schema_ref, definitions, nested_models\n\n # For generics with no args\n args = get_args(field_type)\n if args is not None and not args and Generic in field_type.__bases__:\n return f_schema, definitions, nested_models\n\n raise ValueError(f'Value not declarable with JSON Schema, field: {field}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_multitypes_literal_field_for_schema_multitypes_literal_field_for_schema.return.ModelField_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_multitypes_literal_field_for_schema_multitypes_literal_field_for_schema.return.ModelField_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 955, "end_line": 974, "span_ids": ["multitypes_literal_field_for_schema"], "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 multitypes_literal_field_for_schema(values: Tuple[Any, ...], field: ModelField) -> ModelField:\n \"\"\"\n To support `Literal` with values of different types, we split it into multiple `Literal` with same type\n e.g. `Literal['qwe', 'asd', 1, 2]` becomes `Union[Literal['qwe', 'asd'], Literal[1, 2]]`\n \"\"\"\n literal_distinct_types = defaultdict(list)\n for v in values:\n literal_distinct_types[v.__class__].append(v)\n distinct_literals = (Literal[tuple(same_type_values)] for same_type_values in literal_distinct_types.values())\n\n return ModelField(\n name=field.name,\n type_=Union[tuple(distinct_literals)], # type: ignore\n class_validators=field.class_validators,\n model_config=field.model_config,\n default=field.default,\n required=field.required,\n alias=field.alias,\n field_info=field.field_info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_encode_default__map_types_constraint._int_conint_float_conf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_encode_default__map_types_constraint._int_conint_float_conf", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 977, "end_line": 999, "span_ids": ["impl:20", "encode_default"], "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 encode_default(dft: Any) -> Any:\n from .main import BaseModel\n\n if isinstance(dft, BaseModel) or is_dataclass(dft):\n dft = cast('dict[str, Any]', pydantic_encoder(dft))\n\n if isinstance(dft, dict):\n return {encode_default(k): encode_default(v) for k, v in dft.items()}\n elif isinstance(dft, Enum):\n return dft.value\n elif isinstance(dft, (int, float, str)):\n return dft\n elif isinstance(dft, (list, tuple)):\n t = dft.__class__\n seq_args = (encode_default(v) for v in dft)\n return t(*seq_args) if is_namedtuple(t) else t(seq_args)\n elif dft is None:\n return None\n else:\n return pydantic_encoder(dft)\n\n\n_map_types_constraint: Dict[Any, Callable[..., type]] = {int: conint, float: confloat, Decimal: condecimal}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_from_field_info_get_annotation_from_field_info.return.annotation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_from_field_info_get_annotation_from_field_info.return.annotation", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1002, "end_line": 1028, "span_ids": ["get_annotation_from_field_info"], "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": "def get_annotation_from_field_info(\n annotation: Any, field_info: FieldInfo, field_name: str, validate_assignment: bool = False\n) -> Type[Any]:\n \"\"\"\n Get an annotation with validation implemented for numbers and strings based on the field_info.\n :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr``\n :param field_info: an instance of FieldInfo, possibly with declarations for validations and JSON Schema\n :param field_name: name of the field for use in error messages\n :param validate_assignment: default False, flag for BaseModel Config value of validate_assignment\n :return: the same ``annotation`` if unmodified or a new annotation with validation in place\n \"\"\"\n constraints = field_info.get_constraints()\n used_constraints: Set[str] = set()\n if constraints:\n annotation, used_constraints = get_annotation_with_constraints(annotation, field_info)\n if validate_assignment:\n used_constraints.add('allow_mutation')\n\n unused_constraints = constraints - used_constraints\n if unused_constraints:\n raise ValueError(\n f'On field \"{field_name}\" the following field constraints are set but not enforced: '\n f'{\", \".join(unused_constraints)}. '\n f'\\nFor more details see https://docs.pydantic.dev/usage/schema/#unenforced-field-constraints'\n )\n\n return 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/v1/schema.py_get_annotation_with_constraints_get_annotation_with_constraints.go.constraint_func.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_with_constraints_get_annotation_with_constraints.go.constraint_func.None", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1031, "end_line": 1089, "span_ids": ["get_annotation_with_constraints"], "tokens": 617}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_annotation_with_constraints(annotation: Any, field_info: FieldInfo) -> Tuple[Type[Any], Set[str]]: # noqa: C901\n \"\"\"\n Get an annotation with used constraints implemented for numbers and strings based on the field_info.\n\n :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr``\n :param field_info: an instance of FieldInfo, possibly with declarations for validations and JSON Schema\n :return: the same ``annotation`` if unmodified or a new annotation along with the used constraints.\n \"\"\"\n used_constraints: Set[str] = set()\n\n def go(type_: Any) -> Type[Any]:\n if (\n is_literal_type(type_)\n or isinstance(type_, ForwardRef)\n or lenient_issubclass(type_, (ConstrainedList, ConstrainedSet, ConstrainedFrozenSet))\n ):\n return type_\n origin = get_origin(type_)\n if origin is not None:\n args: Tuple[Any, ...] = get_args(type_)\n if any(isinstance(a, ForwardRef) for a in args):\n # forward refs cause infinite recursion below\n return type_\n\n if origin is Annotated:\n return go(args[0])\n if is_union(origin):\n return Union[tuple(go(a) for a in args)] # type: ignore\n\n if issubclass(origin, List) and (\n field_info.min_items is not None\n or field_info.max_items is not None\n or field_info.unique_items is not None\n ):\n used_constraints.update({'min_items', 'max_items', 'unique_items'})\n return conlist(\n go(args[0]),\n min_items=field_info.min_items,\n max_items=field_info.max_items,\n unique_items=field_info.unique_items,\n )\n\n if issubclass(origin, Set) and (field_info.min_items is not None or field_info.max_items is not None):\n used_constraints.update({'min_items', 'max_items'})\n return conset(go(args[0]), min_items=field_info.min_items, max_items=field_info.max_items)\n\n if issubclass(origin, FrozenSet) and (field_info.min_items is not None or field_info.max_items is not None):\n used_constraints.update({'min_items', 'max_items'})\n return confrozenset(go(args[0]), min_items=field_info.min_items, max_items=field_info.max_items)\n\n for t in (Tuple, List, Set, FrozenSet, Sequence):\n if issubclass(origin, t): # type: ignore\n return t[tuple(go(a) for a in args)] # type: ignore\n\n if issubclass(origin, Dict):\n return Dict[args[0], go(args[1])] # type: ignore\n\n attrs: Optional[Tuple[str, ...]] = None\n constraint_func: Optional[Callable[..., type]] = None\n # ... other code\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_with_constraints.go.if_isinstance_type__type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/schema.py_get_annotation_with_constraints.go.if_isinstance_type__type_", "embedding": null, "metadata": {"file_path": "pydantic/v1/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1090, "end_line": 1165, "span_ids": ["SkipField", "get_annotation_with_constraints", "normalize_name", "SkipField.__init__"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_annotation_with_constraints(annotation: Any, field_info: FieldInfo) -> Tuple[Type[Any], Set[str]]:\n\n def go(type_: Any) -> Type[Any]:\n # ... other code\n if isinstance(type_, type):\n if issubclass(type_, (SecretStr, SecretBytes)):\n attrs = ('max_length', 'min_length')\n\n def constraint_func(**kw: Any) -> Type[Any]:\n return type(type_.__name__, (type_,), kw)\n\n elif issubclass(type_, str) and not issubclass(type_, (EmailStr, AnyUrl)):\n attrs = ('max_length', 'min_length', 'regex')\n if issubclass(type_, StrictStr):\n\n def constraint_func(**kw: Any) -> Type[Any]:\n return type(type_.__name__, (type_,), kw)\n\n else:\n constraint_func = constr\n elif issubclass(type_, bytes):\n attrs = ('max_length', 'min_length', 'regex')\n if issubclass(type_, StrictBytes):\n\n def constraint_func(**kw: Any) -> Type[Any]:\n return type(type_.__name__, (type_,), kw)\n\n else:\n constraint_func = conbytes\n elif issubclass(type_, numeric_types) and not issubclass(\n type_,\n (\n ConstrainedInt,\n ConstrainedFloat,\n ConstrainedDecimal,\n ConstrainedList,\n ConstrainedSet,\n ConstrainedFrozenSet,\n bool,\n ),\n ):\n # Is numeric type\n attrs = ('gt', 'lt', 'ge', 'le', 'multiple_of')\n if issubclass(type_, float):\n attrs += ('allow_inf_nan',)\n if issubclass(type_, Decimal):\n attrs += ('max_digits', 'decimal_places')\n numeric_type = next(t for t in numeric_types if issubclass(type_, t)) # pragma: no branch\n constraint_func = _map_types_constraint[numeric_type]\n\n if attrs:\n used_constraints.update(set(attrs))\n kwargs = {\n attr_name: attr\n for attr_name, attr in ((attr_name, getattr(field_info, attr_name)) for attr_name in attrs)\n if attr is not None\n }\n if kwargs:\n constraint_func = cast(Callable[..., type], constraint_func)\n return constraint_func(**kwargs)\n return type_\n\n return go(annotation), used_constraints\n\n\ndef normalize_name(name: str) -> str:\n \"\"\"\n Normalizes the given name. This can be applied to either a model *or* enum.\n \"\"\"\n return re.sub(r'[^a-zA-Z0-9.\\-_]', '_', name)\n\n\nclass SkipField(Exception):\n \"\"\"\n Utility exception used to exclude fields from schema.\n \"\"\"\n\n def __init__(self, message: str) -> None:\n self.message = message", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_json_parse_obj_as.return.model_type___root___obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_json_parse_obj_as.return.model_type___root___obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["parse_obj_as", "imports", "_generate_parsing_type_name", "_get_parsing_type", "impl:6"], "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": "import json\nfrom functools import lru_cache\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING, Any, Callable, Optional, Type, TypeVar, Union\n\nfrom .parse import Protocol, load_file, load_str_bytes\nfrom .types import StrBytes\nfrom .typing import display_as_type\n\n__all__ = ('parse_file_as', 'parse_obj_as', 'parse_raw_as', 'schema_of', 'schema_json_of')\n\nNameFactory = Union[str, Callable[[Type[Any]], str]]\n\nif TYPE_CHECKING:\n from .typing import DictStrAny\n\n\ndef _generate_parsing_type_name(type_: Any) -> str:\n return f'ParsingModel[{display_as_type(type_)}]'\n\n\n@lru_cache(maxsize=2048)\ndef _get_parsing_type(type_: Any, *, type_name: Optional[NameFactory] = None) -> Any:\n from .main import create_model\n\n if type_name is None:\n type_name = _generate_parsing_type_name\n if not isinstance(type_name, str):\n type_name = type_name(type_)\n return create_model(type_name, __root__=(type_, ...))\n\n\nT = TypeVar('T')\n\n\ndef parse_obj_as(type_: Type[T], obj: Any, *, type_name: Optional[NameFactory] = None) -> T:\n model_type = _get_parsing_type(type_, type_name=type_name) # type: ignore[arg-type]\n return model_type(__root__=obj).__root__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_parse_file_as_parse_file_as.return.parse_obj_as_type__obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_parse_file_as_parse_file_as.return.parse_obj_as_type__obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 60, "span_ids": ["parse_file_as"], "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_file_as(\n type_: Type[T],\n path: Union[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 type_name: Optional[NameFactory] = None,\n) -> T:\n obj = load_file(\n path,\n proto=proto,\n content_type=content_type,\n encoding=encoding,\n allow_pickle=allow_pickle,\n json_loads=json_loads,\n )\n return parse_obj_as(type_, obj, type_name=type_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/v1/tools.py_parse_raw_as_parse_raw_as.return.parse_obj_as_type__obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_parse_raw_as_parse_raw_as.return.parse_obj_as_type__obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 82, "span_ids": ["parse_raw_as"], "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 parse_raw_as(\n type_: Type[T],\n b: StrBytes,\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 type_name: Optional[NameFactory] = None,\n) -> T:\n obj = load_str_bytes(\n b,\n proto=proto,\n content_type=content_type,\n encoding=encoding,\n allow_pickle=allow_pickle,\n json_loads=json_loads,\n )\n return parse_obj_as(type_, obj, type_name=type_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/v1/tools.py_schema_of_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/tools.py_schema_of_", "embedding": null, "metadata": {"file_path": "pydantic/v1/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 93, "span_ids": ["schema_json_of", "schema_of"], "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 schema_of(type_: Any, *, title: Optional[NameFactory] = None, **schema_kwargs: Any) -> 'DictStrAny':\n \"\"\"Generate a JSON schema (as dict) for the passed model or dynamically generated one\"\"\"\n return _get_parsing_type(type_, type_name=title).schema(**schema_kwargs)\n\n\ndef schema_json_of(type_: Any, *, title: Optional[NameFactory] = None, **schema_json_kwargs: Any) -> str:\n \"\"\"Generate a JSON schema (as JSON) for the passed model or dynamically generated one\"\"\"\n return _get_parsing_type(type_, type_name=title).schema_json(**schema_json_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/v1/types.py_abc__registered_1.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_abc__registered_1.pass", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 143, "span_ids": ["_registered", "imports", "impl:3", "_registered_1"], "tokens": 711}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nimport math\nimport re\nimport warnings\nfrom datetime import date\nfrom decimal import Decimal, InvalidOperation\nfrom enum import Enum\nfrom pathlib import Path\nfrom types import new_class\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n ClassVar,\n Dict,\n FrozenSet,\n List,\n Optional,\n Pattern,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n overload,\n)\nfrom uuid import UUID\nfrom weakref import WeakSet\n\nfrom . import errors\nfrom .datetime_parse import parse_date\nfrom .utils import import_string, update_not_none\nfrom .validators import (\n bytes_validator,\n constr_length_validator,\n constr_lower,\n constr_strip_whitespace,\n constr_upper,\n decimal_validator,\n float_finite_validator,\n float_validator,\n frozenset_validator,\n int_validator,\n list_validator,\n number_multiple_validator,\n number_size_validator,\n path_exists_validator,\n path_validator,\n set_validator,\n str_validator,\n strict_bytes_validator,\n strict_float_validator,\n strict_int_validator,\n strict_str_validator,\n)\n\n__all__ = [\n 'NoneStr',\n 'NoneBytes',\n 'StrBytes',\n 'NoneStrBytes',\n 'StrictStr',\n 'ConstrainedBytes',\n 'conbytes',\n 'ConstrainedList',\n 'conlist',\n 'ConstrainedSet',\n 'conset',\n 'ConstrainedFrozenSet',\n 'confrozenset',\n 'ConstrainedStr',\n 'constr',\n 'PyObject',\n 'ConstrainedInt',\n 'conint',\n 'PositiveInt',\n 'NegativeInt',\n 'NonNegativeInt',\n 'NonPositiveInt',\n 'ConstrainedFloat',\n 'confloat',\n 'PositiveFloat',\n 'NegativeFloat',\n 'NonNegativeFloat',\n 'NonPositiveFloat',\n 'FiniteFloat',\n 'ConstrainedDecimal',\n 'condecimal',\n 'UUID1',\n 'UUID3',\n 'UUID4',\n 'UUID5',\n 'FilePath',\n 'DirectoryPath',\n 'Json',\n 'JsonWrapper',\n 'SecretField',\n 'SecretStr',\n 'SecretBytes',\n 'StrictBool',\n 'StrictBytes',\n 'StrictInt',\n 'StrictFloat',\n 'PaymentCardNumber',\n 'ByteSize',\n 'PastDate',\n 'FutureDate',\n 'ConstrainedDate',\n 'condate',\n]\n\nNoneStr = Optional[str]\nNoneBytes = Optional[bytes]\nStrBytes = Union[str, bytes]\nNoneStrBytes = Optional[StrBytes]\nOptionalInt = Optional[int]\nOptionalIntFloat = Union[OptionalInt, float]\nOptionalIntFloatDecimal = Union[OptionalIntFloat, Decimal]\nOptionalDate = Optional[date]\nStrIntFloat = Union[str, int, float]\n\nif TYPE_CHECKING:\n from typing_extensions import Annotated\n\n from .dataclasses import Dataclass\n from .main import BaseModel\n from .typing import CallableGenerator\n\n ModelOrDc = Type[Union[BaseModel, Dataclass]]\n\nT = TypeVar('T')\n_DEFINED_TYPES: 'WeakSet[type]' = WeakSet()\n\n\n@overload\ndef _registered(typ: Type[T]) -> Type[T]:\n pass\n\n\n@overload\ndef _registered(typ: 'ConstrainedNumberMeta') -> 'ConstrainedNumberMeta':\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/v1/types.py__registered_2__registered_2.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py__registered_2__registered_2.return.typ", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 154, "span_ids": ["_registered_2"], "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 _registered(typ: Union[Type[T], 'ConstrainedNumberMeta']) -> Union[Type[T], 'ConstrainedNumberMeta']:\n # In order to generate valid examples of constrained types, Hypothesis needs\n # to inspect the type object - so we keep a weakref to each contype object\n # until it can be registered. When (or if) our Hypothesis plugin is loaded,\n # it monkeypatches this function.\n # If Hypothesis is never used, the total effect is to keep a weak reference\n # which has minimal memory usage and doesn't even affect garbage collection.\n _DEFINED_TYPES.add(typ)\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedNumberMeta_ConstrainedNumberMeta.__new__.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedNumberMeta_ConstrainedNumberMeta.__new__.None_1", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 166, "span_ids": ["ConstrainedNumberMeta", "ConstrainedNumberMeta.__new__"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstrainedNumberMeta(type):\n def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt': # type: ignore\n new_cls = cast('ConstrainedInt', type.__new__(cls, name, bases, dct))\n\n if new_cls.gt is not None and new_cls.ge is not None:\n raise errors.ConfigError('bounds gt and ge cannot be specified at the same time')\n if new_cls.lt is not None and new_cls.le is not None:\n raise errors.ConfigError('bounds lt and le cannot be specified at the same time')\n\n return _registered(new_cls) # 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/v1/types.py___None_1.else_.StrictBool.validate.raise_errors_StrictBoolEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py___None_1.else_.StrictBool.validate.raise_errors_StrictBoolEr", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 196, "span_ids": ["ConstrainedNumberMeta.__new__", "impl:28"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BOOLEAN TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n StrictBool = bool\nelse:\n\n class StrictBool(int):\n \"\"\"\n StrictBool to allow for bools which are not type-coerced.\n \"\"\"\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='boolean')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Any) -> bool:\n \"\"\"\n Ensure that we only allow bools.\n \"\"\"\n if isinstance(value, bool):\n return value\n\n raise errors.StrictBoolError()\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER 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/pydantic/v1/types.py_None_1_ConstrainedInt.__get_validators__.yield_number_multiple_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_1_ConstrainedInt.__get_validators__.yield_number_multiple_val", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 225, "span_ids": ["ConstrainedInt", "ConstrainedInt.__modify_schema__", "impl:28", "ConstrainedInt.__get_validators__"], "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": "if TYPE_CHECKING:\n# ... other code\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass ConstrainedInt(int, metaclass=ConstrainedNumberMeta):\n strict: bool = False\n gt: OptionalInt = None\n ge: OptionalInt = None\n lt: OptionalInt = None\n le: OptionalInt = None\n multiple_of: OptionalInt = None\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(\n field_schema,\n exclusiveMinimum=cls.gt,\n exclusiveMaximum=cls.lt,\n minimum=cls.ge,\n maximum=cls.le,\n multipleOf=cls.multiple_of,\n )\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield strict_int_validator if cls.strict else int_validator\n yield number_size_validator\n yield number_multiple_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/pydantic/v1/types.py_conint_None_2.else_.StrictInt.strict.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conint_None_2.else_.StrictInt.strict.True", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 263, "span_ids": ["impl:32", "conint"], "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 conint(\n *,\n strict: bool = False,\n gt: Optional[int] = None,\n ge: Optional[int] = None,\n lt: Optional[int] = None,\n le: Optional[int] = None,\n multiple_of: Optional[int] = None,\n) -> Type[int]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(strict=strict, gt=gt, ge=ge, lt=lt, le=le, multiple_of=multiple_of)\n return type('ConstrainedIntValue', (ConstrainedInt,), namespace)\n\n\nif TYPE_CHECKING:\n PositiveInt = int\n NegativeInt = int\n NonPositiveInt = int\n NonNegativeInt = int\n StrictInt = int\nelse:\n\n class PositiveInt(ConstrainedInt):\n gt = 0\n\n class NegativeInt(ConstrainedInt):\n lt = 0\n\n class NonPositiveInt(ConstrainedInt):\n le = 0\n\n class NonNegativeInt(ConstrainedInt):\n ge = 0\n\n class StrictInt(ConstrainedInt):\n strict = True\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT 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/pydantic/v1/types.py_None_2_ConstrainedFloat.__get_validators__.yield_float_finite_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_2_ConstrainedFloat.__get_validators__.yield_float_finite_valida", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 303, "span_ids": ["ConstrainedFloat", "ConstrainedFloat.__modify_schema__", "impl:32", "ConstrainedFloat.__get_validators__"], "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": "if TYPE_CHECKING:\n# ... other code\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass ConstrainedFloat(float, metaclass=ConstrainedNumberMeta):\n strict: bool = False\n gt: OptionalIntFloat = None\n ge: OptionalIntFloat = None\n lt: OptionalIntFloat = None\n le: OptionalIntFloat = None\n multiple_of: OptionalIntFloat = None\n allow_inf_nan: Optional[bool] = None\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(\n field_schema,\n exclusiveMinimum=cls.gt,\n exclusiveMaximum=cls.lt,\n minimum=cls.ge,\n maximum=cls.le,\n multipleOf=cls.multiple_of,\n )\n # Modify constraints to account for differences between IEEE floats and JSON\n if field_schema.get('exclusiveMinimum') == -math.inf:\n del field_schema['exclusiveMinimum']\n if field_schema.get('minimum') == -math.inf:\n del field_schema['minimum']\n if field_schema.get('exclusiveMaximum') == math.inf:\n del field_schema['exclusiveMaximum']\n if field_schema.get('maximum') == math.inf:\n del field_schema['maximum']\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield strict_float_validator if cls.strict else float_validator\n yield number_size_validator\n yield number_multiple_validator\n yield float_finite_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/pydantic/v1/types.py_confloat_confloat.return.type_ConstrainedFloatVal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_confloat_confloat.return.type_ConstrainedFloatVal", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 306, "end_line": 318, "span_ids": ["confloat"], "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 confloat(\n *,\n strict: bool = False,\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: Optional[bool] = None,\n) -> Type[float]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(strict=strict, gt=gt, ge=ge, lt=lt, le=le, multiple_of=multiple_of, allow_inf_nan=allow_inf_nan)\n return type('ConstrainedFloatValue', (ConstrainedFloat,), namespace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_3_None_3.else_.FiniteFloat.allow_inf_nan.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_3_None_3.else_.FiniteFloat.allow_inf_nan.False", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 346, "span_ids": ["impl:44"], "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": "if TYPE_CHECKING:\n PositiveFloat = float\n NegativeFloat = float\n NonPositiveFloat = float\n NonNegativeFloat = float\n StrictFloat = float\n FiniteFloat = float\nelse:\n\n class PositiveFloat(ConstrainedFloat):\n gt = 0\n\n class NegativeFloat(ConstrainedFloat):\n lt = 0\n\n class NonPositiveFloat(ConstrainedFloat):\n le = 0\n\n class NonNegativeFloat(ConstrainedFloat):\n ge = 0\n\n class StrictFloat(ConstrainedFloat):\n strict = True\n\n class FiniteFloat(ConstrainedFloat):\n allow_inf_nan = False\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTES 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/pydantic/v1/types.py_None_3_ConstrainedBytes.__get_validators__.yield_constr_length_valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_3_ConstrainedBytes.__get_validators__.yield_constr_length_valid", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 370, "span_ids": ["ConstrainedBytes.__modify_schema__", "ConstrainedBytes.__get_validators__", "impl:44", "ConstrainedBytes"], "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": "if TYPE_CHECKING:\n# ... other code\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTES TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass ConstrainedBytes(bytes):\n strip_whitespace = False\n to_upper = False\n to_lower = False\n min_length: OptionalInt = None\n max_length: OptionalInt = None\n strict: bool = False\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(field_schema, minLength=cls.min_length, maxLength=cls.max_length)\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield strict_bytes_validator if cls.strict else bytes_validator\n yield constr_strip_whitespace\n yield constr_upper\n yield constr_lower\n yield constr_length_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/pydantic/v1/types.py_conbytes_None_4.else_.StrictBytes.strict.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conbytes_None_4.else_.StrictBytes.strict.True", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 399, "span_ids": ["conbytes", "impl:58"], "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 conbytes(\n *,\n strip_whitespace: bool = False,\n to_upper: bool = False,\n to_lower: bool = False,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n strict: bool = False,\n) -> Type[bytes]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(\n strip_whitespace=strip_whitespace,\n to_upper=to_upper,\n to_lower=to_lower,\n min_length=min_length,\n max_length=max_length,\n strict=strict,\n )\n return _registered(type('ConstrainedBytesValue', (ConstrainedBytes,), namespace))\n\n\nif TYPE_CHECKING:\n StrictBytes = bytes\nelse:\n\n class StrictBytes(ConstrainedBytes):\n strict = True\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRING 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/pydantic/v1/types.py_None_4_ConstrainedStr._get_pattern.return.regex_if_isinstance_regex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_4_ConstrainedStr._get_pattern.return.regex_if_isinstance_regex", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 402, "end_line": 446, "span_ids": ["ConstrainedStr", "ConstrainedStr._get_pattern", "ConstrainedStr.__modify_schema__", "ConstrainedStr.__get_validators__", "impl:58", "ConstrainedStr.validate"], "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": "if TYPE_CHECKING:\n# ... other code\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRING TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass ConstrainedStr(str):\n strip_whitespace = False\n to_upper = False\n to_lower = False\n min_length: OptionalInt = None\n max_length: OptionalInt = None\n curtail_length: OptionalInt = None\n regex: Optional[Union[str, Pattern[str]]] = None\n strict = False\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(\n field_schema,\n minLength=cls.min_length,\n maxLength=cls.max_length,\n pattern=cls.regex and cls._get_pattern(cls.regex),\n )\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield strict_str_validator if cls.strict else str_validator\n yield constr_strip_whitespace\n yield constr_upper\n yield constr_lower\n yield constr_length_validator\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Union[str]) -> Union[str]:\n if cls.curtail_length and len(value) > cls.curtail_length:\n value = value[: cls.curtail_length]\n\n if cls.regex:\n if not re.match(cls.regex, value):\n raise errors.StrRegexError(pattern=cls._get_pattern(cls.regex))\n\n return value\n\n @staticmethod\n def _get_pattern(regex: Union[str, Pattern[str]]) -> str:\n return regex if isinstance(regex, str) else regex.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/v1/types.py_constr_constr.return._registered_type_Constra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_constr_constr.return._registered_type_Constra", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 471, "span_ids": ["constr"], "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 constr(\n *,\n strip_whitespace: bool = False,\n to_upper: bool = False,\n to_lower: bool = False,\n strict: bool = False,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n curtail_length: Optional[int] = None,\n regex: Optional[str] = None,\n) -> Type[str]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(\n strip_whitespace=strip_whitespace,\n to_upper=to_upper,\n to_lower=to_lower,\n strict=strict,\n min_length=min_length,\n max_length=max_length,\n curtail_length=curtail_length,\n regex=regex and re.compile(regex),\n )\n return _registered(type('ConstrainedStrValue', (ConstrainedStr,), namespace))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_5_ConstrainedSet.__modify_schema__.update_not_none_field_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_5_ConstrainedSet.__modify_schema__.update_not_none_field_sch", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 501, "span_ids": ["impl:62", "ConstrainedSet.__modify_schema__", "ConstrainedSet", "ConstrainedSet.__get_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": "if TYPE_CHECKING:\n StrictStr = str\nelse:\n\n class StrictStr(ConstrainedStr):\n strict = True\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# This types superclass should be Set[T], but cython chokes on that...\nclass ConstrainedSet(set): # type: ignore\n # Needed for pydantic to detect that this is a set\n __origin__ = set\n __args__: Set[Type[T]] # type: ignore\n\n min_items: Optional[int] = None\n max_items: Optional[int] = None\n item_type: Type[T] # type: ignore\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.set_length_validator\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_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/v1/types.py_ConstrainedSet.set_length_validator_ConstrainedSet.set_length_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedSet.set_length_validator_ConstrainedSet.set_length_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 502, "end_line": 516, "span_ids": ["ConstrainedSet.set_length_validator"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstrainedSet(set): # type: ignore\n\n @classmethod\n def set_length_validator(cls, v: 'Optional[Set[T]]') -> 'Optional[Set[T]]':\n if v is None:\n return None\n\n v = set_validator(v)\n v_len = len(v)\n\n if cls.min_items is not None and v_len < cls.min_items:\n raise errors.SetMinLengthError(limit_value=cls.min_items)\n\n if cls.max_items is not None and v_len > cls.max_items:\n raise errors.SetMaxLengthError(limit_value=cls.max_items)\n\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/v1/types.py_conset_conset.return.new_class_ConstrainedSet": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conset_conset.return.new_class_ConstrainedSet", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 519, "end_line": 523, "span_ids": ["conset"], "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 conset(item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None) -> Type[Set[T]]:\n # __args__ is needed to conform to typing generics api\n namespace = {'min_items': min_items, 'max_items': max_items, 'item_type': item_type, '__args__': [item_type]}\n # We use new_class to be able to deal with Generic types\n return new_class('ConstrainedSetValue', (ConstrainedSet,), {}, lambda ns: ns.update(namespace))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_7_ConstrainedFrozenSet.__modify_schema__.update_not_none_field_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_7_ConstrainedFrozenSet.__modify_schema__.update_not_none_field_sch", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 526, "end_line": 542, "span_ids": ["conset", "ConstrainedFrozenSet.__get_validators__", "ConstrainedFrozenSet.__modify_schema__", "ConstrainedFrozenSet"], "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": "# This types superclass should be FrozenSet[T], but cython chokes on that...\nclass ConstrainedFrozenSet(frozenset): # type: ignore\n # Needed for pydantic to detect that this is a set\n __origin__ = frozenset\n __args__: FrozenSet[Type[T]] # type: ignore\n\n min_items: Optional[int] = None\n max_items: Optional[int] = None\n item_type: Type[T] # type: ignore\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.frozenset_length_validator\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items)\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/v1/types.py_ConstrainedFrozenSet.frozenset_length_validator_ConstrainedFrozenSet.frozenset_length_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedFrozenSet.frozenset_length_validator_ConstrainedFrozenSet.frozenset_length_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 544, "end_line": 558, "span_ids": ["ConstrainedFrozenSet.frozenset_length_validator"], "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 ConstrainedFrozenSet(frozenset): # type: ignore\n\n @classmethod\n def frozenset_length_validator(cls, v: 'Optional[FrozenSet[T]]') -> 'Optional[FrozenSet[T]]':\n if v is None:\n return None\n\n v = frozenset_validator(v)\n v_len = len(v)\n\n if cls.min_items is not None and v_len < cls.min_items:\n raise errors.FrozenSetMinLengthError(limit_value=cls.min_items)\n\n if cls.max_items is not None and v_len > cls.max_items:\n raise errors.FrozenSetMaxLengthError(limit_value=cls.max_items)\n\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/v1/types.py_confrozenset_confrozenset.return.new_class_ConstrainedFro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_confrozenset_confrozenset.return.new_class_ConstrainedFro", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 561, "end_line": 567, "span_ids": ["confrozenset"], "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 confrozenset(\n item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None\n) -> Type[FrozenSet[T]]:\n # __args__ is needed to conform to typing generics api\n namespace = {'min_items': min_items, 'max_items': max_items, 'item_type': item_type, '__args__': [item_type]}\n # We use new_class to be able to deal with Generic types\n return new_class('ConstrainedFrozenSetValue', (ConstrainedFrozenSet,), {}, lambda ns: ns.update(namespace))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_8_ConstrainedList.__modify_schema__.update_not_none_field_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_8_ConstrainedList.__modify_schema__.update_not_none_field_sch", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 571, "end_line": 593, "span_ids": ["ConstrainedList.__modify_schema__", "ConstrainedList.__get_validators__", "confrozenset", "ConstrainedList"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIST TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# This types superclass should be List[T], but cython chokes on that...\nclass ConstrainedList(list): # type: ignore\n # Needed for pydantic to detect that this is a list\n __origin__ = list\n __args__: Tuple[Type[T], ...] # type: ignore\n\n min_items: Optional[int] = None\n max_items: Optional[int] = None\n unique_items: Optional[bool] = None\n item_type: Type[T] # type: ignore\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.list_length_validator\n if cls.unique_items:\n yield cls.unique_items_validator\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(field_schema, minItems=cls.min_items, maxItems=cls.max_items, uniqueItems=cls.unique_items)\n\nif TYPE_CHECKING:\n# ... other code\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/v1/types.py_ConstrainedList.list_length_validator_ConstrainedList.unique_items_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedList.list_length_validator_ConstrainedList.unique_items_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 593, "end_line": 618, "span_ids": ["ConstrainedList.unique_items_validator", "ConstrainedList.list_length_validator"], "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 ConstrainedList(list): # type: ignore\n\n @classmethod\n def list_length_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]':\n if v is None:\n return None\n\n v = list_validator(v)\n v_len = len(v)\n\n if cls.min_items is not None and v_len < cls.min_items:\n raise errors.ListMinLengthError(limit_value=cls.min_items)\n\n if cls.max_items is not None and v_len > cls.max_items:\n raise errors.ListMaxLengthError(limit_value=cls.max_items)\n\n return v\n\n @classmethod\n def unique_items_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]':\n if v is None:\n return None\n\n for i, value in enumerate(v, start=1):\n if value in v[i:]:\n raise errors.ListUniqueItemsError()\n\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/v1/types.py_conlist_conlist.return.new_class_ConstrainedLis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_conlist_conlist.return.new_class_ConstrainedLis", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 621, "end_line": 629, "span_ids": ["conlist"], "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 conlist(\n item_type: Type[T], *, min_items: Optional[int] = None, max_items: Optional[int] = None, unique_items: bool = None\n) -> Type[List[T]]:\n # __args__ is needed to conform to typing generics api\n namespace = dict(\n min_items=min_items, max_items=max_items, unique_items=unique_items, item_type=item_type, __args__=(item_type,)\n )\n # We use new_class to be able to deal with Generic types\n return new_class('ConstrainedListValue', (ConstrainedList,), {}, lambda ns: ns.update(namespace))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_10_None_6.else_.PyObject.validate.None_1.except_ImportError_as_e_.raise_errors_PyObjectErro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_10_None_6.else_.PyObject.validate.None_1.except_ImportError_as_e_.raise_errors_PyObjectErro", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 632, "end_line": 659, "span_ids": ["impl:66", "conlist"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PYOBJECT TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nif TYPE_CHECKING:\n PyObject = Callable[..., Any]\nelse:\n\n class PyObject:\n validate_always = True\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Any) -> Any:\n if isinstance(value, Callable):\n return value\n\n try:\n value = str_validator(value)\n except errors.StrError:\n raise errors.PyObjectError(error_message='value is neither a valid import path not a valid callable')\n\n try:\n return import_string(value)\n except ImportError as e:\n raise errors.PyObjectError(error_message=str(e))\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/v1/types.py_None_11_ConstrainedDecimal.__get_validators__.yield_cls_validate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_11_ConstrainedDecimal.__get_validators__.yield_cls_validate", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 662, "end_line": 690, "span_ids": ["ConstrainedDecimal", "impl:66", "ConstrainedDecimal.__modify_schema__", "ConstrainedDecimal.__get_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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECIMAL TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass ConstrainedDecimal(Decimal, metaclass=ConstrainedNumberMeta):\n gt: OptionalIntFloatDecimal = None\n ge: OptionalIntFloatDecimal = None\n lt: OptionalIntFloatDecimal = None\n le: OptionalIntFloatDecimal = None\n max_digits: OptionalInt = None\n decimal_places: OptionalInt = None\n multiple_of: OptionalIntFloatDecimal = None\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(\n field_schema,\n exclusiveMinimum=cls.gt,\n exclusiveMaximum=cls.lt,\n minimum=cls.ge,\n maximum=cls.le,\n multipleOf=cls.multiple_of,\n )\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield decimal_validator\n yield number_size_validator\n yield number_multiple_validator\n yield cls.validate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedDecimal.validate_ConstrainedDecimal.validate.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedDecimal.validate_ConstrainedDecimal.validate.return.value", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 692, "end_line": 730, "span_ids": ["ConstrainedDecimal.validate"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstrainedDecimal(Decimal, metaclass=ConstrainedNumberMeta):\n\n @classmethod\n def validate(cls, value: Decimal) -> Decimal:\n try:\n normalized_value = value.normalize()\n except InvalidOperation:\n normalized_value = value\n digit_tuple, exponent = normalized_value.as_tuple()[1:]\n if exponent in {'F', 'n', 'N'}:\n raise errors.DecimalIsNotFiniteError()\n\n if 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 of 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 whole_digits = digits - decimals\n\n if cls.max_digits is not None and digits > cls.max_digits:\n raise errors.DecimalMaxDigitsError(max_digits=cls.max_digits)\n\n if cls.decimal_places is not None and decimals > cls.decimal_places:\n raise errors.DecimalMaxPlacesError(decimal_places=cls.decimal_places)\n\n if cls.max_digits is not None and cls.decimal_places is not None:\n expected = cls.max_digits - cls.decimal_places\n if whole_digits > expected:\n raise errors.DecimalWholeDigitsError(whole_digits=expected)\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/v1/types.py_condecimal_condecimal.return.type_ConstrainedDecimalV": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_condecimal_condecimal.return.type_ConstrainedDecimalV", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 729, "end_line": 743, "span_ids": ["condecimal"], "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 condecimal(\n *,\n gt: Decimal = None,\n ge: Decimal = None,\n lt: Decimal = None,\n le: Decimal = None,\n max_digits: Optional[int] = None,\n decimal_places: Optional[int] = None,\n multiple_of: Decimal = None,\n) -> Type[Decimal]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(\n gt=gt, ge=ge, lt=lt, le=le, max_digits=max_digits, decimal_places=decimal_places, multiple_of=multiple_of\n )\n return type('ConstrainedDecimalValue', (ConstrainedDecimal,), namespace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_12_None_9.else_.Json.__modify_schema__.field_schema_update_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_12_None_9.else_.Json.__modify_schema__.field_schema_update_type_", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 752, "end_line": 844, "span_ids": ["JsonMeta.__getitem__", "impl:70", "condecimal", "JsonWrapper", "JsonMeta", "impl:86"], "tokens": 601}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# This types superclass should be FrozenSet[T], but cython chokes on that...\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LIST TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# This types superclass should be List[T], but cython chokes on that...\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UUID TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n UUID1 = UUID\n UUID3 = UUID\n UUID4 = UUID\n UUID5 = UUID\nelse:\n\n class UUID1(UUID):\n _required_version = 1\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format=f'uuid{cls._required_version}')\n\n class UUID3(UUID1):\n _required_version = 3\n\n class UUID4(UUID1):\n _required_version = 4\n\n class UUID5(UUID1):\n _required_version = 5\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PATH TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n FilePath = Path\n DirectoryPath = Path\nelse:\n\n class FilePath(Path):\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(format='file-path')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield path_validator\n yield path_exists_validator\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Path) -> Path:\n if not value.is_file():\n raise errors.PathNotAFileError(path=value)\n\n return value\n\n class DirectoryPath(Path):\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(format='directory-path')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield path_validator\n yield path_exists_validator\n yield cls.validate\n\n @classmethod\n def validate(cls, value: Path) -> Path:\n if not value.is_dir():\n raise errors.PathNotADirectoryError(path=value)\n\n return value\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass JsonWrapper:\n pass\n\n\nclass JsonMeta(type):\n def __getitem__(self, t: Type[Any]) -> Type[JsonWrapper]:\n if t is Any:\n return Json # allow Json[Any] to replecate plain Json\n return _registered(type('JsonWrapperValue', (JsonWrapper,), {'inner_type': t}))\n\n\nif TYPE_CHECKING:\n Json = Annotated[T, ...] # Json[list[str]] will be recognized by type checkers as list[str]\n\nelse:\n\n class Json(metaclass=JsonMeta):\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(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/v1/types.py_None_15_SecretField.get_secret_value._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_15_SecretField.get_secret_value._", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 841, "end_line": 866, "span_ids": ["SecretField.get_secret_value", "SecretField.__eq__", "SecretField.__str__", "SecretField", "impl:86", "SecretField.__hash__"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SECRET TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass SecretField(abc.ABC):\n \"\"\"\n Note: this should be implemented as a generic like `SecretField(ABC, Generic[T])`,\n the `__init__()` should be part of the abstract class and the\n `get_secret_value()` method should use the generic `T` type.\n\n However Cython doesn't support very well generics at the moment and\n the generated code fails to be imported (see\n https://github.com/cython/cython/issues/2753).\n \"\"\"\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 __str__(self) -> str:\n return '**********' if self.get_secret_value() else ''\n\n def __hash__(self) -> int:\n return hash(self.get_secret_value())\n\n @abc.abstractmethod\n def get_secret_value(self) -> Any: # pragma: no cover\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_SecretStr_SecretStr.get_secret_value.return.self__secret_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_SecretStr_SecretStr.get_secret_value.return.self__secret_value", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 869, "end_line": 910, "span_ids": ["SecretStr.__get_validators__", "SecretStr", "SecretStr.__init__", "SecretStr.get_secret_value", "SecretStr.__repr__", "SecretStr.__len__", "SecretStr.validate", "SecretStr.__modify_schema__", "SecretStr.display"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SecretStr(SecretField):\n min_length: OptionalInt = None\n max_length: OptionalInt = None\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(\n field_schema,\n type='string',\n writeOnly=True,\n format='password',\n minLength=cls.min_length,\n maxLength=cls.max_length,\n )\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n yield constr_length_validator\n\n @classmethod\n def validate(cls, value: Any) -> 'SecretStr':\n if isinstance(value, cls):\n return value\n value = str_validator(value)\n return cls(value)\n\n def __init__(self, value: str):\n self._secret_value = value\n\n def __repr__(self) -> str:\n return f\"SecretStr('{self}')\"\n\n def __len__(self) -> int:\n return len(self._secret_value)\n\n def display(self) -> str:\n warnings.warn('`secret_str.display()` is deprecated, use `str(secret_str)` instead', DeprecationWarning)\n return str(self)\n\n def get_secret_value(self) -> str:\n return self._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/pydantic/v1/types.py_SecretBytes_SecretBytes.get_secret_value.return.self__secret_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_SecretBytes_SecretBytes.get_secret_value.return.self__secret_value", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 913, "end_line": 954, "span_ids": ["SecretBytes.__repr__", "SecretBytes.display", "SecretBytes.__init__", "SecretBytes.__len__", "SecretBytes.__modify_schema__", "SecretBytes.get_secret_value", "SecretBytes.__get_validators__", "SecretBytes", "SecretBytes.validate"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SecretBytes(SecretField):\n min_length: OptionalInt = None\n max_length: OptionalInt = None\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(\n field_schema,\n type='string',\n writeOnly=True,\n format='password',\n minLength=cls.min_length,\n maxLength=cls.max_length,\n )\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n yield constr_length_validator\n\n @classmethod\n def validate(cls, value: Any) -> 'SecretBytes':\n if isinstance(value, cls):\n return value\n value = bytes_validator(value)\n return cls(value)\n\n def __init__(self, value: bytes):\n self._secret_value = value\n\n def __repr__(self) -> str:\n return f\"SecretBytes(b'{self}')\"\n\n def __len__(self) -> int:\n return len(self._secret_value)\n\n def display(self) -> str:\n warnings.warn('`secret_bytes.display()` is deprecated, use `str(secret_bytes)` instead', DeprecationWarning)\n return str(self)\n\n def get_secret_value(self) -> bytes:\n return self._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/pydantic/v1/types.py_None_16_PaymentCardNumber.validate_digits.return.card_number": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_16_PaymentCardNumber.validate_digits.return.card_number", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 957, "end_line": 1008, "span_ids": ["PaymentCardNumber.masked", "PaymentCardBrand", "PaymentCardNumber.validate_digits", "PaymentCardBrand.__str__", "PaymentCardNumber", "PaymentCardNumber.__init__", "SecretBytes.get_secret_value", "PaymentCardNumber.__get_validators__"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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\n\n\nclass 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.bin = card_number[:6]\n self.last4 = card_number[-4:]\n self.brand = self._get_brand(card_number)\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield str_validator\n yield constr_strip_whitespace\n yield constr_length_validator\n yield cls.validate_digits\n yield cls.validate_luhn_check_digit\n yield cls\n yield cls.validate_length_for_brand\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) -> str:\n if not card_number.isdigit():\n raise errors.NotDigitError\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/v1/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/v1/types.py_PaymentCardNumber.validate_luhn_check_digit_PaymentCardNumber.validate_luhn_check_digit.return.card_number", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1010, "end_line": 1028, "span_ids": ["PaymentCardNumber.validate_luhn_check_digit"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 errors.LuhnValidationError\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/v1/types.py_PaymentCardNumber.validate_length_for_brand_PaymentCardNumber._get_brand.return.brand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_PaymentCardNumber.validate_length_for_brand_PaymentCardNumber._get_brand.return.brand", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1030, "end_line": 1062, "span_ids": ["PaymentCardNumber.validate_length_for_brand", "PaymentCardNumber._get_brand"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PaymentCardNumber(str):\n\n @classmethod\n def validate_length_for_brand(cls, card_number: 'PaymentCardNumber') -> 'PaymentCardNumber':\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 required_length: Union[None, int, str] = None\n if card_number.brand in PaymentCardBrand.mastercard:\n required_length = 16\n valid = len(card_number) == required_length\n elif card_number.brand == PaymentCardBrand.visa:\n required_length = '13, 16 or 19'\n valid = len(card_number) in {13, 16, 19}\n elif card_number.brand == PaymentCardBrand.amex:\n required_length = 15\n valid = len(card_number) == required_length\n else:\n valid = True\n if not valid:\n raise errors.InvalidLengthForBrand(brand=card_number.brand, required_length=required_length)\n return card_number\n\n @staticmethod\n def _get_brand(card_number: str) -> PaymentCardBrand:\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 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/v1/types.py_None_17_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/v1/types.py_None_17_byte_string_re.re_compile_r_s_d_", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1071, "end_line": 1089, "span_ids": ["PaymentCardNumber._get_brand", "impl:90"], "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/v1/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/v1/types.py_ByteSize_ByteSize.validate.return.cls_int_float_scalar_u", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1092, "end_line": 1117, "span_ids": ["ByteSize.__get_validators__", "ByteSize.validate", "ByteSize"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ByteSize(int):\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, v: StrIntFloat) -> 'ByteSize':\n try:\n return cls(int(v))\n except ValueError:\n pass\n\n str_match = byte_string_re.match(str(v))\n if str_match is None:\n raise errors.InvalidByteSize()\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 errors.InvalidByteSizeUnit(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/v1/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/v1/types.py_ByteSize.human_readable_ByteSize.to.return.self_unit_div", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1119, "end_line": 1143, "span_ids": ["ByteSize.human_readable", "ByteSize.to"], "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 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 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 errors.InvalidByteSizeUnit(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/v1/types.py_None_18_None_10.else_.FutureDate.validate.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_None_18_None_10.else_.FutureDate.validate.return.value", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1143, "end_line": 1174, "span_ids": ["ByteSize.to", "impl:95"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PYOBJECT TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATE TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n PastDate = date\n FutureDate = date\nelse:\n\n class PastDate(date):\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield parse_date\n yield cls.validate\n\n @classmethod\n def validate(cls, value: date) -> date:\n if value >= date.today():\n raise errors.DateNotInThePastError()\n\n return value\n\n class FutureDate(date):\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield parse_date\n yield cls.validate\n\n @classmethod\n def validate(cls, value: date) -> date:\n if value <= date.today():\n raise errors.DateNotInTheFutureError()\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/v1/types.py_ConstrainedDate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/types.py_ConstrainedDate_", "embedding": null, "metadata": {"file_path": "pydantic/v1/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1177, "end_line": 1203, "span_ids": ["condate", "ConstrainedDate.__get_validators__", "ConstrainedDate.__modify_schema__", "ConstrainedDate"], "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 ConstrainedDate(date, metaclass=ConstrainedNumberMeta):\n gt: OptionalDate = None\n ge: OptionalDate = None\n lt: OptionalDate = None\n le: OptionalDate = None\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n update_not_none(field_schema, exclusiveMinimum=cls.gt, exclusiveMaximum=cls.lt, minimum=cls.ge, maximum=cls.le)\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield parse_date\n yield number_size_validator\n\n\ndef condate(\n *,\n gt: date = None,\n ge: date = None,\n lt: date = None,\n le: date = None,\n) -> Type[date]:\n # use kwargs then define conf in a dict to aid with IDE type hinting\n namespace = dict(gt=gt, ge=ge, lt=lt, le=le)\n return type('ConstrainedDateValue', (ConstrainedDate,), namespace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_sys_if_hasattr_typing_Liter.LITERAL_TYPES_add_typing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_sys_if_hasattr_typing_Liter.LITERAL_TYPES_add_typing_", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 97, "span_ids": ["imports", "impl:17"], "tokens": 678}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport typing\nfrom collections.abc import Callable\nfrom os import PathLike\nfrom typing import ( # type: ignore\n TYPE_CHECKING,\n AbstractSet,\n Any,\n Callable as TypingCallable,\n ClassVar,\n Dict,\n ForwardRef,\n Generator,\n Iterable,\n List,\n Mapping,\n NewType,\n Optional,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n _eval_type,\n cast,\n get_type_hints,\n)\n\nfrom typing_extensions import (\n Annotated,\n Final,\n Literal,\n NotRequired as TypedDictNotRequired,\n Required as TypedDictRequired,\n)\n\ntry:\n from typing import _TypingBase as typing_base # type: ignore\nexcept ImportError:\n from typing import _Final as typing_base # type: ignore\n\ntry:\n from typing import GenericAlias as TypingGenericAlias # type: ignore\nexcept ImportError:\n # python < 3.9 does not have GenericAlias (list[int], tuple[str, ...] and so on)\n TypingGenericAlias = ()\n\ntry:\n from types import UnionType as TypesUnionType # type: ignore\nexcept ImportError:\n # python < 3.10 does not have UnionType (str | int, byte | bool and so on)\n TypesUnionType = ()\n\n\nif sys.version_info < (3, 9):\n\n def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:\n return type_._evaluate(globalns, localns)\n\nelse:\n\n def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:\n # Even though it is the right signature for python 3.9, mypy complains with\n # `error: Too many arguments for \"_evaluate\" of \"ForwardRef\"` hence the cast...\n return cast(Any, type_)._evaluate(globalns, localns, set())\n\n\nif sys.version_info < (3, 9):\n # Ensure we always get all the whole `Annotated` hint, not just the annotated type.\n # For 3.7 to 3.8, `get_type_hints` doesn't recognize `typing_extensions.Annotated`,\n # so it already returns the full annotation\n get_all_type_hints = get_type_hints\n\nelse:\n\n def get_all_type_hints(obj: Any, globalns: Any = None, localns: Any = None) -> Any:\n return get_type_hints(obj, globalns, localns, include_extras=True)\n\n\n_T = TypeVar('_T')\n\nAnyCallable = TypingCallable[..., Any]\nNoArgAnyCallable = TypingCallable[[], Any]\n\n# workaround for https://github.com/python/mypy/issues/9496\nAnyArgTCallable = TypingCallable[..., _T]\n\n\n# Annotated[...] is implemented by returning an instance of one of these classes, depending on\n# python/typing_extensions version.\nAnnotatedTypeNames = {'AnnotatedMeta', '_AnnotatedAlias'}\n\n\nLITERAL_TYPES: Set[Any] = {Literal}\nif hasattr(typing, 'Literal'):\n LITERAL_TYPES.add(typing.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/v1/typing.py_None_3_None_3.else_.get_origin.return._typing_get_origin_tp_or": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_None_3_None_3.else_.get_origin.return._typing_get_origin_tp_or", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 120, "span_ids": ["impl:17"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if sys.version_info < (3, 8):\n\n def get_origin(t: Type[Any]) -> Optional[Type[Any]]:\n if type(t).__name__ in AnnotatedTypeNames:\n # weirdly this is a runtime requirement, as well as for mypy\n return cast(Type[Any], Annotated)\n return getattr(t, '__origin__', None)\n\nelse:\n from typing import get_origin as _typing_get_origin\n\n def get_origin(tp: Type[Any]) -> Optional[Type[Any]]:\n \"\"\"\n We can't directly use `typing.get_origin` since we need a fallback to support\n custom generic classes like `ConstrainedList`\n It should be useless once https://github.com/cython/cython/issues/3537 is\n solved and https://github.com/pydantic/pydantic/pull/1753 is merged.\n \"\"\"\n if type(tp).__name__ in AnnotatedTypeNames:\n return cast(Type[Any], Annotated) # mypy complains about _SpecialForm\n return _typing_get_origin(tp) or getattr(tp, '__origin__', 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/v1/typing.py_None_4_None_4.else_.get_args.return._typing_get_args_tp_or_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_None_4_None_4.else_.get_args.return._typing_get_args_tp_or_g", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 178, "span_ids": ["impl:17"], "tokens": 618}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if sys.version_info < (3, 8):\n from typing import _GenericAlias\n\n def get_args(t: Type[Any]) -> Tuple[Any, ...]:\n \"\"\"Compatibility version of get_args for python 3.7.\n\n Mostly compatible with the python 3.8 `typing` module version\n and able to handle almost all use cases.\n \"\"\"\n if type(t).__name__ in AnnotatedTypeNames:\n return t.__args__ + t.__metadata__\n if isinstance(t, _GenericAlias):\n res = t.__args__\n if t.__origin__ is Callable and res and res[0] is not Ellipsis:\n res = (list(res[:-1]), res[-1])\n return res\n return getattr(t, '__args__', ())\n\nelse:\n from typing import get_args as _typing_get_args\n\n def _generic_get_args(tp: Type[Any]) -> Tuple[Any, ...]:\n \"\"\"\n In python 3.9, `typing.Dict`, `typing.List`, ...\n do have an empty `__args__` by default (instead of the generic ~T for example).\n In order to still support `Dict` for example and consider it as `Dict[Any, Any]`,\n we retrieve the `_nparams` value that tells us how many parameters it needs.\n \"\"\"\n if hasattr(tp, '_nparams'):\n return (Any,) * tp._nparams\n # Special case for `tuple[()]`, which used to return ((),) with `typing.Tuple`\n # in python 3.10- but now returns () for `tuple` and `Tuple`.\n # This will probably be clarified in pydantic v2\n try:\n if tp == Tuple[()] or sys.version_info >= (3, 9) and tp == tuple[()]: # type: ignore[misc]\n return ((),)\n # there is a TypeError when compiled with cython\n except TypeError: # pragma: no cover\n pass\n return ()\n\n def get_args(tp: Type[Any]) -> Tuple[Any, ...]:\n \"\"\"Get type arguments with all substitutions performed.\n\n For unions, basic simplifications used by Union constructor are performed.\n Examples::\n get_args(Dict[str, int]) == (str, int)\n get_args(int) == ()\n get_args(Union[int, Union[T, int], str][int]) == (int, str)\n get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])\n get_args(Callable[[], T][int]) == ([], int)\n \"\"\"\n if type(tp).__name__ in AnnotatedTypeNames:\n return tp.__args__ + tp.__metadata__\n # the fallback is needed for the same reasons as `get_origin` (see above)\n return _typing_get_args(tp) or getattr(tp, '__args__', ()) or _generic_get_args(tp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_display_as_type_display_as_type.try_.except_AttributeError_.return.str_v_replace_typing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_display_as_type_display_as_type.try_.except_AttributeError_.return.str_v_replace_typing_", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 366, "end_line": 381, "span_ids": ["display_as_type"], "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 display_as_type(v: Type[Any]) -> str:\n if not isinstance(v, typing_base) and not isinstance(v, WithArgsTypes) and not isinstance(v, type):\n v = v.__class__\n\n if is_union(get_origin(v)):\n return f'Union[{\", \".join(map(display_as_type, get_args(v)))}]'\n\n if isinstance(v, WithArgsTypes):\n # Generic alias are constructs like `list[int]`\n return str(v).replace('typing.', '')\n\n try:\n return v.__name__\n except AttributeError:\n # happens with typing objects\n return str(v).replace('typing.', '')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_resolve_annotations_resolve_annotations.return.annotations": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_resolve_annotations_resolve_annotations.return.annotations", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 413, "span_ids": ["resolve_annotations"], "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 resolve_annotations(raw_annotations: Dict[str, Type[Any]], module_name: Optional[str]) -> Dict[str, Type[Any]]:\n \"\"\"\n Partially taken from typing.get_type_hints.\n\n Resolve string or ForwardRef annotations into type objects if possible.\n \"\"\"\n base_globals: Optional[Dict[str, Any]] = None\n if module_name:\n try:\n module = sys.modules[module_name]\n except KeyError:\n # happens occasionally, see https://github.com/pydantic/pydantic/issues/2363\n pass\n else:\n base_globals = module.__dict__\n\n annotations = {}\n for name, value in raw_annotations.items():\n if isinstance(value, str):\n if (3, 10) > sys.version_info >= (3, 9, 8) or sys.version_info >= (3, 10, 1):\n value = ForwardRef(value, is_argument=False, is_class=True)\n else:\n value = ForwardRef(value, is_argument=False)\n try:\n value = _eval_type(value, base_globals, None)\n except NameError:\n # this is ok, it can be fixed with update_forward_refs\n pass\n annotations[name] = value\n return annotations", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_is_callable_type_all_literal_values.return.tuple_x_for_value_in_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_is_callable_type_all_literal_values.return.tuple_x_for_value_in_valu", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 416, "end_line": 438, "span_ids": ["all_literal_values", "literal_values", "is_callable_type", "is_literal_type"], "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 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_) in LITERAL_TYPES\n\n\ndef literal_values(type_: Type[Any]) -> Tuple[Any, ...]:\n return get_args(type_)\n\n\ndef all_literal_values(type_: Type[Any]) -> Tuple[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 tuple(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/v1/typing.py_is_namedtuple_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/v1/typing.py_is_namedtuple_is_finalvar.return._check_finalvar_ann_type_", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 433, "end_line": 510, "span_ids": ["is_classvar", "is_new_type", "is_finalvar", "is_namedtuple", "new_type_supertype", "is_typeddict", "_check_finalvar", "is_typeddict_special", "impl:85", "_check_classvar", "_check_typeddict_special"], "tokens": 632}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_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\ndef is_typeddict(type_: Type[Any]) -> bool:\n \"\"\"\n Check if a given class is a typed dict (from `typing` or `typing_extensions`)\n In 3.10, there will be a public method (https://docs.python.org/3.10/library/typing.html#typing.is_typeddict)\n \"\"\"\n from .utils import lenient_issubclass\n\n return lenient_issubclass(type_, dict) and hasattr(type_, '__total__')\n\n\ndef _check_typeddict_special(type_: Any) -> bool:\n return type_ is TypedDictRequired or type_ is TypedDictNotRequired\n\n\ndef is_typeddict_special(type_: Any) -> bool:\n \"\"\"\n Check if type is a TypedDict special form (Required or NotRequired).\n \"\"\"\n return _check_typeddict_special(type_) or _check_typeddict_special(get_origin(type_))\n\n\ntest_type = NewType('test_type', str)\n\n\ndef is_new_type(type_: Type[Any]) -> bool:\n \"\"\"\n Check whether type_ was created using typing.NewType\n \"\"\"\n return isinstance(type_, test_type.__class__) and hasattr(type_, '__supertype__') # type: ignore\n\n\ndef new_type_supertype(type_: Type[Any]) -> Type[Any]:\n while hasattr(type_, '__supertype__'):\n type_ = type_.__supertype__\n return type_\n\n\ndef _check_classvar(v: Optional[Type[Any]]) -> bool:\n if v is None:\n return False\n\n return v.__class__ == ClassVar.__class__ and getattr(v, '_name', None) == 'ClassVar'\n\n\ndef _check_finalvar(v: Optional[Type[Any]]) -> 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_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__ == ForwardRef and ann_type.__forward_arg__.startswith('ClassVar['):\n return True\n\n return False\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/v1/typing.py_update_field_forward_refs_update_field_forward_refs.if_field_discriminator_ke.field_prepare_discriminat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_update_field_forward_refs_update_field_forward_refs.if_field_discriminator_ke.field_prepare_discriminat", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 521, "end_line": 540, "span_ids": ["update_field_forward_refs"], "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 update_field_forward_refs(field: 'ModelField', globalns: Any, localns: Any) -> None:\n \"\"\"\n Try to update ForwardRefs on fields based on this ModelField, globalns and localns.\n \"\"\"\n prepare = False\n if field.type_.__class__ == ForwardRef:\n prepare = True\n field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)\n if field.outer_type_.__class__ == ForwardRef:\n prepare = True\n field.outer_type_ = evaluate_forwardref(field.outer_type_, globalns, localns or None)\n if prepare:\n field.prepare()\n\n if field.sub_fields:\n for sub_f in field.sub_fields:\n update_field_forward_refs(sub_f, globalns=globalns, localns=localns)\n\n if field.discriminator_key is not None:\n field.prepare_discriminated_union_sub_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/v1/typing.py_update_model_forward_refs_update_model_forward_refs.for_key_in_set_json_encod.json_encoders_new_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_update_model_forward_refs_update_model_forward_refs.for_key_in_set_json_encod.json_encoders_new_key_", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 543, "end_line": 579, "span_ids": ["update_model_forward_refs"], "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 update_model_forward_refs(\n model: Type[Any],\n fields: Iterable['ModelField'],\n json_encoders: Dict[Union[Type[Any], str, ForwardRef], AnyCallable],\n localns: 'DictStrAny',\n exc_to_suppress: Tuple[Type[BaseException], ...] = (),\n) -> None:\n \"\"\"\n Try to update model fields ForwardRefs based on model and localns.\n \"\"\"\n if model.__module__ in sys.modules:\n globalns = sys.modules[model.__module__].__dict__.copy()\n else:\n globalns = {}\n\n globalns.setdefault(model.__name__, model)\n\n for f in fields:\n try:\n update_field_forward_refs(f, globalns=globalns, localns=localns)\n except exc_to_suppress:\n pass\n\n for key in set(json_encoders.keys()):\n if isinstance(key, str):\n fr: ForwardRef = ForwardRef(key)\n elif isinstance(key, ForwardRef):\n fr = key\n else:\n continue\n\n try:\n new_key = evaluate_forwardref(fr, globalns, localns or None)\n except exc_to_suppress: # pragma: no cover\n continue\n\n json_encoders[new_key] = json_encoders.pop(key)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_get_class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_get_class_", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 582, "end_line": 612, "span_ids": ["get_sub_types", "get_class"], "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 get_class(type_: Type[Any]) -> Union[None, bool, Type[Any]]:\n \"\"\"\n Tries to get the class of a Type[T] annotation. Returns True if Type is used\n without brackets. Otherwise returns None.\n \"\"\"\n if type_ is type:\n return True\n\n if get_origin(type_) is None:\n return None\n\n args = get_args(type_)\n if not args or not isinstance(args[0], type):\n return True\n else:\n return args[0]\n\n\ndef get_sub_types(tp: Any) -> List[Any]:\n \"\"\"\n Return all the types that are allowed by type `tp`\n `tp` can be a `Union` of allowed types or an `Annotated` type\n \"\"\"\n origin = get_origin(tp)\n if origin is Annotated:\n return get_sub_types(get_args(tp)[0])\n elif is_union(origin):\n return [x for t in get_args(tp) for x in get_sub_types(t)]\n else:\n return [tp]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_keyword_BUILTIN_COLLECTIONS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_keyword_BUILTIN_COLLECTIONS._", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 118, "span_ids": ["imports", "impl:10"], "tokens": 670}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 keyword\nimport warnings\nimport weakref\nfrom collections import OrderedDict, defaultdict, deque\nfrom copy import deepcopy\nfrom itertools import islice, zip_longest\nfrom types import BuiltinFunctionType, CodeType, FunctionType, GeneratorType, LambdaType, ModuleType\nfrom typing import (\n TYPE_CHECKING,\n AbstractSet,\n Any,\n Callable,\n Collection,\n Dict,\n Generator,\n Iterable,\n Iterator,\n List,\n Mapping,\n NoReturn,\n Optional,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\n\nfrom typing_extensions import Annotated\n\nfrom .errors import ConfigError\nfrom .typing import (\n NoneType,\n WithArgsTypes,\n all_literal_values,\n display_as_type,\n get_args,\n get_origin,\n is_literal_type,\n is_union,\n)\nfrom .version import version_info\n\nif TYPE_CHECKING:\n from inspect import Signature\n from pathlib import Path\n\n from .config import BaseConfig\n from .dataclasses import Dataclass\n from .fields import ModelField\n from .main import BaseModel\n from .typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs\n\n RichReprResult = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]]\n\n__all__ = (\n 'import_string',\n 'sequence_like',\n 'validate_field_name',\n 'lenient_isinstance',\n 'lenient_issubclass',\n 'in_ipython',\n 'is_valid_identifier',\n 'deep_update',\n 'update_not_none',\n 'almost_equal_floats',\n 'get_model',\n 'to_camel',\n 'is_valid_field',\n 'smart_deepcopy',\n 'PyObjectStr',\n 'Representation',\n 'GetterDict',\n 'ValueItems',\n 'version_info', # required here to match behaviour in v1.3\n 'ClassAttribute',\n 'path_type',\n 'ROOT_KEY',\n 'get_unique_discriminator_alias',\n 'get_discriminator_alias_and_values',\n 'DUNDER_ATTRIBUTES',\n)\n\nROOT_KEY = '__root__'\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 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}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_import_string_import_string.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/v1/utils.py_import_string_import_string.None_1.except_AttributeError_as_.raise_ImportError_f_Modul", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 137, "span_ids": ["import_string"], "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 import_string(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/v1/utils.py_truncate_truncate.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_truncate_truncate.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 154, "span_ids": ["truncate"], "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 truncate(v: Union[str], *, max_len: int = 80) -> str:\n \"\"\"\n Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long\n \"\"\"\n warnings.warn('`truncate` is no-longer used by pydantic and is deprecated', DeprecationWarning)\n if isinstance(v, str) and len(v) > (max_len - 2):\n # -3 so quote + string + \u2026 + quote has correct length\n return (v[: (max_len - 3)] + '\u2026').__repr__()\n try:\n v = v.__repr__()\n except TypeError:\n v = v.__class__.__repr__(v) # in case v is a type\n if len(v) > max_len:\n v = v[: max_len - 1] + '\u2026'\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/v1/utils.py_sequence_like_almost_equal_floats.return.abs_value_1_value_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_sequence_like_almost_equal_floats.return.abs_value_1_value_2_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 232, "span_ids": ["sequence_like", "lenient_issubclass", "update_not_none", "deep_update", "impl:12", "lenient_isinstance", "almost_equal_floats", "validate_field_name", "in_ipython", "is_valid_identifier"], "tokens": 607}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def sequence_like(v: Any) -> bool:\n return isinstance(v, (list, tuple, set, frozenset, GeneratorType, deque))\n\n\ndef validate_field_name(bases: List[Type['BaseModel']], field_name: str) -> None:\n \"\"\"\n Ensure that the field's name does not shadow an existing attribute of the model.\n \"\"\"\n for base in bases:\n if getattr(base, field_name, None):\n raise NameError(\n f'Field name \"{field_name}\" shadows a BaseModel attribute; '\n f'use a different field name with \"alias=\\'{field_name}\\'\".'\n )\n\n\ndef lenient_isinstance(o: Any, class_or_tuple: Union[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: Union[Type[Any], Tuple[Type[Any], ...], None]) -> bool:\n try:\n return isinstance(cls, type) and issubclass(cls, class_or_tuple) # type: ignore[arg-type]\n except TypeError:\n if isinstance(cls, WithArgsTypes):\n return False\n raise # pragma: no cover\n\n\ndef 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\ndef 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 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.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/v1/utils.py_generate_model_signature_generate_model_signature.return.Signature_parameters_list", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 235, "end_line": 297, "span_ids": ["generate_model_signature"], "tokens": 519}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_model_signature(\n init: Callable[..., None], fields: Dict[str, 'ModelField'], config: Type['BaseConfig']\n) -> 'Signature':\n \"\"\"\n Generate signature for model based on its fields\n \"\"\"\n from inspect import Parameter, Signature, signature\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 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.allow_population_by_field_name\n for field_name, field in fields.items():\n param_name = field.alias\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 = {'default': field.default} if not field.required else {}\n merged_params[param_name] = Parameter(\n param_name, Parameter.KEYWORD_ONLY, annotation=field.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/v1/utils.py_get_model_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_get_model_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 324, "span_ids": ["to_camel", "impl:14", "to_lower_camel", "get_model"], "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 get_model(obj: Union[Type['BaseModel'], Type['Dataclass']]) -> Type['BaseModel']:\n from .main import BaseModel\n\n try:\n model_cls = obj.__pydantic_model__ # type: ignore\n except AttributeError:\n model_cls = obj\n\n if not issubclass(model_cls, BaseModel):\n raise TypeError('Unsupported type, must be either BaseModel or dataclass')\n return model_cls\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/v1/utils.py_unique_list_PyObjectStr.__repr__.return.str_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_unique_list_PyObjectStr.__repr__.return.str_self_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 327, "end_line": 357, "span_ids": ["PyObjectStr.__repr__", "PyObjectStr", "unique_list"], "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 unique_list(\n input_list: Union[List[T], Tuple[T, ...]],\n *,\n name_factory: 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\n\n\nclass PyObjectStr(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 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/v1/utils.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/v1/utils.py_Representation_Representation.__repr_args__.return._a_v_for_a_v_in_attrs", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 360, "end_line": 379, "span_ids": ["Representation", "Representation.__repr_args__"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Representation:\n \"\"\"\n Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.\n\n __pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations\n of objects.\n \"\"\"\n\n __slots__: Tuple[str, ...] = tuple()\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 = ((s, getattr(self, s)) for s in self.__slots__)\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/v1/utils.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/v1/utils.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/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 381, "end_line": 417, "span_ids": ["Representation.__repr_str__", "Representation.__rich_repr__", "Representation.__str__", "Representation.__repr__", "Representation.__pretty__", "Representation.__repr_name__"], "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 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: Callable[[Any], Any], **kwargs: Any) -> 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/v1/utils.py_GetterDict_GetterDict.__repr_name__.return.f_GetterDict_display_as_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_GetterDict_GetterDict.__repr_name__.return.f_GetterDict_display_as_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 420, "end_line": 479, "span_ids": ["GetterDict.get", "GetterDict.values", "GetterDict.__eq__", "GetterDict.__len__", "GetterDict.extra_keys", "GetterDict", "GetterDict.__init__", "GetterDict.__repr_args__", "GetterDict.__repr_name__", "GetterDict.keys", "GetterDict.__iter__", "GetterDict.__contains__", "GetterDict.__getitem__", "GetterDict.items"], "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": "class GetterDict(Representation):\n \"\"\"\n Hack to make object's smell just enough like dicts for validate_model.\n\n We can't inherit from Mapping[str, Any] because it upsets cython so we have to implement all methods ourselves.\n \"\"\"\n\n __slots__ = ('_obj',)\n\n def __init__(self, obj: Any):\n self._obj = obj\n\n def __getitem__(self, key: str) -> Any:\n try:\n return getattr(self._obj, key)\n except AttributeError as e:\n raise KeyError(key) from e\n\n def get(self, key: Any, default: Any = None) -> Any:\n return getattr(self._obj, key, default)\n\n def extra_keys(self) -> Set[Any]:\n \"\"\"\n We don't want to get any other attributes of obj if the model didn't explicitly ask for them\n \"\"\"\n return set()\n\n def keys(self) -> List[Any]:\n \"\"\"\n Keys of the pseudo dictionary, uses a list not set so order information can be maintained like python\n dictionaries.\n \"\"\"\n return list(self)\n\n def values(self) -> List[Any]:\n return [self[k] for k in self]\n\n def items(self) -> Iterator[Tuple[str, Any]]:\n for k in self:\n yield k, self.get(k)\n\n def __iter__(self) -> Iterator[str]:\n for name in dir(self._obj):\n if not name.startswith('_'):\n yield name\n\n def __len__(self) -> int:\n return sum(1 for _ in self)\n\n def __contains__(self, item: Any) -> bool:\n return item in self.keys()\n\n def __eq__(self, other: Any) -> bool:\n return dict(self) == dict(other.items())\n\n def __repr_args__(self) -> 'ReprArgs':\n return [(None, dict(self))]\n\n def __repr_name__(self) -> str:\n return f'GetterDict[{display_as_type(self._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/v1/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/v1/utils.py_ValueItems_ValueItems.for_element.return.item_if_not_self_is_true_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 482, "end_line": 520, "span_ids": ["ValueItems.is_included", "ValueItems.for_element", "ValueItems.is_excluded", "ValueItems.__init__", "ValueItems"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValueItems(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: Union['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: 'IntStr') -> Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']]:\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/v1/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/v1/utils.py_ValueItems._normalize_indexes_ValueItems._normalize_indexes.return.normalized_items", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 522, "end_line": 559, "span_ids": ["ValueItems._normalize_indexes"], "tokens": 403}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValueItems(Representation):\n\n def _normalize_indexes(self, items: 'MappingIntStrAny', v_length: int) -> 'DictIntStrAny':\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: 'DictIntStrAny' = {}\n all_items = None\n for i, v in items.items():\n if not (isinstance(v, Mapping) or isinstance(v, 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/v1/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/v1/utils.py_ValueItems.merge_ValueItems.merge.return.merged", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 561, "end_line": 598, "span_ids": ["ValueItems.merge"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValueItems(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: 'DictIntStrAny' = {}\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/v1/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/v1/utils.py_ValueItems._coerce_items_ValueItems.__repr_args__.return._None_self__items_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 600, "end_line": 625, "span_ids": ["ValueItems._coerce_items", "ValueItems._coerce_value", "ValueItems.__repr_args__", "ValueItems.is_true"], "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 ValueItems(Representation):\n\n @staticmethod\n def _coerce_items(items: Union['AbstractSetIntStr', 'MappingIntStrAny']) -> 'MappingIntStrAny':\n if isinstance(items, Mapping):\n pass\n elif isinstance(items, AbstractSet):\n items = dict.fromkeys(items, ...)\n else:\n class_name = getattr(items, '__class__', '???')\n assert_never(\n items,\n f'Unexpected type of exclude value {class_name}',\n )\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) -> '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/v1/utils.py_ClassAttribute_ClassAttribute.__get__.raise_AttributeError_f_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_ClassAttribute_ClassAttribute.__get__.raise_AttributeError_f_s", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 628, "end_line": 645, "span_ids": ["ClassAttribute.__init__", "ClassAttribute.__get__", "ClassAttribute"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassAttribute:\n \"\"\"\n Hide class attribute from its instances\n \"\"\"\n\n __slots__ = (\n 'name',\n 'value',\n )\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')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_path_types_Obj.TypeVar_Obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_path_types_Obj.TypeVar_Obj_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 648, "end_line": 672, "span_ids": ["impl:16", "path_type", "impl:18"], "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": "path_types = {\n 'is_dir': 'directory',\n 'is_file': 'file',\n 'is_mount': 'mount point',\n 'is_symlink': 'symlink',\n 'is_block_device': 'block device',\n 'is_char_device': 'char device',\n 'is_fifo': 'FIFO',\n 'is_socket': 'socket',\n}\n\n\ndef path_type(p: 'Path') -> str:\n \"\"\"\n Find out what sort of thing a path is.\n \"\"\"\n assert p.exists(), 'path does not exist'\n for method, name in path_types.items():\n if getattr(p, method)():\n return name\n\n return 'unknown'\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/v1/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/v1/utils.py_smart_deepcopy_smart_deepcopy._slowest_way_when_we_act", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 675, "end_line": 693, "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/v1/utils.py_is_valid_field_all_identical.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_is_valid_field_all_identical.return.True", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 696, "end_line": 733, "span_ids": ["impl:22", "all_identical", "is_valid_field", "impl:20", "is_valid_private_name"], "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 is_valid_field(name: str) -> bool:\n if not name.startswith('_'):\n return True\n return ROOT_KEY == name\n\n\nDUNDER_ATTRIBUTES = {\n '__annotations__',\n '__classcell__',\n '__doc__',\n '__module__',\n '__orig_bases__',\n '__orig_class__',\n '__qualname__',\n}\n\n\ndef is_valid_private_name(name: str) -> bool:\n return not is_valid_field(name) and name not in DUNDER_ATTRIBUTES\n\n\n_EMPTY = object()\n\n\ndef all_identical(left: Iterable[Any], right: 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/v1/utils.py_assert_never_get_unique_discriminator_alias.return.unique_aliases_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_assert_never_get_unique_discriminator_alias.return.unique_aliases_pop_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 736, "end_line": 753, "span_ids": ["assert_never", "get_unique_discriminator_alias"], "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 assert_never(obj: NoReturn, msg: str) -> NoReturn:\n \"\"\"\n Helper to make sure that we have covered all possible types.\n\n This is mostly useful for ``mypy``, docs:\n https://mypy.readthedocs.io/en/latest/literal_types.html#exhaustive-checks\n \"\"\"\n raise TypeError(msg)\n\n\ndef get_unique_discriminator_alias(all_aliases: Collection[str], discriminator_key: str) -> str:\n \"\"\"Validate that all aliases are the same and if that's the case return the alias\"\"\"\n unique_aliases = set(all_aliases)\n if len(unique_aliases) > 1:\n raise ConfigError(\n f'Aliases for discriminator {discriminator_key!r} must be the same (got {\", \".join(sorted(all_aliases))})'\n )\n return unique_aliases.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_get_discriminator_alias_and_values_get_discriminator_alias_and_values.if_is_union_get_origin_tp.else_.return.tp___fields___discriminat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py_get_discriminator_alias_and_values_get_discriminator_alias_and_values.if_is_union_get_origin_tp.else_.return.tp___fields___discriminat", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 756, "end_line": 794, "span_ids": ["get_discriminator_alias_and_values"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_discriminator_alias_and_values(tp: Any, discriminator_key: str) -> Tuple[str, Tuple[str, ...]]:\n \"\"\"\n Get alias and all valid values in the `Literal` type of the discriminator field\n `tp` can be a `BaseModel` class or directly an `Annotated` `Union` of many.\n \"\"\"\n is_root_model = getattr(tp, '__custom_root_type__', False)\n\n if get_origin(tp) is Annotated:\n tp = get_args(tp)[0]\n\n if hasattr(tp, '__pydantic_model__'):\n tp = tp.__pydantic_model__\n\n if is_union(get_origin(tp)):\n alias, all_values = _get_union_alias_and_all_values(tp, discriminator_key)\n return alias, tuple(v for values in all_values for v in values)\n elif is_root_model:\n union_type = tp.__fields__[ROOT_KEY].type_\n alias, all_values = _get_union_alias_and_all_values(union_type, discriminator_key)\n\n if len(set(all_values)) > 1:\n raise ConfigError(\n f'Field {discriminator_key!r} is not the same for all submodels of {display_as_type(tp)!r}'\n )\n\n return alias, all_values[0]\n\n else:\n try:\n t_discriminator_type = tp.__fields__[discriminator_key].type_\n except AttributeError as e:\n raise TypeError(f'Type {tp.__name__!r} is not a valid `BaseModel` or `dataclass`') from e\n except KeyError as e:\n raise ConfigError(f'Model {tp.__name__!r} needs a discriminator field for key {discriminator_key!r}') from e\n\n if not is_literal_type(t_discriminator_type):\n raise ConfigError(f'Field {discriminator_key!r} of model {tp.__name__!r} needs to be a `Literal`')\n\n return tp.__fields__[discriminator_key].alias, all_literal_values(t_discriminator_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/v1/utils.py__get_union_alias_and_all_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/utils.py__get_union_alias_and_all_values_", "embedding": null, "metadata": {"file_path": "pydantic/v1/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 797, "end_line": 804, "span_ids": ["_get_union_alias_and_all_values"], "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 _get_union_alias_and_all_values(\n union_type: Type[Any], discriminator_key: str\n) -> Tuple[str, Tuple[Tuple[str, ...], ...]]:\n zipped_aliases_values = [get_discriminator_alias_and_values(t, discriminator_key) for t in get_args(union_type)]\n # unzip: [('alias_a',('v1', 'v2)), ('alias_b', ('v3',))] => [('alias_a', 'alias_b'), (('v1', 'v2'), ('v3',))]\n all_aliases, all_values = zip(*zipped_aliases_values)\n return get_unique_discriminator_alias(all_aliases, discriminator_key), all_values", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_math_max_str_int.4_300": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_math_max_str_int.4_300", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 124, "span_ids": ["str_validator", "strict_str_validator", "bool_validator", "imports", "impl:10", "impl:14", "bytes_validator", "strict_bytes_validator"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import math\nimport re\nfrom collections import OrderedDict, deque\nfrom collections.abc import Hashable as CollectionsHashable\nfrom datetime import date, datetime, time, timedelta\nfrom decimal import Decimal, DecimalException\nfrom enum import Enum, IntEnum\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom pathlib import Path\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Deque,\n Dict,\n ForwardRef,\n FrozenSet,\n Generator,\n Hashable,\n List,\n NamedTuple,\n Pattern,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\nfrom uuid import UUID\n\nfrom . import errors\nfrom .datetime_parse import parse_date, parse_datetime, parse_duration, parse_time\nfrom .typing import (\n AnyCallable,\n all_literal_values,\n display_as_type,\n get_class,\n is_callable_type,\n is_literal_type,\n is_namedtuple,\n is_none_type,\n is_typeddict,\n)\nfrom .utils import almost_equal_floats, lenient_issubclass, sequence_like\n\nif TYPE_CHECKING:\n from typing_extensions import Literal, TypedDict\n\n from .config import BaseConfig\n from .fields import ModelField\n from .types import ConstrainedDecimal, ConstrainedFloat, ConstrainedInt\n\n ConstrainedNumber = Union[ConstrainedDecimal, ConstrainedFloat, ConstrainedInt]\n AnyOrderedDict = OrderedDict[Any, Any]\n Number = Union[int, float, Decimal]\n StrBytes = Union[str, bytes]\n\n\ndef str_validator(v: Any) -> Union[str]:\n if isinstance(v, str):\n if isinstance(v, Enum):\n return v.value\n else:\n return v\n elif isinstance(v, (float, int, Decimal)):\n # is there anything else we want to add here? If you think so, create an issue.\n return str(v)\n elif isinstance(v, (bytes, bytearray)):\n return v.decode()\n else:\n raise errors.StrError()\n\n\ndef strict_str_validator(v: Any) -> Union[str]:\n if isinstance(v, str) and not isinstance(v, Enum):\n return v\n raise errors.StrError()\n\n\ndef bytes_validator(v: Any) -> Union[bytes]:\n if isinstance(v, bytes):\n return v\n elif isinstance(v, bytearray):\n return bytes(v)\n elif isinstance(v, str):\n return v.encode()\n elif isinstance(v, (float, int, Decimal)):\n return str(v).encode()\n else:\n raise errors.BytesError()\n\n\ndef strict_bytes_validator(v: Any) -> Union[bytes]:\n if isinstance(v, bytes):\n return v\n elif isinstance(v, bytearray):\n return bytes(v)\n else:\n raise errors.BytesError()\n\n\nBOOL_FALSE = {0, '0', 'off', 'f', 'false', 'n', 'no'}\nBOOL_TRUE = {1, '1', 'on', 't', 'true', 'y', 'yes'}\n\n\ndef bool_validator(v: Any) -> bool:\n if v is True or v is False:\n return v\n if isinstance(v, bytes):\n v = v.decode()\n if isinstance(v, str):\n v = v.lower()\n try:\n if v in BOOL_TRUE:\n return True\n if v in BOOL_FALSE:\n return False\n except TypeError:\n raise errors.BoolError()\n raise errors.BoolError()\n\n\n# matches the default limit cpython, see https://github.com/python/cpython/pull/96500\nmax_str_int = 4_300", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_int_validator_int_validator.try_.except_TypeError_ValueE.raise_errors_IntegerError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_int_validator_int_validator.try_.except_TypeError_ValueE.raise_errors_IntegerError", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 143, "span_ids": ["int_validator"], "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 int_validator(v: Any) -> int:\n if isinstance(v, int) and not (v is True or v is False):\n return v\n\n # see https://github.com/pydantic/pydantic/issues/1477 and in turn, https://github.com/python/cpython/issues/95778\n # this check should be unnecessary once patch releases are out for 3.7, 3.8, 3.9 and 3.10\n # but better to check here until then.\n # NOTICE: this does not fully protect user from the DOS risk since the standard library JSON implementation\n # (and other std lib modules like xml) use `int()` and are likely called before this, the best workaround is to\n # 1. update to the latest patch release of python once released, 2. use a different JSON library like ujson\n if isinstance(v, (str, bytes, bytearray)) and len(v) > max_str_int:\n raise errors.IntegerError()\n\n try:\n return int(v)\n except (TypeError, ValueError, OverflowError):\n raise errors.IntegerError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_strict_int_validator_number_multiple_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_strict_int_validator_number_multiple_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 184, "span_ids": ["strict_float_validator", "strict_int_validator", "float_finite_validator", "number_multiple_validator", "float_validator"], "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 strict_int_validator(v: Any) -> int:\n if isinstance(v, int) and not (v is True or v is False):\n return v\n raise errors.IntegerError()\n\n\ndef float_validator(v: Any) -> float:\n if isinstance(v, float):\n return v\n\n try:\n return float(v)\n except (TypeError, ValueError):\n raise errors.FloatError()\n\n\ndef strict_float_validator(v: Any) -> float:\n if isinstance(v, float):\n return v\n raise errors.FloatError()\n\n\ndef float_finite_validator(v: 'Number', field: 'ModelField', config: 'BaseConfig') -> 'Number':\n allow_inf_nan = getattr(field.type_, 'allow_inf_nan', None)\n if allow_inf_nan is None:\n allow_inf_nan = config.allow_inf_nan\n\n if allow_inf_nan is False and (math.isnan(v) or math.isinf(v)):\n raise errors.NumberNotFiniteError()\n return v\n\n\ndef number_multiple_validator(v: 'Number', field: 'ModelField') -> 'Number':\n field_type: ConstrainedNumber = field.type_\n if field_type.multiple_of is not None:\n mod = float(v) / float(field_type.multiple_of) % 1\n if not almost_equal_floats(mod, 0.0) and not almost_equal_floats(mod, 1.0):\n raise errors.NumberNotMultipleError(multiple_of=field_type.multiple_of)\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/v1/validators.py_number_size_validator_number_size_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_number_size_validator_number_size_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 199, "span_ids": ["number_size_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 number_size_validator(v: 'Number', field: 'ModelField') -> 'Number':\n field_type: ConstrainedNumber = field.type_\n if field_type.gt is not None and not v > field_type.gt:\n raise errors.NumberNotGtError(limit_value=field_type.gt)\n elif field_type.ge is not None and not v >= field_type.ge:\n raise errors.NumberNotGeError(limit_value=field_type.ge)\n\n if field_type.lt is not None and not v < field_type.lt:\n raise errors.NumberNotLtError(limit_value=field_type.lt)\n if field_type.le is not None and not v <= field_type.le:\n raise errors.NumberNotLeError(limit_value=field_type.le)\n\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/v1/validators.py_constant_validator_enum_member_validator.return.enum_v_value_if_config_us": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_constant_validator_enum_member_validator.return.enum_v_value_if_config_us", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 312, "span_ids": ["anystr_lower", "dict_validator", "anystr_strip_whitespace", "anystr_upper", "list_validator", "frozenset_validator", "tuple_validator", "anystr_length_validator", "ordered_dict_validator", "set_validator", "constant_validator", "enum_member_validator", "deque_validator"], "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": "def constant_validator(v: 'Any', field: 'ModelField') -> 'Any':\n \"\"\"Validate ``const`` fields.\n\n The value provided for a ``const`` field must be equal to the default value\n of the field. This is to support the keyword of the same name in JSON\n Schema.\n \"\"\"\n if v != field.default:\n raise errors.WrongConstantError(given=v, permitted=[field.default])\n\n return v\n\n\ndef anystr_length_validator(v: 'StrBytes', config: 'BaseConfig') -> 'StrBytes':\n v_len = len(v)\n\n min_length = config.min_anystr_length\n if v_len < min_length:\n raise errors.AnyStrMinLengthError(limit_value=min_length)\n\n max_length = config.max_anystr_length\n if max_length is not None and v_len > max_length:\n raise errors.AnyStrMaxLengthError(limit_value=max_length)\n\n return v\n\n\ndef anystr_strip_whitespace(v: 'StrBytes') -> 'StrBytes':\n return v.strip()\n\n\ndef anystr_upper(v: 'StrBytes') -> 'StrBytes':\n return v.upper()\n\n\ndef anystr_lower(v: 'StrBytes') -> 'StrBytes':\n return v.lower()\n\n\ndef ordered_dict_validator(v: Any) -> 'AnyOrderedDict':\n if isinstance(v, OrderedDict):\n return v\n\n try:\n return OrderedDict(v)\n except (TypeError, ValueError):\n raise errors.DictError()\n\n\ndef dict_validator(v: Any) -> Dict[Any, Any]:\n if isinstance(v, dict):\n return v\n\n try:\n return dict(v)\n except (TypeError, ValueError):\n raise errors.DictError()\n\n\ndef list_validator(v: Any) -> List[Any]:\n if isinstance(v, list):\n return v\n elif sequence_like(v):\n return list(v)\n else:\n raise errors.ListError()\n\n\ndef tuple_validator(v: Any) -> Tuple[Any, ...]:\n if isinstance(v, tuple):\n return v\n elif sequence_like(v):\n return tuple(v)\n else:\n raise errors.TupleError()\n\n\ndef set_validator(v: Any) -> Set[Any]:\n if isinstance(v, set):\n return v\n elif sequence_like(v):\n return set(v)\n else:\n raise errors.SetError()\n\n\ndef frozenset_validator(v: Any) -> FrozenSet[Any]:\n if isinstance(v, frozenset):\n return v\n elif sequence_like(v):\n return frozenset(v)\n else:\n raise errors.FrozenSetError()\n\n\ndef deque_validator(v: Any) -> Deque[Any]:\n if isinstance(v, deque):\n return v\n elif sequence_like(v):\n return deque(v)\n else:\n raise errors.DequeError()\n\n\ndef enum_member_validator(v: Any, field: 'ModelField', config: 'BaseConfig') -> Enum:\n try:\n enum_v = field.type_(v)\n except ValueError:\n # field.type_ should be an enum, so will be iterable\n raise errors.EnumMemberError(enum_values=list(field.type_))\n return enum_v.value if config.use_enum_values else enum_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/v1/validators.py_uuid_validator_uuid_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_uuid_validator_uuid_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 315, "end_line": 336, "span_ids": ["uuid_validator"], "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 uuid_validator(v: Any, field: 'ModelField') -> UUID:\n try:\n if isinstance(v, str):\n v = UUID(v)\n elif isinstance(v, (bytes, bytearray)):\n try:\n v = UUID(v.decode())\n except ValueError:\n # 16 bytes in big-endian order as the bytes argument fail\n # the above check\n v = UUID(bytes=v)\n except ValueError:\n raise errors.UUIDError()\n\n if not isinstance(v, UUID):\n raise errors.UUIDError()\n\n required_version = getattr(field.type_, '_required_version', None)\n if required_version and v.version != required_version:\n raise errors.UUIDVersionError(required_version=required_version)\n\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/v1/validators.py_decimal_validator_int_enum_validator.raise_errors_IntEnumError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_decimal_validator_int_enum_validator.raise_errors_IntEnumError", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 477, "span_ids": ["ip_v6_interface_validator", "ip_v6_network_validator", "ip_v4_network_validator", "ip_v6_address_validator", "ip_v4_interface_validator", "path_validator", "hashable_validator", "callable_validator", "int_enum_validator", "ip_v4_address_validator", "path_exists_validator", "decimal_validator", "enum_validator"], "tokens": 695}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def decimal_validator(v: Any) -> Decimal:\n if isinstance(v, Decimal):\n return v\n elif isinstance(v, (bytes, bytearray)):\n v = v.decode()\n\n v = str(v).strip()\n\n try:\n v = Decimal(v)\n except DecimalException:\n raise errors.DecimalError()\n\n if not v.is_finite():\n raise errors.DecimalIsNotFiniteError()\n\n return v\n\n\ndef hashable_validator(v: Any) -> Hashable:\n if isinstance(v, Hashable):\n return v\n\n raise errors.HashableError()\n\n\ndef ip_v4_address_validator(v: Any) -> IPv4Address:\n if isinstance(v, IPv4Address):\n return v\n\n try:\n return IPv4Address(v)\n except ValueError:\n raise errors.IPv4AddressError()\n\n\ndef ip_v6_address_validator(v: Any) -> IPv6Address:\n if isinstance(v, IPv6Address):\n return v\n\n try:\n return IPv6Address(v)\n except ValueError:\n raise errors.IPv6AddressError()\n\n\ndef ip_v4_network_validator(v: Any) -> 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(v, IPv4Network):\n return v\n\n try:\n return IPv4Network(v)\n except ValueError:\n raise errors.IPv4NetworkError()\n\n\ndef ip_v6_network_validator(v: Any) -> 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(v, IPv6Network):\n return v\n\n try:\n return IPv6Network(v)\n except ValueError:\n raise errors.IPv6NetworkError()\n\n\ndef ip_v4_interface_validator(v: Any) -> IPv4Interface:\n if isinstance(v, IPv4Interface):\n return v\n\n try:\n return IPv4Interface(v)\n except ValueError:\n raise errors.IPv4InterfaceError()\n\n\ndef ip_v6_interface_validator(v: Any) -> IPv6Interface:\n if isinstance(v, IPv6Interface):\n return v\n\n try:\n return IPv6Interface(v)\n except ValueError:\n raise errors.IPv6InterfaceError()\n\n\ndef path_validator(v: Any) -> Path:\n if isinstance(v, Path):\n return v\n\n try:\n return Path(v)\n except TypeError:\n raise errors.PathError()\n\n\ndef path_exists_validator(v: Any) -> Path:\n if not v.exists():\n raise errors.PathNotExistsError(path=v)\n\n return v\n\n\ndef callable_validator(v: Any) -> AnyCallable:\n \"\"\"\n Perform a simple check if the value is callable.\n\n Note: complete matching of argument type hints and return types is not performed\n \"\"\"\n if callable(v):\n return v\n\n raise errors.CallableError(value=v)\n\n\ndef enum_validator(v: Any) -> Enum:\n if isinstance(v, Enum):\n return v\n\n raise errors.EnumError(value=v)\n\n\ndef int_enum_validator(v: Any) -> IntEnum:\n if isinstance(v, IntEnum):\n return v\n\n raise errors.IntEnumError(value=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/v1/validators.py_make_literal_validator_make_literal_validator.return.literal_validator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_literal_validator_make_literal_validator.return.literal_validator", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 494, "span_ids": ["make_literal_validator"], "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 make_literal_validator(type_: Any) -> Callable[[Any], Any]:\n permitted_choices = all_literal_values(type_)\n\n # To have a O(1) complexity and still return one of the values set inside the `Literal`,\n # we create a dict with the set values (a set causes some problems with the way intersection works).\n # In some cases the set value and checked value can indeed be different (see `test_literal_validator_str_enum`)\n allowed_choices = {v: v for v in permitted_choices}\n\n def literal_validator(v: Any) -> Any:\n try:\n return allowed_choices[v]\n except (KeyError, TypeError):\n raise errors.WrongConstantError(given=v, permitted=permitted_choices)\n\n return literal_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/pydantic/v1/validators.py_constr_length_validator_constr_length_validator.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_constr_length_validator_constr_length_validator.return.v", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 508, "span_ids": ["constr_length_validator"], "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 constr_length_validator(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes':\n v_len = len(v)\n\n min_length = field.type_.min_length if field.type_.min_length is not None else config.min_anystr_length\n if v_len < min_length:\n raise errors.AnyStrMinLengthError(limit_value=min_length)\n\n max_length = field.type_.max_length if field.type_.max_length is not None else config.max_anystr_length\n if max_length is not None and v_len > max_length:\n raise errors.AnyStrMaxLengthError(limit_value=max_length)\n\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/v1/validators.py_constr_strip_whitespace_NamedTupleT.TypeVar_NamedTupleT_bo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_constr_strip_whitespace_NamedTupleT.TypeVar_NamedTupleT_bo", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 511, "end_line": 591, "span_ids": ["any_class_validator", "constr_strip_whitespace", "make_arbitrary_type_validator", "impl:16", "pattern_validator", "constr_upper", "make_class_validator", "validate_json", "none_validator", "impl:18", "constr_lower"], "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": "def constr_strip_whitespace(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes':\n strip_whitespace = field.type_.strip_whitespace or config.anystr_strip_whitespace\n if strip_whitespace:\n v = v.strip()\n\n return v\n\n\ndef constr_upper(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes':\n upper = field.type_.to_upper or config.anystr_upper\n if upper:\n v = v.upper()\n\n return v\n\n\ndef constr_lower(v: 'StrBytes', field: 'ModelField', config: 'BaseConfig') -> 'StrBytes':\n lower = field.type_.to_lower or config.anystr_lower\n if lower:\n v = v.lower()\n return v\n\n\ndef validate_json(v: Any, config: 'BaseConfig') -> Any:\n if v is None:\n # pass None through to other validators\n return v\n try:\n return config.json_loads(v) # type: ignore\n except ValueError:\n raise errors.JsonError()\n except TypeError:\n raise errors.JsonTypeError()\n\n\nT = TypeVar('T')\n\n\ndef make_arbitrary_type_validator(type_: Type[T]) -> Callable[[T], T]:\n def arbitrary_type_validator(v: Any) -> T:\n if isinstance(v, type_):\n return v\n raise errors.ArbitraryTypeError(expected_arbitrary_type=type_)\n\n return arbitrary_type_validator\n\n\ndef make_class_validator(type_: Type[T]) -> Callable[[Any], Type[T]]:\n def class_validator(v: Any) -> Type[T]:\n if lenient_issubclass(v, type_):\n return v\n raise errors.SubclassError(expected_class=type_)\n\n return class_validator\n\n\ndef any_class_validator(v: Any) -> Type[T]:\n if isinstance(v, type):\n return v\n raise errors.ClassError()\n\n\ndef none_validator(v: Any) -> 'Literal[None]':\n if v is None:\n return v\n raise errors.NotNoneError()\n\n\ndef pattern_validator(v: Any) -> Pattern[str]:\n if isinstance(v, Pattern):\n return v\n\n str_value = str_validator(v)\n\n try:\n return re.compile(str_value)\n except re.error:\n raise errors.PatternError()\n\n\nNamedTupleT = TypeVar('NamedTupleT', bound=NamedTuple)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_namedtuple_validator_make_namedtuple_validator.return.namedtuple_validator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_namedtuple_validator_make_namedtuple_validator.return.namedtuple_validator", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 594, "end_line": 616, "span_ids": ["make_namedtuple_validator"], "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 make_namedtuple_validator(\n namedtuple_cls: Type[NamedTupleT], config: Type['BaseConfig']\n) -> Callable[[Tuple[Any, ...]], NamedTupleT]:\n from .annotated_types import create_model_from_namedtuple\n\n NamedTupleModel = create_model_from_namedtuple(\n namedtuple_cls,\n __config__=config,\n __module__=namedtuple_cls.__module__,\n )\n namedtuple_cls.__pydantic_model__ = NamedTupleModel # type: ignore[attr-defined]\n\n def namedtuple_validator(values: Tuple[Any, ...]) -> NamedTupleT:\n annotations = NamedTupleModel.__annotations__\n\n if len(values) > len(annotations):\n raise errors.ListMaxLengthError(limit_value=len(annotations))\n\n dict_values: Dict[str, Any] = dict(zip(annotations, values))\n validated_dict_values: Dict[str, Any] = dict(NamedTupleModel(**dict_values))\n return namedtuple_cls(**validated_dict_values)\n\n return namedtuple_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/pydantic/v1/validators.py_make_typeddict_validator_make_typeddict_validator.return.typeddict_validator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_make_typeddict_validator_make_typeddict_validator.return.typeddict_validator", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 619, "end_line": 634, "span_ids": ["make_typeddict_validator"], "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 make_typeddict_validator(\n typeddict_cls: Type['TypedDict'], config: Type['BaseConfig'] # type: ignore[valid-type]\n) -> Callable[[Any], Dict[str, Any]]:\n from .annotated_types import create_model_from_typeddict\n\n TypedDictModel = create_model_from_typeddict(\n typeddict_cls,\n __config__=config,\n __module__=typeddict_cls.__module__,\n )\n typeddict_cls.__pydantic_model__ = TypedDictModel # type: ignore[attr-defined]\n\n def typeddict_validator(values: 'TypedDict') -> Dict[str, Any]: # type: ignore[valid-type]\n return TypedDictModel.parse_obj(values).dict(exclude_unset=True)\n\n return typeddict_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/pydantic/v1/validators.py_IfConfig__VALIDATORS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_IfConfig__VALIDATORS._", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 637, "end_line": 695, "span_ids": ["impl:20", "IfConfig", "IfConfig.check", "IfConfig.__init__"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IfConfig:\n def __init__(self, validator: AnyCallable, *config_attr_names: str, ignored_value: Any = False) -> None:\n self.validator = validator\n self.config_attr_names = config_attr_names\n self.ignored_value = ignored_value\n\n def check(self, config: Type['BaseConfig']) -> bool:\n return any(getattr(config, name) not in {None, self.ignored_value} for name in self.config_attr_names)\n\n\n# order is important here, for example: bool is a subclass of int so has to come first, datetime before date same,\n# IPv4Interface before IPv4Address, etc\n_VALIDATORS: List[Tuple[Type[Any], List[Any]]] = [\n (IntEnum, [int_validator, enum_member_validator]),\n (Enum, [enum_member_validator]),\n (\n str,\n [\n str_validator,\n IfConfig(anystr_strip_whitespace, 'anystr_strip_whitespace'),\n IfConfig(anystr_upper, 'anystr_upper'),\n IfConfig(anystr_lower, 'anystr_lower'),\n IfConfig(anystr_length_validator, 'min_anystr_length', 'max_anystr_length'),\n ],\n ),\n (\n bytes,\n [\n bytes_validator,\n IfConfig(anystr_strip_whitespace, 'anystr_strip_whitespace'),\n IfConfig(anystr_upper, 'anystr_upper'),\n IfConfig(anystr_lower, 'anystr_lower'),\n IfConfig(anystr_length_validator, 'min_anystr_length', 'max_anystr_length'),\n ],\n ),\n (bool, [bool_validator]),\n (int, [int_validator]),\n (float, [float_validator, IfConfig(float_finite_validator, 'allow_inf_nan', ignored_value=True)]),\n (Path, [path_validator]),\n (datetime, [parse_datetime]),\n (date, [parse_date]),\n (time, [parse_time]),\n (timedelta, [parse_duration]),\n (OrderedDict, [ordered_dict_validator]),\n (dict, [dict_validator]),\n (list, [list_validator]),\n (tuple, [tuple_validator]),\n (set, [set_validator]),\n (frozenset, [frozenset_validator]),\n (deque, [deque_validator]),\n (UUID, [uuid_validator]),\n (Decimal, [decimal_validator]),\n (IPv4Interface, [ip_v4_interface_validator]),\n (IPv6Interface, [ip_v6_interface_validator]),\n (IPv4Address, [ip_v4_address_validator]),\n (IPv6Address, [ip_v6_address_validator]),\n (IPv4Network, [ip_v4_network_validator]),\n (IPv6Network, [ip_v6_network_validator]),\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_find_validators_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/validators.py_find_validators_", "embedding": null, "metadata": {"file_path": "pydantic/v1/validators.py", "file_name": "validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 698, "end_line": 766, "span_ids": ["find_validators"], "tokens": 473}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_validators( # noqa: C901 (ignore complexity)\n type_: Type[Any], config: Type['BaseConfig']\n) -> Generator[AnyCallable, None, None]:\n from .dataclasses import is_builtin_dataclass, make_dataclass_validator\n\n if type_ is Any or type_ is object:\n return\n type_type = type_.__class__\n if type_type == ForwardRef or type_type == TypeVar:\n return\n\n if is_none_type(type_):\n yield none_validator\n return\n if type_ is Pattern or type_ is re.Pattern:\n yield pattern_validator\n return\n if type_ is Hashable or type_ is CollectionsHashable:\n yield hashable_validator\n return\n if is_callable_type(type_):\n yield callable_validator\n return\n if is_literal_type(type_):\n yield make_literal_validator(type_)\n return\n if is_builtin_dataclass(type_):\n yield from make_dataclass_validator(type_, config)\n return\n if type_ is Enum:\n yield enum_validator\n return\n if type_ is IntEnum:\n yield int_enum_validator\n return\n if is_namedtuple(type_):\n yield tuple_validator\n yield make_namedtuple_validator(type_, config)\n return\n if is_typeddict(type_):\n yield make_typeddict_validator(type_, config)\n return\n\n class_ = get_class(type_)\n if class_ is not None:\n if class_ is not Any and isinstance(class_, type):\n yield make_class_validator(class_)\n else:\n yield any_class_validator\n return\n\n for val_type, validators in _VALIDATORS:\n try:\n if issubclass(type_, val_type):\n for v in validators:\n if isinstance(v, IfConfig):\n if v.check(config):\n yield v.validator\n else:\n yield v\n return\n except TypeError:\n raise RuntimeError(f'error checking inheritance of {type_!r} (type: {display_as_type(type_)})')\n\n if config.arbitrary_types_allowed:\n yield make_arbitrary_type_validator(type_)\n else:\n raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in 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/v1/version.py___all___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/version.py___all___", "embedding": null, "metadata": {"file_path": "pydantic/v1/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["impl", "version_info"], "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": "__all__ = 'compiled', 'VERSION', 'version_info'\n\nVERSION = '1.10.14'\n\ntry:\n import cython # type: ignore\nexcept ImportError:\n compiled: bool = False\nelse: # pragma: no cover\n try:\n compiled = cython.compiled\n except AttributeError:\n compiled = False\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', 'dotenv', '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 'pydantic compiled': compiled,\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/mypy/modules/metaclass_args.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/metaclass_args.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/metaclass_args.py", "file_name": "metaclass_args.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["impl:3", "impl:4", "NoArguments", "impl", "imports", "ConfigClassUsed.Config", "impl:2", "MetaclassArgumentsWithDefault", "MetaclassArgumentsNoDefault", "ConfigClassUsed"], "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": "from pydantic import BaseModel, Field\n\n\nclass ConfigClassUsed(BaseModel):\n i: int = Field(2, alias='j')\n\n class Config:\n populate_by_name = True\n\n\nConfigClassUsed(i=None)\n\n\nclass MetaclassArgumentsNoDefault(BaseModel, populate_by_name=True):\n i: int = Field(alias='j')\n\n\nMetaclassArgumentsNoDefault(i=None)\n\n\nclass MetaclassArgumentsWithDefault(BaseModel, populate_by_name=True):\n i: int = Field(2, alias='j')\n\n\nMetaclassArgumentsWithDefault(i=None)\n\n\nclass NoArguments(BaseModel):\n i: int = Field(2, alias='j')\n\n\nNoArguments(i=1)\nNoArguments(j=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_aliases.py_test_aliases_priority_test_aliases_priority.assert_model_model_dump_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_aliases_priority_test_aliases_priority.assert_model_model_dump_b", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 241, "end_line": 287, "span_ids": ["test_aliases_priority"], "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": "@pytest.mark.parametrize(\n 'cls_params, field_params, validation_key, serialization_key',\n [\n pytest.param(\n {},\n {'alias': 'x1', 'validation_alias': 'x2'},\n 'x2',\n 'x1',\n id='alias-validation_alias',\n ),\n pytest.param(\n {'alias_generator': str.upper},\n {'alias': 'x'},\n 'x',\n 'x',\n id='alias_generator-alias',\n ),\n pytest.param(\n {'alias_generator': str.upper},\n {'alias': 'x1', 'validation_alias': 'x2'},\n 'x2',\n 'x1',\n id='alias_generator-alias-validation_alias',\n ),\n pytest.param(\n {'alias_generator': str.upper},\n {'alias': 'x1', 'serialization_alias': 'x2'},\n 'x1',\n 'x2',\n id='alias_generator-alias-serialization_alias',\n ),\n pytest.param(\n {'alias_generator': str.upper},\n {'alias': 'x1', 'validation_alias': 'x2', 'serialization_alias': 'x3'},\n 'x2',\n 'x3',\n id='alias_generator-alias-validation_alias-serialization_alias',\n ),\n ],\n)\ndef test_aliases_priority(cls_params, field_params, validation_key, serialization_key):\n class Model(BaseModel, **cls_params):\n x: int = Field(**field_params)\n\n model = Model(**{validation_key: 1})\n assert model.x == 1\n assert model.model_dump(by_alias=True).get(serialization_key, None) 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/tests/test_aliases.py_test_serialization_alias_test_serialization_alias_from_alias.assert_foo_in_sig_param": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_serialization_alias_test_serialization_alias_from_alias.assert_foo_in_sig_param", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 418, "end_line": 451, "span_ids": ["test_serialization_alias", "test_serialization_alias_with_alias", "test_serialization_alias_from_alias"], "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_serialization_alias():\n class Model(BaseModel):\n x: str = Field(serialization_alias='foo')\n\n m = Model(x='bar')\n assert m.x == 'bar'\n assert m.model_dump() == {'x': 'bar'}\n assert m.model_dump(by_alias=True) == {'foo': 'bar'}\n\n\ndef test_serialization_alias_with_alias():\n class Model(BaseModel):\n x: str = Field(alias='x_alias', serialization_alias='foo')\n\n data = {'x_alias': 'bar'}\n m = Model(**data)\n assert m.x == 'bar'\n assert m.model_dump() == {'x': 'bar'}\n assert m.model_dump(by_alias=True) == {'foo': 'bar'}\n sig = signature(Model)\n assert 'x_alias' in sig.parameters\n\n\ndef test_serialization_alias_from_alias():\n class Model(BaseModel):\n x: str = Field(alias='foo')\n\n data = {'foo': 'bar'}\n m = Model(**data)\n assert m.x == 'bar'\n assert m.model_dump() == {'x': 'bar'}\n assert m.model_dump(by_alias=True) == {'foo': 'bar'}\n sig = signature(Model)\n assert 'foo' in sig.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_aliases.py_test_aliases_json_schema_test_aliases_json_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_aliases.py_test_aliases_json_schema_test_aliases_json_schema.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 454, "end_line": 487, "span_ids": ["test_aliases_json_schema"], "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": "@pytest.mark.parametrize(\n 'field,expected',\n [\n pytest.param(\n Field(alias='x_alias', validation_alias='x_val_alias', serialization_alias='x_ser_alias'),\n {\n 'properties': {'x_val_alias': {'title': 'X Val Alias', 'type': 'string'}},\n 'required': ['x_val_alias'],\n },\n id='single_alias',\n ),\n pytest.param(\n Field(validation_alias=AliasChoices('y_alias', 'another_alias')),\n {\n 'properties': {'y_alias': {'title': 'Y Alias', 'type': 'string'}},\n 'required': ['y_alias'],\n },\n id='multiple_aliases',\n ),\n pytest.param(\n Field(validation_alias=AliasChoices(AliasPath('z_alias', 'even_another_alias'), 'and_another')),\n {\n 'properties': {'and_another': {'title': 'And Another', 'type': 'string'}},\n 'required': ['and_another'],\n },\n id='multiple_aliases_with_path',\n ),\n ],\n)\ndef test_aliases_json_schema(field, expected):\n class Model(BaseModel):\n x: str = field\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': 'object', **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_computed_fields.py_test_computed_fields_missing_return_type_test_computed_fields_missing_return_type.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_missing_return_type_test_computed_fields_missing_return_type.None_1", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 523, "end_line": 537, "span_ids": ["test_computed_fields_missing_return_type"], "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_computed_fields_missing_return_type():\n with pytest.raises(PydanticUserError, match='Computed field is missing return type annotation'):\n\n class _Model(BaseModel):\n @computed_field\n def cfield(self):\n raise NotImplementedError\n\n class Model(BaseModel):\n @computed_field(return_type=CustomType)\n def cfield(self):\n return CustomType('abc')\n\n assert Model().model_dump() == {'cfield': '123'}\n assert Model().model_dump_json() == '{\"cfield\":\"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_computed_fields.py_test_alias_generator_test_alias_generator.MyModel.my_aliased_computed_field_2.return.self_my_standard_field_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_alias_generator_test_alias_generator.MyModel.my_aliased_computed_field_2.return.self_my_standard_field_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 540, "end_line": 562, "span_ids": ["test_alias_generator"], "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_alias_generator():\n class MyModel(BaseModel):\n my_standard_field: int\n\n @computed_field # *will* be overridden by alias generator\n @property\n def my_computed_field(self) -> int:\n return self.my_standard_field + 1\n\n @computed_field(alias='my_alias_none') # will *not* be overridden by alias generator\n @property\n def my_aliased_computed_field_none(self) -> int:\n return self.my_standard_field + 2\n\n @computed_field(alias='my_alias_1', alias_priority=1) # *will* be overridden by alias generator\n @property\n def my_aliased_computed_field_1(self) -> int:\n return self.my_standard_field + 3\n\n @computed_field(alias='my_alias_2', alias_priority=2) # will *not* be overridden by alias generator\n @property\n def my_aliased_computed_field_2(self) -> int:\n return self.my_standard_field + 4\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_computed_fields.py_test_alias_generator.MySubModel_test_alias_generator.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_alias_generator.MySubModel_test_alias_generator.None_3", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 564, "end_line": 597, "span_ids": ["test_alias_generator"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_alias_generator():\n # ... other code\n\n class MySubModel(MyModel):\n model_config = dict(alias_generator=to_camel, populate_by_name=True)\n\n model = MyModel(my_standard_field=1)\n assert model.model_dump() == {\n 'my_standard_field': 1,\n 'my_computed_field': 2,\n 'my_aliased_computed_field_none': 3,\n 'my_aliased_computed_field_1': 4,\n 'my_aliased_computed_field_2': 5,\n }\n assert model.model_dump(by_alias=True) == {\n 'my_standard_field': 1,\n 'my_computed_field': 2,\n 'my_alias_none': 3,\n 'my_alias_1': 4,\n 'my_alias_2': 5,\n }\n\n submodel = MySubModel(my_standard_field=1)\n assert submodel.model_dump() == {\n 'my_standard_field': 1,\n 'my_computed_field': 2,\n 'my_aliased_computed_field_none': 3,\n 'my_aliased_computed_field_1': 4,\n 'my_aliased_computed_field_2': 5,\n }\n assert submodel.model_dump(by_alias=True) == {\n 'myStandardField': 1,\n 'myComputedField': 2,\n 'my_alias_none': 3,\n 'myAliasedComputedField1': 4,\n 'my_alias_2': 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_computed_fields.py_make_base_model_make_typed_dict.return.Model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_make_base_model_make_typed_dict.return.Model", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 600, "end_line": 652, "span_ids": ["make_dataclass", "make_base_model", "make_typed_dict"], "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": "def make_base_model() -> Any:\n class CompModel(BaseModel):\n pass\n\n class Model(BaseModel):\n @computed_field\n @property\n def comp_1(self) -> CompModel:\n return CompModel()\n\n @computed_field\n @property\n def comp_2(self) -> CompModel:\n return CompModel()\n\n return Model\n\n\ndef make_dataclass() -> Any:\n class CompModel(BaseModel):\n pass\n\n @dataclasses.dataclass\n class Model:\n @computed_field\n @property\n def comp_1(self) -> CompModel:\n return CompModel()\n\n @computed_field\n @property\n def comp_2(self) -> CompModel:\n return CompModel()\n\n return Model\n\n\ndef make_typed_dict() -> Any:\n class CompModel(BaseModel):\n pass\n\n class Model(TypedDict):\n @computed_field # type: ignore\n @property\n def comp_1(self) -> CompModel:\n return CompModel()\n\n @computed_field # type: ignore\n @property\n def comp_2(self) -> CompModel:\n return CompModel()\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_config.py_TestsBaseConfig.test_immutable_copy_with_frozen_TestsBaseConfig.test_config_class_attributes_are_deprecated.None_4.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_4.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": 337, "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": 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 TestsBaseConfig:\n\n def test_immutable_copy_with_frozen(self):\n class Model(BaseModel):\n a: int\n b: int\n\n model_config = ConfigDict(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 PydanticDeprecatedSince20, match='Support for class-based `config` is deprecated, use ConfigDict instead.'\n ):\n\n class Config(BaseConfig):\n pass\n\n def test_config_class_attributes_are_deprecated(self):\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='Support for class-based `config` is deprecated, use ConfigDict instead.',\n ):\n assert BaseConfig.validate_assignment is False\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='Support for class-based `config` is deprecated, use ConfigDict instead.',\n ):\n assert BaseConfig().validate_assignment is False\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='Support for class-based `config` is deprecated, use ConfigDict instead.',\n ):\n\n class Config(BaseConfig):\n pass\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='Support for class-based `config` is deprecated, use ConfigDict instead.',\n ):\n assert Config.validate_assignment is False\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='Support for class-based `config` is deprecated, use ConfigDict instead.',\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_test_hide_input_in_errors_test_hide_input_in_errors.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_hide_input_in_errors_test_hide_input_in_errors.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 557, "end_line": 572, "span_ids": ["test_hide_input_in_errors"], "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": "@pytest.mark.parametrize(\n 'config,input_str',\n (\n ({}, 'type=string_type, input_value=123, input_type=int'),\n ({'hide_input_in_errors': False}, 'type=string_type, input_value=123, input_type=int'),\n ({'hide_input_in_errors': True}, 'type=string_type'),\n ),\n)\ndef test_hide_input_in_errors(config, input_str):\n class Model(BaseModel):\n x: str\n\n model_config = ConfigDict(**config)\n\n with pytest.raises(ValidationError, match=re.escape(f'Input should be a valid string [{input_str}]')):\n Model(x=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_config.py_parametrize_inf_nan_capable_type_test_config_inf_nan_enabled.assert_Model_value_inf_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_parametrize_inf_nan_capable_type_test_config_inf_nan_enabled.assert_Model_value_inf_na", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 575, "end_line": 586, "span_ids": ["impl:3", "test_config_inf_nan_enabled"], "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": "parametrize_inf_nan_capable_type = pytest.mark.parametrize('inf_nan_capable_type', [float, Decimal])\nparametrize_inf_nan_capable_value = pytest.mark.parametrize('inf_nan_value', ['Inf', 'NaN'])\n\n\n@parametrize_inf_nan_capable_value\n@parametrize_inf_nan_capable_type\ndef test_config_inf_nan_enabled(inf_nan_capable_type, inf_nan_value):\n class Model(BaseModel):\n model_config = ConfigDict(allow_inf_nan=True)\n value: inf_nan_capable_type\n\n assert Model(value=inf_nan_capable_type(inf_nan_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_test_config_inf_nan_disabled_test_config_inf_nan_disabled.assert_e_value_errors_inc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_inf_nan_disabled_test_config_inf_nan_disabled.assert_e_value_errors_inc", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 589, "end_line": 605, "span_ids": ["test_config_inf_nan_disabled"], "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": "@parametrize_inf_nan_capable_value\n@parametrize_inf_nan_capable_type\ndef test_config_inf_nan_disabled(inf_nan_capable_type, inf_nan_value):\n class Model(BaseModel):\n model_config = ConfigDict(allow_inf_nan=False)\n value: inf_nan_capable_type\n\n with pytest.raises(ValidationError) as e:\n Model(value=inf_nan_capable_type(inf_nan_value))\n\n assert e.value.errors(include_url=False)[0] == IsPartialDict(\n {\n 'loc': ('value',),\n 'msg': 'Input should be a finite number',\n 'type': 'finite_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_construction.py_test_copy_undefined_test_immutable_copy_with_frozen.with_pytest_raises_Valida.m2.b.13": {"__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_immutable_copy_with_frozen.with_pytest_raises_Valida.m2.b.13", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 356, "end_line": 379, "span_ids": ["test_copy_undefined", "test_immutable_copy_with_frozen"], "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_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_ = PydanticUndefined\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 assert repr(m) == 'Model(a=40, b=10)'\n\n m2 = copy_method(m, update={'b': 12})\n assert repr(m2) == 'Model(a=40, b=12)'\n with pytest.raises(ValidationError):\n m2.b = 13", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_fields_set_test_pickle_preserves_extra.assert_m2_model_extra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_construction.py_test_pickle_fields_set_test_pickle_preserves_extra.assert_m2_model_extra_", "embedding": null, "metadata": {"file_path": "tests/test_construction.py", "file_name": "test_construction.py", "file_type": "text/x-python", "category": "test", "start_line": 383, "end_line": 394, "span_ids": ["test_pickle_fields_set", "test_pickle_preserves_extra"], "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_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}\n\n\ndef test_pickle_preserves_extra():\n m = ExtraModel(a=24)\n assert m.model_extra == {'a': 24}\n m2 = pickle.loads(pickle.dumps(m))\n assert m2.model_extra == {'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_create_model.py_platform_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_platform_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": 36, "span_ids": ["imports", "test_create_model"], "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": "import platform\nimport re\nfrom typing import Generic, Optional, Tuple, TypeVar\n\nimport pytest\nfrom typing_extensions import Annotated\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n Field,\n PrivateAttr,\n PydanticDeprecatedSince20,\n PydanticUserError,\n ValidationError,\n create_model,\n errors,\n field_validator,\n validator,\n)\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__.validators\n assert not model.__pydantic_decorators__.root_validators\n assert not model.__pydantic_decorators__.field_validators\n assert not model.__pydantic_decorators__.field_serializers\n\n assert model.__module__ == 'tests.test_create_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_create_model.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_create_model.py_test_inheritance_test_inheritance.None_3", "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": 96, "end_line": 110, "span_ids": ["test_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": "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}\n\n # bases as a tuple\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_private_descriptors_test_private_descriptors.MyDescriptor.__delete__.self.fn.fail": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_descriptors_test_private_descriptors.MyDescriptor.__delete__.self.fn.fail", "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": 265, "end_line": 299, "span_ids": ["test_private_descriptors"], "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": "@pytest.mark.parametrize('base', [ModelPrivateAttr, object])\n@pytest.mark.parametrize('use_annotation', [True, False])\ndef test_private_descriptors(base, use_annotation):\n set_name_calls = []\n get_calls = []\n set_calls = []\n delete_calls = []\n\n class MyDescriptor(base):\n def __init__(self, fn):\n super().__init__()\n self.fn = fn\n self.name = ''\n\n def __set_name__(self, owner, name):\n set_name_calls.append((owner, name))\n self.name = name\n\n def __get__(self, obj, type=None):\n get_calls.append((obj, type))\n return self.fn(obj) if obj else self\n\n def __set__(self, obj, value):\n set_calls.append((obj, value))\n self.fn = lambda obj: value\n\n def __delete__(self, obj):\n delete_calls.append(obj)\n\n def fail(obj):\n # I have purposely not used the exact formatting you'd get if the attribute wasn't defined,\n # to make it clear this function is being called, while also having sensible behavior\n raise AttributeError(f'{self.name!r} is not defined on {obj!r}')\n\n self.fn = fail\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_create_model.py_test_private_attr_set_name_test_private_attr_set_name.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_attr_set_name_test_private_attr_set_name.None_4", "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": 344, "end_line": 363, "span_ids": ["test_private_attr_set_name"], "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_private_attr_set_name():\n class SetNameInt(int):\n _owner_attr_name: Optional[str] = None\n\n def __set_name__(self, owner, name):\n self._owner_attr_name = f'{owner.__name__}.{name}'\n\n _private_attr_default = SetNameInt(1)\n\n class Model(BaseModel):\n _private_attr_1: int = PrivateAttr(default=_private_attr_default)\n _private_attr_2: SetNameInt = SetNameInt(2)\n\n assert _private_attr_default._owner_attr_name == 'Model._private_attr_1'\n\n m = Model()\n assert m._private_attr_1 == 1\n assert m._private_attr_1._owner_attr_name == 'Model._private_attr_1'\n assert m._private_attr_2 == 2\n assert m._private_attr_2._owner_attr_name == 'Model._private_attr_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_private_attr_default_descriptor_attribute_error_test_private_attr_default_descriptor_attribute_error.with_pytest_raises_Attrib.Model___private_attribute": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_attr_default_descriptor_attribute_error_test_private_attr_default_descriptor_attribute_error.with_pytest_raises_Attrib.Model___private_attribute", "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": 366, "end_line": 379, "span_ids": ["test_private_attr_default_descriptor_attribute_error"], "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_private_attr_default_descriptor_attribute_error():\n class SetNameInt(int):\n def __get__(self, obj, cls):\n return self\n\n _private_attr_default = SetNameInt(1)\n\n class Model(BaseModel):\n _private_attr: int = PrivateAttr(default=_private_attr_default)\n\n assert Model.__private_attributes__['_private_attr'].__get__(None, Model) == _private_attr_default\n\n with pytest.raises(AttributeError, match=\"'ModelPrivateAttr' object has no attribute 'some_attr'\"):\n Model.__private_attributes__['_private_attr'].some_attr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_value_test_default_value_ellipsis.with_pytest_raises_Valida.MyDataclass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_default_value_test_default_value_ellipsis.with_pytest_raises_Valida.MyDataclass_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 732, "end_line": 753, "span_ids": ["test_default_value_ellipsis", "test_default_value"], "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('default', [1, None])\ndef test_default_value(default):\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n v: int = default\n\n assert dataclasses.asdict(MyDataclass()) == {'v': default}\n assert dataclasses.asdict(MyDataclass(v=42)) == {'v': 42}\n\n\ndef test_default_value_ellipsis():\n \"\"\"\n https://github.com/pydantic/pydantic/issues/5488\n \"\"\"\n\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n v: int = ...\n\n assert dataclasses.asdict(MyDataclass(v=42)) == {'v': 42}\n with pytest.raises(ValidationError, match='type=missing'):\n MyDataclass()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_json_schema_with_computed_field_test_json_schema_with_computed_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_json_schema_with_computed_field_test_json_schema_with_computed_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": 1214, "end_line": 1257, "span_ids": ["test_json_schema_with_computed_field"], "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_json_schema_with_computed_field():\n @dataclasses.dataclass\n class MyDataclass:\n x: int\n\n @computed_field\n @property\n def double_x(self) -> int:\n return 2 * self.x\n\n class Model(BaseModel):\n dc: MyDataclass\n\n assert Model.model_json_schema(mode='validation') == {\n '$defs': {\n 'MyDataclass': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'MyDataclass',\n 'type': 'object',\n }\n },\n 'properties': {'dc': {'$ref': '#/$defs/MyDataclass'}},\n 'required': ['dc'],\n 'title': 'Model',\n 'type': 'object',\n }\n assert Model.model_json_schema(mode='serialization') == {\n '$defs': {\n 'MyDataclass': {\n 'properties': {\n 'double_x': {'readOnly': True, 'title': 'Double X', 'type': 'integer'},\n 'x': {'title': 'X', 'type': 'integer'},\n },\n 'required': ['x', 'double_x'],\n 'title': 'MyDataclass',\n 'type': 'object',\n }\n },\n 'properties': {'dc': {'$ref': '#/$defs/MyDataclass'}},\n 'required': ['dc'],\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_dataclasses.py_test_new_not_called_test_new_not_called.assert_pyd_instance_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_new_not_called_test_new_not_called.assert_pyd_instance_a_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1399, "end_line": 1427, "span_ids": ["test_new_not_called"], "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_new_not_called():\n \"\"\"\n pydantic dataclasses do not preserve sunder attributes set in __new__\n \"\"\"\n\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 test_string = 'string'\n\n std_instance = StandardLibDataclass(a=test_string)\n assert std_instance._special_property == 1\n assert std_instance.a == test_string\n\n pyd_instance = PydanticDataclass(a=test_string)\n assert not hasattr(pyd_instance, '_special_property')\n assert pyd_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_cyclic_reference_dataclass_test_cyclic_reference_dataclass.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_cyclic_reference_dataclass_test_cyclic_reference_dataclass.None_6", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1515, "end_line": 1569, "span_ids": ["test_cyclic_reference_dataclass"], "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_cyclic_reference_dataclass(create_module):\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra='forbid'))\n class D1:\n d2: Optional['D2'] = None\n\n @create_module\n def module():\n from typing import Optional\n\n import pydantic\n\n @pydantic.dataclasses.dataclass(config=pydantic.ConfigDict(extra='forbid'))\n class D2:\n d1: Optional['D1'] = None\n\n # Ensure D2 is in the local namespace; note everything works even though it wasn't _defined_ in this namespace\n D2 = module.D2\n\n # Confirm D1 and D2 require rebuilding\n assert isinstance(D1.__pydantic_validator__, MockValSer)\n assert isinstance(D2.__pydantic_validator__, MockValSer)\n\n # Note: the rebuilds of D1 and D2 happen automatically, and works since it grabs the locals here as the namespace,\n # which contains D1 and D2\n instance = D1(d2=D2(d1=D1(d2=D2(d1=D1()))))\n\n # Confirm D1 and D2 have been rebuilt\n assert isinstance(D1.__pydantic_validator__, SchemaValidator)\n assert isinstance(D2.__pydantic_validator__, SchemaValidator)\n\n assert TypeAdapter(D1).dump_python(instance) == {'d2': {'d1': {'d2': {'d1': {'d2': None}}}}}\n\n with pytest.raises(ValidationError) as exc_info:\n D2(d1=D2())\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'dataclass_type',\n 'loc': ('d1',),\n 'msg': 'Input should be a dictionary or an instance of D1',\n 'input': D2(d1=None),\n 'ctx': {'class_name': 'D1'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n TypeAdapter(D1).validate_python(dict(d2=dict(d1=dict(d2=dict(d2=dict())))))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': {},\n 'loc': ('d2', 'd1', 'd2', 'd2'),\n 'msg': 'Unexpected keyword argument',\n 'type': 'unexpected_keyword_argument',\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_cross_module_cyclic_reference_dataclass_test_cross_module_cyclic_reference_dataclass.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_cross_module_cyclic_reference_dataclass_test_cross_module_cyclic_reference_dataclass.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": 1572, "end_line": 1632, "span_ids": ["test_cross_module_cyclic_reference_dataclass"], "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": "def test_cross_module_cyclic_reference_dataclass(create_module):\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra='forbid'))\n class D1:\n d2: Optional['D2'] = None # noqa F821\n\n @create_module\n def module():\n from typing import Optional\n\n import pydantic\n\n @pydantic.dataclasses.dataclass(config=pydantic.ConfigDict(extra='forbid'))\n class D2:\n d1: Optional['D1'] = None\n\n # Since D2 is not in locals, it will not be picked up by the auto-rebuild:\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n '`D1` is not fully defined; you should define `D2`, then call'\n ' `pydantic.dataclasses.rebuild_dataclass(D1)`.'\n ),\n ):\n D1()\n\n # Explicitly rebuild D1, specifying the appropriate types namespace\n rebuild_dataclass(D1, _types_namespace={'D2': module.D2, 'D1': D1})\n\n # Confirm D2 still requires a rebuild (it will happen automatically)\n assert isinstance(module.D2.__pydantic_validator__, MockValSer)\n\n instance = D1(d2=module.D2(d1=D1(d2=module.D2(d1=D1()))))\n\n # Confirm auto-rebuild of D2 has now happened\n assert isinstance(module.D2.__pydantic_validator__, SchemaValidator)\n\n assert TypeAdapter(D1).dump_python(instance) == {'d2': {'d1': {'d2': {'d1': {'d2': None}}}}}\n\n with pytest.raises(ValidationError) as exc_info:\n module.D2(d1=module.D2())\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'dataclass_type',\n 'input': module.D2(d1=None),\n 'loc': ('d1',),\n 'msg': 'Input should be a dictionary or an instance of D1',\n 'ctx': {'class_name': 'D1'},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n TypeAdapter(D1).validate_python(dict(d2=dict(d1=dict(d2=dict(d2=dict())))))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': {},\n 'loc': ('d2', 'd1', 'd2', 'd2'),\n 'msg': 'Unexpected keyword argument',\n 'type': 'unexpected_keyword_argument',\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_kw_only_inheritance_test_kw_only_inheritance.assert_child_y_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_kw_only_inheritance_test_kw_only_inheritance.assert_child_y_1", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1670, "end_line": 1685, "span_ids": ["test_kw_only_inheritance"], "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": "@pytest.mark.skipif(sys.version_info < (3, 10), reason='kw_only is not available in python < 3.10')\n@pytest.mark.parametrize('decorator1', **dataclass_decorators(exclude_combined=True))\n@pytest.mark.parametrize('decorator2', **dataclass_decorators(exclude_combined=True))\ndef test_kw_only_inheritance(decorator1, decorator2):\n # Exclude combined from the decorators since it doesn't know how to accept kw_only\n @decorator1(kw_only=True)\n class Parent:\n x: int\n\n @decorator2\n class Child(Parent):\n y: int\n\n child = Child(1, x=2)\n assert child.x == 2\n assert child.y == 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_extra_forbid_list_no_error_test_model_validator_after.assert_d_b_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_extra_forbid_list_no_error_test_model_validator_after.assert_d_b_4", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1709, "end_line": 1775, "span_ids": ["test_model_validator_after", "test_extra_forbid_list_no_error", "test_field_validator", "test_extra_forbid_list_error", "test_model_validator_before"], "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_extra_forbid_list_no_error():\n @pydantic.dataclasses.dataclass(config=dict(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='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_field_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\n\n\ndef test_model_validator_before():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n b: float\n\n @model_validator(mode='before')\n def double_b(cls, v: ArgsKwargs):\n v.kwargs['b'] *= 2\n return v\n\n d = MyDataclass('1', b='2')\n assert d.a == 1\n assert d.b == 22.0\n\n\ndef test_model_validator_after():\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n a: int\n b: float\n\n @model_validator(mode='after')\n def double_b(self) -> 'MyDataclass':\n self.b *= 2\n return self\n\n d = MyDataclass('1', b='2')\n assert d.a == 1\n assert d.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_dataclasses.py_test_dataclass_alias_generator_test_dataclass_alias_generator.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_dataclass_alias_generator_test_dataclass_alias_generator.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": 2098, "end_line": 2126, "span_ids": ["test_dataclass_alias_generator"], "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_dataclass_alias_generator():\n def alias_generator(name: str) -> str:\n return 'alias_' + name\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(alias_generator=alias_generator))\n class User:\n name: str\n score: int = Field(alias='my_score')\n\n user = User(**{'alias_name': 'test name', 'my_score': 2})\n assert user.name == 'test name'\n assert user.score == 2\n\n with pytest.raises(ValidationError) as exc_info:\n User(name='test name', score=2)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing',\n 'loc': ('alias_name',),\n 'msg': 'Field required',\n 'input': ArgsKwargs((), {'name': 'test name', 'score': 2}),\n },\n {\n 'type': 'missing',\n 'loc': ('my_score',),\n 'msg': 'Field required',\n 'input': ArgsKwargs((), {'name': 'test name', 'score': 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_dataclasses.py_test_init_vars_inheritance_test_init_vars_inheritance.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_init_vars_inheritance_test_init_vars_inheritance.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": 2172, "end_line": 2199, "span_ids": ["test_init_vars_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_init_vars_inheritance():\n init_vars = []\n\n @pydantic.dataclasses.dataclass\n class Foo:\n init: 'InitVar[int]'\n\n @pydantic.dataclasses.dataclass\n class Bar(Foo):\n arg: int\n\n def __post_init__(self, init: int) -> None:\n init_vars.append(init)\n\n bar = Bar(init=1, arg=2)\n assert TypeAdapter(Bar).dump_python(bar) == {'arg': 2}\n assert init_vars == [1]\n\n with pytest.raises(ValidationError) as exc_info:\n Bar(init='a', arg=2)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'a',\n 'loc': ('init',),\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_dataclasses.py_test_init_vars_call_monkeypatch_test_init_vars_call_monkeypatch.assert_stack_depth_1_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_vars_call_monkeypatch_test_init_vars_call_monkeypatch.assert_stack_depth_1_i", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2160, "end_line": 2175, "span_ids": ["test_init_vars_call_monkeypatch"], "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": "@pytest.mark.skipif(not hasattr(pydantic.dataclasses, '_call_initvar'), reason='InitVar was not modified')\n@pytest.mark.parametrize('remove_monkeypatch', [True, False])\ndef test_init_vars_call_monkeypatch(remove_monkeypatch, monkeypatch):\n # Parametrizing like this allows us to test that the behavior is the same with or without the monkeypatch\n\n if remove_monkeypatch:\n monkeypatch.delattr(InitVar, '__call__')\n\n InitVar(int) # this is what is produced by InitVar[int]; note monkeypatching __call__ doesn't break this\n\n with pytest.raises(TypeError, match=\"'InitVar' object is not callable\") as exc:\n InitVar[int]()\n\n # Check that the custom __call__ was called precisely if the monkeypatch was not removed\n stack_depth = len(traceback.extract_tb(exc.value.__traceback__))\n assert stack_depth == 1 if remove_monkeypatch else 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_decorators_in_model_field_test_decorators_in_model_field.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_decorators_in_model_field_test_decorators_in_model_field.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2178, "end_line": 2212, "span_ids": ["test_decorators_in_model_field"], "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": "@pytest.mark.parametrize('decorator1', **dataclass_decorators())\n@pytest.mark.parametrize('decorator2', **dataclass_decorators())\ndef test_decorators_in_model_field(decorator1, decorator2):\n @decorator1\n class Demo1:\n int1: int\n\n @field_validator('int1', mode='before')\n def set_int_1(cls, v):\n return v + 100\n\n @field_serializer('int1')\n def serialize_int_1(self, v):\n return v + 10\n\n @decorator2\n class Demo2(Demo1):\n int2: int\n\n @field_validator('int2', mode='before')\n def set_int_2(cls, v):\n return v + 200\n\n @field_serializer('int2')\n def serialize_int_2(self, v):\n return v + 20\n\n class Model(BaseModel):\n x: Demo2\n\n m = Model.model_validate(dict(x=dict(int1=1, int2=2)))\n assert m.x.int1 == 101\n assert m.x.int2 == 202\n\n assert m.model_dump() == {'x': {'int1': 111, 'int2': 222}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_vanilla_dataclass_decorators_in_type_adapter_test_vanilla_dataclass_decorators_in_type_adapter.assert_adapter_dump_pytho": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_vanilla_dataclass_decorators_in_type_adapter_test_vanilla_dataclass_decorators_in_type_adapter.assert_adapter_dump_pytho", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2215, "end_line": 2248, "span_ids": ["test_vanilla_dataclass_decorators_in_type_adapter"], "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": "@pytest.mark.parametrize('decorator1', **dataclass_decorators())\n@pytest.mark.parametrize('decorator2', **dataclass_decorators())\ndef test_vanilla_dataclass_decorators_in_type_adapter(decorator1, decorator2):\n @decorator1\n class Demo1:\n int1: int\n\n @field_validator('int1', mode='before')\n def set_int_1(cls, v):\n return v + 100\n\n @field_serializer('int1')\n def serialize_int_1(self, v):\n return v + 10\n\n @decorator2\n class Demo2(Demo1):\n int2: int\n\n @field_validator('int2', mode='before')\n def set_int_2(cls, v):\n return v + 200\n\n @field_serializer('int2')\n def serialize_int_2(self, v):\n return v + 20\n\n adapter = TypeAdapter(Demo2)\n\n m = adapter.validate_python(dict(int1=1, int2=2))\n assert m.int1 == 101\n assert m.int2 == 202\n\n assert adapter.dump_python(m) == {'int1': 111, 'int2': 222}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_slots_test_dataclass_slots.assert_dc_b_bar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_slots_test_dataclass_slots.assert_dc_b_bar_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2251, "end_line": 2268, "span_ids": ["test_dataclass_slots"], "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 'dataclass_decorator',\n [\n pydantic.dataclasses.dataclass,\n dataclasses.dataclass,\n ],\n ids=['pydantic', 'stdlib'],\n)\n@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')\ndef test_dataclass_slots(dataclass_decorator):\n @dataclass_decorator(slots=True)\n class Model:\n a: str\n b: str\n\n dc = TypeAdapter(Model).validate_python({'a': 'foo', 'b': 'bar'})\n assert dc.a == 'foo'\n assert dc.b == 'bar'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_slots_mixed_test_dataclass_slots_mixed.assert_SubModel_z2_z2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_slots_mixed_test_dataclass_slots_mixed.assert_SubModel_z2_z2", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2271, "end_line": 2297, "span_ids": ["test_dataclass_slots_mixed"], "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": "@pytest.mark.parametrize(\n 'dataclass_decorator',\n [\n pydantic.dataclasses.dataclass,\n dataclasses.dataclass,\n ],\n ids=['pydantic', 'stdlib'],\n)\n@pytest.mark.skipif(sys.version_info < (3, 10), reason='slots are only supported for dataclasses in Python >= 3.10')\ndef test_dataclass_slots_mixed(dataclass_decorator):\n @dataclass_decorator(slots=True)\n class Model:\n x: int\n y: dataclasses.InitVar[str]\n z: ClassVar[str] = 'z-classvar'\n\n @dataclass_decorator\n class SubModel(Model):\n x2: int\n y2: dataclasses.InitVar[str]\n z2: ClassVar[str] = 'z2-classvar'\n\n dc = TypeAdapter(SubModel).validate_python({'x': 1, 'y': 'a', 'x2': 2, 'y2': 'b'})\n assert dc.x == 1\n assert dc.x2 == 2\n assert SubModel.z == 'z-classvar'\n assert SubModel.z2 == 'z2-classvar'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_isinstance_validat": {"__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_isinstance_validat", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 239, "span_ids": ["test_root_validator"], "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": "@pytest.mark.filterwarnings('ignore:Pydantic V1 style `@root_validator` validators are deprecated.*:DeprecationWarning')\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 {'x': value.x, 'y': value.y, '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 isinstance(validator_value, TestCls)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_fields_test_fields.None_1.assert_len_m___fields___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_fields_test_fields.None_1.assert_len_m___fields___", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 308, "end_line": 320, "span_ids": ["test_fields"], "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_fields():\n class Model(BaseModel):\n x: int\n y: int = 2\n\n m = Model(x=1)\n assert len(Model.model_fields) == 2\n assert len(m.model_fields) == 2\n match = '^The `__fields__` attribute is deprecated, use `model_fields` instead.'\n with pytest.warns(PydanticDeprecatedSince20, match=match):\n assert len(Model.__fields__) == 2\n with pytest.warns(PydanticDeprecatedSince20, match=match):\n assert len(m.__fields__) == 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_field_const_test_unique_items_conlist.with_pytest_raises_Pydant.Model.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_const_test_unique_items_conlist.with_pytest_raises_Pydant.Model.x", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 427, "end_line": 453, "span_ids": ["test_unique_items_items", "test_field_include_deprecation", "test_field_const", "test_unique_items_conlist"], "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_field_const():\n with pytest.raises(PydanticUserError, match='`const` is removed. use `Literal` instead'):\n\n class Model(BaseModel):\n x: str = Field('test', const=True)\n\n\ndef test_field_include_deprecation():\n m = '`include` is deprecated and does nothing. It will be removed, use `exclude` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: int = Field(include=True)\n\n\ndef test_unique_items_items():\n with pytest.raises(PydanticUserError, match='`unique_items` is removed. use `Set` instead'):\n\n class Model(BaseModel):\n x: List[int] = Field(None, unique_items=True)\n\n\ndef test_unique_items_conlist():\n with pytest.raises(PydanticUserError, match='`unique_items` is removed. use `Set` instead'):\n\n class Model(BaseModel):\n x: conlist(int, unique_items=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_deprecated.py_test_allow_mutation_test_allow_mutation.assert_m_y_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_allow_mutation_test_allow_mutation.assert_m_y_3", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 456, "end_line": 475, "span_ids": ["test_allow_mutation"], "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_allow_mutation():\n m = '`allow_mutation` is deprecated and will be removed. use `frozen` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n model_config = ConfigDict(validate_assignment=True)\n x: int = Field(allow_mutation=False)\n y: int = Field(allow_mutation=True)\n\n m = Model(x=1, y=2)\n\n assert m.x == 1\n with pytest.raises(ValidationError) as exc_info:\n m.x = 2\n assert exc_info.value.errors(include_url=False) == [\n {'input': 2, 'loc': ('x',), 'msg': 'Field is frozen', 'type': 'frozen_field'}\n ]\n\n m.y = 3\n assert m.y == 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_deprecated.py_test_field_extra_arguments_test_field_extra_arguments.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_extra_arguments_test_field_extra_arguments.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 582, "end_line": 594, "span_ids": ["test_field_extra_arguments"], "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_field_extra_arguments():\n m = re.escape(\n 'Using extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. '\n \"(Extra keys: 'test', 'foo')\"\n )\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: str = Field('test', test='test', foo='bar')\n\n assert Model.model_json_schema(by_alias=True)['properties'] == {\n 'x': {'default': 'test', 'foo': 'bar', 'test': 'test', 'title': 'X', 'type': 'string'}\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_deprecated_module_test_deprecated_module.None_8.validate_arguments_test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_deprecated_module_test_deprecated_module.None_8.validate_arguments_test", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 717, "end_line": 775, "span_ids": ["test_deprecated_module"], "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": "def test_deprecated_module(tmp_path: Path) -> None:\n class Model(BaseModel):\n x: int\n\n assert hasattr(parse_obj_as, '__deprecated__')\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='`parse_obj_as` is deprecated. Use `pydantic.TypeAdapter.validate_python` instead.',\n ):\n parse_obj_as(Model, {'x': 1})\n\n assert hasattr(schema_json_of, '__deprecated__')\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='`schema_json_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.',\n ):\n schema_json_of(Model)\n\n assert hasattr(schema_of, '__deprecated__')\n with pytest.warns(\n PydanticDeprecatedSince20, match='`schema_of` is deprecated. Use `pydantic.TypeAdapter.json_schema` instead.'\n ):\n schema_of(Model)\n\n assert hasattr(load_str_bytes, '__deprecated__')\n with pytest.warns(PydanticDeprecatedSince20, match='`load_str_bytes` is deprecated.'):\n load_str_bytes('{\"x\": 1}')\n\n assert hasattr(load_file, '__deprecated__')\n file = tmp_path / 'main.py'\n file.write_text('{\"x\": 1}')\n with pytest.warns(PydanticDeprecatedSince20, match='`load_file` is deprecated.'):\n load_file(file)\n\n assert hasattr(pydantic_encoder, '__deprecated__')\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='`pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead.',\n ):\n pydantic_encoder(Model(x=1))\n\n assert hasattr(custom_pydantic_encoder, '__deprecated__')\n with pytest.warns(\n PydanticDeprecatedSince20, match='`custom_pydantic_encoder` is deprecated, use `BaseModel.model_dump` instead.'\n ):\n custom_pydantic_encoder({int: lambda x: str(x)}, Model(x=1))\n\n assert hasattr(timedelta_isoformat, '__deprecated__')\n with pytest.warns(PydanticDeprecatedSince20, match='`timedelta_isoformat` is deprecated.'):\n timedelta_isoformat(timedelta(seconds=1))\n\n with pytest.warns(\n PydanticDeprecatedSince20, match='The `validate_arguments` method is deprecated; use `validate_call` instead.'\n ):\n\n def test(a: int, b: int):\n pass\n\n validate_arguments()(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_deprecated.py_test_deprecated_color_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_deprecated_color_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 774, "end_line": 791, "span_ids": ["test_deprecated_color", "test_deprecated_payment"], "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_deprecated_color():\n from pydantic.color import Color\n\n with pytest.warns(\n PydanticDeprecatedSince20, match='The `Color` class is deprecated, use `pydantic_extra_types` instead.'\n ):\n Color('red')\n\n\ndef test_deprecated_payment():\n from pydantic import PaymentCardNumber\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead.',\n ):\n PaymentCardNumber('4242424242424242')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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__.convert_to_init_error.return.init_e": {"__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__.convert_to_init_error.return.init_e", "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": 1885, "end_line": 1909, "span_ids": ["test_custom_generic_validators"], "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_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: Any, handler: GetCoreSchemaHandler):\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 = TypeAdapter(args[0]).validate_python\n t2_f = TypeAdapter(args[1]).validate_python\n\n def convert_to_init_error(e: ErrorDetails, loc: str) -> InitErrorDetails:\n init_e = {'type': e['type'], 'loc': e['loc'] + (loc,), 'input': e['input']}\n if 'ctx' in e:\n init_e['ctx'] = e['ctx']\n return init_e\n # ... other code\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_long_int_test_parent_field_with_default.assert_c_c_3": {"__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_parent_field_with_default.assert_c_c_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": 2253, "end_line": 2293, "span_ids": ["test_parent_field_with_default", "test_long_int"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 assert Model(x='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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing_size',\n 'loc': ('x',),\n 'msg': 'Unable to parse input string as an integer, exceeded maximum size',\n 'input': too_long,\n }\n ]\n\n # this used to hang indefinitely\n with pytest.raises(ValidationError):\n Model(x='1' * (10**7))\n\n\ndef 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_abstractmethod_missing_for_all_decorators_test_abstractmethod_missing_for_all_decorators.with_pytest_raises_.Square_side_1_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_abstractmethod_missing_for_all_decorators_test_abstractmethod_missing_for_all_decorators.with_pytest_raises_.Square_side_1_0_", "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": 2300, "end_line": 2373, "span_ids": ["test_abstractmethod_missing_for_all_decorators"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(sys.version_info < (3, 12), reason='error message different on older versions')\n@pytest.mark.parametrize(\n 'bases',\n [\n (BaseModel, ABC),\n (ABC, BaseModel),\n (BaseModel,),\n ],\n)\ndef test_abstractmethod_missing_for_all_decorators(bases):\n class AbstractSquare(*bases):\n side: float\n\n @field_validator('side')\n @classmethod\n @abstractmethod\n def my_field_validator(cls, v):\n raise NotImplementedError\n\n @model_validator(mode='wrap')\n @classmethod\n @abstractmethod\n def my_model_validator(cls, values, handler, info):\n raise NotImplementedError\n\n with pytest.warns(PydanticDeprecatedSince20):\n\n @root_validator(skip_on_failure=True)\n @classmethod\n @abstractmethod\n def my_root_validator(cls, values):\n raise NotImplementedError\n\n with pytest.warns(PydanticDeprecatedSince20):\n\n @validator('side')\n @classmethod\n @abstractmethod\n def my_validator(cls, value, **kwargs):\n raise NotImplementedError\n\n @model_serializer(mode='wrap')\n @abstractmethod\n def my_model_serializer(self, handler, info):\n raise NotImplementedError\n\n @field_serializer('side')\n @abstractmethod\n def my_serializer(self, v, _info):\n raise NotImplementedError\n\n @computed_field\n @property\n @abstractmethod\n def my_computed_field(self) -> Any:\n raise NotImplementedError\n\n class Square(AbstractSquare):\n pass\n\n with pytest.raises(\n TypeError,\n match=(\n \"Can't instantiate abstract class Square without an implementation for abstract methods\"\n \" 'my_computed_field',\"\n \" 'my_field_validator',\"\n \" 'my_model_serializer',\"\n \" 'my_model_validator',\"\n \" 'my_root_validator',\"\n \" 'my_serializer',\"\n \" 'my_validator'\"\n ),\n ):\n Square(side=1.0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_errors.py_re_test_user_error_url.assert_str_exc_info_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_errors.py_re_test_user_error_url.assert_str_exc_info_value", "embedding": null, "metadata": {"file_path": "tests/test_errors.py", "file_name": "test_errors.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_user_error_url"], "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": "import re\n\nimport pytest\n\nfrom pydantic import BaseModel, PydanticUserError, ValidationError\nfrom pydantic.version import version_short\n\n\ndef test_user_error_url():\n with pytest.raises(PydanticUserError) as exc_info:\n BaseModel()\n\n # insert_assert(str(exc_info.value))\n assert str(exc_info.value) == (\n 'Pydantic models should inherit from BaseModel, BaseModel cannot be instantiated directly\\n\\n'\n f'For further information visit https://errors.pydantic.dev/{version_short()}/u/base-model-instantiated'\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_errors.py_test_raise_validation_error_hide_input_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_errors.py_test_raise_validation_error_hide_input_", "embedding": null, "metadata": {"file_path": "tests/test_errors.py", "file_name": "test_errors.py", "file_type": "text/x-python", "category": "test", "start_line": 20, "end_line": 31, "span_ids": ["test_raise_validation_error_hide_input"], "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.parametrize(\n 'hide_input,input_str',\n ((False, 'type=greater_than, input_value=4, input_type=int'), (True, 'type=greater_than')),\n)\ndef test_raise_validation_error_hide_input(hide_input, input_str):\n with pytest.raises(ValidationError, match=re.escape(f'Input should be greater than 5 [{input_str}]')):\n raise ValidationError.from_exception_data(\n 'Foobar',\n [{'type': 'greater_than', 'loc': ('a', 2), 'input': 4, 'ctx': {'gt': 5}}],\n hide_input=hide_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_generics.py_test_generic_with_referenced_generic_type_1_test_generic_with_referenced_generic_type_bound.ReferenceModel_MyInt_": {"__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_referenced_generic_type_bound.ReferenceModel_MyInt_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1430, "end_line": 1458, "span_ids": ["test_generic_with_referenced_generic_type_bound", "test_generic_with_referenced_generic_type_1"], "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_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_generic_type_bound():\n T = TypeVar('T', bound=int)\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 class MyInt(int):\n ...\n\n ReferenceModel[MyInt]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_test_parse_generic_json.assert_serialization_sche": {"__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_test_parse_generic_json.assert_serialization_sche", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2140, "end_line": 2190, "span_ids": ["test_parse_generic_json"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 validation_schema = record.model_json_schema(mode='validation')\n assert validation_schema == {\n '$defs': {\n 'Payload': {\n 'properties': {'payload_field': {'title': 'Payload Field', 'type': 'string'}},\n 'required': ['payload_field'],\n 'title': 'Payload',\n 'type': 'object',\n }\n },\n 'properties': {\n 'message': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'$ref': '#/$defs/Payload'},\n 'title': 'Message',\n 'type': 'string',\n }\n },\n 'required': ['message'],\n 'title': 'MessageWrapper[test_parse_generic_json..Payload]',\n 'type': 'object',\n }\n\n serialization_schema = record.model_json_schema(mode='serialization')\n assert serialization_schema == {\n '$defs': {\n 'Payload': {\n 'properties': {'payload_field': {'title': 'Payload Field', 'type': 'string'}},\n 'required': ['payload_field'],\n 'title': 'Payload',\n 'type': 'object',\n }\n },\n 'properties': {'message': {'allOf': [{'$ref': '#/$defs/Payload'}], 'title': 'Message'}},\n 'required': ['message'],\n 'title': 'MessageWrapper[test_parse_generic_json..Payload]',\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_generics.py_memray_limit_memory_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_memray_limit_memory_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": 2077, "end_line": 2128, "span_ids": ["memray_limit_memory", "test_generics_memory_use"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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')\n\n\n@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_json.py_test_custom_encode_fallback_basemodel_test_recursive.assert_M_value_1_nested_": {"__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_test_recursive.assert_M_value_1_nested_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 325, "end_line": 359, "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_test_enum_includes_extra_without_other_params_test_invalid_json_schema_extra.with_pytest_raises_.MyModel_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_enum_includes_extra_without_other_params_test_invalid_json_schema_extra.with_pytest_raises_.MyModel_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": 403, "end_line": 440, "span_ids": ["test_invalid_json_schema_extra", "test_enum_includes_extra_without_other_params"], "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_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 }\n\n\ndef test_invalid_json_schema_extra():\n class MyModel(BaseModel):\n model_config = ConfigDict(json_schema_extra=1)\n\n name: str\n\n with pytest.raises(\n ValueError, match=re.escape(\"model_config['json_schema_extra']=1 should be a dict, callable, or None\")\n ):\n MyModel.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_decimal_json_schema_test_decimal_json_schema.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_decimal_json_schema_test_decimal_json_schema.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": 503, "end_line": 526, "span_ids": ["test_decimal_json_schema"], "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_decimal_json_schema():\n class Model(BaseModel):\n a: bytes = b'foobar'\n b: Decimal = Decimal('12.34')\n\n model_json_schema_validation = Model.model_json_schema(mode='validation')\n model_json_schema_serialization = Model.model_json_schema(mode='serialization')\n\n assert model_json_schema_validation == {\n 'properties': {\n 'a': {'default': 'foobar', 'format': 'binary', 'title': 'A', 'type': 'string'},\n 'b': {'anyOf': [{'type': 'number'}, {'type': 'string'}], 'default': '12.34', 'title': 'B'},\n },\n 'title': 'Model',\n 'type': 'object',\n }\n assert model_json_schema_serialization == {\n 'properties': {\n 'a': {'default': 'foobar', 'format': 'binary', 'title': 'A', 'type': 'string'},\n 'b': {'default': '12.34', 'title': 'B', 'type': 'string'},\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_optional_test_optional_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_optional_test_optional_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": 552, "end_line": 580, "span_ids": ["test_optional", "test_optional_modify_schema"], "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_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_optional_modify_schema():\n class MyNone(Type[None]):\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source_type: Any, handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n return core_schema.nullable_schema(core_schema.none_schema())\n\n class Model(BaseModel):\n x: MyNone\n\n assert Model.model_json_schema() == {\n 'properties': {'x': {'title': 'X', 'type': 'null'}},\n 'required': ['x'],\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_any_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_any_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": 583, "end_line": 614, "span_ids": ["test_set", "test_any"], "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_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 }\n\n\ndef 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_ta_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_tuple_test_tuple.assert_ta_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": 617, "end_line": 654, "span_ids": ["test_tuple"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n 'field_type,extra_props',\n [\n pytest.param(tuple, {'items': {}}, id='tuple'),\n pytest.param(Tuple, {'items': {}}, id='Tuple'),\n pytest.param(\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 id='Tuple[str, int, Union[str, int, float], float]',\n ),\n pytest.param(Tuple[str], {'prefixItems': [{'type': 'string'}], 'minItems': 1, 'maxItems': 1}, id='Tuple[str]'),\n pytest.param(Tuple[()], {'maxItems': 0, 'minItems': 0}, id='Tuple[()]'),\n pytest.param(Tuple[str, ...], {'items': {'type': 'string'}, 'type': 'array'}, id='Tuple[str, ...]'),\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 }\n\n ta = TypeAdapter(field_type)\n\n assert ta.json_schema() == {'type': 'array', **extra_props}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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.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_json_type_test_json_type.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": 1075, "end_line": 1101, "span_ids": ["test_json_type"], "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_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 'properties': {\n 'a': {'contentMediaType': 'application/json', 'contentSchema': {}, 'title': 'A', 'type': 'string'},\n 'b': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'type': 'integer'},\n 'title': 'B',\n 'type': 'string',\n },\n 'c': {'contentMediaType': 'application/json', 'contentSchema': {}, 'title': 'C', 'type': 'string'},\n },\n 'required': ['a', 'b', 'c'],\n 'title': 'Model',\n 'type': 'object',\n }\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {'a': {'title': 'A'}, 'b': {'title': 'B', 'type': 'integer'}, 'c': {'title': 'C'}},\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_ipvanynetwork_type_test_callable_type.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_ipvanynetwork_type_test_callable_type.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": 1205, "end_line": 1266, "span_ids": ["test_ipvanynetwork_type", "test_callable_type"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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)\n@pytest.mark.parametrize(\n 'base_json_schema,properties',\n [\n (\n {'a': 'b'},\n {\n 'callback': {'title': 'Callback', 'a': 'b'},\n 'foo': {'title': 'Foo', 'type': 'integer'},\n },\n ),\n (\n None,\n {\n 'foo': {'title': 'Foo', 'type': 'integer'},\n },\n ),\n ],\n)\ndef test_callable_type(type_, default_value, base_json_schema, properties):\n class Model(BaseModel):\n callback: type_ = default_value\n foo: int\n\n with pytest.raises(PydanticInvalidForJsonSchema):\n Model.model_json_schema()\n\n class ModelWithOverride(BaseModel):\n callback: Annotated[type_, WithJsonSchema(base_json_schema)] = default_value\n foo: int\n\n if default_value is Ellipsis or base_json_schema is None:\n model_schema = ModelWithOverride.model_json_schema()\n else:\n with pytest.warns(\n PydanticJsonSchemaWarning,\n match='Default value .* is not JSON serializable; excluding'\n r' default from JSON schema \\[non-serializable-default]',\n ):\n model_schema = ModelWithOverride.model_json_schema()\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_tuple_with_extra_schema_test_tuple_with_extra_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_tuple_with_extra_schema_test_tuple_with_extra_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": 2710, "end_line": 2734, "span_ids": ["test_tuple_with_extra_schema"], "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_tuple_with_extra_schema():\n class MyTuple(Tuple[int, str]):\n @classmethod\n def __get_pydantic_core_schema__(cls, _source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.tuple_schema(\n [core_schema.int_schema(), core_schema.str_schema(), core_schema.int_schema()], variadic_item_index=2\n )\n\n class Model(BaseModel):\n x: MyTuple\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'x': {\n 'items': {'type': 'integer'},\n 'minItems': 2,\n 'prefixItems': [{'type': 'integer'}, {'type': 'string'}],\n 'title': 'X',\n 'type': 'array',\n }\n },\n 'required': ['x'],\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_namedtuple_modify_schema_test_namedtuple_modify_schema.assert_Location_model_jso": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_namedtuple_modify_schema_test_namedtuple_modify_schema.assert_Location_model_jso", "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": 3202, "end_line": 3229, "span_ids": ["test_namedtuple_modify_schema"], "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_namedtuple_modify_schema():\n class Coordinates(NamedTuple):\n x: float\n y: float\n\n class CustomCoordinates(Coordinates):\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n schema = handler(source)\n schema['arguments_schema']['metadata']['pydantic_js_prefer_positional_arguments'] = False\n return schema\n\n class Location(BaseModel):\n coords: CustomCoordinates = CustomCoordinates(34, 42)\n\n assert Location.model_json_schema() == {\n '$defs': {\n 'CustomCoordinates': {\n 'additionalProperties': False,\n 'properties': {'x': {'title': 'X', 'type': 'number'}, 'y': {'title': 'Y', 'type': 'number'}},\n 'required': ['x', 'y'],\n 'type': 'object',\n }\n },\n 'properties': {'coords': {'allOf': [{'$ref': '#/$defs/CustomCoordinates'}], 'default': [34, 42]}},\n 'title': 'Location',\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_remove_anyof_redundancy_test_remove_anyof_redundancy.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_remove_anyof_redundancy_test_remove_anyof_redundancy.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": 2899, "end_line": 2926, "span_ids": ["test_remove_anyof_redundancy"], "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_remove_anyof_redundancy() -> None:\n class A:\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n return handler({'type': 'str'})\n\n class B:\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n return handler({'type': 'str'})\n\n class MyModel(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n # Union of two objects should give a JSON with an `anyOf` field, but in this case\n # since the fields are the same, the `anyOf` is removed.\n field: Union[A, B]\n\n assert MyModel.model_json_schema() == {\n 'properties': {'field': {'title': 'Field', 'type': 'string'}},\n 'required': ['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_generate_json_schema_generate_twice_test_generate_json_schema_generate_twice.None_1.generator_generate_defini": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_generate_json_schema_generate_twice_test_generate_json_schema_generate_twice.None_1.generator_generate_defini", "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": 3739, "end_line": 3766, "span_ids": ["test_generate_json_schema_generate_twice"], "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_generate_json_schema_generate_twice():\n generator = GenerateJsonSchema()\n\n class Model(BaseModel):\n title: str\n\n generator.generate(Model.__pydantic_core_schema__)\n\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n 'This JSON schema generator has already been used to generate a JSON schema. '\n 'You must create a new instance of GenerateJsonSchema to generate a new JSON schema.'\n ),\n ):\n generator.generate(Model.__pydantic_core_schema__)\n\n generator = GenerateJsonSchema()\n generator.generate_definitions([(Model, 'validation', Model.__pydantic_core_schema__)])\n\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n 'This JSON schema generator has already been used to generate a JSON schema. '\n 'You must create a new instance of GenerateJsonSchema to generate a new JSON schema.'\n ),\n ):\n generator.generate_definitions([(Model, 'validation', Model.__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_json_schema.py_test_mappings_str_int_json_schema_test_sequence_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_mappings_str_int_json_schema_test_sequence_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": 4183, "end_line": 4214, "span_ids": ["test_sequence_schema", "test_mappings_str_int_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": "@pytest.mark.parametrize('mapping_type', [typing.Dict, typing.Mapping])\ndef test_mappings_str_int_json_schema(mapping_type: Any):\n class Model(BaseModel):\n str_int_map: mapping_type[str, int]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'str_int_map': {\n 'title': 'Str Int Map',\n 'type': 'object',\n 'additionalProperties': {'type': 'integer'},\n }\n },\n 'required': ['str_int_map'],\n }\n\n\n@pytest.mark.parametrize(('sequence_type'), [pytest.param(List), pytest.param(Sequence)])\ndef test_sequence_schema(sequence_type):\n class Model(BaseModel):\n field: sequence_type[int]\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'field': {'items': {'type': 'integer'}, 'title': 'Field', 'type': 'array'},\n },\n 'required': ['field'],\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_sequences_int_json_schema_test_sequences_int_json_schema.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_sequences_int_json_schema_test_sequences_int_json_schema.assert_Model_model_valida", "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": 4217, "end_line": 4234, "span_ids": ["test_sequences_int_json_schema"], "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(('sequence_type',), [pytest.param(List), pytest.param(Sequence)])\ndef test_sequences_int_json_schema(sequence_type):\n class Model(BaseModel):\n int_seq: sequence_type[int]\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'int_seq': {\n 'title': 'Int Seq',\n 'type': 'array',\n 'items': {'type': 'integer'},\n },\n },\n 'required': ['int_seq'],\n }\n assert Model.model_validate_json('{\"int_seq\": [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_json_schema.py_test_arbitrary_type_json_schema_test_arbitrary_type_json_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_arbitrary_type_json_schema_test_arbitrary_type_json_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": 4237, "end_line": 4264, "span_ids": ["test_arbitrary_type_json_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": "@pytest.mark.parametrize(\n 'field_schema,model_schema',\n [\n (None, {'properties': {}, 'title': 'Model', 'type': 'object'}),\n (\n {'a': 'b'},\n {'properties': {'x': {'a': 'b', 'title': 'X'}}, 'required': ['x'], 'title': 'Model', 'type': 'object'},\n ),\n ],\n)\n@pytest.mark.parametrize('instance_of', [True, False])\ndef test_arbitrary_type_json_schema(field_schema, model_schema, instance_of):\n class ArbitraryClass:\n pass\n\n if instance_of:\n\n class Model(BaseModel):\n x: Annotated[InstanceOf[ArbitraryClass], WithJsonSchema(field_schema)]\n\n else:\n\n class Model(BaseModel):\n model_config = dict(arbitrary_types_allowed=True)\n\n x: Annotated[ArbitraryClass, WithJsonSchema(field_schema)]\n\n assert Model.model_json_schema() == model_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_core_metadata_core_schema_metadata_test_build_metadata_dict_initial_metadata.with_pytest_raises_TypeEr.build_metadata_dict_initi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_core_metadata_core_schema_metadata_test_build_metadata_dict_initial_metadata.with_pytest_raises_TypeEr.build_metadata_dict_initi", "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": 4965, "end_line": 4985, "span_ids": ["test_build_metadata_dict_initial_metadata", "test_core_metadata_core_schema_metadata"], "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_core_metadata_core_schema_metadata():\n with pytest.raises(TypeError, match=re.escape(\"CoreSchema metadata should be a dict; got 'test'.\")):\n CoreMetadataHandler({'metadata': 'test'})\n\n core_metadata_handler = CoreMetadataHandler({})\n core_metadata_handler._schema = {}\n assert core_metadata_handler.metadata == {}\n core_metadata_handler._schema = {'metadata': 'test'}\n with pytest.raises(TypeError, match=re.escape(\"CoreSchema metadata should be a dict; got 'test'.\")):\n core_metadata_handler.metadata\n\n\ndef test_build_metadata_dict_initial_metadata():\n assert build_metadata_dict(initial_metadata={'foo': 'bar'}) == {\n 'foo': 'bar',\n 'pydantic_js_functions': [],\n 'pydantic_js_annotation_functions': [],\n }\n\n with pytest.raises(TypeError, match=re.escape(\"CoreSchema metadata should be a dict; got 'test'.\")):\n build_metadata_dict(initial_metadata='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_json_schema.py_test_type_adapter_json_schemas_title_description_test_type_adapter_json_schemas_without_definitions.assert_definitions_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_type_adapter_json_schemas_title_description_test_type_adapter_json_schemas_without_definitions.assert_definitions_not_", "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": 4370, "end_line": 4393, "span_ids": ["test_type_adapter_json_schemas_without_definitions", "test_type_adapter_json_schemas_title_description"], "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_type_adapter_json_schemas_title_description():\n class Model(BaseModel):\n a: str\n\n _, json_schema = TypeAdapter.json_schemas([(Model, 'validation', TypeAdapter(Model))])\n assert 'title' not in json_schema\n assert 'description' not in json_schema\n\n _, json_schema = TypeAdapter.json_schemas(\n [(Model, 'validation', TypeAdapter(Model))],\n title='test title',\n description='test description',\n )\n assert json_schema['title'] == 'test title'\n assert json_schema['description'] == 'test description'\n\n\ndef test_type_adapter_json_schemas_without_definitions():\n _, json_schema = TypeAdapter.json_schemas(\n [(int, 'validation', TypeAdapter(int))],\n ref_template='#/components/schemas/{model}',\n )\n\n assert 'definitions' 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_custom_chain_schema_test_custom_chain_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_custom_chain_schema_test_custom_chain_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": 4396, "end_line": 4413, "span_ids": ["test_custom_chain_schema"], "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_custom_chain_schema():\n class MySequence:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n list_schema = core_schema.list_schema()\n return core_schema.chain_schema([list_schema])\n\n class Model(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n a: MySequence\n\n assert Model.model_json_schema() == {\n 'properties': {'a': {'items': {}, 'title': 'A', 'type': 'array'}},\n 'required': ['a'],\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_json_or_python_schema_test_json_or_python_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_json_or_python_schema_test_json_or_python_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": 4416, "end_line": 4433, "span_ids": ["test_json_or_python_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": "def test_json_or_python_schema():\n class MyJsonOrPython:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n int_schema = core_schema.int_schema()\n return core_schema.json_or_python_schema(json_schema=int_schema, python_schema=int_schema)\n\n class Model(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n a: MyJsonOrPython\n\n assert Model.model_json_schema() == {\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\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_main.py_test_model_rebuild_zero_depth_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_model_rebuild_zero_depth_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": 1904, "end_line": 1977, "span_ids": ["inner_equality_fixture", "test_model_equality_dump", "test_model_equality_type", "test_model_equality", "equality_fixture", "test_model_equality_fields_set", "test_model_rebuild_zero_depth"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_model_rebuild_zero_depth():\n class Model(BaseModel):\n x: 'X_Type'\n\n X_Type = str\n\n with pytest.raises(NameError, match='X_Type'):\n Model.model_rebuild(_parent_namespace_depth=0)\n\n Model.__pydantic_parent_namespace__.update({'X_Type': int})\n Model.model_rebuild(_parent_namespace_depth=0)\n\n m = Model(x=42)\n assert m.model_dump() == {'x': 42}\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.model_fields_set != m2.model_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_extra_equality_test_recursion_loop_error.assert_repr_exc_info_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_equality_test_recursion_loop_error.assert_repr_exc_info_valu", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2212, "end_line": 2239, "span_ids": ["test_recursion_loop_error", "test_equality_delegation", "test_extra_equality"], "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_extra_equality():\n class MyModel(BaseModel, extra='allow'):\n pass\n\n assert MyModel(x=1) != MyModel()\n\n\ndef test_equality_delegation():\n from unittest.mock import ANY\n\n class MyModel(BaseModel):\n foo: str\n\n assert MyModel(foo='bar') == ANY\n\n\ndef test_recursion_loop_error():\n class Model(BaseModel):\n x: List['Model']\n\n data = {'x': []}\n data['x'].append(data)\n with pytest.raises(ValidationError) as exc_info:\n Model(**data)\n assert repr(exc_info.value.errors(include_url=False)[0]) == (\n \"{'type': 'recursion_loop', 'loc': ('x', 0, 'x', 0), 'msg': \"\n \"'Recursion error - cyclic reference detected', 'input': {'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_nested_types_ignored_test_nested_types_ignored.with_pytest_raises_Pydant.BadModel.x.NonNestedType": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_nested_types_ignored_test_nested_types_ignored.with_pytest_raises_Pydant.BadModel.x.NonNestedType", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2283, "end_line": 2307, "span_ids": ["test_nested_types_ignored"], "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_nested_types_ignored():\n from pydantic import BaseModel\n\n class NonNestedType:\n pass\n\n # Defining a nested type does not error\n class GoodModel(BaseModel):\n class NestedType:\n pass\n\n # You can still store such types on the class by annotating as a ClassVar\n MyType: ClassVar[Type[Any]] = NonNestedType\n\n # For documentation: you _can_ give multiple names to a nested type and it won't error:\n # It might be better if it did, but this seems to be rare enough that I'm not concerned\n x = NestedType\n\n assert GoodModel.MyType is NonNestedType\n assert GoodModel.x is GoodModel.NestedType\n\n with pytest.raises(PydanticUserError, match='A non-annotated attribute was detected'):\n\n class BadModel(BaseModel):\n x = NonNestedType", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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__equals.if_isinstance_a_str_and.else_.raise_TypeError_f_argumen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_signature.py_sys__equals.if_isinstance_a_str_and.else_.raise_TypeError_f_argumen", "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": 21, "span_ids": ["imports", "_equals"], "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": "import sys\nfrom inspect import Parameter, Signature, signature\nfrom typing import Any, Generic, Iterable, Optional, TypeVar, Union\n\nimport pytest\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, ConfigDict, 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)}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_model_signature_test_generic_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_test_model_signature_test_generic_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": 24, "end_line": 44, "span_ids": ["test_model_signature", "test_generic_model_signature"], "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_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')\n\n\ndef test_generic_model_signature():\n T = TypeVar('T')\n\n class Model(BaseModel, Generic[T]):\n a: T\n\n sig = signature(Model[int])\n assert sig != signature(BaseModel)\n assert _equals(map(str, sig.parameters.values()), ('a: int',))\n assert _equals(str(sig), '(*, a: int) -> 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_validator.py_from___future___import_an_test_model_validator_wrap.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_from___future___import_an_test_model_validator_wrap.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_model_validator.py", "file_name": "test_model_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "test_model_validator_wrap"], "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\nfrom typing import Any, Dict, cast\n\nimport pytest\n\nfrom pydantic import BaseModel, ValidationInfo, ValidatorFunctionWrapHandler, model_validator\n\n\ndef test_model_validator_wrap() -> None:\n class Model(BaseModel):\n x: int\n y: int\n\n @model_validator(mode='wrap')\n @classmethod\n def val_model(cls, values: dict[str, Any] | Model, handler: ValidatorFunctionWrapHandler) -> Model:\n if isinstance(values, dict):\n assert values == {'x': 1, 'y': 2}\n model = handler({'x': 2, 'y': 3})\n else:\n assert values.x == 1\n assert values.y == 2\n model = handler(Model.model_construct(x=2, y=3))\n assert model.x == 2\n assert model.y == 3\n model.x = 20\n model.y = 30\n return model\n\n assert Model(x=1, y=2).model_dump() == {'x': 20, 'y': 30}\n assert Model.model_validate(Model.model_construct(x=1, y=2)).model_dump() == {'x': 20, 'y': 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_model_validator.py_test_model_validator_before_revalidate_always_test_model_validator_before_revalidate_always.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_model_validator_before_revalidate_always_test_model_validator_before_revalidate_always.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_model_validator.py", "file_name": "test_model_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 82, "span_ids": ["test_model_validator_before_revalidate_always"], "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('classmethod_decorator', [classmethod, lambda x: x])\ndef test_model_validator_before_revalidate_always(classmethod_decorator: Any) -> None:\n class Model(BaseModel, revalidate_instances='always'):\n x: int\n y: int\n\n @model_validator(mode='before')\n @classmethod_decorator\n def val_model(cls, values: Any, info: ValidationInfo) -> dict[str, Any] | Model:\n assert not info.context\n if isinstance(values, dict):\n values = cast(Dict[str, Any], values)\n values['x'] += 1\n values['y'] += 1\n else:\n assert isinstance(values, Model)\n values.x += 1\n values.y += 1\n return values\n\n assert Model(x=1, y=2).model_dump() == {'x': 2, 'y': 3}\n assert Model.model_validate(Model(x=1, y=2)).model_dump() == {'x': 3, 'y': 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_model_validator.py_test_model_validator_after_test_subclass.assert_Person_age_28_age": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_model_validator_after_test_subclass.assert_Person_age_28_age", "embedding": null, "metadata": {"file_path": "tests/test_model_validator.py", "file_name": "test_model_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 112, "span_ids": ["test_subclass", "test_model_validator_after"], "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_model_validator_after() -> None:\n class Model(BaseModel):\n x: int\n y: int\n\n @model_validator(mode='after')\n def val_model(self, info: ValidationInfo) -> Model:\n assert not info.context\n self.x += 1\n self.y += 1\n return self\n\n assert Model(x=1, y=2).model_dump() == {'x': 2, 'y': 3}\n assert Model.model_validate(Model(x=1, y=2)).model_dump() == {'x': 3, 'y': 4}\n\n\ndef test_subclass() -> None:\n class Human(BaseModel):\n @model_validator(mode='before')\n @classmethod\n def run_model_validator(cls, values: dict[str, Any]) -> dict[str, Any]:\n values['age'] *= 2\n return values\n\n class Person(Human):\n age: int\n\n assert Person(age=28).age == 56", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_validator.py_test_nested_models_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_model_validator.py_test_nested_models_", "embedding": null, "metadata": {"file_path": "tests/test_model_validator.py", "file_name": "test_model_validator.py", "file_type": "text/x-python", "category": "test", "start_line": 115, "end_line": 139, "span_ids": ["test_nested_models"], "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_nested_models() -> None:\n calls: list[str] = []\n\n class Model(BaseModel):\n inner: Model | None\n\n @model_validator(mode='before')\n @classmethod\n def validate_model_before(cls, values: dict[str, Any]) -> dict[str, Any]:\n calls.append('before')\n return values\n\n @model_validator(mode='after')\n def validate_model_after(self) -> Model:\n calls.append('after')\n return self\n\n Model.model_validate({'inner': None})\n assert calls == ['before', 'after']\n calls.clear()\n\n Model.model_validate({'inner': {'inner': {'inner': None}}})\n assert calls == ['before'] * 3 + ['after'] * 3\n calls.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_parse.py_test_model_validate_root_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_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": 60, "end_line": 97, "span_ids": ["test_model_validate_root"], "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_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 @model_validator(mode='before')\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 __get_pydantic_json_schema__(\n cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = handler(core_schema)\n root = handler.resolve_ref_schema(json_schema)['properties']['root']\n return root\n\n # Validation\n m = MyModel.model_validate('a')\n assert m.root == 'a'\n\n # Serialization\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_private_attributes.py_test_ignored_types_are_ignored_cached_property_test_none_as_private_attr.assert_a__x_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_ignored_types_are_ignored_cached_property_test_none_as_private_attr.assert_a__x_is_None", "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": 297, "end_line": 316, "span_ids": ["test_ignored_types_are_ignored_cached_property", "test_none_as_private_attr"], "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.skipif(not hasattr(functools, 'cached_property'), reason='cached_property is not available')\ndef test_ignored_types_are_ignored_cached_property():\n \"\"\"Demonstrate the members of functools are ignore here as with fields.\"\"\"\n\n class MyModel(BaseModel):\n _a: functools.cached_property\n _b: int\n\n assert set(MyModel.__private_attributes__) == {'_b'}\n\n\ndef test_none_as_private_attr():\n from pydantic import BaseModel\n\n class A(BaseModel):\n _x: None\n\n a = A()\n a._x = None\n assert a._x 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_root_model.py_test_root_model_nested_test_root_model_as_field.assert_isinstance_m_root_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_nested_test_root_model_as_field.assert_isinstance_m_root_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 145, "span_ids": ["test_root_model_as_field", "test_root_model_nested"], "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_root_model_nested():\n calls = []\n\n class B(RootModel[int]):\n def my_b_method(self):\n calls.append(('my_b_method', self.root))\n\n class A(RootModel[B]):\n def my_a_method(self):\n calls.append(('my_a_method', self.root.root))\n\n m1 = A.model_validate(1)\n m1.my_a_method()\n m1.root.my_b_method()\n assert calls == [('my_a_method', 1), ('my_b_method', 1)]\n\n calls.clear()\n m2 = A.model_validate_json('2')\n m2.my_a_method()\n m2.root.my_b_method()\n assert calls == [('my_a_method', 2), ('my_b_method', 2)]\n\n\ndef test_root_model_as_field():\n class MyRootModel(RootModel[int]):\n pass\n\n class MyModel(BaseModel):\n root_model: MyRootModel\n\n m = MyModel.model_validate({'root_model': 1})\n\n assert isinstance(m.root_model, MyRootModel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_construct_test_construct_nested.with_pytest_raises_Attrib.v_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_construct_test_construct_nested.with_pytest_raises_Attrib.v_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 168, "end_line": 188, "span_ids": ["test_construct_nested", "test_construct"], "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_construct():\n class Base64Root(RootModel[Base64Str]):\n pass\n\n v = Base64Root.model_construct('test')\n assert v.model_dump() == 'dGVzdA==\\n'\n\n\ndef test_construct_nested():\n class Base64RootProperty(BaseModel):\n data: RootModel[Base64Str]\n\n v = Base64RootProperty.model_construct(data=RootModel[Base64Str].model_construct('test'))\n assert v.model_dump() == {'data': 'dGVzdA==\\n'}\n\n # Note: model_construct requires the inputs to be valid; the root model value does not get \"validated\" into\n # an actual root model instance:\n v = Base64RootProperty.model_construct(data='test')\n assert isinstance(v.data, str) # should be RootModel[Base64Str], but model_construct skipped validation\n with pytest.raises(AttributeError, match=\"'str' object has no attribute 'root'\"):\n v.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_root_model.py_test_assignment_test_model_validator_before.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_assignment_test_model_validator_before.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 191, "end_line": 225, "span_ids": ["test_assignment", "test_model_validator_before"], "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_assignment():\n Model = RootModel[int]\n\n m = Model(1)\n assert m.model_fields_set == {'root'}\n assert m.root == 1\n m.root = 2\n assert m.root == 2\n\n\ndef test_model_validator_before():\n class Model(RootModel[int]):\n @model_validator(mode='before')\n def words(cls, v):\n if v == 'one':\n return 1\n elif v == 'two':\n return 2\n else:\n return v\n\n assert Model('one').root == 1\n assert Model('two').root == 2\n assert Model('3').root == 3\n with pytest.raises(ValidationError) as exc_info:\n Model('three')\n # insert_assert(exc_info.value.errors())\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': (),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'three',\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_root_model.py_test_model_validator_after_test_private_attr.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_model_validator_after_test_private_attr.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 273, "span_ids": ["test_private_attr", "test_model_validator_after"], "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_model_validator_after():\n class Model(RootModel[int]):\n @model_validator(mode='after')\n def double(self) -> 'Model':\n self.root *= 2\n return self\n\n assert Model('1').root == 2\n assert Model('21').root == 42\n\n\ndef test_private_attr():\n class Model(RootModel[int]):\n _private_attr: str\n _private_attr_default: str = PrivateAttr(default='abc')\n\n m = Model(42)\n\n assert m.root == 42\n assert m._private_attr_default == 'abc'\n with pytest.raises(AttributeError, match='_private_attr'):\n m._private_attr\n\n m._private_attr = 7\n m._private_attr_default = 8\n m._other_private_attr = 9\n # TODO: Should this be an `AttributeError`?\n with pytest.raises(ValueError, match='other_attr'):\n m.other_attr = 10\n\n assert m._private_attr == 7\n assert m._private_attr_default == 8\n assert m._other_private_attr == 9\n assert m.model_dump() == 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_plain_json_return_type_test_model_serializer_plain_json_return_type.None_1.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_model_serializer_plain_json_return_type_test_model_serializer_plain_json_return_type.None_1.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": 467, "end_line": 489, "span_ids": ["test_model_serializer_plain_json_return_type"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_model_serializer_plain_json_return_type():\n class MyModel(BaseModel):\n a: int\n\n @model_serializer(when_used='json')\n def _serialize(self) -> str:\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() == {'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() == {'a': 666}\n with pytest.warns(UserWarning, match='Expected `str` but got `int` - serialized value may not be as expected'):\n assert m.model_dump(mode='json') == 666\n\n with pytest.warns(UserWarning, match='Expected `str` but got `int` - serialized value may not be as expected'):\n assert m.model_dump_json() == '666'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_field_test_serialize_with_extra.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_invalid_field_test_serialize_with_extra.assert_m_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 794, "end_line": 821, "span_ids": ["test_invalid_field", "test_serialize_with_extra"], "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_invalid_field():\n msg = (\n r'Decorators defined with incorrect fields:'\n r' tests.test_serialize.test_invalid_field..Model:\\d+.customise_b_serialization'\n r\" \\(use check_fields=False if you're inheriting from the model and intended this\\)\"\n )\n with pytest.raises(errors.PydanticUserError, match=msg):\n\n class Model(BaseModel):\n a: str\n\n @field_serializer('b')\n def customise_b_serialization(v):\n return v\n\n\ndef test_serialize_with_extra():\n class Inner(BaseModel):\n a: str = 'a'\n\n class Outer(BaseModel):\n # this cause the inner model incorrectly dumpped:\n model_config = ConfigDict(extra='allow')\n inner: Inner = Field(default_factory=Inner)\n\n m = Outer.model_validate({})\n\n assert m.model_dump() == {'inner': {'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_serialize.py_test_model_serializer_nested_models_test_model_serializer_nested_models.assert_Model_x_2_inner_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_model_serializer_nested_models_test_model_serializer_nested_models.assert_Model_x_2_inner_M", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 829, "end_line": 845, "span_ids": ["test_model_serializer_nested_models"], "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_model_serializer_nested_models() -> None:\n class Model(BaseModel):\n x: int\n inner: Optional['Model']\n\n @model_serializer(mode='wrap')\n def ser_model(self, handler: Callable[['Model'], Dict[str, Any]]) -> Dict[str, Any]:\n inner = handler(self)\n inner['x'] += 1\n return inner\n\n assert Model(x=0, inner=None).model_dump() == {'x': 1, 'inner': None}\n\n assert Model(x=2, inner=Model(x=1, inner=Model(x=0, inner=None))).model_dump() == {\n 'x': 3,\n 'inner': {'x': 2, 'inner': {'x': 1, 'inner': 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_type_adapter.py_json_SomeNamedTuple.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_json_SomeNamedTuple.x", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["SomeNamedTuple", "GenericPydanticModel", "SomeTypedDict", "imports", "PydanticModel", "impl:5"], "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": "import json\nimport sys\nfrom dataclasses import dataclass\nfrom datetime import date, datetime\nfrom typing import Any, Dict, ForwardRef, Generic, List, NamedTuple, Tuple, TypeVar, Union\n\nimport pytest\nfrom pydantic_core import ValidationError\nfrom typing_extensions import Annotated, TypeAlias, TypedDict\n\nfrom pydantic import BaseModel, TypeAdapter, ValidationInfo, field_validator\nfrom pydantic.config import ConfigDict\nfrom pydantic.errors import PydanticUserError\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_type_adapter.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_type_adapter.py_test_types_test_types.assert_expected_v_val_", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 59, "span_ids": ["test_types"], "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": "@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 = TypeAdapter(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_type_adapter.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_type_adapter.py_IntList_test_type_alias.assert_res_1_2_", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.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": 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": "IntList = List[int]\nOuterDict = Dict[str, 'IntList']\n\n\ndef test_global_namespace_variables():\n v = TypeAdapter(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] # noqa: F841\n OuterDict = Dict[str, 'IntList']\n\n v = TypeAdapter(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 = TypeAdapter(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 = TypeAdapter(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_type_adapter.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_type_adapter.py_test_validate_python_strict_test_validate_python_strict.None_5", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 129, "span_ids": ["test_validate_python_strict"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_validate_python_strict() -> None:\n class Model(TypedDict):\n x: int\n\n class ModelStrict(Model):\n __pydantic_config__ = ConfigDict(strict=True) # type: ignore\n\n lax_validator = TypeAdapter(Model)\n strict_validator = TypeAdapter(ModelStrict)\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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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_type_adapter.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_type_adapter.py_test_validate_json_strict_test_validate_json_strict.None_5", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 161, "span_ids": ["test_validate_json_strict"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.xfail(reason='Need to fix this in https://github.com/pydantic/pydantic/pull/5944')\ndef test_validate_json_strict() -> None:\n class Model(TypedDict):\n x: int\n\n class ModelStrict(Model):\n __pydantic_config__ = ConfigDict(strict=True) # type: ignore\n\n lax_validator = TypeAdapter(Model, config=ConfigDict(strict=False))\n strict_validator = TypeAdapter(ModelStrict)\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(include_url=False) == [\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(include_url=False) == [\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(include_url=False) == [\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_type_adapter.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_type_adapter.py_test_validate_python_context_test_validate_python_context.assert_contexts_", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 164, "end_line": 179, "span_ids": ["test_validate_python_context"], "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_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 = TypeAdapter(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_type_adapter.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_type_adapter.py_test_validate_json_context_test_validate_json_context.assert_contexts_", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 182, "end_line": 197, "span_ids": ["test_validate_json_context"], "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_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 = TypeAdapter(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_type_alias_type.py_datetime_ShortRecursiveGenericAlias.Annotated_RecursiveGeneri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_datetime_ShortRecursiveGenericAlias.Annotated_RecursiveGeneri", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["imports"], "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": "import datetime\nfrom dataclasses import dataclass\nfrom typing import Dict, Generic, List, Tuple, TypeVar, Union\n\nimport pytest\nfrom annotated_types import MaxLen\nfrom typing_extensions import Annotated, Literal, TypeAliasType\n\nfrom pydantic import BaseModel, Field, ValidationError\nfrom pydantic.type_adapter import TypeAdapter\n\nT = TypeVar('T')\n\nJsonType = TypeAliasType('JsonType', Union[List['JsonType'], Dict[str, 'JsonType'], str, int, float, bool, None])\nRecursiveGenericAlias = TypeAliasType(\n 'RecursiveGenericAlias', List[Union['RecursiveGenericAlias[T]', T]], type_params=(T,)\n)\nMyList = TypeAliasType('MyList', List[T], type_params=(T,))\n# try mixing with implicit type aliases\nShortMyList = Annotated[MyList[T], MaxLen(1)]\nShortRecursiveGenericAlias = Annotated[RecursiveGenericAlias[T], MaxLen(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_type_alias_type.py_test_type_alias_test_type_alias.assert_t_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_test_type_alias.assert_t_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 23, "end_line": 39, "span_ids": ["test_type_alias"], "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_type_alias() -> None:\n t = TypeAdapter(MyList[int])\n\n assert t.validate_python(['1', '2']) == [1, 2]\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python(['a'])\n assert exc_info.value.errors(include_url=False) == [\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': 'a',\n }\n ]\n\n assert t.json_schema() == {'type': 'array', 'items': {'type': '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/test_type_alias_type.py_test_recursive_type_alias_test_recursive_type_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_type_alias_type.py_test_recursive_type_alias_test_recursive_type_alias.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 42, "end_line": 116, "span_ids": ["test_recursive_type_alias"], "tokens": 724}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_type_alias() -> None:\n t = TypeAdapter(JsonType)\n\n assert t.validate_python({'a': [True, [{'b': None}]]}) == {'a': [True, [{'b': None}]]}\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python({'a': datetime.date(year=1992, month=12, day=11)})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'list_type',\n 'loc': ('list[nullable[union[list[...],dict[str,...],str,int,float,bool]]]',),\n 'msg': 'Input should be a valid list',\n 'input': {'a': datetime.date(1992, 12, 11)},\n },\n {\n 'type': 'list_type',\n 'loc': ('dict[str,...]', 'a', 'list[nullable[union[list[...],dict[str,...],str,int,float,bool]]]'),\n 'msg': 'Input should be a valid list',\n 'input': datetime.date(1992, 12, 11),\n },\n {\n 'type': 'dict_type',\n 'loc': ('dict[str,...]', 'a', 'dict[str,...]'),\n 'msg': 'Input should be a valid dictionary',\n 'input': datetime.date(1992, 12, 11),\n },\n {\n 'type': 'string_type',\n 'loc': ('dict[str,...]', 'a', 'str'),\n 'msg': 'Input should be a valid string',\n 'input': datetime.date(1992, 12, 11),\n },\n {\n 'type': 'int_type',\n 'loc': ('dict[str,...]', 'a', 'int'),\n 'msg': 'Input should be a valid integer',\n 'input': datetime.date(1992, 12, 11),\n },\n {\n 'type': 'float_type',\n 'loc': ('dict[str,...]', 'a', 'float'),\n 'msg': 'Input should be a valid number',\n 'input': datetime.date(1992, 12, 11),\n },\n {\n 'type': 'bool_type',\n 'loc': ('dict[str,...]', 'a', 'bool'),\n 'msg': 'Input should be a valid boolean',\n 'input': datetime.date(1992, 12, 11),\n },\n {\n 'type': 'string_type',\n 'loc': ('str',),\n 'msg': 'Input should be a valid string',\n 'input': {'a': datetime.date(1992, 12, 11)},\n },\n {\n 'type': 'int_type',\n 'loc': ('int',),\n 'msg': 'Input should be a valid integer',\n 'input': {'a': datetime.date(1992, 12, 11)},\n },\n {\n 'type': 'float_type',\n 'loc': ('float',),\n 'msg': 'Input should be a valid number',\n 'input': {'a': datetime.date(1992, 12, 11)},\n },\n {\n 'type': 'bool_type',\n 'loc': ('bool',),\n 'msg': 'Input should be a valid boolean',\n 'input': {'a': datetime.date(1992, 12, 11)},\n },\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_type_alias_type.py_test_type_alias_annotated_test_type_alias_annotated.assert_t_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_annotated_test_type_alias_annotated.assert_t_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 136, "end_line": 153, "span_ids": ["test_type_alias_annotated"], "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_type_alias_annotated() -> None:\n t = TypeAdapter(ShortMyList[int])\n\n assert t.validate_python(['1']) == [1]\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python([1, 2])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': (),\n 'msg': 'List should have at most 1 item after validation, not 2',\n 'input': [1, 2],\n 'ctx': {'field_type': 'List', 'max_length': 1, 'actual_length': 2},\n }\n ]\n\n assert t.json_schema() == {'type': 'array', 'items': {'type': 'integer'}, 'maxItems': 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_type_alias_type.py_test_type_alias_annotated_defs_test_type_alias_annotated_defs.assert_t_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_annotated_defs_test_type_alias_annotated_defs.assert_t_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 156, "end_line": 190, "span_ids": ["test_type_alias_annotated_defs"], "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_type_alias_annotated_defs() -> None:\n # force use of refs by referencing the schema in multiple places\n t = TypeAdapter(Tuple[ShortMyList[int], ShortMyList[int]])\n\n assert t.validate_python((['1'], ['2'])) == ([1], [2])\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python(([1, 2], [1, 2]))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': (0,),\n 'msg': 'List should have at most 1 item after validation, not 2',\n 'input': [1, 2],\n 'ctx': {'field_type': 'List', 'max_length': 1, 'actual_length': 2},\n },\n {\n 'type': 'too_long',\n 'loc': (1,),\n 'msg': 'List should have at most 1 item after validation, not 2',\n 'input': [1, 2],\n 'ctx': {'field_type': 'List', 'max_length': 1, 'actual_length': 2},\n },\n ]\n\n assert t.json_schema() == {\n 'type': 'array',\n 'minItems': 2,\n 'prefixItems': [\n {'$ref': '#/$defs/MyList_int__MaxLen_max_length_1_'},\n {'$ref': '#/$defs/MyList_int__MaxLen_max_length_1_'},\n ],\n 'maxItems': 2,\n '$defs': {'MyList_int__MaxLen_max_length_1_': {'type': 'array', 'items': {'type': 'integer'}, 'maxItems': 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_type_alias_type.py_test_recursive_generic_type_alias_test_recursive_generic_type_alias.assert_t_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_generic_type_alias_test_recursive_generic_type_alias.assert_t_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 193, "end_line": 230, "span_ids": ["test_recursive_generic_type_alias"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_generic_type_alias() -> None:\n t = TypeAdapter(RecursiveGenericAlias[int])\n\n assert t.validate_python([[['1']]]) == [[[1]]]\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python([[['a']]])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'list_type',\n 'loc': (0, 'list[union[...,int]]', 0, 'list[union[...,int]]', 0, 'list[union[...,int]]'),\n 'msg': 'Input should be a valid list',\n 'input': 'a',\n },\n {\n 'type': 'int_parsing',\n 'loc': (0, 'list[union[...,int]]', 0, 'list[union[...,int]]', 0, 'int'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': 'a',\n },\n {\n 'type': 'int_type',\n 'loc': (0, 'list[union[...,int]]', 0, 'int'),\n 'msg': 'Input should be a valid integer',\n 'input': ['a'],\n },\n {'type': 'int_type', 'loc': (0, 'int'), 'msg': 'Input should be a valid integer', 'input': [['a']]},\n ]\n\n assert t.json_schema() == {\n 'allOf': [{'$ref': '#/$defs/RecursiveGenericAlias_int_'}],\n '$defs': {\n 'RecursiveGenericAlias_int_': {\n 'type': 'array',\n 'items': {'anyOf': [{'$ref': '#/$defs/RecursiveGenericAlias_int_'}, {'type': 'integer'}]},\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_type_alias_type.py_test_recursive_generic_type_alias_annotated_test_recursive_generic_type_alias_annotated.assert_t_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_generic_type_alias_annotated_test_recursive_generic_type_alias_annotated.assert_t_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 233, "end_line": 261, "span_ids": ["test_recursive_generic_type_alias_annotated"], "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_recursive_generic_type_alias_annotated() -> None:\n t = TypeAdapter(ShortRecursiveGenericAlias[int])\n\n assert t.validate_python([[]]) == [[]]\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python([[], []])\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': (),\n 'msg': 'List should have at most 1 item after validation, not 2',\n 'input': [[], []],\n 'ctx': {'field_type': 'List', 'max_length': 1, 'actual_length': 2},\n }\n ]\n\n # insert_assert(t.json_schema())\n assert t.json_schema() == {\n 'type': 'array',\n 'items': {'anyOf': [{'$ref': '#/$defs/RecursiveGenericAlias_int_'}, {'type': 'integer'}]},\n 'maxItems': 1,\n '$defs': {\n 'RecursiveGenericAlias_int_': {\n 'type': 'array',\n 'items': {'anyOf': [{'$ref': '#/$defs/RecursiveGenericAlias_int_'}, {'type': 'integer'}]},\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_test_pattern_test_pattern_with_invalid_param.with_pytest_raises_.Foo.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_with_invalid_param.with_pytest_raises_.Foo.pattern", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3727, "end_line": 3766, "span_ids": ["test_pattern_with_invalid_param", "test_pattern"], "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 ('pattern_type', 'pattern_value', 'matching_value', 'non_matching_value'),\n [\n pytest.param(re.Pattern, r'^whatev.r\\d$', 'whatever1', ' whatever1', id='re.Pattern'),\n pytest.param(Pattern, r'^whatev.r\\d$', 'whatever1', ' whatever1', id='Pattern'),\n pytest.param(Pattern[str], r'^whatev.r\\d$', 'whatever1', ' whatever1', id='Pattern[str]'),\n pytest.param(Pattern[bytes], rb'^whatev.r\\d$', b'whatever1', b' whatever1', id='Pattern[bytes]'),\n ],\n)\ndef test_pattern(pattern_type, pattern_value, matching_value, non_matching_value):\n class Foobar(BaseModel):\n pattern: pattern_type\n\n f = Foobar(pattern=pattern_value)\n assert f.pattern.__class__.__name__ == 'Pattern'\n # check it's really a proper pattern\n assert f.pattern.match(matching_value)\n assert not f.pattern.match(non_matching_value)\n\n # Check that pre-compiled patterns are accepted unchanged\n p = re.compile(pattern_value)\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 }\n\n\ndef test_pattern_with_invalid_param():\n with pytest.raises(\n PydanticSchemaGenerationError,\n match=re.escape('Unable to generate pydantic-core schema for typing.Pattern[int].'),\n ):\n\n class Foo(BaseModel):\n pattern: Pattern[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_typeddict.py_test_recursive_generic_typeddict_in_function_3_test_recursive_generic_typeddict_in_function_3.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_3_test_recursive_generic_typeddict_in_function_3.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": 654, "end_line": 685, "span_ids": ["test_recursive_generic_typeddict_in_function_3"], "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_recursive_generic_typeddict_in_function_3():\n T = TypeVar('T')\n\n class RecursiveGenTypedDictModel(BaseModel, Generic[T]):\n rec: 'RecursiveGenTypedDict[T]'\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 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(include_url=False) == [\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_typeddict_field_validator_test_typeddict_field_validator.assert_child_ta_validate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_field_validator_test_typeddict_field_validator.assert_child_ta_validate_", "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": 723, "end_line": 774, "span_ids": ["test_typeddict_field_validator"], "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_typeddict_field_validator(TypedDict: Any) -> None:\n class Parent(TypedDict):\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 parent_ta = TypeAdapter(Parent)\n child_ta = TypeAdapter(Child)\n\n assert parent_ta.validate_python({'a': []})['a'] == ['parent before', 'parent', 'parent after']\n assert child_ta.validate_python({'a': []})['a'] == [\n 'parent before',\n 'child',\n 'parent after',\n 'child before',\n 'child after',\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_model_validator_test_typeddict_model_validator.assert_ta_validate_python": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_model_validator_test_typeddict_model_validator.assert_ta_validate_python", "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": 777, "end_line": 793, "span_ids": ["test_typeddict_model_validator"], "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_typeddict_model_validator(TypedDict) -> None:\n class Model(TypedDict):\n x: int\n y: float\n\n @model_validator(mode='before')\n @classmethod\n def val_model_before(cls, value: Dict[str, Any]) -> Dict[str, Any]:\n return dict(x=value['x'] + 1, y=value['y'] + 2)\n\n @model_validator(mode='after')\n def val_model_after(self) -> 'Model':\n return Model(x=self['x'] * 2, y=self['y'] * 3)\n\n ta = TypeAdapter(Model)\n\n assert ta.validate_python({'x': 1, 'y': 2.5}) == {'x': 4, 'y': 13.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_typeddict.py_test_typeddict_field_serializer_test_typeddict_field_serializer.assert_child_ta_dump_pyth": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_field_serializer_test_typeddict_field_serializer.assert_child_ta_dump_pyth", "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": 796, "end_line": 817, "span_ids": ["test_typeddict_field_serializer"], "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_typeddict_field_serializer(TypedDict: Any) -> None:\n class Parent(TypedDict):\n a: List[str]\n\n @field_serializer('a')\n @classmethod\n def ser(cls, v: List[str]):\n v.append('parent')\n return v\n\n class Child(Parent):\n @field_serializer('a')\n @classmethod\n def ser(cls, v: List[str]):\n v.append('child')\n return v\n\n parent_ta = TypeAdapter(Parent)\n child_ta = TypeAdapter(Child)\n\n assert parent_ta.dump_python(Parent({'a': []}))['a'] == ['parent']\n assert child_ta.dump_python(Child({'a': []}))['a'] == ['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_utils.py_test_value_items_test_value_items.None_19": {"__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_19", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 198, "span_ids": ["test_value_items"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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']\n\n vi = ValueItems([], {'__all__': {}})\n assert vi._items == {}\n\n with pytest.raises(TypeError, match='Unexpected type of exclude value for index \"a\" '):\n ValueItems(['a', 'b'], {'a': None})\n\n m = (\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 with pytest.raises(TypeError, match=m):\n ValueItems(['a', 'b'], {'a': {}})\n\n vi = ValueItems([1, 2, 3, 4], {'__all__': True})\n assert repr(vi) == 'ValueItems({0: Ellipsis, 1: Ellipsis, 2: Ellipsis, 3: Ellipsis})'\n\n vi = ValueItems([1, 2], {'__all__': {1, 2}})\n assert repr(vi) == 'ValueItems({0: {1: Ellipsis, 2: Ellipsis}, 1: {1: Ellipsis, 2: Ellipsis}})'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_camel2snake_test_camel2snake.assert_to_snake_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_camel2snake_test_camel2snake.assert_to_snake_value_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 519, "end_line": 543, "span_ids": ["test_camel2snake"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n ('camel_to_snake', 'camel_to_snake'),\n ('camelToSnake', 'camel_to_snake'),\n ('camel2Snake', 'camel_2_snake'),\n ('_camelToSnake', '_camel_to_snake'),\n ('camelToSnake_', 'camel_to_snake_'),\n ('__camelToSnake__', '__camel_to_snake__'),\n ('CamelToSnake', 'camel_to_snake'),\n ('Camel2Snake', 'camel_2_snake'),\n ('_CamelToSnake', '_camel_to_snake'),\n ('CamelToSnake_', 'camel_to_snake_'),\n ('CAMELToSnake', 'camel_to_snake'),\n ('__CamelToSnake__', '__camel_to_snake__'),\n ('Camel2', 'camel_2'),\n ('Camel2_', 'camel_2_'),\n ('_Camel2', '_camel_2'),\n ('camel2', 'camel_2'),\n ('camel2_', 'camel_2_'),\n ('_camel2', '_camel_2'),\n ],\n)\ndef test_camel2snake(value: str, result: str) -> None:\n assert to_snake(value) == 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_utils.py_test_handle_model_fields_schema_test_handle_model_fields_schema.assert_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_model_fields_schema_test_handle_model_fields_schema.assert_schema_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 573, "end_line": 603, "span_ids": ["test_handle_model_fields_schema"], "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 'params,expected_extra_schema',\n (\n pytest.param({}, {}, id='Model fields without extra_validator'),\n pytest.param(\n {'extras_schema': core_schema.float_schema()},\n {'extras_schema': {'type': 'str'}},\n id='Model fields with extra_validator',\n ),\n ),\n)\ndef test_handle_model_fields_schema(params, expected_extra_schema):\n schema = core_schema.model_fields_schema(\n {\n 'foo': core_schema.model_field(core_schema.int_schema()),\n },\n **params,\n )\n\n def walk(s, recurse):\n # change extra_schema['type'] to 'str'\n if s['type'] == 'float':\n s['type'] = 'str'\n return s\n\n schema = _WalkCoreSchema().handle_model_fields_schema(schema, walk)\n assert schema == {\n **expected_extra_schema,\n 'type': 'model-fields',\n 'fields': {'foo': {'type': 'model-field', 'schema': {'type': '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_utils.py_test_handle_typed_dict_schema_test_handle_typed_dict_schema.assert_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_typed_dict_schema_test_handle_typed_dict_schema.assert_schema_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 606, "end_line": 636, "span_ids": ["test_handle_typed_dict_schema"], "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": "@pytest.mark.parametrize(\n 'params,expected_extra_schema',\n (\n pytest.param({}, {}, id='Typeddict without extra_validator'),\n pytest.param(\n {'extras_schema': core_schema.float_schema()},\n {'extras_schema': {'type': 'str'}},\n id='Typeddict with extra_validator',\n ),\n ),\n)\ndef test_handle_typed_dict_schema(params, expected_extra_schema):\n schema = core_schema.typed_dict_schema(\n {\n 'foo': core_schema.model_field(core_schema.int_schema()),\n },\n **params,\n )\n\n def walk(s, recurse):\n # change extra_validator['type'] to 'str'\n if s['type'] == 'float':\n s['type'] = 'str'\n return s\n\n schema = _WalkCoreSchema().handle_typed_dict_schema(schema, walk)\n assert schema == {\n **expected_extra_schema,\n 'type': 'typed-dict',\n 'fields': {'foo': {'type': 'model-field', 'schema': {'type': '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_utils.py_test_handle_function_schema_test_handle_function_schema.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_function_schema_test_handle_function_schema.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": 639, "end_line": 659, "span_ids": ["test_handle_function_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": "def test_handle_function_schema():\n schema = core_schema.with_info_before_validator_function(\n lambda v, _info: v, core_schema.float_schema(), field_name='field_name'\n )\n\n def walk(s, recurse):\n # change type to str\n if s['type'] == 'float':\n s['type'] = 'str'\n return s\n\n schema = _WalkCoreSchema().handle_function_schema(schema, walk)\n assert schema['type'] == 'function-before'\n assert schema['schema'] == {'type': 'str'}\n\n def walk1(s, recurse):\n # this is here to make sure this function is not called\n assert False\n\n schema = _WalkCoreSchema().handle_function_schema(core_schema.int_schema(), walk1)\n assert schema['type'] == '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_utils.py_test_handle_call_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_call_schema_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 661, "end_line": 679, "span_ids": ["test_handle_call_schema"], "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_handle_call_schema():\n param_a = core_schema.arguments_parameter(name='a', schema=core_schema.str_schema(), mode='positional_only')\n args_schema = core_schema.arguments_schema([param_a])\n\n schema = core_schema.call_schema(\n arguments=args_schema,\n function=lambda a: int(a),\n return_schema=core_schema.str_schema(),\n )\n\n def walk(s, recurse):\n # change return schema\n if 'return_schema' in schema:\n schema['return_schema']['type'] = 'int'\n return s\n\n schema = _WalkCoreSchema().handle_call_schema(schema, walk)\n assert schema['return_schema'] == {'type': '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_v1.py_from_pydantic_import_VERS_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_v1.py_from_pydantic_import_VERS_", "embedding": null, "metadata": {"file_path": "tests/test_v1.py", "file_name": "test_v1.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["test_version", "imports", "test_root_validator"], "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 pydantic import VERSION\nfrom pydantic.v1 import VERSION as V1_VERSION\nfrom pydantic.v1 import BaseModel as V1BaseModel\nfrom pydantic.v1 import root_validator as v1_root_validator\n\n\ndef test_version():\n assert V1_VERSION.startswith('1.')\n assert V1_VERSION != VERSION\n\n\ndef test_root_validator():\n class Model(V1BaseModel):\n v: str\n\n @v1_root_validator(pre=True)\n @classmethod\n def root_validator(cls, values):\n values['v'] += '-v1'\n return values\n\n model = Model(v='value')\n assert model.v == 'value-v1'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_alias_generator_test_config_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_validate_call.py_test_alias_generator_test_config_arbitrary_types_allowed.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 473, "end_line": 504, "span_ids": ["test_alias_generator", "test_config_arbitrary_types_allowed"], "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_alias_generator():\n @validate_call(config=dict(alias_generator=lambda x: x * 2))\n def foo(a: int, b: int):\n return f'{a}, {b}'\n\n assert foo(1, 2) == '1, 2'\n assert foo(aa=1, bb=2) == '1, 2'\n\n\ndef test_config_arbitrary_types_allowed():\n class EggBox:\n def __str__(self) -> str:\n return 'EggBox()'\n\n @validate_call(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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'is_instance_of',\n 'loc': (1,),\n 'msg': 'Input should be an instance of test_config_arbitrary_types_allowed..EggBox',\n 'input': 2,\n 'ctx': {'class': 'test_config_arbitrary_types_allowed..EggBox'},\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_validate_call.py_test_validate_return_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_validate_call.py_test_validate_return_test_validate_all.assert_foo_0_datetime", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 557, "end_line": 571, "span_ids": ["test_validate_all", "test_validate_return"], "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_validate_return():\n @validate_call(config=dict(validate_return=True))\n def foo(a: int, b: int) -> int:\n return a + b\n\n assert foo(1, 2) == 3\n\n\ndef test_validate_all():\n @validate_call(config=dict(validate_default=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_validate_call.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_validate_call.py_test_validate_all_positional_test_validate_all_positional.assert_module_foo_0_d", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 570, "end_line": 584, "span_ids": ["test_validate_all_positional"], "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_all_positional(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom datetime import datetime\n\nfrom pydantic import Field, validate_call\n\n@validate_call(config=dict(validate_default=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_validators.py_test_root_validator_allow_reuse_inheritance_test_root_validator_allow_reuse_inheritance.assert_Child_x_1_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_root_validator_allow_reuse_inheritance_test_root_validator_allow_reuse_inheritance.assert_Child_x_1_model_d", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2532, "end_line": 2554, "span_ids": ["test_root_validator_allow_reuse_inheritance"], "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_root_validator_allow_reuse_inheritance():\n with pytest.warns(PydanticDeprecatedSince20):\n\n class Parent(BaseModel):\n x: int\n\n @root_validator(skip_on_failure=True)\n def root_val(cls, v: Dict[str, Any]) -> Dict[str, Any]:\n v['x'] += 1\n return v\n\n with pytest.warns(PydanticDeprecatedSince20):\n\n class Child(Parent):\n @root_validator(skip_on_failure=True)\n def root_val(cls, v: Dict[str, Any]) -> Dict[str, Any]:\n assert v == {'x': 1}\n v = super().root_val(v)\n assert v == {'x': 2}\n return {'x': 4}\n\n assert Parent(x=1).model_dump() == {'x': 2}\n assert Child(x=1).model_dump() == {'x': 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_bare_root_validator_test_validator_with_underscore_name.assert_Model_name_Adrian": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_bare_root_validator_test_validator_with_underscore_name.assert_Model_name_Adrian", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2557, "end_line": 2588, "span_ids": ["test_validator_with_underscore_name", "test_bare_root_validator"], "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_bare_root_validator():\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n 'If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`.'\n ' Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.'\n ),\n ):\n with pytest.warns(\n PydanticDeprecatedSince20, match='Pydantic V1 style `@root_validator` validators are deprecated.'\n ):\n\n class Model(BaseModel):\n @root_validator\n @classmethod\n def validate_values(cls, values):\n return values\n\n\ndef test_validator_with_underscore_name() -> None:\n \"\"\"\n https://github.com/pydantic/pydantic/issues/5252\n \"\"\"\n\n def f(name: str) -> str:\n return name.lower()\n\n class Model(BaseModel):\n name: str\n _normalize_name = field_validator('name')(f)\n\n assert Model(name='Adrian').name == 'adrian'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_set_dataclass_fields_set_dataclass_fields._type_ignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_set_dataclass_fields_set_dataclass_fields._type_ignore", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_dataclasses.py", "file_name": "_dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 83, "span_ids": ["set_dataclass_fields"], "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 set_dataclass_fields(\n cls: type[StandardDataclass],\n types_namespace: dict[str, Any] | None = None,\n config_wrapper: _config.ConfigWrapper | None = None,\n) -> None:\n \"\"\"Collect and set `cls.__pydantic_fields__`.\n\n Args:\n cls: The class.\n types_namespace: The types namespace, defaults to `None`.\n config_wrapper: The config wrapper instance, defaults to `None`.\n \"\"\"\n typevars_map = get_standard_typevars_map(cls)\n fields = collect_dataclass_fields(cls, types_namespace, typevars_map=typevars_map, config_wrapper=config_wrapper)\n\n cls.__pydantic_fields__ = fields # 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/_internal/_decorators.py_ValidatorDecoratorInfo_ValidatorDecoratorInfo.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.check_fields", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 51, "span_ids": ["ValidatorDecoratorInfo"], "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": "@dataclass(**slots_true)\nclass ValidatorDecoratorInfo:\n \"\"\"A container for data from `@validator` so that we can access it\n while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@validator'.\n fields: A tuple of field names the validator should be called on.\n mode: The proposed validator mode.\n each_item: For complex objects (sets, lists etc.) whether to validate individual\n elements rather than the whole object.\n always: Whether this method and other validators should be called even if the value is missing.\n check_fields: Whether to check that the fields actually exist on the model.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@validator'\n\n fields: tuple[str, ...]\n mode: Literal['before', 'after']\n each_item: bool\n always: bool\n check_fields: 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/_decorators.py_FieldValidatorDecoratorInfo_RootValidatorDecoratorInfo.mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldValidatorDecoratorInfo_RootValidatorDecoratorInfo.mode", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 84, "span_ids": ["FieldValidatorDecoratorInfo", "RootValidatorDecoratorInfo"], "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": "@dataclass(**slots_true)\nclass FieldValidatorDecoratorInfo:\n \"\"\"A container for data from `@field_validator` so that we can access it\n while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@field_validator'.\n fields: A tuple of field names the validator should be called on.\n mode: The proposed validator mode.\n check_fields: Whether to check that the fields actually exist on the model.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@field_validator'\n\n fields: tuple[str, ...]\n mode: FieldValidatorModes\n check_fields: bool | None\n\n\n@dataclass(**slots_true)\nclass RootValidatorDecoratorInfo:\n \"\"\"A container for data from `@root_validator` so that we can access it\n while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@root_validator'.\n mode: The proposed validator mode.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@root_validator'\n mode: Literal['before', '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/pydantic/_internal/_decorators.py_FieldSerializerDecoratorInfo_FieldSerializerDecoratorInfo.check_fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_FieldSerializerDecoratorInfo_FieldSerializerDecoratorInfo.check_fields", "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": 107, "span_ids": ["FieldSerializerDecoratorInfo"], "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": "@dataclass(**slots_true)\nclass FieldSerializerDecoratorInfo:\n \"\"\"A container for data from `@field_serializer` so that we can access it\n while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@field_serializer'.\n fields: A tuple of field names the serializer should be called on.\n mode: The proposed serializer mode.\n return_type: The type of the serializer's return value.\n when_used: The serialization condition. Accepts a string with values `'always'`, `'unless-none'`, `'json'`,\n and `'json-unless-none'`.\n check_fields: Whether to check that the fields actually exist on the model.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@field_serializer'\n fields: tuple[str, ...]\n mode: Literal['plain', 'wrap']\n return_type: Any\n when_used: core_schema.WhenUsed\n check_fields: 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/_decorators.py_ModelSerializerDecoratorInfo_ModelSerializerDecoratorInfo.when_used": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelSerializerDecoratorInfo_ModelSerializerDecoratorInfo.when_used", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 126, "span_ids": ["ModelSerializerDecoratorInfo"], "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": "@dataclass(**slots_true)\nclass ModelSerializerDecoratorInfo:\n \"\"\"A container for data from `@model_serializer` so that we can access it\n while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@model_serializer'.\n mode: The proposed serializer mode.\n return_type: The type of the serializer's return value.\n when_used: The serialization condition. Accepts a string with values `'always'`, `'unless-none'`, `'json'`,\n and `'json-unless-none'`.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@model_serializer'\n mode: Literal['plain', 'wrap']\n return_type: Any\n when_used: core_schema.WhenUsed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_ModelValidatorDecoratorInfo_DecoratedType._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ModelValidatorDecoratorInfo_DecoratedType._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 150, "span_ids": ["ModelValidatorDecoratorInfo", "impl:2"], "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": "@dataclass(**slots_true)\nclass ModelValidatorDecoratorInfo:\n \"\"\"A container for data from `@model_validator` so that we can access it\n while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@model_serializer'.\n mode: The proposed serializer mode.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@model_validator'\n mode: Literal['wrap', 'before', 'after']\n\n\nDecoratorInfo: TypeAlias = \"\"\"Union[\n ValidatorDecoratorInfo,\n FieldValidatorDecoratorInfo,\n RootValidatorDecoratorInfo,\n FieldSerializerDecoratorInfo,\n ModelSerializerDecoratorInfo,\n ModelValidatorDecoratorInfo,\n ComputedFieldInfo,\n]\"\"\"\n\nReturnType = TypeVar('ReturnType')\nDecoratedType: TypeAlias = (\n 'Union[classmethod[Any, Any, ReturnType], staticmethod[Any, ReturnType], Callable[..., ReturnType], property]'\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_DecoratorInfoType_Decorator.info", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 220, "span_ids": ["Decorator", "impl:8"], "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": "DecoratorInfoType = TypeVar('DecoratorInfoType', bound=DecoratorInfo)\n\n\n@dataclass(**slots_true)\nclass Decorator(Generic[DecoratorInfoType]):\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 Attributes:\n cls_ref: The class ref.\n cls_var_name: The decorated function name.\n func: The decorated function.\n shim: A wrapper function to wrap V1 style function.\n info: The decorator info.\n \"\"\"\n\n cls_ref: str\n cls_var_name: str\n func: Callable[..., Any]\n shim: Callable[[Any], Any] | None\n info: DecoratorInfoType", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_AnyDecoratorCallable_is_instance_method_from_sig.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_AnyDecoratorCallable_is_instance_method_from_sig.return.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 655, "end_line": 676, "span_ids": ["is_instance_method_from_sig", "impl:12"], "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": "AnyDecoratorCallable: TypeAlias = (\n 'Union[classmethod[Any, Any, Any], staticmethod[Any, Any], partialmethod[Any], Callable[..., Any]]'\n)\n\n\ndef is_instance_method_from_sig(function: AnyDecoratorCallable) -> bool:\n \"\"\"Whether the function is an instance method.\n\n It will consider a function as instance method if the first parameter of\n function is `self`.\n\n Args:\n function: The function to check.\n\n Returns:\n `True` if the function is an instance method, `False` otherwise.\n \"\"\"\n sig = signature(unwrap_wrapped_function(function))\n first = next(iter(sig.parameters.values()), None)\n if first and first.name == 'self':\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/_decorators.py_ensure_classmethod_based_on_signature__is_classmethod_from_sig.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_ensure_classmethod_based_on_signature__is_classmethod_from_sig.return.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 629, "end_line": 650, "span_ids": ["_is_classmethod_from_sig", "ensure_classmethod_based_on_signature"], "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 ensure_classmethod_based_on_signature(function: AnyDecoratorCallable) -> Any:\n \"\"\"Apply the `@classmethod` decorator on the function.\n\n Args:\n function: The function to apply the decorator on.\n\n Return:\n The `@classmethod` decorator applied function.\n \"\"\"\n if not isinstance(\n unwrap_wrapped_function(function, unwrap_class_static_method=False), classmethod\n ) and _is_classmethod_from_sig(function):\n return classmethod(function) # type: ignore[arg-type]\n return function\n\n\ndef _is_classmethod_from_sig(function: AnyDecoratorCallable) -> bool:\n sig = signature(unwrap_wrapped_function(function))\n first = next(iter(sig.parameters.values()), None)\n if first and first.name == 'cls':\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/_decorators.py_get_function_return_type_get_function_return_type.if_explicit_return_type_i.else_.return.explicit_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_function_return_type_get_function_return_type.if_explicit_return_type_i.else_.return.explicit_return_type", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 758, "end_line": 781, "span_ids": ["get_function_return_type"], "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 get_function_return_type(\n func: Any, explicit_return_type: Any, types_namespace: dict[str, Any] | None = None\n) -> Any:\n \"\"\"Get the function return type.\n\n It gets the return type from the type annotation if `explicit_return_type` is `None`.\n Otherwise, it returns `explicit_return_type`.\n\n Args:\n func: The function to get its return type.\n explicit_return_type: The explicit return type.\n types_namespace: The types namespace, defaults to `None`.\n\n Returns:\n The function return type.\n \"\"\"\n if explicit_return_type is PydanticUndefined:\n # try to get it from the type annotation\n hints = get_function_type_hints(\n unwrap_wrapped_function(func), include_keys={'return'}, types_namespace=types_namespace\n )\n return hints.get('return', PydanticUndefined)\n else:\n return explicit_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/_internal/_decorators.py_count_positional_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_count_positional_params_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 718, "end_line": 739, "span_ids": ["count_positional_params", "ensure_property", "can_be_positional"], "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 count_positional_params(sig: Signature) -> int:\n return sum(1 for param in sig.parameters.values() if can_be_positional(param))\n\n\ndef can_be_positional(param: Parameter) -> bool:\n return param.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD)\n\n\ndef ensure_property(f: Any) -> Any:\n \"\"\"Ensure that a function is a `property` or `cached_property`, or is a valid descriptor.\n\n Args:\n f: The function to check.\n\n Returns:\n The function, or a `property` or `cached_property` instance wrapping the function.\n \"\"\"\n if ismethoddescriptor(f) or isdatadescriptor(f):\n return f\n else:\n return property(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/_internal/_decorators_v1.py__Logic_for_V1_validator_can_be_keyword.return.param_kind_in_Parameter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py__Logic_for_V1_validator_can_be_keyword.return.param_kind_in_Parameter_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators_v1.py", "file_name": "_decorators_v1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 55, "span_ids": ["V1ValidatorWithValuesKwOnly", "V1ValidatorWithValuesAndKwargs", "V1ValidatorWithKwargs", "V1ValidatorWithValuesAndKwargs.__call__", "impl", "can_be_keyword", "V1ValidatorWithValues.__call__", "V1ValidatorWithValues", "V1OnlyValueValidator", "V1ValidatorWithKwargs.__call__", "docstring", "V1ValidatorWithValuesKwOnly.__call__", "V1OnlyValueValidator.__call__"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Logic for V1 validators, e.g. `@validator` and `@root_validator`.\"\"\"\nfrom __future__ import annotations as _annotations\n\nfrom inspect import Parameter, signature\nfrom typing import Any, Dict, Tuple, Union, cast\n\nfrom pydantic_core import core_schema\nfrom typing_extensions import Protocol\n\nfrom ..errors import PydanticUserError\nfrom ._decorators import can_be_positional\n\n\nclass V1OnlyValueValidator(Protocol):\n \"\"\"A simple validator, supported for V1 validators and V2 validators.\"\"\"\n\n def __call__(self, __value: Any) -> Any:\n ...\n\n\nclass V1ValidatorWithValues(Protocol):\n \"\"\"A validator with `values` argument, supported for V1 validators and V2 validators.\"\"\"\n\n def __call__(self, __value: Any, values: dict[str, Any]) -> Any:\n ...\n\n\nclass V1ValidatorWithValuesKwOnly(Protocol):\n \"\"\"A validator with keyword only `values` argument, supported for V1 validators and V2 validators.\"\"\"\n\n def __call__(self, __value: Any, *, values: dict[str, Any]) -> Any:\n ...\n\n\nclass V1ValidatorWithKwargs(Protocol):\n \"\"\"A validator with `kwargs` argument, supported for V1 validators and V2 validators.\"\"\"\n\n def __call__(self, __value: Any, **kwargs: Any) -> Any:\n ...\n\n\nclass V1ValidatorWithValuesAndKwargs(Protocol):\n \"\"\"A validator with `values` and `kwargs` arguments, supported for V1 validators and V2 validators.\"\"\"\n\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\ndef can_be_keyword(param: Parameter) -> bool:\n return param.kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_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/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator__ApplyInferredDiscriminator._This_class_is_used_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py__ApplyInferredDiscriminator__ApplyInferredDiscriminator._This_class_is_used_to_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 52, "span_ids": ["_ApplyInferredDiscriminator"], "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 _ApplyInferredDiscriminator:\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/_model_construction.py__Private_logic_for_crea_object_setattr.object___setattr__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__Private_logic_for_crea_object_setattr.object___setattr__", "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": 43, "span_ids": ["docstring"], "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": "\"\"\"Private logic for creating models.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport builtins\nimport operator\nimport typing\nimport warnings\nimport weakref\nfrom abc import ABCMeta\nfrom functools import partial\nfrom types import FunctionType\nfrom typing import Any, Callable, Generic, NoReturn\n\nimport typing_extensions\nfrom pydantic_core import PydanticUndefined, SchemaSerializer\nfrom typing_extensions import dataclass_transform, deprecated\n\nfrom ..errors import PydanticUndefinedAnnotation, PydanticUserError\nfrom ..plugin._schema_validator import create_schema_validator\nfrom ..warnings import GenericBeforeBaseModelWarning, PydanticDeprecatedSince20\nfrom ._config import ConfigWrapper\nfrom ._decorators import DecoratorInfos, PydanticDescriptorProxy, get_attribute_from_bases, unwrap_wrapped_function\nfrom ._fields import collect_model_fields, is_valid_field_name, is_valid_privateattr_name\nfrom ._generate_schema import GenerateSchema\nfrom ._generics import PydanticGenericMetadata, get_model_typevars_map\nfrom ._mock_val_ser import MockValSer, set_model_mocks\nfrom ._schema_generation_shared import CallbackGetCoreSchemaHandler\nfrom ._signature import generate_pydantic_signature\nfrom ._typing_extra import get_cls_types_namespace, is_annotated, is_classvar, parent_frame_namespace\nfrom ._utils import ClassAttribute, SafeGetItemProxy\nfrom ._validate_call import ValidateCallWrapper\n\nif typing.TYPE_CHECKING:\n from ..fields import Field as PydanticModelField\n from ..fields import FieldInfo, ModelPrivateAttr\n from ..main import BaseModel\nelse:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n PydanticModelField = object()\n\nobject_setattr = 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/_internal/_repr.py__Tools_to_provide_prett_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__Tools_to_provide_prett_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": 25, "span_ids": ["PlainRepr", "PlainRepr.__repr__", "docstring"], "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": "\"\"\"Tools to provide pretty/human-readable display of objects.\"\"\"\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_extensions.TypeAlias = 'typing.Iterable[tuple[str | None, Any]]'\n RichReprResult: typing_extensions.TypeAlias = (\n 'typing.Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]'\n )\n\n\nclass PlainRepr(str):\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/_schema_generation_shared.py__Types_and_utility_func_if_TYPE_CHECKING_.HandlerOverride.Callable_CoreSchemaOrFie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py__Types_and_utility_func_if_TYPE_CHECKING_.HandlerOverride.Callable_CoreSchemaOrFie", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_schema_generation_shared.py", "file_name": "_schema_generation_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "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": "\"\"\"Types and utility functions used by various other internal tools.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Any, Callable\n\nfrom pydantic_core import core_schema\nfrom typing_extensions import Literal\n\nfrom ..annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler\n\nif TYPE_CHECKING:\n from ..json_schema import GenerateJsonSchema, JsonSchemaValue\n from ._core_utils import CoreSchemaOrField\n from ._generate_schema import GenerateSchema\n\n GetJsonSchemaFunction = Callable[[CoreSchemaOrField, GetJsonSchemaHandler], JsonSchemaValue]\n HandlerOverride = Callable[[CoreSchemaOrField], JsonSchemaValue]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_schema_generation_shared.py_CallbackGetCoreSchemaHandler.resolve_ref_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_CallbackGetCoreSchemaHandler.resolve_ref_schema_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_schema_generation_shared.py", "file_name": "_schema_generation_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 118, "span_ids": ["CallbackGetCoreSchemaHandler.resolve_ref_schema"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallbackGetCoreSchemaHandler(GetCoreSchemaHandler):\n\n def resolve_ref_schema(self, maybe_ref_schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n \"\"\"Resolves reference in the core schema.\n\n Args:\n maybe_ref_schema: The input core schema that may contains reference.\n\n Returns:\n Resolved core schema.\n\n Raises:\n LookupError: If it can't find the definition for reference.\n \"\"\"\n if maybe_ref_schema['type'] == 'definition-ref':\n ref = maybe_ref_schema['schema_ref']\n if ref not in self._generate_schema.defs.definitions:\n raise LookupError(\n f'Could not find a ref for {ref}.'\n ' Maybe you tried to call resolve_ref_schema from within a recursive model?'\n )\n return self._generate_schema.defs.definitions[ref]\n elif maybe_ref_schema['type'] == 'definitions':\n return self.resolve_ref_schema(maybe_ref_schema['schema'])\n return maybe_ref_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/_std_types_schema.py__Logic_for_generating_p_if_typing_TYPE_CHECKING_.StdSchemaFunction.Callable_GenerateSchema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py__Logic_for_generating_p_if_typing_TYPE_CHECKING_.StdSchemaFunction.Callable_GenerateSchema_", "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": 45, "span_ids": ["docstring"], "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": "\"\"\"Logic 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 collections\nimport collections.abc\nimport dataclasses\nimport decimal\nimport inspect\nimport os\nimport typing\nfrom enum import Enum\nfrom functools import partial\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom operator import attrgetter\nfrom typing import Any, Callable, Iterable, TypeVar\n\nimport typing_extensions\nfrom pydantic_core import (\n CoreSchema,\n MultiHostUrl,\n PydanticCustomError,\n PydanticOmit,\n Url,\n core_schema,\n)\nfrom typing_extensions import get_args, get_origin\n\nfrom pydantic.errors import PydanticSchemaGenerationError\nfrom pydantic.fields import FieldInfo\nfrom pydantic.types import Strict\n\nfrom ..config import ConfigDict\nfrom ..json_schema import JsonSchemaValue, update_json_schema\nfrom . import _known_annotated_metadata, _typing_extra, _validators\nfrom ._core_utils import get_type_ref\nfrom ._internal_dataclass import slots_true\nfrom ._schema_generation_shared import GetCoreSchemaHandler, GetJsonSchemaHandler\n\nif typing.TYPE_CHECKING:\n from ._generate_schema import GenerateSchema\n\n StdSchemaFunction = Callable[[GenerateSchema, type[Any]], core_schema.CoreSchema]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_url_prepare_pydantic_annotations_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_url_prepare_pydantic_annotations_", "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": 887, "end_line": 918, "span_ids": ["url_prepare_pydantic_annotations", "impl:8"], "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 url_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n if source_type is Url:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.url_schema(),\n lambda cs, handler: handler(cs),\n ),\n *annotations,\n ]\n if source_type is MultiHostUrl:\n return source_type, [\n SchemaTransformer(\n lambda _1, _2: core_schema.multi_host_url_schema(),\n lambda cs, handler: handler(cs),\n ),\n *annotations,\n ]\n\n\nPREPARE_METHODS: tuple[Callable[[Any, Iterable[Any], ConfigDict], tuple[Any, list[Any]] | None], ...] = (\n decimal_prepare_pydantic_annotations,\n sequence_like_prepare_pydantic_annotations,\n datetime_prepare_pydantic_annotations,\n uuid_prepare_pydantic_annotations,\n path_schema_prepare_pydantic_annotations,\n mapping_like_prepare_pydantic_annotations,\n ip_prepare_pydantic_annotations,\n url_prepare_pydantic_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/_typing_extra.py__Logic_for_interacting__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__Logic_for_interacting__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": 1, "end_line": 94, "span_ids": ["is_literal_type", "docstring", "literal_values", "impl:35", "is_deprecated_instance", "is_callable_type", "is_none_type"], "tokens": 688}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Logic for interacting with type annotations, mostly extensions, shims and hacks to wrap python's typing module.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport sys\nimport types\nimport typing\nimport warnings\nfrom collections.abc import Callable\nfrom functools import partial\nfrom types import GetSetDescriptorType\nfrom typing import TYPE_CHECKING, Any, Final\n\nfrom typing_extensions import Annotated, Literal, TypeAliasType, TypeGuard, deprecated, get_args, get_origin\n\nif TYPE_CHECKING:\n from ._dataclasses import StandardDataclass\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 # noqa: F401\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\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 NoneType as NoneType\n\n\nLITERAL_TYPES: set[Any] = {Literal}\nif hasattr(typing, 'Literal'):\n LITERAL_TYPES.add(typing.Literal) # type: ignore\n\n# Check if `deprecated` is a type to prevent errors when using typing_extensions < 4.9.0\nDEPRECATED_TYPES: tuple[Any, ...] = (deprecated,) if isinstance(deprecated, type) else ()\nif hasattr(warnings, 'deprecated'):\n DEPRECATED_TYPES = (*DEPRECATED_TYPES, warnings.deprecated) # type: ignore\n\nNONE_TYPES: tuple[Any, ...] = (None, NoneType, *(tp[None] for tp in LITERAL_TYPES))\n\n\nTypeVarType = Any # since mypy doesn't allow the use of TypeVar as a type\n\n\ndef is_none_type(type_: Any) -> bool:\n return type_ in NONE_TYPES\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_) in LITERAL_TYPES\n\n\ndef is_deprecated_instance(instance: Any) -> TypeGuard[deprecated]:\n return isinstance(instance, DEPRECATED_TYPES)\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/alias_generators.py__Alias_generators_for_c_to_camel.return.re_sub___A_Z_lamb": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/alias_generators.py__Alias_generators_for_c_to_camel.return.re_sub___A_Z_lamb", "embedding": null, "metadata": {"file_path": "pydantic/alias_generators.py", "file_name": "alias_generators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["to_pascal", "to_camel", "docstring"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Alias generators for converting between different capitalization conventions.\"\"\"\nimport re\n\n__all__ = ('to_pascal', 'to_camel', 'to_snake')\n\n\ndef to_pascal(snake: str) -> str:\n \"\"\"Convert a snake_case string to PascalCase.\n\n Args:\n snake: The string to convert.\n\n Returns:\n The PascalCase string.\n \"\"\"\n camel = snake.title()\n return re.sub('([0-9A-Za-z])_(?=[0-9A-Z])', lambda m: m.group(1), camel)\n\n\ndef to_camel(snake: str) -> str:\n \"\"\"Convert a snake_case string to camelCase.\n\n Args:\n snake: The string to convert.\n\n Returns:\n The converted camelCase string.\n \"\"\"\n camel = to_pascal(snake)\n return re.sub('(^_*[A-Z])', lambda m: m.group(1).lower(), camel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_definitions_are__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__Color_definitions_are__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": 29, "span_ids": ["docstring"], "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": "\"\"\"Color definitions are used as per the CSS3\n[CSS Color Module Level 3](http://www.w3.org/TR/css3-color/#svg-color) specification.\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\nWarning: Deprecated\n The `Color` class is deprecated, use `pydantic_extra_types` instead.\n See [`pydantic-extra-types.Color`](../usage/types/extra_types/color_types.md)\n for more information.\n\"\"\"\nimport math\nimport re\nfrom colorsys import hls_to_rgb, rgb_to_hls\nfrom typing import Any, Callable, Optional, Tuple, Type, Union, cast\n\nfrom pydantic_core import CoreSchema, PydanticCustomError, core_schema\nfrom typing_extensions import deprecated\n\nfrom ._internal import _repr\nfrom ._internal._schema_generation_shared import GetJsonSchemaHandler as _GetJsonSchemaHandler\nfrom .json_schema import JsonSchemaValue\nfrom .warnings import PydanticDeprecatedSince20\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_Color_Color.original.return.self__original": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_Color_Color.original.return.self__original", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 109, "span_ids": ["Color.__get_pydantic_json_schema__", "Color.original", "Color", "Color.__init__"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@deprecated(\n 'The `Color` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_color/.',\n category=PydanticDeprecatedSince20,\n)\nclass Color(_repr.Representation):\n \"\"\"Represents a color.\"\"\"\n\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 __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: _GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = {}\n field_schema.update(type='string', format='color')\n return field_schema\n\n def original(self) -> ColorType:\n \"\"\"Original value passed to `Color`.\"\"\"\n return self._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/pydantic/dataclasses.py__Provide_an_enhanced_da_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__Provide_an_enhanced_da_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": 92, "span_ids": ["docstring"], "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": "\"\"\"Provide an enhanced dataclass that performs validation.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport sys\nimport types\nfrom typing import TYPE_CHECKING, Any, Callable, Generic, NoReturn, TypeVar, overload\n\nfrom typing_extensions import Literal, TypeGuard, dataclass_transform\n\nfrom ._internal import _config, _decorators, _typing_extra\nfrom ._internal import _dataclasses as _pydantic_dataclasses\nfrom ._migration import getattr_migration\nfrom .config import ConfigDict\nfrom .fields import Field, FieldInfo\n\nif TYPE_CHECKING:\n from ._internal._dataclasses import PydanticDataclass\n\n__all__ = 'dataclass', 'rebuild_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 slots: bool = ...,\n ) -> Callable[[type[_T]], type[PydanticDataclass]]: # type: ignore\n ...\n\n @dataclass_transform(field_specifiers=(dataclasses.field, Field))\n @overload\n def dataclass(\n _cls: type[_T], # type: ignore\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 slots: 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]]: # type: ignore\n ...\n\n @dataclass_transform(field_specifiers=(dataclasses.field, Field))\n @overload\n def dataclass(\n _cls: type[_T], # type: ignore\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.create_dataclass_dataclass.return.create_dataclass__cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass.create_dataclass_dataclass.return.create_dataclass__cls_", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 250, "span_ids": ["dataclass"], "tokens": 752}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclass_transform(field_specifiers=(dataclasses.field, Field))\ndef dataclass( # noqa: C901\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 slots: bool = False,\n) -> Callable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]:\n # ... other code\n\n def create_dataclass(cls: type[Any]) -> type[PydanticDataclass]:\n \"\"\"Create a Pydantic dataclass from a regular dataclass.\n\n Args:\n cls: The class to create the Pydantic dataclass from.\n\n Returns:\n A Pydantic dataclass.\n \"\"\"\n original_cls = cls\n\n config_dict = config\n if config_dict is None:\n # if not explicitly provided, read from the type\n cls_config = getattr(cls, '__pydantic_config__', None)\n if cls_config is not None:\n config_dict = cls_config\n config_wrapper = _config.ConfigWrapper(config_dict)\n decorators = _decorators.DecoratorInfos.build(cls)\n\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 if _pydantic_dataclasses.is_builtin_dataclass(cls):\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 # We don't want to add validation to the existing std lib dataclass, so we will subclass it\n # If the class is generic, we need to make sure the subclass also inherits from Generic\n # with all the same parameters.\n bases = (cls,)\n if issubclass(cls, Generic):\n generic_base = Generic[cls.__parameters__] # type: ignore\n bases = bases + (generic_base,)\n cls = types.new_class(cls.__name__, bases)\n\n make_pydantic_fields_compatible(cls)\n\n cls = dataclasses.dataclass( # type: ignore[call-overload]\n cls,\n # the value of init here doesn't affect anything except that it makes it easier to generate a signature\n init=True,\n repr=repr,\n eq=eq,\n order=order,\n unsafe_hash=unsafe_hash,\n frozen=frozen,\n **kwargs,\n )\n\n cls.__pydantic_decorators__ = decorators # type: ignore\n cls.__doc__ = original_doc\n cls.__module__ = original_cls.__module__\n cls.__qualname__ = original_cls.__qualname__\n pydantic_complete = _pydantic_dataclasses.complete_dataclass(\n cls, config_wrapper, raise_errors=False, types_namespace=None\n )\n cls.__pydantic_complete__ = pydantic_complete # type: ignore\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/errors.py__Pydantic_specific_erro_PydanticErrorCodes.Literal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py__Pydantic_specific_erro_PydanticErrorCodes.Literal_", "embedding": null, "metadata": {"file_path": "pydantic/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 65, "span_ids": ["docstring"], "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": "\"\"\"Pydantic-specific errors.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport re\n\nfrom typing_extensions import Literal, Self\n\nfrom ._migration import getattr_migration\nfrom .version import version_short\n\n__all__ = (\n 'PydanticUserError',\n 'PydanticUndefinedAnnotation',\n 'PydanticImportError',\n 'PydanticSchemaGenerationError',\n 'PydanticInvalidForJsonSchema',\n 'PydanticErrorCodes',\n)\n\n# We use this URL to allow for future flexibility about how we host the docs, while allowing for Pydantic\n# code in the while with \"old\" URLs to still work.\n# 'u' refers to \"user errors\" - e.g. errors caused by developers using pydantic, as opposed to validation errors.\nDEV_ERROR_DOCS_URL = f'https://errors.pydantic.dev/{version_short()}/u/'\nPydanticErrorCodes = Literal[\n 'class-not-fully-defined',\n 'custom-json-schema',\n 'decorator-missing-field',\n 'discriminator-no-field',\n 'discriminator-alias-type',\n 'discriminator-needs-literal',\n 'discriminator-alias',\n 'discriminator-validator',\n 'callable-discriminator-no-tag',\n 'typed-dict-version',\n 'model-field-overridden',\n 'model-field-missing-annotation',\n 'config-both',\n 'removed-kwargs',\n 'invalid-for-json-schema',\n 'json-schema-already-used',\n 'base-model-instantiated',\n 'undefined-annotation',\n 'schema-for-unknown-type',\n 'import-error',\n 'create-model-field-definitions',\n 'create-model-config-base',\n 'validator-no-fields',\n 'validator-invalid-fields',\n 'validator-instance-method',\n 'root-validator-pre-skip',\n 'model-serializer-instance-method',\n 'validator-field-config-info',\n 'validator-v1-signature',\n 'validator-signature',\n 'field-serializer-signature',\n 'model-serializer-signature',\n 'multiple-field-serializers',\n 'invalid_annotated_type',\n 'type-adapter-config-unused',\n 'root-model-extra',\n 'unevaluable-type-annotation',\n 'dataclass-init-false-extra-allow',\n 'clashing-init-and-init-var',\n 'model-config-invalid-field-name',\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticErrorMixin_PydanticUserError._An_error_raised_due_to": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/errors.py_PydanticErrorMixin_PydanticUserError._An_error_raised_due_to", "embedding": null, "metadata": {"file_path": "pydantic/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 80, "span_ids": ["PydanticErrorMixin.__init__", "PydanticUserError", "PydanticErrorMixin.__str__", "PydanticErrorMixin"], "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 PydanticErrorMixin:\n \"\"\"A mixin class for common functionality shared by all Pydantic-specific errors.\n\n Attributes:\n message: A message describing the error.\n code: An optional error code from PydanticErrorCodes enum.\n \"\"\"\n\n def __init__(self, message: str, *, code: PydanticErrorCodes | None) -> None:\n self.message = message\n self.code = code\n\n def __str__(self) -> str:\n if self.code is None:\n return self.message\n else:\n return f'{self.message}\\n\\nFor further information visit {DEV_ERROR_DOCS_URL}{self.code}'\n\n\nclass PydanticUserError(PydanticErrorMixin, TypeError):\n \"\"\"An error raised due to incorrect use of Pydantic.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__The_networks_module_co___all__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py__The_networks_module_co___all__._", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["docstring"], "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": "\"\"\"The networks module contains types for common network-related fields.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses as _dataclasses\nimport re\nfrom importlib.metadata import version\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, Self, TypeAlias\n\nfrom ._internal import _fields, _repr, _schema_generation_shared\nfrom ._migration import getattr_migration\nfrom .annotated_handlers import GetCoreSchemaHandler\nfrom .json_schema import JsonSchemaValue\n\nif TYPE_CHECKING:\n import email_validator\n\n NetworkType: TypeAlias = '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 'NatsDsn',\n 'validate_email',\n 'MySQLDsn',\n 'MariaDBDsn',\n 'ClickHouseDsn',\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_confrozenset_AnyItemType.TypeVar_AnyItemType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_confrozenset_AnyItemType.TypeVar_AnyItemType_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 821, "end_line": 837, "span_ids": ["confrozenset", "impl:35"], "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 confrozenset(\n item_type: type[HashableItemType], *, min_length: int | None = None, max_length: int | None = None\n) -> type[frozenset[HashableItemType]]:\n \"\"\"A wrapper around `typing.FrozenSet` that allows for additional constraints.\n\n Args:\n item_type: The type of the items in the frozenset.\n min_length: The minimum length of the frozenset.\n max_length: The maximum length of the frozenset.\n\n Returns:\n The wrapped frozenset type.\n \"\"\"\n return Annotated[FrozenSet[item_type], annotated_types.Len(min_length or 0, max_length)]\n\n\nAnyItemType = TypeVar('AnyItemType')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_SecretBytes_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_SecretBytes_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": 1670, "end_line": 1713, "span_ids": ["PaymentCardBrand", "SecretBytes.__len__", "SecretBytes._display", "PaymentCardBrand.__str__", "SecretBytes"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SecretBytes(_SecretField[bytes]):\n \"\"\"A bytes used for storing sensitive information that you do not want to be visible in logging or tracebacks.\n\n It displays `b'**********'` instead of the string value on `repr()` and `str()` calls.\n When the secret value is nonempty, it is displayed as `b'**********'` instead of the underlying value in\n calls to `repr()` and `str()`. If the value _is_ empty, it is displayed as `b''`.\n\n ```py\n from pydantic import BaseModel, SecretBytes\n\n class User(BaseModel):\n username: str\n password: SecretBytes\n\n user = User(username='scolvin', password=b'password1')\n #> username='scolvin' password=SecretBytes(b'**********')\n print(user.password.get_secret_value())\n #> b'password1'\n print((SecretBytes(b'password'), SecretBytes(b'')))\n #> (SecretBytes(b'**********'), SecretBytes(b''))\n ```\n \"\"\"\n\n _inner_schema: ClassVar[CoreSchema] = core_schema.bytes_schema()\n _error_kind: ClassVar[str] = 'bytes_type'\n\n def __len__(self) -> int:\n return len(self._secret_value)\n\n def _display(self) -> bytes:\n return _secret_display(self._secret_value).encode()\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PAYMENT CARD TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass PaymentCardBrand(str, Enum):\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": 1716, "end_line": 1768, "span_ids": ["PaymentCardNumber.validate", "PaymentCardNumber.masked", "PaymentCardNumber.validate_digits", "PaymentCardNumber.__get_pydantic_core_schema__", "PaymentCardNumber", "PaymentCardNumber.__init__"], "tokens": 472}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@deprecated(\n 'The `PaymentCardNumber` class is deprecated, use `pydantic_extra_types` instead. '\n 'See https://docs.pydantic.dev/latest/api/pydantic_extra_types_payment/#pydantic_extra_types.payment.PaymentCardNumber.',\n category=PydanticDeprecatedSince20,\n)\nclass PaymentCardNumber(str):\n \"\"\"Based on: https://en.wikipedia.org/wiki/Payment_card_number.\"\"\"\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, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n return core_schema.with_info_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 \"\"\"Validate the card number and return a `PaymentCardNumber` instance.\"\"\"\n return cls(input_value)\n\n @property\n def masked(self) -> str:\n \"\"\"Mask all but the last 4 digits of the card number.\n\n Returns:\n A masked card number string.\n \"\"\"\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 \"\"\"Validate that the card number is all digits.\"\"\"\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_ByteSize.to_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.to_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": 1849, "end_line": 1866, "span_ids": ["ByteSize.to"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ByteSize(int):\n\n def to(self, unit: str) -> float:\n \"\"\"Converts a byte size to another unit, including both byte and bit units.\n\n Args:\n unit: The unit to convert to. Must be one of the following: B, KB, MB, GB, TB, PB, EB,\n KiB, MiB, GiB, TiB, PiB, EiB (byte units) and\n bit, kbit, mbit, gbit, tbit, pbit, ebit,\n kibit, mibit, gibit, tibit, pibit, eibit (bit units).\n\n Returns:\n The byte size in the new unit.\n \"\"\"\n try:\n unit_div = self.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/v1/typing.py_None_5_if_TYPE_CHECKING_.if_MYPY_.else_.AnyClassMethod.classmethod_Any_Any_Any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py_None_5_if_TYPE_CHECKING_.if_MYPY_.else_.AnyClassMethod.classmethod_Any_Any_Any", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 278, "span_ids": ["impl:43", "impl:35"], "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": "if sys.version_info < (3, 9):\n\n def convert_generics(tp: Type[Any]) -> Type[Any]:\n \"\"\"Python 3.9 and older only supports generics from `typing` module.\n They convert strings to ForwardRef automatically.\n\n Examples::\n typing.List['Hero'] == typing.List[ForwardRef('Hero')]\n \"\"\"\n return tp\n\nelse:\n from typing import _UnionGenericAlias # type: ignore\n\n from typing_extensions import _AnnotatedAlias\n\n def convert_generics(tp: Type[Any]) -> Type[Any]:\n \"\"\"\n Recursively searches for `str` type hints and replaces them with ForwardRef.\n\n Examples::\n convert_generics(list['Hero']) == list[ForwardRef('Hero')]\n convert_generics(dict['Hero', 'Team']) == dict[ForwardRef('Hero'), ForwardRef('Team')]\n convert_generics(typing.Dict['Hero', 'Team']) == typing.Dict[ForwardRef('Hero'), ForwardRef('Team')]\n convert_generics(list[str | 'Hero'] | int) == list[str | ForwardRef('Hero')] | int\n \"\"\"\n origin = get_origin(tp)\n if not origin or not hasattr(tp, '__args__'):\n return tp\n\n args = get_args(tp)\n\n # typing.Annotated needs special treatment\n if origin is Annotated:\n return _AnnotatedAlias(convert_generics(args[0]), args[1:])\n\n # recursively replace `str` instances inside of `GenericAlias` with `ForwardRef(arg)`\n converted = tuple(\n ForwardRef(arg) if isinstance(arg, str) and isinstance(tp, TypingGenericAlias) else convert_generics(arg)\n for arg in args\n )\n\n if converted == args:\n return tp\n elif isinstance(tp, TypingGenericAlias):\n return TypingGenericAlias(origin, converted)\n elif isinstance(tp, TypesUnionType):\n # recreate types.UnionType (PEP604, Python >= 3.10)\n return _UnionGenericAlias(origin, converted)\n else:\n try:\n setattr(tp, '__args__', converted)\n except AttributeError:\n pass\n return tp\n\n\nif sys.version_info < (3, 10):\n\n def is_union(tp: Optional[Type[Any]]) -> bool:\n return tp is Union\n\n WithArgsTypes = (TypingGenericAlias,)\n\nelse:\n import types\n import typing\n\n def is_union(tp: Optional[Type[Any]]) -> bool:\n return tp is Union or tp is types.UnionType # noqa: E721\n\n WithArgsTypes = (typing._GenericAlias, types.GenericAlias, types.UnionType)\n\n\nStrPath = Union[str, PathLike]\n\n\nif TYPE_CHECKING:\n from .fields import ModelField\n\n TupleGenerator = Generator[Tuple[str, Any], None, None]\n DictStrAny = Dict[str, Any]\n DictAny = Dict[Any, Any]\n SetStr = Set[str]\n ListStr = List[str]\n IntStr = Union[int, str]\n AbstractSetIntStr = AbstractSet[IntStr]\n DictIntStrAny = Dict[IntStr, Any]\n MappingIntStrAny = Mapping[IntStr, Any]\n CallableGenerator = Generator[AnyCallable, None, None]\n ReprArgs = Sequence[Tuple[Optional[str], Any]]\n\n MYPY = False\n if MYPY:\n AnyClassMethod = classmethod[Any]\n else:\n # classmethod[TargetType, CallableParamSpecType, CallableReturnType]\n AnyClassMethod = classmethod[Any, Any, 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/v1/typing.py___all___None_8.else_.is_none_type.return.type__in_NONE_TYPES": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/typing.py___all___None_8.else_.is_none_type.return.type__in_NONE_TYPES", "embedding": null, "metadata": {"file_path": "pydantic/v1/typing.py", "file_name": "typing.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 355, "span_ids": ["impl:43", "impl:82"], "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": "__all__ = (\n 'AnyCallable',\n 'NoArgAnyCallable',\n 'NoneType',\n 'is_none_type',\n 'display_as_type',\n 'resolve_annotations',\n 'is_callable_type',\n 'is_literal_type',\n 'all_literal_values',\n 'is_namedtuple',\n 'is_typeddict',\n 'is_typeddict_special',\n 'is_new_type',\n 'new_type_supertype',\n 'is_classvar',\n 'is_finalvar',\n 'update_field_forward_refs',\n 'update_model_forward_refs',\n 'TupleGenerator',\n 'DictStrAny',\n 'DictAny',\n 'SetStr',\n 'ListStr',\n 'IntStr',\n 'AbstractSetIntStr',\n 'DictIntStrAny',\n 'CallableGenerator',\n 'ReprArgs',\n 'AnyClassMethod',\n 'CallableGenerator',\n 'WithArgsTypes',\n 'get_args',\n 'get_origin',\n 'get_sub_types',\n 'typing_base',\n 'get_all_type_hints',\n 'is_union',\n 'StrPath',\n 'MappingIntStrAny',\n)\n\n\nNoneType = None.__class__\n\n\nNONE_TYPES: Tuple[Any, Any, Any] = (None, NoneType, Literal[None])\n\n\nif 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\" check sare 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 return type_ in NONE_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_discriminated_union.py_test_wrapped_nullable_union_test_wrapped_nullable_union._insert_assert_discrimin": {"__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_test_wrapped_nullable_union._insert_assert_discrimin", "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": 1017, "end_line": 1051, "span_ids": ["test_wrapped_nullable_union"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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.with_info_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(include_url=False) == [\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 # insert_assert(discriminated_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._insert_assert_Model_mod_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._insert_assert_Model_mod_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": 3336, "end_line": 3375, "span_ids": ["test_advanced_generic_schema"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_advanced_generic_schema():\n\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {'CustomType': {'enum': ['a', 'b'], 'title': 'CustomType title', 'type': 'string'}},\n 'properties': {\n 'data0': {\n 'anyOf': [{'type': 'string'}, {'items': {'type': 'string'}, 'type': 'array'}],\n 'title': 'Gen title',\n },\n 'data1': {\n 'anyOf': [{'$ref': '#/$defs/CustomType'}, {'items': {'$ref': '#/$defs/CustomType'}, 'type': 'array'}],\n 'description': 'Data 1 description',\n 'title': 'Data1 title',\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': {'items': {}, 'title': 'Data3', 'type': 'array'},\n 'data4': {\n 'maxItems': 1,\n 'minItems': 1,\n 'prefixItems': [{'$ref': '#/$defs/CustomType'}],\n 'title': 'Data4',\n 'type': 'array',\n },\n 'data5': {\n 'maxItems': 2,\n 'minItems': 2,\n 'prefixItems': [{'$ref': '#/$defs/CustomType'}, {'type': 'string'}],\n 'title': 'Data5',\n 'type': 'array',\n },\n },\n 'required': ['data0', 'data1', 'data2', 'data3', 'data4', 'data5'],\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_deeper_nested_discriminated_annotated_union_test_deeper_nested_discriminated_annotated_union._insert_assert_Model_mod": {"__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._insert_assert_Model_mod", "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": 3235, "end_line": 3267, "span_ids": ["test_deeper_nested_discriminated_annotated_union"], "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_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\n # insert_assert(Model.model_json_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_discriminated_annotated_union_literal_enum_test_discriminated_annotated_union_literal_enum._insert_assert_Model_mod": {"__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._insert_assert_Model_mod", "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": 3407, "end_line": 3451, "span_ids": ["test_discriminated_annotated_union_literal_enum"], "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_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\n # insert_assert(Model.model_json_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_lax_or_strict_schema_test_lax_or_strict_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_lax_or_strict_schema_test_lax_or_strict_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": 4526, "end_line": 4543, "span_ids": ["test_lax_or_strict_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_lax_or_strict_schema():\n class MyLaxOrStrict:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n int_schema = core_schema.int_schema()\n return core_schema.lax_or_strict_schema(lax_schema=int_schema, strict_schema=int_schema, strict=True)\n\n class Model(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n a: MyLaxOrStrict\n\n assert Model.model_json_schema() == {\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\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_override_enum_json_schema_test_override_enum_json_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_override_enum_json_schema_test_override_enum_json_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": 5074, "end_line": 5097, "span_ids": ["test_override_enum_json_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": "def test_override_enum_json_schema():\n class CustomType(Enum):\n A = 'a'\n B = 'b'\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> core_schema.CoreSchema:\n json_schema = handler(core_schema)\n json_schema.update(title='CustomType title', type='string')\n return json_schema\n\n class Model(BaseModel):\n x: CustomType\n\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {'CustomType': {'enum': ['a', 'b'], 'title': 'CustomType title', 'type': 'string'}},\n 'properties': {'x': {'$ref': '#/$defs/CustomType'}},\n 'required': ['x'],\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_main.py_test_get_core_schema_unpacks_refs_for_source_type_test_get_core_schema_unpacks_refs_for_source_type.assert_received_schemas_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_get_core_schema_unpacks_refs_for_source_type_test_get_core_schema_unpacks_refs_for_source_type.assert_received_schemas_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2368, "end_line": 2414, "span_ids": ["test_get_core_schema_unpacks_refs_for_source_type"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_core_schema_unpacks_refs_for_source_type() -> None:\n # use a list to track since we end up calling `__get_pydantic_core_schema__` multiple times for models\n # e.g. InnerModel.__get_pydantic_core_schema__ gets called:\n # 1. When InnerModel is defined\n # 2. When OuterModel is defined\n # 3. When we use the TypeAdapter\n received_schemas: dict[str, list[str]] = defaultdict(list)\n\n @dataclass\n class Marker:\n name: str\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n received_schemas[self.name].append(schema['type'])\n return schema\n\n class InnerModel(BaseModel):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n received_schemas['InnerModel'].append(schema['type'])\n schema['metadata'] = schema.get('metadata', {})\n schema['metadata']['foo'] = 'inner was here!'\n return deepcopy(schema)\n\n class OuterModel(BaseModel):\n inner: Annotated[InnerModel, Marker('Marker(\"inner\")')]\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n received_schemas['OuterModel'].append(schema['type'])\n return schema\n\n ta = TypeAdapter(Annotated[OuterModel, Marker('Marker(\"outer\")')])\n\n # super hacky check but it works in all cases and avoids a complex and fragile iteration over CoreSchema\n # the point here is to verify that `__get_pydantic_core_schema__`\n assert 'inner was here' in str(ta.core_schema)\n\n assert received_schemas == {\n 'InnerModel': ['model', 'model', 'model'],\n 'Marker(\"inner\")': ['definition-ref', 'definition-ref'],\n 'OuterModel': ['model', 'model'],\n 'Marker(\"outer\")': ['definition-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_types_typeddict.py_test_typeddict_schema_test_typeddict_schema.CustomTD.__get_pydantic_core_schema__.return.schema": {"__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.CustomTD.__get_pydantic_core_schema__.return.schema", "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": 203, "end_line": 223, "span_ids": ["test_typeddict_schema"], "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_typeddict_schema(TypedDict):\n class Data(BaseModel):\n a: int\n\n class DataTD(TypedDict):\n a: int\n\n class CustomTD(TypedDict):\n b: int\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source_type: Any, handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n schema = handler(source_type)\n schema = handler.resolve_ref_schema(schema)\n assert schema['type'] == 'typed-dict'\n b = schema['fields']['b']['schema']\n assert b['type'] == 'int'\n b['gt'] = 0 # type: ignore\n return 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_types_typeddict.py_test_typeddict_schema.Model_test_typeddict_schema.None_1": {"__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.Model_test_typeddict_schema.None_1", "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": 225, "end_line": 292, "span_ids": ["test_typeddict_schema"], "tokens": 577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_typeddict_schema(TypedDict):\n # ... other code\n\n class Model(BaseModel):\n data: Data\n data_td: DataTD\n custom_td: CustomTD\n\n # insert_assert(Model.model_json_schema(mode='validation'))\n assert Model.model_json_schema(mode='validation') == {\n 'type': 'object',\n 'properties': {\n 'data': {'$ref': '#/$defs/Data'},\n 'data_td': {'$ref': '#/$defs/DataTD'},\n 'custom_td': {'$ref': '#/$defs/CustomTD'},\n },\n 'required': ['data', 'data_td', 'custom_td'],\n 'title': 'Model',\n '$defs': {\n 'DataTD': {\n 'type': 'object',\n 'properties': {'a': {'type': 'integer', 'title': 'A'}},\n 'required': ['a'],\n 'title': 'DataTD',\n },\n 'CustomTD': {\n 'type': 'object',\n 'properties': {'b': {'type': 'integer', 'exclusiveMinimum': 0, 'title': 'B'}},\n 'required': ['b'],\n 'title': 'CustomTD',\n },\n 'Data': {\n 'type': 'object',\n 'properties': {'a': {'type': 'integer', 'title': 'A'}},\n 'required': ['a'],\n 'title': 'Data',\n },\n },\n }\n\n # insert_assert(Model.model_json_schema(mode='serialization'))\n assert Model.model_json_schema(mode='serialization') == {\n 'type': 'object',\n 'properties': {\n 'data': {'$ref': '#/$defs/Data'},\n 'data_td': {'$ref': '#/$defs/DataTD'},\n 'custom_td': {'$ref': '#/$defs/CustomTD'},\n },\n 'required': ['data', 'data_td', 'custom_td'],\n 'title': 'Model',\n '$defs': {\n 'DataTD': {\n 'type': 'object',\n 'properties': {'a': {'type': 'integer', 'title': 'A'}},\n 'required': ['a'],\n 'title': 'DataTD',\n },\n 'CustomTD': {\n 'type': 'object',\n 'properties': {'b': {'type': 'integer', 'exclusiveMinimum': 0, 'title': 'B'}},\n 'required': ['b'],\n 'title': 'CustomTD',\n },\n 'Data': {\n 'type': 'object',\n 'properties': {'a': {'type': 'integer', 'title': 'A'}},\n 'required': ['a'],\n 'title': 'Data',\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/_decorators_v1.py_make_v1_generic_root_validator_make_v1_generic_root_validator._mode_after_for_pydant": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_make_v1_generic_root_validator_make_v1_generic_root_validator._mode_after_for_pydant", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators_v1.py", "file_name": "_decorators_v1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 159, "span_ids": ["make_v1_generic_root_validator"], "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 make_v1_generic_root_validator(\n validator: V1RootValidatorFunction, pre: bool\n) -> V2CoreBeforeRootValidator | V2CoreAfterRootValidator:\n \"\"\"Wrap a V1 style root validator for V2 compatibility.\n\n Args:\n validator: The V1 style field validator.\n pre: Whether the validator is a pre validator.\n\n Returns:\n A wrapped V2 style validator.\n \"\"\"\n if pre is True:\n # mode='before' for pydantic-core\n def _wrapper1(values: RootValidatorValues, _: core_schema.ValidationInfo) -> RootValidatorValues:\n return validator(values)\n\n return _wrapper1\n\n # mode='after' for pydantic-core\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/_decorators_v1.py_make_v1_generic_root_validator._wrapper2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators_v1.py_make_v1_generic_root_validator._wrapper2_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators_v1.py", "file_name": "_decorators_v1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 182, "span_ids": ["make_v1_generic_root_validator"], "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 make_v1_generic_root_validator(\n validator: V1RootValidatorFunction, pre: bool\n) -> V2CoreBeforeRootValidator | V2CoreAfterRootValidator:\n # ... other code\n def _wrapper2(fields_tuple: RootValidatorFieldsTuple, _: core_schema.ValidationInfo) -> RootValidatorFieldsTuple:\n if len(fields_tuple) == 2:\n # dataclass, this is easy\n values, init_vars = fields_tuple\n values = validator(values)\n return values, init_vars\n else:\n # ugly hack: to match v1 behaviour, we merge values and model_extra, then split them up based on fields\n # afterwards\n model_dict, model_extra, fields_set = fields_tuple\n if model_extra:\n fields = set(model_dict.keys())\n model_dict.update(model_extra)\n model_dict_new = validator(model_dict)\n for k in list(model_dict_new.keys()):\n if k not in fields:\n model_extra[k] = model_dict_new.pop(k)\n else:\n model_dict_new = validator(model_dict)\n return model_dict_new, model_extra, 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/_generics.py__get_caller_frame_info__get_caller_frame_info.return.frame_globals_get___name": {"__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__get_caller_frame_info.return.frame_globals_get___name", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 182, "span_ids": ["_get_caller_frame_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": "def _get_caller_frame_info(depth: int = 2) -> tuple[str | None, bool]:\n \"\"\"Used inside a function to check whether it was called globally.\n\n Args:\n depth: The depth to get the frame.\n\n Returns:\n A tuple contains `module_name` and `called_globally`.\n\n Raises:\n RuntimeError: If the function is not called inside a function.\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_DictValues_iter_contained_typevars.if_isinstance_v_TypeVar_.else_.for_arg_in_args_.yield_from_iter_contained": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_DictValues_iter_contained_typevars.if_isinstance_v_TypeVar_.else_.for_arg_in_args_.yield_from_iter_contained", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 208, "span_ids": ["iter_contained_typevars", "impl:23"], "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": "DictValues: type[Any] = {}.values().__class__\n\n\ndef iter_contained_typevars(v: Any) -> Iterator[TypeVarType]:\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_model_class(v):\n yield from v.__pydantic_generic_metadata__['parameters']\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.ignored_names.set_": {"__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.ignored_names.set_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 317, "span_ids": ["inspect_namespace"], "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 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 \"\"\"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 Args:\n namespace: The attribute dictionary of the class to be created.\n ignored_types: A tuple of ignore types.\n base_class_vars: A set of base class class variables.\n base_class_fields: A set of base class fields.\n\n Returns:\n A dict contains private attributes info.\n\n Raises:\n TypeError: If there is a `__root__` field in model.\n NameError: If private attribute name is invalid.\n PydanticUserError:\n - If a field does not have a type annotation.\n - If a field on base class was overridden by a non-annotated attribute.\n \"\"\"\n from ..fields import FieldInfo, ModelPrivateAttr, PrivateAttr\n\n all_ignored_types = ignored_types + default_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 raise TypeError(\"To define root models, use `pydantic.RootModel` rather than a field called '__root__'\")\n\n ignored_names: 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/functional_serializers.py_AnyType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_AnyType_", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 277, "span_ids": ["impl:14"], "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": "AnyType = TypeVar('AnyType')\n\n\nif TYPE_CHECKING:\n SerializeAsAny = Annotated[AnyType, ...] # SerializeAsAny[list[str]] will be treated by type checkers as list[str]\n \"\"\"Force serialization to ignore whatever is defined in the schema and instead ask the object\n itself how it should be serialized.\n In particular, this means that when model subclasses are serialized, fields present in the subclass\n but not in the original schema will be included.\n \"\"\"\nelse:\n\n @dataclasses.dataclass(**_internal_dataclass.slots_true)\n class SerializeAsAny: # noqa: D101\n def __class_getitem__(cls, item: Any) -> Any:\n return Annotated[item, SerializeAsAny()]\n\n def __get_pydantic_core_schema__(\n self, source_type: Any, handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n schema = handler(source_type)\n schema_to_update = schema\n while schema_to_update['type'] == 'definitions':\n schema_to_update = schema_to_update.copy()\n schema_to_update = schema_to_update['schema']\n schema_to_update['serialization'] = core_schema.wrap_serializer_function_ser_schema(\n lambda x, h: h(x), schema=core_schema.any_schema()\n )\n return schema\n\n __hash__ = object.__hash__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py__This_module_contains_r__inspect_validator._decorators_inspect_valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py__This_module_contains_r__inspect_validator._decorators_inspect_valid", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["docstring"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"This module contains related classes and functions for validation.\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport sys\nfrom functools import partialmethod\nfrom types import FunctionType\nfrom typing import TYPE_CHECKING, Any, Callable, TypeVar, Union, cast, overload\n\nfrom pydantic_core import core_schema\nfrom pydantic_core import core_schema as _core_schema\nfrom typing_extensions import Annotated, Literal, TypeAlias\n\nfrom . import GetCoreSchemaHandler as _GetCoreSchemaHandler\nfrom ._internal import _core_metadata, _decorators, _generics, _internal_dataclass\nfrom .annotated_handlers import GetCoreSchemaHandler\nfrom .errors import PydanticUserError\n\nif sys.version_info < (3, 11):\n from typing_extensions import Protocol\nelse:\n from typing import Protocol\n\n_inspect_validator = _decorators.inspect_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/pydantic/functional_validators.py__ModelType_ModelWrapValidatorHandler.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py__ModelType_ModelWrapValidatorHandler.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 375, "end_line": 388, "span_ids": ["ModelWrapValidatorHandler", "ModelWrapValidatorHandler.__call__", "impl:19"], "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": "_ModelType = TypeVar('_ModelType')\n_ModelTypeCo = TypeVar('_ModelTypeCo', covariant=True)\n\n\nclass ModelWrapValidatorHandler(_core_schema.ValidatorFunctionWrapHandler, Protocol[_ModelTypeCo]):\n \"\"\"@model_validator decorated function handler argument type. This is used when `mode='wrap'`.\"\"\"\n\n def __call__( # noqa: D102\n self,\n value: Any,\n outer_location: str | int | None = None,\n /,\n ) -> _ModelTypeCo: # pragma: no cover\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelWrapValidatorWithoutInfo_ModelWrapValidatorWithoutInfo.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelWrapValidatorWithoutInfo_ModelWrapValidatorWithoutInfo.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 391, "end_line": 406, "span_ids": ["ModelWrapValidatorWithoutInfo.__call__", "ModelWrapValidatorWithoutInfo"], "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 ModelWrapValidatorWithoutInfo(Protocol[_ModelType]):\n \"\"\"A @model_validator decorated function signature.\n This is used when `mode='wrap'` and the function does not have info argument.\n \"\"\"\n\n def __call__( # noqa: D102\n self,\n cls: type[_ModelType],\n # this can be a dict, a model instance\n # or anything else that gets passed to validate_python\n # thus validators _must_ handle all cases\n value: Any,\n handler: ModelWrapValidatorHandler[_ModelType],\n /,\n ) -> _ModelType:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelWrapValidator_ModelWrapValidator.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelWrapValidator_ModelWrapValidator.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 423, "span_ids": ["ModelWrapValidator", "ModelWrapValidator.__call__"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModelWrapValidator(Protocol[_ModelType]):\n \"\"\"A @model_validator decorated function signature. This is used when `mode='wrap'`.\"\"\"\n\n def __call__( # noqa: D102\n self,\n cls: type[_ModelType],\n # this can be a dict, a model instance\n # or anything else that gets passed to validate_python\n # thus validators _must_ handle all cases\n value: Any,\n handler: ModelWrapValidatorHandler[_ModelType],\n info: _core_schema.ValidationInfo,\n /,\n ) -> _ModelType:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelBeforeValidatorWithoutInfo_ModelBeforeValidatorWithoutInfo.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelBeforeValidatorWithoutInfo_ModelBeforeValidatorWithoutInfo.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 442, "end_line": 456, "span_ids": ["ModelBeforeValidatorWithoutInfo.__call__", "ModelBeforeValidatorWithoutInfo"], "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": "class ModelBeforeValidatorWithoutInfo(Protocol):\n \"\"\"A @model_validator decorated function signature.\n This is used when `mode='before'` and the function does not have info argument.\n \"\"\"\n\n def __call__( # noqa: D102\n self,\n cls: Any,\n # this can be a dict, a model instance\n # or anything else that gets passed to validate_python\n # thus validators _must_ handle all cases\n value: Any,\n /,\n ) -> Any:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelBeforeValidator_ModelBeforeValidator.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelBeforeValidator_ModelBeforeValidator.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 487, "span_ids": ["ModelBeforeValidator", "ModelBeforeValidator.__call__"], "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": "class ModelBeforeValidator(Protocol):\n \"\"\"A `@model_validator` decorated function signature. This is used when `mode='before'`.\"\"\"\n\n def __call__( # noqa: D102\n self,\n cls: Any,\n # this can be a dict, a model instance\n # or anything else that gets passed to validate_python\n # thus validators _must_ handle all cases\n value: Any,\n info: _core_schema.ValidationInfo,\n /,\n ) -> Any:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelAfterValidatorWithoutInfo_model_validator_5._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_ModelAfterValidatorWithoutInfo_model_validator_5._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 520, "span_ids": ["model_validator_4", "model_validator_5", "model_validator", "impl:23"], "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": "ModelAfterValidatorWithoutInfo = Callable[[_ModelType], _ModelType]\n\"\"\"A `@model_validator` decorated function signature. This is used when `mode='after'` and the function does not\nhave info argument.\n\"\"\"\n\nModelAfterValidator = Callable[[_ModelType, _core_schema.ValidationInfo], _ModelType]\n\"\"\"A `@model_validator` decorated function signature. This is used when `mode='after'`.\"\"\"\n\n_AnyModelWrapValidator = Union[ModelWrapValidator[_ModelType], ModelWrapValidatorWithoutInfo[_ModelType]]\n_AnyModeBeforeValidator = Union[\n FreeModelBeforeValidator, ModelBeforeValidator, FreeModelBeforeValidatorWithoutInfo, ModelBeforeValidatorWithoutInfo\n]\n_AnyModelAfterValidator = Union[ModelAfterValidator[_ModelType], ModelAfterValidatorWithoutInfo[_ModelType]]\n\n\n@overload\ndef model_validator(\n *,\n mode: Literal['wrap'],\n) -> Callable[\n [_AnyModelWrapValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]\n]:\n ...\n\n\n@overload\ndef model_validator(\n *,\n mode: Literal['before'],\n) -> Callable[[_AnyModeBeforeValidator], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]]:\n ...\n\n\n@overload\ndef model_validator(\n *,\n mode: Literal['after'],\n) -> Callable[\n [_AnyModelAfterValidator[_ModelType]], _decorators.PydanticDescriptorProxy[_decorators.ModelValidatorDecoratorInfo]\n]:\n ...\n\n\nif TYPE_CHECKING:\n # If we add configurable attributes to IsInstance, we'd probably need to stop hiding it from type checkers like this\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/functional_validators.py_model_validator_6_model_validator_6.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_model_validator_6_model_validator_6.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 548, "end_line": 602, "span_ids": ["model_validator_6"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def model_validator(\n *,\n mode: Literal['wrap', 'before', 'after'],\n) -> Any:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validators/#model-validators\n\n Decorate model methods for validation purposes.\n\n Example usage:\n ```py\n from typing_extensions import Self\n\n from pydantic import BaseModel, ValidationError, model_validator\n\n class Square(BaseModel):\n width: float\n height: float\n\n @model_validator(mode='after')\n def verify_square(self) -> Self:\n if self.width != self.height:\n raise ValueError('width and height do not match')\n return self\n\n s = Square(width=1, height=1)\n print(repr(s))\n #> Square(width=1.0, height=1.0)\n\n try:\n Square(width=1, height=2)\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Square\n Value error, width and height do not match [type=value_error, input_value={'width': 1, 'height': 2}, input_type=dict]\n '''\n ```\n\n For more in depth examples, see [Model Validators](../concepts/validators.md#model-validators).\n\n Args:\n mode: A required string literal that specifies the validation mode.\n It can be one of the following: 'wrap', 'before', or 'after'.\n\n Returns:\n A decorator that can be used to decorate a function to be used as a model validator.\n \"\"\"\n\n def dec(f: Any) -> _decorators.PydanticDescriptorProxy[Any]:\n # auto apply the @classmethod decorator\n f = _decorators.ensure_classmethod_based_on_signature(f)\n dec_info = _decorators.ModelValidatorDecoratorInfo(mode=mode)\n return _decorators.PydanticDescriptorProxy(f, dec_info)\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/functional_validators.py_None_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_None_3_", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 552, "end_line": 584, "span_ids": ["impl:39"], "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": "if TYPE_CHECKING:\n SkipValidation = Annotated[AnyType, ...] # SkipValidation[list[str]] will be treated by type checkers as list[str]\nelse:\n\n @dataclasses.dataclass(**_internal_dataclass.slots_true)\n class SkipValidation:\n \"\"\"If this is applied as an annotation (e.g., via `x: Annotated[int, SkipValidation]`), validation will be\n skipped. You can also use `SkipValidation[int]` as a shorthand for `Annotated[int, SkipValidation]`.\n\n This can be useful if you want to use a type annotation for documentation/IDE/type-checking purposes,\n and know that it is safe to skip validation for one or more of the fields.\n\n Because this converts the validation schema to `any_schema`, subsequent annotation-applied transformations\n may not have the expected effects. Therefore, when used, this annotation should generally be the final\n annotation applied to a type.\n \"\"\"\n\n def __class_getitem__(cls, item: Any) -> Any:\n return Annotated[item, SkipValidation()]\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n original_schema = handler(source)\n metadata = _core_metadata.build_metadata_dict(js_annotation_functions=[lambda _c, h: h(original_schema)])\n return core_schema.any_schema(\n metadata=metadata,\n serialization=core_schema.wrap_serializer_function_ser_schema(\n function=lambda v, h: h(v), schema=original_schema\n ),\n )\n\n __hash__ = object.__hash__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__Logic_for_creating_mod__object_setattr._model_construction_objec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py__Logic_for_creating_mod__object_setattr._model_construction_objec", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 62, "span_ids": ["docstring"], "tokens": 514}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Logic for creating models.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport operator\nimport sys\nimport types\nimport typing\nimport warnings\nfrom copy import copy, deepcopy\nfrom typing import Any, ClassVar, Dict, Generator, Set, Tuple, TypeVar, Union\n\nimport pydantic_core\nimport typing_extensions\nfrom pydantic_core import PydanticUndefined\nfrom typing_extensions import TypeAlias\n\nfrom ._internal import (\n _config,\n _decorators,\n _fields,\n _forward_ref,\n _generics,\n _mock_val_ser,\n _model_construction,\n _repr,\n _typing_extra,\n _utils,\n)\nfrom ._migration import getattr_migration\nfrom .annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler\nfrom .config import ConfigDict\nfrom .errors import PydanticUndefinedAnnotation, PydanticUserError\nfrom .json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema, JsonSchemaMode, JsonSchemaValue, model_json_schema\nfrom .warnings import PydanticDeprecatedSince20\n\n# Always define certain types that are needed to resolve method type hints/annotations\n# (even when not type checking) via typing.get_type_hints.\nModel = TypeVar('Model', bound='BaseModel')\nTupleGenerator = Generator[Tuple[str, Any], None, None]\n# should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope\nIncEx: TypeAlias = Union[Set[int], Set[str], Dict[int, Any], Dict[str, Any], None]\n\n\nif typing.TYPE_CHECKING:\n from inspect import Signature\n from pathlib import Path\n\n from pydantic_core import CoreSchema, SchemaSerializer, SchemaValidator\n from typing_extensions import Unpack\n\n from ._internal._utils import AbstractSetIntStr, MappingIntStrAny\n from .deprecated.parse import Protocol as DeprecatedParseProtocol\n from .fields import ComputedFieldInfo, FieldInfo, ModelPrivateAttr\n from .fields import Field as _Field\nelse:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n\n__all__ = 'BaseModel', 'create_model'\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/main.py_BaseModel.model_parametrized_name_BaseModel.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_parametrized_name_BaseModel.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": 390, "end_line": 421, "span_ids": ["BaseModel.model_parametrized_name", "BaseModel.model_post_init"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def model_parametrized_name(cls, params: tuple[type[Any], ...]) -> str:\n \"\"\"Compute the class name for parametrizations of generic classes.\n\n This method can be overridden to achieve a custom naming scheme for generic BaseModels.\n\n Args:\n 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\n Returns:\n String representing the new class where `params` are passed to `cls` as type variables.\n\n Raises:\n TypeError: Raised when trying to generate concrete names for non-generic models.\n \"\"\"\n if not issubclass(cls, typing.Generic):\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}]'\n\n def model_post_init(self, __context: Any) -> None:\n \"\"\"Override this method to perform additional initialization after `__init__` and `model_construct`.\n This is useful if you want to do some validation that requires the entire model to be initialized.\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/main.py_BaseModel.model_validate_json_BaseModel.model_validate_json.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.model_validate_json_BaseModel.model_validate_json.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": 513, "end_line": 538, "span_ids": ["BaseModel.model_validate_json"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.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 \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/json/#json-parsing\n\n Validate the given JSON data against the Pydantic model.\n\n Args:\n json_data: The JSON data to validate.\n strict: Whether to enforce types strictly.\n context: Extra variables to pass to the validator.\n\n Returns:\n The validated Pydantic model.\n\n Raises:\n ValueError: If `json_data` is not a JSON string.\n \"\"\"\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._take_logic_from__repr__BaseModel.__fields_set__.return.self___pydantic_fields_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._take_logic_from__repr__BaseModel.__fields_set__.return.self___pydantic_fields_se", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 993, "end_line": 1023, "span_ids": ["BaseModel.__fields_set__", "BaseModel.__repr_args__", "BaseModel.__str__", "BaseModel.__fields__", "BaseModel:52"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n # take logic from `_repr.Representation` without the side effects of inheritance, see #5740\n __repr_name__ = _repr.Representation.__repr_name__\n __repr_str__ = _repr.Representation.__repr_str__\n __pretty__ = _repr.Representation.__pretty__\n __rich_repr__ = _repr.Representation.__rich_repr__\n\n def __str__(self) -> str:\n return self.__repr_str__(' ')\n\n # ##### Deprecated methods from v1 #####\n @property\n @typing_extensions.deprecated(\n 'The `__fields__` attribute is deprecated, use `model_fields` instead.', category=None\n )\n def __fields__(self) -> dict[str, FieldInfo]:\n warnings.warn(\n 'The `__fields__` attribute is deprecated, use `model_fields` instead.', category=PydanticDeprecatedSince20\n )\n return self.model_fields\n\n @property\n @typing_extensions.deprecated(\n 'The `__fields_set__` attribute is deprecated, use `model_fields_set` instead.',\n category=None,\n )\n def __fields_set__(self) -> set[str]:\n warnings.warn(\n 'The `__fields_set__` attribute is deprecated, use `model_fields_set` instead.',\n category=PydanticDeprecatedSince20,\n )\n return self.__pydantic_fields_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/pydantic/mypy.py_PydanticModelTransformer_PydanticModelTransformer.__init__.self.plugin_config.plugin_config": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer_PydanticModelTransformer.__init__.self.plugin_config.plugin_config", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 396, "end_line": 422, "span_ids": ["PydanticModelTransformer.__init__", "PydanticModelTransformer"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n \"\"\"Transform the BaseModel subclass according to the plugin settings.\n\n Attributes:\n tracked_config_fields: A set of field configs that the plugin has to track their value.\n \"\"\"\n\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__(\n self,\n cls: ClassDef,\n reason: Expression | Statement,\n api: SemanticAnalyzerPluginInterface,\n plugin_config: PydanticPluginConfig,\n ) -> None:\n self._cls = cls\n self._reason = reason\n self._api = api\n\n self.plugin_config = plugin_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_error_unexpected_behavior_error_unexpected_behavior.api_fail_full_message_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_error_unexpected_behavior_error_unexpected_behavior.api_fail_full_message_co", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 867, "end_line": 875, "span_ids": ["error_unexpected_behavior"], "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 error_unexpected_behavior(\n detail: str, api: CheckerPluginInterface | SemanticAnalyzerPluginInterface, context: Context\n) -> None: # pragma: no cover\n \"\"\"Emits unexpected behavior error.\"\"\"\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_untyped_fields_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_untyped_fields_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": 1095, "end_line": 1107, "span_ids": ["error_default_and_default_factory_specified", "error_extra_fields_on_root_model", "error_untyped_fields"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None:\n \"\"\"Emits an error when there is an untyped field in the model.\"\"\"\n api.fail('Untyped fields disallowed', context, code=ERROR_UNTYPED)\n\n\ndef error_extra_fields_on_root_model(api: CheckerPluginInterface, context: Context) -> None:\n \"\"\"Emits an error when there is more than just a root field defined for a subclass of RootModel.\"\"\"\n api.fail('Only `root` is allowed as a field of a `RootModel`', context, code=ERROR_EXTRA_FIELD_ROOT_MODEL)\n\n\ndef error_default_and_default_factory_specified(api: CheckerPluginInterface, context: Context) -> None:\n \"\"\"Emits an error when `Field` has both `default` and `default_factory` together.\"\"\"\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/networks.py_IPvAnyNetwork.__get_pydantic_json_schema___IPvAnyNetwork._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_IPvAnyNetwork.__get_pydantic_json_schema___IPvAnyNetwork._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": 652, "end_line": 672, "span_ids": ["IPvAnyNetwork.__get_pydantic_json_schema__", "IPvAnyNetwork._validate", "IPvAnyNetwork.__get_pydantic_core_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 IPvAnyNetwork:\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: _schema_generation_shared.GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = {}\n field_schema.update(type='string', format='ipvanynetwork')\n return field_schema\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n _source: type[Any],\n _handler: GetCoreSchemaHandler,\n ) -> core_schema.CoreSchema:\n return core_schema.no_info_plain_validator_function(\n cls._validate, serialization=core_schema.to_string_ser_schema()\n )\n\n @classmethod\n def _validate(cls, input_value: NetworkType, /) -> IPv4Network | IPv6Network:\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/types.py_Strict_StrictBool.Annotated_bool_Strict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Strict_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": 117, "end_line": 144, "span_ids": ["impl:5", "Strict", "Strict.__hash__"], "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": "@_dataclasses.dataclass\nclass Strict(_fields.PydanticMetadata, BaseMetadata):\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/strict_mode/#strict-mode-with-annotated-strict\n\n A field metadata class to indicate that a field should be validated in strict mode.\n\n Attributes:\n strict: Whether to validate the field in strict mode.\n\n Example:\n ```python\n from typing_extensions import Annotated\n\n from pydantic.types import Strict\n\n StrictBool = Annotated[bool, Strict()]\n ```\n \"\"\"\n\n strict: bool = True\n\n def __hash__(self) -> int:\n return hash(self.strict)\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/tests/mypy/modules/plugin_fail_baseConfig.py_from_typing_import_Any_G_DynamicAliasModel2_x_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_DynamicAliasModel2_x_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": 174, "span_ids": ["DefaultTestingModel", "KwargsModel", "impl", "KwargsBadConfig2", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "Model.Config", "Model", "impl:8", "KwargsInheritingModel", "KwargsBadExtraModel", "InheritingModel", "impl:27", "KwargsModel.method", "BadConfig2.Config", "impl:17", "AliasModel", "impl:35", "Response", "impl:31", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "impl:16", "BadConfig2", "KwargsBadConfig1", "DynamicAliasModel2", "impl:34", "BadConfig1", "Blah", "BadExtraModel.Config", "BadConfig1.Config", "impl:25", "InheritingModel.Config", "DynamicAliasModel", "ForbidExtraModel", "impl:18", "impl:15", "Model.Config.config_method"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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({})\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({})\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')\n\n\nclass 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_KwargsDynamicAliasModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_", "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": 178, "end_line": 309, "span_ids": ["AliasGeneratorModel.Config", "impl:49", "KwargsAliasGeneratorModel", "impl:44", "AliasGeneratorModel2.Config", "AddProject", "impl:39", "AliasGeneratorModel2", "CoverageTester", "_default_factory", "ModelWithAnnotatedValidator", "FrozenModel", "impl:47", "InheritingModel2", "UntypedFieldModel", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "ModelWithAnnotatedValidator.instance_method", "impl:52", "impl:42", "FrozenModel.Config", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:37", "InheritingModel2.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 716}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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/test_create_model.py_test_private_descriptors.A_test_private_descriptors.None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_descriptors.A_test_private_descriptors.None_13", "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": 301, "end_line": 337, "span_ids": ["test_private_descriptors"], "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": "@pytest.mark.parametrize('base', [ModelPrivateAttr, object])\n@pytest.mark.parametrize('use_annotation', [True, False])\ndef test_private_descriptors(base, use_annotation):\n # ... other code\n\n class A(BaseModel):\n x: int\n\n if use_annotation:\n _some_func: MyDescriptor = MyDescriptor(lambda self: self.x)\n else:\n _some_func = MyDescriptor(lambda self: self.x)\n\n @property\n def _double_x(self):\n return self.x * 2\n\n assert set(A.__private_attributes__) == {'_some_func'}\n assert set_name_calls == [(A, '_some_func')]\n\n a = A(x=2)\n\n assert a._double_x == 4 # Ensure properties with leading underscores work fine and don't become private attributes\n\n assert get_calls == []\n assert a._some_func == 2\n assert get_calls == [(a, A)]\n\n assert set_calls == []\n a._some_func = 3\n assert set_calls == [(a, 3)]\n\n assert a._some_func == 3\n assert get_calls == [(a, A), (a, A)]\n\n assert delete_calls == []\n del a._some_func\n assert delete_calls == [a]\n\n with pytest.raises(AttributeError, match=r\"'_some_func' is not defined on A\\(x=2\\)\"):\n a._some_func\n assert get_calls == [(a, A), (a, 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_create_model.py_test_private_attr_set_name_do_not_crash_if_not_callable_test_del_model_attr_with_privat_attrs.assert_not_hasattr_m_so": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_private_attr_set_name_do_not_crash_if_not_callable_test_del_model_attr_with_privat_attrs.assert_not_hasattr_m_so", "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": 378, "end_line": 429, "span_ids": ["test_del_model_attr_error", "test_private_attr_set_name_do_not_crash_if_not_callable", "test_del_model_attr", "test_del_model_attr_with_privat_attrs"], "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_private_attr_set_name_do_not_crash_if_not_callable():\n class SetNameInt(int):\n __set_name__ = None\n\n _private_attr_default = SetNameInt(2)\n\n class Model(BaseModel):\n _private_attr: int = PrivateAttr(default=_private_attr_default)\n\n # Checks below are just to ensure that everything is the same as in `test_private_attr_set_name`\n # The main check is that model class definition above doesn't crash\n assert Model()._private_attr == 2\n\n\ndef test_del_model_attr():\n class Model(BaseModel):\n some_field: str\n\n m = Model(some_field='value')\n assert hasattr(m, 'some_field')\n\n del m.some_field\n\n assert not hasattr(m, 'some_field')\n\n\n@pytest.mark.skipif(\n platform.python_implementation() == 'PyPy',\n reason='In this single case `del` behaves weird on pypy',\n)\ndef test_del_model_attr_error():\n class Model(BaseModel):\n some_field: str\n\n m = Model(some_field='value')\n assert not hasattr(m, 'other_field')\n\n with pytest.raises(AttributeError, match='other_field'):\n del m.other_field\n\n\ndef test_del_model_attr_with_privat_attrs():\n class Model(BaseModel):\n _private_attr: int = PrivateAttr(default=1)\n some_field: str\n\n m = Model(some_field='value')\n assert hasattr(m, 'some_field')\n\n del m.some_field\n\n assert not hasattr(m, 'some_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_create_model.py_test_del_model_attr_with_privat_attrs_error_test_del_model_attr_with_privat_attrs_error.with_pytest_raises_Attrib.del_m_other_field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_del_model_attr_with_privat_attrs_error_test_del_model_attr_with_privat_attrs_error.with_pytest_raises_Attrib.del_m_other_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": 432, "end_line": 445, "span_ids": ["test_del_model_attr_with_privat_attrs_error"], "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.skipif(\n platform.python_implementation() == 'PyPy',\n reason='In this single case `del` behaves weird on pypy',\n)\ndef test_del_model_attr_with_privat_attrs_error():\n class Model(BaseModel):\n _private_attr: int = PrivateAttr(default=1)\n some_field: str\n\n m = Model(some_field='value')\n assert not hasattr(m, 'other_field')\n\n with pytest.raises(AttributeError, match=\"'Model' object has no attribute 'other_field'\"):\n del m.other_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_docs.py_from___future___import_an_SOURCES_ROOT.Path___file___parent_par": {"__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_SOURCES_ROOT.Path___file___parent_par", "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": 21, "span_ids": ["imports"], "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": "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\nfrom typing import Any\n\nimport pytest\nfrom pydantic_core import core_schema\nfrom pytest_examples import CodeExample, EvalExample, find_examples\n\nfrom pydantic.errors import PydanticErrorCodes\n\nINDEX_MAIN = None\nDOCS_ROOT = Path(__file__).parent.parent / 'docs'\nSOURCES_ROOT = Path(__file__).parent.parent / 'pydantic'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_skip_docs_tests_skip_docs_tests.None_2.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_skip_docs_tests_skip_docs_tests.None_2.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": 24, "end_line": 44, "span_ids": ["skip_docs_tests"], "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 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 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_run_example_run_example.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_run_example_run_example.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": 81, "end_line": 142, "span_ids": ["run_example"], "tokens": 614}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_example(example: CodeExample, eval_example: EvalExample, mocker: Any) -> None: # noqa C901\n eval_example.print_callback = print_callback\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.startswith('skip') and lint_settings.startswith('skip'):\n pytest.skip('both running code 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 eval_example.set_config(ruff_ignore=['D', 'T', 'E721', 'Q001'], line_length=LINE_LENGTH)\n if '# ignore-above' in example.source:\n eval_example.set_config(ruff_ignore=eval_example.config.ruff_ignore + ['E402'], line_length=LINE_LENGTH)\n if group_name:\n eval_example.set_config(ruff_ignore=eval_example.config.ruff_ignore + ['F821'], line_length=LINE_LENGTH)\n\n if not lint_settings.startswith('skip'):\n if eval_example.update_examples:\n eval_example.format(example)\n else:\n if example.in_py_file():\n # Ignore isort as double newlines will cause it to fail, but we remove them in py files\n eval_example.set_config(ruff_ignore=eval_example.config.ruff_ignore + ['I001'], line_length=LINE_LENGTH)\n eval_example.lint(example)\n\n if test_settings.startswith('skip'):\n pytest.skip(test_settings[4:].lstrip(' -') or 'running code skipped')\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.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_examples_test_docs_examples.run_example_example_eval": {"__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.run_example_example_eval", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 156, "end_line": 171, "span_ids": ["test_docs_examples"], "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.filterwarnings('ignore:(parse_obj_as|schema_json_of|schema_of) is deprecated.*:DeprecationWarning')\n@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):\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 run_example(example, eval_example, mocker)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_test_docs_devtools_example.None_2.else_.assert_output_html_out": {"__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_test_docs_devtools_example.None_2.else_.assert_output_html_out", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 186, "end_line": 223, "span_ids": ["test_docs_devtools_example"], "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": "@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 eval_example.set_config(ruff_ignore=['D', 'T'], line_length=LINE_LENGTH)\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_docs.py_test_error_codes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_error_codes_", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 268, "span_ids": ["test_validation_error_codes", "test_error_codes"], "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": "def test_error_codes():\n error_text = (DOCS_ROOT / 'errors/usage_errors.md').read_text()\n\n code_error_codes = PydanticErrorCodes.__args__\n\n documented_error_codes = tuple(re.findall(r'^## .+ \\{#(.+?)}$', error_text, flags=re.MULTILINE))\n\n assert code_error_codes == documented_error_codes, 'Error codes in code and docs do not match'\n\n\ndef test_validation_error_codes():\n error_text = (DOCS_ROOT / 'errors/validation_errors.md').read_text()\n\n expected_validation_error_codes = set(core_schema.ErrorType.__args__)\n # Remove codes that are not currently accessible from pydantic:\n expected_validation_error_codes.remove('timezone_offset') # not currently exposed for configuration in pydantic\n\n test_failures = []\n\n documented_validation_error_codes = []\n error_code_section = None\n printed_error_code = None\n for line in error_text.splitlines():\n section_match = re.fullmatch(r'## `(.+)`', line)\n if section_match:\n if error_code_section is not None and printed_error_code != error_code_section:\n test_failures.append(f'Error code {error_code_section!r} is not printed in its example')\n error_code_section = section_match.group(1)\n if error_code_section not in expected_validation_error_codes:\n test_failures.append(f'Documented error code {error_code_section!r} is not a member of ErrorType')\n documented_validation_error_codes.append(error_code_section)\n printed_error_code = None\n continue\n\n printed_match = re.search(\"#> '(.+)'\", line)\n if printed_match:\n printed_error_code = printed_match.group(1)\n\n assert test_failures == []\n\n code_validation_error_codes = sorted(expected_validation_error_codes)\n assert code_validation_error_codes == documented_validation_error_codes, 'Error codes in code and docs do not match'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref_test_undefined_types_warning_raised_by_usage.with_pytest_raises_user_e.module.Foobar_a_1_": {"__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_raised_by_usage.with_pytest_raises_user_e.module.Foobar_a_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": 927, "end_line": 959, "span_ids": ["test_undefined_types_warning_1b_suppressed_via_config_2b_forward_ref", "test_undefined_types_warning_raised_by_usage"], "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_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 # Because we don't instantiate the type, no error for an undefined type is raised\n class Foobar(BaseModel):\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_complete__` is a good indicator of this.\n assert module.Foobar.__pydantic_complete__ is False\n\n\ndef test_undefined_types_warning_raised_by_usage(create_module):\n with pytest_raises_user_error_for_undefined_type('Foobar', '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\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_json.py_test_json_serialization_test_json_serialization.assert_ta_dump_json_gen_v": {"__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_ta_dump_json_gen_v", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 91, "span_ids": ["test_json_serialization"], "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": "@pytest.mark.parametrize(\n 'ser_type,gen_value,json_output',\n [\n (UUID, lambda: UUID('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 ta: TypeAdapter[Any] = TypeAdapter(ser_type)\n assert ta.dump_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_schema.py_test_literal_types_test_literal_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_literal_types_test_literal_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": 2294, "end_line": 2342, "span_ids": ["test_literal_types"], "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": "@pytest.mark.skipif(sys.version_info[:2] == (3, 8), reason=\"ListEnum doesn't work in 3.8\")\ndef test_literal_types() -> None:\n \"\"\"Test that we properly add `type` to json schema enums when there is a single type.\"\"\"\n\n # for float and array we use an Enum because Literal can only accept str, int, bool or None\n class FloatEnum(float, Enum):\n a = 123.0\n b = 123.1\n\n class ListEnum(List[int], Enum):\n a = [123]\n b = [456]\n\n class Model(BaseModel):\n str_literal: Literal['foo', 'bar']\n int_literal: Literal[123, 456]\n float_literal: FloatEnum\n bool_literal: Literal[True, False]\n none_literal: Literal[None] # ends up as a const since there's only 1\n list_literal: ListEnum\n mixed_literal: Literal[123, 'abc']\n\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'FloatEnum': {'enum': [123.0, 123.1], 'title': 'FloatEnum', 'type': 'numeric'},\n 'ListEnum': {'enum': [[123], [456]], 'title': 'ListEnum', 'type': 'array'},\n },\n 'properties': {\n 'str_literal': {'enum': ['foo', 'bar'], 'title': 'Str Literal', 'type': 'string'},\n 'int_literal': {'enum': [123, 456], 'title': 'Int Literal', 'type': 'integer'},\n 'float_literal': {'$ref': '#/$defs/FloatEnum'},\n 'bool_literal': {'enum': [True, False], 'title': 'Bool Literal', 'type': 'boolean'},\n 'none_literal': {'const': None, 'enum': [None], 'title': 'None Literal'},\n 'list_literal': {'$ref': '#/$defs/ListEnum'},\n 'mixed_literal': {'enum': [123, 'abc'], 'title': 'Mixed Literal'},\n },\n 'required': [\n 'str_literal',\n 'int_literal',\n 'float_literal',\n 'bool_literal',\n 'none_literal',\n 'list_literal',\n 'mixed_literal',\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_color_type_test_typeddict_with_extra_allow.assert_TypeAdapter_Model_": {"__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_typeddict_with_extra_allow.assert_TypeAdapter_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": 2133, "end_line": 2241, "span_ids": ["test_model_with_extra_allow", "test_model_with_extra_ignore", "test_dataclass_with_extra_forbid", "test_dataclass_with_extra_ignore", "test_color_type", "test_typeddict_with_extra_allow", "test_model_with_extra_forbidden", "test_dataclass_with_extra_allow"], "tokens": 731}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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='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 }\n\n\ndef test_model_with_extra_allow():\n class Model(BaseModel):\n model_config = ConfigDict(extra='allow')\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': True,\n }\n\n\ndef test_model_with_extra_ignore():\n class Model(BaseModel):\n model_config = ConfigDict(extra='ignore')\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 }\n\n\ndef test_dataclass_with_extra_allow():\n @pydantic.dataclasses.dataclass\n class Model:\n __pydantic_config__ = ConfigDict(extra='allow')\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'additionalProperties': True,\n }\n\n\ndef test_dataclass_with_extra_ignore():\n @pydantic.dataclasses.dataclass\n class Model:\n __pydantic_config__ = ConfigDict(extra='ignore')\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n }\n\n\ndef test_dataclass_with_extra_forbid():\n @pydantic.dataclasses.dataclass\n class Model:\n __pydantic_config__ = ConfigDict(extra='ignore')\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n }\n\n\ndef test_typeddict_with_extra_allow():\n class Model(TypedDict):\n __pydantic_config__ = ConfigDict(extra='allow') # type: ignore\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'additionalProperties': 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_json_schema.py_test_root_model_test_root_model.assert_C_model_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_root_model_test_root_model.assert_C_model_json_schem", "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": 4436, "end_line": 4459, "span_ids": ["test_root_model"], "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_root_model():\n class A(RootModel[int]):\n \"\"\"A Model docstring\"\"\"\n\n assert A.model_json_schema() == {'title': 'A', 'description': 'A Model docstring', 'type': 'integer'}\n\n class B(RootModel[A]):\n pass\n\n assert B.model_json_schema() == {\n '$defs': {'A': {'description': 'A Model docstring', 'title': 'A', 'type': 'integer'}},\n 'allOf': [{'$ref': '#/$defs/A'}],\n 'title': 'B',\n }\n\n class C(RootModel[A]):\n \"\"\"C Model docstring\"\"\"\n\n assert C.model_json_schema() == {\n '$defs': {'A': {'description': 'A Model docstring', 'title': 'A', 'type': 'integer'}},\n 'allOf': [{'$ref': '#/$defs/A'}],\n 'title': 'C',\n 'description': 'C Model docstring',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extras_on_ref_test_json_schema_extras_on_ref.assert_ta_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_json_schema_extras_on_ref_test_json_schema_extras_on_ref.assert_ta_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": 4660, "end_line": 4706, "span_ids": ["test_json_schema_extras_on_ref"], "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": "def test_json_schema_extras_on_ref() -> None:\n @dataclass\n class JsonSchemaExamples:\n examples: Dict[str, Any]\n\n def __get_pydantic_json_schema__(\n self, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = handler(core_schema)\n assert json_schema.keys() == {'$ref'}\n json_schema['examples'] = to_json(self.examples)\n return json_schema\n\n @dataclass\n class JsonSchemaTitle:\n title: str\n\n def __get_pydantic_json_schema__(\n self, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = handler(core_schema)\n assert json_schema.keys() == {'allOf', 'examples'}\n json_schema['title'] = self.title\n return json_schema\n\n class Model(BaseModel):\n name: str\n age: int\n\n ta = TypeAdapter(\n Annotated[Model, JsonSchemaExamples({'foo': Model(name='John', age=28)}), JsonSchemaTitle('ModelTitle')]\n )\n\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {\n '$defs': {\n 'Model': {\n 'properties': {'age': {'title': 'Age', 'type': 'integer'}, 'name': {'title': 'Name', 'type': 'string'}},\n 'required': ['name', 'age'],\n 'title': 'Model',\n 'type': 'object',\n }\n },\n 'allOf': [{'$ref': '#/$defs/Model'}],\n 'examples': b'{\"foo\":{\"name\":\"John\",\"age\":28}}',\n 'title': 'ModelTitle',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_inclusion_of_defaults_test_resolve_def_schema_from_core_schema.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_inclusion_of_defaults_test_resolve_def_schema_from_core_schema.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": 4709, "end_line": 4752, "span_ids": ["test_inclusion_of_defaults", "test_resolve_def_schema_from_core_schema"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_inclusion_of_defaults():\n class Model(BaseModel):\n x: int = 1\n y: int = Field(default_factory=lambda: 2)\n\n assert Model.model_json_schema() == {\n 'properties': {'x': {'default': 1, 'title': 'X', 'type': 'integer'}, 'y': {'title': 'Y', 'type': 'integer'}},\n 'title': 'Model',\n 'type': 'object',\n }\n\n\ndef test_resolve_def_schema_from_core_schema() -> None:\n class Inner(BaseModel):\n x: int\n\n class Marker:\n def __get_pydantic_json_schema__(\n self, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\n field_schema['title'] = 'Foo'\n original_schema = handler.resolve_ref_schema(field_schema)\n original_schema['title'] = 'Bar'\n return field_schema\n\n class Outer(BaseModel):\n inner: Annotated[Inner, Marker()]\n\n # insert_assert(Outer.model_json_schema())\n assert Outer.model_json_schema() == {\n '$defs': {\n 'Inner': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Bar',\n 'type': 'object',\n }\n },\n 'properties': {'inner': {'allOf': [{'$ref': '#/$defs/Inner'}], 'title': 'Foo'}},\n 'required': ['inner'],\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_examples_annotation_test_examples_annotation.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_examples_annotation_test_examples_annotation.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": 4755, "end_line": 4789, "span_ids": ["test_examples_annotation"], "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_examples_annotation() -> None:\n ListWithExamples = Annotated[\n List[float],\n Examples({'Fibonacci': [1, 1, 2, 3, 5]}),\n ]\n\n ta = TypeAdapter(ListWithExamples)\n\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {\n 'examples': {'Fibonacci': [1, 1, 2, 3, 5]},\n 'items': {'type': 'number'},\n 'type': 'array',\n }\n\n ListWithMoreExamples = Annotated[\n ListWithExamples,\n Examples(\n {\n 'Constants': [\n 3.14,\n 2.71,\n ]\n }\n ),\n ]\n\n ta = TypeAdapter(ListWithMoreExamples)\n\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {\n 'examples': {'Constants': [3.14, 2.71], 'Fibonacci': [1, 1, 2, 3, 5]},\n 'items': {'type': 'number'},\n 'type': 'array',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_typeddict_field_required_missing_test_typeddict_field_required_missing.CustomType.__get_pydantic_core_schema__.return.core_schema_no_info_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_field_required_missing_test_typeddict_field_required_missing.CustomType.__get_pydantic_core_schema__.return.core_schema_no_info_after", "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": 4792, "end_line": 4808, "span_ids": ["test_typeddict_field_required_missing"], "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_typeddict_field_required_missing() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6192\"\"\"\n\n class CustomType:\n def __init__(self, data: Dict[str, int]) -> None:\n self.data = data\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n data_schema = core_schema.typed_dict_schema(\n {\n 'subunits': core_schema.typed_dict_field(\n core_schema.int_schema(),\n ),\n }\n )\n return core_schema.no_info_after_validator_function(cls, data_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_typeddict_field_required_missing.Model_test_typeddict_field_required_missing.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_field_required_missing.Model_test_typeddict_field_required_missing.assert_exc_info_value_err", "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": 4810, "end_line": 4828, "span_ids": ["test_typeddict_field_required_missing"], "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_typeddict_field_required_missing() -> None:\n # ... other code\n\n class Model(BaseModel):\n t: CustomType\n\n m = Model(t={'subunits': 123})\n assert type(m.t) is CustomType\n assert m.t.data == {'subunits': 123}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(t={'subunits': 'abc'})\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': ('t', 'subunits'),\n 'msg': 'Input should be a valid integer, unable to parse string as an integer',\n 'input': '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_main.py_test_get_core_schema_return_new_ref_test_get_core_schema_return_new_ref.assert_OuterModel_inner_I": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_get_core_schema_return_new_ref_test_get_core_schema_return_new_ref.assert_OuterModel_inner_I", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2417, "end_line": 2446, "span_ids": ["test_get_core_schema_return_new_ref"], "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_get_core_schema_return_new_ref() -> None:\n class InnerModel(BaseModel):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n schema = deepcopy(schema)\n schema['metadata'] = schema.get('metadata', {})\n schema['metadata']['foo'] = 'inner was here!'\n return deepcopy(schema)\n\n class OuterModel(BaseModel):\n inner: InnerModel\n x: int = 1\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n\n def set_x(m: 'OuterModel') -> 'OuterModel':\n m.x += 1\n return m\n\n return core_schema.no_info_after_validator_function(set_x, schema, ref=schema.pop('ref'))\n\n cs = OuterModel.__pydantic_core_schema__\n # super hacky check but it works in all cases and avoids a complex and fragile iteration over CoreSchema\n # the point here is to verify that `__get_pydantic_core_schema__`\n assert 'inner was here' in str(cs)\n\n assert OuterModel(inner=InnerModel()).x == 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_resolve_def_schema_from_core_schema_test_resolve_def_schema_from_core_schema.assert_Outer_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_resolve_def_schema_from_core_schema_test_resolve_def_schema_from_core_schema.assert_Outer_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2449, "end_line": 2469, "span_ids": ["test_resolve_def_schema_from_core_schema"], "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_resolve_def_schema_from_core_schema() -> None:\n class Inner(BaseModel):\n x: int\n\n class Marker:\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n resolved = handler.resolve_ref_schema(schema)\n assert resolved['type'] == 'model'\n assert resolved['cls'] is Inner\n\n def modify_inner(v: Inner) -> Inner:\n v.x += 1\n return v\n\n return core_schema.no_info_after_validator_function(modify_inner, schema)\n\n class Outer(BaseModel):\n inner: Annotated[Inner, Marker()]\n\n assert Outer.model_validate({'inner': {'x': 1}}).inner.x == 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_extra_validator_scalar_test_extra_validator_scalar.assert_Child_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_validator_scalar_test_extra_validator_scalar.assert_Child_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2472, "end_line": 2488, "span_ids": ["test_extra_validator_scalar"], "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_extra_validator_scalar() -> None:\n class Model(BaseModel):\n model_config = ConfigDict(extra='allow')\n\n class Child(Model):\n __pydantic_extra__: Dict[str, int]\n\n m = Child(a='1')\n assert m.__pydantic_extra__ == {'a': 1}\n\n # insert_assert(Child.model_json_schema())\n assert Child.model_json_schema() == {\n 'additionalProperties': {'type': 'integer'},\n 'properties': {},\n 'title': 'Child',\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_test_extra_validator_named_test_extra_validator_named.assert_Child_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_extra_validator_named_test_extra_validator_named.assert_Child_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2839, "end_line": 2868, "span_ids": ["test_extra_validator_named"], "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_extra_validator_named() -> None:\n class Foo(BaseModel):\n x: int\n\n class Model(BaseModel):\n model_config = ConfigDict(extra='allow')\n __pydantic_extra__: 'dict[str, Foo]'\n\n class Child(Model):\n y: int\n\n m = Child(a={'x': '1'}, y=2)\n assert m.__pydantic_extra__ == {'a': Foo(x=1)}\n\n # insert_assert(Child.model_json_schema())\n assert Child.model_json_schema() == {\n '$defs': {\n 'Foo': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Foo',\n 'type': 'object',\n }\n },\n 'additionalProperties': {'$ref': '#/$defs/Foo'},\n 'properties': {'y': {'title': 'Y', 'type': 'integer'}},\n 'required': ['y'],\n 'title': 'Child',\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_root_model.py_test_validate_assignment_false_test_root_model_as_attr_with_validate_default.assert_m_rooted_value___p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_validate_assignment_false_test_root_model_as_attr_with_validate_default.assert_m_rooted_value___p", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 276, "end_line": 409, "span_ids": ["test_root_model_literal", "test_root_model_nested_equality", "test_root_model_equality", "test_validate_assignment_true", "test_validate_assignment_false", "test_extra_error", "test_root_model_default_value_with_validate_default", "test_root_model_default_factory", "test_root_model_as_attr_with_validate_default", "test_root_model_wrong_default_value_without_validate_default", "test_root_model_base_model_equality", "test_root_model_with_private_attrs_equality", "test_root_model_default_value", "test_root_model_default_value_with_validate_default_on_field"], "tokens": 829}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_validate_assignment_false():\n Model = RootModel[int]\n\n m = Model(42)\n m.root = 'abc'\n assert m.root == 'abc'\n\n\ndef test_validate_assignment_true():\n class Model(RootModel[int]):\n model_config = ConfigDict(validate_assignment=True)\n\n m = Model(42)\n\n with pytest.raises(ValidationError) as e:\n m.root = 'abc'\n\n assert e.value.errors(include_url=False) == [\n {\n 'input': 'abc',\n 'loc': (),\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_root_model_literal():\n assert RootModel[int](42).root == 42\n\n\ndef test_root_model_equality():\n assert RootModel[int](42) == RootModel[int](42)\n assert RootModel[int](42) != RootModel[int](7)\n assert RootModel[int](42) != RootModel[float](42)\n assert RootModel[int](42) == RootModel[int].model_construct(42)\n\n\ndef test_root_model_with_private_attrs_equality():\n class Model(RootModel[int]):\n _private_attr: str = PrivateAttr(default='abc')\n\n m = Model(42)\n assert m == Model(42)\n\n m._private_attr = 'xyz'\n assert m != Model(42)\n\n\ndef test_root_model_nested_equality():\n class Model(BaseModel):\n value: RootModel[int]\n\n assert Model(value=42).value == RootModel[int](42)\n\n\ndef test_root_model_base_model_equality():\n class R(RootModel[int]):\n pass\n\n class B(BaseModel):\n root: int\n\n assert R(42) != B(root=42)\n assert B(root=42) != R(42)\n\n\n@pytest.mark.parametrize('extra_value', ['ignore', 'allow', 'forbid'])\ndef test_extra_error(extra_value):\n with pytest.raises(PydanticUserError, match='extra'):\n\n class Model(RootModel[int]):\n model_config = ConfigDict(extra=extra_value)\n\n\ndef test_root_model_default_value():\n class Model(RootModel):\n root: int = 42\n\n m = Model()\n assert m.root == 42\n assert m.model_dump() == 42\n assert m.__pydantic_fields_set__ == set()\n\n\ndef test_root_model_default_factory():\n class Model(RootModel):\n root: int = Field(default_factory=lambda: 42)\n\n m = Model()\n assert m.root == 42\n assert m.model_dump() == 42\n assert m.__pydantic_fields_set__ == set()\n\n\ndef test_root_model_wrong_default_value_without_validate_default():\n class Model(RootModel):\n root: int = '42'\n\n assert Model().root == '42'\n\n\ndef test_root_model_default_value_with_validate_default():\n class Model(RootModel):\n model_config = ConfigDict(validate_default=True)\n\n root: int = '42'\n\n m = Model()\n assert m.root == 42\n assert m.model_dump() == 42\n assert m.__pydantic_fields_set__ == set()\n\n\ndef test_root_model_default_value_with_validate_default_on_field():\n class Model(RootModel):\n root: Annotated[int, Field(validate_default=True, default='42')]\n\n m = Model()\n assert m.root == 42\n assert m.model_dump() == 42\n assert m.__pydantic_fields_set__ == set()\n\n\ndef test_root_model_as_attr_with_validate_default():\n class Model(BaseModel):\n model_config = ConfigDict(validate_default=True)\n\n rooted_value: RootModel[int] = 42\n\n m = Model()\n assert m.rooted_value == RootModel[int](42)\n assert m.model_dump() == {'rooted_value': 42}\n assert m.rooted_value.__pydantic_fields_set__ == {'root'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_in_root_model_default_test_nested_root_model_proper_default.assert_m_value___pydantic": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_in_root_model_default_test_nested_root_model_proper_default.assert_m_value___pydantic", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 414, "end_line": 448, "span_ids": ["test_root_model_in_root_model_default", "test_nested_root_model_proper_default", "test_nested_root_model_naive_default"], "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_model_in_root_model_default():\n class Nested(RootModel):\n root: int = 42\n\n class Model(RootModel):\n root: Nested = Nested()\n\n m = Model()\n assert m.root.root == 42\n assert m.__pydantic_fields_set__ == set()\n assert m.root.__pydantic_fields_set__ == set()\n\n\ndef test_nested_root_model_naive_default():\n class Nested(RootModel):\n root: int = 42\n\n class Model(BaseModel):\n value: Nested\n\n m = Model(value=Nested())\n assert m.value.root == 42\n assert m.value.__pydantic_fields_set__ == set()\n\n\ndef test_nested_root_model_proper_default():\n class Nested(RootModel):\n root: int = 42\n\n class Model(BaseModel):\n value: Nested = Field(default_factory=Nested)\n\n m = Model()\n assert m.value.root == 42\n assert m.value.__pydantic_fields_set__ == set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_json_schema_meta_test_root_model_json_schema_meta.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_json_schema_meta_test_root_model_json_schema_meta.None_3", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 451, "end_line": 465, "span_ids": ["test_root_model_json_schema_meta"], "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_root_model_json_schema_meta():\n ParametrizedModel = RootModel[int]\n\n class SubclassedModel(RootModel):\n \"\"\"Subclassed Model docstring\"\"\"\n\n root: int\n\n parametrized_json_schema = ParametrizedModel.model_json_schema()\n subclassed_json_schema = SubclassedModel.model_json_schema()\n\n assert parametrized_json_schema.get('title') == 'RootModel[int]'\n assert parametrized_json_schema.get('description') is None\n assert subclassed_json_schema.get('title') == 'SubclassedModel'\n assert subclassed_json_schema.get('description') == 'Subclassed Model docstring'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_pattern_serialize_test_type_adapter_dump_json.assert_ta_dump_json_Model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_pattern_serialize_test_type_adapter_dump_json.assert_ta_dump_json_Model", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 843, "end_line": 886, "span_ids": ["test_custom_return_schema", "test_pattern_serialize", "test_clear_return_schema", "test_type_adapter_dump_json"], "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_pattern_serialize():\n ta = TypeAdapter(Pattern[str])\n pattern = re.compile('^regex$')\n assert ta.dump_python(pattern) == pattern\n assert ta.dump_python(pattern, mode='json') == '^regex$'\n assert ta.dump_json(pattern) == b'\"^regex$\"'\n\n\ndef test_custom_return_schema():\n class Model(BaseModel):\n x: int\n\n @field_serializer('x', return_type=str)\n def ser_model(self, v) -> int:\n return repr(v)\n\n return_serializer = re.search(r'return_serializer: *\\w+', repr(Model.__pydantic_serializer__)).group(0)\n assert return_serializer == 'return_serializer: Str'\n\n\ndef test_clear_return_schema():\n class Model(BaseModel):\n x: int\n\n @field_serializer('x', return_type=Any)\n def ser_model(self, v) -> int:\n return repr(v)\n\n return_serializer = re.search(r'return_serializer: *\\w+', repr(Model.__pydantic_serializer__)).group(0)\n assert return_serializer == 'return_serializer: Any'\n\n\ndef test_type_adapter_dump_json():\n class Model(TypedDict):\n x: int\n y: float\n\n @model_serializer(mode='plain')\n def ser_model(self) -> Dict[str, Any]:\n return {'x': self['x'] * 2, 'y': self['y'] * 3}\n\n ta = TypeAdapter(Model)\n\n assert ta.dump_json(Model({'x': 1, 'y': 2.5})) == b'{\"x\":2,\"y\":7.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_typeddict.py_test_typeddict_non_total_test_partial_new_typeddict.None_1": {"__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_partial_new_typeddict.None_1", "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": 135, "end_line": 171, "span_ids": ["test_typeddict_non_total", "test_partial_new_typeddict"], "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_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(include_url=False) == [\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}\n\n\ndef 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}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extra_default_test_typeddict_extra_default.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_extra_default_test_typeddict_extra_default.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": 174, "end_line": 200, "span_ids": ["test_typeddict_extra_default"], "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_typeddict_extra_default(TypedDict):\n class User(TypedDict):\n name: str\n age: int\n\n ta = TypeAdapter(User)\n\n assert ta.validate_python({'name': 'pika', 'age': 7, 'rank': 1}) == {'name': 'pika', 'age': 7}\n\n class UserExtraAllow(User):\n __pydantic_config__ = ConfigDict(extra='allow')\n\n ta = TypeAdapter(UserExtraAllow)\n\n assert ta.validate_python({'name': 'pika', 'age': 7, 'rank': 1}) == {'name': 'pika', 'age': 7, 'rank': 1}\n\n class UserExtraForbid(User):\n __pydantic_config__ = ConfigDict(extra='forbid')\n\n ta = TypeAdapter(UserExtraForbid)\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python({'name': 'pika', 'age': 7, 'rank': 1})\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'extra_forbidden', 'loc': ('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/docs/plugins/conversion_table.py_from___future___import_an_from_pydantic_import_Byte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_from___future___import_an_from_pydantic_import_Byte", "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": 18, "span_ids": ["imports"], "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": "from __future__ import annotations as _annotations\n\nimport collections\nimport typing\nfrom collections import deque\nfrom dataclasses import dataclass\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 Any, Iterable, Mapping, Pattern, Sequence, Type\nfrom uuid import UUID\n\nfrom pydantic_core import CoreSchema, core_schema\nfrom typing_extensions import TypedDict\n\nfrom pydantic import ByteSize, InstanceOf", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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_Row_Row.input_source_str.if_self_python_input_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_Row_Row.input_source_str.if_self_python_input_.else_.return._", "embedding": null, "metadata": {"file_path": "docs/plugins/conversion_table.py", "file_name": "conversion_table.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 51, "span_ids": ["Row.input_type_str", "Row.input_source_str", "Row.field_type_str", "Row"], "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": "@dataclass\nclass Row:\n field_type: type[Any] | str\n input_type: type[Any] | str\n python_input: bool = False\n json_input: bool = False\n strict: bool = False\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 @property\n def field_type_str(self) -> str:\n return f'{self.field_type.__name__}' if hasattr(self.field_type, '__name__') else f'{self.field_type}'\n\n @property\n def input_type_str(self) -> str:\n return f'{self.input_type.__name__}' if hasattr(self.input_type, '__name__') else f'{self.input_type}'\n\n @property\n def input_source_str(self) -> str:\n if self.python_input:\n if self.json_input:\n return 'Python & JSON'\n else:\n return 'Python'\n elif self.json_input:\n return 'JSON'\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/docs/plugins/conversion_table.py_ConversionTable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/conversion_table.py_ConversionTable_", "embedding": null, "metadata": {"file_path": "docs/plugins/conversion_table.py", "file_name": "conversion_table.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 1534, "span_ids": ["ConversionTable.filtered", "impl:3", "impl", "ConversionTable.col_values", "ConversionTable", "ConversionTable.row_sort_key", "ConversionTable.as_markdown", "ConversionTable.row_as_markdown", "ConversionTable.sorted"], "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": "@dataclass\nclass ConversionTable:\n rows: list[Row]\n\n col_names = [\n 'Field Type',\n 'Input',\n 'Strict',\n 'Input Source',\n 'Conditions',\n ]\n open_nowrap_span = ''\n close_nowrap_span = ''\n\n def col_values(self, row: Row) -> list[str]:\n o = self.open_nowrap_span\n c = self.close_nowrap_span\n\n return [\n f'{o}`{row.field_type_str}`{c}',\n f'{o}`{row.input_type_str}`{c}',\n '\u2713' if row.strict else '',\n f'{o}{row.input_source_str}{c}',\n row.condition if row.condition else '',\n ]\n\n @staticmethod\n def row_as_markdown(cols: list[str]) -> str:\n return f'| {\" | \".join(cols)} |'\n\n def as_markdown(self) -> str:\n lines = [self.row_as_markdown(self.col_names), self.row_as_markdown(['-'] * len(self.col_names))]\n for row in self.rows:\n lines.append(self.row_as_markdown(self.col_values(row)))\n return '\\n'.join(lines)\n\n @staticmethod\n def row_sort_key(row: Row) -> Any:\n field_type = row.field_type_str or ' '\n input_type = row.input_type_str or ' '\n input_source = row.input_source_str\n\n # Include the .isupper() to make it so that leading-lowercase items come first\n return field_type[0].isupper(), field_type, input_type[0].isupper(), input_type, input_source\n\n def sorted(self) -> ConversionTable:\n return ConversionTable(sorted(self.rows, key=self.row_sort_key))\n\n def filtered(self, predicate: typing.Callable[[Row], bool]) -> ConversionTable:\n return ConversionTable([row for row in self.rows if predicate(row)])\n\n\ntable_rows: list[Row] =\n # ... other code\n\nconversion_table = ConversionTable(table_rows).sorted()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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/griffe_doclinks.py_ast_find_heading.raise_ValueError_f_headin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_ast_find_heading.raise_ValueError_f_headin", "embedding": null, "metadata": {"file_path": "docs/plugins/griffe_doclinks.py", "file_name": "griffe_doclinks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["imports", "find_heading"], "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 ast\nimport re\nfrom functools import partial\nfrom pathlib import Path\nfrom typing import Tuple\n\nfrom griffe.dataclasses import Object as GriffeObject\nfrom griffe.extensions import VisitorExtension\nfrom pymdownx.slugs import slugify\n\nDOCS_PATH = Path(__file__).parent.parent\nslugifier = slugify(case='lower')\n\n\ndef find_heading(content: str, slug: str, file_path: Path) -> Tuple[str, int]:\n for m in re.finditer('^#+ (.+)', content, flags=re.M):\n heading = m.group(1)\n h_slug = slugifier(heading, '-')\n if h_slug == slug:\n return heading, m.end()\n raise ValueError(f'heading with slug {slug!r} not found in {file_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/docs/plugins/griffe_doclinks.py_insert_at_top_insert_at_top.return.f_abstract_Usage_Doc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_insert_at_top_insert_at_top.return.f_abstract_Usage_Doc", "embedding": null, "metadata": {"file_path": "docs/plugins/griffe_doclinks.py", "file_name": "griffe_doclinks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 37, "span_ids": ["insert_at_top"], "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 insert_at_top(path: str, api_link: str) -> str:\n rel_file = path.rstrip('/') + '.md'\n file_path = DOCS_PATH / rel_file\n content = file_path.read_text()\n second_heading = re.search('^#+ ', content, flags=re.M)\n assert second_heading, 'unable to find second heading in file'\n first_section = content[: second_heading.start()]\n\n if f'[{api_link}]' not in first_section:\n print(f'inserting API link \"{api_link}\" at the top of {file_path.relative_to(DOCS_PATH)}')\n file_path.write_text('??? api \"API Documentation\"\\n' f' [`{api_link}`][{api_link}]
\\n\\n' f'{content}')\n\n heading = file_path.stem.replace('_', ' ').title()\n return f'!!! abstract \"Usage Documentation\"\\n [{heading}](../{rel_file})\\n'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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/griffe_doclinks.py_replace_links_replace_links.return.f_abstract_Usage_Doc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_replace_links_replace_links.return.f_abstract_Usage_Doc", "embedding": null, "metadata": {"file_path": "docs/plugins/griffe_doclinks.py", "file_name": "griffe_doclinks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 67, "span_ids": ["replace_links"], "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 replace_links(m: re.Match, *, api_link: str) -> str:\n path_group = m.group(1)\n if '#' not in path_group:\n # no heading id, put the content at the top of the page\n return insert_at_top(path_group, api_link)\n\n usage_path, slug = path_group.split('#', 1)\n rel_file = usage_path.rstrip('/') + '.md'\n file_path = DOCS_PATH / rel_file\n content = file_path.read_text()\n heading, heading_end = find_heading(content, slug, file_path)\n\n next_heading = re.search('^#+ ', content[heading_end:], flags=re.M)\n if next_heading:\n next_section = content[heading_end : heading_end + next_heading.start()]\n else:\n next_section = content[heading_end:]\n\n if f'[{api_link}]' not in next_section:\n print(f'inserting API link \"{api_link}\" into {file_path.relative_to(DOCS_PATH)}')\n file_path.write_text(\n f'{content[:heading_end]}\\n\\n'\n '??? api \"API Documentation\"\\n'\n f' [`{api_link}`][{api_link}]
'\n f'{content[heading_end:]}'\n )\n\n return f'!!! abstract \"Usage Documentation\"\\n [{heading}](../{rel_file}#{slug})\\n'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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/griffe_doclinks.py_update_docstring_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/griffe_doclinks.py_update_docstring_", "embedding": null, "metadata": {"file_path": "docs/plugins/griffe_doclinks.py", "file_name": "griffe_doclinks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 91, "span_ids": ["Extension.visit_module", "update_docstrings_recursively", "Extension", "update_docstring"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_docstring(obj: GriffeObject) -> str:\n return re.sub(\n r'usage[\\- ]docs: ?https://docs\\.pydantic\\.dev/.+?/(\\S+)',\n partial(replace_links, api_link=obj.path),\n obj.docstring.value,\n flags=re.I,\n )\n\n\ndef update_docstrings_recursively(obj: GriffeObject) -> None:\n if obj.docstring:\n obj.docstring.value = update_docstring(obj)\n for member in obj.members.values():\n if not member.is_alias:\n update_docstrings_recursively(member)\n\n\nclass Extension(VisitorExtension):\n def visit_module(self, node: ast.AST) -> None:\n module = self.visitor.current.module\n update_docstrings_recursively(module)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_on_page_markdown_on_page_markdown.if_md_render_why_markd.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_render_why_markd.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": 43, "end_line": 63, "span_ids": ["on_page_markdown"], "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 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 := render_index(markdown, page):\n return md\n if md := render_why(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 elif md := populate_pydantic_people(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_add_changelog.if_not_new_file_is_file_.new_file_write_text_histo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_changelog_add_changelog.if_not_new_file_is_file_.new_file_write_text_histo", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 71, "span_ids": ["add_changelog"], "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 add_changelog() -> None:\n history = (PROJECT_ROOT / 'HISTORY.md').read_text(encoding='utf-8')\n history = re.sub(r'(\\s)@([\\w\\-]+)', r'\\1[@\\2](https://github.com/\\2)', history, flags=re.I)\n history = re.sub(r'\\[GitHub release]\\(', r'[:simple-github: GitHub release](', history)\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(encoding='utf-8') != history:\n new_file.write_text(history, encoding='utf-8')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_add_mkdocs_run_deps_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_mkdocs_run_deps_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": 74, "end_line": 95, "span_ids": ["impl:9", "add_mkdocs_run_deps"], "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 add_mkdocs_run_deps() -> None:\n # set the pydantic and pydantic-core versions to configure for running examples in the browser\n pyproject_toml = (PROJECT_ROOT / 'pyproject.toml').read_text()\n pydantic_core_version = re.search(r'pydantic-core==(.+?)[\"\\']', pyproject_toml).group(1)\n\n version_py = (PROJECT_ROOT / 'pydantic' / 'version.py').read_text()\n pydantic_version = re.search(r'^VERSION ?= ([\"\\'])(.+)\\1', version_py, flags=re.M).group(2)\n\n mkdocs_run_deps = json.dumps([f'pydantic=={pydantic_version}', f'pydantic-core=={pydantic_core_version}'])\n logger.info('Setting mkdocs_run_deps=%s', mkdocs_run_deps)\n\n html = f\"\"\"\\\n \n\"\"\"\n path = DOCS_DIR / 'theme/mkdocs_run_deps.html'\n path.write_text(html)\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_get_orgs_data_tile_template._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_get_orgs_data_tile_template._", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 200, "span_ids": ["impl:13", "get_orgs_data"], "tokens": 102}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_orgs_data() -> list[dict[str, str]]:\n with (THIS_DIR / 'orgs.toml').open('rb') as f:\n orgs_data = tomli.load(f)\n return orgs_data['orgs']\n\n\ntile_template = \"\"\"\n
\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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_render_index_render_index.return.re_sub_r_organisation": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_render_index_render_index.return.re_sub_r_organisation", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 203, "end_line": 226, "span_ids": ["render_index"], "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 render_index(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'index.md':\n return None\n\n if version := os.getenv('PYDANTIC_VERSION'):\n url = f'https://github.com/pydantic/pydantic/releases/tag/{version}'\n version_str = f'Documentation for version: [{version}]({url})'\n elif (version_ref := os.getenv('GITHUB_REF')) and version_ref.startswith('refs/tags/'):\n version = re.sub('^refs/tags/', '', version_ref.lower())\n url = f'https://github.com/pydantic/pydantic/releases/tag/{version}'\n version_str = f'Documentation for version: [{version}]({url})'\n elif sha := os.getenv('GITHUB_SHA'):\n url = f'https://github.com/pydantic/pydantic/commit/{sha}'\n sha = sha[:7]\n version_str = f'Documentation for development version: [{sha}]({url})'\n else:\n version_str = 'Documentation for development version'\n logger.info('Setting version prefix: %r', version_str)\n markdown = re.sub(r'{{ *version *}}', version_str, markdown)\n\n elements = [tile_template.format(**org) for org in get_orgs_data()]\n\n orgs_grid = f'
{\"\".join(elements)}
'\n return re.sub(r'{{ *organisations *}}', orgs_grid, 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_render_why__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_render_why__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": 229, "end_line": 252, "span_ids": ["render_why", "_generate_table_row", "_generate_table_heading"], "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 render_why(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'why.md':\n return None\n\n with (THIS_DIR / 'using.toml').open('rb') as f:\n using = tomli.load(f)['libs']\n\n libraries = '\\n'.join('* [`{repo}`](https://github.com/{repo}) {stars:,} stars'.format(**lib) for lib in using)\n markdown = re.sub(r'{{ *libraries *}}', libraries, markdown)\n default_description = '_(Based on the criteria described above)_'\n\n elements = [\n f'### {org[\"name\"]} {{#org-{org[\"key\"]}}}\\n\\n{org.get(\"description\") or default_description}'\n for org in get_orgs_data()\n ]\n return re.sub(r'{{ *organisations *}}', '\\n\\n'.join(elements), 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/using_update.py_from_pathlib_import_Path_update_lib.lib_stars_stars": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/using_update.py_from_pathlib_import_Path_update_lib.lib_stars_stars", "embedding": null, "metadata": {"file_path": "docs/plugins/using_update.py", "file_name": "using_update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["imports", "update_lib"], "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": "from pathlib import Path\nfrom time import sleep\n\nimport requests\nimport tomli\n\nTHIS_DIR = Path(__file__).parent\n\nsession = requests.Session()\n\n\ndef update_lib(lib, *, retry=0):\n repo = lib['repo']\n url = f'https://api.github.com/repos/{repo}'\n resp = session.get(url)\n if resp.status_code == 403 and retry < 3:\n print(f'retrying {repo} {retry}')\n sleep(5)\n return update_lib(lib, retry=retry + 1)\n\n resp.raise_for_status()\n data = resp.json()\n stars = data['watchers_count']\n print(f'{repo}: {stars}')\n lib['stars'] = stars", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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/using_update.py_with_THIS_DIR_using_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/using_update.py_with_THIS_DIR_using_t_", "embedding": null, "metadata": {"file_path": "docs/plugins/using_update.py", "file_name": "using_update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 40, "span_ids": ["impl:5"], "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": "with (THIS_DIR / 'using.toml').open('rb') as f:\n table = tomli.load(f)\n\nlibs = table['libs']\nfor lib in libs:\n update_lib(lib)\n\nlibs.sort(key=lambda lib: lib['stars'], reverse=True)\n\nwith (THIS_DIR / 'using.toml').open('w') as f:\n for lib in libs:\n f.write('[[libs]]\\nrepo = \"{repo}\"\\nstars = {stars}\\n'.format(**lib))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_typing___version__.VERSION": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py_typing___version__.VERSION", "embedding": null, "metadata": {"file_path": "pydantic/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 57, "span_ids": ["imports"], "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": "import typing\n\nfrom ._migration import getattr_migration\nfrom .version import VERSION\n\nif typing.TYPE_CHECKING:\n # import of virtually everything is supported via `__getattr__` below,\n # but we need them here for type checking and IDE support\n import pydantic_core\n from pydantic_core.core_schema import (\n FieldSerializationInfo,\n SerializationInfo,\n SerializerFunctionWrapHandler,\n ValidationInfo,\n ValidatorFunctionWrapHandler,\n )\n\n from . import dataclasses\n from ._internal._generate_schema import GenerateSchema as GenerateSchema\n from .aliases import AliasChoices, AliasGenerator, AliasPath\n from .annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler\n from .config import ConfigDict, with_config\n from .errors import *\n from .fields import Field, PrivateAttr, computed_field\n from .functional_serializers import (\n PlainSerializer,\n SerializeAsAny,\n WrapSerializer,\n field_serializer,\n model_serializer,\n )\n from .functional_validators import (\n AfterValidator,\n BeforeValidator,\n InstanceOf,\n PlainValidator,\n SkipValidation,\n WrapValidator,\n field_validator,\n model_validator,\n )\n from .json_schema import WithJsonSchema\n from .main import *\n from .networks import *\n from .type_adapter import TypeAdapter\n from .types import *\n from .validate_call_decorator import validate_call\n from .warnings import PydanticDeprecatedSince20, PydanticDeprecatedSince26, PydanticDeprecationWarning\n\n # this encourages pycharm to import `ValidationError` from here, not pydantic_core\n ValidationError = pydantic_core.ValidationError\n from .deprecated.class_validators import root_validator, validator\n from .deprecated.config import BaseConfig, Extra\n from .deprecated.tools import *\n from .root_model import RootModel\n\n__version__ = VERSION", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py___all_____all__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py___all_____all__._", "embedding": null, "metadata": {"file_path": "pydantic/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 216, "span_ids": ["imports"], "tokens": 903}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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__ = (\n # dataclasses\n 'dataclasses',\n # functional validators\n 'field_validator',\n 'model_validator',\n 'AfterValidator',\n 'BeforeValidator',\n 'PlainValidator',\n 'WrapValidator',\n 'SkipValidation',\n 'InstanceOf',\n # JSON Schema\n 'WithJsonSchema',\n # deprecated V1 functional validators, these are imported via `__getattr__` below\n 'root_validator',\n 'validator',\n # functional serializers\n 'field_serializer',\n 'model_serializer',\n 'PlainSerializer',\n 'SerializeAsAny',\n 'WrapSerializer',\n # config\n 'ConfigDict',\n 'with_config',\n # deprecated V1 config, these are imported via `__getattr__` below\n 'BaseConfig',\n 'Extra',\n # validate_call\n 'validate_call',\n # errors\n 'PydanticErrorCodes',\n 'PydanticUserError',\n 'PydanticSchemaGenerationError',\n 'PydanticImportError',\n 'PydanticUndefinedAnnotation',\n 'PydanticInvalidForJsonSchema',\n # fields\n 'Field',\n 'computed_field',\n 'PrivateAttr',\n # alias\n 'AliasChoices',\n 'AliasGenerator',\n 'AliasPath',\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 'NatsDsn',\n 'MySQLDsn',\n 'MariaDBDsn',\n 'ClickHouseDsn',\n 'validate_email',\n # root_model\n 'RootModel',\n # deprecated tools, these are imported via `__getattr__` below\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 'StringConstraints',\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 'NewPath',\n 'Json',\n 'Secret',\n 'SecretStr',\n 'SecretBytes',\n 'StrictBool',\n 'StrictBytes',\n 'StrictInt',\n 'StrictFloat',\n 'PaymentCardNumber',\n 'ByteSize',\n 'PastDate',\n 'FutureDate',\n 'PastDatetime',\n 'FutureDatetime',\n 'AwareDatetime',\n 'NaiveDatetime',\n 'AllowInfNan',\n 'EncoderProtocol',\n 'EncodedBytes',\n 'EncodedStr',\n 'Base64Encoder',\n 'Base64Bytes',\n 'Base64Str',\n 'Base64UrlBytes',\n 'Base64UrlStr',\n 'GetPydanticSchema',\n 'Tag',\n 'Discriminator',\n 'JsonValue',\n # type_adapter\n 'TypeAdapter',\n # version\n '__version__',\n 'VERSION',\n # warnings\n 'PydanticDeprecatedSince20',\n 'PydanticDeprecatedSince26',\n 'PydanticDeprecationWarning',\n # annotated handlers\n 'GetCoreSchemaHandler',\n 'GetJsonSchemaHandler',\n # generate schema from ._internal\n 'GenerateSchema',\n # pydantic_core\n 'ValidationError',\n 'ValidationInfo',\n 'SerializationInfo',\n 'ValidatorFunctionWrapHandler',\n 'FieldSerializationInfo',\n 'SerializerFunctionWrapHandler',\n 'OnErrorOmit',\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__A_mapping_of_member_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/__init__.py__A_mapping_of_member_n_", "embedding": null, "metadata": {"file_path": "pydantic/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 387, "span_ids": ["__getattr__", "imports", "impl:16", "impl:14", "__dir__"], "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": "# A mapping of {: (package, )} defining dynamic imports\n_dynamic_imports: 'dict[str, tuple[str, str]]' =\n # ... other code\n\n_getattr_migration = getattr_migration(__name__)\n\n\ndef __getattr__(attr_name: str) -> object:\n dynamic_attr = _dynamic_imports.get(attr_name)\n if dynamic_attr is None:\n return _getattr_migration(attr_name)\n\n package, module_name = dynamic_attr\n\n from importlib import import_module\n\n if module_name == '__module__':\n return import_module(f'.{attr_name}', package=package)\n else:\n module = import_module(module_name, package=package)\n return getattr(module, attr_name)\n\n\ndef __dir__() -> 'list[str]':\n return list(__all__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_from___future___import_an_DEPRECATION_MESSAGE._Support_for_class_based_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_from___future___import_an_DEPRECATION_MESSAGE._Support_for_class_based_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["imports"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations as _annotations\n\nimport warnings\nfrom contextlib import contextmanager\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n cast,\n)\n\nfrom pydantic_core import core_schema\nfrom typing_extensions import (\n Literal,\n Self,\n)\n\nfrom ..aliases import AliasGenerator\nfrom ..config import ConfigDict, ExtraValues, JsonDict, JsonEncoder, JsonSchemaExtraCallable\nfrom ..errors import PydanticUserError\nfrom ..warnings import PydanticDeprecatedSince20\n\nif not TYPE_CHECKING:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n\nif TYPE_CHECKING:\n from .._internal._schema_generation_shared import GenerateSchema\n\nDEPRECATION_MESSAGE = 'Support for class-based `config` is deprecated, use ConfigDict instead.'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_config.py_ConfigWrapper_ConfigWrapper.__init__.if_check_.else_.self.config_dict.cast_ConfigDict_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapper_ConfigWrapper.__init__.if_check_.else_.self.config_dict.cast_ConfigDict_config_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 91, "span_ids": ["ConfigWrapper", "ConfigWrapper.__init__"], "tokens": 558}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigWrapper:\n \"\"\"Internal wrapper for Config which exposes ConfigDict items as attributes.\"\"\"\n\n __slots__ = ('config_dict',)\n\n config_dict: ConfigDict\n\n # all annotations are copied directly from ConfigDict, and should be kept up to date, a test will fail if they\n # stop matching\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: ExtraValues | None\n frozen: bool\n populate_by_name: bool\n use_enum_values: bool\n validate_assignment: bool\n arbitrary_types_allowed: bool\n from_attributes: bool\n # whether to use the actual key provided in the data (e.g. 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] | AliasGenerator | None\n ignored_types: tuple[type, ...]\n allow_inf_nan: bool\n json_schema_extra: JsonDict | JsonSchemaExtraCallable | None\n json_encoders: dict[type[object], JsonEncoder] | None\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 ser_json_inf_nan: Literal['null', 'constants']\n # whether to validate default values during validation, default False\n validate_default: bool\n validate_return: bool\n protected_namespaces: tuple[str, ...]\n hide_input_in_errors: bool\n defer_build: bool\n plugin_settings: dict[str, object] | None\n schema_generator: type[GenerateSchema] | None\n json_schema_serialization_defaults_required: bool\n json_schema_mode_override: Literal['validation', 'serialization', None]\n coerce_numbers_to_str: bool\n regex_engine: Literal['rust-regex', 'python-re']\n validation_error_cause: bool\n use_attribute_docstrings: bool\n\n def __init__(self, config: ConfigDict | dict[str, Any] | type[Any] | None, *, check: bool = True):\n if check:\n self.config_dict = prepare_config(config)\n else:\n self.config_dict = cast(ConfigDict, 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/_core_metadata.py_from___future___import_an_CoreMetadata._TODO_Consider_moving_t": {"__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._TODO_Consider_moving_t", "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": 33, "span_ids": ["imports", "CoreMetadata"], "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": "from __future__ import annotations as _annotations\n\nimport typing\nfrom typing import Any\n\nimport typing_extensions\n\nif typing.TYPE_CHECKING:\n from ._schema_generation_shared import (\n CoreSchemaOrField as CoreSchemaOrField,\n )\n from ._schema_generation_shared import (\n GetJsonSchemaFunction,\n )\n\n\nclass CoreMetadata(typing_extensions.TypedDict, total=False):\n \"\"\"A `TypedDict` for holding the metadata dict of the schema.\n\n Attributes:\n pydantic_js_functions: List of JSON schema functions.\n pydantic_js_prefer_positional_arguments: Whether JSON schema generator will\n prefer positional over keyword arguments for an 'arguments' schema.\n \"\"\"\n\n pydantic_js_functions: list[GetJsonSchemaFunction]\n pydantic_js_annotation_functions: list[GetJsonSchemaFunction]\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\n\n pydantic_typed_dict_cls: type[Any] | None # TODO: Consider moving this into the pydantic-core TypedDictSchema", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CoreMetadataHandler.metadata.return.metadata": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_metadata.py_CoreMetadataHandler_CoreMetadataHandler.metadata.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": 36, "end_line": 64, "span_ids": ["CoreMetadataHandler", "CoreMetadataHandler.__init__", "CoreMetadataHandler.metadata"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CoreMetadataHandler:\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: CoreSchemaOrField):\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}.')\n\n @property\n def metadata(self) -> CoreMetadata:\n \"\"\"Retrieves the metadata dict from 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_ref_collect_definitions.return.defs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_get_ref_collect_definitions.return.defs", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 143, "span_ids": ["get_ref", "collect_definitions"], "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 get_ref(s: core_schema.CoreSchema) -> None | str:\n \"\"\"Get the ref from the schema if it has one.\n This exists just for type checking to work correctly.\n \"\"\"\n return s.get('ref', None)\n\n\ndef collect_definitions(schema: core_schema.CoreSchema) -> dict[str, core_schema.CoreSchema]:\n defs: dict[str, CoreSchema] = {}\n\n def _record_valid_refs(s: core_schema.CoreSchema, recurse: Recurse) -> core_schema.CoreSchema:\n ref = get_ref(s)\n if ref:\n defs[ref] = s\n return recurse(s, _record_valid_refs)\n\n walk_core_schema(schema, _record_valid_refs)\n\n return defs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_define_expected_missing_refs_define_expected_missing_refs.return.None": {"__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_define_expected_missing_refs.return.None", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 165, "span_ids": ["define_expected_missing_refs"], "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 define_expected_missing_refs(\n schema: core_schema.CoreSchema, allowed_missing_refs: set[str]\n) -> core_schema.CoreSchema | None:\n if not allowed_missing_refs:\n # in this case, there are no missing refs to potentially substitute, so there's no need to walk the schema\n # this is a common case (will be hit for all non-generic models), so it's worth optimizing for\n return None\n\n refs = collect_definitions(schema).keys()\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 # Issue: https://github.com/pydantic/pydantic-core/issues/619\n core_schema.none_schema(ref=ref, metadata={HAS_INVALID_SCHEMAS_METADATA_KEY: True})\n for ref in expected_missing_refs\n ]\n return core_schema.definitions_schema(schema, definitions)\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/_core_utils.py__TODO_Should_we_move__W__WalkCoreSchema._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__TODO_Should_we_move__W__WalkCoreSchema._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": 180, "end_line": 210, "span_ids": ["_WalkCoreSchema", "_WalkCoreSchema._handle_other_schemas", "_WalkCoreSchema.walk", "_WalkCoreSchema._walk", "_WalkCoreSchema._build_schema_type_to_method", "_WalkCoreSchema.__init__", "impl:19"], "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": "# TODO: Should we move _WalkCoreSchema into pydantic_core proper?\n# Issue: https://github.com/pydantic/pydantic-core/issues/615\n\n\nclass _WalkCoreSchema:\n def __init__(self):\n self._schema_type_to_method = self._build_schema_type_to_method()\n\n def _build_schema_type_to_method(self) -> dict[core_schema.CoreSchemaType, Recurse]:\n mapping: dict[core_schema.CoreSchemaType, Recurse] = {}\n key: core_schema.CoreSchemaType\n for key in get_args(core_schema.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, f: Walk) -> core_schema.CoreSchema:\n return f(schema, self._walk)\n\n def _walk(self, schema: core_schema.CoreSchema, f: Walk) -> core_schema.CoreSchema:\n schema = self._schema_type_to_method[schema['type']](schema.copy(), f)\n ser_schema: core_schema.SerSchema | None = schema.get('serialization') # type: ignore\n if ser_schema:\n schema['serialization'] = self._handle_ser_schemas(ser_schema, f)\n return schema\n\n def _handle_other_schemas(self, schema: core_schema.CoreSchema, f: Walk) -> core_schema.CoreSchema:\n sub_schema = schema.get('schema', None)\n if sub_schema is not None:\n schema['schema'] = self.walk(sub_schema, f) # 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__WalkCoreSchema._handle_ser_schemas__WalkCoreSchema._handle_ser_schemas.return.ser_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__WalkCoreSchema._handle_ser_schemas__WalkCoreSchema._handle_ser_schemas.return.ser_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": 222, "end_line": 229, "span_ids": ["_WalkCoreSchema._handle_ser_schemas"], "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 _WalkCoreSchema:\n\n def _handle_ser_schemas(self, ser_schema: core_schema.SerSchema, f: Walk) -> core_schema.SerSchema:\n schema: core_schema.CoreSchema | None = ser_schema.get('schema', None)\n if schema is not None:\n ser_schema['schema'] = self.walk(schema, f) # type: ignore\n return_schema: core_schema.CoreSchema | None = ser_schema.get('return_schema', None)\n if return_schema is not None:\n ser_schema['return_schema'] = self.walk(return_schema, f) # type: ignore\n return ser_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__WalkCoreSchema.handle_model_fields_schema__WalkCoreSchema.handle_model_fields_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__WalkCoreSchema.handle_model_fields_schema__WalkCoreSchema.handle_model_fields_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": 340, "end_line": 357, "span_ids": ["_WalkCoreSchema.handle_model_fields_schema"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _WalkCoreSchema:\n\n def handle_model_fields_schema(self, schema: core_schema.ModelFieldsSchema, f: Walk) -> core_schema.CoreSchema:\n extras_schema = schema.get('extras_schema')\n if extras_schema is not None:\n schema['extras_schema'] = self.walk(extras_schema, f)\n replaced_fields: dict[str, core_schema.ModelField] = {}\n replaced_computed_fields: list[core_schema.ComputedField] = []\n for computed_field in schema.get('computed_fields', ()):\n replaced_field = computed_field.copy()\n replaced_field['return_schema'] = self.walk(computed_field['return_schema'], f)\n replaced_computed_fields.append(replaced_field)\n if replaced_computed_fields:\n schema['computed_fields'] = replaced_computed_fields\n for k, v in schema['fields'].items():\n replaced_field = v.copy()\n replaced_field['schema'] = self.walk(v['schema'], f)\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_simplify_schema_references_simplify_schema_references.collect_refs.if_s_type_definiti.else_.if_ref_is_not_None_.else_.return.recurse_s_collect_refs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references_simplify_schema_references.collect_refs.if_s_type_definiti.else_.if_ref_is_not_None_.else_.return.recurse_s_collect_refs_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 434, "end_line": 458, "span_ids": ["simplify_schema_references"], "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 simplify_schema_references(schema: core_schema.CoreSchema) -> core_schema.CoreSchema: # noqa: C901\n definitions: dict[str, core_schema.CoreSchema] = {}\n ref_counts: dict[str, int] = defaultdict(int)\n involved_in_recursion: dict[str, bool] = {}\n current_recursion_ref_count: dict[str, int] = defaultdict(int)\n\n def collect_refs(s: core_schema.CoreSchema, recurse: Recurse) -> core_schema.CoreSchema:\n if s['type'] == 'definitions':\n for definition in s['definitions']:\n ref = get_ref(definition)\n assert ref is not None\n if ref not in definitions:\n definitions[ref] = definition\n recurse(definition, collect_refs)\n return recurse(s['schema'], collect_refs)\n else:\n ref = get_ref(s)\n if ref is not None:\n new = recurse(s, collect_refs)\n new_ref = get_ref(new)\n if new_ref:\n definitions[new_ref] = new\n return core_schema.definition_reference_schema(schema_ref=ref)\n else:\n return recurse(s, collect_refs)\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/_core_utils.py_simplify_schema_references.schema_simplify_schema_references.count_refs.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.schema_simplify_schema_references.count_refs.return.s", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 460, "end_line": 478, "span_ids": ["simplify_schema_references"], "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 simplify_schema_references(schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n # ... other code\n\n schema = walk_core_schema(schema, collect_refs)\n\n def count_refs(s: core_schema.CoreSchema, recurse: Recurse) -> core_schema.CoreSchema:\n if s['type'] != 'definition-ref':\n return recurse(s, count_refs)\n ref = s['schema_ref']\n ref_counts[ref] += 1\n\n if ref_counts[ref] >= 2:\n # If this model is involved in a recursion this should be detected\n # on its second encounter, we can safely stop the walk here.\n if current_recursion_ref_count[ref] != 0:\n involved_in_recursion[ref] = True\n return s\n\n current_recursion_ref_count[ref] += 1\n recurse(definitions[ref], count_refs)\n current_recursion_ref_count[ref] -= 1\n return s\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/_core_utils.py_simplify_schema_references.schema_5_simplify_schema_references.can_be_inlined.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.schema_5_simplify_schema_references.can_be_inlined.return.True", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_core_utils.py", "file_name": "_core_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 480, "end_line": 501, "span_ids": ["simplify_schema_references"], "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 simplify_schema_references(schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n # ... other code\n\n schema = walk_core_schema(schema, count_refs)\n\n assert all(c == 0 for c in current_recursion_ref_count.values()), 'this is a bug! please report it'\n\n def can_be_inlined(s: core_schema.DefinitionReferenceSchema, ref: str) -> bool:\n if ref_counts[ref] > 1:\n return False\n if involved_in_recursion.get(ref, False):\n return False\n if 'serialization' in s:\n return False\n if 'metadata' in s:\n metadata = s['metadata']\n for k in (\n 'pydantic_js_functions',\n 'pydantic_js_annotation_functions',\n 'pydantic.internal.union_discriminator',\n ):\n if k in metadata:\n # we need to keep this as a ref\n return False\n return True\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.inline_refs_simplify_schema_references.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_simplify_schema_references.inline_refs_simplify_schema_references.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": 503, "end_line": 529, "span_ids": ["simplify_schema_references"], "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 simplify_schema_references(schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n # ... other code\n\n def inline_refs(s: core_schema.CoreSchema, recurse: Recurse) -> core_schema.CoreSchema:\n if s['type'] == 'definition-ref':\n ref = s['schema_ref']\n # Check if the reference is only used once, not involved in recursion and does not have\n # any extra keys (like 'serialization')\n if can_be_inlined(s, ref):\n # Inline the reference by replacing the reference with the actual schema\n new = definitions.pop(ref)\n ref_counts[ref] -= 1 # because we just replaced it!\n # put all other keys that were on the def-ref schema into the inlined version\n # in particular this is needed for `serialization`\n if 'serialization' in s:\n new['serialization'] = s['serialization']\n s = recurse(new, inline_refs)\n return s\n else:\n return recurse(s, inline_refs)\n else:\n return recurse(s, inline_refs)\n\n schema = walk_core_schema(schema, inline_refs)\n\n def_values = [v for v in definitions.values() if ref_counts[v['ref']] > 0] # type: ignore\n\n if def_values:\n schema = core_schema.definitions_schema(schema=schema, definitions=def_values)\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__strip_metadata__strip_metadata.return.walk_core_schema_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py__strip_metadata__strip_metadata.return.walk_core_schema_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": 532, "end_line": 560, "span_ids": ["_strip_metadata"], "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 _strip_metadata(schema: CoreSchema) -> CoreSchema:\n def strip_metadata(s: CoreSchema, recurse: Recurse) -> CoreSchema:\n s = s.copy()\n s.pop('metadata', None)\n if s['type'] == 'model-fields':\n s = s.copy()\n s['fields'] = {k: v.copy() for k, v in s['fields'].items()}\n for field_name, field_schema in s['fields'].items():\n field_schema.pop('metadata', None)\n s['fields'][field_name] = field_schema\n computed_fields = s.get('computed_fields', None)\n if computed_fields:\n s['computed_fields'] = [cf.copy() for cf in computed_fields]\n for cf in computed_fields:\n cf.pop('metadata', None)\n else:\n s.pop('computed_fields', None)\n elif s['type'] == 'model':\n # remove some defaults\n if s.get('custom_init', True) is False:\n s.pop('custom_init')\n if s.get('root_model', True) is False:\n s.pop('root_model')\n if {'title'}.issuperset(s.get('config', {}).keys()):\n s.pop('config', None)\n\n return recurse(s, strip_metadata)\n\n return walk_core_schema(schema, strip_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_utils.py_pretty_print_core_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_core_utils.py_pretty_print_core_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": 563, "end_line": 586, "span_ids": ["validate_core_schema", "pretty_print_core_schema"], "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 pretty_print_core_schema(\n schema: CoreSchema,\n include_metadata: bool = False,\n) -> None:\n \"\"\"Pretty print a CoreSchema using rich.\n This is intended for debugging purposes.\n\n Args:\n schema: The CoreSchema to print.\n include_metadata: Whether to include metadata in the output. Defaults to `False`.\n \"\"\"\n from rich import print # type: ignore # install it manually in your dev env\n\n if not include_metadata:\n schema = _strip_metadata(schema)\n\n return print(schema)\n\n\ndef validate_core_schema(schema: CoreSchema) -> CoreSchema:\n if 'PYDANTIC_SKIP_VALIDATING_CORE_SCHEMAS' in os.environ:\n return schema\n return _validate_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/_dataclasses.py__Private_logic_for_crea_if_typing_TYPE_CHECKING_.else_.DeprecationWarning.PydanticDeprecatedSince20": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py__Private_logic_for_crea_if_typing_TYPE_CHECKING_.else_.DeprecationWarning.PydanticDeprecatedSince20", "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": 65, "span_ids": ["docstring"], "tokens": 627}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Private logic for creating pydantic dataclasses.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport typing\nimport warnings\nfrom functools import partial, wraps\nfrom typing import Any, Callable, ClassVar\n\nfrom pydantic_core import (\n ArgsKwargs,\n SchemaSerializer,\n SchemaValidator,\n core_schema,\n)\nfrom typing_extensions import TypeGuard\n\nfrom ..errors import PydanticUndefinedAnnotation\nfrom ..fields import FieldInfo\nfrom ..plugin._schema_validator import create_schema_validator\nfrom ..warnings import PydanticDeprecatedSince20\nfrom . import _config, _decorators, _typing_extra\nfrom ._fields import collect_dataclass_fields\nfrom ._generate_schema import GenerateSchema\nfrom ._generics import get_standard_typevars_map\nfrom ._mock_val_ser import set_dataclass_mocks\nfrom ._schema_generation_shared import CallbackGetCoreSchemaHandler\nfrom ._signature import generate_pydantic_signature\n\nif typing.TYPE_CHECKING:\n from ..config import ConfigDict\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 \"\"\"A protocol containing attributes only available once a class has been decorated as a Pydantic dataclass.\n\n Attributes:\n __pydantic_config__: Pydantic-specific configuration settings for the dataclass.\n __pydantic_complete__: Whether dataclass building is completed, or if there are still undefined fields.\n __pydantic_core_schema__: The pydantic-core schema used to build the SchemaValidator and SchemaSerializer.\n __pydantic_decorators__: Metadata containing the decorators defined on the dataclass.\n __pydantic_fields__: Metadata about the fields defined on the dataclass.\n __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the dataclass.\n __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the dataclass.\n \"\"\"\n\n __pydantic_config__: ClassVar[ConfigDict]\n __pydantic_complete__: ClassVar[bool]\n __pydantic_core_schema__: ClassVar[core_schema.CoreSchema]\n __pydantic_decorators__: ClassVar[_decorators.DecoratorInfos]\n __pydantic_fields__: ClassVar[dict[str, FieldInfo]]\n __pydantic_serializer__: ClassVar[SchemaSerializer]\n __pydantic_validator__: ClassVar[SchemaValidator]\n\nelse:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_Decorator.build_Decorator.bind_to_cls.return.self_build_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_Decorator.build_Decorator.bind_to_cls.return.self_build_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 278, "span_ids": ["Decorator.build", "Decorator.bind_to_cls"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclass(**slots_true)\nclass Decorator(Generic[DecoratorInfoType]):\n\n @staticmethod\n def build(\n cls_: Any,\n *,\n cls_var_name: str,\n shim: Callable[[Any], Any] | None,\n info: DecoratorInfoType,\n ) -> Decorator[DecoratorInfoType]:\n \"\"\"Build a new decorator.\n\n Args:\n cls_: The class.\n cls_var_name: The decorated function name.\n shim: A wrapper function to wrap V1 style function.\n info: The decorator info.\n\n Returns:\n The new decorator instance.\n \"\"\"\n func = get_attribute_from_bases(cls_, cls_var_name)\n if shim is not None:\n func = shim(func)\n func = unwrap_wrapped_function(func, unwrap_partial=False)\n if not callable(func):\n # This branch will get hit for classmethod properties\n attribute = get_attribute_from_base_dicts(cls_, cls_var_name) # prevents the binding call to `__get__`\n if isinstance(attribute, PydanticDescriptorProxy):\n func = unwrap_wrapped_function(attribute.wrapped)\n return Decorator(\n cls_ref=get_type_ref(cls_),\n cls_var_name=cls_var_name,\n func=func,\n shim=shim,\n info=info,\n )\n\n def bind_to_cls(self, cls: Any) -> Decorator[DecoratorInfoType]:\n \"\"\"Bind the decorator to a class.\n\n Args:\n cls: the class.\n\n Returns:\n The new decorator instance.\n \"\"\"\n return self.build(\n cls,\n cls_var_name=self.cls_var_name,\n shim=self.shim,\n info=self.info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_get_bases_mro.return._tp_mro_for_bases_bas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_bases_mro.return._tp_mro_for_bases_bas", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 313, "span_ids": ["get_bases", "mro"], "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 get_bases(tp: type[Any]) -> tuple[type[Any], ...]:\n \"\"\"Get the base classes of a class or typeddict.\n\n Args:\n tp: The type or class to get the bases.\n\n Returns:\n The base classes.\n \"\"\"\n if is_typeddict(tp):\n return tp.__orig_bases__ # type: ignore\n try:\n return tp.__bases__\n except AttributeError:\n return ()\n\n\ndef mro(tp: type[Any]) -> tuple[type[Any], ...]:\n \"\"\"Calculate the Method Resolution Order of bases using the C3 algorithm.\n\n See https://www.python.org/download/releases/2.3/mro/\n \"\"\"\n # try to use the existing mro, for performance mainly\n # but also because it helps verify the implementation below\n if not is_typeddict(tp):\n try:\n return tp.__mro__\n except AttributeError:\n # GenericAlias and some other cases\n pass\n\n bases = get_bases(tp)\n return (tp,) + mro_for_bases(bases)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_mro_for_bases__sentinel.object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_mro_for_bases__sentinel.object_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 338, "span_ids": ["impl:10", "mro_for_bases"], "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 mro_for_bases(bases: tuple[type[Any], ...]) -> tuple[type[Any], ...]:\n def merge_seqs(seqs: list[deque[type[Any]]]) -> Iterable[type[Any]]:\n while True:\n non_empty = [seq for seq in seqs if seq]\n if not non_empty:\n # Nothing left to process, we're done.\n return\n candidate: type[Any] | None = None\n for seq in non_empty: # Find merge candidates among seq heads.\n candidate = seq[0]\n not_head = [s for s in non_empty if candidate in islice(s, 1, None)]\n if not_head:\n # Reject the candidate.\n candidate = None\n else:\n break\n if not candidate:\n raise TypeError('Inconsistent hierarchy, no C3 MRO is possible')\n yield candidate\n for seq in non_empty:\n # Remove candidate.\n if seq[0] == candidate:\n seq.popleft()\n\n seqs = [deque(mro(base)) for base in bases] + [deque(bases)]\n return tuple(merge_seqs(seqs))\n\n\n_sentinel = 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/pydantic/_internal/_decorators.py_get_attribute_from_bases_get_attribute_from_bases.if_isinstance_tp_tuple_.else_.try_.except_AttributeError_.return.get_attribute_from_bases_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_attribute_from_bases_get_attribute_from_bases.if_isinstance_tp_tuple_.else_.try_.except_AttributeError_.return.get_attribute_from_bases_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 347, "end_line": 379, "span_ids": ["get_attribute_from_bases"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_attribute_from_bases(tp: type[Any] | tuple[type[Any], ...], name: str) -> Any:\n \"\"\"Get the attribute from the next class in the MRO that has it,\n aiming to simulate calling the method on the actual class.\n\n The reason for iterating over the mro instead of just getting\n the attribute (which would do that for us) is to support TypedDict,\n which lacks a real __mro__, but can have a virtual one constructed\n from its bases (as done here).\n\n Args:\n tp: The type or class to search for the attribute. If a tuple, this is treated as a set of base classes.\n name: The name of the attribute to retrieve.\n\n Returns:\n Any: The attribute value, if found.\n\n Raises:\n AttributeError: If the attribute is not found in any class in the MRO.\n \"\"\"\n if isinstance(tp, tuple):\n for base in mro_for_bases(tp):\n attribute = base.__dict__.get(name, _sentinel)\n if attribute is not _sentinel:\n attribute_get = getattr(attribute, '__get__', None)\n if attribute_get is not None:\n return attribute_get(None, tp)\n return attribute\n raise AttributeError(f'{name} not found in {tp}')\n else:\n try:\n return getattr(tp, name)\n except AttributeError:\n return get_attribute_from_bases(mro(tp), 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/_internal/_decorators.py_get_attribute_from_base_dicts_get_attribute_from_base_dicts._raise_the_error": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_get_attribute_from_base_dicts_get_attribute_from_base_dicts._raise_the_error", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 382, "end_line": 400, "span_ids": ["get_attribute_from_base_dicts"], "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 get_attribute_from_base_dicts(tp: type[Any], name: str) -> Any:\n \"\"\"Get an attribute out of the `__dict__` following the MRO.\n This prevents the call to `__get__` on the descriptor, and allows\n us to get the original function for classmethod properties.\n\n Args:\n tp: The type or class to search for the attribute.\n name: The name of the attribute to retrieve.\n\n Returns:\n Any: The attribute value, if found.\n\n Raises:\n KeyError: If the attribute is not found in any class's `__dict__` in the MRO.\n \"\"\"\n for base in reversed(mro(tp)):\n if name in base.__dict__:\n return base.__dict__[name]\n return tp.__dict__[name] # raise the 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/pydantic/_internal/_decorators.py_inspect_field_serializer_inspect_field_serializer.if_info_arg_and_computed_.else_.return.is_field_serializer_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py_inspect_field_serializer_inspect_field_serializer.if_info_arg_and_computed_.else_.return.is_field_serializer_info", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_decorators.py", "file_name": "_decorators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 547, "end_line": 587, "span_ids": ["inspect_field_serializer"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def inspect_field_serializer(\n serializer: Callable[..., Any], mode: Literal['plain', 'wrap'], computed_field: bool = False\n) -> tuple[bool, bool]:\n \"\"\"Look at a field serializer function and determine if it is a field serializer,\n and whether it takes an info argument.\n\n An error is raised if the function has an invalid signature.\n\n Args:\n serializer: The serializer function to inspect.\n mode: The serializer mode, either 'plain' or 'wrap'.\n computed_field: When serializer is applied on computed_field. It doesn't require\n info signature.\n\n Returns:\n Tuple of (is_field_serializer, info_arg).\n \"\"\"\n sig = signature(serializer)\n\n first = next(iter(sig.parameters.values()), None)\n is_field_serializer = first is not None and first.name == 'self'\n\n n_positional = count_positional_params(sig)\n if is_field_serializer:\n # -1 to correct for self parameter\n info_arg = _serializer_info_arg(mode, n_positional - 1)\n else:\n info_arg = _serializer_info_arg(mode, n_positional)\n\n if info_arg is None:\n raise PydanticUserError(\n f'Unrecognized field_serializer function signature for {serializer} with `mode={mode}`:{sig}',\n code='field-serializer-signature',\n )\n if info_arg and computed_field:\n raise PydanticUserError(\n 'field_serializer on computed_field does not use info signature', code='field-serializer-signature'\n )\n\n else:\n return is_field_serializer, info_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/_discriminated_union.py_apply_discriminator_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_apply_discriminator_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": 63, "end_line": 99, "span_ids": ["apply_discriminator"], "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 apply_discriminator(\n schema: core_schema.CoreSchema,\n discriminator: str | Discriminator,\n definitions: dict[str, core_schema.CoreSchema] | None = None,\n) -> core_schema.CoreSchema:\n \"\"\"Applies the discriminator and returns a new core schema.\n\n Args:\n schema: The input schema.\n discriminator: The name of the field which will serve as the discriminator.\n definitions: A mapping of schema ref to schema.\n\n Returns:\n The new core schema.\n\n Raises:\n TypeError:\n - If `discriminator` is used with invalid union variant.\n - If `discriminator` is used with `Union` type with one variant.\n - If `discriminator` value mapped to multiple choices.\n MissingDefinitionForUnionRef:\n If the definition for ref is missing.\n PydanticUserError:\n - If a model in union doesn't have a discriminator field.\n - If discriminator field has a non-string alias.\n - If discriminator fields have different aliases.\n - If discriminator field not of type `Literal`.\n \"\"\"\n from ..types import Discriminator\n\n if isinstance(discriminator, Discriminator):\n if isinstance(discriminator.discriminator, str):\n discriminator = discriminator.discriminator\n else:\n return discriminator._convert_schema(schema)\n\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/_fields.py__Private_logic_related__if_TYPE_CHECKING_.DecoratorInfos": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py__Private_logic_related__if_TYPE_CHECKING_.DecoratorInfos", "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": 27, "span_ids": ["docstring"], "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": "\"\"\"Private logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport sys\nimport warnings\nfrom copy import copy\nfrom functools import lru_cache\nfrom typing import TYPE_CHECKING, Any\n\nfrom pydantic_core import PydanticUndefined\n\nfrom pydantic.errors import PydanticUserError\n\nfrom . import _typing_extra\nfrom ._config import ConfigWrapper\nfrom ._docs_extraction import extract_docstrings_from_cls\nfrom ._repr import Representation\nfrom ._typing_extra import get_cls_type_hints_lenient, get_type_hints, is_classvar, is_finalvar\n\nif TYPE_CHECKING:\n from annotated_types import BaseMetadata\n\n from ..fields import FieldInfo\n from ..main import BaseModel\n from ._dataclasses import StandardDataclass\n from ._decorators import DecoratorInfos", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 27, "end_line": 53, "span_ids": ["get_type_hints_infer_globalns"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_type_hints_infer_globalns(\n obj: Any,\n localns: dict[str, Any] | None = None,\n include_extras: bool = False,\n) -> dict[str, Any]:\n \"\"\"Gets type hints for an object by inferring the global namespace.\n\n It uses the `typing.get_type_hints`, The only thing that we do here is fetching\n global namespace from `obj.__module__` if it is not `None`.\n\n Args:\n obj: The object to get its type hints.\n localns: The local namespaces.\n include_extras: Whether to recursively include annotation metadata.\n\n Returns:\n The object type hints.\n \"\"\"\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/_forward_ref.py_from___future___import_an_": {"__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_", "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": 24, "span_ids": ["PydanticRecursiveRef.__or__", "imports", "PydanticRecursiveRef.__ror__", "PydanticRecursiveRef.__call__", "PydanticRecursiveRef"], "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": "from __future__ import annotations as _annotations\n\nfrom dataclasses import dataclass\nfrom typing import Union\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 \"\"\"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 __or__(self, other):\n return Union[self, other] # type: ignore\n\n def __ror__(self, other):\n return Union[other, self] # 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/_internal/_generate_schema.py_modify_model_json_schema_JsonEncoders.Dict_Type_Any_JsonEncod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_modify_model_json_schema_JsonEncoders.Dict_Type_Any_JsonEncod", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 233, "span_ids": ["modify_model_json_schema", "impl:26"], "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 modify_model_json_schema(\n schema_or_field: CoreSchemaOrField, handler: GetJsonSchemaHandler, *, cls: Any\n) -> JsonSchemaValue:\n \"\"\"Add title and description for model-like classes' JSON schema.\n\n Args:\n schema_or_field: The schema data to generate a JSON schema from.\n handler: The `GetCoreSchemaHandler` instance.\n cls: The model-like class.\n\n Returns:\n JsonSchemaValue: The updated JSON schema.\n \"\"\"\n from ..main import BaseModel\n\n json_schema = handler(schema_or_field)\n original_schema = handler.resolve_ref_schema(json_schema)\n # Preserve the fact that definitions schemas should never have sibling keys:\n if '$ref' in original_schema:\n ref = original_schema['$ref']\n original_schema.clear()\n original_schema['allOf'] = [{'$ref': ref}]\n if 'title' not in original_schema:\n original_schema['title'] = cls.__name__\n # BaseModel; don't use cls.__doc__ as it will contain the verbose class signature by default\n docstring = None if cls is BaseModel else cls.__doc__\n if docstring and 'description' not in original_schema:\n original_schema['description'] = inspect.cleandoc(docstring)\n return json_schema\n\n\nJsonEncoders = Dict[Type[Any], JsonEncoder]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__add_custom_serialization_from_json_encoders__add_custom_serialization_from_json_encoders.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__add_custom_serialization_from_json_encoders__add_custom_serialization_from_json_encoders.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": 230, "end_line": 261, "span_ids": ["_add_custom_serialization_from_json_encoders"], "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 _add_custom_serialization_from_json_encoders(\n json_encoders: JsonEncoders | None, tp: Any, schema: CoreSchema\n) -> CoreSchema:\n \"\"\"Iterate over the json_encoders and add the first matching encoder to the schema.\n\n Args:\n json_encoders: A dictionary of types and their encoder functions.\n tp: The type to check for a matching encoder.\n schema: The schema to add the encoder to.\n \"\"\"\n if not json_encoders:\n return schema\n if 'serialization' in schema:\n return schema\n # Check the class type and its superclasses for a matching encoder\n # Decimal.__class__.__mro__ (and probably other cases) doesn't include Decimal itself\n # if the type is a GenericAlias (e.g. from list[int]) we need to use __class__ instead of .__mro__\n for base in (tp, *getattr(tp, '__mro__', tp.__class__.__mro__)[:-1]):\n encoder = json_encoders.get(base)\n if encoder is None:\n continue\n\n warnings.warn(\n f'`json_encoders` is deprecated. See https://docs.pydantic.dev/{version_short()}/concepts/serialization/#custom-serializers for alternatives',\n PydanticDeprecatedSince20,\n )\n\n # TODO: in theory we should check that the schema accepts a serialization key\n schema['serialization'] = core_schema.plain_serializer_function_ser_schema(encoder, when_used='json')\n return 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_GenerateSchema.__init__.self.defs._Definitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema_GenerateSchema.__init__.self.defs._Definitions_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 306, "end_line": 328, "span_ids": ["GenerateSchema", "GenerateSchema.__init__"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n \"\"\"Generate core schema for a Pydantic model, dataclass and types like `str`, `datetime`, ... .\"\"\"\n\n __slots__ = (\n '_config_wrapper_stack',\n '_types_namespace_stack',\n '_typevars_map',\n 'field_name_stack',\n 'defs',\n )\n\n def __init__(\n self,\n config_wrapper: ConfigWrapper,\n types_namespace: dict[str, Any] | None,\n typevars_map: dict[Any, Any] | None = None,\n ) -> None:\n # we need a stack for recursing into child models\n self._config_wrapper_stack = ConfigWrapperStack(config_wrapper)\n self._types_namespace_stack = TypesNamespaceStack(types_namespace)\n self._typevars_map = typevars_map\n self.field_name_stack = _FieldNameStack()\n self.defs = _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/_generate_schema.py_GenerateSchema.__from_parent_GenerateSchema.__from_parent.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.__from_parent_GenerateSchema.__from_parent.return.obj", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 330, "end_line": 344, "span_ids": ["GenerateSchema.__from_parent"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n @classmethod\n def __from_parent(\n cls,\n config_wrapper_stack: ConfigWrapperStack,\n types_namespace_stack: TypesNamespaceStack,\n typevars_map: dict[Any, Any] | None,\n defs: _Definitions,\n ) -> GenerateSchema:\n obj = cls.__new__(cls)\n obj._config_wrapper_stack = config_wrapper_stack\n obj._types_namespace_stack = types_namespace_stack\n obj._typevars_map = typevars_map\n obj.field_name_stack = _FieldNameStack()\n obj.defs = defs\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._arbitrary_type_schema_GenerateSchema._arbitrary_type_schema.return.core_schema_is_instance_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._arbitrary_type_schema_GenerateSchema._arbitrary_type_schema.return.core_schema_is_instance_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": 353, "end_line": 363, "span_ids": ["GenerateSchema._arbitrary_type_schema"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _arbitrary_type_schema(self, tp: Any) -> CoreSchema:\n if not isinstance(tp, type):\n warn(\n f'{tp!r} is not a Python type (it may be an instance of an object),'\n ' Pydantic will allow any object with no validation since we cannot even'\n ' enforce that the input is an instance of the given type.'\n ' To get rid of this error wrap the type with `pydantic.SkipValidation`.',\n UserWarning,\n )\n return core_schema.any_schema()\n return core_schema.is_instance_schema(tp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._unknown_type_schema_GenerateSchema._unknown_type_schema.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._unknown_type_schema_GenerateSchema._unknown_type_schema.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": 365, "end_line": 374, "span_ids": ["GenerateSchema._unknown_type_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 _unknown_type_schema(self, obj: Any) -> CoreSchema:\n raise PydanticSchemaGenerationError(\n f'Unable to generate pydantic-core schema for {obj!r}. '\n 'Set `arbitrary_types_allowed=True` in the model_config to ignore this error'\n ' or implement `__get_pydantic_core_schema__` on your type to fully support it.'\n '\\n\\nIf you got this error by calling handler() within'\n ' `__get_pydantic_core_schema__` then you likely need to call'\n ' `handler.generate_schema()` since we do not call'\n ' `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.'\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._add_js_function_GenerateSchema._add_js_function.if_js_function_not_in_pyd.pydantic_js_functions_app": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._add_js_function_GenerateSchema._add_js_function.if_js_function_not_in_pyd.pydantic_js_functions_app", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 422, "end_line": 431, "span_ids": ["GenerateSchema._add_js_function"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _add_js_function(self, metadata_schema: CoreSchema, js_function: Callable[..., Any]) -> None:\n metadata = CoreMetadataHandler(metadata_schema).metadata\n pydantic_js_functions = metadata.setdefault('pydantic_js_functions', [])\n # because of how we generate core schemas for nested generic models\n # we can end up adding `BaseModel.__get_pydantic_json_schema__` multiple times\n # this check may fail to catch duplicates if the function is a `functools.partial`\n # or something like that\n # but if it does it'll fail by inserting the duplicate\n if js_function not in pydantic_js_functions:\n pydantic_js_functions.append(js_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/_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": 461, "end_line": 506, "span_ids": ["GenerateSchema.generate_schema"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def generate_schema(\n self,\n obj: Any,\n from_dunder_get_core_schema: bool = True,\n ) -> core_schema.CoreSchema:\n \"\"\"Generate core schema.\n\n Args:\n obj: The object to generate core schema for.\n from_dunder_get_core_schema: Whether to generate schema from either the\n `__get_pydantic_core_schema__` function or `__pydantic_core_schema__` property.\n\n Returns:\n The generated core schema.\n\n Raises:\n PydanticUndefinedAnnotation:\n If it is not possible to evaluate forward reference.\n PydanticSchemaGenerationError:\n If it is not possible to generate pydantic-core schema.\n TypeError:\n - If `alias_generator` returns a disallowed type (must be str, AliasPath or AliasChoices).\n - If V1 style validator with `each_item=True` applied on a wrong field.\n PydanticUserError:\n - If `typing.TypedDict` is used instead of `typing_extensions.TypedDict` on Python < 3.12.\n - If `__modify_schema__` method is used instead of `__get_pydantic_json_schema__`.\n \"\"\"\n schema: CoreSchema | None = None\n\n if from_dunder_get_core_schema:\n from_property = self._generate_schema_from_property(obj, obj)\n if from_property is not None:\n schema = from_property\n\n if schema is None:\n schema = self._generate_schema_inner(obj)\n\n metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)\n if metadata_js_function is not None:\n metadata_schema = resolve_original_schema(schema, self.defs.definitions)\n if metadata_schema:\n self._add_js_function(metadata_schema, metadata_js_function)\n\n schema = _add_custom_serialization_from_json_encoders(self._config_wrapper.json_encoders, obj, 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.with_self_defs_get_schema.with_self__config_wrapper.return.core_schema_definition_re": {"__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.with_self_defs_get_schema.with_self__config_wrapper.return.core_schema_definition_re", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 508, "end_line": 602, "span_ids": ["GenerateSchema._model_schema"], "tokens": 864}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"Generate schema for a Pydantic model.\"\"\"\n with self.defs.get_schema_or_ref(cls) as (model_ref, maybe_schema):\n if maybe_schema is not None:\n return maybe_schema\n\n fields = cls.model_fields\n decorators = cls.__pydantic_decorators__\n computed_fields = decorators.computed_fields\n check_decorator_fields_exist(\n chain(\n decorators.field_validators.values(),\n decorators.field_serializers.values(),\n decorators.validators.values(),\n ),\n {*fields.keys(), *computed_fields.keys()},\n )\n config_wrapper = ConfigWrapper(cls.model_config, check=False)\n core_config = config_wrapper.core_config(cls)\n metadata = build_metadata_dict(js_functions=[partial(modify_model_json_schema, cls=cls)])\n\n model_validators = decorators.model_validators.values()\n\n extras_schema = None\n if core_config.get('extra_fields_behavior') == 'allow':\n assert cls.__mro__[0] is cls\n assert cls.__mro__[-1] is object\n for candidate_cls in cls.__mro__[:-1]:\n extras_annotation = candidate_cls.__annotations__.get('__pydantic_extra__', None)\n if extras_annotation is not None:\n if isinstance(extras_annotation, str):\n extras_annotation = _typing_extra.eval_type_backport(\n _typing_extra._make_forward_ref(extras_annotation, is_argument=False, is_class=True),\n self._types_namespace,\n )\n tp = get_origin(extras_annotation)\n if tp not in (Dict, dict):\n raise PydanticSchemaGenerationError(\n 'The type annotation for `__pydantic_extra__` must be `Dict[str, ...]`'\n )\n extra_items_type = self._get_args_resolving_forward_refs(\n extras_annotation,\n required=True,\n )[1]\n if extra_items_type is not Any:\n extras_schema = self.generate_schema(extra_items_type)\n break\n\n with self._config_wrapper_stack.push(config_wrapper), self._types_namespace_stack.push(cls):\n self = self._current_generate_schema\n if cls.__pydantic_root_model__:\n root_field = self._common_field_schema('root', fields['root'], decorators)\n inner_schema = root_field['schema']\n inner_schema = apply_model_validators(inner_schema, model_validators, 'inner')\n model_schema = core_schema.model_schema(\n cls,\n inner_schema,\n custom_init=getattr(cls, '__pydantic_custom_init__', None),\n root_model=True,\n post_init=getattr(cls, '__pydantic_post_init__', None),\n config=core_config,\n ref=model_ref,\n metadata=metadata,\n )\n else:\n fields_schema: core_schema.CoreSchema = core_schema.model_fields_schema(\n {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},\n computed_fields=[\n self._computed_field_schema(d, decorators.field_serializers)\n for d in computed_fields.values()\n ],\n extras_schema=extras_schema,\n model_name=cls.__name__,\n )\n inner_schema = apply_validators(fields_schema, decorators.root_validators.values(), None)\n new_inner_schema = define_expected_missing_refs(inner_schema, recursively_defined_type_refs())\n if new_inner_schema is not None:\n inner_schema = new_inner_schema\n inner_schema = apply_model_validators(inner_schema, model_validators, 'inner')\n\n model_schema = core_schema.model_schema(\n cls,\n inner_schema,\n custom_init=getattr(cls, '__pydantic_custom_init__', None),\n root_model=False,\n post_init=getattr(cls, '__pydantic_post_init__', None),\n config=core_config,\n ref=model_ref,\n metadata=metadata,\n )\n\n schema = self._apply_model_serializers(model_schema, decorators.model_serializers.values())\n schema = apply_model_validators(schema, model_validators, 'outer')\n self.defs.definitions[model_ref] = schema\n return core_schema.definition_reference_schema(model_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/_generate_schema.py_GenerateSchema._unpack_refs_defs_GenerateSchema._generate_schema_from_property.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._unpack_refs_defs_GenerateSchema._generate_schema_from_property.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": 604, "end_line": 666, "span_ids": ["GenerateSchema._unpack_refs_defs", "GenerateSchema._generate_schema_from_property"], "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 _unpack_refs_defs(self, schema: CoreSchema) -> CoreSchema:\n \"\"\"Unpack all 'definitions' schemas into `GenerateSchema.defs.definitions`\n and return the inner schema.\n \"\"\"\n\n def get_ref(s: CoreSchema) -> str:\n return s['ref'] # type: ignore\n\n if schema['type'] == 'definitions':\n self.defs.definitions.update({get_ref(s): s for s in schema['definitions']})\n schema = schema['schema']\n return schema\n\n def _generate_schema_from_property(self, obj: Any, source: Any) -> core_schema.CoreSchema | None:\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\n decide whether to use a `__pydantic_core_schema__` attribute, or generate a fresh schema.\n \"\"\"\n # avoid calling `__get_pydantic_core_schema__` if we've already visited this object\n with self.defs.get_schema_or_ref(obj) as (_, maybe_schema):\n if maybe_schema is not None:\n return maybe_schema\n if obj is source:\n ref_mode = 'unpack'\n else:\n ref_mode = 'to-def'\n\n schema: CoreSchema\n get_schema = getattr(obj, '__get_pydantic_core_schema__', None)\n if get_schema is None:\n validators = getattr(obj, '__get_validators__', None)\n if validators is None:\n return None\n warn(\n '`__get_validators__` is deprecated and will be removed, use `__get_pydantic_core_schema__` instead.',\n PydanticDeprecatedSince20,\n )\n schema = core_schema.chain_schema([core_schema.with_info_plain_validator_function(v) for v in validators()])\n else:\n if len(inspect.signature(get_schema).parameters) == 1:\n # (source) -> CoreSchema\n schema = get_schema(source)\n else:\n schema = get_schema(\n source, CallbackGetCoreSchemaHandler(self._generate_schema_inner, self, ref_mode=ref_mode)\n )\n\n schema = self._unpack_refs_defs(schema)\n\n if is_function_with_inner_schema(schema):\n ref = schema['schema'].pop('ref', None) # pyright: ignore[reportGeneralTypeIssues]\n if ref:\n schema['ref'] = ref\n else:\n ref = get_ref(schema)\n\n if ref:\n self.defs.definitions[ref] = schema\n return core_schema.definition_reference_schema(ref)\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._resolve_forward_ref_GenerateSchema._resolve_forward_ref.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._resolve_forward_ref_GenerateSchema._resolve_forward_ref.return.obj", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 668, "end_line": 688, "span_ids": ["GenerateSchema._resolve_forward_ref"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _resolve_forward_ref(self, obj: Any) -> Any:\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.eval_type_backport(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:\n obj = replace_types(obj, self._typevars_map)\n\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._generate_schema_inner_GenerateSchema._generate_schema_inner.return.self_match_type_obj_": {"__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_inner_GenerateSchema._generate_schema_inner.return.self_match_type_obj_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 705, "end_line": 727, "span_ids": ["GenerateSchema._generate_schema_inner"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _generate_schema_inner(self, obj: Any) -> core_schema.CoreSchema:\n if isinstance(obj, _AnnotatedType):\n return self._annotated_schema(obj)\n\n if isinstance(obj, dict):\n # we assume this is already a valid schema\n return obj # type: ignore[return-value]\n\n if isinstance(obj, str):\n obj = ForwardRef(obj)\n\n if isinstance(obj, ForwardRef):\n return self.generate_schema(self._resolve_forward_ref(obj))\n\n from ..main import BaseModel\n\n if lenient_issubclass(obj, BaseModel):\n return self._model_schema(obj)\n\n if isinstance(obj, PydanticRecursiveRef):\n return core_schema.definition_reference_schema(schema_ref=obj.type_ref)\n\n return self.match_type(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/_generate_schema.py_GenerateSchema.match_type_GenerateSchema.match_type.return.self__unknown_type_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema.match_type_GenerateSchema.match_type.return.self__unknown_type_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": 738, "end_line": 823, "span_ids": ["GenerateSchema.match_type"], "tokens": 820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def match_type(self, obj: Any) -> core_schema.CoreSchema: # noqa: C901\n \"\"\"Main mapping of types to schemas.\n\n The general structure is a series of if statements starting with the simple cases\n (non-generic primitive types) and then handling generics and other more complex cases.\n\n Each case either generates a schema directly, calls into a public user-overridable method\n (like `GenerateSchema.tuple_variable_schema`) or calls into a private method that handles some\n boilerplate before calling into the user-facing method (e.g. `GenerateSchema._tuple_schema`).\n\n The idea is that we'll evolve this into adding more and more user facing methods over time\n as they get requested and we figure out what the right API for them is.\n \"\"\"\n if obj is str:\n return self.str_schema()\n elif obj is bytes:\n return core_schema.bytes_schema()\n elif obj is int:\n return core_schema.int_schema()\n elif obj is float:\n return core_schema.float_schema()\n elif obj is bool:\n return core_schema.bool_schema()\n elif obj is Any or obj is object:\n return core_schema.any_schema()\n elif obj is None or obj is _typing_extra.NoneType:\n return core_schema.none_schema()\n elif obj in TUPLE_TYPES:\n return self._tuple_schema(obj)\n elif obj in LIST_TYPES:\n return self._list_schema(obj, self._get_first_arg_or_any(obj))\n elif obj in SET_TYPES:\n return self._set_schema(obj, self._get_first_arg_or_any(obj))\n elif obj in FROZEN_SET_TYPES:\n return self._frozenset_schema(obj, self._get_first_arg_or_any(obj))\n elif obj in DICT_TYPES:\n return self._dict_schema(obj, *self._get_first_two_args_or_any(obj))\n elif isinstance(obj, TypeAliasType):\n return self._type_alias_type_schema(obj)\n elif obj == type:\n return self._type_schema()\n elif _typing_extra.is_callable_type(obj):\n return core_schema.callable_schema()\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, None)\n elif _typing_extra.is_new_type(obj):\n # NewType, can't use isinstance because it fails <3.10\n return self.generate_schema(obj.__supertype__)\n elif obj == re.Pattern:\n return self._pattern_schema(obj)\n elif obj is collections.abc.Hashable or obj is typing.Hashable:\n return self._hashable_schema()\n elif isinstance(obj, typing.TypeVar):\n return self._unsubstituted_typevar_schema(obj)\n elif is_finalvar(obj):\n if obj is Final:\n return core_schema.any_schema()\n return self.generate_schema(\n self._get_first_arg_or_any(obj),\n )\n elif isinstance(obj, (FunctionType, LambdaType, MethodType, partial)):\n return self._callable_schema(obj)\n elif inspect.isclass(obj) and issubclass(obj, Enum):\n from ._std_types_schema import get_enum_core_schema\n\n return get_enum_core_schema(obj, self._config_wrapper.config_dict)\n\n if _typing_extra.is_dataclass(obj):\n return self._dataclass_schema(obj, None)\n\n res = self._get_prepare_pydantic_annotations_for_known_type(obj, ())\n if res is not None:\n source_type, annotations = res\n return self._apply_annotations(source_type, annotations)\n\n origin = get_origin(obj)\n if origin is not None:\n return self._match_generic_type(obj, origin)\n\n if self._arbitrary_types:\n return self._arbitrary_type_schema(obj)\n return self._unknown_type_schema(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/_generate_schema.py_GenerateSchema._match_generic_type_GenerateSchema._match_generic_type.return.self__unknown_type_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._match_generic_type_GenerateSchema._match_generic_type.return.self__unknown_type_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": 816, "end_line": 858, "span_ids": ["GenerateSchema._match_generic_type"], "tokens": 491}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _match_generic_type(self, obj: Any, origin: Any) -> CoreSchema: # noqa: C901\n if isinstance(origin, TypeAliasType):\n return self._type_alias_type_schema(obj)\n\n # Need to handle generic dataclasses before looking for the schema properties because attribute accesses\n # on _GenericAlias delegate to the origin type, so lose the information about the concrete parametrization\n # As a result, currently, there is no way to cache the schema for generic dataclasses. This may be possible\n # to resolve by modifying the value returned by `Generic.__class_getitem__`, but that is a dangerous game.\n if _typing_extra.is_dataclass(origin):\n return self._dataclass_schema(obj, origin)\n if _typing_extra.is_namedtuple(origin):\n return self._namedtuple_schema(obj, origin)\n\n from_property = self._generate_schema_from_property(origin, obj)\n if from_property is not None:\n return from_property\n\n if _typing_extra.origin_is_union(origin):\n return self._union_schema(obj)\n elif origin in TUPLE_TYPES:\n return self._tuple_schema(obj)\n elif origin in LIST_TYPES:\n return self._list_schema(obj, self._get_first_arg_or_any(obj))\n elif origin in SET_TYPES:\n return self._set_schema(obj, self._get_first_arg_or_any(obj))\n elif origin in FROZEN_SET_TYPES:\n return self._frozenset_schema(obj, self._get_first_arg_or_any(obj))\n elif origin in DICT_TYPES:\n return self._dict_schema(obj, *self._get_first_two_args_or_any(obj))\n elif is_typeddict(origin):\n return self._typed_dict_schema(obj, origin)\n elif origin in (typing.Type, type):\n return self._subclass_schema(obj)\n elif origin in {typing.Sequence, collections.abc.Sequence}:\n return self._sequence_schema(obj)\n elif origin in {typing.Iterable, collections.abc.Iterable, typing.Generator, collections.abc.Generator}:\n return self._iterable_schema(obj)\n elif origin in (re.Pattern, typing.Pattern):\n return self._pattern_schema(obj)\n\n if self._arbitrary_types:\n return self._arbitrary_type_schema(origin)\n return self._unknown_type_schema(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/_generate_schema.py_GenerateSchema._typed_dict_schema_GenerateSchema._typed_dict_schema.FieldInfo": {"__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.FieldInfo", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1086, "end_line": 1102, "span_ids": ["GenerateSchema._typed_dict_schema"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _typed_dict_schema(self, typed_dict_cls: Any, origin: Any) -> core_schema.CoreSchema:\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\n On 3.11 but < 3.12 TypedDict does not preserve inheritance information.\n\n Hence to avoid creating validators that do not do what users expect we only\n support typing.TypedDict on Python >= 3.12 or typing_extension.TypedDict on all versions\n \"\"\"\n from ..fields import FieldInfo\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._typed_dict_schema.with_self_defs_get_schema_GenerateSchema._typed_dict_schema.with_self_defs_get_schema.with_self__config_wrapper.return.core_schema_definition_re": {"__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.with_self_defs_get_schema_GenerateSchema._typed_dict_schema.with_self_defs_get_schema.with_self__config_wrapper.return.core_schema_definition_re", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1202, "end_line": 1285, "span_ids": ["GenerateSchema._typed_dict_schema"], "tokens": 706}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _typed_dict_schema(self, typed_dict_cls: Any, origin: Any) -> core_schema.CoreSchema:\n # ... other code\n\n with self.defs.get_schema_or_ref(typed_dict_cls) as (typed_dict_ref, maybe_schema):\n if maybe_schema is not None:\n return maybe_schema\n\n typevars_map = get_standard_typevars_map(typed_dict_cls)\n if origin is not None:\n typed_dict_cls = origin\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.12.',\n code='typed-dict-version',\n )\n\n try:\n config: ConfigDict | None = get_attribute_from_bases(typed_dict_cls, '__pydantic_config__')\n except AttributeError:\n config = None\n\n with self._config_wrapper_stack.push(config), self._types_namespace_stack.push(typed_dict_cls):\n core_config = self._config_wrapper.core_config(typed_dict_cls)\n\n self = self._current_generate_schema\n\n required_keys: frozenset[str] = typed_dict_cls.__required_keys__\n\n fields: dict[str, core_schema.TypedDictField] = {}\n\n decorators = DecoratorInfos.build(typed_dict_cls)\n\n if self._config_wrapper.use_attribute_docstrings:\n field_docstrings = extract_docstrings_from_cls(typed_dict_cls, use_inspect=True)\n else:\n field_docstrings = None\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, typevars_map)\n required = field_name in required_keys\n\n if get_origin(annotation) == _typing_extra.Required:\n required = True\n annotation = self._get_args_resolving_forward_refs(\n annotation,\n required=True,\n )[0]\n elif get_origin(annotation) == _typing_extra.NotRequired:\n required = False\n annotation = self._get_args_resolving_forward_refs(\n annotation,\n required=True,\n )[0]\n\n field_info = FieldInfo.from_annotation(annotation)\n if (\n field_docstrings is not None\n and field_info.description is None\n and field_name in field_docstrings\n ):\n field_info.description = field_docstrings[field_name]\n fields[field_name] = self._generate_td_field_schema(\n field_name, field_info, decorators, required=required\n )\n\n metadata = build_metadata_dict(\n js_functions=[partial(modify_model_json_schema, cls=typed_dict_cls)], typed_dict_cls=typed_dict_cls\n )\n\n td_schema = core_schema.typed_dict_schema(\n fields,\n computed_fields=[\n self._computed_field_schema(d, decorators.field_serializers)\n for d in decorators.computed_fields.values()\n ],\n ref=typed_dict_ref,\n metadata=metadata,\n config=core_config,\n )\n\n schema = self._apply_model_serializers(td_schema, decorators.model_serializers.values())\n schema = apply_model_validators(schema, decorators.model_validators.values(), 'all')\n self.defs.definitions[typed_dict_ref] = schema\n return core_schema.definition_reference_schema(typed_dict_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/_generate_schema.py_GenerateSchema._namedtuple_schema_GenerateSchema._namedtuple_schema.with_self_defs_get_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.with_self_defs_get_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": 1178, "end_line": 1209, "span_ids": ["GenerateSchema._namedtuple_schema"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _namedtuple_schema(self, namedtuple_cls: Any, origin: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for a NamedTuple.\"\"\"\n with self.defs.get_schema_or_ref(namedtuple_cls) as (namedtuple_ref, maybe_schema):\n if maybe_schema is not None:\n return maybe_schema\n typevars_map = get_standard_typevars_map(namedtuple_cls)\n if origin is not None:\n namedtuple_cls = origin\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 if typevars_map:\n annotations = {\n field_name: replace_types(annotation, typevars_map)\n for field_name, annotation in annotations.items()\n }\n\n arguments_schema = core_schema.arguments_schema(\n [\n self._generate_parameter_schema(\n field_name, annotation, default=namedtuple_cls._field_defaults.get(field_name, Parameter.empty)\n )\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, ref=namedtuple_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/_generate_schema.py_GenerateSchema._type_schema_GenerateSchema._union_is_subclass_schema.return.core_schema_union_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._type_schema_GenerateSchema._union_is_subclass_schema.return.core_schema_union_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": 1274, "end_line": 1284, "span_ids": ["GenerateSchema._union_is_subclass_schema", "GenerateSchema._type_schema"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\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 )\n\n def _union_is_subclass_schema(self, union_type: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for `Type[Union[X, ...]]`.\"\"\"\n args = self._get_args_resolving_forward_refs(union_type, required=True)\n return core_schema.union_schema([self.generate_schema(typing.Type[args]) for args in 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/_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": 1286, "end_line": 1305, "span_ids": ["GenerateSchema._subclass_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": "class GenerateSchema:\n\n def _subclass_schema(self, type_: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for a Type, e.g. `Type[int]`.\"\"\"\n type_param = self._get_first_arg_or_any(type_)\n if type_param == Any:\n return self._type_schema()\n elif isinstance(type_param, typing.TypeVar):\n if type_param.__bound__:\n if _typing_extra.origin_is_union(get_origin(type_param.__bound__)):\n return self._union_is_subclass_schema(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 elif _typing_extra.origin_is_union(get_origin(type_param)):\n return self._union_is_subclass_schema(type_param)\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._unsubstituted_typevar_schema_GenerateSchema._unsubstituted_typevar_schema.if_default_is_not_None_.else_.return.core_schema_any_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._unsubstituted_typevar_schema_GenerateSchema._unsubstituted_typevar_schema.if_default_is_not_None_.else_.return.core_schema_any_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": 1485, "end_line": 1508, "span_ids": ["GenerateSchema._unsubstituted_typevar_schema"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _unsubstituted_typevar_schema(self, typevar: typing.TypeVar) -> core_schema.CoreSchema:\n assert isinstance(typevar, typing.TypeVar)\n\n bound = typevar.__bound__\n constraints = typevar.__constraints__\n default = getattr(typevar, '__default__', None)\n\n if (bound is not None) + (len(constraints) != 0) + (default is not None) > 1:\n raise NotImplementedError(\n 'Pydantic does not support mixing more than one of TypeVar bounds, constraints and defaults'\n )\n\n if default is not None:\n return self.generate_schema(default)\n elif constraints:\n return self._union_schema(typing.Union[constraints]) # type: ignore\n elif bound:\n schema = self.generate_schema(bound)\n schema['serialization'] = core_schema.wrap_serializer_function_ser_schema(\n lambda x, h: h(x), schema=core_schema.any_schema()\n )\n return schema\n else:\n return core_schema.any_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._annotated_schema_GenerateSchema._annotated_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._annotated_schema_GenerateSchema._annotated_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": 1568, "end_line": 1582, "span_ids": ["GenerateSchema._annotated_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": "class GenerateSchema:\n\n def _annotated_schema(self, annotated_type: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for an Annotated type, e.g. `Annotated[int, Field(...)]` or `Annotated[int, Gt(0)]`.\"\"\"\n from ..fields import FieldInfo\n\n source_type, *annotations = self._get_args_resolving_forward_refs(\n annotated_type,\n required=True,\n )\n schema = self._apply_annotations(source_type, annotations)\n # put the default validator last so that TypeAdapter.get_default_value() works\n # even if there are function validators involved\n for annotation in annotations:\n if isinstance(annotation, FieldInfo):\n schema = wrap_default(annotation, 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_GenerateSchema._get_prepare_pydantic_annotations_for_known_type_GenerateSchema._get_prepare_pydantic_annotations_for_known_type.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._get_prepare_pydantic_annotations_for_known_type_GenerateSchema._get_prepare_pydantic_annotations_for_known_type.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": 1645, "end_line": 1662, "span_ids": ["GenerateSchema._get_prepare_pydantic_annotations_for_known_type"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _get_prepare_pydantic_annotations_for_known_type(\n self, obj: Any, annotations: tuple[Any, ...]\n ) -> tuple[Any, list[Any]] | None:\n from ._std_types_schema import PREPARE_METHODS\n\n # Check for hashability\n try:\n hash(obj)\n except TypeError:\n # obj is definitely not a known type if this fails\n return None\n\n for gen in PREPARE_METHODS:\n res = gen(obj, annotations, self._config_wrapper.config_dict)\n if res is not None:\n return res\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._apply_annotations_GenerateSchema._apply_annotations.pydantic_js_annotation_functions._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_annotations_GenerateSchema._apply_annotations.pydantic_js_annotation_functions._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1603, "end_line": 1620, "span_ids": ["GenerateSchema._apply_annotations"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _apply_annotations(\n self,\n source_type: Any,\n annotations: list[Any],\n transform_inner_schema: Callable[[CoreSchema], CoreSchema] = lambda x: x,\n ) -> CoreSchema:\n \"\"\"Apply arguments from `Annotated` or from `FieldInfo` to a schema.\n\n This gets called by `GenerateSchema._annotated_schema` but differs from it in that it does\n not expect `source_type` to be an `Annotated` object, it expects it to be the first argument of that\n (in other words, `GenerateSchema._annotated_schema` just unpacks `Annotated`, this process it).\n \"\"\"\n annotations = list(_known_annotated_metadata.expand_grouped_metadata(annotations))\n res = self._get_prepare_pydantic_annotations_for_known_type(source_type, tuple(annotations))\n if res is not None:\n source_type, annotations = res\n\n pydantic_js_annotation_functions: list[GetJsonSchemaFunction] = []\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._apply_annotations.get_inner_schema_GenerateSchema._apply_annotations.return._add_custom_serialization": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_annotations.get_inner_schema_GenerateSchema._apply_annotations.return._add_custom_serialization", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1635, "end_line": 1648, "span_ids": ["GenerateSchema._apply_annotations"], "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 GenerateSchema:\n\n def _apply_annotations(\n self,\n source_type: Any,\n annotations: list[Any],\n transform_inner_schema: Callable[[CoreSchema], CoreSchema] = lambda x: x,\n ) -> CoreSchema:\n # ... other code\n\n get_inner_schema = CallbackGetCoreSchemaHandler(inner_handler, self)\n\n for annotation in annotations:\n if annotation is None:\n continue\n get_inner_schema = self._get_wrapped_inner_schema(\n get_inner_schema, annotation, pydantic_js_annotation_functions\n )\n\n schema = get_inner_schema(source_type)\n if pydantic_js_annotation_functions:\n metadata = CoreMetadataHandler(schema).metadata\n metadata.setdefault('pydantic_js_annotation_functions', []).extend(pydantic_js_annotation_functions)\n return _add_custom_serialization_from_json_encoders(self._config_wrapper.json_encoders, source_type, 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._apply_single_annotation_GenerateSchema._apply_single_annotation.return.original_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_single_annotation_GenerateSchema._apply_single_annotation.return.original_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": 1650, "end_line": 1690, "span_ids": ["GenerateSchema._apply_single_annotation"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _apply_single_annotation(self, schema: core_schema.CoreSchema, metadata: Any) -> core_schema.CoreSchema:\n from ..fields import FieldInfo\n\n if isinstance(metadata, FieldInfo):\n for field_metadata in metadata.metadata:\n schema = self._apply_single_annotation(schema, field_metadata)\n\n if metadata.discriminator is not None:\n schema = self._apply_discriminator_to_union(schema, metadata.discriminator)\n return schema\n\n if schema['type'] == 'nullable':\n # for nullable schemas, metadata is automatically applied to the inner schema\n inner = schema.get('schema', core_schema.any_schema())\n inner = self._apply_single_annotation(inner, metadata)\n if inner:\n schema['schema'] = inner\n return schema\n\n original_schema = schema\n ref = schema.get('ref', None)\n if ref is not None:\n schema = schema.copy()\n new_ref = ref + f'_{repr(metadata)}'\n if new_ref in self.defs.definitions:\n return self.defs.definitions[new_ref]\n schema['ref'] = new_ref # type: ignore\n elif schema['type'] == 'definition-ref':\n ref = schema['schema_ref']\n if ref in self.defs.definitions:\n schema = self.defs.definitions[ref].copy()\n new_ref = ref + f'_{repr(metadata)}'\n if new_ref in self.defs.definitions:\n return self.defs.definitions[new_ref]\n schema['ref'] = new_ref # type: ignore\n\n maybe_updated_schema = _known_annotated_metadata.apply_known_metadata(metadata, schema.copy())\n\n if maybe_updated_schema is not None:\n return maybe_updated_schema\n return original_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._apply_single_annotation_json_schema_GenerateSchema._apply_single_annotation_json_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._apply_single_annotation_json_schema_GenerateSchema._apply_single_annotation_json_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": 1753, "end_line": 1774, "span_ids": ["GenerateSchema._apply_single_annotation_json_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 GenerateSchema:\n\n def _apply_single_annotation_json_schema(\n self, schema: core_schema.CoreSchema, metadata: Any\n ) -> core_schema.CoreSchema:\n from ..fields import FieldInfo\n\n if isinstance(metadata, FieldInfo):\n for field_metadata in metadata.metadata:\n schema = self._apply_single_annotation_json_schema(schema, field_metadata)\n json_schema_update: JsonSchemaValue = {}\n if metadata.title:\n json_schema_update['title'] = metadata.title\n if metadata.description:\n json_schema_update['description'] = metadata.description\n if metadata.examples:\n json_schema_update['examples'] = to_jsonable_python(metadata.examples)\n\n json_schema_extra = metadata.json_schema_extra\n if json_schema_update or json_schema_extra:\n CoreMetadataHandler(schema).metadata.setdefault('pydantic_js_annotation_functions', []).append(\n get_json_schema_update_func(json_schema_update, json_schema_extra)\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_wrap_default_wrap_default.if_field_info_default_fac.else_.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_wrap_default_wrap_default.if_field_info_default_fac.else_.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": 1956, "end_line": 1975, "span_ids": ["wrap_default"], "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 wrap_default(field_info: FieldInfo, schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n \"\"\"Wrap schema with default schema if default value or `default_factory` are available.\n\n Args:\n field_info: The field info object.\n schema: The schema to apply default on.\n\n Returns:\n Updated schema by default value or `default_factory`.\n \"\"\"\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 PydanticUndefined:\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__Definitions__Definitions.get_schema_or_ref.if_ref_in_self_seen_or_re.else_.try_.finally_.self_seen_discard_ref_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__Definitions__Definitions.get_schema_or_ref.if_ref_in_self_seen_or_re.else_.try_.finally_.self_seen_discard_ref_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2036, "end_line": 2072, "span_ids": ["_Definitions", "_Definitions.get_schema_or_ref", "_Definitions.__init__"], "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 _Definitions:\n \"\"\"Keeps track of references and definitions.\"\"\"\n\n def __init__(self) -> None:\n self.seen: set[str] = set()\n self.definitions: dict[str, core_schema.CoreSchema] = {}\n\n @contextmanager\n def get_schema_or_ref(self, tp: Any) -> Iterator[tuple[str, None] | tuple[str, CoreSchema]]:\n \"\"\"Get a definition for `tp` if one exists.\n\n If a definition exists, a tuple of `(ref_string, CoreSchema)` is returned.\n If no definition exists yet, a tuple of `(ref_string, None)` is returned.\n\n Note that the returned `CoreSchema` will always be a `DefinitionReferenceSchema`,\n not the actual definition itself.\n\n This should be called for any type that can be identified by reference.\n This includes any recursive types.\n\n At present the following types can be named/recursive:\n\n - BaseModel\n - Dataclasses\n - TypedDict\n - TypeAliasType\n \"\"\"\n ref = get_type_ref(tp)\n # return the reference if we're either (1) in a cycle or (2) it was already defined\n if ref in self.seen or ref in self.definitions:\n yield (ref, core_schema.definition_reference_schema(ref))\n else:\n self.seen.add(ref)\n try:\n yield (ref, None)\n finally:\n self.seen.discard(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/_generics.py_has_instance_in_type_has_instance_in_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_has_instance_in_type_has_instance_in_type.return.False", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generics.py", "file_name": "_generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 342, "end_line": 367, "span_ids": ["has_instance_in_type"], "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 has_instance_in_type(type_: Any, isinstance_target: Any) -> bool:\n \"\"\"Checks if the type, or any of its arbitrary nested args, satisfy\n `isinstance(, isinstance_target)`.\n \"\"\"\n if isinstance(type_, isinstance_target):\n return True\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 return has_instance_in_type(annotated_type, isinstance_target)\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 any(has_instance_in_type(a, isinstance_target) for a in type_args):\n return True\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)) and not isinstance(type_, typing_extensions.ParamSpec):\n if any(has_instance_in_type(element, isinstance_target) for element in type_):\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_internal_dataclass.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_internal_dataclass.py__", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_internal_dataclass.py", "file_name": "_internal_dataclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["imports"], "tokens": 60}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nfrom typing import Any, Dict\n\ndataclass_kwargs: Dict[str, Any]\n\n# `slots` is available on Python >= 3.10\nif sys.version_info >= (3, 10):\n slots_true = {'slots': True}\nelse:\n slots_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/_known_annotated_metadata.py_from___future___import_an_for_constraint_in_INT_CON.CONSTRAINTS_TO_ALLOWED_SC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_from___future___import_an_for_constraint_in_INT_CON.CONSTRAINTS_TO_ALLOWED_SC", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 73, "span_ids": ["imports", "impl:50"], "tokens": 748}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations\n\nfrom collections import defaultdict\nfrom copy import copy\nfrom functools import partial\nfrom typing import TYPE_CHECKING, Any, Callable, Iterable\n\nfrom pydantic_core import CoreSchema, PydanticCustomError, to_jsonable_python\nfrom pydantic_core import core_schema as cs\n\nfrom ._fields import PydanticMetadata\n\nif TYPE_CHECKING:\n from ..annotated_handlers import GetJsonSchemaHandler\n\n\nSTRICT = {'strict'}\nSEQUENCE_CONSTRAINTS = {'min_length', 'max_length'}\nINEQUALITY = {'le', 'ge', 'lt', 'gt'}\nNUMERIC_CONSTRAINTS = {'multiple_of', 'allow_inf_nan', *INEQUALITY}\n\nSTR_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT, 'strip_whitespace', 'to_lower', 'to_upper', 'pattern'}\nBYTES_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT}\n\nLIST_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT}\nTUPLE_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT}\nSET_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT}\nDICT_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT}\nGENERATOR_CONSTRAINTS = {*SEQUENCE_CONSTRAINTS, *STRICT}\n\nFLOAT_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT}\nINT_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT}\nBOOL_CONSTRAINTS = STRICT\nUUID_CONSTRAINTS = STRICT\n\nDATE_TIME_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT}\nTIMEDELTA_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT}\nTIME_CONSTRAINTS = {*NUMERIC_CONSTRAINTS, *STRICT}\nLAX_OR_STRICT_CONSTRAINTS = STRICT\n\nUNION_CONSTRAINTS = {'union_mode'}\nURL_CONSTRAINTS = {\n 'max_length',\n 'allowed_schemes',\n 'host_required',\n 'default_host',\n 'default_port',\n 'default_path',\n}\n\nTEXT_SCHEMA_TYPES = ('str', 'bytes', 'url', 'multi-host-url')\nSEQUENCE_SCHEMA_TYPES = ('list', 'tuple', 'set', 'frozenset', 'generator', *TEXT_SCHEMA_TYPES)\nNUMERIC_SCHEMA_TYPES = ('float', 'int', 'date', 'time', 'timedelta', 'datetime')\n\nCONSTRAINTS_TO_ALLOWED_SCHEMAS: dict[str, set[str]] = defaultdict(set)\nfor constraint in STR_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(TEXT_SCHEMA_TYPES)\nfor constraint in BYTES_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('bytes',))\nfor constraint in LIST_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('list',))\nfor constraint in TUPLE_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('tuple',))\nfor constraint in SET_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('set', 'frozenset'))\nfor constraint in DICT_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('dict',))\nfor constraint in GENERATOR_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('generator',))\nfor constraint in FLOAT_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('float',))\nfor constraint in INT_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('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/pydantic/_internal/_known_annotated_metadata.py_for_constraint_in_DATE_TI_for_constraint_in_LAX_OR_.CONSTRAINTS_TO_ALLOWED_SC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_for_constraint_in_DATE_TI_for_constraint_in_LAX_OR_.CONSTRAINTS_TO_ALLOWED_SC", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 91, "span_ids": ["impl:50"], "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": "for constraint in DATE_TIME_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('date', 'time', 'datetime'))\nfor constraint in TIMEDELTA_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('timedelta',))\nfor constraint in TIME_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('time',))\nfor schema_type in (*TEXT_SCHEMA_TYPES, *SEQUENCE_SCHEMA_TYPES, *NUMERIC_SCHEMA_TYPES, 'typed-dict', 'model'):\n CONSTRAINTS_TO_ALLOWED_SCHEMAS['strict'].add(schema_type)\nfor constraint in UNION_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('union',))\nfor constraint in URL_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('url', 'multi-host-url'))\nfor constraint in BOOL_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('bool',))\nfor constraint in UUID_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('uuid',))\nfor constraint in LAX_OR_STRICT_CONSTRAINTS:\n CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint].update(('lax-or-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/_internal/_known_annotated_metadata.py_add_js_update_schema_as_jsonable_value.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_add_js_update_schema_as_jsonable_value.return.v", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 113, "span_ids": ["as_jsonable_value", "add_js_update_schema"], "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 add_js_update_schema(s: cs.CoreSchema, f: Callable[[], dict[str, Any]]) -> None:\n def update_js_schema(s: cs.CoreSchema, handler: GetJsonSchemaHandler) -> dict[str, Any]:\n js_schema = handler(s)\n js_schema.update(f())\n return js_schema\n\n if 'metadata' in s:\n metadata = s['metadata']\n if 'pydantic_js_functions' in s:\n metadata['pydantic_js_functions'].append(update_js_schema)\n else:\n metadata['pydantic_js_functions'] = [update_js_schema]\n else:\n s['metadata'] = {'pydantic_js_functions': [update_js_schema]}\n\n\ndef as_jsonable_value(v: Any) -> Any:\n if type(v) not in (int, str, float, bytes, bool, type(None)):\n return to_jsonable_python(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/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata_apply_known_metadata.schema_type.schema_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata_apply_known_metadata.schema_type.schema_type_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 181, "span_ids": ["apply_known_metadata"], "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 apply_known_metadata(annotation: Any, schema: CoreSchema) -> CoreSchema | None: # noqa: C901\n \"\"\"Apply `annotation` to `schema` if it is an annotation we know about (Gt, Le, etc.).\n Otherwise return `None`.\n\n This does not handle all known annotations. If / when it does, it can always\n return a CoreSchema and return the unmodified schema if the annotation should be ignored.\n\n Assumes that GroupedMetadata has already been expanded via `expand_grouped_metadata`.\n\n Args:\n annotation: The annotation.\n schema: The schema.\n\n Returns:\n An updated schema with annotation if it is an annotation we know about, `None` otherwise.\n\n Raises:\n PydanticCustomError: If `Predicate` fails.\n \"\"\"\n import annotated_types as at\n\n from . import _validators\n\n schema = schema.copy()\n schema_update, other_metadata = collect_known_metadata([annotation])\n schema_type = schema['type']\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata.for_constraint_value_in__apply_known_metadata.for_constraint_value_in_.if_constraint_allow_i.else_.raise_RuntimeError_f_Unab": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata.for_constraint_value_in__apply_known_metadata.for_constraint_value_in_.if_constraint_allow_i.else_.raise_RuntimeError_f_Unab", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 280, "span_ids": ["apply_known_metadata"], "tokens": 714}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_known_metadata(annotation: Any, schema: CoreSchema) -> CoreSchema | None:\n # ... other code\n for constraint, value in schema_update.items():\n if constraint not in CONSTRAINTS_TO_ALLOWED_SCHEMAS:\n raise ValueError(f'Unknown constraint {constraint}')\n allowed_schemas = CONSTRAINTS_TO_ALLOWED_SCHEMAS[constraint]\n\n if schema_type in allowed_schemas:\n if constraint == 'union_mode' and schema_type == 'union':\n schema['mode'] = value # type: ignore # schema is UnionSchema\n else:\n schema[constraint] = value\n continue\n\n if constraint == 'allow_inf_nan' and value is False:\n return cs.no_info_after_validator_function(\n _validators.forbid_inf_nan_check,\n schema,\n )\n elif constraint == 'pattern':\n # insert a str schema to make sure the regex engine matches\n return cs.chain_schema(\n [\n schema,\n cs.str_schema(pattern=value),\n ]\n )\n elif constraint == 'gt':\n s = cs.no_info_after_validator_function(\n partial(_validators.greater_than_validator, gt=value),\n schema,\n )\n add_js_update_schema(s, lambda: {'gt': as_jsonable_value(value)})\n return s\n elif constraint == 'ge':\n return cs.no_info_after_validator_function(\n partial(_validators.greater_than_or_equal_validator, ge=value),\n schema,\n )\n elif constraint == 'lt':\n return cs.no_info_after_validator_function(\n partial(_validators.less_than_validator, lt=value),\n schema,\n )\n elif constraint == 'le':\n return cs.no_info_after_validator_function(\n partial(_validators.less_than_or_equal_validator, le=value),\n schema,\n )\n elif constraint == 'multiple_of':\n return cs.no_info_after_validator_function(\n partial(_validators.multiple_of_validator, multiple_of=value),\n schema,\n )\n elif constraint == 'min_length':\n s = cs.no_info_after_validator_function(\n partial(_validators.min_length_validator, min_length=value),\n schema,\n )\n add_js_update_schema(s, lambda: {'minLength': (as_jsonable_value(value))})\n return s\n elif constraint == 'max_length':\n s = cs.no_info_after_validator_function(\n partial(_validators.max_length_validator, max_length=value),\n schema,\n )\n add_js_update_schema(s, lambda: {'maxLength': (as_jsonable_value(value))})\n return s\n elif constraint == 'strip_whitespace':\n return cs.chain_schema(\n [\n schema,\n cs.str_schema(strip_whitespace=True),\n ]\n )\n elif constraint == 'to_lower':\n return cs.chain_schema(\n [\n schema,\n cs.str_schema(to_lower=True),\n ]\n )\n elif constraint == 'to_upper':\n return cs.chain_schema(\n [\n schema,\n cs.str_schema(to_upper=True),\n ]\n )\n elif constraint == 'min_length':\n return cs.no_info_after_validator_function(\n partial(_validators.min_length_validator, min_length=annotation.min_length),\n schema,\n )\n elif constraint == 'max_length':\n return cs.no_info_after_validator_function(\n partial(_validators.max_length_validator, max_length=annotation.max_length),\n schema,\n )\n else:\n raise RuntimeError(f'Unable to apply constraint {constraint} to schema {schema_type}')\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata.for_annotation_in_other_m_apply_known_metadata.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_known_annotated_metadata.py_apply_known_metadata.for_annotation_in_other_m_apply_known_metadata.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_known_annotated_metadata.py", "file_name": "_known_annotated_metadata.py", "file_type": "text/x-python", "category": "implementation", "start_line": 282, "end_line": 334, "span_ids": ["apply_known_metadata"], "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 apply_known_metadata(annotation: Any, schema: CoreSchema) -> CoreSchema | None:\n # ... other code\n\n for annotation in other_metadata:\n if isinstance(annotation, at.Gt):\n return cs.no_info_after_validator_function(\n partial(_validators.greater_than_validator, gt=annotation.gt),\n schema,\n )\n elif isinstance(annotation, at.Ge):\n return cs.no_info_after_validator_function(\n partial(_validators.greater_than_or_equal_validator, ge=annotation.ge),\n schema,\n )\n elif isinstance(annotation, at.Lt):\n return cs.no_info_after_validator_function(\n partial(_validators.less_than_validator, lt=annotation.lt),\n schema,\n )\n elif isinstance(annotation, at.Le):\n return cs.no_info_after_validator_function(\n partial(_validators.less_than_or_equal_validator, le=annotation.le),\n schema,\n )\n elif isinstance(annotation, at.MultipleOf):\n return cs.no_info_after_validator_function(\n partial(_validators.multiple_of_validator, multiple_of=annotation.multiple_of),\n schema,\n )\n elif isinstance(annotation, at.MinLen):\n return cs.no_info_after_validator_function(\n partial(_validators.min_length_validator, min_length=annotation.min_length),\n schema,\n )\n elif isinstance(annotation, at.MaxLen):\n return cs.no_info_after_validator_function(\n partial(_validators.max_length_validator, max_length=annotation.max_length),\n schema,\n )\n elif isinstance(annotation, at.Predicate):\n predicate_name = f'{annotation.func.__qualname__} ' if hasattr(annotation.func, '__qualname__') else ''\n\n def val_func(v: Any) -> Any:\n # annotation.func may also raise an exception, let it pass through\n if not annotation.func(v):\n raise PydanticCustomError(\n 'predicate_failed',\n f'Predicate {predicate_name}failed', # type: ignore\n )\n return v\n\n return cs.no_info_after_validator_function(val_func, schema)\n # ignore any other unknown metadata\n return None\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/_mock_val_ser.py_from___future___import_an_MockValSer.rebuild.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_mock_val_ser.py_from___future___import_an_MockValSer.rebuild.return.None", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_mock_val_ser.py", "file_name": "_mock_val_ser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["MockValSer.__init__", "MockValSer", "imports", "MockValSer.__getattr__", "MockValSer.rebuild"], "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": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Callable, Generic, TypeVar\n\nfrom pydantic_core import SchemaSerializer, SchemaValidator\nfrom typing_extensions import Literal\n\nfrom ..errors import PydanticErrorCodes, PydanticUserError\n\nif TYPE_CHECKING:\n from ..dataclasses import PydanticDataclass\n from ..main import BaseModel\n\n\nValSer = TypeVar('ValSer', SchemaValidator, SchemaSerializer)\n\n\nclass MockValSer(Generic[ValSer]):\n \"\"\"Mocker for `pydantic_core.SchemaValidator` or `pydantic_core.SchemaSerializer` which optionally attempts to\n rebuild the thing it's mocking when one of its methods is accessed and raises an error if that fails.\n \"\"\"\n\n __slots__ = '_error_message', '_code', '_val_or_ser', '_attempt_rebuild'\n\n def __init__(\n self,\n error_message: str,\n *,\n code: PydanticErrorCodes,\n val_or_ser: Literal['validator', 'serializer'],\n attempt_rebuild: Callable[[], ValSer | None] | None = None,\n ) -> None:\n self._error_message = error_message\n self._val_or_ser = SchemaValidator if val_or_ser == 'validator' else SchemaSerializer\n self._code: PydanticErrorCodes = code\n self._attempt_rebuild = attempt_rebuild\n\n def __getattr__(self, item: str) -> None:\n __tracebackhide__ = True\n if self._attempt_rebuild:\n val_ser = self._attempt_rebuild()\n if val_ser is not None:\n return getattr(val_ser, item)\n\n # raise an AttributeError if `item` doesn't exist\n getattr(self._val_or_ser, item)\n raise PydanticUserError(self._error_message, code=self._code)\n\n def rebuild(self) -> ValSer | None:\n if self._attempt_rebuild:\n val_ser = self._attempt_rebuild()\n if val_ser is not None:\n return val_ser\n else:\n raise PydanticUserError(self._error_message, code=self._code)\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/_mock_val_ser.py_set_model_mocks_set_model_mocks.cls.__pydantic_serializer__.MockValSer_type_igno": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_mock_val_ser.py_set_model_mocks_set_model_mocks.cls.__pydantic_serializer__.MockValSer_type_igno", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_mock_val_ser.py", "file_name": "_mock_val_ser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 96, "span_ids": ["set_model_mocks"], "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 set_model_mocks(cls: type[BaseModel], cls_name: str, undefined_name: str = 'all referenced types') -> None:\n \"\"\"Set `__pydantic_validator__` and `__pydantic_serializer__` to `MockValSer`s on a model.\n\n Args:\n cls: The model class to set the mocks on\n cls_name: Name of the model class, used in error messages\n undefined_name: Name of the undefined thing, used in error messages\n \"\"\"\n undefined_type_error_message = (\n f'`{cls_name}` is not fully defined; you should define {undefined_name},'\n f' then call `{cls_name}.model_rebuild()`.'\n )\n\n def attempt_rebuild_validator() -> SchemaValidator | None:\n if cls.model_rebuild(raise_errors=False, _parent_namespace_depth=5) is not False:\n return cls.__pydantic_validator__\n else:\n return None\n\n cls.__pydantic_validator__ = MockValSer( # type: ignore[assignment]\n undefined_type_error_message,\n code='class-not-fully-defined',\n val_or_ser='validator',\n attempt_rebuild=attempt_rebuild_validator,\n )\n\n def attempt_rebuild_serializer() -> SchemaSerializer | None:\n if cls.model_rebuild(raise_errors=False, _parent_namespace_depth=5) is not False:\n return cls.__pydantic_serializer__\n else:\n return None\n\n cls.__pydantic_serializer__ = MockValSer( # type: ignore[assignment]\n undefined_type_error_message,\n code='class-not-fully-defined',\n val_or_ser='serializer',\n attempt_rebuild=attempt_rebuild_serializer,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_mock_val_ser.py_set_dataclass_mocks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_mock_val_ser.py_set_dataclass_mocks_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_mock_val_ser.py", "file_name": "_mock_val_ser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 141, "span_ids": ["set_dataclass_mocks"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_dataclass_mocks(\n cls: type[PydanticDataclass], cls_name: str, undefined_name: str = 'all referenced types'\n) -> None:\n \"\"\"Set `__pydantic_validator__` and `__pydantic_serializer__` to `MockValSer`s on a dataclass.\n\n Args:\n cls: The model class to set the mocks on\n cls_name: Name of the model class, used in error messages\n undefined_name: Name of the undefined thing, used in error messages\n \"\"\"\n from ..dataclasses import rebuild_dataclass\n\n undefined_type_error_message = (\n f'`{cls_name}` is not fully defined; you should define {undefined_name},'\n f' then call `pydantic.dataclasses.rebuild_dataclass({cls_name})`.'\n )\n\n def attempt_rebuild_validator() -> SchemaValidator | None:\n if rebuild_dataclass(cls, raise_errors=False, _parent_namespace_depth=5) is not False:\n return cls.__pydantic_validator__\n else:\n return None\n\n cls.__pydantic_validator__ = MockValSer( # type: ignore[assignment]\n undefined_type_error_message,\n code='class-not-fully-defined',\n val_or_ser='validator',\n attempt_rebuild=attempt_rebuild_validator,\n )\n\n def attempt_rebuild_serializer() -> SchemaSerializer | None:\n if rebuild_dataclass(cls, raise_errors=False, _parent_namespace_depth=5) is not False:\n return cls.__pydantic_serializer__\n else:\n return None\n\n cls.__pydantic_serializer__ = MockValSer( # type: ignore[assignment]\n undefined_type_error_message,\n code='class-not-fully-defined',\n val_or_ser='validator',\n attempt_rebuild=attempt_rebuild_serializer,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_ModelMetaclass.if_not_typing_TYPE_CHECKI_ModelMetaclass.__instancecheck__.return.hasattr_instance___pyda": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass.if_not_typing_TYPE_CHECKI_ModelMetaclass.__instancecheck__.return.hasattr_instance___pyda", "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": 227, "span_ids": ["ModelMetaclass:2", "ModelMetaclass.__prepare__", "ModelMetaclass.__instancecheck__"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclass_transform(kw_only_default=True, field_specifiers=(PydanticModelField,))\nclass ModelMetaclass(ABCMeta):\n\n if not typing.TYPE_CHECKING: # pragma: no branch\n # We put `__getattr__` in a non-TYPE_CHECKING block because otherwise, mypy allows arbitrary attribute access\n\n def __getattr__(self, item: str) -> Any:\n \"\"\"This is necessary to keep attribute access working for class attribute access.\"\"\"\n private_attributes = self.__dict__.get('__private_attributes__')\n if private_attributes and item in private_attributes:\n return private_attributes[item]\n if item == '__pydantic_core_schema__':\n # This means the class didn't get a schema generated for it, likely because there was an undefined reference\n maybe_mock_validator = getattr(self, '__pydantic_validator__', None)\n if isinstance(maybe_mock_validator, MockValSer):\n rebuilt_validator = maybe_mock_validator.rebuild()\n if rebuilt_validator is not None:\n # In this case, a validator was built, and so `__pydantic_core_schema__` should now be set\n return getattr(self, '__pydantic_core_schema__')\n raise AttributeError(item)\n\n @classmethod\n def __prepare__(cls, *args: Any, **kwargs: Any) -> dict[str, object]:\n return _ModelNamespaceDict()\n\n def __instancecheck__(self, instance: Any) -> bool:\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/_internal/_model_construction.py_init_private_attributes_init_private_attributes.if_getattr_self___pydan.object_setattr_self___p": {"__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_init_private_attributes.if_getattr_self___pydan.object_setattr_self___p", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 266, "span_ids": ["init_private_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 init_private_attributes(self: BaseModel, __context: Any) -> None:\n \"\"\"This function is meant to behave like a BaseModel method to initialise private attributes.\n\n It takes context as an argument since that's what pydantic-core passes when calling it.\n\n Args:\n self: The BaseModel instance.\n __context: The context.\n \"\"\"\n if getattr(self, '__pydantic_private__', None) is None:\n pydantic_private = {}\n for name, private_attr in self.__private_attributes__.items():\n default = private_attr.get_default()\n if default is not PydanticUndefined:\n pydantic_private[name] = default\n object_setattr(self, '__pydantic_private__', pydantic_private)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_get_model_post_init_get_model_post_init.if_model_post_init_is_not.return.model_post_init": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_get_model_post_init_get_model_post_init.if_model_post_init_is_not.return.model_post_init", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 269, "end_line": 278, "span_ids": ["get_model_post_init"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_model_post_init(namespace: dict[str, Any], bases: tuple[type[Any], ...]) -> Callable[..., Any] | None:\n \"\"\"Get the `model_post_init` method from the namespace or the class bases, or `None` if not defined.\"\"\"\n if 'model_post_init' in namespace:\n return namespace['model_post_init']\n\n from ..main import BaseModel\n\n model_post_init = get_attribute_from_bases(bases, 'model_post_init')\n if model_post_init is not BaseModel.model_post_init:\n return 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/pydantic/_internal/_model_construction.py_set_model_fields_set_model_fields.for_k_in_class_vars_.if_value_is_not_None_and_.setattr_cls_k_value_def": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_set_model_fields_set_model_fields.for_k_in_class_vars_.if_value_is_not_None_and_.setattr_cls_k_value_def", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 407, "end_line": 434, "span_ids": ["set_model_fields"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_model_fields(\n cls: type[BaseModel], bases: tuple[type[Any], ...], config_wrapper: ConfigWrapper, types_namespace: dict[str, Any]\n) -> None:\n \"\"\"Collect and set `cls.model_fields` and `cls.__class_vars__`.\n\n Args:\n cls: BaseModel or dataclass.\n bases: Parents of the class, generally `cls.__bases__`.\n config_wrapper: The config wrapper instance.\n types_namespace: Optional extra namespace to look for types in.\n \"\"\"\n typevars_map = get_model_typevars_map(cls)\n fields, class_vars = collect_model_fields(cls, bases, config_wrapper, types_namespace, typevars_map=typevars_map)\n\n cls.model_fields = fields\n cls.__class_vars__.update(class_vars)\n\n for k in class_vars:\n # Class vars should not be private attributes\n # We remove them _here_ and not earlier because we rely on inspecting the class to determine its classvars,\n # but private attributes are determined by inspecting the namespace _prior_ to class creation.\n # In the case that a classvar with a leading-'_' is defined via a ForwardRef (e.g., when using\n # `__future__.annotations`), we want to remove the private attribute which was detected _before_ we knew it\n # evaluated to a classvar\n\n value = cls.__private_attributes__.pop(k, None)\n if value is not None and value.default is not PydanticUndefined:\n setattr(cls, k, value.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_build_lenient_weakvaluedict_build_lenient_weakvaluedict.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_build_lenient_weakvaluedict_build_lenient_weakvaluedict.return.result", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 572, "end_line": 589, "span_ids": ["build_lenient_weakvaluedict"], "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 build_lenient_weakvaluedict(d: dict[str, Any] | None) -> dict[str, Any] | None:\n \"\"\"Takes an input dictionary, and produces a new value that (invertibly) replaces the values with weakrefs.\n\n We can't just use a WeakValueDictionary because many types (including int, str, etc.) can't be stored as values\n in a WeakValueDictionary.\n\n The `unpack_lenient_weakvaluedict` function can be used to reverse this operation.\n \"\"\"\n if d is None:\n return None\n result = {}\n for k, v in d.items():\n try:\n proxy = _PydanticWeakRef(v)\n except TypeError:\n proxy = v\n result[k] = proxy\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/_model_construction.py_unpack_lenient_weakvaluedict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_unpack_lenient_weakvaluedict_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 592, "end_line": 620, "span_ids": ["unpack_lenient_weakvaluedict", "default_ignored_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": "def unpack_lenient_weakvaluedict(d: dict[str, Any] | None) -> dict[str, Any] | None:\n \"\"\"Inverts the transform performed by `build_lenient_weakvaluedict`.\"\"\"\n if d is None:\n return None\n\n result = {}\n for k, v in d.items():\n if isinstance(v, _PydanticWeakRef):\n v = v()\n if v is not None:\n result[k] = v\n else:\n result[k] = v\n return result\n\n\ndef default_ignored_types() -> tuple[type[Any], ...]:\n from ..fields import ComputedFieldInfo\n\n return (\n FunctionType,\n property,\n classmethod,\n staticmethod,\n PydanticDescriptorProxy,\n ComputedFieldInfo,\n ValidateCallWrapper,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_schema_generation_shared.py_CallbackGetCoreSchemaHandler_CallbackGetCoreSchemaHandler.field_name.return.self__generate_schema_fie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_CallbackGetCoreSchemaHandler_CallbackGetCoreSchemaHandler.field_name.return.self__generate_schema_fie", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_schema_generation_shared.py", "file_name": "_schema_generation_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 100, "span_ids": ["CallbackGetCoreSchemaHandler.generate_schema", "CallbackGetCoreSchemaHandler", "CallbackGetCoreSchemaHandler._get_types_namespace", "CallbackGetCoreSchemaHandler.__call__", "CallbackGetCoreSchemaHandler.__init__", "CallbackGetCoreSchemaHandler.field_name"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallbackGetCoreSchemaHandler(GetCoreSchemaHandler):\n \"\"\"Wrapper to use an arbitrary function as a `GetCoreSchemaHandler`.\n\n Used internally by Pydantic, please do not rely on this implementation.\n See `GetCoreSchemaHandler` for the handler API.\n \"\"\"\n\n def __init__(\n self,\n handler: Callable[[Any], core_schema.CoreSchema],\n generate_schema: GenerateSchema,\n ref_mode: Literal['to-def', 'unpack'] = 'to-def',\n ) -> None:\n self._handler = handler\n self._generate_schema = generate_schema\n self._ref_mode = ref_mode\n\n def __call__(self, source_type: Any, /) -> core_schema.CoreSchema:\n schema = self._handler(source_type)\n ref = schema.get('ref')\n if self._ref_mode == 'to-def':\n if ref is not None:\n self._generate_schema.defs.definitions[ref] = schema\n return core_schema.definition_reference_schema(ref)\n return schema\n else: # ref_mode = 'unpack\n return self.resolve_ref_schema(schema)\n\n def _get_types_namespace(self) -> dict[str, Any] | None:\n return self._generate_schema._types_namespace\n\n def generate_schema(self, source_type: Any, /) -> core_schema.CoreSchema:\n return self._generate_schema.generate_schema(source_type)\n\n @property\n def field_name(self) -> str | None:\n return self._generate_schema.field_name_stack.get()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_prepare_pydantic_annotations_decimal_prepare_pydantic_annotations.return.source_InnerSchemaValid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_decimal_prepare_pydantic_annotations_decimal_prepare_pydantic_annotations.return.source_InnerSchemaValid", "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": 161, "end_line": 176, "span_ids": ["decimal_prepare_pydantic_annotations"], "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 decimal_prepare_pydantic_annotations(\n source: Any, annotations: Iterable[Any], config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n if source is not decimal.Decimal:\n return None\n\n metadata, remaining_annotations = _known_annotated_metadata.collect_known_metadata(annotations)\n\n config_allow_inf_nan = config.get('allow_inf_nan')\n if config_allow_inf_nan is not None:\n metadata.setdefault('allow_inf_nan', config_allow_inf_nan)\n\n _known_annotated_metadata.check_metadata(\n metadata, {*_known_annotated_metadata.FLOAT_CONSTRAINTS, 'max_digits', 'decimal_places'}, decimal.Decimal\n )\n return source, [InnerSchemaValidator(core_schema.decimal_schema(**metadata)), *remaining_annotations]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_datetime_prepare_pydantic_annotations_uuid_prepare_pydantic_annotations.return._source_type_InnerSchem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_datetime_prepare_pydantic_annotations_uuid_prepare_pydantic_annotations.return._source_type_InnerSchem", "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": 179, "end_line": 210, "span_ids": ["uuid_prepare_pydantic_annotations", "datetime_prepare_pydantic_annotations"], "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 datetime_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n import datetime\n\n metadata, remaining_annotations = _known_annotated_metadata.collect_known_metadata(annotations)\n if source_type is datetime.date:\n sv = InnerSchemaValidator(core_schema.date_schema(**metadata))\n elif source_type is datetime.datetime:\n sv = InnerSchemaValidator(core_schema.datetime_schema(**metadata))\n elif source_type is datetime.time:\n sv = InnerSchemaValidator(core_schema.time_schema(**metadata))\n elif source_type is datetime.timedelta:\n sv = InnerSchemaValidator(core_schema.timedelta_schema(**metadata))\n else:\n return None\n # check now that we know the source type is correct\n _known_annotated_metadata.check_metadata(metadata, _known_annotated_metadata.DATE_TIME_CONSTRAINTS, source_type)\n return (source_type, [sv, *remaining_annotations])\n\n\ndef uuid_prepare_pydantic_annotations(\n source_type: Any, annotations: Iterable[Any], _config: ConfigDict\n) -> tuple[Any, list[Any]] | None:\n # UUIDs have no constraints - they are fixed length, constructing a UUID instance checks the length\n\n from uuid import UUID\n\n if source_type is not UUID:\n return None\n\n return (source_type, [InnerSchemaValidator(core_schema.uuid_schema()), *annotations])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__Bucket_of_reusable_int_KeyType.TypeVar_KeyType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__Bucket_of_reusable_int_KeyType.TypeVar_KeyType_", "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": 100, "span_ids": ["sequence_like", "lenient_issubclass", "impl:10", "lenient_isinstance", "docstring", "is_model_class", "is_valid_identifier"], "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": "\"\"\"Bucket 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 dataclasses\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, Mapping, TypeVar\n\nfrom typing_extensions import TypeAlias, TypeGuard\n\nfrom . import _repr, _typing_extra\n\nif typing.TYPE_CHECKING:\n MappingIntStrAny: TypeAlias = 'typing.Mapping[int, Any] | typing.Mapping[str, Any]'\n AbstractSetIntStr: TypeAlias = 'typing.AbstractSet[int] | typing.AbstractSet[str]'\n from ..main import BaseModel\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: # pragma: no cover\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: # pragma: no cover\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\n\n\ndef is_model_class(cls: Any) -> TypeGuard[type[BaseModel]]:\n \"\"\"Returns true if cls is a _proper_ subclass of BaseModel, and provides proper type-checking,\n unlike raw calls to lenient_issubclass.\n \"\"\"\n from ..main import BaseModel\n\n return lenient_issubclass(cls, BaseModel) and cls is not BaseModel\n\n\ndef is_valid_identifier(identifier: str) -> bool:\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')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_deep_update_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_deep_update_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": 102, "end_line": 117, "span_ids": ["update_not_none", "deep_update", "impl:12"], "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 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 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\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/_validators.py__Validator_functions_fo_from_pydantic_core__pydan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py__Validator_functions_fo_from_pydantic_core__pydan", "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": 15, "span_ids": ["docstring"], "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": "\"\"\"Validator 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 math\nimport re\nimport typing\nfrom ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network\nfrom typing import Any\n\nfrom pydantic_core import PydanticCustomError, core_schema\nfrom pydantic_core._pydantic_core import PydanticKnownError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_import_string.if_isinstance_value_str_.else_.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validators.py_sequence_validator_import_string.if_isinstance_value_str_.else_.return.value", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validators.py", "file_name": "_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 66, "span_ids": ["sequence_validator", "import_string"], "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 sequence_validator(\n input_value: typing.Sequence[Any],\n /,\n validator: core_schema.ValidatorFunctionWrapHandler,\n) -> typing.Sequence[Any]:\n \"\"\"Validator for `Sequence` types, isinstance(v, Sequence) has already been called.\"\"\"\n value_type = type(input_value)\n\n # We don't accept any plain string as a sequence\n # Relevant issue: https://github.com/pydantic/pydantic/issues/5595\n if issubclass(value_type, (str, bytes)):\n raise PydanticCustomError(\n 'sequence_str',\n \"'{type_name}' instances are not allowed as a Sequence value\",\n {'type_name': value_type.__name__},\n )\n\n # TODO: refactor sequence validation to validate with either a list or a tuple\n # schema, depending on the type of the value.\n # Additionally, we should be able to remove one of either this validator or the\n # SequenceValidator in _std_types_schema.py (preferably this one, while porting over some logic).\n # Effectively, a refactor for sequence validation is needed.\n if value_type == tuple:\n input_value = list(input_value)\n\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, range):\n # return the list as we probably can't re-create the range\n return v_list\n elif value_type == tuple:\n return tuple(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]\n\n\ndef 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)}) from e\n else:\n # otherwise we just return the value and let the next validator do the rest of the work\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/_migration.py_sys_REDIRECT_TO_V1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_migration.py_sys_REDIRECT_TO_V1._", "embedding": null, "metadata": {"file_path": "pydantic/_migration.py", "file_name": "_migration.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["imports"], "tokens": 549}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, Callable, Dict\n\nfrom .version import version_short\n\nMOVED_IN_V2 = {\n 'pydantic.utils:version_info': 'pydantic.version:version_info',\n 'pydantic.error_wrappers:ValidationError': 'pydantic:ValidationError',\n 'pydantic.utils:to_camel': 'pydantic.alias_generators:to_pascal',\n 'pydantic.utils:to_lower_camel': 'pydantic.alias_generators:to_camel',\n 'pydantic:PyObject': 'pydantic.types:ImportString',\n 'pydantic.types:PyObject': 'pydantic.types:ImportString',\n 'pydantic.generics:GenericModel': 'pydantic.BaseModel',\n}\n\nDEPRECATED_MOVED_IN_V2 = {\n 'pydantic.tools:schema_of': 'pydantic.deprecated.tools:schema_of',\n 'pydantic.tools:parse_obj_as': 'pydantic.deprecated.tools:parse_obj_as',\n 'pydantic.tools:schema_json_of': 'pydantic.deprecated.tools:schema_json_of',\n 'pydantic.json:pydantic_encoder': 'pydantic.deprecated.json:pydantic_encoder',\n 'pydantic:validate_arguments': 'pydantic.deprecated.decorator:validate_arguments',\n 'pydantic.json:custom_pydantic_encoder': 'pydantic.deprecated.json:custom_pydantic_encoder',\n 'pydantic.json:timedelta_isoformat': 'pydantic.deprecated.json:timedelta_isoformat',\n 'pydantic.decorator:validate_arguments': 'pydantic.deprecated.decorator:validate_arguments',\n 'pydantic.class_validators:validator': 'pydantic.deprecated.class_validators:validator',\n 'pydantic.class_validators:root_validator': 'pydantic.deprecated.class_validators:root_validator',\n 'pydantic.config:BaseConfig': 'pydantic.deprecated.config:BaseConfig',\n 'pydantic.config:Extra': 'pydantic.deprecated.config:Extra',\n}\n\nREDIRECT_TO_V1 = {\n f'pydantic.utils:{obj}': f'pydantic.v1.utils:{obj}'\n for obj in (\n 'deep_update',\n 'GetterDict',\n 'lenient_issubclass',\n 'lenient_isinstance',\n 'is_valid_field',\n 'update_not_none',\n 'import_string',\n 'Representation',\n 'ROOT_KEY',\n 'smart_deepcopy',\n 'sequence_like',\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/annotated_handlers.py__Type_annotations_to_us___all__._GetJsonSchemaHandler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py__Type_annotations_to_us___all__._GetJsonSchemaHandler_", "embedding": null, "metadata": {"file_path": "pydantic/annotated_handlers.py", "file_name": "annotated_handlers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["docstring"], "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": "\"\"\"Type annotations to use with `__get_pydantic_core_schema__` and `__get_pydantic_json_schema__`.\"\"\"\nfrom __future__ import annotations as _annotations\n\nfrom typing import TYPE_CHECKING, Any, Union\n\nfrom pydantic_core import core_schema\n\nif TYPE_CHECKING:\n from .json_schema import JsonSchemaMode, JsonSchemaValue\n\n CoreSchemaOrField = Union[\n core_schema.CoreSchema,\n core_schema.ModelField,\n core_schema.DataclassField,\n core_schema.TypedDictField,\n core_schema.ComputedField,\n ]\n\n__all__ = 'GetJsonSchemaHandler', 'GetCoreSchemaHandler'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetJsonSchemaHandler_GetJsonSchemaHandler.__call__.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetJsonSchemaHandler_GetJsonSchemaHandler.__call__.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "pydantic/annotated_handlers.py", "file_name": "annotated_handlers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 45, "span_ids": ["GetJsonSchemaHandler.__call__", "GetJsonSchemaHandler"], "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 GetJsonSchemaHandler:\n \"\"\"Handler to call into the next JSON schema generation function.\n\n Attributes:\n mode: Json schema mode, can be `validation` or `serialization`.\n \"\"\"\n\n mode: JsonSchemaMode\n\n def __call__(self, core_schema: CoreSchemaOrField, /) -> JsonSchemaValue:\n \"\"\"Call the inner handler and get the JsonSchemaValue it returns.\n This will call the next JSON schema modifying function up until it calls\n into `pydantic.json_schema.GenerateJsonSchema`, which will raise a\n `pydantic.errors.PydanticInvalidForJsonSchema` error if it cannot generate\n a JSON schema.\n\n Args:\n core_schema: A `pydantic_core.core_schema.CoreSchema`.\n\n Returns:\n JsonSchemaValue: The JSON schema generated by the inner JSON schema modify\n functions.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetJsonSchemaHandler.resolve_ref_schema_GetJsonSchemaHandler.resolve_ref_schema.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetJsonSchemaHandler.resolve_ref_schema_GetJsonSchemaHandler.resolve_ref_schema.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "pydantic/annotated_handlers.py", "file_name": "annotated_handlers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 61, "span_ids": ["GetJsonSchemaHandler.resolve_ref_schema"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetJsonSchemaHandler:\n\n def resolve_ref_schema(self, maybe_ref_json_schema: JsonSchemaValue, /) -> JsonSchemaValue:\n \"\"\"Get the real schema for a `{\"$ref\": ...}` schema.\n If the schema given is not a `$ref` schema, it will be returned as is.\n This means you don't have to check before calling this function.\n\n Args:\n maybe_ref_json_schema: A JsonSchemaValue which may be a `$ref` schema.\n\n Raises:\n LookupError: If the ref is not found.\n\n Returns:\n JsonSchemaValue: A JsonSchemaValue that has no `$ref`.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler_GetCoreSchemaHandler.__call__.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler_GetCoreSchemaHandler.__call__.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "pydantic/annotated_handlers.py", "file_name": "annotated_handlers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 80, "span_ids": ["GetCoreSchemaHandler.__call__", "GetCoreSchemaHandler"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetCoreSchemaHandler:\n \"\"\"Handler to call into the next CoreSchema schema generation function.\"\"\"\n\n def __call__(self, source_type: Any, /) -> core_schema.CoreSchema:\n \"\"\"Call the inner handler and get the CoreSchema it returns.\n This will call the next CoreSchema modifying function up until it calls\n into Pydantic's internal schema generation machinery, which will raise a\n `pydantic.errors.PydanticSchemaGenerationError` error if it cannot generate\n a CoreSchema for the given source type.\n\n Args:\n source_type: The input type.\n\n Returns:\n CoreSchema: The `pydantic-core` CoreSchema generated.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler.generate_schema_GetCoreSchemaHandler.generate_schema.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler.generate_schema_GetCoreSchemaHandler.generate_schema.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "pydantic/annotated_handlers.py", "file_name": "annotated_handlers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 95, "span_ids": ["GetCoreSchemaHandler.generate_schema"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetCoreSchemaHandler:\n\n def generate_schema(self, source_type: Any, /) -> core_schema.CoreSchema:\n \"\"\"Generate a schema unrelated to the current context.\n Use this function if e.g. you are handling schema generation for a sequence\n and want to generate a schema for its items.\n Otherwise, you may end up doing something like applying a `min_length` constraint\n that was intended for the sequence itself to its items!\n\n Args:\n source_type: The input type.\n\n Returns:\n CoreSchema: The `pydantic-core` CoreSchema generated.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler.resolve_ref_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/annotated_handlers.py_GetCoreSchemaHandler.resolve_ref_schema_", "embedding": null, "metadata": {"file_path": "pydantic/annotated_handlers.py", "file_name": "annotated_handlers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 121, "span_ids": ["GetCoreSchemaHandler.resolve_ref_schema", "GetCoreSchemaHandler.field_name", "GetCoreSchemaHandler._get_types_namespace"], "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 GetCoreSchemaHandler:\n\n def resolve_ref_schema(self, maybe_ref_schema: core_schema.CoreSchema, /) -> core_schema.CoreSchema:\n \"\"\"Get the real schema for a `definition-ref` schema.\n If the schema given is not a `definition-ref` schema, it will be returned as is.\n This means you don't have to check before calling this function.\n\n Args:\n maybe_ref_schema: A `CoreSchema`, `ref`-based or not.\n\n Raises:\n LookupError: If the `ref` is not found.\n\n Returns:\n A concrete `CoreSchema`.\n \"\"\"\n raise NotImplementedError\n\n @property\n def field_name(self) -> str | None:\n \"\"\"Get the name of the closest field to this validator.\"\"\"\n raise NotImplementedError\n\n def _get_types_namespace(self) -> dict[str, Any] | None:\n \"\"\"Internal method used during type resolution for serializer annotations.\"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/color.py_parse_float_alpha_parse_float_alpha.if_math_isclose_alpha_1_.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_math_isclose_alpha_1_.else_.raise_PydanticCustomError", "embedding": null, "metadata": {"file_path": "pydantic/color.py", "file_name": "color.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 407, "span_ids": ["parse_float_alpha"], "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 parse_float_alpha(value: Union[None, str, float, int]) -> Optional[float]:\n \"\"\"Parse an alpha value checking it's a valid float in the range 0 to 1.\n\n Args:\n value: The input value to parse.\n\n Returns:\n The parsed value as a float, or `None` if the value was None or equal 1.\n\n Raises:\n PydanticCustomError: If the input value cannot be successfully parsed as a float in the expected range.\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 math.isclose(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/config.py__Configuration_for_Pyda_ExtraValues.Literal_allow_ignore_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__Configuration_for_Pyda_ExtraValues.Literal_allow_ignore_", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["docstring"], "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": "\"\"\"Configuration for Pydantic models.\"\"\"\nfrom __future__ import annotations as _annotations\n\nfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Type, TypeVar, Union\n\nfrom typing_extensions import Literal, TypeAlias, TypedDict\n\nfrom ._migration import getattr_migration\nfrom .aliases import AliasGenerator\n\nif TYPE_CHECKING:\n from ._internal._generate_schema import GenerateSchema as _GenerateSchema\n\n__all__ = ('ConfigDict', 'with_config')\n\n\nJsonValue: TypeAlias = Union[int, float, str, bool, None, List['JsonValue'], 'JsonDict']\nJsonDict: TypeAlias = Dict[str, JsonValue]\n\nJsonEncoder = Callable[[Any], Any]\n\nJsonSchemaExtraCallable: TypeAlias = Union[\n Callable[[JsonDict], None],\n Callable[[JsonDict, Type[Any]], None],\n]\n\nExtraValues = Literal['allow', 'ignore', '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.populate_by_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict_ConfigDict.populate_by_name", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 131, "span_ids": ["ConfigDict"], "tokens": 670}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"A TypedDict for configuring Pydantic behaviour.\"\"\"\n\n title: str | None\n \"\"\"The title for the generated JSON schema, defaults to the model's name\"\"\"\n\n str_to_lower: bool\n \"\"\"Whether to convert all characters to lowercase for str types. Defaults to `False`.\"\"\"\n\n str_to_upper: bool\n \"\"\"Whether to convert all characters to uppercase for str types. Defaults to `False`.\"\"\"\n str_strip_whitespace: bool\n \"\"\"Whether to strip leading and trailing whitespace for str types.\"\"\"\n\n str_min_length: int\n \"\"\"The minimum length for str types. Defaults to `None`.\"\"\"\n\n str_max_length: int | None\n \"\"\"The maximum length for str types. Defaults to `None`.\"\"\"\n\n extra: ExtraValues | None\n \"\"\"\n Whether to ignore, allow, or forbid extra attributes during model initialization. Defaults to `'ignore'`.\n\n You can configure how pydantic handles the attributes that are not defined in the model:\n\n * `allow` - Allow any extra attributes.\n * `forbid` - Forbid any extra attributes.\n * `ignore` - Ignore any extra attributes.\n\n ```py\n from pydantic import BaseModel, ConfigDict\n\n\n class User(BaseModel):\n model_config = ConfigDict(extra='ignore') # (1)!\n\n name: str\n\n\n user = User(name='John Doe', age=20) # (2)!\n print(user)\n #> name='John Doe'\n ```\n\n 1. This is the default behaviour.\n 2. The `age` argument is ignored.\n\n Instead, with `extra='allow'`, the `age` argument is included:\n\n ```py\n from pydantic import BaseModel, ConfigDict\n\n\n class User(BaseModel):\n model_config = ConfigDict(extra='allow')\n\n name: str\n\n\n user = User(name='John Doe', age=20) # (1)!\n print(user)\n #> name='John Doe' age=20\n ```\n\n 1. The `age` argument is included.\n\n With `extra='forbid'`, an error is raised:\n\n ```py\n from pydantic import BaseModel, ConfigDict, ValidationError\n\n\n class User(BaseModel):\n model_config = ConfigDict(extra='forbid')\n\n name: str\n\n\n try:\n User(name='John Doe', age=20)\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for User\n age\n Extra inputs are not permitted [type=extra_forbidden, input_value=20, input_type=int]\n '''\n ```\n \"\"\"\n\n frozen: bool\n \"\"\"\n Whether models are faux-immutable, i.e. whether `__setattr__` is allowed, and also generates\n a `__hash__()` method for the model. This makes instances of the model potentially hashable if all the\n attributes are hashable. Defaults to `False`.\n\n Note:\n On V1, the inverse of this setting was called `allow_mutation`, and was `True` by default.\n \"\"\"\n\n populate_by_name: 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_ConfigDict.None_9_ConfigDict.validate_assignment": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_9_ConfigDict.validate_assignment", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 203, "span_ids": ["ConfigDict"], "tokens": 573}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"\n Whether an aliased field may be populated by its name as given by the model\n attribute, as well as the alias. Defaults to `False`.\n\n Note:\n The name of this configuration setting was changed in **v2.0** from\n `allow_population_by_field_name` to `populate_by_name`.\n\n ```py\n from pydantic import BaseModel, ConfigDict, Field\n\n\n class User(BaseModel):\n model_config = ConfigDict(populate_by_name=True)\n\n name: str = Field(alias='full_name') # (1)!\n age: int\n\n\n user = User(full_name='John Doe', age=20) # (2)!\n print(user)\n #> name='John Doe' age=20\n user = User(name='John Doe', age=20) # (3)!\n print(user)\n #> name='John Doe' age=20\n ```\n\n 1. The field `'name'` has an alias `'full_name'`.\n 2. The model is populated by the alias `'full_name'`.\n 3. The model is populated by the field name `'name'`.\n \"\"\"\n\n use_enum_values: bool\n \"\"\"\n Whether to populate models with the `value` property of enums, rather than the raw enum.\n This may be useful if you want to serialize `model.model_dump()` later. Defaults to `False`.\n\n !!! note\n If you have an `Optional[Enum]` value that you set a default for, you need to use `validate_default=True`\n for said Field to ensure that the `use_enum_values` flag takes effect on the default, as extracting an\n enum's value occurs during validation, not serialization.\n\n ```py\n from enum import Enum\n from typing import Optional\n\n from pydantic import BaseModel, ConfigDict, Field\n\n\n class SomeEnum(Enum):\n FOO = 'foo'\n BAR = 'bar'\n BAZ = 'baz'\n\n\n class SomeModel(BaseModel):\n model_config = ConfigDict(use_enum_values=True)\n\n some_enum: SomeEnum\n another_enum: Optional[SomeEnum] = Field(default=SomeEnum.FOO, validate_default=True)\n\n\n model1 = SomeModel(some_enum=SomeEnum.BAR)\n print(model1.model_dump())\n # {'some_enum': 'bar', 'another_enum': 'foo'}\n\n model2 = SomeModel(some_enum=SomeEnum.BAR, another_enum=SomeEnum.BAZ)\n print(model2.model_dump())\n #> {'some_enum': 'bar', 'another_enum': 'baz'}\n ```\n \"\"\"\n\n validate_assignment: 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_ConfigDict.None_11_ConfigDict.arbitrary_types_allowed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_11_ConfigDict.arbitrary_types_allowed", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 255, "span_ids": ["ConfigDict"], "tokens": 384}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigDict(TypedDict, total=False):\n \"\"\"\n Whether to validate the data when the model is changed. Defaults to `False`.\n\n The default behavior of Pydantic is to validate the data when the model is created.\n\n In case the user changes the data after the model is created, the model is _not_ revalidated.\n\n ```py\n from pydantic import BaseModel\n\n class User(BaseModel):\n name: str\n\n user = User(name='John Doe') # (1)!\n print(user)\n #> name='John Doe'\n user.name = 123 # (1)!\n print(user)\n #> name=123\n ```\n\n 1. The validation happens only when the model is created.\n 2. The validation does not happen when the data is changed.\n\n In case you want to revalidate the model when the data is changed, you can use `validate_assignment=True`:\n\n ```py\n from pydantic import BaseModel, ValidationError\n\n class User(BaseModel, validate_assignment=True): # (1)!\n name: str\n\n user = User(name='John Doe') # (2)!\n print(user)\n #> name='John Doe'\n try:\n user.name = 123 # (3)!\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for User\n name\n Input should be a valid string [type=string_type, input_value=123, input_type=int]\n '''\n ```\n\n 1. You can either use class keyword arguments, or `model_config` to set `validate_assignment=True`.\n 2. The validation happens when the model is created.\n 3. The validation _also_ happens when the data is changed.\n \"\"\"\n\n arbitrary_types_allowed: 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_ConfigDict.None_12_ConfigDict.alias_generator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_12_ConfigDict.alias_generator", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 319, "span_ids": ["ConfigDict"], "tokens": 536}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"\n Whether arbitrary types are allowed for field types. Defaults to `False`.\n\n ```py\n from pydantic import BaseModel, ConfigDict, ValidationError\n\n # This is not a pydantic model, it's an arbitrary class\n class Pet:\n def __init__(self, name: str):\n self.name = name\n\n class Model(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n pet: Pet\n owner: str\n\n pet = Pet(name='Hedwig')\n # A simple check of instance type is used to validate the data\n model = Model(owner='Harry', pet=pet)\n print(model)\n #> pet=<__main__.Pet object at 0x0123456789ab> owner='Harry'\n print(model.pet)\n #> <__main__.Pet object at 0x0123456789ab>\n print(model.pet.name)\n #> Hedwig\n print(type(model.pet))\n #> \n try:\n # If the value is not an instance of the type, it's invalid\n Model(owner='Harry', pet='Hedwig')\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n pet\n Input should be an instance of Pet [type=is_instance_of, input_value='Hedwig', input_type=str]\n '''\n\n # Nothing in the instance of the arbitrary type is checked\n # Here name probably should have been a str, but it's not validated\n pet2 = Pet(name=42)\n model2 = Model(owner='Harry', pet=pet2)\n print(model2)\n #> pet=<__main__.Pet object at 0x0123456789ab> owner='Harry'\n print(model2.pet)\n #> <__main__.Pet object at 0x0123456789ab>\n print(model2.pet.name)\n #> 42\n print(type(model2.pet))\n #> \n ```\n \"\"\"\n\n from_attributes: bool\n \"\"\"\n Whether to build models and look up discriminators of tagged unions using python object attributes.\n \"\"\"\n\n loc_by_alias: bool\n \"\"\"Whether to use the actual key provided in the data (e.g. alias) for error `loc`s rather than the field's name. Defaults to `True`.\"\"\"\n\n alias_generator: Callable[[str], str] | AliasGenerator | 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/config.py_ConfigDict.None_23_ConfigDict.None_23": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_23_ConfigDict.None_23", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 523, "span_ids": ["ConfigDict"], "tokens": 1009}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"\n When and how to revalidate models and dataclasses during validation. Accepts the string\n values of `'never'`, `'always'` and `'subclass-instances'`. Defaults to `'never'`.\n\n - `'never'` will not revalidate models and dataclasses during validation\n - `'always'` will revalidate models and dataclasses during validation\n - `'subclass-instances'` will revalidate models and dataclasses during validation if the instance is a\n subclass of the model or dataclass\n\n By default, model and dataclass instances are not revalidated during validation.\n\n ```py\n from typing import List\n\n from pydantic import BaseModel\n\n class User(BaseModel, revalidate_instances='never'): # (1)!\n hobbies: List[str]\n\n class SubUser(User):\n sins: List[str]\n\n class Transaction(BaseModel):\n user: User\n\n my_user = User(hobbies=['reading'])\n t = Transaction(user=my_user)\n print(t)\n #> user=User(hobbies=['reading'])\n\n my_user.hobbies = [1] # (2)!\n t = Transaction(user=my_user) # (3)!\n print(t)\n #> user=User(hobbies=[1])\n\n my_sub_user = SubUser(hobbies=['scuba diving'], sins=['lying'])\n t = Transaction(user=my_sub_user)\n print(t)\n #> user=SubUser(hobbies=['scuba diving'], sins=['lying'])\n ```\n\n 1. `revalidate_instances` is set to `'never'` by **default.\n 2. The assignment is not validated, unless you set `validate_assignment` to `True` in the model's config.\n 3. Since `revalidate_instances` is set to `never`, this is not revalidated.\n\n If you want to revalidate instances during validation, you can set `revalidate_instances` to `'always'`\n in the model's config.\n\n ```py\n from typing import List\n\n from pydantic import BaseModel, ValidationError\n\n class User(BaseModel, revalidate_instances='always'): # (1)!\n hobbies: List[str]\n\n class SubUser(User):\n sins: List[str]\n\n class Transaction(BaseModel):\n user: User\n\n my_user = User(hobbies=['reading'])\n t = Transaction(user=my_user)\n print(t)\n #> user=User(hobbies=['reading'])\n\n my_user.hobbies = [1]\n try:\n t = Transaction(user=my_user) # (2)!\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Transaction\n user.hobbies.0\n Input should be a valid string [type=string_type, input_value=1, input_type=int]\n '''\n\n my_sub_user = SubUser(hobbies=['scuba diving'], sins=['lying'])\n t = Transaction(user=my_sub_user)\n print(t) # (3)!\n #> user=User(hobbies=['scuba diving'])\n ```\n\n 1. `revalidate_instances` is set to `'always'`.\n 2. The model is revalidated, since `revalidate_instances` is set to `'always'`.\n 3. Using `'never'` we would have gotten `user=SubUser(hobbies=['scuba diving'], sins=['lying'])`.\n\n It's also possible to set `revalidate_instances` to `'subclass-instances'` to only revalidate instances\n of subclasses of the model.\n\n ```py\n from typing import List\n\n from pydantic import BaseModel\n\n class User(BaseModel, revalidate_instances='subclass-instances'): # (1)!\n hobbies: List[str]\n\n class SubUser(User):\n sins: List[str]\n\n class Transaction(BaseModel):\n user: User\n\n my_user = User(hobbies=['reading'])\n t = Transaction(user=my_user)\n print(t)\n #> user=User(hobbies=['reading'])\n\n my_user.hobbies = [1]\n t = Transaction(user=my_user) # (2)!\n print(t)\n #> user=User(hobbies=[1])\n\n my_sub_user = SubUser(hobbies=['scuba diving'], sins=['lying'])\n t = Transaction(user=my_sub_user)\n print(t) # (3)!\n #> user=User(hobbies=['scuba diving'])\n ```\n\n 1. `revalidate_instances` is set to `'subclass-instances'`.\n 2. This is not revalidated, since `my_user` is not a subclass of `User`.\n 3. Using `'never'` we would have gotten `user=SubUser(hobbies=['scuba diving'], sins=['lying'])`.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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___getattr___if_3_8_sys_version_.dataclasses.InitVar.__call__._call_initvar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py___getattr___if_3_8_sys_version_.dataclasses.InitVar.__call__._call_initvar", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 251, "span_ids": ["impl:9"], "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": "__getattr__ = getattr_migration(__name__)\n\nif (3, 8) <= sys.version_info < (3, 11):\n # Monkeypatch dataclasses.InitVar so that typing doesn't error if it occurs as a type when evaluating type hints\n # Starting in 3.11, typing.get_type_hints will not raise an error if the retrieved type hints are not callable.\n\n def _call_initvar(*args: Any, **kwargs: Any) -> NoReturn:\n \"\"\"This function does nothing but raise an error that is as similar as possible to what you'd get\n if you were to try calling `InitVar[int]()` without this monkeypatch. The whole purpose is just\n to ensure typing._type_check does not error if the type hint evaluates to `InitVar[]`.\n \"\"\"\n raise TypeError(\"'InitVar' object is not callable\")\n\n dataclasses.InitVar.__call__ = _call_initvar", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/class_validators.py__Old_validator_and__if_TYPE_CHECKING_.else_.DeprecationWarning.PydanticDeprecatedSince20": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/class_validators.py__Old_validator_and__if_TYPE_CHECKING_.else_.DeprecationWarning.PydanticDeprecatedSince20", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/class_validators.py", "file_name": "class_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 79, "span_ids": ["docstring"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Old `@validator` and `@root_validator` function validators from V1.\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nfrom functools import partial, partialmethod\nfrom types import FunctionType\nfrom typing import TYPE_CHECKING, Any, Callable, TypeVar, Union, overload\nfrom warnings import warn\n\nfrom typing_extensions import Literal, Protocol, TypeAlias, deprecated\n\nfrom .._internal import _decorators, _decorators_v1\nfrom ..errors import PydanticUserError\nfrom ..warnings import PydanticDeprecatedSince20\n\n_ALLOW_REUSE_WARNING_MESSAGE = '`allow_reuse` is deprecated and will be ignored; it should no longer be necessary'\n\n\nif TYPE_CHECKING:\n\n class _OnlyValueValidatorClsMethod(Protocol):\n def __call__(self, __cls: Any, __value: Any) -> Any:\n ...\n\n class _V1ValidatorWithValuesClsMethod(Protocol):\n def __call__(self, __cls: Any, __value: Any, values: dict[str, Any]) -> Any:\n ...\n\n class _V1ValidatorWithValuesKwOnlyClsMethod(Protocol):\n def __call__(self, __cls: Any, __value: Any, *, values: dict[str, Any]) -> Any:\n ...\n\n class _V1ValidatorWithKwargsClsMethod(Protocol):\n def __call__(self, __cls: Any, **kwargs: Any) -> Any:\n ...\n\n class _V1ValidatorWithValuesAndKwargsClsMethod(Protocol):\n def __call__(self, __cls: Any, values: dict[str, Any], **kwargs: Any) -> Any:\n ...\n\n class _V1RootValidatorClsMethod(Protocol):\n def __call__(\n self, __cls: Any, __values: _decorators_v1.RootValidatorValues\n ) -> _decorators_v1.RootValidatorValues:\n ...\n\n V1Validator = Union[\n _OnlyValueValidatorClsMethod,\n _V1ValidatorWithValuesClsMethod,\n _V1ValidatorWithValuesKwOnlyClsMethod,\n _V1ValidatorWithKwargsClsMethod,\n _V1ValidatorWithValuesAndKwargsClsMethod,\n _decorators_v1.V1ValidatorWithValues,\n _decorators_v1.V1ValidatorWithValuesKwOnly,\n _decorators_v1.V1ValidatorWithKwargs,\n _decorators_v1.V1ValidatorWithValuesAndKwargs,\n ]\n\n V1RootValidator = Union[\n _V1RootValidatorClsMethod,\n _decorators_v1.V1RootValidatorFunction,\n ]\n\n _PartialClsOrStaticMethod: TypeAlias = Union[classmethod[Any, Any, Any], staticmethod[Any, Any], partialmethod[Any]]\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', V1Validator, _PartialClsOrStaticMethod)\n _V1RootValidatorFunctionType = TypeVar(\n '_V1RootValidatorFunctionType',\n _decorators_v1.V1RootValidatorFunction,\n _V1RootValidatorClsMethod,\n _PartialClsOrStaticMethod,\n )\nelse:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/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/deprecated/config.py_BaseConfig_BaseConfig.__init_subclass__.return.super___init_subclass__", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 51, "span_ids": ["BaseConfig", "BaseConfig.__getattr__", "BaseConfig.__init_subclass__"], "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": "@deprecated('BaseConfig is deprecated. Use the `pydantic.ConfigDict` instead.', category=PydanticDeprecatedSince20)\nclass BaseConfig(metaclass=_ConfigMetaclass):\n \"\"\"This class is only retained for backwards compatibility.\n\n !!! Warning \"Deprecated\"\n BaseConfig is deprecated. Use the [`pydantic.ConfigDict`][pydantic.ConfigDict] instead.\n \"\"\"\n\n def __getattr__(self, item: str) -> Any:\n try:\n obj = super().__getattribute__(item)\n warnings.warn(_config.DEPRECATION_MESSAGE, DeprecationWarning)\n return obj\n except AttributeError as exc:\n try:\n return getattr(type(self), item)\n except AttributeError:\n # re-raising 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(_config.DEPRECATION_MESSAGE, DeprecationWarning)\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/deprecated/config.py__ExtraMeta_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/config.py__ExtraMeta_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 72, "span_ids": ["_ExtraMeta.__getattribute__", "_ExtraMeta", "Extra"], "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 _ExtraMeta(type):\n def __getattribute__(self, __name: str) -> Any:\n # The @deprecated decorator accesses other attributes, so we only emit a warning for the expected ones\n if __name in {'allow', 'ignore', 'forbid'}:\n warnings.warn(\n \"`pydantic.config.Extra` is deprecated, use literal values instead (e.g. `extra='allow'`)\",\n DeprecationWarning,\n stacklevel=2,\n )\n return super().__getattribute__(__name)\n\n\n@deprecated(\n \"Extra is deprecated. Use literal values instead (e.g. `extra='allow'`)\", category=PydanticDeprecatedSince20\n)\nclass Extra(metaclass=_ExtraMeta):\n allow: Literal['allow'] = 'allow'\n ignore: Literal['ignore'] = 'ignore'\n forbid: Literal['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/deprecated/parse.py_from___future___import_an_Protocol.pickle._pickle_": {"__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_Protocol.pickle._pickle_", "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": 22, "span_ids": ["imports", "Protocol"], "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": "from __future__ import annotations\n\nimport json\nimport pickle\nimport warnings\nfrom enum import Enum\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING, Any, Callable\n\nfrom typing_extensions import deprecated\n\nfrom ..warnings import PydanticDeprecatedSince20\n\nif not TYPE_CHECKING:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n\n\nclass Protocol(str, Enum):\n json = 'json'\n pickle = 'pickle'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_str_bytes_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_load_str_bytes_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": 25, "end_line": 56, "span_ids": ["load_str_bytes"], "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": "@deprecated('`load_str_bytes` is deprecated.', category=None)\ndef load_str_bytes(\n b: str | bytes,\n *,\n content_type: str | None = None,\n encoding: str = 'utf8',\n proto: Protocol | None = None,\n allow_pickle: bool = False,\n json_loads: Callable[[str], Any] = json.loads,\n) -> Any:\n warnings.warn('`load_str_bytes` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)\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) # type: ignore\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() # type: ignore\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/tools.py_from___future___import_an_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_from___future___import_an_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["imports"], "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": "from __future__ import annotations\n\nimport json\nimport warnings\nfrom typing import TYPE_CHECKING, Any, Callable, Type, TypeVar, Union\n\nfrom typing_extensions import deprecated\n\nfrom ..json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema\nfrom ..type_adapter import TypeAdapter\nfrom ..warnings import PydanticDeprecatedSince20\n\nif not TYPE_CHECKING:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n\n__all__ = 'parse_obj_as', 'schema_of', 'schema_json_of'\n\nNameFactory = Union[str, Callable[[Type[Any]], str]]\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/deprecated/tools.py_parse_obj_as_parse_obj_as.return.TypeAdapter_type__valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/deprecated/tools.py_parse_obj_as_parse_obj_as.return.TypeAdapter_type__valida", "embedding": null, "metadata": {"file_path": "pydantic/deprecated/tools.py", "file_name": "tools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 42, "span_ids": ["parse_obj_as"], "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": "@deprecated(\n '`parse_obj_as` is deprecated. Use `pydantic.TypeAdapter.validate_python` instead.',\n category=None,\n)\ndef parse_obj_as(type_: type[T], obj: Any, type_name: NameFactory | None = None) -> T:\n warnings.warn(\n '`parse_obj_as` is deprecated. Use `pydantic.TypeAdapter.validate_python` instead.',\n category=PydanticDeprecatedSince20,\n stacklevel=2,\n )\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 TypeAdapter(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/fields.py_FieldInfo.merge_field_infos_FieldInfo.merge_field_infos.return.field_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.merge_field_infos_FieldInfo.merge_field_infos.return.field_info", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 408, "end_line": 447, "span_ids": ["FieldInfo.merge_field_infos"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def merge_field_infos(*field_infos: FieldInfo, **overrides: Any) -> FieldInfo:\n \"\"\"Merge `FieldInfo` instances keeping only explicitly set attributes.\n\n Later `FieldInfo` instances override earlier ones.\n\n Returns:\n FieldInfo: A merged FieldInfo instance.\n \"\"\"\n flattened_field_infos: list[FieldInfo] = []\n for field_info in field_infos:\n flattened_field_infos.extend(x for x in field_info.metadata if isinstance(x, FieldInfo))\n flattened_field_infos.append(field_info)\n field_infos = tuple(flattened_field_infos)\n if len(field_infos) == 1:\n # No merging necessary, but we still need to make a copy and apply the overrides\n field_info = copy(field_infos[0])\n field_info._attributes_set.update(overrides)\n\n default_override = overrides.pop('default', PydanticUndefined)\n if default_override is Ellipsis:\n default_override = PydanticUndefined\n if default_override is not PydanticUndefined:\n field_info.default = default_override\n\n for k, v in overrides.items():\n setattr(field_info, k, v)\n return field_info # type: ignore\n\n new_kwargs: dict[str, Any] = {}\n metadata = {}\n for field_info in field_infos:\n new_kwargs.update(field_info._attributes_set)\n for x in field_info.metadata:\n if not isinstance(x, FieldInfo):\n metadata[type(x)] = x\n new_kwargs.update(overrides)\n field_info = FieldInfo(**new_kwargs)\n field_info.metadata = list(metadata.values())\n return field_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/fields.py_FieldInfo._from_dataclass_field_FieldInfo._from_dataclass_field.return.Field_default_default_de": {"__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_default_default_de", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 433, "span_ids": ["FieldInfo._from_dataclass_field"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def _from_dataclass_field(dc_field: DataclassField[Any]) -> FieldInfo:\n \"\"\"Return a new `FieldInfo` instance from a `dataclasses.Field` instance.\n\n Args:\n dc_field: The `dataclasses.Field` instance to convert.\n\n Returns:\n The corresponding `FieldInfo` instance.\n\n Raises:\n TypeError: If any of the `FieldInfo` kwargs does not match the `dataclass.Field` kwargs.\n \"\"\"\n default = dc_field.default\n if default is dataclasses.MISSING:\n default = PydanticUndefined\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 dc_field_metadata = {k: v for k, v in dc_field.metadata.items() if k in _FIELD_ARG_NAMES}\n return Field(default=default, default_factory=default_factory, repr=dc_field.repr, **dc_field_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._extract_metadata_FieldInfo._extract_metadata.return.annotation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._extract_metadata_FieldInfo._extract_metadata.return.annotation_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 435, "end_line": 450, "span_ids": ["FieldInfo._extract_metadata"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def _extract_metadata(annotation: type[Any] | None) -> tuple[type[Any] | None, list[Any]]:\n \"\"\"Tries to extract metadata/constraints from an annotation if it uses `Annotated`.\n\n Args:\n annotation: The type hint annotation for which metadata has to be extracted.\n\n Returns:\n A tuple containing the extracted metadata type and the list of extra arguments.\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 return first_arg, list(extra_args)\n\n return 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__EmptyKwargs__DefaultValues.dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__EmptyKwargs__DefaultValues.dict_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 624, "end_line": 659, "span_ids": ["_EmptyKwargs", "impl:15"], "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 _EmptyKwargs(typing_extensions.TypedDict):\n \"\"\"This class exists solely to ensure that type checking warns about passing `**extra` in `Field`.\"\"\"\n\n\n_DefaultValues = dict(\n default=...,\n default_factory=None,\n alias=None,\n alias_priority=None,\n validation_alias=None,\n serialization_alias=None,\n title=None,\n description=None,\n examples=None,\n exclude=None,\n discriminator=None,\n json_schema_extra=None,\n frozen=None,\n validate_default=None,\n repr=True,\n init=None,\n init_var=None,\n kw_only=None,\n pattern=None,\n strict=None,\n gt=None,\n ge=None,\n lt=None,\n le=None,\n multiple_of=None,\n allow_inf_nan=None,\n max_digits=None,\n decimal_places=None,\n min_length=None,\n max_length=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/fields.py_Field_Field._Usage_docs_https_do": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field_Field._Usage_docs_https_do", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 662, "end_line": 757, "span_ids": ["Field"], "tokens": 1326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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( # noqa: C901\n default: Any = PydanticUndefined,\n *,\n default_factory: typing.Callable[[], Any] | None = _Unset,\n alias: str | None = _Unset,\n alias_priority: int | None = _Unset,\n validation_alias: str | AliasPath | AliasChoices | None = _Unset,\n serialization_alias: str | None = _Unset,\n title: str | None = _Unset,\n description: str | None = _Unset,\n examples: list[Any] | None = _Unset,\n exclude: bool | None = _Unset,\n discriminator: str | types.Discriminator | None = _Unset,\n deprecated: Deprecated | str | bool | None = _Unset,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = _Unset,\n frozen: bool | None = _Unset,\n validate_default: bool | None = _Unset,\n repr: bool = _Unset,\n init: bool | None = _Unset,\n init_var: bool | None = _Unset,\n kw_only: bool | None = _Unset,\n pattern: str | None = _Unset,\n strict: bool | None = _Unset,\n gt: float | None = _Unset,\n ge: float | None = _Unset,\n lt: float | None = _Unset,\n le: float | None = _Unset,\n multiple_of: float | None = _Unset,\n allow_inf_nan: bool | None = _Unset,\n max_digits: int | None = _Unset,\n decimal_places: int | None = _Unset,\n min_length: int | None = _Unset,\n max_length: int | None = _Unset,\n union_mode: Literal['smart', 'left_to_right'] = _Unset,\n **extra: Unpack[_EmptyKwargs],\n) -> Any:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/fields\n\n Create a field for objects that can be configured.\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 Note:\n - Any `_Unset` objects will be replaced by the corresponding value defined in the `_DefaultValues` dictionary. If a key for the `_Unset` object is not found in the `_DefaultValues` dictionary, it will default to `None`\n\n Args:\n default: Default value if the field is not set.\n default_factory: A callable to generate the default value, such as :func:`~datetime.utcnow`.\n alias: The name to use for the attribute when validating or serializing by alias.\n This is often used for things like converting between snake and camel case.\n alias_priority: Priority of the alias. This affects whether an alias generator is used.\n validation_alias: Like `alias`, but only affects validation, not serialization.\n serialization_alias: Like `alias`, but only affects serialization, not validation.\n title: Human-readable title.\n description: Human-readable description.\n examples: Example values for this field.\n exclude: Whether to exclude the field from the model serialization.\n discriminator: Field name or Discriminator for discriminating the type in a tagged union.\n deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,\n or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.\n json_schema_extra: A dict or callable to provide extra JSON schema properties.\n frozen: Whether the field is frozen. If true, attempts to change the value on an instance will raise an error.\n validate_default: If `True`, apply validation to the default value every time you create an instance.\n Otherwise, for performance reasons, the default value of the field is trusted and not validated.\n repr: A boolean indicating whether to include the field in the `__repr__` output.\n init: Whether the field should be included in the constructor of the dataclass.\n (Only applies to dataclasses.)\n init_var: Whether the field should _only_ be included in the constructor of the dataclass.\n (Only applies to dataclasses.)\n kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.\n (Only applies to dataclasses.)\n strict: If `True`, strict validation is applied to the field.\n See [Strict Mode](../concepts/strict_mode.md) for details.\n gt: Greater than. If set, value must be greater than this. Only applicable to numbers.\n ge: Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers.\n lt: Less than. If set, value must be less than this. Only applicable to numbers.\n le: Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers.\n multiple_of: Value must be a multiple of this. Only applicable to numbers.\n min_length: Minimum length for iterables.\n max_length: Maximum length for iterables.\n pattern: Pattern for strings (a regular expression).\n allow_inf_nan: Allow `inf`, `-inf`, `nan`. Only applicable to numbers.\n max_digits: Maximum number of allow digits for strings.\n decimal_places: Maximum number of decimal places allowed for numbers.\n union_mode: The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`.\n See [Union Mode](standard_library_types.md#union-mode) for details.\n extra: (Deprecated) Extra fields that will be included in the JSON schema.\n\n !!! warning Deprecated\n The `extra` kwargs is deprecated. Use `json_schema_extra` instead.\n\n Returns:\n A new [`FieldInfo`][pydantic.fields.FieldInfo]. The return annotation is `Any` so `Field` can be used on\n type-annotated fields without causing a type error.\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_ARG_NAMES_remove_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field.return__FIELD_ARG_NAMES_remove_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 822, "end_line": 859, "span_ids": ["Field", "impl:17"], "tokens": 654}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def Field( # noqa: C901\n default: Any = PydanticUndefined,\n *,\n default_factory: typing.Callable[[], Any] | None = _Unset,\n alias: str | None = _Unset,\n alias_priority: int | None = _Unset,\n validation_alias: str | AliasPath | AliasChoices | None = _Unset,\n serialization_alias: str | None = _Unset,\n title: str | None = _Unset,\n description: str | None = _Unset,\n examples: list[Any] | None = _Unset,\n exclude: bool | None = _Unset,\n discriminator: str | types.Discriminator | None = _Unset,\n deprecated: Deprecated | str | bool | None = _Unset,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = _Unset,\n frozen: bool | None = _Unset,\n validate_default: bool | None = _Unset,\n repr: bool = _Unset,\n init: bool | None = _Unset,\n init_var: bool | None = _Unset,\n kw_only: bool | None = _Unset,\n pattern: str | None = _Unset,\n strict: bool | None = _Unset,\n gt: float | None = _Unset,\n ge: float | None = _Unset,\n lt: float | None = _Unset,\n le: float | None = _Unset,\n multiple_of: float | None = _Unset,\n allow_inf_nan: bool | None = _Unset,\n max_digits: int | None = _Unset,\n decimal_places: int | None = _Unset,\n min_length: int | None = _Unset,\n max_length: int | None = _Unset,\n union_mode: Literal['smart', 'left_to_right'] = _Unset,\n **extra: Unpack[_EmptyKwargs],\n) -> Any:\n # ... other code\n\n return FieldInfo.from_field(\n default,\n default_factory=default_factory,\n alias=alias,\n alias_priority=alias_priority,\n validation_alias=validation_alias,\n serialization_alias=serialization_alias,\n title=title,\n description=description,\n examples=examples,\n exclude=exclude,\n discriminator=discriminator,\n deprecated=deprecated,\n json_schema_extra=json_schema_extra,\n frozen=frozen,\n pattern=pattern,\n validate_default=validate_default,\n repr=repr,\n init=init,\n init_var=init_var,\n kw_only=kw_only,\n strict=strict,\n gt=gt,\n ge=ge,\n lt=lt,\n le=le,\n multiple_of=multiple_of,\n min_length=min_length,\n max_length=max_length,\n allow_inf_nan=allow_inf_nan,\n max_digits=max_digits,\n decimal_places=decimal_places,\n union_mode=union_mode,\n )\n\n\n_FIELD_ARG_NAMES = set(inspect.signature(Field).parameters)\n_FIELD_ARG_NAMES.remove('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/pydantic/fields.py__do_not_include_the_vark_ModelPrivateAttr.__set_name__.if_callable_set_name_.set_name_cls_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__do_not_include_the_vark_ModelPrivateAttr.__set_name__.if_callable_set_name_.set_name_cls_name_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 859, "end_line": 903, "span_ids": ["ModelPrivateAttr.__init__", "ModelPrivateAttr.__set_name__", "ModelPrivateAttr", "impl:17", "ModelPrivateAttr:5"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # do not include the varkwargs parameter\n\n\nclass ModelPrivateAttr(_repr.Representation):\n \"\"\"A descriptor for private attributes in class models.\n\n !!! warning\n You generally shouldn't be creating `ModelPrivateAttr` instances directly, instead use\n `pydantic.fields.PrivateAttr`. (This is similar to `FieldInfo` vs. `Field`.)\n\n Attributes:\n default: The default value of the attribute if not provided.\n default_factory: A callable function that generates the default value of the\n attribute if not provided.\n \"\"\"\n\n __slots__ = 'default', 'default_factory'\n\n def __init__(\n self, default: Any = PydanticUndefined, *, default_factory: typing.Callable[[], Any] | None = None\n ) -> None:\n self.default = default\n self.default_factory = default_factory\n\n if not typing.TYPE_CHECKING:\n # We put `__getattr__` in a non-TYPE_CHECKING block because otherwise, mypy allows arbitrary attribute access\n\n def __getattr__(self, item: str) -> Any:\n \"\"\"This function improves compatibility with custom descriptors by ensuring delegation happens\n as expected when the default value of a private attribute is a descriptor.\n \"\"\"\n if item in {'__get__', '__set__', '__delete__'}:\n if hasattr(self.default, item):\n return getattr(self.default, item)\n raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')\n\n def __set_name__(self, cls: type[Any], name: str) -> None:\n \"\"\"Preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487.\"\"\"\n if self.default is PydanticUndefined:\n return\n if not hasattr(self.default, '__set_name__'):\n return\n set_name = self.default.__set_name__\n if callable(set_name):\n set_name(cls, name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_5.dec_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_5.dec_", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1192, "end_line": 1229, "span_ids": ["computed_field_5"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def computed_field(\n func: PropertyT | None = None,\n /,\n *,\n alias: str | None = None,\n alias_priority: int | None = None,\n title: str | None = None,\n description: str | None = None,\n deprecated: Deprecated | str | bool | None = None,\n examples: list[Any] | None = None,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = None,\n repr: bool | None = None,\n return_type: Any = PydanticUndefined,\n) -> PropertyT | typing.Callable[[PropertyT], PropertyT]:\n\n def dec(f: Any) -> Any:\n nonlocal description, deprecated, return_type, alias_priority\n unwrapped = _decorators.unwrap_wrapped_function(f)\n\n if description is None and unwrapped.__doc__:\n description = inspect.cleandoc(unwrapped.__doc__)\n\n if deprecated is None and hasattr(unwrapped, '__deprecated__'):\n deprecated = unwrapped.__deprecated__\n\n # if the function isn't already decorated with `@property` (or another descriptor), then we wrap it now\n f = _decorators.ensure_property(f)\n alias_priority = (alias_priority or 2) if alias is not None else None\n\n if repr is None:\n repr_: bool = not _wrapped_property_is_private(property_=f)\n else:\n repr_ = repr\n\n dec_info = ComputedFieldInfo(\n f,\n return_type,\n alias,\n alias_priority,\n title,\n description,\n deprecated,\n examples,\n json_schema_extra,\n repr_,\n )\n return _decorators.PydanticDescriptorProxy(f, dec_info)\n\n if func is None:\n return dec\n else:\n return dec(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/functional_serializers.py__This_module_contains_r_GetCoreSchemaHandler": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py__This_module_contains_r_GetCoreSchemaHandler", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["docstring"], "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": "\"\"\"This module contains related classes and functions for serialization.\"\"\"\nfrom __future__ import annotations\n\nimport dataclasses\nfrom functools import partialmethod\nfrom typing import TYPE_CHECKING, Any, Callable, TypeVar, Union, overload\n\nfrom pydantic_core import PydanticUndefined, core_schema\nfrom pydantic_core import core_schema as _core_schema\nfrom typing_extensions import Annotated, Literal, TypeAlias\n\nfrom . import PydanticUndefinedAnnotation\nfrom ._internal import _decorators, _internal_dataclass\nfrom .annotated_handlers import GetCoreSchemaHandler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_PlainSerializer_PlainSerializer.when_used._always_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_PlainSerializer_PlainSerializer.when_used._always_", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 52, "span_ids": ["PlainSerializer"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@dataclasses.dataclass(**_internal_dataclass.slots_true, frozen=True)\nclass PlainSerializer:\n \"\"\"Plain serializers use a function to modify the output of serialization.\n\n This is particularly helpful when you want to customize the serialization for annotated types.\n Consider an input of `list`, which will be serialized into a space-delimited string.\n\n ```python\n from typing import List\n\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, PlainSerializer\n\n CustomStr = Annotated[\n List, PlainSerializer(lambda x: ' '.join(x), return_type=str)\n ]\n\n class StudentModel(BaseModel):\n courses: CustomStr\n\n student = StudentModel(courses=['Math', 'Chemistry', 'English'])\n print(student.model_dump())\n #> {'courses': 'Math Chemistry English'}\n ```\n\n Attributes:\n func: The serializer function.\n return_type: The return type for the function. If omitted it will be inferred from the type annotation.\n when_used: Determines when this serializer should be used. Accepts a string with values `'always'`,\n `'unless-none'`, `'json'`, and `'json-unless-none'`. Defaults to 'always'.\n \"\"\"\n\n func: core_schema.SerializerFunction\n return_type: Any = PydanticUndefined\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_field_serializer_3_field_serializer_3.return.dec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_field_serializer_3_field_serializer_3.return.dec", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 288, "span_ids": ["field_serializer_3"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def field_serializer(\n *fields: str,\n mode: Literal['plain', 'wrap'] = 'plain',\n return_type: Any = PydanticUndefined,\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always',\n check_fields: bool | None = None,\n) -> Callable[[Any], Any]:\n \"\"\"Decorator that enables custom field serialization.\n\n In the below example, a field of type `set` is used to mitigate duplication. A `field_serializer` is used to serialize the data as a sorted list.\n\n ```python\n from typing import Set\n\n from pydantic import BaseModel, field_serializer\n\n class StudentModel(BaseModel):\n name: str = 'Jane'\n courses: Set[str]\n\n @field_serializer('courses', when_used='json')\n def serialize_courses_in_order(courses: Set[str]):\n return sorted(courses)\n\n student = StudentModel(courses={'Math', 'Chemistry', 'English'})\n print(student.model_dump_json())\n #> {\"name\":\"Jane\",\"courses\":[\"Chemistry\",\"English\",\"Math\"]}\n ```\n\n See [Custom serializers](../concepts/serialization.md#custom-serializers) for more information.\n\n Four signatures are supported:\n\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 Args:\n fields: Which field(s) the method should be called on.\n mode: The serialization mode.\n\n - `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\n default serialization logic.\n return_type: Optional return type for the function, if omitted it will be inferred from the type annotation.\n when_used: Determines the serializer will be used for serialization.\n check_fields: Whether to check that the fields actually exist on the model.\n\n Returns:\n The decorator function.\n \"\"\"\n\n def dec(\n f: Callable[..., Any] | staticmethod[Any, Any] | classmethod[Any, Any, Any],\n ) -> _decorators.PydanticDescriptorProxy[Any]:\n dec_info = _decorators.FieldSerializerDecoratorInfo(\n fields=fields,\n mode=mode,\n return_type=return_type,\n when_used=when_used,\n check_fields=check_fields,\n )\n return _decorators.PydanticDescriptorProxy(f, dec_info)\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/functional_validators.py_AfterValidator_AfterValidator.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AfterValidator_AfterValidator.func", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 71, "span_ids": ["AfterValidator"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass AfterValidator:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validators/#annotated-validators\n\n A metadata class that indicates that a validation should be applied **after** the inner validation logic.\n\n Attributes:\n func: The validator function.\n\n Example:\n ```py\n from typing_extensions import Annotated\n\n from pydantic import AfterValidator, BaseModel, ValidationError\n\n MyInt = Annotated[int, AfterValidator(lambda v: v + 1)]\n\n class Model(BaseModel):\n a: MyInt\n\n print(Model(a=1).a)\n #> 2\n\n try:\n Model(a='a')\n except ValidationError as e:\n print(e.json(indent=2))\n '''\n [\n {\n \"type\": \"int_parsing\",\n \"loc\": [\n \"a\"\n ],\n \"msg\": \"Input should be a valid integer, unable to parse string as an integer\",\n \"input\": \"a\",\n \"url\": \"https://errors.pydantic.dev/2/v/int_parsing\"\n }\n ]\n '''\n ```\n \"\"\"\n\n func: core_schema.NoInfoValidatorFunction | core_schema.WithInfoValidatorFunction", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AfterValidator.__get_pydantic_core_schema___AfterValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AfterValidator.__get_pydantic_core_schema___AfterValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_after", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 82, "span_ids": ["AfterValidator.__get_pydantic_core_schema__"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass AfterValidator:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchemaHandler) -> core_schema.CoreSchema:\n schema = handler(source_type)\n info_arg = _inspect_validator(self.func, 'after')\n if info_arg:\n func = cast(core_schema.WithInfoValidatorFunction, self.func)\n return core_schema.with_info_after_validator_function(func, schema=schema, field_name=handler.field_name)\n else:\n func = cast(core_schema.NoInfoValidatorFunction, self.func)\n return core_schema.no_info_after_validator_function(func, 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/functional_validators.py_BeforeValidator_BeforeValidator.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_BeforeValidator_BeforeValidator.func", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 115, "span_ids": ["BeforeValidator"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass BeforeValidator:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validators/#annotated-validators\n\n A metadata class that indicates that a validation should be applied **before** the inner validation logic.\n\n Attributes:\n func: The validator function.\n\n Example:\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, BeforeValidator\n\n MyInt = Annotated[int, BeforeValidator(lambda v: v + 1)]\n\n class Model(BaseModel):\n a: MyInt\n\n print(Model(a=1).a)\n #> 2\n\n try:\n Model(a='a')\n except TypeError as e:\n print(e)\n #> can only concatenate str (not \"int\") to str\n ```\n \"\"\"\n\n func: core_schema.NoInfoValidatorFunction | core_schema.WithInfoValidatorFunction", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_BeforeValidator.__get_pydantic_core_schema___BeforeValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_befor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_BeforeValidator.__get_pydantic_core_schema___BeforeValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_befor", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 126, "span_ids": ["BeforeValidator.__get_pydantic_core_schema__"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass BeforeValidator:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchemaHandler) -> core_schema.CoreSchema:\n schema = handler(source_type)\n info_arg = _inspect_validator(self.func, 'before')\n if info_arg:\n func = cast(core_schema.WithInfoValidatorFunction, self.func)\n return core_schema.with_info_before_validator_function(func, schema=schema, field_name=handler.field_name)\n else:\n func = cast(core_schema.NoInfoValidatorFunction, self.func)\n return core_schema.no_info_before_validator_function(func, 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/functional_validators.py_PlainValidator_PlainValidator.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_PlainValidator_PlainValidator.func", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 153, "span_ids": ["PlainValidator"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass PlainValidator:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validators/#annotated-validators\n\n A metadata class that indicates that a validation should be applied **instead** of the inner validation logic.\n\n Attributes:\n func: The validator function.\n\n Example:\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, PlainValidator\n\n MyInt = Annotated[int, PlainValidator(lambda v: int(v) + 1)]\n\n class Model(BaseModel):\n a: MyInt\n\n print(Model(a='1').a)\n #> 2\n ```\n \"\"\"\n\n func: core_schema.NoInfoValidatorFunction | core_schema.WithInfoValidatorFunction", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_PlainValidator.__get_pydantic_core_schema___PlainValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_plain": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_PlainValidator.__get_pydantic_core_schema___PlainValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_plain", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 177, "span_ids": ["PlainValidator.__get_pydantic_core_schema__"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass PlainValidator:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchemaHandler) -> core_schema.CoreSchema:\n # Note that for some valid uses of PlainValidator, it is not possible to generate a core schema for the\n # source_type, so calling `handler(source_type)` will error, which prevents us from generating a proper\n # serialization schema. To work around this for use cases that will not involve serialization, we simply\n # catch any PydanticSchemaGenerationError that may be raised while attempting to build the serialization schema\n # and abort any attempts to handle special serialization.\n from pydantic import PydanticSchemaGenerationError\n\n try:\n schema = handler(source_type)\n serialization = core_schema.wrap_serializer_function_ser_schema(function=lambda v, h: h(v), schema=schema)\n except PydanticSchemaGenerationError:\n serialization = None\n\n info_arg = _inspect_validator(self.func, 'plain')\n if info_arg:\n func = cast(core_schema.WithInfoValidatorFunction, self.func)\n return core_schema.with_info_plain_validator_function(\n func, field_name=handler.field_name, serialization=serialization\n )\n else:\n func = cast(core_schema.NoInfoValidatorFunction, self.func)\n return core_schema.no_info_plain_validator_function(func, serialization=serialization)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_WrapValidator_WrapValidator.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_WrapValidator_WrapValidator.func", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 218, "span_ids": ["WrapValidator"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass WrapValidator:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validators/#annotated-validators\n\n A metadata class that indicates that a validation should be applied **around** the inner validation logic.\n\n Attributes:\n func: The validator function.\n\n ```py\n from datetime import datetime\n\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, ValidationError, WrapValidator\n\n def validate_timestamp(v, handler):\n if v == 'now':\n # we don't want to bother with further validation, just return the new value\n return datetime.now()\n try:\n return handler(v)\n except ValidationError:\n # validation failed, in this case we want to return a default value\n return datetime(2000, 1, 1)\n\n MyTimestamp = Annotated[datetime, WrapValidator(validate_timestamp)]\n\n class Model(BaseModel):\n a: MyTimestamp\n\n print(Model(a='now').a)\n #> 2032-01-02 03:04:05.000006\n print(Model(a='invalid').a)\n #> 2000-01-01 00:00:00\n ```\n \"\"\"\n\n func: core_schema.NoInfoWrapValidatorFunction | core_schema.WithInfoWrapValidatorFunction", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_WrapValidator.__get_pydantic_core_schema___WrapValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_wrap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_WrapValidator.__get_pydantic_core_schema___WrapValidator.__get_pydantic_core_schema__.if_info_arg_.else_.return.core_schema_no_info_wrap_", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 214, "span_ids": ["WrapValidator.__get_pydantic_core_schema__"], "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": "@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)\nclass WrapValidator:\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchemaHandler) -> core_schema.CoreSchema:\n schema = handler(source_type)\n info_arg = _inspect_validator(self.func, 'wrap')\n if info_arg:\n func = cast(core_schema.WithInfoWrapValidatorFunction, self.func)\n return core_schema.with_info_wrap_validator_function(func, schema=schema, field_name=handler.field_name)\n else:\n func = cast(core_schema.NoInfoWrapValidatorFunction, self.func)\n return core_schema.no_info_wrap_validator_function(func, 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/functional_validators.py_AnyType_None_2.else_.InstanceOf.__hash__.object___hash__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_AnyType_None_2.else_.InstanceOf.__hash__.object___hash__", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 482, "end_line": 549, "span_ids": ["impl:33"], "tokens": 563}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"A `@model_validator` decorated function signature. This is used when `mode='after'`.\"\"\"\n\n\nAnyType = TypeVar('AnyType')\n\n\nif TYPE_CHECKING:\n # If we add configurable attributes to IsInstance, we'd probably need to stop hiding it from type checkers like this\n InstanceOf = Annotated[AnyType, ...] # `IsInstance[Sequence]` will be recognized by type checkers as `Sequence`\n\nelse:\n\n @dataclasses.dataclass(**_internal_dataclass.slots_true)\n class InstanceOf:\n '''Generic type for annotating a type that is an instance of a given class.\n\n Example:\n ```py\n from pydantic import BaseModel, InstanceOf\n\n class Foo:\n ...\n\n class Bar(BaseModel):\n foo: InstanceOf[Foo]\n\n Bar(foo=Foo())\n try:\n Bar(foo=42)\n except ValidationError as e:\n print(e)\n \"\"\"\n [\n \u2502 {\n \u2502 \u2502 'type': 'is_instance_of',\n \u2502 \u2502 'loc': ('foo',),\n \u2502 \u2502 'msg': 'Input should be an instance of Foo',\n \u2502 \u2502 'input': 42,\n \u2502 \u2502 'ctx': {'class': 'Foo'},\n \u2502 \u2502 'url': 'https://errors.pydantic.dev/0.38.0/v/is_instance_of'\n \u2502 }\n ]\n \"\"\"\n ```\n '''\n\n @classmethod\n def __class_getitem__(cls, item: AnyType) -> AnyType:\n return Annotated[item, cls()]\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n from pydantic import PydanticSchemaGenerationError\n\n # use the generic _origin_ as the second argument to isinstance when appropriate\n instance_of_schema = core_schema.is_instance_schema(_generics.get_origin(source) or source)\n\n try:\n # Try to generate the \"standard\" schema, which will be used when loading from JSON\n original_schema = handler(source)\n except PydanticSchemaGenerationError:\n # If that fails, just produce a schema that can validate from python\n return instance_of_schema\n else:\n # Use the \"original\" approach to serialization\n instance_of_schema['serialization'] = core_schema.wrap_serializer_function_ser_schema(\n function=lambda v, h: h(v), schema=original_schema\n )\n return core_schema.json_or_python_schema(python_schema=instance_of_schema, json_schema=original_schema)\n\n __hash__ = object.__hash__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel_BaseModel._Usage_docs_https_do": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel_BaseModel._Usage_docs_https_do", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 88, "span_ids": ["BaseModel"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/models/\n\n A base class for creating Pydantic models.\n\n Attributes:\n __class_vars__: The names of classvars defined on the model.\n __private_attributes__: Metadata about the private attributes of the model.\n __signature__: The signature for instantiating the model.\n\n __pydantic_complete__: Whether model building is completed, or if there are still undefined fields.\n __pydantic_core_schema__: The pydantic-core schema used to build the SchemaValidator and SchemaSerializer.\n __pydantic_custom_init__: Whether the model has a custom `__init__` function.\n __pydantic_decorators__: Metadata containing the decorators defined on the model.\n This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1.\n __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to\n __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.\n __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models.\n __pydantic_post_init__: The name of the post-init method for the model, if defined.\n __pydantic_root_model__: Whether the model is a `RootModel`.\n __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model.\n __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.\n\n __pydantic_extra__: An instance attribute with the values of extra fields from validation when\n `model_config['extra'] == 'allow'`.\n __pydantic_fields_set__: An instance attribute with the names of fields explicitly set.\n __pydantic_private__: Instance attribute with the values of private attributes set on the model instance.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.if_typing_TYPE_CHECKING__BaseModel.__pydantic_root_model__.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.if_typing_TYPE_CHECKING__BaseModel.__pydantic_root_model__.False", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 163, "span_ids": ["BaseModel"], "tokens": 800}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(metaclass=_model_construction.ModelMetaclass):\n\n if typing.TYPE_CHECKING:\n # Here we provide annotations for the attributes of BaseModel.\n # Many of these are populated by the metaclass, which is why this section is in a `TYPE_CHECKING` block.\n # However, for the sake of easy review, we have included type annotations of all class and instance attributes\n # of `BaseModel` here:\n\n # Class attributes\n model_config: ClassVar[ConfigDict]\n \"\"\"\n Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].\n \"\"\"\n\n model_fields: ClassVar[dict[str, FieldInfo]]\n \"\"\"\n Metadata about the fields defined on the model,\n mapping of field names to [`FieldInfo`][pydantic.fields.FieldInfo].\n\n This replaces `Model.__fields__` from Pydantic V1.\n \"\"\"\n\n model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]]\n \"\"\"A dictionary of computed field names and their corresponding `ComputedFieldInfo` objects.\"\"\"\n\n __class_vars__: ClassVar[set[str]]\n __private_attributes__: ClassVar[dict[str, ModelPrivateAttr]]\n __signature__: ClassVar[Signature]\n\n __pydantic_complete__: ClassVar[bool]\n __pydantic_core_schema__: ClassVar[CoreSchema]\n __pydantic_custom_init__: ClassVar[bool]\n __pydantic_decorators__: ClassVar[_decorators.DecoratorInfos]\n __pydantic_generic_metadata__: ClassVar[_generics.PydanticGenericMetadata]\n __pydantic_parent_namespace__: ClassVar[dict[str, Any] | None]\n __pydantic_post_init__: ClassVar[None | typing_extensions.Literal['model_post_init']]\n __pydantic_root_model__: ClassVar[bool]\n __pydantic_serializer__: ClassVar[SchemaSerializer]\n __pydantic_validator__: ClassVar[SchemaValidator]\n\n # Instance attributes\n # Note: we use the non-existent kwarg `init=False` in pydantic.fields.Field below so that @dataclass_transform\n # doesn't think these are valid as keyword arguments to the class initializer.\n __pydantic_extra__: dict[str, Any] | None = _Field(init=False) # type: ignore\n __pydantic_fields_set__: set[str] = _Field(init=False) # type: ignore\n __pydantic_private__: dict[str, Any] | None = _Field(init=False) # type: ignore\n\n else:\n # `model_fields` and `__pydantic_decorators__` must be set for\n # pydantic._internal._generate_schema.GenerateSchema.model_schema to work for a plain BaseModel annotation\n model_fields = {}\n model_computed_fields = {}\n\n __pydantic_decorators__ = _decorators.DecoratorInfos()\n __pydantic_parent_namespace__ = None\n # Prevent `BaseModel` from being instantiated directly:\n __pydantic_validator__ = _mock_val_ser.MockValSer(\n 'Pydantic models should inherit from BaseModel, BaseModel cannot be instantiated directly',\n val_or_ser='validator',\n code='base-model-instantiated',\n )\n __pydantic_serializer__ = _mock_val_ser.MockValSer(\n 'Pydantic models should inherit from BaseModel, BaseModel cannot be instantiated directly',\n val_or_ser='serializer',\n code='base-model-instantiated',\n )\n\n __slots__ = '__dict__', '__pydantic_fields_set__', '__pydantic_extra__', '__pydantic_private__'\n\n model_config = ConfigDict()\n __pydantic_complete__ = False\n __pydantic_root_model__ = 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_BaseModel.__init___BaseModel.model_fields_set.return.self___pydantic_fields_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__init___BaseModel.model_fields_set.return.self___pydantic_fields_se", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 193, "span_ids": ["BaseModel.model_fields_set", "BaseModel:47", "BaseModel.__init__", "BaseModel.model_extra"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def __init__(self, /, **data: Any) -> None: # type: ignore\n \"\"\"Create a new model by parsing and validating input data from keyword arguments.\n\n Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be\n validated to form a valid model.\n\n `self` is explicitly positional-only 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 self.__pydantic_validator__.validate_python(data, self_instance=self)\n\n # The following line sets a flag that we use to determine when `__init__` gets overridden by the user\n __init__.__pydantic_base_init__ = True # pyright: ignore[reportFunctionMemberAccess]\n\n @property\n def model_extra(self) -> dict[str, Any] | None:\n \"\"\"Get extra fields set during validation.\n\n Returns:\n A dictionary of extra fields, or `None` if `config.extra` is not set to `\"allow\"`.\n \"\"\"\n return self.__pydantic_extra__\n\n @property\n def model_fields_set(self) -> set[str]:\n \"\"\"Returns the set of fields that have been explicitly set on this model instance.\n\n Returns:\n A set of strings representing the fields that have been set,\n i.e. that were not filled from defaults.\n \"\"\"\n return self.__pydantic_fields_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/pydantic/main.py_BaseModel.model_validate_strings_BaseModel.model_validate_strings.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.model_validate_strings_BaseModel.model_validate_strings.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": 533, "end_line": 553, "span_ids": ["BaseModel.model_validate_strings"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def model_validate_strings(\n cls: type[Model],\n obj: Any,\n *,\n strict: bool | None = None,\n context: dict[str, Any] | None = None,\n ) -> Model:\n \"\"\"Validate the given object contains string data against the Pydantic model.\n\n Args:\n obj: The object contains string data to validate.\n strict: Whether to enforce types strictly.\n context: Extra variables to pass to the validator.\n\n Returns:\n The validated Pydantic model.\n \"\"\"\n # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\n __tracebackhide__ = True\n return cls.__pydantic_validator__.validate_strings(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._check_frozen_BaseModel._check_frozen.raise_pydantic_core_Valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._check_frozen_BaseModel._check_frozen.raise_pydantic_core_Valid", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 831, "end_line": 843, "span_ids": ["BaseModel._check_frozen"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def _check_frozen(self, name: str, value: Any) -> None:\n if self.model_config.get('frozen', None):\n typ = 'frozen_instance'\n elif getattr(self.model_fields.get(name), 'frozen', False):\n typ = 'frozen_field'\n else:\n return\n error: pydantic_core.InitErrorDetails = {\n 'type': typ,\n 'loc': (name,),\n 'input': value,\n }\n raise pydantic_core.ValidationError.from_exception_data(self.__class__.__name__, [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/pydantic/main.py_BaseModel.from_orm_BaseModel.from_orm.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.from_orm_BaseModel.from_orm.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": 1152, "end_line": 1168, "span_ids": ["BaseModel.from_orm"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated(\n 'The `from_orm` method is deprecated; set '\n \"`model_config['from_attributes']=True` and use `model_validate` instead.\",\n category=None,\n )\n def from_orm(cls: type[Model], obj: Any) -> Model: # noqa: D102\n warnings.warn(\n 'The `from_orm` method is deprecated; set '\n \"`model_config['from_attributes']=True` and use `model_validate` instead.\",\n category=PydanticDeprecatedSince20,\n )\n if not cls.model_config.get('from_attributes', None):\n raise PydanticUserError(\n 'You must set the config attribute `from_attributes=True` to use from_orm', code=None\n )\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.construct_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.construct_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": 1170, "end_line": 1176, "span_ids": ["BaseModel.construct"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated('The `construct` method is deprecated; use `model_construct` instead.', category=None)\n def construct(cls: type[Model], _fields_set: set[str] | None = None, **values: Any) -> Model: # noqa: D102\n warnings.warn(\n 'The `construct` method is deprecated; use `model_construct` instead.', category=PydanticDeprecatedSince20\n )\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.copy_internals__copy_and_": {"__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.copy_internals__copy_and_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1178, "end_line": 1252, "span_ids": ["BaseModel.copy"], "tokens": 730}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @typing_extensions.deprecated(\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 category=None,\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: # pragma: no cover\n \"\"\"Returns a copy of the model.\n\n !!! warning \"Deprecated\"\n This method is now deprecated; use `model_copy` instead.\n\n If you need `include` or `exclude`, use:\n\n ```py\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\n Args:\n include: Optional set or mapping specifying which fields to include in the copied model.\n exclude: Optional set or mapping specifying which fields to exclude in the copied model.\n update: Optional dictionary of field-value pairs to override field values in the copied model.\n deep: If True, the values of fields that are Pydantic models will be deep-copied.\n\n Returns:\n A copy of the model with included, excluded and updated fields as specified.\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 category=PydanticDeprecatedSince20,\n )\n from .deprecated import copy_internals\n\n values = dict(\n copy_internals._iter(\n self, to_dict=False, by_alias=False, include=include, exclude=exclude, exclude_unset=False\n ),\n **(update or {}),\n )\n if self.__pydantic_private__ is None:\n private = None\n else:\n private = {k: v for k, v in self.__pydantic_private__.items() if v is not PydanticUndefined}\n\n if self.__pydantic_extra__ is None:\n extra: dict[str, Any] | None = None\n else:\n extra = self.__pydantic_extra__.copy()\n for k in list(self.__pydantic_extra__):\n if k not in values: # k was in the exclude\n extra.pop(k)\n for k in list(values):\n if k in self.__pydantic_extra__: # k must have come from extra\n extra[k] = values.pop(k)\n\n # new `__pydantic_fields_set__` can have unset optional fields with a set value in `update` kwarg\n if update:\n fields_set = self.__pydantic_fields_set__ | update.keys()\n else:\n fields_set = set(self.__pydantic_fields_set__)\n\n # removing excluded fields from `__pydantic_fields_set__`\n if exclude:\n fields_set -= set(exclude)\n\n return copy_internals._copy_and_set_values(self, values, fields_set, extra, private, 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._get_value_BaseModel._get_value.return.copy_internals__get_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._get_value_BaseModel._get_value.return.copy_internals__get_value", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1333, "end_line": 1345, "span_ids": ["BaseModel._get_value"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n @typing_extensions.deprecated(\n 'The private method `_get_value` will be removed and should no longer be used.',\n category=None,\n )\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.',\n category=PydanticDeprecatedSince20,\n )\n from .deprecated import copy_internals\n\n return copy_internals._get_value(cls, *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_BaseModel._calculate_keys_BaseModel._calculate_keys.return.copy_internals__calculate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._calculate_keys_BaseModel._calculate_keys.return.copy_internals__calculate", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1347, "end_line": 1358, "span_ids": ["BaseModel._calculate_keys"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @typing_extensions.deprecated(\n 'The private method `_calculate_keys` will be removed and should no longer be used.',\n category=None,\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.',\n category=PydanticDeprecatedSince20,\n )\n from .deprecated import copy_internals\n\n return 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_create_model_create_model._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_create_model._", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1358, "end_line": 1370, "span_ids": ["create_model"], "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": "@typing.overload\ndef create_model(\n __model_name: str,\n *,\n __config__: ConfigDict | None = None,\n __doc__: str | None = None,\n __base__: None = None,\n __module__: str = __name__,\n __validators__: dict[str, classmethod] | None = None,\n __cls_kwargs__: dict[str, Any] | None = None,\n **field_definitions: Any,\n) -> type[BaseModel]:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_1_create_model_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_1_create_model_1._", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1373, "end_line": 1385, "span_ids": ["create_model_1"], "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": "@typing.overload\ndef create_model(\n __model_name: str,\n *,\n __config__: ConfigDict | None = None,\n __doc__: str | None = None,\n __base__: type[Model] | tuple[type[Model], ...],\n __module__: str = __name__,\n __validators__: dict[str, classmethod] | None = None,\n __cls_kwargs__: dict[str, Any] | None = 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/mypy.py__This_module_includes_c___version__.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py__This_module_includes_c___version__.2", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 111, "span_ids": ["impl:11", "docstring"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"This module includes classes and functions designed specifically for use with the mypy plugin.\"\"\"\n\nfrom __future__ import annotations\n\nimport sys\nfrom configparser import ConfigParser\nfrom typing import Any, Callable, Iterator\n\nfrom mypy.errorcodes import ErrorCode\nfrom mypy.expandtype import expand_type, expand_type_by_instance\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 DictExpr,\n EllipsisExpr,\n Expression,\n FuncDef,\n IfStmt,\n JsonDict,\n MemberExpr,\n NameExpr,\n PassStmt,\n PlaceholderNode,\n RefExpr,\n Statement,\n StrExpr,\n SymbolTableNode,\n TempNode,\n TypeAlias,\n TypeInfo,\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.plugins.common import (\n deserialize_and_fixup_type,\n)\nfrom mypy.semanal import set_callable_name\nfrom mypy.server.trigger import make_wildcard_trigger\nfrom mypy.state import state\nfrom mypy.typeops import map_type_from_supertype\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\nfrom pydantic._internal import _fields\nfrom pydantic.version import parse_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'\nBASESETTINGS_FULLNAME = 'pydantic_settings.main.BaseSettings'\nROOT_MODEL_FULLNAME = 'pydantic.root_model.RootModel'\nMODEL_METACLASS_FULLNAME = 'pydantic._internal._model_construction.ModelMetaclass'\nFIELD_FULLNAME = 'pydantic.fields.Field'\nDATACLASS_FULLNAME = 'pydantic.dataclasses.dataclass'\nMODEL_VALIDATOR_FULLNAME = 'pydantic.functional_validators.model_validator'\nDECORATOR_FULLNAMES = {\n 'pydantic.functional_validators.field_validator',\n 'pydantic.functional_validators.model_validator',\n 'pydantic.functional_serializers.serializer',\n 'pydantic.functional_serializers.model_serializer',\n 'pydantic.deprecated.class_validators.validator',\n 'pydantic.deprecated.class_validators.root_validator',\n}\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_plugin_PydanticPlugin.get_base_class_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_plugin_PydanticPlugin.get_base_class_hook.return.None", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 144, "span_ids": ["PydanticPlugin.__init__", "PydanticPlugin.get_base_class_hook", "plugin", "PydanticPlugin"], "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 plugin(version: str) -> type[Plugin]:\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 Args:\n version: The mypy version string.\n\n Return:\n The Pydantic mypy plugin type.\n \"\"\"\n return PydanticPlugin\n\n\nclass PydanticPlugin(Plugin):\n \"\"\"The Pydantic mypy plugin.\"\"\"\n\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], bool] | None:\n \"\"\"Update Pydantic model class.\"\"\"\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(base.fullname == BASEMODEL_FULLNAME for base in sym.node.mro):\n return self._pydantic_model_class_maker_callback\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin.get_metaclass_hook_PydanticPlugin._pydantic_model_class_maker_callback.return.transformer_transform_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticPlugin.get_metaclass_hook_PydanticPlugin._pydantic_model_class_maker_callback.return.transformer_transform_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 183, "span_ids": ["PydanticPlugin._pydantic_model_class_maker_callback", "PydanticPlugin.get_metaclass_hook", "PydanticPlugin.get_function_hook", "PydanticPlugin.get_class_decorator_hook", "PydanticPlugin.report_config_data", "PydanticPlugin.get_method_hook"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticPlugin(Plugin):\n\n def get_metaclass_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:\n \"\"\"Update Pydantic `ModelMetaclass` definition.\"\"\"\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 \"\"\"Adjust the return type of the `Field` function.\"\"\"\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 \"\"\"Adjust return type of `from_orm` method call.\"\"\"\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) -> bool:\n transformer = PydanticModelTransformer(ctx.cls, ctx.reason, ctx.api, self.plugin_config)\n return 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_PydanticModelField.expand_type_PydanticModelField.expand_type.return.self_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.expand_type_PydanticModelField.expand_type.return.self_type", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 357, "end_line": 367, "span_ids": ["PydanticModelField.expand_type"], "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 PydanticModelField:\n\n def expand_type(self, current_info: TypeInfo, api: SemanticAnalyzerPluginInterface) -> Type | None:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.expand_type.\"\"\"\n # The getattr in the next line is used to prevent errors in legacy versions of mypy without this attribute\n if self.type is not None and getattr(self.info, 'self_type', None) is not None:\n # In general, it is not safe to call `expand_type()` during semantic analyzis,\n # however this plugin is called very late, so all types should be fully ready.\n # Also, it is tricky to avoid eager expansion of Self types here (e.g. because\n # we serialize attributes).\n with state.strict_optional_set(api.options.strict_optional):\n return expand_type(self.type, {self.info.self_type.id: fill_typevars(current_info)})\n return self.type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.transform_PydanticModelTransformer.transform.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.transform_PydanticModelTransformer.transform.return.True", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 460, "end_line": 494, "span_ids": ["PydanticModelTransformer.transform"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def transform(self) -> bool:\n \"\"\"Configures the BaseModel subclass according to the plugin settings.\n\n In particular:\n\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 info = self._cls.info\n is_root_model = any(ROOT_MODEL_FULLNAME in base.fullname for base in info.mro[:-1])\n config = self.collect_config()\n fields, class_vars = self.collect_fields_and_class_vars(config, is_root_model)\n if fields is None or class_vars is None:\n # Some definitions are not ready. We need another pass.\n return False\n for field in fields:\n if field.type is None:\n return False\n\n is_settings = any(base.fullname == BASESETTINGS_FULLNAME for base in info.mro[:-1])\n self.add_initializer(fields, config, is_settings, is_root_model)\n self.add_model_construct_method(fields, config, is_settings)\n self.set_frozen(fields, self._api, frozen=config.frozen is True)\n\n self.adjust_decorator_signatures()\n\n info.metadata[METADATA_KEY] = {\n 'fields': {field.name: field.serialize() for field in fields},\n 'class_vars': {class_var.name: class_var.serialize() for class_var in class_vars},\n 'config': config.get_values_dict(),\n }\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/mypy.py_PydanticModelTransformer.adjust_decorator_signatures_PydanticModelTransformer.adjust_decorator_signatures.for_name_sym_in_self__cl.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_decorator_signatures_PydanticModelTransformer.adjust_decorator_signatures.for_name_sym_in_self__cl.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": 459, "end_line": 484, "span_ids": ["PydanticModelTransformer.adjust_decorator_signatures"], "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 PydanticModelTransformer:\n\n def adjust_decorator_signatures(self) -> None:\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._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 # @model_validator(mode=\"after\") is an exception, it expects a regular method\n and not (\n first_dec.callee.fullname == MODEL_VALIDATOR_FULLNAME\n and any(\n first_dec.arg_names[i] == 'mode' and isinstance(arg, StrExpr) and arg.value == 'after'\n for i, arg in enumerate(first_dec.args)\n )\n )\n ):\n # TODO: Only do this if the first argument of the decorated function is `cls`\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._get_assignment_statements_from_if_statement_PydanticModelTransformer._get_assignment_statements_from_block.for_stmt_in_block_body_.if_isinstance_stmt_Assig.elif_isinstance_stmt_IfS.yield_from_self__get_assi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer._get_assignment_statements_from_if_statement_PydanticModelTransformer._get_assignment_statements_from_block.for_stmt_in_block_body_.if_isinstance_stmt_Assig.elif_isinstance_stmt_IfS.yield_from_self__get_assi", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 617, "end_line": 629, "span_ids": ["PydanticModelTransformer._get_assignment_statements_from_if_statement", "PydanticModelTransformer._get_assignment_statements_from_block"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def _get_assignment_statements_from_if_statement(self, stmt: IfStmt) -> Iterator[AssignmentStmt]:\n for body in stmt.body:\n if not body.is_unreachable:\n yield from self._get_assignment_statements_from_block(body)\n if stmt.else_body is not None and not stmt.else_body.is_unreachable:\n yield from self._get_assignment_statements_from_block(stmt.else_body)\n\n def _get_assignment_statements_from_block(self, block: Block) -> Iterator[AssignmentStmt]:\n for stmt in block.body:\n if isinstance(stmt, AssignmentStmt):\n yield stmt\n elif isinstance(stmt, IfStmt):\n yield from self._get_assignment_statements_from_if_statement(stmt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer._infer_dataclass_attr_init_type_PydanticModelTransformer._infer_dataclass_attr_init_type.return.default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer._infer_dataclass_attr_init_type_PydanticModelTransformer._infer_dataclass_attr_init_type.return.default", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 751, "end_line": 787, "span_ids": ["PydanticModelTransformer._infer_dataclass_attr_init_type"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def _infer_dataclass_attr_init_type(self, sym: SymbolTableNode, name: str, context: Context) -> Type | None:\n \"\"\"Infer __init__ argument type for an attribute.\n\n In particular, possibly use the signature of __set__.\n \"\"\"\n default = sym.type\n if sym.implicit:\n return default\n t = get_proper_type(sym.type)\n\n # Perform a simple-minded inference from the signature of __set__, if present.\n # We can't use mypy.checkmember here, since this plugin runs before type checking.\n # We only support some basic scanerios here, which is hopefully sufficient for\n # the vast majority of use cases.\n if not isinstance(t, Instance):\n return default\n setter = t.type.get('__set__')\n if setter:\n if isinstance(setter.node, FuncDef):\n super_info = t.type.get_containing_type_info('__set__')\n assert super_info\n if setter.type:\n setter_type = get_proper_type(map_type_from_supertype(setter.type, t.type, super_info))\n else:\n return AnyType(TypeOfAny.unannotated)\n if isinstance(setter_type, CallableType) and setter_type.arg_kinds == [\n ARG_POS,\n ARG_POS,\n ARG_POS,\n ]:\n return expand_type_by_instance(setter_type.arg_types[2], t)\n else:\n self._api.fail(f'Unsupported signature for \"__set__\" in \"{t.type.name}\"', context)\n else:\n self._api.fail(f'Unsupported \"__set__\" in \"{t.type.name}\"', context)\n\n return default", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.add_initializer_PydanticModelTransformer.add_initializer.add_method_self__api_sel": {"__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.add_method_self__api_sel", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 841, "end_line": 884, "span_ids": ["PydanticModelTransformer.add_initializer"], "tokens": 512}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def add_initializer(\n self, fields: list[PydanticModelField], config: ModelConfigData, is_settings: bool, is_root_model: bool\n ) -> None:\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 if '__init__' in self._cls.info.names and not self._cls.info.names['__init__'].plugin_generated:\n return # Don't generate an __init__ if one already exists\n\n typed = self.plugin_config.init_typed\n use_alias = config.populate_by_name is not True\n requires_dynamic_aliases = bool(config.has_alias_generator and not config.populate_by_name)\n args = self.get_field_arguments(\n fields,\n typed=typed,\n requires_dynamic_aliases=requires_dynamic_aliases,\n use_alias=use_alias,\n is_settings=is_settings,\n )\n\n if is_root_model and MYPY_VERSION_TUPLE <= (1, 0, 1):\n # convert root argument to positional argument\n # This is needed because mypy support for `dataclass_transform` isn't complete on 1.0.1\n args[0].kind = ARG_POS if args[0].kind == ARG_NAMED else ARG_OPT\n\n if is_settings:\n base_settings_node = self._api.lookup_fully_qualified(BASESETTINGS_FULLNAME).node\n if '__init__' in base_settings_node.names:\n base_settings_init_node = base_settings_node.names['__init__'].node\n if base_settings_init_node is not None and base_settings_init_node.type is not None:\n func_type = base_settings_init_node.type\n for arg_idx, arg_name in enumerate(func_type.arg_names):\n if arg_name.startswith('__') or not arg_name.startswith('_'):\n continue\n analyzed_variable_type = self._api.anal_type(func_type.arg_types[arg_idx])\n variable = Var(arg_name, analyzed_variable_type)\n args.append(Argument(variable, analyzed_variable_type, None, ARG_OPT))\n\n if not self.should_init_forbid_extra(fields, config):\n var = Var('kwargs')\n args.append(Argument(var, AnyType(TypeOfAny.explicit), None, ARG_STAR2))\n\n add_method(self._api, self._cls, '__init__', args=args, return_type=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.set_frozen_PydanticModelTransformer.set_frozen.for_field_in_fields_.if_sym_node_is_not_None_.else_.info_names_var_name_Sy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.set_frozen_PydanticModelTransformer.set_frozen.for_field_in_fields_.if_sym_node_is_not_None_.else_.info_names_var_name_Sy", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 916, "end_line": 945, "span_ids": ["PydanticModelTransformer.set_frozen"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def set_frozen(self, fields: list[PydanticModelField], api: SemanticAnalyzerPluginInterface, frozen: bool) -> None:\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 info = self._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 self._api.final_iteration:\n # See https://github.com/pydantic/pydantic/issues/5191 to hit this branch for test coverage\n self._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, self._api, self._cls)\n else:\n var = field.to_var(info, api, use_alias=False)\n var.info = info\n var.is_property = frozen\n var._fullname = info.fullname + '.' + var.name\n info.names[var.name] = SymbolTableNode(MDEF, var)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_has_default_PydanticModelTransformer.get_has_default.return.not_isinstance_expr_Elli": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.get_has_default_PydanticModelTransformer.get_has_default.return.not_isinstance_expr_Elli", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 920, "end_line": 940, "span_ids": ["PydanticModelTransformer.get_has_default"], "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 PydanticModelTransformer:\n\n @staticmethod\n def get_has_default(stmt: AssignmentStmt) -> bool:\n \"\"\"Returns a boolean indicating whether the field defined in `stmt` is a required field.\"\"\"\n expr = stmt.rvalue\n if isinstance(expr, TempNode):\n # TempNode means annotation-only, so has no default\n return False\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 has a default if and only if:\n # * there is a positional argument that is not `...`\n # * there is a keyword argument named \"default\" that is not `...`\n # * there is a \"default_factory\" that is not `None`\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 positional argument.\n if name is None or name == 'default':\n return arg.__class__ is not EllipsisExpr\n if name == 'default_factory':\n return not (isinstance(arg, NameExpr) and arg.fullname == 'builtins.None')\n return False\n # Has no default if the \"default value\" is Ellipsis (i.e., `field_name: Annotation = ...`)\n return not 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/networks.py_AnyUrl_None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_AnyUrl_None_4", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 190, "span_ids": ["impl:9", "impl:15"], "tokens": 965}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "AnyUrl = Url\n\"\"\"Base type for all URLs.\n\n* Any scheme allowed\n* Top-level domain (TLD) not required\n* Host required\n\nAssuming an input URL of `http://samuel:pass@example.com:8000/the/path/?query=here#fragment=is;this=bit`,\nthe types export the following properties:\n\n- `scheme`: the URL scheme (`http`), always set.\n- `host`: the URL host (`example.com`), always set.\n- `username`: optional username if included (`samuel`).\n- `password`: optional password if included (`pass`).\n- `port`: optional port (`8000`).\n- `path`: optional path (`/the/path/`).\n- `query`: optional URL query (for example, `GET` arguments or \"search string\", such as `query=here`).\n- `fragment`: optional fragment (`fragment=is;this=bit`).\n\"\"\"\nAnyHttpUrl = Annotated[Url, UrlConstraints(allowed_schemes=['http', 'https'])]\n\"\"\"A type that will accept any http or https URL.\n\n* TLD not required\n* Host required\n\"\"\"\nHttpUrl = Annotated[Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'])]\n\"\"\"A type that will accept any http or https URL.\n\n* TLD required\n* Host required\n* Max length 2083\n\n```py\nfrom pydantic import BaseModel, HttpUrl, ValidationError\n\nclass MyModel(BaseModel):\n url: HttpUrl\n\nm = MyModel(url='http://www.example.com') # (1)!\nprint(m.url)\n#> http://www.example.com/\n\ntry:\n MyModel(url='ftp://invalid.url')\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for MyModel\n url\n URL scheme should be 'http' or 'https' [type=url_scheme, input_value='ftp://invalid.url', input_type=str]\n '''\n\ntry:\n MyModel(url='not a url')\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for MyModel\n url\n Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='not a url', input_type=str]\n '''\n```\n\n1. Note: mypy would prefer `m = MyModel(url=HttpUrl('http://www.example.com'))`, but Pydantic will convert the string to an HttpUrl instance anyway.\n\n\"International domains\" (e.g. a URL where the host or TLD includes non-ascii characters) will be encoded via\n[punycode](https://en.wikipedia.org/wiki/Punycode) (see\n[this article](https://www.xudongz.com/blog/2017/idn-phishing/) for a good description of why this is important):\n\n```py\nfrom pydantic import BaseModel, HttpUrl\n\nclass MyModel(BaseModel):\n url: HttpUrl\n\nm1 = MyModel(url='http://puny\u00a3code.com')\nprint(m1.url)\n#> http://xn--punycode-eja.com/\nm2 = MyModel(url='https://www.\u0430\u0440\u0440\u04cf\u0435.com/')\nprint(m2.url)\n#> https://www.xn--80ak6aa92e.com/\nm3 = MyModel(url='https://www.example.\u73e0\u5b9d/')\nprint(m3.url)\n#> https://www.example.xn--pbt977c/\n```\n\n\n!!! warning \"Underscores in Hostnames\"\n In Pydantic, underscores are allowed in all parts of a domain except the TLD.\n Technically this might be wrong - in theory the hostname cannot have underscores, but subdomains can.\n\n To explain this; consider the following two cases:\n\n - `exam_ple.co.uk`: the hostname is `exam_ple`, which should not be allowed since it contains an underscore.\n - `foo_bar.example.com` the hostname is `example`, which should be allowed since the underscore is in the subdomain.\n\n Without having an exhaustive list of TLDs, it would be impossible to differentiate between these two. Therefore\n underscores are allowed, but you can always do further validation in a validator if desired.\n\n Also, Chrome, Firefox, and Safari all currently accept `http://exam_ple.com` as a URL, so we're in good\n (or at least big) company.\n\"\"\"\nFileUrl = Annotated[Url, UrlConstraints(allowed_schemes=['file'])]\n\"\"\"A type that will accept any file URL.\n\n* Host not required\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_PostgresDsn_None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_PostgresDsn_None_10", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 311, "span_ids": ["impl:19", "impl:15"], "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": "PostgresDsn = 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\"\"\"A type that will accept any Postgres DSN.\n\n* User info required\n* TLD not required\n* Host required\n* Supports multiple hosts\n\nIf further validation is required, these properties can be used by validators to enforce specific behaviour:\n\n```py\nfrom pydantic import (\n BaseModel,\n HttpUrl,\n PostgresDsn,\n ValidationError,\n field_validator,\n)\n\nclass MyModel(BaseModel):\n url: HttpUrl\n\nm = MyModel(url='http://www.example.com')\n\n# the repr() method for a url will display all properties of the url\nprint(repr(m.url))\n#> Url('http://www.example.com/')\nprint(m.url.scheme)\n#> http\nprint(m.url.host)\n#> www.example.com\nprint(m.url.port)\n#> 80\n\nclass MyDatabaseModel(BaseModel):\n db: PostgresDsn\n\n @field_validator('db')\n def check_db_name(cls, v):\n assert v.path and len(v.path) > 1, 'database must be provided'\n return v\n\nm = MyDatabaseModel(db='postgres://user:pass@localhost:5432/foobar')\nprint(m.db)\n#> postgres://user:pass@localhost:5432/foobar\n\ntry:\n MyDatabaseModel(db='postgres://user:pass@localhost:5432')\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for MyDatabaseModel\n db\n Assertion failed, database must be provided\n assert (None)\n + where None = MultiHostUrl('postgres://user:pass@localhost:5432').path [type=assertion_error, input_value='postgres://user:pass@localhost:5432', input_type=str]\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]\n\"\"\"A type that will accept any Cockroach DSN.\n\n* User info required\n* TLD not required\n* Host required\n\"\"\"\nAmqpDsn = Annotated[Url, UrlConstraints(allowed_schemes=['amqp', 'amqps'])]\n\"\"\"A type that will accept any AMQP DSN.\n\n* User info required\n* TLD not required\n* Host required\n\"\"\"\nRedisDsn = Annotated[\n Url,\n UrlConstraints(allowed_schemes=['redis', 'rediss'], default_host='localhost', default_port=6379, default_path='/0'),\n]\n\"\"\"A type that will accept any Redis DSN.\n\n* User info required\n* TLD not required\n* Host required (e.g., `rediss://:pass@localhost`)\n\"\"\"\nMongoDsn = Annotated[MultiHostUrl, UrlConstraints(allowed_schemes=['mongodb', 'mongodb+srv'], default_port=27017)]\n\"\"\"A type that will accept any MongoDB DSN.\n\n* User info not required\n* Database name not required\n* Port not required\n* User info may be passed without user part (e.g., `mongodb://mongodb0.example.com:27017`).\n\"\"\"\nKafkaDsn = Annotated[Url, UrlConstraints(allowed_schemes=['kafka'], default_host='localhost', default_port=9092)]\n\"\"\"A type that will accept any Kafka DSN.\n\n* User info required\n* TLD not required\n* Host required\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.__get_pydantic_json_schema__.return.field_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NameEmail_NameEmail.__get_pydantic_json_schema__.return.field_schema", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 406, "end_line": 457, "span_ids": ["NameEmail.__init__", "NameEmail.__get_pydantic_json_schema__", "NameEmail", "NameEmail.__eq__"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NameEmail(_repr.Representation):\n \"\"\"\n Info:\n To use this type, you need to install the optional\n [`email-validator`](https://github.com/JoshData/python-email-validator) package:\n\n ```bash\n pip install email-validator\n ```\n\n Validate a name and email address combination, as specified by\n [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4).\n\n The `NameEmail` has two properties: `name` and `email`.\n In case the `name` is not provided, it's inferred from the email address.\n\n ```py\n from pydantic import BaseModel, NameEmail\n\n class User(BaseModel):\n email: NameEmail\n\n user = User(email='Fred Bloggs ')\n print(user.email)\n #> Fred Bloggs \n print(user.email.name)\n #> Fred Bloggs\n\n user = User(email='fred.bloggs@example.com')\n print(user.email)\n #> fred.bloggs \n print(user.email.name)\n #> fred.bloggs\n ```\n \"\"\" # noqa: D212\n\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 __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: _schema_generation_shared.GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\n field_schema.update(type='string', format='name-email')\n return 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/pydantic/networks.py_NameEmail.__get_pydantic_core_schema___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.__get_pydantic_core_schema___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": 490, "end_line": 523, "span_ids": ["NameEmail._validate", "NameEmail.__get_pydantic_core_schema__", "NameEmail.__str__"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NameEmail(_repr.Representation):\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n _source: type[Any],\n _handler: GetCoreSchemaHandler,\n ) -> core_schema.CoreSchema:\n import_email_validator()\n\n return core_schema.no_info_after_validator_function(\n cls._validate,\n core_schema.json_or_python_schema(\n json_schema=core_schema.str_schema(),\n python_schema=core_schema.union_schema(\n [core_schema.is_instance_schema(cls), core_schema.str_schema()],\n custom_error_type='name_email_type',\n custom_error_message='Input is not a valid NameEmail',\n ),\n serialization=core_schema.to_string_ser_schema(),\n ),\n )\n\n @classmethod\n def _validate(cls, input_value: Self | str, /) -> Self:\n if isinstance(input_value, cls):\n return input_value\n else:\n name, email = validate_email(input_value)\n return cls(name, email)\n\n def __str__(self) -> str:\n if '@' in self.name:\n return f'\"{self.name}\" <{self.email}>'\n\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__build_pretty_email_regex_MAX_EMAIL_LENGTH.2048": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py__build_pretty_email_regex_MAX_EMAIL_LENGTH.2048", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 675, "end_line": 685, "span_ids": ["_build_pretty_email_regex", "impl:41"], "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 _build_pretty_email_regex() -> re.Pattern[str]:\n name_chars = r'[\\w!#$%&\\'*+\\-/=?^_`{|}~]'\n unquoted_name_group = rf'((?:{name_chars}+\\s+)*{name_chars}+)'\n quoted_name_group = r'\"((?:[^\"]|\\\")+)\"'\n email_group = r'<\\s*(.+)\\s*>'\n return re.compile(rf'\\s*(?:{unquoted_name_group}|{quoted_name_group})?\\s*{email_group}\\s*')\n\n\npretty_email_regex = _build_pretty_email_regex()\n\nMAX_EMAIL_LENGTH = 2048", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__Maximum_length_for_an__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py__Maximum_length_for_an__", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 686, "end_line": 733, "span_ids": ["validate_email", "impl:41", "impl:45"], "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": "\"\"\"Maximum length for an email.\nA somewhat arbitrary but very generous number compared to what is allowed by most implementations.\n\"\"\"\n\n\ndef validate_email(value: str) -> tuple[str, str]:\n \"\"\"Email address validation using [email-validator](https://pypi.org/project/email-validator/).\n\n Note:\n Note that:\n\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 if len(value) > MAX_EMAIL_LENGTH:\n raise PydanticCustomError(\n 'value_error',\n 'value is not a valid email address: {reason}',\n {'reason': f'Length must not exceed {MAX_EMAIL_LENGTH} characters'},\n )\n\n m = pretty_email_regex.fullmatch(value)\n name: str | None = None\n if m:\n unquoted_name, quoted_name, value = m.groups()\n name = unquoted_name or quoted_name\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 email = parts.normalized\n assert email is not None\n name = name or parts.local_part\n return name, email\n\n\n__getattr__ = getattr_migration(__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/plugin/__init__.py__Usage_docs_https_do_SchemaKind.Literal_BaseModel_Typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py__Usage_docs_https_do_SchemaKind.Literal_BaseModel_Typ", "embedding": null, "metadata": {"file_path": "pydantic/plugin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["SchemaTypePath", "impl:5", "docstring"], "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": "\"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/plugins#build-a-plugin\n\nPlugin interface for Pydantic plugins, and related types.\n\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Any, Callable, NamedTuple\n\nfrom pydantic_core import CoreConfig, CoreSchema, ValidationError\nfrom typing_extensions import Literal, Protocol, TypeAlias\n\n__all__ = (\n 'PydanticPluginProtocol',\n 'BaseValidateHandlerProtocol',\n 'ValidatePythonHandlerProtocol',\n 'ValidateJsonHandlerProtocol',\n 'ValidateStringsHandlerProtocol',\n 'NewSchemaReturns',\n 'SchemaTypePath',\n 'SchemaKind',\n)\n\nNewSchemaReturns: TypeAlias = 'tuple[ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None]'\n\n\nclass SchemaTypePath(NamedTuple):\n \"\"\"Path defining where `schema_type` was defined, or where `TypeAdapter` was called.\"\"\"\n\n module: str\n name: str\n\n\nSchemaKind: TypeAlias = Literal['BaseModel', 'TypeAdapter', 'dataclass', 'create_model', 'validate_call']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_PydanticPluginProtocol_PydanticPluginProtocol.new_schema_validator.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_PydanticPluginProtocol_PydanticPluginProtocol.new_schema_validator.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "pydantic/plugin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 68, "span_ids": ["PydanticPluginProtocol.new_schema_validator", "PydanticPluginProtocol"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticPluginProtocol(Protocol):\n \"\"\"Protocol defining the interface for Pydantic plugins.\"\"\"\n\n def new_schema_validator(\n self,\n schema: CoreSchema,\n schema_type: Any,\n schema_type_path: SchemaTypePath,\n schema_kind: SchemaKind,\n config: CoreConfig | None,\n plugin_settings: dict[str, object],\n ) -> tuple[\n ValidatePythonHandlerProtocol | None, ValidateJsonHandlerProtocol | None, ValidateStringsHandlerProtocol | None\n ]:\n \"\"\"This method is called for each plugin every time a new [`SchemaValidator`][pydantic_core.SchemaValidator]\n is created.\n\n It should return an event handler for each of the three validation methods, or `None` if the plugin does not\n implement that method.\n\n Args:\n schema: The schema to validate against.\n schema_type: The original type which the schema was created from, e.g. the model class.\n schema_type_path: Path defining where `schema_type` was defined, or where `TypeAdapter` was called.\n schema_kind: The kind of schema to validate against.\n config: The config to use for validation.\n plugin_settings: Any plugin settings.\n\n Returns:\n A tuple of optional event handlers for each of the three validation methods -\n `validate_python`, `validate_json`, `validate_strings`.\n \"\"\"\n raise NotImplementedError('Pydantic plugins should implement `new_schema_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/pydantic/plugin/__init__.py_BaseValidateHandlerProtocol_BaseValidateHandlerProtocol.on_exception.return": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_BaseValidateHandlerProtocol_BaseValidateHandlerProtocol.on_exception.return", "embedding": null, "metadata": {"file_path": "pydantic/plugin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 103, "span_ids": ["BaseValidateHandlerProtocol", "BaseValidateHandlerProtocol.on_exception", "BaseValidateHandlerProtocol.on_success", "BaseValidateHandlerProtocol.on_error"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseValidateHandlerProtocol(Protocol):\n \"\"\"Base class for plugin callbacks protocols.\n\n You shouldn't implement this protocol directly, instead use one of the subclasses with adds the correctly\n typed `on_error` method.\n \"\"\"\n\n on_enter: Callable[..., None]\n \"\"\"`on_enter` is changed to be more specific on all subclasses\"\"\"\n\n def on_success(self, result: Any) -> None:\n \"\"\"Callback to be notified of successful validation.\n\n Args:\n result: The result of the validation.\n \"\"\"\n return\n\n def on_error(self, error: ValidationError) -> None:\n \"\"\"Callback to be notified of validation errors.\n\n Args:\n error: The validation error.\n \"\"\"\n return\n\n def on_exception(self, exception: Exception) -> None:\n \"\"\"Callback to be notified of validation exceptions.\n\n Args:\n exception: The exception raised during validation.\n \"\"\"\n return", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_ValidatePythonHandlerProtocol_ValidatePythonHandlerProtocol.on_enter.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_ValidatePythonHandlerProtocol_ValidatePythonHandlerProtocol.on_enter.pass", "embedding": null, "metadata": {"file_path": "pydantic/plugin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 128, "span_ids": ["ValidatePythonHandlerProtocol.on_enter", "ValidatePythonHandlerProtocol"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidatePythonHandlerProtocol(BaseValidateHandlerProtocol, Protocol):\n \"\"\"Event handler for `SchemaValidator.validate_python`.\"\"\"\n\n def on_enter(\n self,\n input: Any,\n *,\n strict: bool | None = None,\n from_attributes: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n \"\"\"Callback to be notified of validation start, and create an instance of the event handler.\n\n Args:\n input: The input to be validated.\n strict: Whether to validate the object in strict mode.\n from_attributes: Whether to validate objects as inputs by extracting attributes.\n context: The context to use for validation, this is passed to functional validators.\n self_instance: An instance of a model to set attributes on from validation, this is used when running\n validation from the `__init__` method of a model.\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/plugin/__init__.py_ValidateJsonHandlerProtocol_ValidateJsonHandlerProtocol.on_enter.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_ValidateJsonHandlerProtocol_ValidateJsonHandlerProtocol.on_enter.pass", "embedding": null, "metadata": {"file_path": "pydantic/plugin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 151, "span_ids": ["ValidateJsonHandlerProtocol", "ValidateJsonHandlerProtocol.on_enter"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ValidateJsonHandlerProtocol(BaseValidateHandlerProtocol, Protocol):\n \"\"\"Event handler for `SchemaValidator.validate_json`.\"\"\"\n\n def on_enter(\n self,\n input: str | bytes | bytearray,\n *,\n strict: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n \"\"\"Callback to be notified of validation start, and create an instance of the event handler.\n\n Args:\n input: The JSON data to be validated.\n strict: Whether to validate the object in strict mode.\n context: The context to use for validation, this is passed to functional validators.\n self_instance: An instance of a model to set attributes on from validation, this is used when running\n validation from the `__init__` method of a model.\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/plugin/__init__.py_StringInput_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/__init__.py_StringInput_", "embedding": null, "metadata": {"file_path": "pydantic/plugin/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 171, "span_ids": ["ValidateStringsHandlerProtocol.on_enter", "impl:7", "ValidateStringsHandlerProtocol"], "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": "StringInput: TypeAlias = 'dict[str, StringInput]'\n\n\nclass ValidateStringsHandlerProtocol(BaseValidateHandlerProtocol, Protocol):\n \"\"\"Event handler for `SchemaValidator.validate_strings`.\"\"\"\n\n def on_enter(\n self, input: StringInput, *, strict: bool | None = None, context: dict[str, Any] | None = None\n ) -> None:\n \"\"\"Callback to be notified of validation start, and create an instance of the event handler.\n\n Args:\n input: The string data to be validated.\n strict: Whether to validate the object in strict mode.\n context: The context to use for validation, this is passed to functional validators.\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/plugin/_loader.py_from___future___import_an__loading_plugins.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_loader.py_from___future___import_an__loading_plugins.False", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_loader.py", "file_name": "_loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["imports"], "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": "from __future__ import annotations\n\nimport importlib.metadata as importlib_metadata\nimport os\nimport warnings\nfrom typing import TYPE_CHECKING, Final, Iterable\n\nif TYPE_CHECKING:\n from . import PydanticPluginProtocol\n\n\nPYDANTIC_ENTRY_POINT_GROUP: Final[str] = 'pydantic'\n\n# cache of plugins\n_plugins: dict[str, PydanticPluginProtocol] | None = None\n# return no plugins while loading plugins to avoid recursion and errors while import plugins\n# this means that if plugins use pydantic\n_loading_plugins: 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/plugin/_loader.py_get_plugins_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_loader.py_get_plugins_", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_loader.py", "file_name": "_loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 57, "span_ids": ["get_plugins"], "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 get_plugins() -> Iterable[PydanticPluginProtocol]:\n \"\"\"Load plugins for Pydantic.\n\n Inspired by: https://github.com/pytest-dev/pluggy/blob/1.3.0/src/pluggy/_manager.py#L376-L402\n \"\"\"\n disabled_plugins = os.getenv('PYDANTIC_DISABLE_PLUGINS')\n global _plugins, _loading_plugins\n if _loading_plugins:\n # this happens when plugins themselves use pydantic, we return no plugins\n return ()\n elif disabled_plugins in ('__all__', '1', 'true'):\n return ()\n elif _plugins is None:\n _plugins = {}\n # set _loading_plugins so any plugins that use pydantic don't themselves use plugins\n _loading_plugins = True\n try:\n for dist in importlib_metadata.distributions():\n for entry_point in dist.entry_points:\n if entry_point.group != PYDANTIC_ENTRY_POINT_GROUP:\n continue\n if entry_point.value in _plugins:\n continue\n if disabled_plugins is not None and entry_point.name in disabled_plugins.split(','):\n continue\n try:\n _plugins[entry_point.value] = entry_point.load()\n except (ImportError, AttributeError) as e:\n warnings.warn(\n f'{e.__class__.__name__} while loading the `{entry_point.name}` Pydantic plugin, '\n f'this plugin will not be installed.\\n\\n{e!r}'\n )\n finally:\n _loading_plugins = False\n\n return _plugins.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/plugin/_schema_validator.py__Pluggable_schema_valid_events.list_Event___args___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py__Pluggable_schema_valid_events.list_Event___args___", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_schema_validator.py", "file_name": "_schema_validator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["docstring"], "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": "\"\"\"Pluggable schema validator for pydantic.\"\"\"\nfrom __future__ import annotations\n\nimport functools\nfrom typing import TYPE_CHECKING, Any, Callable, Iterable, TypeVar\n\nfrom pydantic_core import CoreConfig, CoreSchema, SchemaValidator, ValidationError\nfrom typing_extensions import Literal, ParamSpec\n\nif TYPE_CHECKING:\n from . import BaseValidateHandlerProtocol, PydanticPluginProtocol, SchemaKind, SchemaTypePath\n\n\nP = ParamSpec('P')\nR = TypeVar('R')\nEvent = Literal['on_validate_python', 'on_validate_json', 'on_validate_strings']\nevents: list[Event] = list(Event.__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/plugin/_schema_validator.py__type_ignore_create_schema_validator.if_plugins_.else_.return.SchemaValidator_schema_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py__type_ignore_create_schema_validator.if_plugins_.else_.return.SchemaValidator_schema_c", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_schema_validator.py", "file_name": "_schema_validator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 49, "span_ids": ["create_schema_validator", "docstring"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: ignore\n\n\ndef create_schema_validator(\n schema: CoreSchema,\n schema_type: Any,\n schema_type_module: str,\n schema_type_name: str,\n schema_kind: SchemaKind,\n config: CoreConfig | None = None,\n plugin_settings: dict[str, Any] | None = None,\n) -> SchemaValidator:\n \"\"\"Create a `SchemaValidator` or `PluggableSchemaValidator` if plugins are installed.\n\n Returns:\n If plugins are installed then return `PluggableSchemaValidator`, otherwise return `SchemaValidator`.\n \"\"\"\n from . import SchemaTypePath\n from ._loader import get_plugins\n\n plugins = get_plugins()\n if plugins:\n return PluggableSchemaValidator(\n schema,\n schema_type,\n SchemaTypePath(schema_type_module, schema_type_name),\n schema_kind,\n config,\n plugins,\n plugin_settings or {},\n ) # type: ignore\n else:\n return SchemaValidator(schema, 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/plugin/_schema_validator.py_PluggableSchemaValidator_PluggableSchemaValidator.__getattr__.return.getattr_self__schema_vali": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_PluggableSchemaValidator_PluggableSchemaValidator.__getattr__.return.getattr_self__schema_vali", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_schema_validator.py", "file_name": "_schema_validator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 91, "span_ids": ["PluggableSchemaValidator", "PluggableSchemaValidator.__init__", "PluggableSchemaValidator.__getattr__"], "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 PluggableSchemaValidator:\n \"\"\"Pluggable schema validator.\"\"\"\n\n __slots__ = '_schema_validator', 'validate_json', 'validate_python', 'validate_strings'\n\n def __init__(\n self,\n schema: CoreSchema,\n schema_type: Any,\n schema_type_path: SchemaTypePath,\n schema_kind: SchemaKind,\n config: CoreConfig | None,\n plugins: Iterable[PydanticPluginProtocol],\n plugin_settings: dict[str, Any],\n ) -> None:\n self._schema_validator = SchemaValidator(schema, config)\n\n python_event_handlers: list[BaseValidateHandlerProtocol] = []\n json_event_handlers: list[BaseValidateHandlerProtocol] = []\n strings_event_handlers: list[BaseValidateHandlerProtocol] = []\n for plugin in plugins:\n try:\n p, j, s = plugin.new_schema_validator(\n schema, schema_type, schema_type_path, schema_kind, config, plugin_settings\n )\n except TypeError as e: # pragma: no cover\n raise TypeError(f'Error using plugin `{plugin.__module__}:{plugin.__class__.__name__}`: {e}') from e\n if p is not None:\n python_event_handlers.append(p)\n if j is not None:\n json_event_handlers.append(j)\n if s is not None:\n strings_event_handlers.append(s)\n\n self.validate_python = build_wrapper(self._schema_validator.validate_python, python_event_handlers)\n self.validate_json = build_wrapper(self._schema_validator.validate_json, json_event_handlers)\n self.validate_strings = build_wrapper(self._schema_validator.validate_strings, strings_event_handlers)\n\n def __getattr__(self, name: str) -> Any:\n return getattr(self._schema_validator, 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/plugin/_schema_validator.py_build_wrapper_build_wrapper.if_not_event_handlers_.else_.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_build_wrapper_build_wrapper.if_not_event_handlers_.else_.return.wrapper", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_schema_validator.py", "file_name": "_schema_validator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 120, "span_ids": ["build_wrapper"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_wrapper(func: Callable[P, R], event_handlers: list[BaseValidateHandlerProtocol]) -> Callable[P, R]:\n if not event_handlers:\n return func\n else:\n on_enters = tuple(h.on_enter for h in event_handlers if filter_handlers(h, 'on_enter'))\n on_successes = tuple(h.on_success for h in event_handlers if filter_handlers(h, 'on_success'))\n on_errors = tuple(h.on_error for h in event_handlers if filter_handlers(h, 'on_error'))\n on_exceptions = tuple(h.on_exception for h in event_handlers if filter_handlers(h, 'on_exception'))\n\n @functools.wraps(func)\n def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:\n for on_enter_handler in on_enters:\n on_enter_handler(*args, **kwargs)\n\n try:\n result = func(*args, **kwargs)\n except ValidationError as error:\n for on_error_handler in on_errors:\n on_error_handler(error)\n raise\n except Exception as exception:\n for on_exception_handler in on_exceptions:\n on_exception_handler(exception)\n raise\n else:\n for on_success_handler in on_successes:\n on_success_handler(result)\n return result\n\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_filter_handlers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/plugin/_schema_validator.py_filter_handlers_", "embedding": null, "metadata": {"file_path": "pydantic/plugin/_schema_validator.py", "file_name": "_schema_validator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 136, "span_ids": ["filter_handlers"], "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 filter_handlers(handler_cls: BaseValidateHandlerProtocol, method_name: str) -> bool:\n \"\"\"Filter out handler methods which are not implemented by the plugin directly - e.g. are missing\n or are inherited from the protocol.\n \"\"\"\n handler = getattr(handler_cls, method_name, None)\n if handler is None:\n return False\n elif handler.__module__ == 'pydantic.plugin':\n # this is the original handler, from the protocol due to runtime inheritance\n # we don't want to call it\n return False\n else:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py__RootModel_class_and_ty_RootModelRootType.typing_TypeVar_RootModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py__RootModel_class_and_ty_RootModelRootType.typing_TypeVar_RootModel", "embedding": null, "metadata": {"file_path": "pydantic/root_model.py", "file_name": "root_model.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["docstring"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"RootModel class and type definitions.\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\nfrom copy import copy, deepcopy\n\nfrom pydantic_core import PydanticUndefined\n\nfrom . import PydanticUserError\nfrom ._internal import _model_construction, _repr\nfrom .main import BaseModel, _object_setattr\n\nif typing.TYPE_CHECKING:\n from typing import Any\n\n from typing_extensions import Literal, dataclass_transform\n\n from .fields import Field as PydanticModelField\n\n # dataclass_transform could be applied to RootModel directly, but `ModelMetaclass`'s dataclass_transform\n # takes priority (at least with pyright). We trick type checkers into thinking we apply dataclass_transform\n # on a new metaclass.\n @dataclass_transform(kw_only_default=False, field_specifiers=(PydanticModelField,))\n class _RootModelMetaclass(_model_construction.ModelMetaclass):\n ...\nelse:\n _RootModelMetaclass = _model_construction.ModelMetaclass\n\n__all__ = ('RootModel',)\n\nModel = typing.TypeVar('Model', bound='BaseModel')\nRootModelRootType = typing.TypeVar('RootModelRootType')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.model_construct_RootModel.model_construct.return.super_model_construct_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.model_construct_RootModel.model_construct.return.super_model_construct_r", "embedding": null, "metadata": {"file_path": "pydantic/root_model.py", "file_name": "root_model.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 91, "span_ids": ["RootModel.model_construct"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RootModel(BaseModel, typing.Generic[RootModelRootType], metaclass=_RootModelMetaclass):\n\n @classmethod\n def model_construct(cls: type[Model], root: RootModelRootType, _fields_set: set[str] | None = None) -> Model: # type: ignore\n \"\"\"Create a new model using the provided root object and update fields set.\n\n Args:\n root: The root object of the model.\n _fields_set: The set of fields to be updated.\n\n Returns:\n The new model.\n\n Raises:\n NotImplemented: If the model is not a subclass of `RootModel`.\n \"\"\"\n return super().model_construct(root=root, _fields_set=_fields_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/pydantic/root_model.py_RootModel.__getstate___RootModel.__copy__.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.__getstate___RootModel.__copy__.return.m", "embedding": null, "metadata": {"file_path": "pydantic/root_model.py", "file_name": "root_model.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 109, "span_ids": ["RootModel.__setstate__", "RootModel.__getstate__", "RootModel.__copy__"], "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 RootModel(BaseModel, typing.Generic[RootModelRootType], metaclass=_RootModelMetaclass):\n\n def __getstate__(self) -> dict[Any, Any]:\n return {\n '__dict__': self.__dict__,\n '__pydantic_fields_set__': self.__pydantic_fields_set__,\n }\n\n def __setstate__(self, state: dict[Any, Any]) -> None:\n _object_setattr(self, '__pydantic_fields_set__', state['__pydantic_fields_set__'])\n _object_setattr(self, '__dict__', state['__dict__'])\n\n def __copy__(self: Model) -> Model:\n \"\"\"Returns a shallow copy of the model.\"\"\"\n cls = type(self)\n m = cls.__new__(cls)\n _object_setattr(m, '__dict__', copy(self.__dict__))\n _object_setattr(m, '__pydantic_fields_set__', copy(self.__pydantic_fields_set__))\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/root_model.py_RootModel.__deepcopy___RootModel.__deepcopy__.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.__deepcopy___RootModel.__deepcopy__.return.m", "embedding": null, "metadata": {"file_path": "pydantic/root_model.py", "file_name": "root_model.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 119, "span_ids": ["RootModel.__deepcopy__"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RootModel(BaseModel, typing.Generic[RootModelRootType], metaclass=_RootModelMetaclass):\n\n def __deepcopy__(self: Model, memo: dict[int, Any] | None = None) -> Model:\n \"\"\"Returns a deep copy of the model.\"\"\"\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 __pydantic_fields_set__ is a set[str],\n # and attempting a deepcopy would be marginally slower.\n _object_setattr(m, '__pydantic_fields_set__', copy(self.__pydantic_fields_set__))\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/root_model.py_RootModel.if_typing_TYPE_CHECKING__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel.if_typing_TYPE_CHECKING__", "embedding": null, "metadata": {"file_path": "pydantic/root_model.py", "file_name": "root_model.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 156, "span_ids": ["RootModel:12", "RootModel.__repr_args__", "RootModel.__eq__"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RootModel(BaseModel, typing.Generic[RootModelRootType], metaclass=_RootModelMetaclass):\n\n if typing.TYPE_CHECKING:\n\n def model_dump( # type: ignore\n self,\n *,\n mode: Literal['json', 'python'] | str = 'python',\n include: Any = None,\n exclude: Any = 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 \"\"\"This method is included just to get a more accurate return type for type checkers.\n It is included in this `if TYPE_CHECKING:` block since no override is actually necessary.\n\n See the documentation of `BaseModel.model_dump` for more details about the arguments.\n\n Generally, this method will have a return type of `RootModelRootType`, assuming that `RootModelRootType` is\n not a `BaseModel` subclass. If `RootModelRootType` is a `BaseModel` subclass, then the return\n type will likely be `dict[str, Any]`, as `model_dump` calls are recursive. The return type could\n even be something different, in the case of a custom serializer.\n Thus, `Any` is used here to catch all of these cases.\n \"\"\"\n ...\n\n def __eq__(self, other: Any) -> bool:\n if not isinstance(other, RootModel):\n return NotImplemented\n return self.model_fields['root'].annotation == other.model_fields['root'].annotation and super().__eq__(other)\n\n def __repr_args__(self) -> _repr.ReprArgs:\n yield 'root', self.root", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__get_schema__get_schema.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__get_schema__get_schema.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 82, "span_ids": ["_get_schema"], "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": "def _get_schema(type_: Any, config_wrapper: _config.ConfigWrapper, parent_depth: int) -> CoreSchema:\n \"\"\"`BaseModel` uses its own `__module__` to find out where it was defined\n and then looks 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\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 always work for more complex cases.\n\n For example, take the following:\n\n a.py\n ```python\n from typing import Dict, List\n\n IntList = List[int]\n OuterDict = Dict[str, 'IntList']\n ```\n\n b.py\n ```python test=\"skip\"\n from a import OuterDict\n\n from pydantic import TypeAdapter\n\n IntList = int # replaces the symbol the forward reference is looking for\n v = TypeAdapter(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 `TypeAdapter(OuterDict)` can't determine what module `OuterDict` came from.\n\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\n But at the very least this behavior is _subtly_ different from `BaseModel`'s.\n \"\"\"\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(config_wrapper, types_namespace=global_ns, typevars_map={})\n schema = gen.generate_schema(type_)\n schema = gen.clean_schema(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/type_adapter.py_TypeAdapter.validate_strings_TypeAdapter.validate_strings.return.self_validator_validate_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.validate_strings_TypeAdapter.validate_strings.return.self_validator_validate_s", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 290, "span_ids": ["TypeAdapter.validate_strings"], "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": "@final\nclass TypeAdapter(Generic[T]):\n\n def validate_strings(self, obj: Any, /, *, strict: bool | None = None, context: dict[str, Any] | None = None) -> T:\n \"\"\"Validate object contains string data against the model.\n\n Args:\n obj: The object contains string data to validate.\n strict: Whether to strictly check types.\n context: Additional context to use during validation.\n\n Returns:\n The validated object.\n \"\"\"\n return self.validator.validate_strings(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/types.py__A_boolean_that_must_be_conint.return.Annotated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__A_boolean_that_must_be_conint.return.Annotated_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 231, "span_ids": ["conint", "impl:5"], "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": "\"\"\"A boolean that must be either ``True`` or ``False``.\"\"\"\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 \"\"\"\n !!! warning \"Discouraged\"\n This function is **discouraged** in favor of using\n [`Annotated`](https://docs.python.org/3/library/typing.html#typing.Annotated) with\n [`Field`][pydantic.fields.Field] instead.\n\n This function will be **deprecated** in Pydantic 3.0.\n\n The reason is that `conint` returns a type, which doesn't play well with static analysis tools.\n\n === \":x: Don't do this\"\n ```py\n from pydantic import BaseModel, conint\n\n class Foo(BaseModel):\n bar: conint(strict=True, gt=0)\n ```\n\n === \":white_check_mark: Do this\"\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, Field\n\n class Foo(BaseModel):\n bar: Annotated[int, Field(strict=True, gt=0)]\n ```\n\n A wrapper around `int` that allows for additional constraints.\n\n Args:\n strict: Whether to validate the integer in strict mode. Defaults to `None`.\n gt: The value must be greater than this.\n ge: The value must be greater than or equal to this.\n lt: The value must be less than this.\n le: The value must be less than or equal to this.\n multiple_of: The value must be a multiple of this.\n\n Returns:\n The wrapped integer type.\n\n ```py\n from pydantic import BaseModel, ValidationError, conint\n\n class ConstrainedExample(BaseModel):\n constrained_int: conint(gt=1)\n\n m = ConstrainedExample(constrained_int=2)\n print(repr(m))\n #> ConstrainedExample(constrained_int=2)\n\n try:\n ConstrainedExample(constrained_int=0)\n except ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than',\n 'loc': ('constrained_int',),\n 'msg': 'Input should be greater than 1',\n 'input': 0,\n 'ctx': {'gt': 1},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than',\n }\n ]\n '''\n ```\n\n \"\"\" # noqa: D212\n return Annotated[\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_None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveInt_None_9", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 234, "end_line": 379, "span_ids": ["impl:13", "impl:7"], "tokens": 851}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "PositiveInt = Annotated[int, annotated_types.Gt(0)]\n\"\"\"An integer that must be greater than zero.\n\n```py\nfrom pydantic import BaseModel, PositiveInt, ValidationError\n\nclass Model(BaseModel):\n positive_int: PositiveInt\n\nm = Model(positive_int=1)\nprint(repr(m))\n#> Model(positive_int=1)\n\ntry:\n Model(positive_int=-1)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than',\n 'loc': ('positive_int',),\n 'msg': 'Input should be greater than 0',\n 'input': -1,\n 'ctx': {'gt': 0},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than',\n }\n ]\n '''\n```\n\"\"\"\nNegativeInt = Annotated[int, annotated_types.Lt(0)]\n\"\"\"An integer that must be less than zero.\n\n```py\nfrom pydantic import BaseModel, NegativeInt, ValidationError\n\nclass Model(BaseModel):\n negative_int: NegativeInt\n\nm = Model(negative_int=-1)\nprint(repr(m))\n#> Model(negative_int=-1)\n\ntry:\n Model(negative_int=1)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'less_than',\n 'loc': ('negative_int',),\n 'msg': 'Input should be less than 0',\n 'input': 1,\n 'ctx': {'lt': 0},\n 'url': 'https://errors.pydantic.dev/2/v/less_than',\n }\n ]\n '''\n```\n\"\"\"\nNonPositiveInt = Annotated[int, annotated_types.Le(0)]\n\"\"\"An integer that must be less than or equal to zero.\n\n```py\nfrom pydantic import BaseModel, NonPositiveInt, ValidationError\n\nclass Model(BaseModel):\n non_positive_int: NonPositiveInt\n\nm = Model(non_positive_int=0)\nprint(repr(m))\n#> Model(non_positive_int=0)\n\ntry:\n Model(non_positive_int=1)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'less_than_equal',\n 'loc': ('non_positive_int',),\n 'msg': 'Input should be less than or equal to 0',\n 'input': 1,\n 'ctx': {'le': 0},\n 'url': 'https://errors.pydantic.dev/2/v/less_than_equal',\n }\n ]\n '''\n```\n\"\"\"\nNonNegativeInt = Annotated[int, annotated_types.Ge(0)]\n\"\"\"An integer that must be greater than or equal to zero.\n\n```py\nfrom pydantic import BaseModel, NonNegativeInt, ValidationError\n\nclass Model(BaseModel):\n non_negative_int: NonNegativeInt\n\nm = Model(non_negative_int=0)\nprint(repr(m))\n#> Model(non_negative_int=0)\n\ntry:\n Model(non_negative_int=-1)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than_equal',\n 'loc': ('non_negative_int',),\n 'msg': 'Input should be greater than or equal to 0',\n 'input': -1,\n 'ctx': {'ge': 0},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than_equal',\n }\n ]\n '''\n```\n\"\"\"\nStrictInt = Annotated[int, Strict()]\n\"\"\"An integer that must be validated in strict mode.\n\n```py\nfrom pydantic import BaseModel, StrictInt, ValidationError\n\nclass StrictIntModel(BaseModel):\n strict_int: StrictInt\n\ntry:\n StrictIntModel(strict_int=3.14159)\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for StrictIntModel\n strict_int\n Input should be a valid integer [type=int_type, input_value=3.14159, input_type=float]\n '''\n```\n\"\"\"\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FLOAT 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/pydantic/types.py_AllowInfNan_confloat.return.Annotated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_AllowInfNan_confloat.return.Annotated_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 469, "span_ids": ["AllowInfNan.__hash__", "confloat", "AllowInfNan"], "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": "@_dataclasses.dataclass\nclass AllowInfNan(_fields.PydanticMetadata):\n \"\"\"A field metadata class to indicate that a field should allow ``-inf``, ``inf``, and ``nan``.\"\"\"\n\n allow_inf_nan: bool = True\n\n def __hash__(self) -> int:\n return hash(self.allow_inf_nan)\n\n\ndef 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 \"\"\"\n !!! warning \"Discouraged\"\n This function is **discouraged** in favor of using\n [`Annotated`](https://docs.python.org/3/library/typing.html#typing.Annotated) with\n [`Field`][pydantic.fields.Field] instead.\n\n This function will be **deprecated** in Pydantic 3.0.\n\n The reason is that `confloat` returns a type, which doesn't play well with static analysis tools.\n\n === \":x: Don't do this\"\n ```py\n from pydantic import BaseModel, confloat\n\n class Foo(BaseModel):\n bar: confloat(strict=True, gt=0)\n ```\n\n === \":white_check_mark: Do this\"\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, Field\n\n class Foo(BaseModel):\n bar: Annotated[float, Field(strict=True, gt=0)]\n ```\n\n A wrapper around `float` that allows for additional constraints.\n\n Args:\n strict: Whether to validate the float in strict mode.\n gt: The value must be greater than this.\n ge: The value must be greater than or equal to this.\n lt: The value must be less than this.\n le: The value must be less than or equal to this.\n multiple_of: The value must be a multiple of this.\n allow_inf_nan: Whether to allow `-inf`, `inf`, and `nan`.\n\n Returns:\n The wrapped float type.\n\n ```py\n from pydantic import BaseModel, ValidationError, confloat\n\n class ConstrainedExample(BaseModel):\n constrained_float: confloat(gt=1.0)\n\n m = ConstrainedExample(constrained_float=1.1)\n print(repr(m))\n #> ConstrainedExample(constrained_float=1.1)\n\n try:\n ConstrainedExample(constrained_float=0.9)\n except ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than',\n 'loc': ('constrained_float',),\n 'msg': 'Input should be greater than 1',\n 'input': 0.9,\n 'ctx': {'gt': 1.0},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than',\n }\n ]\n '''\n ```\n \"\"\" # noqa: D212\n return Annotated[\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__A_float_that_must_be_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_PositiveFloat__A_float_that_must_be_v", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 481, "end_line": 624, "span_ids": ["impl:23", "impl:17"], "tokens": 880}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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)]\n\"\"\"A float that must be greater than zero.\n\n```py\nfrom pydantic import BaseModel, PositiveFloat, ValidationError\n\nclass Model(BaseModel):\n positive_float: PositiveFloat\n\nm = Model(positive_float=1.0)\nprint(repr(m))\n#> Model(positive_float=1.0)\n\ntry:\n Model(positive_float=-1.0)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than',\n 'loc': ('positive_float',),\n 'msg': 'Input should be greater than 0',\n 'input': -1.0,\n 'ctx': {'gt': 0.0},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than',\n }\n ]\n '''\n```\n\"\"\"\nNegativeFloat = Annotated[float, annotated_types.Lt(0)]\n\"\"\"A float that must be less than zero.\n\n```py\nfrom pydantic import BaseModel, NegativeFloat, ValidationError\n\nclass Model(BaseModel):\n negative_float: NegativeFloat\n\nm = Model(negative_float=-1.0)\nprint(repr(m))\n#> Model(negative_float=-1.0)\n\ntry:\n Model(negative_float=1.0)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'less_than',\n 'loc': ('negative_float',),\n 'msg': 'Input should be less than 0',\n 'input': 1.0,\n 'ctx': {'lt': 0.0},\n 'url': 'https://errors.pydantic.dev/2/v/less_than',\n }\n ]\n '''\n```\n\"\"\"\nNonPositiveFloat = Annotated[float, annotated_types.Le(0)]\n\"\"\"A float that must be less than or equal to zero.\n\n```py\nfrom pydantic import BaseModel, NonPositiveFloat, ValidationError\n\nclass Model(BaseModel):\n non_positive_float: NonPositiveFloat\n\nm = Model(non_positive_float=0.0)\nprint(repr(m))\n#> Model(non_positive_float=0.0)\n\ntry:\n Model(non_positive_float=1.0)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'less_than_equal',\n 'loc': ('non_positive_float',),\n 'msg': 'Input should be less than or equal to 0',\n 'input': 1.0,\n 'ctx': {'le': 0.0},\n 'url': 'https://errors.pydantic.dev/2/v/less_than_equal',\n }\n ]\n '''\n```\n\"\"\"\nNonNegativeFloat = Annotated[float, annotated_types.Ge(0)]\n\"\"\"A float that must be greater than or equal to zero.\n\n```py\nfrom pydantic import BaseModel, NonNegativeFloat, ValidationError\n\nclass Model(BaseModel):\n non_negative_float: NonNegativeFloat\n\nm = Model(non_negative_float=0.0)\nprint(repr(m))\n#> Model(non_negative_float=0.0)\n\ntry:\n Model(non_negative_float=-1.0)\nexcept ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than_equal',\n 'loc': ('non_negative_float',),\n 'msg': 'Input should be greater than or equal to 0',\n 'input': -1.0,\n 'ctx': {'ge': 0.0},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than_equal',\n }\n ]\n '''\n```\n\"\"\"\nStrictFloat = Annotated[float, Strict(True)]\n\"\"\"A float that must be validated in strict mode.\n\n```py\nfrom pydantic import BaseModel, StrictFloat, ValidationError\n\nclass StrictFloatModel(BaseModel):\n strict_float: StrictFloat\n\ntry:\n StrictFloatModel(strict_float='1.0')\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for StrictFloatModel\n strict_float\n Input should be a valid number [type=float_type, input_value='1.0', input_type=str]\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/types.py_FiniteFloat_conbytes.return.Annotated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_FiniteFloat_conbytes.return.Annotated_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 625, "end_line": 664, "span_ids": ["impl:23", "conbytes"], "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": "FiniteFloat = Annotated[float, AllowInfNan(False)]\n\"\"\"A float that must be finite (not ``-inf``, ``inf``, or ``nan``).\n\n```py\nfrom pydantic import BaseModel, FiniteFloat\n\nclass Model(BaseModel):\n finite: FiniteFloat\n\nm = Model(finite=1.0)\nprint(m)\n#> finite=1.0\n```\n\"\"\"\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 \"\"\"A wrapper around `bytes` that allows for additional constraints.\n\n Args:\n min_length: The minimum length of the bytes.\n max_length: The maximum length of the bytes.\n strict: Whether to validate the bytes in strict mode.\n\n Returns:\n The wrapped bytes type.\n \"\"\"\n return Annotated[\n bytes,\n Strict(strict) if strict is not None else None,\n annotated_types.Len(min_length or 0, max_length),\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_StrictBytes_StringConstraints.pattern.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StrictBytes_StringConstraints.pattern.None", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 670, "end_line": 699, "span_ids": ["impl:29", "StringConstraints"], "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": "StrictBytes = Annotated[bytes, Strict()]\n\"\"\"A bytes that must be validated in strict mode.\"\"\"\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ STRING TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n@_dataclasses.dataclass(frozen=True)\nclass StringConstraints(annotated_types.GroupedMetadata):\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/fields/#string-constraints\n\n Apply constraints to `str` types.\n\n Attributes:\n strip_whitespace: Whether to strip whitespace from the string.\n to_upper: Whether to convert the string to uppercase.\n to_lower: Whether to convert the string to lowercase.\n strict: Whether to validate the string in strict mode.\n min_length: The minimum length of the string.\n max_length: The maximum length of the string.\n pattern: A regex pattern that the string must match.\n \"\"\"\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_StringConstraints.__iter___StringConstraints.__iter__.if_.yield__fields_pydantic_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StringConstraints.__iter___StringConstraints.__iter__.if_.yield__fields_pydantic_ge", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 687, "end_line": 705, "span_ids": ["StringConstraints.__iter__"], "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": "@_dataclasses.dataclass(frozen=True)\nclass StringConstraints(annotated_types.GroupedMetadata):\n\n def __iter__(self) -> Iterator[BaseMetadata]:\n if self.min_length is not None:\n yield MinLen(self.min_length)\n if self.max_length is not None:\n yield MaxLen(self.max_length)\n if self.strict is not None:\n yield Strict()\n if (\n self.strip_whitespace is not None\n or self.pattern is not None\n or self.to_lower is not None\n or self.to_upper is not None\n ):\n yield _fields.pydantic_general_metadata(\n strip_whitespace=self.strip_whitespace,\n to_upper=self.to_upper,\n to_lower=self.to_lower,\n pattern=self.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/pydantic/types.py_constr_constr.return.Annotated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_constr_constr.return.Annotated_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 783, "span_ids": ["constr"], "tokens": 540}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 \"\"\"\n !!! warning \"Discouraged\"\n This function is **discouraged** in favor of using\n [`Annotated`](https://docs.python.org/3/library/typing.html#typing.Annotated) with\n [`StringConstraints`][pydantic.types.StringConstraints] instead.\n\n This function will be **deprecated** in Pydantic 3.0.\n\n The reason is that `constr` returns a type, which doesn't play well with static analysis tools.\n\n === \":x: Don't do this\"\n ```py\n from pydantic import BaseModel, constr\n\n class Foo(BaseModel):\n bar: constr(strip_whitespace=True, to_upper=True, pattern=r'^[A-Z]+$')\n ```\n\n === \":white_check_mark: Do this\"\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, StringConstraints\n\n class Foo(BaseModel):\n bar: Annotated[str, StringConstraints(strip_whitespace=True, to_upper=True, pattern=r'^[A-Z]+$')]\n ```\n\n A wrapper around `str` that allows for additional constraints.\n\n ```py\n from pydantic import BaseModel, constr\n\n class Foo(BaseModel):\n bar: constr(strip_whitespace=True, to_upper=True, pattern=r'^[A-Z]+$')\n\n\n foo = Foo(bar=' hello ')\n print(foo)\n #> bar='HELLO'\n ```\n\n Args:\n strip_whitespace: Whether to remove leading and trailing whitespace.\n to_upper: Whether to turn all characters to uppercase.\n to_lower: Whether to turn all characters to lowercase.\n strict: Whether to validate the string in strict mode.\n min_length: The minimum length of the string.\n max_length: The maximum length of the string.\n pattern: A regex pattern to validate the string against.\n\n Returns:\n The wrapped string type.\n \"\"\" # noqa: D212\n return Annotated[\n str,\n StringConstraints(\n strip_whitespace=strip_whitespace,\n to_upper=to_upper,\n to_lower=to_lower,\n strict=strict,\n min_length=min_length,\n max_length=max_length,\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_conset.return.Annotated_Set_item_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_StrictStr_conset.return.Annotated_Set_item_type_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 797, "end_line": 818, "span_ids": ["conset", "impl:31"], "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": "StrictStr = Annotated[str, Strict()]\n\"\"\"A string that must be validated in strict mode.\"\"\"\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ COLLECTION TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nHashableItemType = TypeVar('HashableItemType', bound=Hashable)\n\n\ndef conset(\n item_type: type[HashableItemType], *, min_length: int | None = None, max_length: int | None = None\n) -> type[set[HashableItemType]]:\n \"\"\"A wrapper around `typing.Set` that allows for additional constraints.\n\n Args:\n item_type: The type of the items in the set.\n min_length: The minimum length of the set.\n max_length: The maximum length of the set.\n\n Returns:\n The wrapped set type.\n \"\"\"\n return Annotated[Set[item_type], annotated_types.Len(min_length or 0, 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_conlist_AnyType.TypeVar_AnyType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_conlist_AnyType.TypeVar_AnyType_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 840, "end_line": 874, "span_ids": ["impl:37", "conlist"], "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 conlist(\n item_type: type[AnyItemType],\n *,\n min_length: int | None = None,\n max_length: int | None = None,\n unique_items: bool | None = None,\n) -> type[list[AnyItemType]]:\n \"\"\"A wrapper around typing.List that adds validation.\n\n Args:\n item_type: The type of the items in the list.\n min_length: The minimum length of the list. Defaults to None.\n max_length: The maximum length of the list. Defaults to None.\n unique_items: Whether the items in the list must be unique. Defaults to None.\n !!! warning Deprecated\n The `unique_items` parameter is deprecated, use `Set` instead.\n See [this issue](https://github.com/pydantic/pydantic-core/issues/296) for more details.\n\n Returns:\n The wrapped list type.\n \"\"\"\n if unique_items is not None:\n raise PydanticUserError(\n (\n '`unique_items` is removed, use `Set` instead'\n '(this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296)'\n ),\n code='removed-kwargs',\n )\n return Annotated[List[item_type], annotated_types.Len(min_length or 0, max_length)]\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~ IMPORT STRING TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAnyType = TypeVar('AnyType')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_if_TYPE_CHECKING__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_if_TYPE_CHECKING__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": 875, "end_line": 999, "span_ids": ["impl:37"], "tokens": 923}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ImportString = Annotated[AnyType, ...]\nelse:\n\n class ImportString:\n \"\"\"A type that can be used to import a type from a string.\n\n `ImportString` expects a string and loads the Python object importable at that dotted path.\n Attributes of modules may be separated from the module by `:` or `.`, e.g. if `'math:cos'` was provided,\n the resulting field value would be the function`cos`. If a `.` is used and both an attribute and submodule\n are present at the same path, the module will be preferred.\n\n On model instantiation, pointers will be evaluated and imported. There is\n some nuance to this behavior, demonstrated in the examples below.\n\n **Good behavior:**\n ```py\n from math import cos\n\n from pydantic import BaseModel, Field, ImportString, ValidationError\n\n\n class ImportThings(BaseModel):\n obj: ImportString\n\n\n # A string value will cause an automatic import\n my_cos = ImportThings(obj='math.cos')\n\n # You can use the imported function as you would expect\n cos_of_0 = my_cos.obj(0)\n assert cos_of_0 == 1\n\n\n # A string whose value cannot be imported will raise an error\n try:\n ImportThings(obj='foo.bar')\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for ImportThings\n obj\n Invalid python path: No module named 'foo.bar' [type=import_error, input_value='foo.bar', input_type=str]\n '''\n\n\n # Actual python objects can be assigned as well\n my_cos = ImportThings(obj=cos)\n my_cos_2 = ImportThings(obj='math.cos')\n my_cos_3 = ImportThings(obj='math:cos')\n assert my_cos == my_cos_2 == my_cos_3\n\n\n # You can set default field value either as Python object:\n class ImportThingsDefaultPyObj(BaseModel):\n obj: ImportString = math.cos\n\n\n # or as a string value (but only if used with `validate_default=True`)\n class ImportThingsDefaultString(BaseModel):\n obj: ImportString = Field(default='math.cos', validate_default=True)\n\n\n my_cos_default1 = ImportThingsDefaultPyObj()\n my_cos_default2 = ImportThingsDefaultString()\n assert my_cos_default1.obj == my_cos_default2.obj == math.cos\n\n\n # note: this will not work!\n class ImportThingsMissingValidateDefault(BaseModel):\n obj: ImportString = 'math.cos'\n\n my_cos_default3 = ImportThingsMissingValidateDefault()\n assert my_cos_default3.obj == 'math.cos' # just string, not evaluated\n ```\n\n Serializing an `ImportString` type to json is also possible.\n\n ```py\n from pydantic import BaseModel, ImportString\n\n\n class ImportThings(BaseModel):\n obj: ImportString\n\n\n # Create an instance\n m = ImportThings(obj='math.cos')\n print(m)\n #> obj=\n print(m.model_dump_json())\n #> {\"obj\":\"math.cos\"}\n ```\n \"\"\"\n\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, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n serializer = core_schema.plain_serializer_function_ser_schema(cls._serialize, when_used='json')\n if cls is source:\n # Treat bare usage of ImportString (`schema is None`) as the same as ImportString[Any]\n return core_schema.no_info_plain_validator_function(\n function=_validators.import_string, serialization=serializer\n )\n else:\n return core_schema.no_info_before_validator_function(\n function=_validators.import_string, schema=handler(source), serialization=serializer\n )\n\n @staticmethod\n def _serialize(v: Any) -> str:\n if isinstance(v, ModuleType):\n return v.__name__\n elif hasattr(v, '__module__') and hasattr(v, '__name__'):\n return f'{v.__module__}.{v.__name__}'\n else:\n return v\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_22_condecimal.return.Annotated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_22_condecimal.return.Annotated_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 982, "end_line": 1077, "span_ids": ["condecimal", "impl:37"], "tokens": 808}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"\"\"\n !!! warning \"Discouraged\"\n This function is **discouraged** in favor of using\n [`Annotated`](https://docs.python.org/3/library/typing.html#typing.Annotated) with\n [`Field`][pydantic.fields.Field] instead.\n\n This function will be **deprecated** in Pydantic 3.0.\n\n The reason is that `condecimal` returns a type, which doesn't play well with static analysis tools.\n\n === \":x: Don't do this\"\n ```py\n from pydantic import BaseModel, condecimal\n\n class Foo(BaseModel):\n bar: condecimal(strict=True, allow_inf_nan=True)\n ```\n\n === \":white_check_mark: Do this\"\n ```py\n from decimal import Decimal\n\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, Field\n\n class Foo(BaseModel):\n bar: Annotated[Decimal, Field(strict=True, allow_inf_nan=True)]\n ```\n\n A wrapper around Decimal that adds validation.\n\n Args:\n strict: Whether to validate the value in strict mode. Defaults to `None`.\n gt: The value must be greater than this. Defaults to `None`.\n ge: The value must be greater than or equal to this. Defaults to `None`.\n lt: The value must be less than this. Defaults to `None`.\n le: The value must be less than or equal to this. Defaults to `None`.\n multiple_of: The value must be a multiple of this. Defaults to `None`.\n max_digits: The maximum number of digits. Defaults to `None`.\n decimal_places: The number of decimal places. Defaults to `None`.\n allow_inf_nan: Whether to allow infinity and NaN. Defaults to `None`.\n\n ```py\n from decimal import Decimal\n\n from pydantic import BaseModel, ValidationError, condecimal\n\n class ConstrainedExample(BaseModel):\n constrained_decimal: condecimal(gt=Decimal('1.0'))\n\n m = ConstrainedExample(constrained_decimal=Decimal('1.1'))\n print(repr(m))\n #> ConstrainedExample(constrained_decimal=Decimal('1.1'))\n\n try:\n ConstrainedExample(constrained_decimal=Decimal('0.9'))\n except ValidationError as e:\n print(e.errors())\n '''\n [\n {\n 'type': 'greater_than',\n 'loc': ('constrained_decimal',),\n 'msg': 'Input should be greater than 1.0',\n 'input': Decimal('0.9'),\n 'ctx': {'gt': Decimal('1.0')},\n 'url': 'https://errors.pydantic.dev/2/v/greater_than',\n }\n ]\n '''\n ```\n \"\"\" # noqa: D212\n return Annotated[\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.pydantic_general_metadata(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_23_UuidVersion.__hash__.return.hash_type_self_uuid_versi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_23_UuidVersion.__hash__.return.hash_type_self_uuid_versi", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1066, "end_line": 1095, "span_ids": ["UuidVersion", "UuidVersion.__get_pydantic_json_schema__", "UuidVersion.__hash__", "condecimal", "UuidVersion.__get_pydantic_core_schema__"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UUID TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n@_dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass UuidVersion:\n \"\"\"A field metadata class to indicate a [UUID](https://docs.python.org/3/library/uuid.html) version.\"\"\"\n\n uuid_version: Literal[1, 3, 4, 5]\n\n def __get_pydantic_json_schema__(\n self, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\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__(self, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n if isinstance(self, source):\n # used directly as a type\n return core_schema.uuid_schema(version=self.uuid_version)\n else:\n # update existing schema with self.uuid_version\n schema = handler(source)\n _check_annotated_type(schema['type'], 'uuid', self.__class__.__name__)\n schema['version'] = self.uuid_version # type: ignore\n return schema\n\n def __hash__(self) -> int:\n return hash(type(self.uuid_version))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_UUID1_UUID5.Annotated_UUID_UuidVersi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_UUID1_UUID5.Annotated_UUID_UuidVersi", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1112, "end_line": 1154, "span_ids": ["impl:43"], "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": "UUID1 = Annotated[UUID, UuidVersion(1)]\n\"\"\"A [UUID](https://docs.python.org/3/library/uuid.html) that must be version 1.\n\n```py\nimport uuid\n\nfrom pydantic import UUID1, BaseModel\n\nclass Model(BaseModel):\n uuid1: UUID1\n\nModel(uuid1=uuid.uuid1())\n```\n\"\"\"\nUUID3 = Annotated[UUID, UuidVersion(3)]\n\"\"\"A [UUID](https://docs.python.org/3/library/uuid.html) that must be version 3.\n\n```py\nimport uuid\n\nfrom pydantic import UUID3, BaseModel\n\nclass Model(BaseModel):\n uuid3: UUID3\n\nModel(uuid3=uuid.uuid3(uuid.NAMESPACE_DNS, 'pydantic.org'))\n```\n\"\"\"\nUUID4 = Annotated[UUID, UuidVersion(4)]\n\"\"\"A [UUID](https://docs.python.org/3/library/uuid.html) that must be version 4.\n\n```py\nimport uuid\n\nfrom pydantic import UUID4, BaseModel\n\nclass Model(BaseModel):\n uuid4: UUID4\n\nModel(uuid4=uuid.uuid4())\n```\n\"\"\"\nUUID5 = Annotated[UUID, UuidVersion(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/pydantic/types.py_None_27_PathType.__get_pydantic_core_schema__.return.core_schema_with_info_aft": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_27_PathType.__get_pydantic_core_schema__.return.core_schema_with_info_aft", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1155, "end_line": 1195, "span_ids": ["PathType.__get_pydantic_core_schema__", "PathType.__get_pydantic_json_schema__", "impl:43", "PathType"], "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": "\"\"\"A [UUID](https://docs.python.org/3/library/uuid.html) that must be version 5.\n\n```py\nimport uuid\n\nfrom pydantic import UUID5, BaseModel\n\nclass Model(BaseModel):\n uuid5: UUID5\n\nModel(uuid5=uuid.uuid5(uuid.NAMESPACE_DNS, 'pydantic.org'))\n```\n\"\"\"\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PATH TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n@_dataclasses.dataclass\nclass PathType:\n path_type: Literal['file', 'dir', 'new']\n\n def __get_pydantic_json_schema__(\n self, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\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__(self, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n function_lookup = {\n 'file': cast(core_schema.WithInfoValidatorFunction, self.validate_file),\n 'dir': cast(core_schema.WithInfoValidatorFunction, self.validate_directory),\n 'new': cast(core_schema.WithInfoValidatorFunction, self.validate_new),\n }\n\n return core_schema.with_info_after_validator_function(\n function_lookup[self.path_type],\n handler(source),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_None_32": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_FilePath_None_32", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1224, "end_line": 1312, "span_ids": ["impl:51"], "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": "FilePath = Annotated[Path, PathType('file')]\n\"\"\"A path that must point to a file.\n\n```py\nfrom pathlib import Path\n\nfrom pydantic import BaseModel, FilePath, ValidationError\n\nclass Model(BaseModel):\n f: FilePath\n\npath = Path('text.txt')\npath.touch()\nm = Model(f='text.txt')\nprint(m.model_dump())\n#> {'f': PosixPath('text.txt')}\npath.unlink()\n\npath = Path('directory')\npath.mkdir(exist_ok=True)\ntry:\n Model(f='directory') # directory\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n f\n Path does not point to a file [type=path_not_file, input_value='directory', input_type=str]\n '''\npath.rmdir()\n\ntry:\n Model(f='not-exists-file')\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n f\n Path does not point to a file [type=path_not_file, input_value='not-exists-file', input_type=str]\n '''\n```\n\"\"\"\nDirectoryPath = Annotated[Path, PathType('dir')]\n\"\"\"A path that must point to a directory.\n\n```py\nfrom pathlib import Path\n\nfrom pydantic import BaseModel, DirectoryPath, ValidationError\n\nclass Model(BaseModel):\n f: DirectoryPath\n\npath = Path('directory/')\npath.mkdir()\nm = Model(f='directory/')\nprint(m.model_dump())\n#> {'f': PosixPath('directory')}\npath.rmdir()\n\npath = Path('file.txt')\npath.touch()\ntry:\n Model(f='file.txt') # file\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n f\n Path does not point to a directory [type=path_not_directory, input_value='file.txt', input_type=str]\n '''\npath.unlink()\n\ntry:\n Model(f='not-exists-directory')\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n f\n Path does not point to a directory [type=path_not_directory, input_value='not-exists-directory', input_type=str]\n '''\n```\n\"\"\"\nNewPath = Annotated[Path, PathType('new')]\n\"\"\"A path for a new file or directory that must not already exist.\"\"\"\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON 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/types.py_None_1_None_33": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_1_None_33", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1337, "end_line": 1444, "span_ids": ["impl:57"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if TYPE_CHECKING:\n # Json[list[str]] will be recognized by type checkers as list[str]\n Json = Annotated[AnyType, ...]\n\nelse:\n\n class Json:\n \"\"\"A special type wrapper which loads JSON before parsing.\n\n You can use the `Json` data type to make Pydantic first load a raw JSON string before\n validating the loaded data into the parametrized type:\n\n ```py\n from typing import Any, List\n\n from pydantic import BaseModel, Json, ValidationError\n\n\n class AnyJsonModel(BaseModel):\n json_obj: Json[Any]\n\n\n class ConstrainedJsonModel(BaseModel):\n json_obj: Json[List[int]]\n\n\n print(AnyJsonModel(json_obj='{\"b\": 1}'))\n #> json_obj={'b': 1}\n print(ConstrainedJsonModel(json_obj='[1, 2, 3]'))\n #> json_obj=[1, 2, 3]\n\n try:\n ConstrainedJsonModel(json_obj=12)\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for ConstrainedJsonModel\n json_obj\n JSON input should be string, bytes or bytearray [type=json_type, input_value=12, input_type=int]\n '''\n\n try:\n ConstrainedJsonModel(json_obj='[a, b]')\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for ConstrainedJsonModel\n json_obj\n Invalid JSON: expected value at line 1 column 2 [type=json_invalid, input_value='[a, b]', input_type=str]\n '''\n\n try:\n ConstrainedJsonModel(json_obj='[\"a\", \"b\"]')\n except ValidationError as e:\n print(e)\n '''\n 2 validation errors for ConstrainedJsonModel\n json_obj.0\n Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='a', input_type=str]\n json_obj.1\n Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='b', input_type=str]\n '''\n ```\n\n When you dump the model using `model_dump` or `model_dump_json`, the dumped value will be the result of validation,\n not the original JSON string. However, you can use the argument `round_trip=True` to get the original JSON string back:\n\n ```py\n from typing import List\n\n from pydantic import BaseModel, Json\n\n\n class ConstrainedJsonModel(BaseModel):\n json_obj: Json[List[int]]\n\n\n print(ConstrainedJsonModel(json_obj='[1, 2, 3]').model_dump_json())\n #> {\"json_obj\":[1,2,3]}\n print(\n ConstrainedJsonModel(json_obj='[1, 2, 3]').model_dump_json(round_trip=True)\n )\n #> {\"json_obj\":\"[1,2,3]\"}\n ```\n \"\"\"\n\n @classmethod\n def __class_getitem__(cls, item: AnyType) -> AnyType:\n return Annotated[item, cls()]\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n if cls is source:\n return core_schema.json_schema(None)\n else:\n return core_schema.json_schema(handler(source))\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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._validate_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._validate_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": 1914, "end_line": 1934, "span_ids": ["ByteSize._validate"], "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 ByteSize(int):\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 = cls.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 = cls.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_None_36_None_2.else_.FutureDate.__repr__.return._FutureDate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_36_None_2.else_.FutureDate.__repr__.return._FutureDate_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1869, "end_line": 1918, "span_ids": ["_check_annotated_type", "ByteSize.to", "impl:63"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATE TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\ndef _check_annotated_type(annotated_type: str, expected_type: str, annotation: str) -> None:\n if annotated_type != expected_type:\n raise PydanticUserError(f\"'{annotation}' cannot annotate '{annotated_type}'.\", code='invalid_annotated_type')\n\n\nif TYPE_CHECKING:\n PastDate = Annotated[date, ...]\n FutureDate = Annotated[date, ...]\nelse:\n\n class PastDate:\n \"\"\"A date in the past.\"\"\"\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n if cls is source:\n # used directly as a type\n return core_schema.date_schema(now_op='past')\n else:\n schema = handler(source)\n _check_annotated_type(schema['type'], 'date', cls.__name__)\n schema['now_op'] = 'past'\n return schema\n\n def __repr__(self) -> str:\n return 'PastDate'\n\n class FutureDate:\n \"\"\"A date in the future.\"\"\"\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n if cls is source:\n # used directly as a type\n return core_schema.date_schema(now_op='future')\n else:\n schema = handler(source)\n _check_annotated_type(schema['type'], 'date', cls.__name__)\n schema['now_op'] = 'future'\n return schema\n\n def __repr__(self) -> str:\n return 'FutureDate'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_condate_condate.return.Annotated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_condate_condate.return.Annotated_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1854, "end_line": 1878, "span_ids": ["condate"], "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 condate(\n *,\n strict: bool | None = None,\n gt: date | None = None,\n ge: date | None = None,\n lt: date | None = None,\n le: date | None = None,\n) -> type[date]:\n \"\"\"A wrapper for date that adds constraints.\n\n Args:\n strict: Whether to validate the date value in strict mode. Defaults to `None`.\n gt: The value must be greater than this. Defaults to `None`.\n ge: The value must be greater than or equal to this. Defaults to `None`.\n lt: The value must be less than this. Defaults to `None`.\n le: The value must be less than or equal to this. Defaults to `None`.\n\n Returns:\n A date type with the specified constraints.\n \"\"\"\n return Annotated[\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 ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_37_None_3.else_.FutureDatetime.__repr__.return._FutureDatetime_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_37_None_3.else_.FutureDatetime.__repr__.return._FutureDatetime_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1948, "end_line": 2032, "span_ids": ["condate", "impl:69"], "tokens": 625}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DATETIME TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nif TYPE_CHECKING:\n AwareDatetime = Annotated[datetime, ...]\n NaiveDatetime = Annotated[datetime, ...]\n PastDatetime = Annotated[datetime, ...]\n FutureDatetime = Annotated[datetime, ...]\n\nelse:\n\n class AwareDatetime:\n \"\"\"A datetime that requires timezone info.\"\"\"\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n if cls is source:\n # used directly as a type\n return core_schema.datetime_schema(tz_constraint='aware')\n else:\n schema = handler(source)\n _check_annotated_type(schema['type'], 'datetime', cls.__name__)\n schema['tz_constraint'] = 'aware'\n return schema\n\n def __repr__(self) -> str:\n return 'AwareDatetime'\n\n class NaiveDatetime:\n \"\"\"A datetime that doesn't require timezone info.\"\"\"\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n if cls is source:\n # used directly as a type\n return core_schema.datetime_schema(tz_constraint='naive')\n else:\n schema = handler(source)\n _check_annotated_type(schema['type'], 'datetime', cls.__name__)\n schema['tz_constraint'] = 'naive'\n return schema\n\n def __repr__(self) -> str:\n return 'NaiveDatetime'\n\n class PastDatetime:\n \"\"\"A datetime that must be in the past.\"\"\"\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n if cls is source:\n # used directly as a type\n return core_schema.datetime_schema(now_op='past')\n else:\n schema = handler(source)\n _check_annotated_type(schema['type'], 'datetime', cls.__name__)\n schema['now_op'] = 'past'\n return schema\n\n def __repr__(self) -> str:\n return 'PastDatetime'\n\n class FutureDatetime:\n \"\"\"A datetime that must be in the future.\"\"\"\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls, source: type[Any], handler: GetCoreSchemaHandler\n ) -> core_schema.CoreSchema:\n if cls is source:\n # used directly as a type\n return core_schema.datetime_schema(now_op='future')\n else:\n schema = handler(source)\n _check_annotated_type(schema['type'], 'datetime', cls.__name__)\n schema['now_op'] = 'future'\n return schema\n\n def __repr__(self) -> str:\n return 'FutureDatetime'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_38_EncoderProtocol.get_json_format._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_38_EncoderProtocol.get_json_format._", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2035, "end_line": 2072, "span_ids": ["EncoderProtocol.get_json_format", "impl:69", "EncoderProtocol.decode", "EncoderProtocol.encode", "EncoderProtocol"], "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": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Encoded TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass EncoderProtocol(Protocol):\n \"\"\"Protocol for encoding and decoding data to and from bytes.\"\"\"\n\n @classmethod\n def decode(cls, data: bytes) -> bytes:\n \"\"\"Decode the data using the encoder.\n\n Args:\n data: The data to decode.\n\n Returns:\n The decoded data.\n \"\"\"\n ...\n\n @classmethod\n def encode(cls, value: bytes) -> bytes:\n \"\"\"Encode the data using the encoder.\n\n Args:\n value: The data to encode.\n\n Returns:\n The encoded data.\n \"\"\"\n ...\n\n @classmethod\n def get_json_format(cls) -> str:\n \"\"\"Get the JSON format for the encoded data.\n\n Returns:\n The JSON format for the encoded data.\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_Base64UrlEncoder_Base64UrlEncoder.get_json_format.return._base64url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Base64UrlEncoder_Base64UrlEncoder.get_json_format.return._base64url_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2048, "end_line": 2085, "span_ids": ["Base64UrlEncoder", "Base64UrlEncoder.get_json_format", "Base64UrlEncoder.encode", "Base64UrlEncoder.decode"], "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 Base64UrlEncoder(EncoderProtocol):\n \"\"\"URL-safe Base64 encoder.\"\"\"\n\n @classmethod\n def decode(cls, data: bytes) -> bytes:\n \"\"\"Decode the data from base64 encoded bytes to original bytes data.\n\n Args:\n data: The data to decode.\n\n Returns:\n The decoded data.\n \"\"\"\n try:\n return base64.urlsafe_b64decode(data)\n except ValueError as e:\n raise PydanticCustomError('base64_decode', \"Base64 decoding error: '{error}'\", {'error': str(e)})\n\n @classmethod\n def encode(cls, value: bytes) -> bytes:\n \"\"\"Encode the data from bytes to a base64 encoded bytes.\n\n Args:\n value: The data to encode.\n\n Returns:\n The encoded data.\n \"\"\"\n return base64.urlsafe_b64encode(value)\n\n @classmethod\n def get_json_format(cls) -> Literal['base64url']:\n \"\"\"Get the JSON format for the encoded data.\n\n Returns:\n The JSON format for the encoded data.\n \"\"\"\n return 'base64url'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_EncodedStr_EncodedStr.__hash__.return.hash_self_encoder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_EncodedStr_EncodedStr.__hash__.return.hash_self_encoder_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2185, "end_line": 2270, "span_ids": ["EncodedStr.encode_str", "EncodedStr.__hash__", "EncodedStr.__get_pydantic_core_schema__", "EncodedStr.decode_str", "EncodedStr"], "tokens": 595}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@_dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass EncodedStr(EncodedBytes):\n \"\"\"A str type that is encoded and decoded using the specified encoder.\n\n `EncodedStr` needs an encoder that implements `EncoderProtocol` to operate.\n\n ```py\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, EncodedStr, EncoderProtocol, ValidationError\n\n class MyEncoder(EncoderProtocol):\n @classmethod\n def decode(cls, data: bytes) -> bytes:\n if data == b'**undecodable**':\n raise ValueError('Cannot decode data')\n return data[13:]\n\n @classmethod\n def encode(cls, value: bytes) -> bytes:\n return b'**encoded**: ' + value\n\n @classmethod\n def get_json_format(cls) -> str:\n return 'my-encoder'\n\n MyEncodedStr = Annotated[str, EncodedStr(encoder=MyEncoder)]\n\n class Model(BaseModel):\n my_encoded_str: MyEncodedStr\n\n # Initialize the model with encoded data\n m = Model(my_encoded_str='**encoded**: some str')\n\n # Access decoded value\n print(m.my_encoded_str)\n #> some str\n\n # Serialize into the encoded form\n print(m.model_dump())\n #> {'my_encoded_str': '**encoded**: some str'}\n\n # Validate encoded data\n try:\n Model(my_encoded_str='**undecodable**')\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n my_encoded_str\n Value error, Cannot decode data [type=value_error, input_value='**undecodable**', input_type=str]\n '''\n ```\n \"\"\"\n\n def __get_pydantic_core_schema__(self, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n return core_schema.with_info_after_validator_function(\n function=self.decode_str,\n schema=super(EncodedStr, self).__get_pydantic_core_schema__(source=source, handler=handler), # noqa: UP008\n serialization=core_schema.plain_serializer_function_ser_schema(function=self.encode_str),\n )\n\n def decode_str(self, data: bytes, _: core_schema.ValidationInfo) -> str:\n \"\"\"Decode the data using the specified encoder.\n\n Args:\n data: The data to decode.\n\n Returns:\n The decoded data.\n \"\"\"\n return data.decode()\n\n def encode_str(self, value: str) -> str:\n \"\"\"Encode the data using the specified encoder.\n\n Args:\n value: The data to encode.\n\n Returns:\n The encoded data.\n \"\"\"\n return super(EncodedStr, self).encode(value=value.encode()).decode() # noqa: UP008\n\n def __hash__(self) -> int:\n return hash(self.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/pydantic/types.py_Base64Bytes_None_42": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Base64Bytes_None_42", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2340, "end_line": 2458, "span_ids": ["impl:79", "impl:83"], "tokens": 1044}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "Base64Bytes = Annotated[bytes, EncodedBytes(encoder=Base64Encoder)]\n\"\"\"A bytes type that is encoded and decoded using the standard (non-URL-safe) base64 encoder.\n\nNote:\n Under the hood, `Base64Bytes` use standard library `base64.encodebytes` and `base64.decodebytes` functions.\n\n As a result, attempting to decode url-safe base64 data using the `Base64Bytes` type may fail or produce an incorrect\n decoding.\n\n```py\nfrom pydantic import Base64Bytes, BaseModel, ValidationError\n\nclass Model(BaseModel):\n base64_bytes: Base64Bytes\n\n# Initialize the model with base64 data\nm = Model(base64_bytes=b'VGhpcyBpcyB0aGUgd2F5')\n\n# Access decoded value\nprint(m.base64_bytes)\n#> b'This is the way'\n\n# Serialize into the base64 form\nprint(m.model_dump())\n#> {'base64_bytes': b'VGhpcyBpcyB0aGUgd2F5\\n'}\n\n# Validate base64 data\ntry:\n print(Model(base64_bytes=b'undecodable').base64_bytes)\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n base64_bytes\n Base64 decoding error: 'Incorrect padding' [type=base64_decode, input_value=b'undecodable', input_type=bytes]\n '''\n```\n\"\"\"\nBase64Str = Annotated[str, EncodedStr(encoder=Base64Encoder)]\n\"\"\"A str type that is encoded and decoded using the standard (non-URL-safe) base64 encoder.\n\nNote:\n Under the hood, `Base64Bytes` use standard library `base64.encodebytes` and `base64.decodebytes` functions.\n\n As a result, attempting to decode url-safe base64 data using the `Base64Str` type may fail or produce an incorrect\n decoding.\n\n```py\nfrom pydantic import Base64Str, BaseModel, ValidationError\n\nclass Model(BaseModel):\n base64_str: Base64Str\n\n# Initialize the model with base64 data\nm = Model(base64_str='VGhlc2UgYXJlbid0IHRoZSBkcm9pZHMgeW91J3JlIGxvb2tpbmcgZm9y')\n\n# Access decoded value\nprint(m.base64_str)\n#> These aren't the droids you're looking for\n\n# Serialize into the base64 form\nprint(m.model_dump())\n#> {'base64_str': 'VGhlc2UgYXJlbid0IHRoZSBkcm9pZHMgeW91J3JlIGxvb2tpbmcgZm9y\\n'}\n\n# Validate base64 data\ntry:\n print(Model(base64_str='undecodable').base64_str)\nexcept ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n base64_str\n Base64 decoding error: 'Incorrect padding' [type=base64_decode, input_value='undecodable', input_type=str]\n '''\n```\n\"\"\"\nBase64UrlBytes = Annotated[bytes, EncodedBytes(encoder=Base64UrlEncoder)]\n\"\"\"A bytes type that is encoded and decoded using the URL-safe base64 encoder.\n\nNote:\n Under the hood, `Base64UrlBytes` use standard library `base64.urlsafe_b64encode` and `base64.urlsafe_b64decode`\n functions.\n\n As a result, the `Base64UrlBytes` type can be used to faithfully decode \"vanilla\" base64 data\n (using `'+'` and `'/'`).\n\n```py\nfrom pydantic import Base64UrlBytes, BaseModel\n\nclass Model(BaseModel):\n base64url_bytes: Base64UrlBytes\n\n# Initialize the model with base64 data\nm = Model(base64url_bytes=b'SHc_dHc-TXc==')\nprint(m)\n#> base64url_bytes=b'Hw?tw>Mw'\n```\n\"\"\"\nBase64UrlStr = Annotated[str, EncodedStr(encoder=Base64UrlEncoder)]\n\"\"\"A str type that is encoded and decoded using the URL-safe base64 encoder.\n\nNote:\n Under the hood, `Base64UrlStr` use standard library `base64.urlsafe_b64encode` and `base64.urlsafe_b64decode`\n functions.\n\n As a result, the `Base64UrlStr` type can be used to faithfully decode \"vanilla\" base64 data (using `'+'` and `'/'`).\n\n```py\nfrom pydantic import Base64UrlStr, BaseModel\n\nclass Model(BaseModel):\n base64url_str: Base64UrlStr\n\n# Initialize the model with base64 data\nm = Model(base64url_str='SHc_dHc-TXc==')\nprint(m)\n#> base64url_str='Hw?tw>Mw'\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___getattr___GetPydanticSchema.__hash__.object___hash__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py___getattr___GetPydanticSchema.__hash__.object___hash__", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2579, "end_line": 2627, "span_ids": ["GetPydanticSchema", "impl:83"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "__getattr__ = getattr_migration(__name__)\n\n\n@_dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass GetPydanticSchema:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/types/#using-getpydanticschema-to-reduce-boilerplate\n\n A convenience class for creating an annotation that provides pydantic custom type hooks.\n\n This class is intended to eliminate the need to create a custom \"marker\" which defines the\n `__get_pydantic_core_schema__` and `__get_pydantic_json_schema__` custom hook methods.\n\n For example, to have a field treated by type checkers as `int`, but by pydantic as `Any`, you can do:\n ```python\n from typing import Any\n\n from typing_extensions import Annotated\n\n from pydantic import BaseModel, GetPydanticSchema\n\n HandleAsAny = GetPydanticSchema(lambda _s, h: h(Any))\n\n class Model(BaseModel):\n x: Annotated[int, HandleAsAny] # pydantic sees `x: Any`\n\n print(repr(Model(x='abc').x))\n #> 'abc'\n ```\n \"\"\"\n\n get_pydantic_core_schema: Callable[[Any, GetCoreSchemaHandler], CoreSchema] | None = None\n get_pydantic_json_schema: Callable[[Any, GetJsonSchemaHandler], JsonSchemaValue] | None = None\n\n # Note: we may want to consider adding a convenience staticmethod `def for_type(type_: Any) -> GetPydanticSchema:`\n # which returns `GetPydanticSchema(lambda _s, h: h(type_))`\n\n if not TYPE_CHECKING:\n # We put `__getattr__` in a non-TYPE_CHECKING block because otherwise, mypy allows arbitrary attribute access\n\n def __getattr__(self, item: str) -> Any:\n \"\"\"Use this rather than defining `__get_pydantic_core_schema__` etc. to reduce the number of nested calls.\"\"\"\n if item == '__get_pydantic_core_schema__' and self.get_pydantic_core_schema:\n return self.get_pydantic_core_schema\n elif item == '__get_pydantic_json_schema__' and self.get_pydantic_json_schema:\n return self.get_pydantic_json_schema\n else:\n return object.__getattribute__(self, item)\n\n __hash__ = object.__hash__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Tag_Tag.__get_pydantic_core_schema__.return.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Tag_Tag.__get_pydantic_core_schema__.return.schema", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2457, "end_line": 2542, "span_ids": ["Tag", "Tag.__get_pydantic_core_schema__"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(**_internal_dataclass.slots_true, frozen=True)\nclass Tag:\n \"\"\"Provides a way to specify the expected tag to use for a case of a (callable) discriminated union.\n\n Also provides a way to label a union case in error messages.\n\n When using a callable `Discriminator`, attach a `Tag` to each case in the `Union` to specify the tag that\n should be used to identify that case. For example, in the below example, the `Tag` is used to specify that\n if `get_discriminator_value` returns `'apple'`, the input should be validated as an `ApplePie`, and if it\n returns `'pumpkin'`, the input should be validated as a `PumpkinPie`.\n\n The primary role of the `Tag` here is to map the return value from the callable `Discriminator` function to\n the appropriate member of the `Union` in question.\n\n ```py\n from typing import Any, Union\n\n from typing_extensions import Annotated, Literal\n\n from pydantic import BaseModel, Discriminator, Tag\n\n class Pie(BaseModel):\n time_to_cook: int\n num_ingredients: int\n\n class ApplePie(Pie):\n fruit: Literal['apple'] = 'apple'\n\n class PumpkinPie(Pie):\n filling: Literal['pumpkin'] = 'pumpkin'\n\n def get_discriminator_value(v: Any) -> str:\n if isinstance(v, dict):\n return v.get('fruit', v.get('filling'))\n return getattr(v, 'fruit', getattr(v, 'filling', None))\n\n class ThanksgivingDinner(BaseModel):\n dessert: Annotated[\n Union[\n Annotated[ApplePie, Tag('apple')],\n Annotated[PumpkinPie, Tag('pumpkin')],\n ],\n Discriminator(get_discriminator_value),\n ]\n\n apple_variation = ThanksgivingDinner.model_validate(\n {'dessert': {'fruit': 'apple', 'time_to_cook': 60, 'num_ingredients': 8}}\n )\n print(repr(apple_variation))\n '''\n ThanksgivingDinner(dessert=ApplePie(time_to_cook=60, num_ingredients=8, fruit='apple'))\n '''\n\n pumpkin_variation = ThanksgivingDinner.model_validate(\n {\n 'dessert': {\n 'filling': 'pumpkin',\n 'time_to_cook': 40,\n 'num_ingredients': 6,\n }\n }\n )\n print(repr(pumpkin_variation))\n '''\n ThanksgivingDinner(dessert=PumpkinPie(time_to_cook=40, num_ingredients=6, filling='pumpkin'))\n '''\n ```\n\n !!! note\n You must specify a `Tag` for every case in a `Tag` that is associated with a\n callable `Discriminator`. Failing to do so will result in a `PydanticUserError` with code\n [`callable-discriminator-no-tag`](../errors/usage_errors.md#callable-discriminator-no-tag).\n\n See the [Discriminated Unions] concepts docs for more details on how to use `Tag`s.\n\n [Discriminated Unions]: ../concepts/unions.md#discriminated-unions\n \"\"\"\n\n tag: str\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(source_type)\n metadata = schema.setdefault('metadata', {})\n assert isinstance(metadata, dict)\n metadata[_core_utils.TAGGED_UNION_TAG_KEY] = self.tag\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/v1/env_settings.py_EnvSettingsSource._read_env_files_EnvSettingsSource._read_env_files.return.dotenv_vars": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource._read_env_files_EnvSettingsSource._read_env_files.return.dotenv_vars", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 229, "span_ids": ["EnvSettingsSource._read_env_files"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnvSettingsSource:\n\n def _read_env_files(self, case_sensitive: bool) -> Dict[str, Optional[str]]:\n env_files = self.env_file\n if env_files is None:\n return {}\n\n if isinstance(env_files, (str, os.PathLike)):\n env_files = [env_files]\n\n dotenv_vars = {}\n for env_file in env_files:\n env_path = Path(env_file).expanduser()\n if env_path.is_file():\n dotenv_vars.update(\n read_env_file(env_path, encoding=self.env_file_encoding, case_sensitive=case_sensitive)\n )\n\n return dotenv_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/v1/env_settings.py_EnvSettingsSource.field_is_complex_EnvSettingsSource.field_is_complex.return.True_allow_parse_failure": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/env_settings.py_EnvSettingsSource.field_is_complex_EnvSettingsSource.field_is_complex.return.True_allow_parse_failure", "embedding": null, "metadata": {"file_path": "pydantic/v1/env_settings.py", "file_name": "env_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 245, "span_ids": ["EnvSettingsSource.field_is_complex"], "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 EnvSettingsSource:\n\n def field_is_complex(self, field: ModelField) -> Tuple[bool, bool]:\n \"\"\"\n Find out if a field is complex, and if so whether JSON errors should be ignored\n \"\"\"\n if lenient_issubclass(field.annotation, JsonWrapper):\n return False, False\n\n if field.is_complex():\n allow_parse_failure = False\n elif is_union(get_origin(field.type_)) and field.sub_fields and any(f.is_complex() for f in field.sub_fields):\n allow_parse_failure = True\n else:\n return False, False\n\n return True, allow_parse_failure", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_replace_types_replace_types.if_isinstance_new_type_s.else_.return.new_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/generics.py_replace_types_replace_types.if_isinstance_new_type_s.else_.return.new_type", "embedding": null, "metadata": {"file_path": "pydantic/v1/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 330, "span_ids": ["replace_types"], "tokens": 868}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_types(type_: Any, type_map: Mapping[Any, Any]) -> 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 Annotated:\n annotated_type, *annotations = type_args\n return Annotated[replace_types(annotated_type, type_map), tuple(annotations)]\n\n if (origin_type is ExtLiteral) or (sys.version_info >= (3, 8) and origin_type is Literal):\n return type_map.get(type_, type_)\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 if not origin_type and lenient_issubclass(type_, GenericModel) and not type_.__concrete__:\n type_args = type_.__parameters__\n resolved_type_args = tuple(replace_types(t, type_map) for t in type_args)\n if all_identical(type_args, resolved_type_args):\n return type_\n return type_[resolved_type_args]\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 # For JsonWrapperValue, need to handle its inner type to allow correct parsing\n # of generic Json arguments like Json[T]\n if not origin_type and lenient_issubclass(type_, JsonWrapper):\n type_.inner_type = replace_types(type_.inner_type, type_map)\n return type_\n\n # If all else fails, we try to resolve the type directly and otherwise just\n # return the input with no modifications.\n new_type = type_map.get(type_, type_)\n # Convert string to ForwardRef\n if isinstance(new_type, str):\n return ForwardRef(new_type)\n else:\n return new_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/v1/networks.py_IPvAnyNetwork_MAX_EMAIL_LENGTH.2048": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py_IPvAnyNetwork_MAX_EMAIL_LENGTH.2048", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 680, "end_line": 705, "span_ids": ["impl:33", "IPvAnyNetwork", "IPvAnyNetwork.__modify_schema__", "IPvAnyNetwork.__get_validators__", "IPvAnyNetwork.validate"], "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 IPvAnyNetwork(_BaseNetwork): # type: ignore\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n field_schema.update(type='string', format='ipvanynetwork')\n\n @classmethod\n def __get_validators__(cls) -> 'CallableGenerator':\n yield cls.validate\n\n @classmethod\n def validate(cls, value: NetworkType) -> Union[IPv4Network, IPv6Network]:\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 errors.IPvAnyNetworkError()\n\n\npretty_email_regex = re.compile(r'([\\w ]*?) *<(.*)> *')\nMAX_EMAIL_LENGTH = 2048", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py__Maximum_length_for_an__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/v1/networks.py__Maximum_length_for_an__", "embedding": null, "metadata": {"file_path": "pydantic/v1/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 706, "end_line": 748, "span_ids": ["validate_email", "impl:33"], "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": "\"\"\"Maximum length for an email.\nA somewhat arbitrary but very generous number compared to what is allowed by most implementations.\n\"\"\"\n\n\ndef validate_email(value: Union[str]) -> Tuple[str, str]:\n \"\"\"\n Email address validation using https://pypi.org/project/email-validator/\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 if len(value) > MAX_EMAIL_LENGTH:\n raise errors.EmailError()\n\n m = pretty_email_regex.fullmatch(value)\n name: Union[str, None] = None\n if m:\n name, value = m.groups()\n email = value.strip()\n try:\n parts = email_validator.validate_email(email, check_deliverability=False)\n except email_validator.EmailNotValidError as e:\n raise errors.EmailError from e\n\n if hasattr(parts, 'normalized'):\n # email-validator >= 2\n email = parts.normalized\n assert email is not None\n name = name or parts.local_part\n return name, email\n else:\n # email-validator >1, <2\n at_index = email.index('@')\n local_part = email[:at_index] # RFC 5321, local part must be case-sensitive.\n global_part = email[at_index:].lower()\n\n return name or local_part, local_part + global_part", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py__Decorator_for_validati_validate_call_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py__Decorator_for_validati_validate_call_1._", "embedding": null, "metadata": {"file_path": "pydantic/validate_call_decorator.py", "file_name": "validate_call_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["validate_call_1", "validate_call", "docstring"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Decorator for validating function calls.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport functools\nfrom typing import TYPE_CHECKING, Any, Callable, TypeVar, overload\n\nfrom ._internal import _validate_call\n\n__all__ = ('validate_call',)\n\nif TYPE_CHECKING:\n from .config import ConfigDict\n\n AnyCallableT = TypeVar('AnyCallableT', bound=Callable[..., Any])\n\n\n@overload\ndef validate_call(\n *, config: ConfigDict | None = None, validate_return: bool = False\n) -> Callable[[AnyCallableT], AnyCallableT]:\n ...\n\n\n@overload\ndef validate_call(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/version.py__The_version_module_h_version_short.return._join_VERSION_split_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py__The_version_module_h_version_short.return._join_VERSION_split_", "embedding": null, "metadata": {"file_path": "pydantic/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["version_short", "docstring"], "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": "\"\"\"The `version` module holds the version information for Pydantic.\"\"\"\nfrom __future__ import annotations as _annotations\n\n__all__ = 'VERSION', 'version_info'\n\nVERSION = '2.7.0a1'\n\"\"\"The version of Pydantic.\"\"\"\n\n\ndef version_short() -> str:\n \"\"\"Return the `major.minor` part of Pydantic version.\n\n It returns '2.1' if Pydantic version is '2.1.1'.\n \"\"\"\n return '.'.join(VERSION.split('.')[: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/version.py_version_info_version_info.return._n_join_30_for": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py_version_info_version_info.return._n_join_30_for", "embedding": null, "metadata": {"file_path": "pydantic/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 62, "span_ids": ["version_info"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def version_info() -> str:\n \"\"\"Return complete version information for Pydantic and its dependencies.\"\"\"\n import importlib.metadata as importlib_metadata\n import os\n import platform\n import sys\n from pathlib import Path\n\n import pydantic_core._pydantic_core as pdc\n\n from ._internal import _git as git\n\n # get data about packages that are closely related to pydantic, use pydantic or often conflict with pydantic\n package_names = {\n 'email-validator',\n 'fastapi',\n 'mypy',\n 'pydantic-extra-types',\n 'pydantic-settings',\n 'pyright',\n 'typing_extensions',\n }\n related_packages = []\n\n for dist in importlib_metadata.distributions():\n name = dist.metadata['Name']\n if name in package_names:\n related_packages.append(f'{name}-{dist.version}')\n\n pydantic_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))\n most_recent_commit = (\n git.git_revision(pydantic_dir) if git.is_git_repo(pydantic_dir) and git.have_git() else 'unknown'\n )\n\n info = {\n 'pydantic version': VERSION,\n 'pydantic-core version': pdc.__version__,\n 'pydantic-core build': getattr(pdc, 'build_info', None) or pdc.build_profile,\n 'install path': Path(__file__).resolve().parent,\n 'python version': sys.version,\n 'platform': platform.platform(),\n 'related packages': ' '.join(related_packages),\n 'commit': most_recent_commit,\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/pydantic/version.py_parse_mypy_version_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/version.py_parse_mypy_version_", "embedding": null, "metadata": {"file_path": "pydantic/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 78, "span_ids": ["parse_mypy_version"], "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 parse_mypy_version(version: str) -> tuple[int, ...]:\n \"\"\"Parse mypy string version to tuple of ints.\n\n It parses normal version like `0.930` and extra info followed by a `+` sign\n like `0.940+dev.04cac4b5d911c4f9529e6ce86a27b44f28846f5d.dirty`.\n\n Args:\n version: The mypy version string.\n\n Returns:\n A tuple of ints. e.g. (0, 930).\n \"\"\"\n return tuple(map(int, version.partition('+')[0].split('.')))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py__Pydantic_specific_warn_PydanticDeprecationWarning.__init__.self.expected_removal.expected_removal_if_expec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py__Pydantic_specific_warn_PydanticDeprecationWarning.__init__.self.expected_removal.expected_removal_if_expec", "embedding": null, "metadata": {"file_path": "pydantic/warnings.py", "file_name": "warnings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["PydanticDeprecationWarning.__init__", "PydanticDeprecationWarning", "docstring"], "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": "\"\"\"Pydantic-specific warnings.\"\"\"\nfrom __future__ import annotations as _annotations\n\nfrom .version import version_short\n\n__all__ = 'PydanticDeprecatedSince20', 'PydanticDeprecationWarning'\n\n\nclass PydanticDeprecationWarning(DeprecationWarning):\n \"\"\"A Pydantic specific deprecation warning.\n\n This warning is raised when using deprecated functionality in Pydantic. It provides information on when the\n deprecation was introduced and the expected version in which the corresponding functionality will be removed.\n\n Attributes:\n message: Description of the warning.\n since: Pydantic version in what the deprecation was introduced.\n expected_removal: Pydantic version in what the corresponding functionality expected to be removed.\n \"\"\"\n\n message: str\n since: tuple[int, int]\n expected_removal: tuple[int, int]\n\n def __init__(\n self, message: str, *args: object, since: tuple[int, int], expected_removal: tuple[int, int] | None = None\n ) -> None:\n super().__init__(message, *args)\n self.message = message.rstrip('.')\n self.since = since\n self.expected_removal = expected_removal if expected_removal is not None else (since[0] + 1, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/check_relnotes.py__Short_helper_script_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/check_relnotes.py__Short_helper_script_to_", "embedding": null, "metadata": {"file_path": "release/check_relnotes.py", "file_name": "check_relnotes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["docstring"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Short helper script to check that a PR has exactly one relnotes label.\"\"\"\n\nimport json\nimport os\nimport sys\n\nif __name__ == '__main__':\n event_path = os.environ.get('GITHUB_EVENT_PATH')\n if event_path is None:\n raise RuntimeError('Can only check changelog on github actions')\n\n with open(event_path) as event_file:\n event = json.load(event_file)\n\n labels = [\n label['name']\n for label in event['pull_request']['labels']\n if label['name'].startswith('relnotes-') or label['name'] == 'documentation'\n ]\n\n if not labels:\n print(\n 'No suitable label found, please add either one of the `relnotes-` or `documentation` labels.',\n file=sys.stderr,\n )\n exit(1)\n\n if len(labels) > 1:\n print(f'Multiple relnotes labels found: `{\"`, `\".join(labels)}`', file=sys.stderr)\n exit(1)\n\n print('Found suitable label:', labels[0])\n exit(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/release/make_history.py_from___future___import_an_main.print_f_nSUCCESS_added_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/make_history.py_from___future___import_an_main.print_f_nSUCCESS_added_", "embedding": null, "metadata": {"file_path": "release/make_history.py", "file_name": "make_history.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["imports", "main"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations as _annotations\n\nimport argparse\nimport json\nimport re\nimport subprocess\nimport sys\nfrom datetime import date\nfrom pathlib import Path\n\nimport requests\n\n\ndef main():\n root_dir = Path(__file__).parent.parent\n\n parser = argparse.ArgumentParser()\n # For easier iteration, can generate the release notes without saving\n parser.add_argument('--preview', help='print preview of release notes to terminal without saving to HISTORY.md')\n args = parser.parse_args()\n\n if args.preview:\n new_version = args.preview\n else:\n version_file = root_dir / 'pydantic' / 'version.py'\n new_version = re.search(r\"VERSION = '(.*)'\", version_file.read_text()).group(1)\n\n history_path = root_dir / 'HISTORY.md'\n history_content = history_path.read_text()\n\n # use ( to avoid matching beta versions\n if f'## v{new_version} (' in history_content:\n print(f'WARNING: v{new_version} already in history, stopping')\n sys.exit(1)\n\n title = f'v{new_version} ({date.today():%Y-%m-%d})'\n notes = get_notes(new_version)\n new_chunk = (\n f'## {title}\\n\\n'\n f'[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v{new_version})\\n\\n'\n f'{notes}\\n\\n'\n )\n if args.preview:\n print(new_chunk)\n return\n history = new_chunk + history_content\n\n history_path.write_text(history)\n print(f'\\nSUCCESS: added \"{title}\" section to {history_path.relative_to(root_dir)}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/make_history.py_get_notes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/release/make_history.py_get_notes_", "embedding": null, "metadata": {"file_path": "release/make_history.py", "file_name": "make_history.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 109, "span_ids": ["impl", "get_notes", "run", "get_last_tag", "get_gh_auth_token"], "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": "def get_notes(new_version: str) -> str:\n last_tag = get_last_tag()\n auth_token = get_gh_auth_token()\n\n data = {'target_committish': 'main', 'previous_tag_name': last_tag, 'tag_name': f'v{new_version}'}\n response = requests.post(\n 'https://api.github.com/repos/pydantic/pydantic/releases/generate-notes',\n headers={\n 'Accept': 'application/vnd.github+json',\n 'Authorization': f'Bearer {auth_token}',\n 'x-github-api-version': '2022-11-28',\n },\n data=json.dumps(data),\n )\n response.raise_for_status()\n\n body = response.json()['body']\n body = body.replace('\\n\\n', '')\n\n # Add one level to all headers so they match HISTORY.md, and add trailing newline\n body = re.sub(pattern='^(#+ .+?)$', repl=r'#\\1\\n', string=body, flags=re.MULTILINE)\n\n # Ensure a blank line before headers\n body = re.sub(pattern='([^\\n])(\\n#+ .+?\\n)', repl=r'\\1\\n\\2', string=body)\n\n # Render PR links nicely\n body = re.sub(\n pattern='https://github.com/pydantic/pydantic/pull/(\\\\d+)',\n repl=r'[#\\1](https://github.com/pydantic/pydantic/pull/\\1)',\n string=body,\n )\n\n # Remove \"full changelog\" link\n body = re.sub(\n pattern=r'\\*\\*Full Changelog\\*\\*: https://.*$',\n repl='',\n string=body,\n )\n\n return body.strip()\n\n\ndef get_last_tag():\n return run('git', 'describe', '--tags', '--abbrev=0')\n\n\ndef get_gh_auth_token():\n return run('gh', 'auth', 'token')\n\n\ndef run(*args: str) -> str:\n p = subprocess.run(args, stdout=subprocess.PIPE, check=True, encoding='utf-8')\n return p.stdout.strip()\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/generate_north_star_data.py_from_datetime_import_date_website.return.one_of_blog_social_profi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/generate_north_star_data.py_from_datetime_import_date_website.return.one_of_blog_social_profi", "embedding": null, "metadata": {"file_path": "tests/benchmarks/generate_north_star_data.py", "file_name": "generate_north_star_data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 111, "span_ids": ["social_profile", "twitter_profile", "time_seconds", "date_string", "lax_datetime", "datetime_str", "time_string", "datetime_timestamp", "lax_float", "lax_int", "list_of", "time_microseconds", "imports", "lax_time", "one_of", "website", "blog", "facebook_profile", "linkedin_profile", "datetime_microseconds"], "tokens": 732}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from datetime import datetime\nfrom typing import Any, Callable, List, TypeVar, Union\n\nfrom faker import Faker\n\nf = Faker()\nFaker.seed(0)\n\n\nT = TypeVar('T')\n\n## Helper functions\n\n# by default faker uses upper bound of now for datetime, which\n# is not helpful for reproducing benchmark data\n_END_DATETIME = datetime(2023, 1, 1, 0, 0, 0, 0)\n\n\ndef one_of(*callables: Callable[[], Any]) -> Any:\n return f.random.choice(callables)()\n\n\ndef list_of(callable: Callable[[], T], max_length: int) -> List[T]:\n return [callable() for _ in range(f.random_int(max=max_length))]\n\n\ndef lax_int(*args: Any, **kwargs: Any) -> Union[int, float, str]:\n return f.random.choice((int, float, str))(f.random_int(*args, **kwargs))\n\n\ndef lax_float(*args: Any, **kwargs: Any) -> Union[int, float, str]:\n return f.random.choice((int, float, str))(f.pyfloat(*args, **kwargs))\n\n\ndef time_seconds() -> int:\n dt = f.date_time(end_datetime=_END_DATETIME)\n midnight = dt.replace(hour=0, minute=0, second=0, microsecond=0)\n return (dt - midnight).total_seconds()\n\n\ndef time_microseconds() -> float:\n return float(time_seconds()) + (f.random_int(max=999999) * 1e-6)\n\n\ndef time_string() -> str:\n return f.time()\n\n\ndef lax_time() -> Union[int, float, str]:\n return one_of(time_seconds, time_microseconds, time_string)\n\n\ndef date_string() -> str:\n return f.date(end_datetime=_END_DATETIME).format('%Y-%m-%d')\n\n\ndef datetime_timestamp() -> int:\n dt = f.date_time(end_datetime=_END_DATETIME)\n midnight = dt.replace(hour=0, minute=0, second=0, microsecond=0)\n return (dt - midnight).total_seconds()\n\n\ndef datetime_microseconds() -> float:\n return float(datetime_timestamp()) + (f.random_int(max=999999) * 1e-6)\n\n\ndef datetime_str() -> str:\n return f.date_time(end_datetime=_END_DATETIME).isoformat()\n\n\ndef lax_datetime() -> Union[int, float, str]:\n return one_of(datetime_timestamp, datetime_microseconds, datetime_str)\n\n\n## Sample data generators\n\n\ndef blog() -> dict:\n return {\n 'type': 'blog',\n 'title': f.text(max_nb_chars=40),\n 'post_count': lax_int(),\n 'readers': lax_int(),\n 'avg_post_rating': lax_float(min_value=0, max_value=5),\n 'url': f.url(),\n }\n\n\ndef social_profile() -> dict:\n return {\n 'type': 'profile',\n 'username': f.user_name(),\n 'join_date': date_string(),\n **one_of(facebook_profile, twitter_profile, linkedin_profile),\n }\n\n\ndef facebook_profile() -> dict:\n return {'network': 'facebook', 'friends': lax_int()}\n\n\ndef twitter_profile() -> dict:\n return {'network': 'twitter', 'followers': lax_int()}\n\n\ndef linkedin_profile() -> dict:\n return {'network': 'linkedin', 'connections': min(f.random_int(), 500)}\n\n\ndef website() -> dict:\n return one_of(blog, social_profile)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/generate_north_star_data.py_person_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/generate_north_star_data.py_person_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/generate_north_star_data.py", "file_name": "generate_north_star_data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 128, "span_ids": ["person_data", "person"], "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 person() -> dict:\n return {\n 'id': f.uuid4(),\n 'name': f.name(),\n 'height': str(f.pydecimal(min_value=1, max_value=2, right_digits=2)),\n 'entry_created_date': date_string(),\n 'entry_created_time': lax_time(),\n 'entry_updated_at': lax_datetime(),\n 'websites': list_of(website, max_length=5),\n }\n\n\ndef person_data(length: int) -> List[dict]:\n return [person() for _ in range(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/tests/benchmarks/test_fastapi_startup_generics.py__https_github_com_pyd_OUTER_DATA_MODEL_COUNT.5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py__https_github_com_pyd_OUTER_DATA_MODEL_COUNT.5", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_generics.py", "file_name": "test_fastapi_startup_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["docstring"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"https://github.com/pydantic/pydantic/issues/6768\"\"\"\nfrom __future__ import annotations\n\nfrom pathlib import Path\nfrom typing import Any, Generic, List, TypeVar\n\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, TypeAdapter, create_model\nfrom pydantic.fields import FieldInfo\n\nTYPES_DEFAULTS = {int: 0, str: '', bool: False} # some dummy basic types with defaults for some fields\nTYPES = [*TYPES_DEFAULTS.keys()]\n# these are set low to minimise test time, they're increased below in the cProfile call\nINNER_DATA_MODEL_COUNT = 5\nOUTER_DATA_MODEL_COUNT = 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/benchmarks/test_fastapi_startup_generics.py_create_data_models_create_data_models.return._models_models_with_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_create_data_models_create_data_models.return._models_models_with_ne", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_generics.py", "file_name": "test_fastapi_startup_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 46, "span_ids": ["create_data_models"], "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 create_data_models() -> list[Any]:\n # Create varying inner models with different sizes and fields (not actually realistic)\n models = []\n for i in range(INNER_DATA_MODEL_COUNT):\n fields = {}\n for j in range(i):\n type_ = TYPES[j % len(TYPES)]\n type_default = TYPES_DEFAULTS[type_]\n if j % 4 == 0:\n type_ = List[type_]\n type_default = []\n\n default = ... if j % 2 == 0 else type_default\n fields[f'f{j}'] = (type_, default)\n models.append(create_model(f'M1{i}', **fields))\n\n # Crate varying outer models where some fields use the inner models (not really realistic)\n models_with_nested = []\n for i in range(OUTER_DATA_MODEL_COUNT):\n fields = {}\n for j in range(i):\n type_ = models[j % len(models)] if j % 2 == 0 else TYPES[j % len(TYPES)]\n if j % 4 == 0:\n type_ = List[type_]\n fields[f'f{j}'] = (type_, ...)\n models_with_nested.append(create_model(f'M2{i}', **fields))\n\n return [*models, *models_with_nested]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_test_fastapi_startup_perf_test_fastapi_startup_perf.assert_len_data_models_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_test_fastapi_startup_perf_test_fastapi_startup_perf.assert_len_data_models_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_generics.py", "file_name": "test_fastapi_startup_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 101, "span_ids": ["test_fastapi_startup_perf"], "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_fastapi_startup_perf(benchmark: Any):\n data_models = create_data_models()\n # API models for reading / writing the different data models\n T = TypeVar('T')\n\n class GetModel(BaseModel, Generic[T]):\n res: T\n\n class GetModel2(GetModel[T], Generic[T]):\n foo: str\n bar: str\n\n class GetManyModel(BaseModel, Generic[T]):\n res: list[T]\n\n class GetManyModel2(GetManyModel[T], Generic[T]):\n foo: str\n bar: str\n\n class GetManyModel3(BaseModel, Generic[T]):\n res: dict[str, T]\n\n class GetManyModel4(BaseModel, Generic[T]):\n res: dict[str, list[T]]\n\n class PutModel(BaseModel, Generic[T]):\n data: T\n\n class PutModel2(PutModel[T], Generic[T]):\n foo: str\n bar: str\n\n class PutManyModel(BaseModel, Generic[T]):\n data: list[T]\n\n class PutManyModel2(PutManyModel[T], Generic[T]):\n foo: str\n bar: str\n\n api_models: list[Any] = [\n GetModel,\n GetModel2,\n GetManyModel,\n GetManyModel2,\n GetManyModel3,\n GetManyModel4,\n PutModel,\n PutModel2,\n PutManyModel,\n PutManyModel2,\n ]\n\n assert len(data_models) == INNER_DATA_MODEL_COUNT + OUTER_DATA_MODEL_COUNT\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/benchmarks/test_fastapi_startup_generics.py_test_fastapi_startup_perf.bench_test_fastapi_startup_perf.benchmark_bench_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_test_fastapi_startup_perf.bench_test_fastapi_startup_perf.benchmark_bench_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_generics.py", "file_name": "test_fastapi_startup_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 122, "span_ids": ["test_fastapi_startup_perf"], "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_fastapi_startup_perf(benchmark: Any):\n # ... other code\n\n def bench():\n concrete_api_models = []\n adapters = []\n for outer_api_model in api_models:\n for data_model in data_models:\n concrete_api_model = outer_api_model[\n data_model\n ] # Would be used eg as request or response body in FastAPI\n concrete_api_models.append(concrete_api_model)\n\n # Emulate FastAPI creating its TypeAdapters\n adapt = TypeAdapter(Annotated[concrete_api_model, FieldInfo(description='foo')])\n adapters.append(adapt)\n adapt = TypeAdapter(Annotated[concrete_api_model, FieldInfo(description='bar')])\n adapters.append(adapt)\n\n assert len(concrete_api_models) == len(data_models) * len(api_models)\n assert len(adapters) == len(concrete_api_models) * 2\n\n benchmark(bench)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_if___name_____main____": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_generics.py_if___name_____main____", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_generics.py", "file_name": "test_fastapi_startup_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 145, "span_ids": ["impl:9"], "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": "if __name__ == '__main__':\n # run with `pdm run tests/benchmarks/test_fastapi_startup.py`\n import cProfile\n import sys\n import time\n\n INNER_DATA_MODEL_COUNT = 50\n OUTER_DATA_MODEL_COUNT = 50\n print(f'Python version: {sys.version}')\n if sys.argv[-1] == 'cProfile':\n cProfile.run(\n 'test_fastapi_startup_perf(lambda f: f())',\n sort='tottime',\n filename=Path(__file__).name.strip('.py') + '.cprof',\n )\n else:\n start = time.perf_counter()\n test_fastapi_startup_perf(lambda f: f())\n end = time.perf_counter()\n print(f'Time taken: {end - start:.2f}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/tests/benchmarks/test_fastapi_startup_simple.py__https_github_com_pyd_test_fastapi_startup_perf.benchmark_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_simple.py__https_github_com_pyd_test_fastapi_startup_perf.benchmark_run_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_simple.py", "file_name": "test_fastapi_startup_simple.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 89, "span_ids": ["test_fastapi_startup_perf", "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": "\"\"\"https://github.com/pydantic/pydantic/issues/6768\"\"\"\nfrom __future__ import annotations\n\nfrom datetime import datetime\nfrom pathlib import Path\nfrom typing import Any, Callable, Dict, List, Tuple\nfrom uuid import UUID\n\nfrom annotated_types import Gt\nfrom typing_extensions import Annotated\n\nfrom pydantic import AnyUrl, BaseModel, EmailStr, TypeAdapter\nfrom pydantic.functional_validators import AfterValidator\nfrom pydantic.types import StringConstraints\n\n\ndef test_fastapi_startup_perf(benchmark: Callable[[Callable[[], Any]], None]):\n def run() -> None:\n class User(BaseModel):\n id: int\n username: str\n email: EmailStr\n full_name: str | None = None\n\n class Address(BaseModel):\n street: str\n city: str\n state: Annotated[str, AfterValidator(lambda x: x.upper())]\n postal_code: Annotated[str, StringConstraints(min_length=5, max_length=5, pattern=r'[A-Z0-9]+')]\n\n class Product(BaseModel):\n id: int\n name: str\n price: Annotated[float, Gt(0)]\n description: str | None = None\n\n class BlogPost(BaseModel):\n title: Annotated[str, StringConstraints(pattern=r'[A-Za-z0-9]+')]\n content: str\n author: User\n published: bool = False\n\n class Website(BaseModel):\n name: str\n url: AnyUrl\n description: str | None = None\n\n class Order(BaseModel):\n order_id: str\n customer: User\n shipping_address: Address\n products: list[Product]\n\n class Comment(BaseModel):\n text: str\n author: User\n post: BlogPost\n created_at: datetime\n\n class Event(BaseModel):\n event_id: UUID\n name: str\n date: datetime\n location: str\n\n class Category(BaseModel):\n name: str\n description: str | None = None\n\n ReviewGroup = List[Dict[Tuple[User, Product], Comment]]\n\n data_models = [\n User,\n Address,\n Product,\n BlogPost,\n Website,\n Order,\n Comment,\n Event,\n Category,\n ReviewGroup,\n ]\n\n for _ in range(5): # FastAPI creates a new TypeAdapter for each endpoint\n for model in data_models:\n TypeAdapter(model)\n\n benchmark(run)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_simple.py_if___name_____main____": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_fastapi_startup_simple.py_if___name_____main____", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_fastapi_startup_simple.py", "file_name": "test_fastapi_startup_simple.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 110, "span_ids": ["impl"], "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": "if __name__ == '__main__':\n # run with `pdm run tests/benchmarks/test_fastapi_startup_simple.py`\n import cProfile\n import sys\n import time\n\n print(f'Python version: {sys.version}')\n if sys.argv[-1] == 'cProfile':\n cProfile.run(\n 'test_fastapi_startup_perf(lambda f: f())',\n sort='tottime',\n filename=Path(__file__).name.strip('.py') + '.cprof',\n )\n else:\n start = time.perf_counter()\n test_fastapi_startup_perf(lambda f: f())\n end = time.perf_counter()\n print(f'Time taken: {end - start:.6f}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/tests/benchmarks/test_north_star.py___pydantic_type_adapter.return.TypeAdapter_List_Person_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_north_star.py___pydantic_type_adapter.return.TypeAdapter_List_Person_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_north_star.py", "file_name": "test_north_star.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 62, "span_ids": ["pydantic_type_adapter", "docstring"], "tokens": 390}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nAn integration-style benchmark of a model with a class of what should\n(hopefully) be some of the most common field types used in pydantic validation.\n\nUsed to gauge overall pydantic performance.\n\"\"\"\nimport json\nfrom datetime import date, datetime, time\nfrom decimal import Decimal\nfrom pathlib import Path\nfrom typing import List, Union\nfrom uuid import UUID\n\nimport pytest\nfrom typing_extensions import Annotated, Literal\n\n\n@pytest.fixture(scope='module')\ndef pydantic_type_adapter():\n from pydantic import BaseModel, Field, TypeAdapter\n from pydantic.networks import AnyHttpUrl\n\n class Blog(BaseModel):\n type: Literal['blog']\n title: str\n post_count: int\n readers: int\n avg_post_rating: float\n url: AnyHttpUrl\n\n class SocialProfileBase(BaseModel):\n type: Literal['profile']\n network: Literal['facebook', 'twitter', 'linkedin']\n username: str\n join_date: date\n\n class FacebookProfile(SocialProfileBase):\n network: Literal['facebook']\n friends: int\n\n class TwitterProfile(SocialProfileBase):\n network: Literal['twitter']\n followers: int\n\n class LinkedinProfile(SocialProfileBase):\n network: Literal['linkedin']\n connections: Annotated[int, Field(le=500)]\n\n SocialProfile = Annotated[Union[FacebookProfile, TwitterProfile, LinkedinProfile], Field(discriminator='network')]\n\n Website = Annotated[Union[Blog, SocialProfile], Field(discriminator='type')]\n\n class Person(BaseModel):\n id: UUID\n name: str\n height: Decimal\n entry_created_date: date\n entry_created_time: time\n entry_updated_at: datetime\n websites: List[Website] = Field(default_factory=list)\n\n return TypeAdapter(List[Person])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/check_usage_docs.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/check_usage_docs.py___", "embedding": null, "metadata": {"file_path": "tests/check_usage_docs.py", "file_name": "check_usage_docs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["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": "\"\"\"\nCheck that all `Usage docs` tags in docstrings link to the latest version of pydantic.\n\"\"\"\nimport re\nimport sys\nfrom pathlib import Path\n\nROOT_DIR = Path(__file__).parent.parent\nPYDANTIC_DIR = ROOT_DIR / 'pydantic'\nversion_file = PYDANTIC_DIR / 'version.py'\n\n\nversion = re.search(rb\"VERSION = '(.*)'\", version_file.read_bytes()).group(1)\nversion_major_minor = b'.'.join(version.split(b'.')[:2])\nexpected_base = b'https://docs.pydantic.dev/' + version_major_minor + b'/'\n\npaths = sys.argv[1:]\nerror_count = 0\nfor path_str in paths:\n path = ROOT_DIR / path_str\n b = path.read_bytes()\n\n changed = 0\n\n def sub(m: re.Match) -> bytes:\n global changed\n if m.group(2) != expected_base:\n changed += 1\n return m.group(1) + expected_base\n else:\n return m.group(0)\n\n b = re.sub(rb'(\"\"\" *usage.docs: *)(https://.+?/.+?/)', sub, b, flags=re.I)\n if changed:\n error_count += changed\n path.write_bytes(b)\n plural = 's' if changed > 1 else ''\n print(f'{path_str:50} {changed} usage docs link{plural} updated')\n\nif error_count:\n sys.exit(1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/generics.py_from_typing_import_Any_D_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/generics.py_from_typing_import_Any_D_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 54, "span_ids": ["impl:3", "HtmlResponse.custom_method", "JsonBody", "DomainType", "imports", "impl:12", "HtmlResponse", "HtmlBody", "HistoryField", "JsonResponse", "Response"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Any, Dict, Generic, Optional, TypeVar\n\nfrom pydantic import BaseModel\n\nTbody = TypeVar('Tbody')\n\n\nclass Response(BaseModel, Generic[Tbody]):\n url: str\n body: Tbody\n\n\nclass JsonBody(BaseModel):\n raw: str\n data: Dict[str, Any]\n\n\nclass HtmlBody(BaseModel):\n raw: str\n doctype: str\n\n\nclass JsonResponse(Response[JsonBody]):\n pass\n\n\nclass HtmlResponse(Response[HtmlBody]):\n def custom_method(self) -> None:\n doctype = self.body.doctype\n print(f'self: {doctype}')\n\n\nexample = {'url': 'foo.com', 'body': {'raw': '....', 'doctype': 'html'}}\n\nresp = HtmlResponse.model_validate(example)\nresp.custom_method()\n\ndoctype = resp.body.doctype\n\n\nT = TypeVar('T', int, str)\n\n\nclass HistoryField(BaseModel, Generic[T]):\n value: Optional[T]\n\n\nclass DomainType(HistoryField[int]):\n pass\n\n\nthing = DomainType(value=None)\nvar: Optional[int] = thing.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/mypy/modules/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1": {"__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_KwargsNotFrozenModel.a.1", "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": 183, "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", "Model.NotConfig", "imports", "impl:16", "KwargsNoMutationModel", "KwargsNotFrozenModel", "impl:28", "impl:34", "KwargsModel.NotConfig", "FutureModel", "NestedModel:2", "Mixin.f", "NestedModel.Model", "impl:10", "impl:25", "NoMutationModel", "SelfReferencingModel"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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)\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\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__)\n\n\nclass KwargsFrozenModel(BaseModel, frozen=True):\n x: int\n\n\nclass KwargsNotFrozenModel(FrozenModel, frozen=False, from_attributes=True):\n a: int = 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_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_", "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": 186, "end_line": 246, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "impl:47", "Response"], "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": "KwargsNotFrozenModel(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')(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/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/root_models.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/root_models.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "tokens": 97}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail1.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail1.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/fail1.py", "file_name": "fail1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["impl", "Model", "docstring"], "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": "\"\"\"\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')\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]\nm.json_list_of_ints[0] + 'not integer'\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-default_ini/fail2.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail2.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/fail2.py", "file_name": "fail2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["impl", "Model", "docstring"], "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": "\"\"\"\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)\n# MYPY: error: \"Model\" has no attribute \"foobar\" [attr-defined]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail3.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/fail3.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/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": 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": "\"\"\"\nTest mypy failure with invalid types.\n\"\"\"\nfrom typing import Generic, List, TypeVar\n\nfrom pydantic import BaseModel\n\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')\n# MYPY: error: Argument 1 to \"append\" of \"list\" has incompatible type \"str\"; expected \"int\" [arg-type]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/metaclass_args.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/metaclass_args.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/metaclass_args.py", "file_name": "metaclass_args.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["impl:3", "impl:4", "NoArguments", "impl", "imports", "ConfigClassUsed.Config", "impl:2", "MetaclassArgumentsWithDefault", "MetaclassArgumentsNoDefault", "ConfigClassUsed"], "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": "from pydantic import BaseModel, Field\n\n\nclass ConfigClassUsed(BaseModel):\n i: int = Field(2, alias='j')\n\n class Config:\n populate_by_name = True\n\n\nConfigClassUsed(i=None)\n\n\nclass MetaclassArgumentsNoDefault(BaseModel, populate_by_name=True):\n i: int = Field(alias='j')\n\n\nMetaclassArgumentsNoDefault(i=None)\n\n\nclass MetaclassArgumentsWithDefault(BaseModel, populate_by_name=True):\n i: int = Field(2, alias='j')\n\n\nMetaclassArgumentsWithDefault(i=None)\n\n\nclass NoArguments(BaseModel):\n i: int = Field(2, alias='j')\n\n\nNoArguments(i=1)\nNoArguments(j=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/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py_NotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py_NotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 168, "end_line": 313, "span_ids": ["impl:54", "impl:44", "foo", "NotFrozenModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "impl:62", "KwargsFrozenModel", "impl:47", "Response", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 803}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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\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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n# MYPY: error: Unexpected keyword argument \"foo\" for \"MyDataClass\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"bar\" for \"MyDataClass\" [call-arg]\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n# MYPY: error: Unused \"type: ignore\" comment\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_FrozenModel.model_config.dict_frozen_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_FrozenModel.model_config.dict_frozen_True_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 168, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "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": 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 ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom pydantic import BaseModel, Field, create_model, field_validator\nfrom pydantic.dataclasses import dataclass\n\n\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)\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\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# MYPY: error: Unexpected keyword argument \"name\" for \"AddProject\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"slug\" for \"AddProject\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"description\" for \"AddProject\" [call-arg]\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py_NotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py_NotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 249, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "KwargsNotFrozenModel", "impl:44", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "KwargsFrozenModel", "NotFrozenModel", "impl:47", "Response"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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__)\n\n\nclass 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')(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/outputs/1.0.1/mypy-default_ini/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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 pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Argument \"_case_sensitive\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[bool]\" [arg-type]\n# MYPY: error: Argument \"_env_prefix\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[str]\" [arg-type]\n# MYPY: error: Argument \"_env_file\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[Union[Path, str, List[Union[Path, str]], Tuple[Union[Path, str], ...]]]\" [arg-type]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-default_ini/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/outputs/1.0.1/mypy-default_ini/success.py___Flags.__str__.return.f_flag_self_strict_bool_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 58, "span_ids": ["Flags.__str__", "Flags", "docstring"], "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": "\"\"\"\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, ClassVar, 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 FilePath,\n FutureDate,\n FutureDatetime,\n ImportString,\n Json,\n NaiveDatetime,\n NegativeFloat,\n NegativeInt,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n PastDate,\n PastDatetime,\n PositiveFloat,\n PositiveInt,\n StrictBool,\n StrictBytes,\n StrictFloat,\n StrictInt,\n StrictStr,\n UrlConstraints,\n WrapValidator,\n create_model,\n field_validator,\n model_validator,\n root_validator,\n validate_call,\n)\nfrom pydantic.fields import Field, PrivateAttr\nfrom pydantic.json_schema import Examples\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/outputs/1.0.1/mypy-default_ini/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/outputs/1.0.1/mypy-default_ini/success.py_Model_Model.pre_root_check.return.values", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 78, "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/outputs/1.0.1/mypy-default_ini/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/outputs/1.0.1/mypy-default_ini/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 191, "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_call\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_call(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/outputs/1.0.1/mypy-default_ini/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/outputs/1.0.1/mypy-default_ini/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 194, "end_line": 251, "span_ids": ["impl:56", "PydanticTypes", "MyPrivateAttr"], "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": "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(validate_default=True)\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 import_string_str: ImportString[Any] = 'datetime.date' # type: ignore[misc]\n# MYPY: error: Unused \"type: ignore\" comment\n import_string_callable: ImportString[Any] = date\n # UUID\n my_uuid1: UUID1 = UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')\n my_uuid1_str: UUID1 = 'a8098c1a-f86e-11da-bd1a-00112444be1e'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"UUID\") [assignment]\n # Path\n my_file_path: FilePath = Path(__file__)\n my_file_path_str: FilePath = __file__\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"Path\") [assignment]\n my_dir_path: DirectoryPath = Path('.')\n my_dir_path_str: DirectoryPath = '.'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"Path\") [assignment]\n # Json\n my_json: Json[Dict[str, str]] = '{\"hello\": \"world\"}'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"Dict[str, str]\") [assignment]\n my_json_list: Json[List[str]] = '[\"hello\", \"world\"]'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"List[str]\") [assignment]\n # Date\n my_past_date: PastDate = date.today() - timedelta(1)\n my_future_date: FutureDate = date.today() + timedelta(1)\n # Datetime\n my_past_datetime: PastDatetime = datetime.now() - timedelta(1)\n my_future_datetime: FutureDatetime = datetime.now() + timedelta(1)\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/outputs/1.0.1/mypy-default_ini/success.py_validated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/success.py_validated_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 330, "span_ids": ["SomeDict", "WrapValidatorModel", "CustomPath", "impl:73", "Abstract", "Square", "two_dim_shape_validator", "Concrete", "CustomPath.__fspath__", "impl:76", "UrlModel", "impl:80", "double", "impl:62", "CustomPath.__init__"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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='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\nDynamicModel = create_model('DynamicModel')\n\nexamples = Examples({})\n\n\ndef double(value: Any, handler: Any) -> int:\n return handler(value) * 2\n\n\nclass WrapValidatorModel(BaseModel):\n x: Annotated[int, WrapValidator(double)]\n\n\nclass Abstract(BaseModel):\n class_id: ClassVar\n\n\nclass Concrete(Abstract):\n class_id = 1\n\n\ndef two_dim_shape_validator(v: Dict[str, Any]) -> Dict[str, Any]:\n assert 'volume' not in v, 'shape is 2d, cannot have volume'\n return v\n\n\nclass Square(BaseModel):\n width: float\n height: float\n\n free_validator = model_validator(mode='before')(two_dim_shape_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/mypy/outputs/1.0.1/mypy-plugin-strict-no-any_ini/dataclass_no_any.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict-no-any_ini/dataclass_no_any.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict-no-any_ini/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": 40}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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={'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/outputs/1.0.1/mypy-plugin-strict_ini/fail_defaults.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/fail_defaults.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/fail_defaults.py", "file_name": "fail_defaults.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "Model", "impl"], "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": "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()\n# MYPY: error: Missing named argument \"undefined_default_no_args\" for \"Model\" [call-arg]\n# MYPY: error: Missing named argument \"undefined_default\" for \"Model\" [call-arg]\n# MYPY: error: Missing named argument \"positional_ellipsis_default\" for \"Model\" [call-arg]\n# MYPY: error: Missing named argument \"named_ellipsis_default\" for \"Model\" [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/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_default_factory.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_default_factory.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_default_factory.py", "file_name": "plugin_default_factory.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["new_list", "Model", "docstring"], "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": "\"\"\"\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# MYPY: error: Incompatible types in assignment (expression has type \"List[int]\", variable has type \"List[str]\") [assignment]\n l7_error: int = Field(default_factory=list)\n# MYPY: error: Incompatible types in assignment (expression has type \"List[Any]\", variable has type \"int\") [assignment]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 195, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "impl:41", "AliasModel", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 775}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nKwargsAliasGeneratorModel2(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/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 334, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 351, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsInheritingModel", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "InheritingModel.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n class Config:\n frozen = False\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 125, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 208, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "DynamicAliasModel2.Config", "AliasModel", "impl:41", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n\nclass 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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_37": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_37", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 311, "span_ids": ["AliasGeneratorModel.Config", "KwargsAliasGeneratorModel", "impl:44", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "FrozenModel", "impl:62", "impl:47", "UntypedFieldModel", "impl:59", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "FrozenModel.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 901}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n class Config:\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 347, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2.Config", "InheritingModel2"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 364, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel(x=1).x.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel(x=1).x.2", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.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", "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": 830}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py_NotFrozenModel_model_vali_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py_NotFrozenModel_model_vali_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 248, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "KwargsNotFrozenModel", "impl:44", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "KwargsFrozenModel", "impl:47", "Response"], "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": "NotFrozenModel.model_validate(model.__dict__)\n\n\nclass 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')(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/outputs/1.0.1/mypy-plugin-very-strict_ini/metaclass_args.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-very-strict_ini/metaclass_args.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-very-strict_ini/metaclass_args.py", "file_name": "metaclass_args.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["impl:3", "NoArguments", "impl", "imports", "ConfigClassUsed.Config", "impl:7", "MetaclassArgumentsWithDefault", "MetaclassArgumentsNoDefault", "impl:5", "ConfigClassUsed"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from pydantic import BaseModel, Field\n\n\nclass ConfigClassUsed(BaseModel):\n i: int = Field(2, alias='j')\n\n class Config:\n populate_by_name = True\n\n\nConfigClassUsed(i=None)\n# MYPY: error: Argument \"i\" to \"ConfigClassUsed\" has incompatible type \"None\"; expected \"int\" [arg-type]\n\n\nclass MetaclassArgumentsNoDefault(BaseModel, populate_by_name=True):\n i: int = Field(alias='j')\n\n\nMetaclassArgumentsNoDefault(i=None)\n# MYPY: error: Argument \"i\" to \"MetaclassArgumentsNoDefault\" has incompatible type \"None\"; expected \"int\" [arg-type]\n\n\nclass MetaclassArgumentsWithDefault(BaseModel, populate_by_name=True):\n i: int = Field(2, alias='j')\n\n\nMetaclassArgumentsWithDefault(i=None)\n# MYPY: error: Argument \"i\" to \"MetaclassArgumentsWithDefault\" has incompatible type \"None\"; expected \"int\" [arg-type]\n\n\nclass NoArguments(BaseModel):\n i: int = Field(2, alias='j')\n\n\nNoArguments(i=1)\n# MYPY: error: Unexpected keyword argument \"i\" for \"NoArguments\" [call-arg]\nNoArguments(j=None)\n# MYPY: error: Argument \"j\" to \"NoArguments\" has incompatible type \"None\"; expected \"int\" [arg-type]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/custom_constructor.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/custom_constructor.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/custom_constructor.py", "file_name": "custom_constructor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["imports", "Person", "Person.__init__", "impl"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from 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# MYPY: note: \"Person\" defined here\n super().__init__(id=id, name='Patrick', birth_year=1991)\n\n\nPerson(1)\nPerson(id=1)\nPerson(name='Patrick')\n# MYPY: error: Unexpected keyword argument \"name\" for \"Person\" [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/tests/mypy/outputs/1.0.1/mypy-plugin_ini/generics.py_from_typing_import_Any_D_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/generics.py_from_typing_import_Any_D_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/generics.py", "file_name": "generics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 54, "span_ids": ["impl:3", "HtmlResponse.custom_method", "JsonBody", "DomainType", "imports", "impl:12", "HtmlResponse", "HtmlBody", "HistoryField", "JsonResponse", "Response"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Any, Dict, Generic, Optional, TypeVar\n\nfrom pydantic import BaseModel\n\nTbody = TypeVar('Tbody')\n\n\nclass Response(BaseModel, Generic[Tbody]):\n url: str\n body: Tbody\n\n\nclass JsonBody(BaseModel):\n raw: str\n data: Dict[str, Any]\n\n\nclass HtmlBody(BaseModel):\n raw: str\n doctype: str\n\n\nclass JsonResponse(Response[JsonBody]):\n pass\n\n\nclass HtmlResponse(Response[HtmlBody]):\n def custom_method(self) -> None:\n doctype = self.body.doctype\n print(f'self: {doctype}')\n\n\nexample = {'url': 'foo.com', 'body': {'raw': '....', 'doctype': 'html'}}\n\nresp = HtmlResponse.model_validate(example)\nresp.custom_method()\n\ndoctype = resp.body.doctype\n\n\nT = TypeVar('T', int, str)\n\n\nclass HistoryField(BaseModel, Generic[T]):\n value: Optional[T]\n\n\nclass DomainType(HistoryField[int]):\n pass\n\n\nthing = DomainType(value=None)\nvar: Optional[int] = thing.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/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 217, "span_ids": ["DefaultTestingModel", "impl:29", "impl:38", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "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": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 220, "end_line": 292, "span_ids": ["impl:55", "impl:48", "KwargsAliasGeneratorModel", "CoverageTester.from_orm", "impl:66", "CoverageTester", "_default_factory", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "InheritingModel2", "impl:58", "UntypedFieldModel"], "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": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 318, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 319, "end_line": 335, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsInheritingModel", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "InheritingModel.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n class Config:\n frozen = False\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 125, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 232, "span_ids": ["AliasGeneratorModel.Config", "DefaultTestingModel", "impl:29", "impl:38", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "AliasGeneratorModel2.Config", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "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": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\n\n\nclass 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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\n alias_generator = lambda x: x + '_' # noqa E731\nKwargsAliasGeneratorModel(z=1)\n\n\nKwargsAliasGeneratorModel2(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/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 235, "end_line": 311, "span_ids": ["impl:55", "KwargsAliasGeneratorModel", "impl:53", "AddProject", "CoverageTester", "_default_factory", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "CoverageTester.from_orm", "KwargsAliasGeneratorModel2", "impl:58", "impl:48", "FrozenModel.Config", "impl:66", "InheritingModel2.Config", "impl:50", "impl:56"], "tokens": 490}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 331, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 348, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/mypy-plugin_ini/plugin_success.py_KwargsNotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success.py_KwargsNotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 307, "span_ids": ["impl:54", "impl:61", "foo", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "impl:47", "Response", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 671}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 183, "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", "Model.NotConfig", "imports", "impl:16", "KwargsNoMutationModel", "KwargsNotFrozenModel", "impl:28", "impl:34", "KwargsModel.NotConfig", "FutureModel", "NestedModel:2", "Mixin.f", "NestedModel.Model", "impl:10", "impl:25", "NoMutationModel", "SelfReferencingModel"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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)\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\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__)\n\n\nclass KwargsFrozenModel(BaseModel, frozen=True):\n x: int\n\n\nclass KwargsNotFrozenModel(FrozenModel, frozen=False, from_attributes=True):\n a: int = 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/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 246, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "impl:47", "Response"], "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": "KwargsNotFrozenModel(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')(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/outputs/1.0.1/mypy-plugin_ini/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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 pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Argument \"_case_sensitive\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[bool]\" [arg-type]\n# MYPY: error: Argument \"_env_prefix\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[str]\" [arg-type]\n# MYPY: error: Argument \"_env_file\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[Union[Path, str, List[Union[Path, str]], Tuple[Union[Path, str], ...]]]\" [arg-type]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin_ini/root_models.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/root_models.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "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": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n# MYPY: error: Missing type parameters for generic type \"RootModel\" [type-arg]\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]\n# MYPY: error: Only `root` is allowed as a field of a `RootModel` [pydantic-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/mypy/outputs/1.0.1/pyproject-default_toml/fail1.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail1.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/fail1.py", "file_name": "fail1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["impl", "Model", "docstring"], "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": "\"\"\"\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')\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]\nm.json_list_of_ints[0] + 'not integer'\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/pyproject-default_toml/fail2.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail2.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/fail2.py", "file_name": "fail2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["impl", "Model", "docstring"], "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": "\"\"\"\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)\n# MYPY: error: \"Model\" has no attribute \"foobar\" [attr-defined]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail3.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/fail3.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/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": 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": "\"\"\"\nTest mypy failure with invalid types.\n\"\"\"\nfrom typing import Generic, List, TypeVar\n\nfrom pydantic import BaseModel\n\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')\n# MYPY: error: Argument 1 to \"append\" of \"list\" has incompatible type \"str\"; expected \"int\" [arg-type]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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 pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Argument \"_case_sensitive\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[bool]\" [arg-type]\n# MYPY: error: Argument \"_env_prefix\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[str]\" [arg-type]\n# MYPY: error: Argument \"_env_file\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[Union[Path, str, List[Union[Path, str]], Tuple[Union[Path, str], ...]]]\" [arg-type]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/pyproject-default_toml/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/outputs/1.0.1/pyproject-default_toml/success.py___Flags.__str__.return.f_flag_self_strict_bool_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 58, "span_ids": ["Flags.__str__", "Flags", "docstring"], "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": "\"\"\"\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, ClassVar, 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 FilePath,\n FutureDate,\n FutureDatetime,\n ImportString,\n Json,\n NaiveDatetime,\n NegativeFloat,\n NegativeInt,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n PastDate,\n PastDatetime,\n PositiveFloat,\n PositiveInt,\n StrictBool,\n StrictBytes,\n StrictFloat,\n StrictInt,\n StrictStr,\n UrlConstraints,\n WrapValidator,\n create_model,\n field_validator,\n model_validator,\n root_validator,\n validate_call,\n)\nfrom pydantic.fields import Field, PrivateAttr\nfrom pydantic.json_schema import Examples\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/outputs/1.0.1/pyproject-default_toml/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/outputs/1.0.1/pyproject-default_toml/success.py_Model_Model.pre_root_check.return.values", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 78, "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/outputs/1.0.1/pyproject-default_toml/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/outputs/1.0.1/pyproject-default_toml/success.py_dog_years_MyConf.callable_pyobject.Field_default_date_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 191, "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_call\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_call(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/outputs/1.0.1/pyproject-default_toml/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/outputs/1.0.1/pyproject-default_toml/success.py_conf_PydanticTypes.my_naive_datetime.datetime_now_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 194, "end_line": 251, "span_ids": ["impl:56", "PydanticTypes", "MyPrivateAttr"], "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": "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(validate_default=True)\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 import_string_str: ImportString[Any] = 'datetime.date' # type: ignore[misc]\n# MYPY: error: Unused \"type: ignore\" comment\n import_string_callable: ImportString[Any] = date\n # UUID\n my_uuid1: UUID1 = UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')\n my_uuid1_str: UUID1 = 'a8098c1a-f86e-11da-bd1a-00112444be1e'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"UUID\") [assignment]\n # Path\n my_file_path: FilePath = Path(__file__)\n my_file_path_str: FilePath = __file__\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"Path\") [assignment]\n my_dir_path: DirectoryPath = Path('.')\n my_dir_path_str: DirectoryPath = '.'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"Path\") [assignment]\n # Json\n my_json: Json[Dict[str, str]] = '{\"hello\": \"world\"}'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"Dict[str, str]\") [assignment]\n my_json_list: Json[List[str]] = '[\"hello\", \"world\"]'\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"List[str]\") [assignment]\n # Date\n my_past_date: PastDate = date.today() - timedelta(1)\n my_future_date: FutureDate = date.today() + timedelta(1)\n # Datetime\n my_past_datetime: PastDatetime = datetime.now() - timedelta(1)\n my_future_datetime: FutureDatetime = datetime.now() + timedelta(1)\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/outputs/1.0.1/pyproject-default_toml/success.py_validated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py_validated_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/success.py", "file_name": "success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 330, "span_ids": ["SomeDict", "WrapValidatorModel", "CustomPath", "impl:73", "Abstract", "Square", "two_dim_shape_validator", "Concrete", "CustomPath.__fspath__", "impl:76", "UrlModel", "impl:80", "double", "impl:62", "CustomPath.__init__"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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='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\nDynamicModel = create_model('DynamicModel')\n\nexamples = Examples({})\n\n\ndef double(value: Any, handler: Any) -> int:\n return handler(value) * 2\n\n\nclass WrapValidatorModel(BaseModel):\n x: Annotated[int, WrapValidator(double)]\n\n\nclass Abstract(BaseModel):\n class_id: ClassVar\n\n\nclass Concrete(Abstract):\n class_id = 1\n\n\ndef two_dim_shape_validator(v: Dict[str, Any]) -> Dict[str, Any]:\n assert 'volume' not in v, 'shape is 2d, cannot have volume'\n return v\n\n\nclass Square(BaseModel):\n width: float\n height: float\n\n free_validator = model_validator(mode='before')(two_dim_shape_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/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/fail_defaults.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/fail_defaults.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/fail_defaults.py", "file_name": "fail_defaults.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "Model", "impl"], "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": "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()\n# MYPY: error: Missing named argument \"undefined_default_no_args\" for \"Model\" [call-arg]\n# MYPY: error: Missing named argument \"undefined_default\" for \"Model\" [call-arg]\n# MYPY: error: Missing named argument \"positional_ellipsis_default\" for \"Model\" [call-arg]\n# MYPY: error: Missing named argument \"named_ellipsis_default\" for \"Model\" [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/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 195, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "impl:41", "AliasModel", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 775}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nKwargsAliasGeneratorModel2(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/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 334, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 351, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsInheritingModel", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "InheritingModel.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n class Config:\n frozen = False\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 125, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 208, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "DynamicAliasModel2.Config", "AliasModel", "impl:41", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n\nclass 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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_37": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_37", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 311, "span_ids": ["AliasGeneratorModel.Config", "KwargsAliasGeneratorModel", "impl:44", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "FrozenModel", "impl:62", "impl:47", "UntypedFieldModel", "impl:59", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "FrozenModel.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 901}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n class Config:\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 347, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2.Config", "InheritingModel2"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 364, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel(x=1).x.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py_from_typing_import_ClassV_NotFrozenModel(x=1).x.2", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.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", "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": 830}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py_NotFrozenModel_model_vali_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py_NotFrozenModel_model_vali_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 248, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "KwargsNotFrozenModel", "impl:44", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "KwargsFrozenModel", "impl:47", "Response"], "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": "NotFrozenModel.model_validate(model.__dict__)\n\n\nclass 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')(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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 217, "span_ids": ["DefaultTestingModel", "impl:29", "impl:38", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "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": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 220, "end_line": 292, "span_ids": ["impl:55", "impl:48", "KwargsAliasGeneratorModel", "CoverageTester.from_orm", "impl:66", "CoverageTester", "_default_factory", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "InheritingModel2", "impl:58", "UntypedFieldModel"], "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": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 318, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 319, "end_line": 335, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsInheritingModel", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "InheritingModel.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n class Config:\n frozen = False\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 125, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 232, "span_ids": ["AliasGeneratorModel.Config", "DefaultTestingModel", "impl:29", "impl:38", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "AliasGeneratorModel2.Config", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "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": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\n\n\nclass 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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\n alias_generator = lambda x: x + '_' # noqa E731\nKwargsAliasGeneratorModel(z=1)\n\n\nKwargsAliasGeneratorModel2(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/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 235, "end_line": 311, "span_ids": ["impl:55", "KwargsAliasGeneratorModel", "impl:53", "AddProject", "CoverageTester", "_default_factory", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "CoverageTester.from_orm", "KwargsAliasGeneratorModel2", "impl:58", "impl:48", "FrozenModel.Config", "impl:66", "InheritingModel2.Config", "impl:50", "impl:56"], "tokens": 490}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 331, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 348, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py_KwargsNotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py_KwargsNotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 307, "span_ids": ["impl:54", "impl:61", "foo", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "impl:47", "Response", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 671}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py_from_typing_import_ClassV_KwargsNotFrozenModel.a.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 183, "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", "Model.NotConfig", "imports", "impl:16", "KwargsNoMutationModel", "KwargsNotFrozenModel", "impl:28", "impl:34", "KwargsModel.NotConfig", "FutureModel", "NestedModel:2", "Mixin.f", "NestedModel.Model", "impl:10", "impl:25", "NoMutationModel", "SelfReferencingModel"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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)\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\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__)\n\n\nclass KwargsFrozenModel(BaseModel, frozen=True):\n x: int\n\n\nclass KwargsNotFrozenModel(FrozenModel, frozen=False, from_attributes=True):\n a: int = 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/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py_KwargsNotFrozenModel(x=1).x_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 246, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "ModelWithAnnotatedValidator", "_default_factory_list", "impl:47", "Response"], "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": "KwargsNotFrozenModel(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')(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/outputs/1.0.1/pyproject-plugin_toml/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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 pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Argument \"_case_sensitive\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[bool]\" [arg-type]\n# MYPY: error: Argument \"_env_prefix\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[str]\" [arg-type]\n# MYPY: error: Argument \"_env_file\" to \"Settings\" has incompatible type \"int\"; expected \"Optional[Union[Path, str, List[Union[Path, str]], Tuple[Union[Path, str], ...]]]\" [arg-type]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.1.1/mypy-default_ini/fail1.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/fail1.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/fail1.py", "file_name": "fail1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["impl", "Model", "docstring"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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# MYPY: error: Missing named argument \"json_list_of_ints\" for \"Model\" [call-arg]\n# MYPY: error: List item 1 has incompatible type \"str\"; expected \"int\" [list-item]\n# MYPY: error: List item 2 has incompatible type \"bytes\"; expected \"int\" [list-item]\n\nprint(m.age + 'not integer')\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]\nm.json_list_of_ints[0] + 'not integer'\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.1.1/mypy-default_ini/fail2.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/fail2.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/fail2.py", "file_name": "fail2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["impl", "Model", "docstring"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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# MYPY: error: List item 1 has incompatible type \"str\"; expected \"int\" [list-item]\n# MYPY: error: List item 2 has incompatible type \"bytes\"; expected \"int\" [list-item]\n\nprint(m.foobar)\n# MYPY: error: \"Model\" has no attribute \"foobar\" [attr-defined]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/metaclass_args.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/metaclass_args.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/metaclass_args.py", "file_name": "metaclass_args.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["impl:3", "NoArguments", "impl", "imports", "ConfigClassUsed.Config", "impl:7", "MetaclassArgumentsWithDefault", "MetaclassArgumentsNoDefault", "impl:5", "ConfigClassUsed"], "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": "from pydantic import BaseModel, Field\n\n\nclass ConfigClassUsed(BaseModel):\n i: int = Field(2, alias='j')\n\n class Config:\n populate_by_name = True\n\n\nConfigClassUsed(i=None)\n# MYPY: error: Unexpected keyword argument \"i\" for \"ConfigClassUsed\" [call-arg]\n\n\nclass MetaclassArgumentsNoDefault(BaseModel, populate_by_name=True):\n i: int = Field(alias='j')\n\n\nMetaclassArgumentsNoDefault(i=None)\n# MYPY: error: Unexpected keyword argument \"i\" for \"MetaclassArgumentsNoDefault\" [call-arg]\n\n\nclass MetaclassArgumentsWithDefault(BaseModel, populate_by_name=True):\n i: int = Field(2, alias='j')\n\n\nMetaclassArgumentsWithDefault(i=None)\n# MYPY: error: Unexpected keyword argument \"i\" for \"MetaclassArgumentsWithDefault\" [call-arg]\n\n\nclass NoArguments(BaseModel):\n i: int = Field(2, alias='j')\n\n\nNoArguments(i=1)\n# MYPY: error: Unexpected keyword argument \"i\" for \"NoArguments\" [call-arg]\nNoArguments(j=None)\n# MYPY: error: Argument \"j\" to \"NoArguments\" has incompatible type \"None\"; expected \"int\" [arg-type]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py_DynamicModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py_DynamicModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 314, "span_ids": ["impl:54", "impl:61", "impl:44", "foo", "NotFrozenModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "FrozenModel", "KwargsFrozenModel", "impl:47", "Response", "impl:36", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 831}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "DynamicModel = 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# MYPY: error: Cannot inherit frozen dataclass from a non-frozen one [misc]\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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n# MYPY: error: Unused \"type: ignore\" comment\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV__.NestedModel_Model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV__.NestedModel_Model", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 158, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "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": 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": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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# MYPY: error: Cannot inherit frozen dataclass from a non-frozen one [misc]\n x: int\n\n\nclass KwargsMutationModel(KwargsNoMutationModel, frozen=False, from_attributes=True):\n# MYPY: error: Cannot inherit non-frozen dataclass from a frozen one [misc]\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\n# MYPY: error: Property \"x\" defined in \"KwargsNoMutationModel\" is read-only [misc]\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py_DynamicModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py_DynamicModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 252, "span_ids": ["impl:36", "ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "KwargsNotFrozenModel", "impl:44", "impl:50", "ModelWithAnnotatedValidator", "FrozenModel", "_default_factory_list", "KwargsFrozenModel", "NotFrozenModel", "impl:47", "Response"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "DynamicModel = 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__)\n\n\nclass KwargsFrozenModel(BaseModel, frozen=True):\n# MYPY: error: Cannot inherit frozen dataclass from a non-frozen one [misc]\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')(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/outputs/1.1.1/mypy-default_ini/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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": "from pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n# MYPY: error: Missing named argument \"foo\" for \"Settings\" [call-arg]\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n# MYPY: error: Unexpected keyword argument \"_case_sensitive\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_prefix\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_file\" for \"Settings\" [call-arg]\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Unexpected keyword argument \"_case_sensitive\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_prefix\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_file\" for \"Settings\" [call-arg]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()\n# MYPY: error: Missing named argument \"bar\" for \"SettingsWithConfigDict\" [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/tests/mypy/outputs/1.1.1/pyproject-default_toml/fail1.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/fail1.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/pyproject-default_toml/fail1.py", "file_name": "fail1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["impl", "Model", "docstring"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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# MYPY: error: Missing named argument \"json_list_of_ints\" for \"Model\" [call-arg]\n# MYPY: error: List item 1 has incompatible type \"str\"; expected \"int\" [list-item]\n# MYPY: error: List item 2 has incompatible type \"bytes\"; expected \"int\" [list-item]\n\nprint(m.age + 'not integer')\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]\nm.json_list_of_ints[0] + 'not integer'\n# MYPY: error: Unsupported operand types for + (\"int\" and \"str\") [operator]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.1.1/pyproject-default_toml/fail2.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/fail2.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/pyproject-default_toml/fail2.py", "file_name": "fail2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["impl", "Model", "docstring"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\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# MYPY: error: List item 1 has incompatible type \"str\"; expected \"int\" [list-item]\n# MYPY: error: List item 2 has incompatible type \"bytes\"; expected \"int\" [list-item]\n\nprint(m.foobar)\n# MYPY: error: \"Model\" has no attribute \"foobar\" [attr-defined]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/pyproject-default_toml/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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": "from pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n# MYPY: error: Missing named argument \"foo\" for \"Settings\" [call-arg]\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n# MYPY: error: Unexpected keyword argument \"_case_sensitive\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_prefix\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_file\" for \"Settings\" [call-arg]\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Unexpected keyword argument \"_case_sensitive\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_prefix\" for \"Settings\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"_env_file\" for \"Settings\" [call-arg]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()\n# MYPY: error: Missing named argument \"bar\" for \"SettingsWithConfigDict\" [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/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_dynamic_model.x.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py_from_typing_import_ClassV_dynamic_model.x.2", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 163, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "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": 818}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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# MYPY: error: Cannot inherit non-frozen dataclass from a frozen one [misc]\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\n# MYPY: error: Property \"x\" defined in \"KwargsNoMutationModel\" is read-only [misc]\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py_FrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py_FrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success_baseConfig.py", "file_name": "plugin_success_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 250, "span_ids": ["ModelWithSelfField", "ModelWithAllowReuseValidator", "impl:54", "FieldDefaultTestingModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "KwargsNotFrozenModel", "impl:44", "impl:50", "ModelWithAnnotatedValidator", "FrozenModel", "_default_factory_list", "KwargsFrozenModel", "NotFrozenModel", "impl:47", "Response"], "tokens": 407}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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__)\n\n\nclass 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')(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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 197, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "impl:41", "AliasModel", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 336, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 353, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 210, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "DynamicAliasModel2.Config", "AliasModel", "impl:41", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n\nclass 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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 313, "span_ids": ["AliasGeneratorModel.Config", "KwargsAliasGeneratorModel", "impl:44", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "FrozenModel", "impl:62", "impl:47", "UntypedFieldModel", "impl:59", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "FrozenModel.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 871}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n class Config:\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 349, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2.Config", "InheritingModel2"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 366, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 219, "span_ids": ["DefaultTestingModel", "impl:29", "impl:38", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 783}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\nKwargsAliasGeneratorModel(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/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 294, "span_ids": ["impl:55", "impl:48", "KwargsAliasGeneratorModel", "CoverageTester.from_orm", "impl:66", "CoverageTester", "_default_factory", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "InheritingModel2", "impl:58", "UntypedFieldModel"], "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": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 320, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 337, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 234, "span_ids": ["AliasGeneratorModel.Config", "DefaultTestingModel", "impl:29", "impl:38", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "AliasGeneratorModel2.Config", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\n\n\nclass 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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\n alias_generator = lambda x: x + '_' # noqa E731\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 313, "span_ids": ["impl:55", "KwargsAliasGeneratorModel", "impl:53", "AddProject", "CoverageTester", "_default_factory", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "CoverageTester.from_orm", "KwargsAliasGeneratorModel2", "impl:58", "impl:48", "FrozenModel.Config", "impl:66", "InheritingModel2.Config", "impl:50", "impl:56"], "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": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 333, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 350, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 197, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "impl:41", "AliasModel", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 336, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 353, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 210, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "DynamicAliasModel2.Config", "AliasModel", "impl:41", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n\nclass 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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 313, "span_ids": ["AliasGeneratorModel.Config", "KwargsAliasGeneratorModel", "impl:44", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "FrozenModel", "impl:62", "impl:47", "UntypedFieldModel", "impl:59", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "FrozenModel.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 871}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n class Config:\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 349, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2.Config", "InheritingModel2"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 366, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 219, "span_ids": ["DefaultTestingModel", "impl:29", "impl:38", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 783}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\nKwargsAliasGeneratorModel(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/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 294, "span_ids": ["impl:55", "impl:48", "KwargsAliasGeneratorModel", "CoverageTester.from_orm", "impl:66", "CoverageTester", "_default_factory", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "InheritingModel2", "impl:58", "UntypedFieldModel"], "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": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 320, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 337, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel2.Config._noqa_E731", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 234, "span_ids": ["AliasGeneratorModel.Config", "DefaultTestingModel", "impl:29", "impl:38", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "AliasGeneratorModel2.Config", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\n\n\nclass 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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment\n alias_generator = lambda x: x + '_' # noqa E731\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 313, "span_ids": ["impl:55", "KwargsAliasGeneratorModel", "impl:53", "AddProject", "CoverageTester", "_default_factory", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "CoverageTester.from_orm", "KwargsAliasGeneratorModel2", "impl:58", "impl:48", "FrozenModel.Config", "impl:66", "InheritingModel2.Config", "impl:50", "impl:56"], "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": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 333, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"Set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Optional[Callable[[], Any]]\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 350, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/mypy-default_ini/plugin_success.py_foo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_foo_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 282, "end_line": 312, "span_ids": ["foo", "InnerModel", "impl:61", "OuterModel"], "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 foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n# MYPY: error: Unused \"type: ignore\" comment [unused-ignore]\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_default_factory.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_default_factory.py___", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_default_factory.py", "file_name": "plugin_default_factory.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["new_list", "Model", "docstring"], "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": "\"\"\"\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# MYPY: error: Incompatible types in assignment (expression has type \"list[int]\", variable has type \"list[str]\") [assignment]\n l7_error: int = Field(default_factory=list)\n# MYPY: error: Incompatible types in assignment (expression has type \"list[Any]\", variable has type \"int\") [assignment]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 197, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "impl:41", "AliasModel", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 336, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 353, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 210, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "DynamicAliasModel2.Config", "AliasModel", "impl:41", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n\nclass 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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 313, "span_ids": ["AliasGeneratorModel.Config", "KwargsAliasGeneratorModel", "impl:44", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "FrozenModel", "impl:62", "impl:47", "UntypedFieldModel", "impl:59", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "FrozenModel.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 871}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n class Config:\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 349, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2.Config", "InheritingModel2"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 366, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 219, "span_ids": ["DefaultTestingModel", "impl:29", "impl:38", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment [unused-ignore]\nKwargsAliasGeneratorModel(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/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 294, "span_ids": ["impl:55", "impl:48", "KwargsAliasGeneratorModel", "CoverageTester.from_orm", "impl:66", "CoverageTester", "_default_factory", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "InheritingModel2", "impl:58", "UntypedFieldModel"], "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": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 320, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 337, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel_z_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel_z_1_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 226, "span_ids": ["AliasGeneratorModel.Config", "DefaultTestingModel", "impl:29", "impl:38", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 730}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\n\n\nclass 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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_AliasGeneratorModel2_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_AliasGeneratorModel2_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 313, "span_ids": ["impl:55", "KwargsAliasGeneratorModel", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "_default_factory", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "CoverageTester.from_orm", "KwargsAliasGeneratorModel2", "impl:58", "impl:48", "FrozenModel.Config", "impl:66", "InheritingModel2.Config", "impl:50", "impl:56"], "tokens": 534}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n\n\nclass AliasGeneratorModel2(BaseModel):\n x: int = Field(..., alias='y')\n\n class Config: # type: ignore[pydantic-alias]\n# MYPY: error: Unused \"type: ignore\" comment [unused-ignore]\n alias_generator = lambda x: x + '_' # noqa E731\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 333, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 350, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/mypy-plugin_ini/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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": "from pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Argument \"_case_sensitive\" to \"Settings\" has incompatible type \"int\"; expected \"bool | None\" [arg-type]\n# MYPY: error: Argument \"_env_prefix\" to \"Settings\" has incompatible type \"int\"; expected \"str | None\" [arg-type]\n# MYPY: error: Argument \"_env_file\" to \"Settings\" has incompatible type \"int\"; expected \"Path | str | list[Path | str] | tuple[Path | str, ...] | None\" [arg-type]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 197, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "impl:41", "AliasModel", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 336, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 353, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_DynamicAliasModel2_x_y_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 210, "span_ids": ["Blah", "impl:21", "DefaultTestingModel", "impl:29", "impl:31", "DynamicAliasModel2.Config", "AliasModel", "impl:41", "UndefinedAnnotationModel", "DynamicAliasModel2", "impl:35", "DynamicAliasModel", "impl:39", "impl:19", "Response"], "tokens": 779}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n# Strict mode fails\ninheriting = InheritingModel(x='1', y='1')\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\nModel(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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# MYPY: error: Argument \"data\" to \"Response\" has incompatible type \"int\"; expected \"Model\" [arg-type]\n\n\nclass AliasModel(BaseModel):\n x: str = Field(..., alias='y')\n z: int\n\n\nAliasModel(y=1, z=2)\n# MYPY: error: Argument \"y\" to \"AliasModel\" has incompatible type \"int\"; expected \"str\" [arg-type]\n\nx_alias = 'y'\n\n\nclass DynamicAliasModel(BaseModel):\n x: str = Field(..., alias=x_alias)\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n z: int\n\n\nDynamicAliasModel(y='y', z='1')\n# MYPY: error: Argument \"z\" to \"DynamicAliasModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n\n\nclass 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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"DynamicAliasModel2\" [call-arg]\nDynamicAliasModel2(x='y', z=1)\n\n\nKwargsAliasGeneratorModel2(x=1)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_KwargsDynamicAliasModel_None_39", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 313, "span_ids": ["AliasGeneratorModel.Config", "KwargsAliasGeneratorModel", "impl:44", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "FrozenModel", "impl:62", "impl:47", "UntypedFieldModel", "impl:59", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "FrozenModel.Config", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "tokens": 871}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n class Config:\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py_InheritingModel2_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 349, "span_ids": ["impl:70", "FieldDefaultTestingModel", "impl:66", "_default_factory", "InheritingModel2.Config", "InheritingModel2"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 366, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Untyped_fi__MYPY_error_Unused_ty", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 219, "span_ids": ["DefaultTestingModel", "impl:29", "impl:38", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasGeneratorModel2", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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# MYPY: error: Unused \"type: ignore\" comment [unused-ignore]\nKwargsAliasGeneratorModel(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/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_UntypedFieldModel_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 294, "span_ids": ["impl:55", "impl:48", "KwargsAliasGeneratorModel", "CoverageTester.from_orm", "impl:66", "CoverageTester", "_default_factory", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "InheritingModel2", "impl:58", "UntypedFieldModel"], "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": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 320, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 337, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_from_typing_import_Any_G_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 99, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model.Config", "Model", "impl:8", "KwargsBadExtraModel", "KwargsModel.method", "BadConfig2.Config", "impl:17", "Model.method", "ForbidExtraModel.Config", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "BadExtraModel.Config", "BadConfig1.Config", "ForbidExtraModel", "impl:15", "Model.Config.config_method"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n class Config:\n extra = 'forbid'\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n class Config:\n extra = 1 # type: ignore[pydantic-config]\n extra = 1\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n class Config:\n from_attributes: Any = {} # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n class Config:\n from_attributes = list # not sensible, but should still be handled gracefully\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 127, "span_ids": ["InheritingModel", "InheritingModel.Config", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel_z_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Untyped_fi_AliasGeneratorModel_z_1_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 226, "span_ids": ["AliasGeneratorModel.Config", "DefaultTestingModel", "impl:29", "impl:38", "DynamicAliasModel2.Config", "UndefinedAnnotationModel", "impl:39", "impl:19", "impl:21", "AliasModel", "impl:35", "Response", "impl:31", "AliasGeneratorModel", "DynamicAliasModel2", "Blah", "impl:42", "impl:45", "DynamicAliasModel", "KwargsDynamicAliasModel"], "tokens": 730}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n\nDefaultTestingModel()\n# MYPY: error: Missing named argument \"a\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"b\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"c\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"d\" for \"DefaultTestingModel\" [call-arg]\n# MYPY: error: Missing named argument \"f\" for \"DefaultTestingModel\" [call-arg]\n\n\nclass UndefinedAnnotationModel(BaseModel):\n undefined: Undefined # noqa F821\n# MYPY: error: Name \"Undefined\" is not defined [name-defined]\n\n\nUndefinedAnnotationModel()\n# MYPY: error: Missing named argument \"undefined\" for \"UndefinedAnnotationModel\" [call-arg]\n\n\nModel.model_construct(x=1)\n# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\nModel.model_construct(_fields_set={'x'}, x=1, y='2')\nModel.model_construct(x='1', y='2')\n# MYPY: error: Argument \"x\" to \"model_construct\" of \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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')\n\n\nclass 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)\n# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\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)\n# MYPY: error: Missing named argument \"x\" for \"KwargsDynamicAliasModel\" [call-arg]\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)\nKwargsAliasGeneratorModel2(y=1, 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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_AliasGeneratorModel2_test._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_AliasGeneratorModel2_test._", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 313, "span_ids": ["impl:55", "KwargsAliasGeneratorModel", "impl:53", "AliasGeneratorModel2.Config", "AddProject", "AliasGeneratorModel2", "CoverageTester", "_default_factory", "FrozenModel", "impl:62", "InheritingModel2", "UntypedFieldModel", "CoverageTester.from_orm", "KwargsAliasGeneratorModel2", "impl:58", "impl:48", "FrozenModel.Config", "impl:66", "InheritingModel2.Config", "impl:50", "impl:56"], "tokens": 534}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"x\" for \"DynamicAliasModel2\" [call-arg]\n\n\nclass AliasGeneratorModel2(BaseModel):\n x: int = Field(..., alias='y')\n\n class Config: # type: ignore[pydantic-alias]\n# MYPY: error: Unused \"type: ignore\" comment [unused-ignore]\n alias_generator = lambda x: x + '_' # noqa E731\n\n\nclass UntypedFieldModel(BaseModel):\n x: int = 1\n y = 2\n# MYPY: error: Untyped fields disallowed [pydantic-field]\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# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [misc]\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] = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py_FieldDefaultTestingModel_FieldDefaultTestingModel.m.Field_default_1_default_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 333, "span_ids": ["FieldDefaultTestingModel"], "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 FieldDefaultTestingModel(BaseModel):\n # Default\n e: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n f: int = None\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n\n # Default factory\n g: str = Field(default_factory=set)\n# MYPY: error: Incompatible types in assignment (expression has type \"set[Any]\", variable has type \"str\") [assignment]\n h: int = Field(default_factory=_default_factory)\n# MYPY: error: Incompatible types in assignment (expression has type \"str\", variable has type \"int\") [assignment]\n i: List[int] = Field(default_factory=list)\n l_: str = Field(default_factory=3)\n# MYPY: error: Argument \"default_factory\" to \"Field\" has incompatible type \"int\"; expected \"Callable[[], Any] | None\" [arg-type]\n\n # Default and default factory\n m: int = Field(default=1, 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/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py__MYPY_error_Field_defa_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail_baseConfig.py", "file_name": "plugin_fail_baseConfig.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 350, "span_ids": ["ModelWithAnnotatedValidator.instance_method", "ModelWithAnnotatedValidator", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations"], "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": "# MYPY: error: Field default and default_factory cannot be specified together [pydantic-field]\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# MYPY: error: Missing positional argument \"self\" in call to \"instance_method\" of \"ModelWithAnnotatedValidator\" [call-arg]\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/outputs/1.4.1/pyproject-plugin_toml/pydantic_settings.py_from_pydantic_settings_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/pydantic_settings.py_from_pydantic_settings_im_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/pydantic_settings.py", "file_name": "pydantic_settings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "impl:7", "SettingsWithConfigDict", "Settings"], "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": "from pydantic_settings import BaseSettings, SettingsConfigDict\n\n\nclass Settings(BaseSettings):\n foo: str\n\n\ns = Settings()\n\ns = Settings(foo='test', _case_sensitive=True, _env_prefix='test__', _env_file='test')\n\ns = Settings(foo='test', _case_sensitive=1, _env_prefix=2, _env_file=3)\n# MYPY: error: Argument \"_case_sensitive\" to \"Settings\" has incompatible type \"int\"; expected \"bool | None\" [arg-type]\n# MYPY: error: Argument \"_env_prefix\" to \"Settings\" has incompatible type \"int\"; expected \"str | None\" [arg-type]\n# MYPY: error: Argument \"_env_file\" to \"Settings\" has incompatible type \"int\"; expected \"Path | str | list[Path | str] | tuple[Path | str, ...] | None\" [arg-type]\n\n\nclass SettingsWithConfigDict(BaseSettings):\n bar: str\n\n model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')\n\n\nscd = SettingsWithConfigDict()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_dataclasses_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_dataclasses_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": 35, "span_ids": ["imports"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import dataclasses\nimport importlib\nimport os\nimport re\nimport sys\nfrom bisect import insort\nfrom pathlib import Path\nfrom typing import Any, List, Optional, Tuple, Union\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.version import parse_mypy_version\n\nexcept ImportError:\n mypy_api = None\n mypy_version = None\n\n parse_mypy_version = lambda _: (0,) # noqa: E731\n\n\nMYPY_VERSION_TUPLE = parse_mypy_version(mypy_version)\nPYDANTIC_ROOT = Path(__file__).parent.parent.parent\n\npytestmark = pytest.mark.skipif(\n '--test-mypy' not in sys.argv\n and os.environ.get('PYCHARM_HOSTED') != '1', # never skip when running via the PyCharm runner\n reason='Test only with \"--test-mypy\" flag',\n)\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_MypyCasesBuilder_MypyCasesBuilder.build.return.built_cases": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_MypyCasesBuilder_MypyCasesBuilder.build.return.built_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": 38, "end_line": 58, "span_ids": ["MypyCasesBuilder.build", "MypyCasesBuilder"], "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": "@dataclasses.dataclass\nclass MypyCasesBuilder:\n configs: Union[str, List[str]]\n modules: Union[str, List[str]]\n marks: Any = None\n\n def build(self) -> List[Union[Tuple[str, str], Any]]:\n \"\"\"\n Produces the cartesian product of the configs and modules, optionally with marks.\n \"\"\"\n if isinstance(self.configs, str):\n self.configs = [self.configs]\n if isinstance(self.modules, str):\n self.modules = [self.modules]\n built_cases = []\n for config in self.configs:\n for module in self.modules:\n built_cases.append((config, module))\n if self.marks is not None:\n built_cases = [pytest.param(config, module, marks=self.marks) for config, module in built_cases]\n return built_cases", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_cases_MypyTestConfig._the_target_for_the_curr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_cases_MypyTestConfig._the_target_for_the_curr", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 131, "span_ids": ["MypyTestTarget", "impl:16", "MypyTestConfig"], "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": "cases = (\n # No plugin\n MypyCasesBuilder(\n ['mypy-default.ini', 'pyproject-default.toml'],\n ['fail1.py', 'fail2.py', 'fail3.py', 'fail4.py', 'pydantic_settings.py'],\n ).build()\n + MypyCasesBuilder(\n ['mypy-default.ini', 'pyproject-default.toml'],\n 'success.py',\n pytest.mark.skipif(MYPY_VERSION_TUPLE > (1, 0, 1), reason='Need to handle some more things for mypy >=1.1.1'),\n ).build()\n + MypyCasesBuilder(\n ['mypy-default.ini', 'pyproject-default.toml'],\n 'root_models.py',\n pytest.mark.skipif(\n MYPY_VERSION_TUPLE < (1, 1, 1), reason='`dataclass_transform` only supported on mypy >= 1.1.1'\n ),\n ).build()\n + MypyCasesBuilder(\n 'mypy-default.ini', ['plugin_success.py', 'plugin_success_baseConfig.py', 'metaclass_args.py']\n ).build()\n # Default plugin config\n + MypyCasesBuilder(\n ['mypy-plugin.ini', 'pyproject-plugin.toml'],\n [\n 'plugin_success.py',\n 'plugin_fail.py',\n 'plugin_success_baseConfig.py',\n 'plugin_fail_baseConfig.py',\n 'pydantic_settings.py',\n ],\n ).build()\n # Strict plugin config\n + MypyCasesBuilder(\n ['mypy-plugin-strict.ini', 'pyproject-plugin-strict.toml'],\n [\n 'plugin_success.py',\n 'plugin_fail.py',\n 'fail_defaults.py',\n 'plugin_success_baseConfig.py',\n 'plugin_fail_baseConfig.py',\n ],\n ).build()\n # One-off cases\n + [\n ('mypy-plugin.ini', 'custom_constructor.py'),\n ('mypy-plugin.ini', 'config_conditional_extra.py'),\n ('mypy-plugin.ini', 'plugin_optional_inheritance.py'),\n ('mypy-plugin.ini', 'generics.py'),\n ('mypy-plugin.ini', 'root_models.py'),\n ('mypy-plugin-strict.ini', 'plugin_default_factory.py'),\n ('mypy-plugin-strict-no-any.ini', 'dataclass_no_any.py'),\n ('mypy-plugin-very-strict.ini', 'metaclass_args.py'),\n ('pyproject-default.toml', 'computed_fields.py'),\n ('pyproject-default.toml', 'with_config_decorator.py'),\n ('pyproject-plugin-no-strict-optional.toml', 'no_strict_optional.py'),\n ('pyproject-plugin-strict-equality.toml', 'strict_equality.py'),\n ]\n)\n\n\n@dataclasses.dataclass\nclass MypyTestTarget:\n parsed_mypy_version: Tuple[int, ...]\n output_path: Path\n\n\n@dataclasses.dataclass\nclass MypyTestConfig:\n existing: Optional[MypyTestTarget] # the oldest target with an output that is no older than the installed mypy\n current: MypyTestTarget # the target for the current installed mypy", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_get_test_config_get_test_config.return.MypyTestConfig_existing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_get_test_config_get_test_config.return.MypyTestConfig_existing_", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 155, "span_ids": ["get_test_config"], "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 get_test_config(module_path: Path, config_path: Path) -> MypyTestConfig:\n outputs_dir = PYDANTIC_ROOT / 'tests/mypy/outputs'\n outputs_dir.mkdir(exist_ok=True)\n existing_versions = [\n x.name for x in outputs_dir.iterdir() if x.is_dir() and re.match(r'[0-9]+(?:\\.[0-9]+)*', x.name)\n ]\n\n def _convert_to_output_path(v: str) -> Path:\n return outputs_dir / v / config_path.name.replace('.', '_') / module_path.name\n\n existing = None\n\n # Build sorted list of (parsed_version, version) pairs, including the current mypy version being used\n parsed_version_pairs = sorted([(parse_mypy_version(v), v) for v in existing_versions])\n if MYPY_VERSION_TUPLE not in [x[0] for x in parsed_version_pairs]:\n insort(parsed_version_pairs, (MYPY_VERSION_TUPLE, mypy_version))\n\n for parsed_version, version in parsed_version_pairs[::-1]:\n if parsed_version > MYPY_VERSION_TUPLE:\n continue\n output_path = _convert_to_output_path(version)\n if output_path.exists():\n existing = MypyTestTarget(parsed_version, output_path)\n break\n\n current = MypyTestTarget(MYPY_VERSION_TUPLE, _convert_to_output_path(mypy_version))\n return MypyTestConfig(existing, current)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_get_expected_return_code_test_success_cases_run.importlib_import_module_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_get_expected_return_code_test_success_cases_run.importlib_import_module_f", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 225, "end_line": 238, "span_ids": ["get_expected_return_code", "test_success_cases_run"], "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 get_expected_return_code(source_code: str) -> int:\n if re.findall(r'^\\s*# MYPY:', source_code, flags=re.MULTILINE):\n return 1\n return 0\n\n\n@pytest.mark.parametrize('module', ['dataclass_no_any', 'plugin_success', 'plugin_success_baseConfig'])\n@pytest.mark.filterwarnings('ignore:.*is deprecated.*:DeprecationWarning')\n@pytest.mark.filterwarnings('ignore:.*are deprecated.*:DeprecationWarning')\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}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_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_explicit_reexports_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": 241, "end_line": 250, "span_ids": ["test_explicit_reexports"], "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_explicit_reexports():\n from pydantic import __all__ as root_all\n from pydantic.deprecated.tools import __all__ as tools\n from pydantic.main import __all__ as main\n from pydantic.networks import __all__ as networks\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_test_parse_mypy_version.assert_parse_mypy_version": {"__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_test_parse_mypy_version.assert_parse_mypy_version", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 253, "end_line": 269, "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/mypy/test_mypy.py_merge_python_and_mypy_output_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_merge_python_and_mypy_output_", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 283, "end_line": 299, "span_ids": ["merge_python_and_mypy_output"], "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 merge_python_and_mypy_output(source_code: str, mypy_output: str) -> str:\n merged_lines = [(line, False) for line in source_code.splitlines()]\n\n for line in mypy_output.splitlines()[::-1]:\n if not line:\n continue\n try:\n line_number, message = re.split(r':(?:\\d+:)?', line, maxsplit=1)\n merged_lines.insert(int(line_number), (f'# MYPY: {message.strip()}', True))\n except ValueError:\n # This could happen due to lack of a ':' in `line`, or the pre-':' contents not being a number\n # Either way, put all such lines at the top of the file\n merged_lines.insert(0, (f'# MYPY: {line.strip()}', True))\n\n merged_lines = [line for line, is_mypy in merged_lines if is_mypy or not line.strip().startswith('# MYPY: ')]\n return '\\n'.join(merged_lines) + '\\n'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/plugin/example_plugin.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/plugin/example_plugin.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/plugin/example_plugin.py", "file_name": "example_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["Plugin", "ValidatePythonHandler.on_success", "impl", "MyModel", "ValidatePythonHandler.on_error", "imports", "impl:7", "ValidatePythonHandler.on_enter", "ValidatePythonHandler", "Plugin.new_schema_validator"], "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": "from pydantic import BaseModel\n\n\nclass MyModel(BaseModel):\n x: int\n\n\nm = MyModel(x='10')\nif m.x != 10:\n raise ValueError('m.x should be 10')\n\nlog = []\n\n\nclass ValidatePythonHandler:\n def on_enter(self, *args, **kwargs) -> None:\n log.append(f'on_enter args={args} kwargs={kwargs}')\n\n def on_success(self, result) -> None:\n log.append(f'on_success result={result}')\n\n def on_error(self, error) -> None:\n log.append(f'on_error error={error}')\n\n\nclass Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n return ValidatePythonHandler(), None, None\n\n\nplugin = Plugin()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/plugin/test_plugin.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/plugin/test_plugin.py_os_", "embedding": null, "metadata": {"file_path": "tests/plugin/test_plugin.py", "file_name": "test_plugin.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 25, "span_ids": ["imports", "test_plugin_usage"], "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": "import os\n\nimport pytest\n\npytestmark = pytest.mark.skipif(not os.getenv('TEST_PLUGIN'), reason='Test only with `TEST_PLUGIN` env var set.')\n\n\ndef test_plugin_usage():\n from pydantic import BaseModel\n\n class MyModel(BaseModel):\n x: int\n y: str\n\n m = MyModel(x='10', y='hello')\n assert m.x == 10\n assert m.y == 'hello'\n\n from example_plugin import log\n\n assert log == [\n \"on_enter args=({'x': '10', 'y': 'hello'},) kwargs={'self_instance': MyModel()}\",\n \"on_success result=x=10 y='hello'\",\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_used_by_default.assert__test_alias_generator_used_by_default.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_used_by_default.assert__test_alias_generator_used_by_default.assert_", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 297, "span_ids": ["test_alias_generator_used_by_default"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize('alias_generator', upper_alias_generator)\ndef test_alias_generator_used_by_default(alias_generator):\n # ... other code\n\n assert {\n name: {k: getattr(f, k) for k in ('alias', 'validation_alias', 'serialization_alias')}\n for name, f in Model.model_fields.items()\n } == {\n # Validation/serialization aliases should be:\n # 1. The specific alias, if specified, or\n # 2. The alias, if specified, or\n # 3. The generated alias (i.e. the field name in upper case)\n 'a': {\n 'alias': 'A',\n 'validation_alias': 'A',\n 'serialization_alias': 'A',\n },\n 'b': {\n 'alias': 'b_alias',\n 'validation_alias': 'b_alias',\n 'serialization_alias': 'b_alias',\n },\n 'c': {\n 'alias': 'C',\n 'validation_alias': 'c_val_alias',\n 'serialization_alias': 'C',\n },\n 'd': {\n 'alias': 'D',\n 'validation_alias': 'D',\n 'serialization_alias': 'd_ser_alias',\n },\n 'e': {\n 'alias': 'e_alias',\n 'validation_alias': 'e_val_alias',\n 'serialization_alias': 'e_alias',\n },\n 'f': {\n 'alias': 'f_alias',\n 'validation_alias': 'f_alias',\n 'serialization_alias': 'f_ser_alias',\n },\n 'g': {\n 'alias': 'g_alias',\n 'validation_alias': 'g_val_alias',\n 'serialization_alias': 'g_ser_alias',\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_annotated.py_sys_NO_VALUE.object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_sys_NO_VALUE.object_", "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": 14, "span_ids": ["imports"], "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": "import sys\nfrom typing import Any, Generic, Iterator, List, Set, TypeVar\n\nimport pytest\nfrom annotated_types import BaseMetadata, GroupedMetadata, Gt, Lt, Predicate\nfrom pydantic_core import PydanticUndefined, core_schema\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, Field, GetCoreSchemaHandler, TypeAdapter, ValidationError\nfrom pydantic.errors import PydanticSchemaGenerationError\nfrom pydantic.fields import PrivateAttr\nfrom pydantic.functional_validators import AfterValidator\n\nNO_VALUE = 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_annotated.py_test_annotated_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_test_annotated_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": 16, "end_line": 89, "span_ids": ["test_annotated"], "tokens": 556}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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 PydanticUndefined,\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 lambda: Annotated[int, Field(alias='foobar')],\n PydanticUndefined,\n \"FieldInfo(annotation=int, required=True, alias='foobar', alias_priority=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_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": 92, "end_line": 125, "span_ids": ["test_annotated_instance_exceptions", "test_annotated_allows_unknown"], "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.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 PydanticUndefined,\n pytest.raises(ValueError, match=r'Field required \\[type=missing,'),\n ),\n (\n lambda: Annotated[int, Field()],\n PydanticUndefined,\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_get_pydantic_core_schema_source_type_test_get_pydantic_core_schema_source_type.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_get_pydantic_core_schema_source_type_test_get_pydantic_core_schema_source_type.None_1", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 234, "end_line": 257, "span_ids": ["test_get_pydantic_core_schema_source_type"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_pydantic_core_schema_source_type() -> None:\n types: Set[Any] = set()\n\n class PydanticMarker:\n def __get_pydantic_core_schema__(self, source: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n types.add(source)\n return handler(source)\n\n class _(BaseModel):\n x: Annotated[Annotated[int, 'foo'], PydanticMarker()]\n\n assert types == {int}\n types.clear()\n\n T = TypeVar('T')\n\n class GenericModel(BaseModel, Generic[T]):\n y: T\n\n class _(BaseModel):\n x: Annotated[GenericModel[int], PydanticMarker()]\n\n assert types == {GenericModel[int]}\n types.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_type_adapter_test_merge_field_infos_type_adapter.assert_ta_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_type_adapter_test_merge_field_infos_type_adapter.assert_ta_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 260, "end_line": 289, "span_ids": ["test_merge_field_infos_type_adapter"], "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_merge_field_infos_type_adapter() -> None:\n ta = TypeAdapter(\n Annotated[\n int, Field(gt=0), Field(lt=100), Field(gt=1), Field(description='abc'), Field(3), Field(description=None)\n ]\n )\n\n default = ta.get_default_value()\n assert default is not None\n assert default.value == 3\n\n # insert_assert(ta.validate_python(2))\n assert ta.validate_python(2) == 2\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(1)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'greater_than', 'loc': (), 'msg': 'Input should be greater than 1', 'input': 1, 'ctx': {'gt': 1}}\n ]\n\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {\n 'default': 3,\n 'description': 'abc',\n 'exclusiveMaximum': 100,\n 'exclusiveMinimum': 1,\n '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_merge_field_infos_model_test_model_dump_doesnt_dump_annotated_dunder.assert_AnnotatedModel_one": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_model_test_model_dump_doesnt_dump_annotated_dunder.assert_AnnotatedModel_one", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 292, "end_line": 316, "span_ids": ["test_merge_field_infos_model", "test_model_dump_doesnt_dump_annotated_dunder"], "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_merge_field_infos_model() -> None:\n class Model(BaseModel):\n x: Annotated[\n int, Field(gt=0), Field(lt=100), Field(gt=1), Field(description='abc'), Field(3), Field(description=None)\n ] = Field(5)\n\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'properties': {\n 'x': {'default': 5, 'exclusiveMaximum': 100, 'exclusiveMinimum': 1, 'title': 'X', 'type': 'integer'}\n },\n 'title': 'Model',\n 'type': 'object',\n }\n\n\ndef test_model_dump_doesnt_dump_annotated_dunder():\n class Model(BaseModel):\n one: int\n\n AnnotatedModel = Annotated[Model, ...]\n\n # In Pydantic v1, `AnnotatedModel.dict()` would have returned\n # `{'one': 1, '__orig_class__': typing.Annotated[...]}`\n assert AnnotatedModel(one=1).model_dump() == {'one': 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_annotated.py_test_merge_field_infos_ordering_test_merge_field_infos_ordering.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_merge_field_infos_ordering_test_merge_field_infos_ordering.None_2", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 319, "end_line": 345, "span_ids": ["test_merge_field_infos_ordering"], "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_merge_field_infos_ordering() -> None:\n TheType = Annotated[int, AfterValidator(lambda x: x), Field(le=2), AfterValidator(lambda x: x * 2), Field(lt=4)]\n\n class Model(BaseModel):\n x: TheType\n\n assert Model(x=1).x == 2\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=2)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'less_than', 'loc': ('x',), 'msg': 'Input should be less than 4', 'input': 2, 'ctx': {'lt': 4}}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=3)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'less_than_equal',\n 'loc': ('x',),\n 'msg': 'Input should be less than or equal to 2',\n 'input': 3,\n 'ctx': {'le': 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_annotated.py_test_validate_float_inf_nan_python_test_validate_float_inf_nan_python.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_validate_float_inf_nan_python_test_validate_float_inf_nan_python.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 349, "end_line": 362, "span_ids": ["test_validate_float_inf_nan_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": "def test_validate_float_inf_nan_python() -> None:\n ta = TypeAdapter(Annotated[float, AfterValidator(lambda x: x * 3), Field(allow_inf_nan=False)])\n assert ta.validate_python(2.0) == 6.0\n\n ta = TypeAdapter(Annotated[float, AfterValidator(lambda _: float('nan')), Field(allow_inf_nan=False)])\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(1.0)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n # TODO: input should be float('nan'), this seems like a subtle bug in pydantic-core\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'finite_number', 'loc': (), 'msg': 'Input should be a finite number', 'input': 1.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_annotated.py_test_predicate_error_python_test_predicate_error_python.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_predicate_error_python_test_predicate_error_python.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 361, "end_line": 375, "span_ids": ["test_predicate_error_python"], "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_predicate_error_python() -> None:\n ta = TypeAdapter(Annotated[int, Predicate(lambda x: x > 0)])\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(-1)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'predicate_failed',\n 'loc': (),\n 'msg': 'Predicate test_predicate_error_python.. failed',\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_computed_fields.py_test_exclude_none_test_exclude_none.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_exclude_none_test_exclude_none.None_3", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 292, "end_line": 309, "span_ids": ["test_exclude_none"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_exclude_none():\n class Model(BaseModel):\n x: int\n y: int\n\n @computed_field\n def sum(self) -> int:\n return self.x + self.y\n\n @computed_field\n def none(self) -> None:\n return None\n\n m = Model(x=1, y=2)\n assert m.model_dump(exclude_none=False) == {'x': 1, 'y': 2, 'sum': 3, 'none': None}\n assert m.model_dump(exclude_none=True) == {'x': 1, 'y': 2, 'sum': 3}\n assert m.model_dump(mode='json', exclude_none=False) == {'x': 1, 'y': 2, 'sum': 3, 'none': None}\n assert m.model_dump(mode='json', exclude_none=True) == {'x': 1, 'y': 2, 'sum': 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_computed_fields.py_test_abstractmethod_test_abstractmethod_missing.with_pytest_raises_.Square_side_4_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_abstractmethod_test_abstractmethod_missing.with_pytest_raises_.Square_side_4_0_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 489, "end_line": 534, "span_ids": ["test_abstractmethod", "test_abstractmethod_missing"], "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_abstractmethod():\n class AbstractSquare(BaseModel):\n side: float\n\n @computed_field\n @property\n @abstractmethod\n def area(self) -> float:\n raise NotImplementedError()\n\n class Square(AbstractSquare):\n @computed_field\n @property\n def area(self) -> float:\n return self.side + 1\n\n m = Square(side=4.0)\n assert m.model_dump() == {'side': 4.0, 'area': 5.0}\n\n\n@pytest.mark.skipif(sys.version_info < (3, 12), reason='error message is different on older versions')\n@pytest.mark.parametrize(\n 'bases',\n [\n (BaseModel, ABC),\n (ABC, BaseModel),\n (BaseModel,),\n ],\n)\ndef test_abstractmethod_missing(bases: Tuple[Any, ...]):\n class AbstractSquare(*bases):\n side: float\n\n @computed_field\n @property\n @abstractmethod\n def area(self) -> float:\n raise NotImplementedError()\n\n class Square(AbstractSquare):\n pass\n\n with pytest.raises(\n TypeError, match=\"Can't instantiate abstract class Square without an implementation for abstract method 'area'\"\n ):\n Square(side=4.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_computed_fields.py_test_multiple_references_to_schema_test_multiple_references_to_schema.assert_ta_json_schema_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_multiple_references_to_schema_test_multiple_references_to_schema.assert_ta_json_schema_mod", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 687, "end_line": 722, "span_ids": ["test_multiple_references_to_schema"], "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 'model_factory',\n [\n make_base_model,\n pytest.param(\n make_typed_dict,\n marks=pytest.mark.xfail(\n reason='computed fields do not work with TypedDict yet. See https://github.com/pydantic/pydantic-core/issues/657'\n ),\n ),\n make_dataclass,\n ],\n)\ndef test_multiple_references_to_schema(model_factory: Callable[[], Any]) -> None:\n \"\"\"\n https://github.com/pydantic/pydantic/issues/5980\n \"\"\"\n\n model = model_factory()\n\n ta = TypeAdapter(model)\n\n assert ta.dump_python(model()) == {'comp_1': {}, 'comp_2': {}}\n\n assert ta.json_schema() == {'type': 'object', 'properties': {}, 'title': 'Model'}\n\n assert ta.json_schema(mode='serialization') == {\n '$defs': {'CompModel': {'properties': {}, 'title': 'CompModel', 'type': 'object'}},\n 'properties': {\n 'comp_1': {'allOf': [{'$ref': '#/$defs/CompModel'}], 'readOnly': True},\n 'comp_2': {'allOf': [{'$ref': '#/$defs/CompModel'}], 'readOnly': True},\n },\n 'required': ['comp_1', 'comp_2'],\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_config.py_json_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_json_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": 56, "span_ids": ["imports", "model_with_strict_config"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nimport re\nimport sys\nfrom contextlib import nullcontext as does_not_raise\nfrom decimal import Decimal\nfrom inspect import signature\nfrom typing import Any, ContextManager, Iterable, NamedTuple, Optional, Type, Union\n\nfrom dirty_equals import HasRepr, IsPartialDict\nfrom pydantic_core import SchemaError, SchemaSerializer, SchemaValidator\n\nfrom pydantic import (\n BaseConfig,\n BaseModel,\n Field,\n GenerateSchema,\n PrivateAttr,\n PydanticDeprecatedSince20,\n PydanticSchemaGenerationError,\n ValidationError,\n create_model,\n field_validator,\n validate_call,\n)\nfrom pydantic._internal._config import ConfigWrapper, config_defaults\nfrom pydantic._internal._mock_val_ser import MockValSer\nfrom pydantic._internal._typing_extra import get_type_hints\nfrom pydantic.config import ConfigDict, JsonValue\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\nfrom pydantic.errors import PydanticUserError\nfrom pydantic.fields import FieldInfo\nfrom pydantic.type_adapter import TypeAdapter\nfrom pydantic.warnings import PydanticDeprecationWarning\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 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_config.py_test_config_wrapper_match_test_config_wrapper_match.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_wrapper_match_test_config_wrapper_match.assert_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 527, "end_line": 539, "span_ids": ["test_config_wrapper_match"], "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_config_wrapper_match():\n localns = {'_GenerateSchema': GenerateSchema, 'GenerateSchema': GenerateSchema, 'JsonValue': JsonValue}\n config_dict_annotations = [(k, str(v)) for k, v in get_type_hints(ConfigDict, localns=localns).items()]\n config_dict_annotations.sort()\n # remove config\n config_wrapper_annotations = [\n (k, str(v)) for k, v in get_type_hints(ConfigWrapper, localns=localns).items() if k != 'config_dict'\n ]\n config_wrapper_annotations.sort()\n\n assert (\n config_dict_annotations == config_wrapper_annotations\n ), 'ConfigDict and ConfigWrapper must have the same annotations (except ConfigWrapper.config_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_config.py_test_config_validation_error_cause_test_config_validation_error_cause.assert_src_exc___notes___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_validation_error_cause_test_config_validation_error_cause.assert_src_exc___notes___", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 542, "end_line": 567, "span_ids": ["test_config_validation_error_cause"], "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.skipif(sys.version_info < (3, 11), reason='requires backport pre 3.11, fully tested in pydantic core')\ndef test_config_validation_error_cause():\n class Foo(BaseModel):\n foo: int\n\n @field_validator('foo')\n def check_foo(cls, v):\n assert v > 5, 'Must be greater than 5'\n\n # Should be disabled by default:\n with pytest.raises(ValidationError) as exc_info:\n Foo(foo=4)\n assert exc_info.value.__cause__ is None\n\n Foo.model_config = ConfigDict(validation_error_cause=True)\n Foo.model_rebuild(force=True)\n with pytest.raises(ValidationError) as exc_info:\n Foo(foo=4)\n # Confirm python error attached as a cause, and error location specified in a note:\n assert exc_info.value.__cause__ is not None\n assert isinstance(exc_info.value.__cause__, ExceptionGroup)\n assert len(exc_info.value.__cause__.exceptions) == 1\n src_exc = exc_info.value.__cause__.exceptions[0]\n assert repr(src_exc) == \"AssertionError('Must be greater than 5\\\\nassert 4 > 5')\"\n assert len(src_exc.__notes__) == 1\n assert src_exc.__notes__[0] == '\\nPydantic: cause of loc: 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_config.py_test_config_defaults_match_test_config_is_not_inherited_in_model_fields.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_defaults_match_test_config_is_not_inherited_in_model_fields.assert_m_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": 570, "end_line": 595, "span_ids": ["test_config_defaults_match", "test_config_is_not_inherited_in_model_fields"], "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_config_defaults_match():\n localns = {'_GenerateSchema': GenerateSchema, 'GenerateSchema': GenerateSchema}\n config_dict_keys = sorted(list(get_type_hints(ConfigDict, localns=localns).keys()))\n config_defaults_keys = sorted(list(config_defaults.keys()))\n\n assert config_dict_keys == config_defaults_keys, 'ConfigDict and config_defaults must have the same keys'\n\n\ndef test_config_is_not_inherited_in_model_fields():\n from typing import List\n\n from pydantic import BaseModel, ConfigDict\n\n class Inner(BaseModel):\n a: str\n\n class Outer(BaseModel):\n # this cause the inner model incorrectly dumpped:\n model_config = ConfigDict(str_to_lower=True)\n\n x: List[str] # should be converted to lower\n inner: Inner # should not have fields converted to lower\n\n m = Outer.model_validate(dict(x=['Abc'], inner=dict(a='Def')))\n\n assert m.model_dump() == {'x': ['abc'], 'inner': {'a': 'Def'}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_wrapper_repr_test_json_encoders_model.assert_json_loads_Model_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_wrapper_repr_test_json_encoders_model.assert_json_loads_Model_v", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 650, "end_line": 687, "span_ids": ["test_json_encoders_model", "test_config_wrapper_repr", "test_config_inheritance_with_annotations", "test_config_wrapper_get_item"], "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": "@pytest.mark.parametrize(\n 'config,expected',\n (\n (ConfigDict(), 'ConfigWrapper()'),\n (ConfigDict(title='test'), \"ConfigWrapper(title='test')\"),\n ),\n)\ndef test_config_wrapper_repr(config, expected):\n assert repr(ConfigWrapper(config=config)) == expected\n\n\ndef test_config_wrapper_get_item():\n config_wrapper = ConfigWrapper(config=ConfigDict(title='test'))\n\n assert config_wrapper.title == 'test'\n with pytest.raises(AttributeError, match=\"Config has no attribute 'test'\"):\n config_wrapper.test\n\n\ndef test_config_inheritance_with_annotations():\n class Parent(BaseModel):\n model_config: ConfigDict = {'extra': 'allow'}\n\n class Child(Parent):\n model_config: ConfigDict = {'str_to_lower': True}\n\n assert Child.model_config == {'extra': 'allow', 'str_to_lower': True}\n\n\ndef test_json_encoders_model() -> None:\n with pytest.warns(PydanticDeprecationWarning):\n\n class Model(BaseModel):\n model_config = ConfigDict(json_encoders={Decimal: lambda x: str(x * 2), int: lambda x: str(x * 3)})\n value: Decimal\n x: int\n\n assert json.loads(Model(value=Decimal('1.1'), x=1).model_dump_json()) == {'value': '2.2', 'x': '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_config.py_test_json_encoders_type_adapter_test_json_encoders_type_adapter.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_json_encoders_type_adapter_test_json_encoders_type_adapter.None_3", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 690, "end_line": 702, "span_ids": ["test_json_encoders_type_adapter"], "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.filterwarnings('ignore::pydantic.warnings.PydanticDeprecationWarning')\ndef test_json_encoders_type_adapter() -> None:\n config = ConfigDict(json_encoders={Decimal: lambda x: str(x * 2), int: lambda x: str(x * 3)})\n\n ta = TypeAdapter(int, config=config)\n assert json.loads(ta.dump_json(1)) == '3'\n\n ta = TypeAdapter(Decimal, config=config)\n assert json.loads(ta.dump_json(Decimal('1.1'))) == '2.2'\n\n ta = TypeAdapter(Union[Decimal, int], config=config)\n assert json.loads(ta.dump_json(Decimal('1.1'))) == '2.2'\n assert json.loads(ta.dump_json(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_config.py_test_config_model_defer_build_test_config_type_adapter_defer_build.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_model_defer_build_test_config_type_adapter_defer_build.None_5", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 705, "end_line": 735, "span_ids": ["test_config_model_defer_build", "test_config_type_adapter_defer_build"], "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_config_model_defer_build():\n class MyModel(BaseModel, defer_build=True):\n x: int\n\n assert isinstance(MyModel.__pydantic_validator__, MockValSer)\n assert isinstance(MyModel.__pydantic_serializer__, MockValSer)\n\n m = MyModel(x=1)\n assert m.x == 1\n\n assert isinstance(MyModel.__pydantic_validator__, SchemaValidator)\n assert isinstance(MyModel.__pydantic_serializer__, SchemaSerializer)\n\n\ndef test_config_type_adapter_defer_build():\n class MyModel(BaseModel, defer_build=True):\n x: int\n\n ta = TypeAdapter(MyModel)\n\n assert isinstance(ta.validator, MockValSer)\n assert isinstance(ta.serializer, MockValSer)\n\n m = ta.validate_python({'x': 1})\n assert m.x == 1\n m2 = ta.validate_python({'x': 2})\n assert m2.x == 2\n\n # in the future, can reassign said validators to the TypeAdapter\n assert isinstance(MyModel.__pydantic_validator__, SchemaValidator)\n assert isinstance(MyModel.__pydantic_serializer__, SchemaSerializer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_model_defer_build_nested_test_config_model_defer_build_nested.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_model_defer_build_nested_test_config_model_defer_build_nested.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": 738, "end_line": 752, "span_ids": ["test_config_model_defer_build_nested"], "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_config_model_defer_build_nested():\n class MyNestedModel(BaseModel, defer_build=True):\n x: int\n\n class MyModel(BaseModel):\n y: MyNestedModel\n\n assert isinstance(MyNestedModel.__pydantic_validator__, MockValSer)\n assert isinstance(MyNestedModel.__pydantic_serializer__, MockValSer)\n\n m = MyModel(y={'x': 1})\n assert m.model_dump() == {'y': {'x': 1}}\n\n assert isinstance(MyNestedModel.__pydantic_validator__, MockValSer)\n assert isinstance(MyNestedModel.__pydantic_serializer__, MockValSer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_model_defer_build_ser_first_test_defer_build_json_schema.assert_M_model_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_config_model_defer_build_ser_first_test_defer_build_json_schema.assert_M_model_json_schem", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 755, "end_line": 775, "span_ids": ["test_defer_build_json_schema", "test_config_model_defer_build_ser_first"], "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_config_model_defer_build_ser_first():\n class M1(BaseModel, defer_build=True):\n a: str\n\n class M2(BaseModel, defer_build=True):\n b: M1\n\n m = M2.model_validate({'b': {'a': 'foo'}})\n assert m.b.model_dump() == {'a': 'foo'}\n\n\ndef test_defer_build_json_schema():\n class M(BaseModel, defer_build=True):\n a: int\n\n assert M.model_json_schema() == {\n 'title': 'M',\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_create_model.py_test_dynamic_and_static_test_create_model_with_doc.assert_model___doc___": {"__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_create_model_with_doc.assert_model___doc___", "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": 234, "end_line": 270, "span_ids": ["test_create_model_with_doc", "test_dynamic_and_static", "test_create_model_field_and_model_title", "test_create_model_field_description"], "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 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_create_model_field_and_model_title():\n m = create_model('M', __config__=ConfigDict(title='abc'), a=(str, Field(title='field-title')))\n assert m.model_json_schema() == {\n 'properties': {'a': {'title': 'field-title', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'abc',\n 'type': 'object',\n }\n\n\ndef test_create_model_field_description():\n m = create_model('M', a=(str, Field(description='descr')), __doc__='Some doc')\n assert m.model_json_schema() == {\n 'properties': {'a': {'description': 'descr', 'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'M',\n 'type': 'object',\n 'description': 'Some doc',\n }\n\n\ndef test_create_model_with_doc():\n model = create_model('FooModel', foo=(str, ...), bar=(int, 123), __doc__='The Foo model')\n assert model.__name__ == 'FooModel'\n assert model.__doc__ == 'The Foo 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_dataclasses.py_test_kw_only_test_kw_only_subclass.assert_B_1_y_2_z_3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_kw_only_test_kw_only_subclass.assert_B_1_y_2_z_3_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1635, "end_line": 1660, "span_ids": ["test_kw_only", "test_kw_only_subclass"], "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.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\n@pytest.mark.skipif(sys.version_info < (3, 10), reason='kw_only is not available in python < 3.10')\ndef test_kw_only_subclass():\n @pydantic.dataclasses.dataclass\n class A:\n x: int\n y: int = pydantic.Field(default=0, kw_only=True)\n\n @pydantic.dataclasses.dataclass\n class B(A):\n z: int\n\n assert B(1, 2) == B(x=1, y=0, z=2)\n assert B(1, y=2, z=3) == B(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_dataclass_decorators_dataclass_decorators.return._argvalues_decorators_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_dataclass_decorators_dataclass_decorators.return._argvalues_decorators_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1663, "end_line": 1688, "span_ids": ["dataclass_decorators"], "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 dataclass_decorators(include_identity: bool = False, exclude_combined: bool = False):\n decorators = [pydantic.dataclasses.dataclass, dataclasses.dataclass]\n ids = ['pydantic', 'stdlib']\n\n if not exclude_combined:\n\n def combined_decorator(cls):\n \"\"\"\n Should be equivalent to:\n @pydantic.dataclasses.dataclass\n @dataclasses.dataclass\n \"\"\"\n return pydantic.dataclasses.dataclass(dataclasses.dataclass(cls))\n\n decorators.append(combined_decorator)\n ids.append('combined')\n\n if include_identity:\n\n def identity_decorator(cls):\n return cls\n\n decorators.append(identity_decorator)\n ids.append('identity')\n\n return {'argvalues': decorators, 'ids': ids}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_multiple_parametrized_generic_dataclasses_test_multiple_parametrized_generic_dataclasses.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_multiple_parametrized_generic_dataclasses_test_multiple_parametrized_generic_dataclasses.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": 2077, "end_line": 2109, "span_ids": ["test_multiple_parametrized_generic_dataclasses"], "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_multiple_parametrized_generic_dataclasses():\n T = TypeVar('T')\n\n @pydantic.dataclasses.dataclass\n class GenericDataclass(Generic[T]):\n x: T\n\n validator1 = pydantic.TypeAdapter(GenericDataclass[int])\n validator2 = pydantic.TypeAdapter(GenericDataclass[str])\n\n # verify that generic parameters are showing up in the type ref for generic dataclasses\n # this can probably be removed if the schema changes in some way that makes this part of the test fail\n assert '[int:' in validator1.core_schema['ref']\n assert '[str:' in validator2.core_schema['ref']\n\n assert validator1.validate_python({'x': 1}).x == 1\n assert validator2.validate_python({'x': 'hello world'}).x == 'hello world'\n\n with pytest.raises(ValidationError) as exc_info:\n validator2.validate_python({'x': 1})\n assert exc_info.value.errors(include_url=False) == [\n {'input': 1, 'loc': ('x',), 'msg': 'Input should be a valid string', 'type': 'string_type'}\n ]\n with pytest.raises(ValidationError) as exc_info:\n validator1.validate_python({'x': 'hello world'})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'hello world',\n 'loc': ('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_dataclasses.py_test_rebuild_dataclass_test_model_config_override_in_decorator_empty_config.assert_ta_validate_python": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_rebuild_dataclass_test_model_config_override_in_decorator_empty_config.assert_ta_validate_python", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2356, "end_line": 2406, "span_ids": ["test_model_config_override_in_decorator", "test_model_config_override_in_decorator_empty_config", "test_rebuild_dataclass", "test_model_config"], "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_rebuild_dataclass():\n @pydantic.dataclasses.dataclass\n class MyDataClass:\n x: str\n\n assert rebuild_dataclass(MyDataClass) is None\n\n @pydantic.dataclasses.dataclass()\n class MyDataClass1:\n d2: Optional['Foo'] = None # noqa F821\n\n with pytest.raises(PydanticUndefinedAnnotation, match=\"name 'Foo' is not defined\"):\n rebuild_dataclass(MyDataClass1, _parent_namespace_depth=0)\n\n\n@pytest.mark.parametrize(\n 'dataclass_decorator',\n [\n pydantic.dataclasses.dataclass,\n dataclasses.dataclass,\n ],\n ids=['pydantic', 'stdlib'],\n)\ndef test_model_config(dataclass_decorator: Any) -> None:\n @dataclass_decorator\n class Model:\n x: str\n __pydantic_config__ = ConfigDict(str_to_lower=True)\n\n ta = TypeAdapter(Model)\n assert ta.validate_python({'x': 'ABC'}).x == 'abc'\n\n\ndef test_model_config_override_in_decorator() -> None:\n @pydantic.dataclasses.dataclass(config=ConfigDict(str_to_lower=False, str_strip_whitespace=True))\n class Model:\n x: str\n __pydantic_config__ = ConfigDict(str_to_lower=True)\n\n ta = TypeAdapter(Model)\n assert ta.validate_python({'x': 'ABC '}).x == 'ABC'\n\n\ndef test_model_config_override_in_decorator_empty_config() -> None:\n @pydantic.dataclasses.dataclass(config=ConfigDict())\n class Model:\n x: str\n __pydantic_config__ = ConfigDict(str_to_lower=True)\n\n ta = TypeAdapter(Model)\n assert ta.validate_python({'x': 'ABC '}).x == 'ABC '", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_pydantic_field_annotation_test_pydantic_field_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_dataclasses.py_test_pydantic_field_annotation_test_pydantic_field_annotation.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": 2409, "end_line": 2424, "span_ids": ["test_pydantic_field_annotation"], "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_pydantic_field_annotation():\n @pydantic.dataclasses.dataclass\n class Model:\n x: Annotated[int, Field(gt=0)]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=-1)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'gt': 0},\n 'input': -1,\n 'loc': ('x',),\n 'msg': 'Input should be greater than 0',\n 'type': 'greater_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_dataclasses.py_test_combined_field_annotations_test_combined_field_annotations.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_combined_field_annotations_test_combined_field_annotations.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": 2427, "end_line": 2455, "span_ids": ["test_combined_field_annotations"], "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_combined_field_annotations():\n \"\"\"\n This test is included to document the fact that `Field` and `field` can be used together.\n That said, if you mix them like this, there is a good chance you'll run into surprising behavior/bugs.\n\n (E.g., `x: Annotated[int, Field(gt=1, validate_default=True)] = field(default=0)` doesn't cause an error)\n\n I would generally advise against doing this, and if we do change the behavior in the future to somehow merge\n pydantic.FieldInfo and dataclasses.Field in a way that changes runtime behavior for existing code, I would probably\n consider it a bugfix rather than a breaking change.\n \"\"\"\n\n @pydantic.dataclasses.dataclass\n class Model:\n x: Annotated[int, Field(gt=1)] = dataclasses.field(default=1)\n\n assert Model().x == 1\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=0)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'gt': 1},\n 'input': 0,\n 'loc': ('x',),\n 'msg': 'Input should be greater than 1',\n 'type': 'greater_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_dataclasses.py_test_dataclass_field_default_factory_with_init_test_dataclass_field_default_with_init.assert_RootModel_Model_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclass_field_default_factory_with_init_test_dataclass_field_default_with_init.assert_RootModel_Model_m", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2458, "end_line": 2477, "span_ids": ["test_dataclass_field_default_factory_with_init", "test_dataclass_field_default_with_init"], "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_dataclass_field_default_factory_with_init():\n @pydantic.dataclasses.dataclass\n class Model:\n x: int = dataclasses.field(default_factory=lambda: 3, init=False)\n\n m = Model()\n assert 'x' in Model.__pydantic_fields__\n assert m.x == 3\n assert RootModel[Model](m).model_dump() == {'x': 3}\n\n\ndef test_dataclass_field_default_with_init():\n @pydantic.dataclasses.dataclass\n class Model:\n x: int = dataclasses.field(default=3, init=False)\n\n m = Model()\n assert 'x' in Model.__pydantic_fields__\n assert m.x == 3\n assert RootModel[Model](m).model_dump() == {'x': 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_metadata_test_metadata.assert_TypeAdapter_Pydant": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_metadata_test_metadata.assert_TypeAdapter_Pydant", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2480, "end_line": 2492, "span_ids": ["test_metadata"], "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_metadata():\n @dataclasses.dataclass\n class Test:\n value: int = dataclasses.field(metadata={'info': 'Some int value', 'json_schema_extra': {'a': 'b'}})\n\n PydanticTest = pydantic.dataclasses.dataclass(Test)\n\n assert TypeAdapter(PydanticTest).json_schema() == {\n 'properties': {'value': {'a': 'b', 'title': 'Value', 'type': 'integer'}},\n 'required': ['value'],\n 'title': 'Test',\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_signature_test_signature.assert_str_inspect_signat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_signature_test_signature.assert_str_inspect_signat", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2481, "end_line": 2494, "span_ids": ["test_signature"], "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_signature():\n @pydantic.dataclasses.dataclass\n class Model:\n x: int\n y: str = 'y'\n z: float = dataclasses.field(default=1.0)\n a: float = dataclasses.field(default_factory=float)\n b: float = Field(default=1.0)\n c: float = Field(default_factory=float)\n d: int = dataclasses.field(metadata={'alias': 'dd'}, default=1)\n\n assert str(inspect.signature(Model)) == (\n \"(x: int, y: str = 'y', z: float = 1.0, a: float = , b: float = 1.0, c: float = , dd: int = 1) -> 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_datetime.py_test_date_parsing_time_model_fixture.return.TimeModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_date_parsing_time_model_fixture.return.TimeModel", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 107, "span_ids": ["test_date_parsing", "time_model_fixture"], "tokens": 681}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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\n\n\n@pytest.fixture(scope='module', name='TimeModel')\ndef time_model_fixture():\n class TimeModel(BaseModel):\n d: time\n\n return TimeModel", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_time_parsing_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_test_time_parsing_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": 110, "end_line": 153, "span_ids": ["datetime_model_fixture", "test_time_parsing"], "tokens": 689}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ('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, tzinfo=timezone.utc)),\n (3600.5, time(1, 0, 0, 500000, tzinfo=timezone.utc)),\n (86400 - 1, time(23, 59, 59, tzinfo=timezone.utc)),\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, invalid timezone sign')),\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:00', time(11, 5, 0, tzinfo=timezone.utc)),\n ('11:05-06:00', time(11, 5, 0, tzinfo=create_tz(-360))),\n ('11:05+06:00', time(11, 5, 0, tzinfo=create_tz(360))),\n ('11:05:00-25:00', Err('Input should be in a valid time format, timezone offset must be less than 24 hours')),\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_future_datetime_validation_fails_test_invalid_annotated_type.with_pytest_raises_TypeEr.Model.foo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_future_datetime_validation_fails_test_invalid_annotated_type.with_pytest_raises_TypeEr.Model.foo", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 558, "end_line": 597, "span_ids": ["test_invalid_annotated_type", "test_future_datetime_validation_fails"], "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.parametrize(\n 'value',\n (\n datetime.now(),\n datetime.now() - timedelta(1),\n '1996-01-22T10:20:30',\n ),\n)\ndef test_future_datetime_validation_fails(value, future_datetime_type):\n class Model(BaseModel):\n foo: future_datetime_type\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'datetime_future',\n 'loc': ('foo',),\n 'msg': 'Input should be in the future',\n 'input': value,\n }\n ]\n\n\n@pytest.mark.parametrize(\n 'annotation',\n (\n PastDate,\n PastDatetime,\n FutureDate,\n FutureDatetime,\n NaiveDatetime,\n AwareDatetime,\n ),\n)\ndef test_invalid_annotated_type(annotation):\n with pytest.raises(TypeError, match=f\"'{annotation.__name__}' cannot annotate 'str'.\"):\n\n class Model(BaseModel):\n foo: Annotated[str, 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/tests/test_datetime.py_test_tzinfo_could_be_reused_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_datetime.py_test_tzinfo_could_be_reused_", "embedding": null, "metadata": {"file_path": "tests/test_datetime.py", "file_name": "test_datetime.py", "file_type": "text/x-python", "category": "test", "start_line": 617, "end_line": 637, "span_ids": ["test_tzinfo_could_be_reused", "test_datetime_from_date_str"], "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_tzinfo_could_be_reused():\n class Model(BaseModel):\n value: datetime\n\n m = Model(value='2015-10-21T15:28:00.000000+01:00')\n assert m.model_dump_json() == '{\"value\":\"2015-10-21T15:28:00+01:00\"}'\n\n target = datetime(1955, 11, 12, 14, 38, tzinfo=m.value.tzinfo)\n assert target == datetime(1955, 11, 12, 14, 38, tzinfo=timezone(timedelta(hours=1)))\n\n now = datetime.now(tz=m.value.tzinfo)\n assert isinstance(now, datetime)\n\n\ndef test_datetime_from_date_str():\n class Model(BaseModel):\n value: datetime\n\n m = Model(value='2015-10-21')\n assert m.value == datetime(2015, 10, 21, 0, 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_deprecated.py_test_field_regex_test_modify_schema_error.with_pytest_raises_.Model.__modify_schema__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_regex_test_modify_schema_error.with_pytest_raises_.Model.__modify_schema__.pass", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 480, "end_line": 497, "span_ids": ["test_field_regex", "test_modify_schema_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_field_regex():\n with pytest.raises(PydanticUserError, match='`regex` is removed. use `pattern` instead'):\n\n class Model(BaseModel):\n x: str = Field('test', regex=r'^test$')\n\n\ndef test_modify_schema_error():\n with pytest.raises(\n PydanticUserError,\n match='The `__modify_schema__` method is not supported in Pydantic v2. '\n 'Use `__get_pydantic_json_schema__` instead in class `Model`.',\n ):\n\n class Model(BaseModel):\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, 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/tests/test_deprecated.py_test_v1_v2_custom_type_compatibility_test_v1_v2_custom_type_compatibility.assert_ta_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_v1_v2_custom_type_compatibility_test_v1_v2_custom_type_compatibility.assert_ta_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 498, "end_line": 523, "span_ids": ["test_v1_v2_custom_type_compatibility"], "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_v1_v2_custom_type_compatibility() -> None:\n \"\"\"Create a custom type that works with V1 and V2\"\"\"\n\n class MyType:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.int_schema()\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n return {'anyOf': [{'type': 'string'}, {'type': 'number'}]}\n\n @classmethod\n def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None:\n raise NotImplementedError # not actually called, we just want to make sure the method can exist\n\n @classmethod\n def __get_validators__(cls) -> Iterable[Any]:\n raise NotImplementedError # not actually called, we just want to make sure the method can exist\n yield\n\n ta = TypeAdapter(MyType)\n assert ta.validate_python('123') == 123\n assert ta.json_schema() == {'anyOf': [{'type': 'string'}, {'type': '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_deprecated.py_test_v1_get_validators_test_v1_get_validators.assert_m_x_day_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_v1_get_validators_test_v1_get_validators.assert_m_x_day_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 526, "end_line": 557, "span_ids": ["test_v1_get_validators"], "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_get_validators():\n class CustomDate(date):\n @classmethod\n def __get_validators__(cls):\n yield cls.validate1\n yield cls.validate2\n\n @classmethod\n def validate1(cls, v, i):\n print(v)\n\n if v.year < 2000:\n raise ValueError('Invalid year')\n return v\n\n @classmethod\n def validate2(cls, v, i):\n return date.today().replace(month=1, day=1)\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='^`__get_validators__` is deprecated and will be removed, use `__get_pydantic_core_schema__` instead.',\n ):\n\n class Model(BaseModel):\n x: CustomDate\n\n with pytest.raises(ValidationError, match='Value error, Invalid year'):\n Model(x=date(1999, 1, 1))\n\n m = Model(x=date.today())\n assert m.x.day == 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_v1_get_validators_invalid_validator_test_v1_get_validators_invalid_validator.with_pytest_raises_TypeEr.InvalidValidatorModel_x_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_v1_get_validators_invalid_validator_test_v1_get_validators_invalid_validator.with_pytest_raises_TypeEr.InvalidValidatorModel_x_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 560, "end_line": 579, "span_ids": ["test_v1_get_validators_invalid_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 test_v1_get_validators_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):\n pass\n\n with pytest.warns(\n PydanticDeprecatedSince20,\n match='^`__get_validators__` is deprecated and will be removed, use `__get_pydantic_core_schema__` instead.',\n ):\n\n class InvalidValidatorModel(BaseModel):\n x: InvalidValidator\n\n with pytest.raises(TypeError, match='takes 1 positional argument but 3 were given'):\n InvalidValidatorModel(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_field_extra_does_not_rewrite_json_schema_extra_test_dict.with_pytest_warns_Pydanti.assert_m_dict_x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_field_extra_does_not_rewrite_json_schema_extra_test_dict.with_pytest_warns_Pydanti.assert_m_dict_x_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 597, "end_line": 616, "span_ids": ["SimpleModel", "test_dict", "test_field_extra_does_not_rewrite_json_schema_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_extra_does_not_rewrite_json_schema_extra():\n m = 'Using extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead'\n with pytest.warns(PydanticDeprecatedSince20, match=m):\n\n class Model(BaseModel):\n x: str = Field('test', test='test', json_schema_extra={'test': 'json_schema_extra value'})\n\n assert Model.model_json_schema(by_alias=True)['properties'] == {\n 'x': {'default': 'test', 'test': 'json_schema_extra value', 'title': 'X', 'type': 'string'}\n }\n\n\nclass SimpleModel(BaseModel):\n x: int\n\n\ndef test_dict():\n m = SimpleModel(x=1)\n with pytest.warns(PydanticDeprecatedSince20, match=r'^The `dict` method is deprecated; use `model_dump` instead\\.'):\n assert m.dict() == {'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_json_test_json.with_pytest_warns_Pydanti.None_2.m_json_foo_4_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_json_test_json.with_pytest_warns_Pydanti.None_2.m_json_foo_4_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 619, "end_line": 632, "span_ids": ["test_json"], "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_json():\n m = SimpleModel(x=1)\n with pytest.warns(\n PydanticDeprecatedSince20, match=r'^The `json` method is deprecated; use `model_dump_json` instead\\.'\n ):\n assert m.json() == '{\"x\":1}'\n\n with pytest.warns(PydanticDeprecatedSince20):\n with pytest.raises(TypeError, match='The `encoder` argument is no longer supported'):\n m.json(encoder=1)\n with pytest.raises(TypeError, match='The `models_as_dict` argument is no longer supported'):\n m.json(models_as_dict=True)\n with pytest.raises(TypeError, match='`dumps_kwargs` keyword arguments are no longer supported.'):\n m.json(foo=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_validate_arguments.py_asyncio_validate_arguments.with_pytest_warns_.return.validate_arguments_deprec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_validate_arguments.py_asyncio_validate_arguments.with_pytest_warns_.return.validate_arguments_deprec", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_validate_arguments.py", "file_name": "test_deprecated_validate_arguments.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 20, "span_ids": ["validate_arguments", "imports"], "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": "import asyncio\nimport inspect\nfrom pathlib import Path\nfrom typing import List\n\nimport pytest\nfrom dirty_equals import IsInstance\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, Field, PydanticDeprecatedSince20, ValidationError\nfrom pydantic.deprecated.decorator import ValidatedFunction\nfrom pydantic.deprecated.decorator import validate_arguments as validate_arguments_deprecated\nfrom pydantic.errors import PydanticUserError\n\n\ndef validate_arguments(*args, **kwargs):\n with pytest.warns(\n PydanticDeprecatedSince20, match='^The `validate_arguments` method is deprecated; use `validate_call`'\n ):\n return validate_arguments_deprecated(*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/tests/test_discriminated_union.py_re_test_discriminated_union_type.with_pytest_raises_.Model.x.Field_discriminator_": {"__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_type.with_pytest_raises_.Model.x.Field_discriminator_", "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": 27, "span_ids": ["imports", "test_discriminated_union_type"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nimport sys\nfrom enum import Enum, IntEnum\nfrom types import SimpleNamespace\nfrom typing import Any, Callable, Generic, List, Optional, Sequence, TypeVar, Union\n\nimport pytest\nfrom dirty_equals import HasRepr, IsStr\nfrom pydantic_core import SchemaValidator, core_schema\nfrom typing_extensions import Annotated, Literal, TypedDict\n\nfrom pydantic import BaseModel, ConfigDict, Discriminator, Field, TypeAdapter, ValidationError, field_validator\nfrom pydantic._internal._discriminated_union import apply_discriminator\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\nfrom pydantic.errors import PydanticUserError\nfrom pydantic.fields import FieldInfo\nfrom pydantic.json_schema import GenerateJsonSchema\nfrom pydantic.types import Tag\n\n\ndef test_discriminated_union_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: str = Field(..., discriminator='qwe')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_single_variant_test_discriminated_single_variant.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_single_variant_test_discriminated_single_variant.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": 27, "end_line": 50, "span_ids": ["test_discriminated_single_variant"], "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": "@pytest.mark.parametrize('union', [True, False])\ndef test_discriminated_single_variant(union):\n class InnerModel(BaseModel):\n qwe: Literal['qwe']\n y: int\n\n class Model(BaseModel):\n if union:\n x: Union[InnerModel] = Field(..., discriminator='qwe')\n else:\n x: InnerModel = Field(..., discriminator='qwe')\n\n assert Model(x={'qwe': 'qwe', 'y': 1}).x.qwe == 'qwe'\n with pytest.raises(ValidationError) as exc_info:\n Model(x={'qwe': 'asd', 'y': 'a'}) # note: incorrect type of \"y\" is not reported due to discriminator failure\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': \"'qwe'\", 'expected_tags': \"'qwe'\", 'tag': 'asd'},\n 'input': {'qwe': 'asd', 'y': 'a'},\n 'loc': ('x',),\n 'msg': \"Input tag 'asd' found using 'qwe' does not match any of the expected \" \"tags: 'qwe'\",\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_single_variant_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_test_discriminated_union_single_variant_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": 53, "end_line": 100, "span_ids": ["test_discriminated_union_literal_discriminator", "test_discriminated_union_defined_discriminator", "test_discriminated_union_single_variant", "test_discriminated_union_invalid_type"], "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_discriminated_union_single_variant():\n class InnerModel(BaseModel):\n qwe: Literal['qwe']\n\n class Model(BaseModel):\n x: Union[InnerModel] = Field(..., discriminator='qwe')\n\n assert Model(x={'qwe': 'qwe'}).x.qwe == '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_invalid_alias_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_invalid_alias_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": 846, "end_line": 856, "span_ids": ["test_invalid_alias"], "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_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_wrapped_nullable_union.assert_discriminated_sche_test_wrapped_nullable_union.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_wrapped_nullable_union.assert_discriminated_sche_test_wrapped_nullable_union.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": 1052, "end_line": 1134, "span_ids": ["test_wrapped_nullable_union"], "tokens": 551}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 # ... other code\n assert discriminated_schema == {\n 'type': 'nullable',\n 'schema': {\n 'type': 'tagged-union',\n 'choices': {\n 'ant': {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {'type': 'typed-dict-field', 'schema': {'type': 'literal', 'expected': ['ant']}}\n },\n },\n 'cat': {\n 'type': 'function-wrap',\n 'function': {\n 'type': 'with-info',\n 'function': HasRepr(IsStr(regex=r'\\. at 0x[0-9a-fA-F]+>')),\n },\n 'schema': {\n 'type': 'nullable',\n 'schema': {\n 'type': 'union',\n 'choices': [\n {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {\n 'type': 'typed-dict-field',\n 'schema': {'type': 'literal', 'expected': ['cat']},\n }\n },\n },\n {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {\n 'type': 'typed-dict-field',\n 'schema': {'type': 'literal', 'expected': ['dog']},\n }\n },\n },\n ],\n },\n },\n },\n 'dog': {\n 'type': 'function-wrap',\n 'function': {\n 'type': 'with-info',\n 'function': HasRepr(IsStr(regex=r'\\. at 0x[0-9a-fA-F]+>')),\n },\n 'schema': {\n 'type': 'nullable',\n 'schema': {\n 'type': 'union',\n 'choices': [\n {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {\n 'type': 'typed-dict-field',\n 'schema': {'type': 'literal', 'expected': ['cat']},\n }\n },\n },\n {\n 'type': 'typed-dict',\n 'fields': {\n 'kind': {\n 'type': 'typed-dict-field',\n 'schema': {'type': 'literal', 'expected': ['dog']},\n }\n },\n },\n ],\n },\n },\n },\n },\n 'discriminator': 'kind',\n 'strict': False,\n 'from_attributes': True,\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_union_in_submodel_test_union_in_submodel._insert_assert_TestModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_in_submodel_test_union_in_submodel._insert_assert_TestModel", "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": 1137, "end_line": 1186, "span_ids": ["test_union_in_submodel"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_union_in_submodel() -> None:\n class UnionModel1(BaseModel):\n type: Literal[1] = 1\n other: Literal['UnionModel1'] = 'UnionModel1'\n\n class UnionModel2(BaseModel):\n type: Literal[2] = 2\n other: Literal['UnionModel2'] = 'UnionModel2'\n\n UnionModel = Annotated[Union[UnionModel1, UnionModel2], Field(discriminator='type')]\n\n class SubModel1(BaseModel):\n union_model: UnionModel\n\n class SubModel2(BaseModel):\n union_model: UnionModel\n\n class TestModel(BaseModel):\n submodel: Union[SubModel1, SubModel2]\n\n m = TestModel.model_validate({'submodel': {'union_model': {'type': 1}}})\n assert isinstance(m.submodel, SubModel1)\n assert isinstance(m.submodel.union_model, UnionModel1)\n\n m = TestModel.model_validate({'submodel': {'union_model': {'type': 2}}})\n assert isinstance(m.submodel, SubModel1)\n assert isinstance(m.submodel.union_model, UnionModel2)\n\n with pytest.raises(ValidationError) as exc_info:\n TestModel.model_validate({'submodel': {'union_model': {'type': 1, 'other': 'UnionModel2'}}})\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'literal_error',\n 'loc': ('submodel', 'SubModel1', 'union_model', 1, 'other'),\n 'msg': \"Input should be 'UnionModel1'\",\n 'input': 'UnionModel2',\n 'ctx': {'expected': \"'UnionModel1'\"},\n },\n {\n 'type': 'literal_error',\n 'loc': ('submodel', 'SubModel2', 'union_model', 1, 'other'),\n 'msg': \"Input should be 'UnionModel1'\",\n 'input': 'UnionModel2',\n 'ctx': {'expected': \"'UnionModel1'\"},\n },\n ]\n\n # insert_assert(TestModel.model_json_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_discriminated_union.py_test_union_in_submodel.assert_TestModel_model_js_test_union_in_submodel.assert_TestModel_model_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_union_in_submodel.assert_TestModel_model_js_test_union_in_submodel.assert_TestModel_model_js", "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": 1198, "end_line": 1265, "span_ids": ["test_union_in_submodel"], "tokens": 586}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_union_in_submodel() -> None:\n # ... other code\n assert TestModel.model_json_schema() == {\n '$defs': {\n 'SubModel1': {\n 'properties': {\n 'union_model': {\n 'discriminator': {\n 'mapping': {'1': '#/$defs/UnionModel1', '2': '#/$defs/UnionModel2'},\n 'propertyName': 'type',\n },\n 'oneOf': [{'$ref': '#/$defs/UnionModel1'}, {'$ref': '#/$defs/UnionModel2'}],\n 'title': 'Union Model',\n }\n },\n 'required': ['union_model'],\n 'title': 'SubModel1',\n 'type': 'object',\n },\n 'SubModel2': {\n 'properties': {\n 'union_model': {\n 'discriminator': {\n 'mapping': {'1': '#/$defs/UnionModel1', '2': '#/$defs/UnionModel2'},\n 'propertyName': 'type',\n },\n 'oneOf': [{'$ref': '#/$defs/UnionModel1'}, {'$ref': '#/$defs/UnionModel2'}],\n 'title': 'Union Model',\n }\n },\n 'required': ['union_model'],\n 'title': 'SubModel2',\n 'type': 'object',\n },\n 'UnionModel1': {\n 'properties': {\n 'type': {'const': 1, 'default': 1, 'enum': [1], 'title': 'Type', 'type': 'integer'},\n 'other': {\n 'const': 'UnionModel1',\n 'default': 'UnionModel1',\n 'enum': ['UnionModel1'],\n 'title': 'Other',\n 'type': 'string',\n },\n },\n 'title': 'UnionModel1',\n 'type': 'object',\n },\n 'UnionModel2': {\n 'properties': {\n 'type': {'const': 2, 'default': 2, 'enum': [2], 'title': 'Type', 'type': 'integer'},\n 'other': {\n 'const': 'UnionModel2',\n 'default': 'UnionModel2',\n 'enum': ['UnionModel2'],\n 'title': 'Other',\n 'type': 'string',\n },\n },\n 'title': 'UnionModel2',\n 'type': 'object',\n },\n },\n 'properties': {\n 'submodel': {'anyOf': [{'$ref': '#/$defs/SubModel1'}, {'$ref': '#/$defs/SubModel2'}], 'title': 'Submodel'}\n },\n 'required': ['submodel'],\n 'title': 'TestModel',\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_discriminated_union.py_test_function_after_discriminator_test_function_after_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_function_after_discriminator_test_function_after_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": 1245, "end_line": 1281, "span_ids": ["test_function_after_discriminator"], "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_function_after_discriminator():\n class CatModel(BaseModel):\n name: Literal['kitty', 'cat']\n\n @field_validator('name', mode='after')\n def replace_name(cls, v):\n return 'cat'\n\n class DogModel(BaseModel):\n name: Literal['puppy', 'dog']\n\n # comment out the 2 field validators and model will work!\n @field_validator('name', mode='after')\n def replace_name(cls, v):\n return 'dog'\n\n AllowedAnimal = Annotated[Union[CatModel, DogModel], Field(discriminator='name')]\n\n class Model(BaseModel):\n x: AllowedAnimal\n\n m = Model(x={'name': 'kitty'})\n assert m.x.name == 'cat'\n\n # Ensure a discriminated union is actually being used during validation\n with pytest.raises(ValidationError) as exc_info:\n Model(x={'name': 'invalid'})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': \"'name'\", 'expected_tags': \"'kitty', 'cat', 'puppy', 'dog'\", 'tag': 'invalid'},\n 'input': {'name': 'invalid'},\n 'loc': ('x',),\n 'msg': \"Input tag 'invalid' found using 'name' does not match any of the \"\n \"expected tags: 'kitty', 'cat', 'puppy', '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_sequence_discriminated_union_test_sequence_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_discriminated_union.py_test_sequence_discriminated_union_test_sequence_discriminated_union.assert_Model_model_json_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": 1307, "end_line": 1379, "span_ids": ["test_sequence_discriminated_union"], "tokens": 586}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_sequence_discriminated_union():\n class Cat(BaseModel):\n pet_type: Literal['cat']\n meows: int\n\n class Dog(BaseModel):\n pet_type: Literal['dog']\n barks: float\n\n class Lizard(BaseModel):\n pet_type: Literal['reptile', 'lizard']\n scales: bool\n\n Pet = Annotated[Union[Cat, Dog, Lizard], Field(discriminator='pet_type')]\n\n class Model(BaseModel):\n pet: Sequence[Pet]\n n: int\n\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'Cat': {\n 'properties': {\n 'pet_type': {'const': 'cat', 'enum': ['cat'], 'title': 'Pet Type', 'type': 'string'},\n 'meows': {'title': 'Meows', 'type': 'integer'},\n },\n 'required': ['pet_type', 'meows'],\n 'title': 'Cat',\n 'type': 'object',\n },\n 'Dog': {\n 'properties': {\n 'pet_type': {'const': 'dog', 'enum': ['dog'], 'title': 'Pet Type', 'type': 'string'},\n 'barks': {'title': 'Barks', 'type': 'number'},\n },\n 'required': ['pet_type', 'barks'],\n 'title': 'Dog',\n 'type': 'object',\n },\n 'Lizard': {\n 'properties': {\n 'pet_type': {'enum': ['reptile', 'lizard'], 'title': 'Pet Type', 'type': 'string'},\n 'scales': {'title': 'Scales', 'type': 'boolean'},\n },\n 'required': ['pet_type', 'scales'],\n 'title': 'Lizard',\n 'type': 'object',\n },\n },\n 'properties': {\n 'pet': {\n 'items': {\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': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}, {'$ref': '#/$defs/Lizard'}],\n },\n 'title': 'Pet',\n 'type': 'array',\n },\n 'n': {'title': 'N', 'type': 'integer'},\n },\n 'required': ['pet', '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_discriminated_union.py_callable_discriminated_union_animals_shared_pet_discriminator_value.return.get_discriminator_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_callable_discriminated_union_animals_shared_pet_discriminator_value.return.get_discriminator_value", "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": 1358, "end_line": 1383, "span_ids": ["shared_pet_discriminator_value", "callable_discriminated_union_animals"], "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.fixture(scope='session', name='animals')\ndef callable_discriminated_union_animals() -> SimpleNamespace:\n class Cat(BaseModel):\n pet_type: Literal['cat'] = 'cat'\n\n class Dog(BaseModel):\n pet_kind: Literal['dog'] = 'dog'\n\n class Fish(BaseModel):\n pet_kind: Literal['fish'] = 'fish'\n\n class Lizard(BaseModel):\n pet_variety: Literal['lizard'] = 'lizard'\n\n animals = SimpleNamespace(cat=Cat, dog=Dog, fish=Fish, lizard=Lizard)\n return animals\n\n\n@pytest.fixture(scope='session', name='get_pet_discriminator_value')\ndef shared_pet_discriminator_value() -> Callable[[Any], str]:\n def get_discriminator_value(v):\n if isinstance(v, dict):\n return v.get('pet_type', v.get('pet_kind'))\n return getattr(v, 'pet_type', getattr(v, 'pet_kind', None))\n\n return get_discriminator_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_discriminated_union.py_test_callable_discriminated_union_with_type_adapter_test_callable_discriminated_union_with_type_adapter.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_with_type_adapter_test_callable_discriminated_union_with_type_adapter.None_9", "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": 1400, "end_line": 1469, "span_ids": ["test_callable_discriminated_union_with_type_adapter"], "tokens": 695}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_callable_discriminated_union_with_type_adapter(\n animals: SimpleNamespace, get_pet_discriminator_value: Callable[[Any], str]\n) -> None:\n pet_adapter = TypeAdapter(\n Annotated[\n Union[Annotated[animals.cat, Tag('cat')], Annotated[animals.dog, Tag('dog')]],\n Discriminator(get_pet_discriminator_value),\n ]\n )\n\n assert pet_adapter.validate_python({'pet_type': 'cat'}).pet_type == 'cat'\n assert pet_adapter.validate_python({'pet_kind': 'dog'}).pet_kind == 'dog'\n assert pet_adapter.validate_python(animals.cat()).pet_type == 'cat'\n assert pet_adapter.validate_python(animals.dog()).pet_kind == 'dog'\n assert pet_adapter.validate_json('{\"pet_type\":\"cat\"}').pet_type == 'cat'\n assert pet_adapter.validate_json('{\"pet_kind\":\"dog\"}').pet_kind == 'dog'\n\n # Unexpected discriminator value for dict\n with pytest.raises(ValidationError) as exc_info:\n pet_adapter.validate_python({'pet_kind': 'fish'})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()', 'expected_tags': \"'cat', 'dog'\", 'tag': 'fish'},\n 'input': {'pet_kind': 'fish'},\n 'loc': (),\n 'msg': \"Input tag 'fish' found using get_discriminator_value() does not \"\n \"match any of the expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n # Missing discriminator key for dict\n with pytest.raises(ValidationError) as exc_info:\n pet_adapter.validate_python({'pet_variety': 'lizard'})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()'},\n 'input': {'pet_variety': 'lizard'},\n 'loc': (),\n 'msg': 'Unable to extract tag using discriminator get_discriminator_value()',\n 'type': 'union_tag_not_found',\n }\n ]\n\n # Unexpected discriminator value for instance\n with pytest.raises(ValidationError) as exc_info:\n pet_adapter.validate_python(animals.fish())\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()', 'expected_tags': \"'cat', 'dog'\", 'tag': 'fish'},\n 'input': animals.fish(pet_kind='fish'),\n 'loc': (),\n 'msg': \"Input tag 'fish' found using get_discriminator_value() does not \"\n \"match any of the expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n # Missing discriminator key for instance\n with pytest.raises(ValidationError) as exc_info:\n pet_adapter.validate_python(animals.lizard())\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()'},\n 'input': animals.lizard(pet_variety='lizard'),\n 'loc': (),\n 'msg': 'Unable to extract tag using discriminator get_discriminator_value()',\n 'type': 'union_tag_not_found',\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_various_syntax_options_for_callable_union_test_various_syntax_options_for_callable_union.models._PetModelField_PetModelA": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_various_syntax_options_for_callable_union_test_various_syntax_options_for_callable_union.models._PetModelField_PetModelA", "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": 1472, "end_line": 1492, "span_ids": ["test_various_syntax_options_for_callable_union"], "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_various_syntax_options_for_callable_union(\n animals: SimpleNamespace, get_pet_discriminator_value: Callable[[Any], str]\n) -> None:\n class PetModelField(BaseModel):\n pet: Union[Annotated[animals.cat, Tag('cat')], Annotated[animals.dog, Tag('dog')]] = Field(\n discriminator=Discriminator(get_pet_discriminator_value)\n )\n\n class PetModelAnnotated(BaseModel):\n pet: Annotated[\n Union[Annotated[animals.cat, Tag('cat')], Annotated[animals.dog, Tag('dog')]],\n Discriminator(get_pet_discriminator_value),\n ]\n\n class PetModelAnnotatedWithField(BaseModel):\n pet: Annotated[\n Union[Annotated[animals.cat, Tag('cat')], Annotated[animals.dog, Tag('dog')]],\n Field(discriminator=Discriminator(get_pet_discriminator_value)),\n ]\n\n models = [PetModelField, PetModelAnnotated, PetModelAnnotatedWithField]\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_various_syntax_options_for_callable_union.for_model_in_models__test_various_syntax_options_for_callable_union.for_model_in_models_.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_various_syntax_options_for_callable_union.for_model_in_models__test_various_syntax_options_for_callable_union.for_model_in_models_.None_9", "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": 1480, "end_line": 1540, "span_ids": ["test_various_syntax_options_for_callable_union"], "tokens": 688}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_various_syntax_options_for_callable_union(\n animals: SimpleNamespace, get_pet_discriminator_value: Callable[[Any], str]\n) -> None:\n # ... other code\n\n for model in models:\n assert model.model_validate({'pet': {'pet_type': 'cat'}}).pet.pet_type == 'cat'\n assert model.model_validate({'pet': {'pet_kind': 'dog'}}).pet.pet_kind == 'dog'\n assert model(pet=animals.cat()).pet.pet_type == 'cat'\n assert model(pet=animals.dog()).pet.pet_kind == 'dog'\n assert model.model_validate_json('{\"pet\": {\"pet_type\":\"cat\"}}').pet.pet_type == 'cat'\n assert model.model_validate_json('{\"pet\": {\"pet_kind\":\"dog\"}}').pet.pet_kind == 'dog'\n\n # Unexpected discriminator value for dict\n with pytest.raises(ValidationError) as exc_info:\n model.model_validate({'pet': {'pet_kind': 'fish'}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()', 'expected_tags': \"'cat', 'dog'\", 'tag': 'fish'},\n 'input': {'pet_kind': 'fish'},\n 'loc': ('pet',),\n 'msg': \"Input tag 'fish' found using get_discriminator_value() does not \"\n \"match any of the expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n # Missing discriminator key for dict\n with pytest.raises(ValidationError) as exc_info:\n model.model_validate({'pet': {'pet_variety': 'lizard'}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()'},\n 'input': {'pet_variety': 'lizard'},\n 'loc': ('pet',),\n 'msg': 'Unable to extract tag using discriminator get_discriminator_value()',\n 'type': 'union_tag_not_found',\n }\n ]\n\n # Unexpected discriminator value for instance\n with pytest.raises(ValidationError) as exc_info:\n model(pet=animals.fish())\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()', 'expected_tags': \"'cat', 'dog'\", 'tag': 'fish'},\n 'input': animals.fish(pet_kind='fish'),\n 'loc': ('pet',),\n 'msg': \"Input tag 'fish' found using get_discriminator_value() does not \"\n \"match any of the expected tags: 'cat', 'dog'\",\n 'type': 'union_tag_invalid',\n }\n ]\n\n # Missing discriminator key for instance\n with pytest.raises(ValidationError) as exc_info:\n model(pet=animals.lizard())\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'get_discriminator_value()'},\n 'input': animals.lizard(pet_variety='lizard'),\n 'loc': ('pet',),\n 'msg': 'Unable to extract tag using discriminator get_discriminator_value()',\n 'type': 'union_tag_not_found',\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_docs.py_test_docstrings_examples_set_cwd.try_.finally_.os_chdir_cwd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs.py_test_docstrings_examples_set_cwd.try_.finally_.os_chdir_cwd_", "embedding": null, "metadata": {"file_path": "tests/test_docs.py", "file_name": "test_docs.py", "file_type": "text/x-python", "category": "test", "start_line": 145, "end_line": 165, "span_ids": ["set_cwd", "test_docstrings_examples"], "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.filterwarnings('ignore:(parse_obj_as|schema_json_of|schema_of) is deprecated.*:DeprecationWarning')\n@pytest.mark.skipif(bool(skip_reason), reason=skip_reason or 'not skipping')\n@pytest.mark.parametrize('example', find_examples(str(SOURCES_ROOT), skip=sys.platform == 'win32'), ids=str)\ndef test_docstrings_examples(example: CodeExample, eval_example: EvalExample, tmp_path: Path, mocker):\n if str(example.path).startswith(str(SOURCES_ROOT / 'v1')):\n pytest.skip('skip v1 examples')\n\n run_example(example, eval_example, mocker)\n\n\n@pytest.fixture(scope='module', autouse=True)\ndef set_cwd():\n # `test_docs_examples` needs to be run from this folder or relative paths will be wrong and some tests fail\n execution_path = str(DOCS_ROOT.parent)\n\n cwd = os.getcwd()\n os.chdir(execution_path)\n try:\n yield\n finally:\n os.chdir(cwd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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.__init__.self.t2.t2": {"__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.__init__.self.t2.t2", "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": 1492, "end_line": 1507, "span_ids": ["DisplayGen.__init__", "test_field_str_shape", "DisplayGen", "impl"], "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_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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_rf_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_rf_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": 1510, "end_line": 1544, "span_ids": ["test_field_type_display"], "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": "@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(rf'\\(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_custom_generic_validators.MyGen.__get_pydantic_core_schema__.validate_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.return.core_schema_with_info_aft": {"__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.MyGen.__get_pydantic_core_schema__.validate_test_custom_generic_validators.MyGen.__get_pydantic_core_schema__.return.core_schema_with_info_aft", "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": 1911, "end_line": 1928, "span_ids": ["test_custom_generic_validators"], "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_generic_validators():\n\n class MyGen(Generic[T1, T2]):\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: Any, handler: GetCoreSchemaHandler):\n # ... other code\n\n def validate(v, _info):\n if not args:\n return v\n try:\n v.t1 = t1_f(v.t1)\n except ValidationError as exc:\n raise ValidationError.from_exception_data(\n exc.title, [convert_to_init_error(e, 't1') for e in exc.errors()]\n ) from exc\n try:\n v.t2 = t2_f(v.t2)\n except ValidationError as exc:\n raise ValidationError.from_exception_data(\n exc.title, [convert_to_init_error(e, 't2') for e in exc.errors()]\n ) from exc\n return v\n\n return core_schema.with_info_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_generic_wrapped_forwardref_test_generic_wrapped_forwardref.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_generic_wrapped_forwardref_test_generic_wrapped_forwardref.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": 2382, "end_line": 2403, "span_ids": ["test_generic_wrapped_forwardref"], "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_generic_wrapped_forwardref():\n class Operation(BaseModel):\n callbacks: 'list[PathItem]'\n\n class PathItem(BaseModel):\n pass\n\n Operation.model_rebuild()\n\n Operation.model_validate({'callbacks': [PathItem()]})\n with pytest.raises(ValidationError) as exc_info:\n Operation.model_validate({'callbacks': [1]})\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('callbacks', 0),\n 'msg': 'Input should be a valid dictionary or instance of PathItem',\n 'input': 1,\n 'ctx': {'class_name': 'PathItem'},\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_plain_basemodel_field_test_plain_basemodel_field.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_plain_basemodel_field_test_plain_basemodel_field.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": 2401, "end_line": 2420, "span_ids": ["test_plain_basemodel_field"], "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_plain_basemodel_field():\n class Model(BaseModel):\n x: BaseModel\n\n class Model2(BaseModel):\n pass\n\n assert Model(x=Model2()).x == Model2()\n with pytest.raises(ValidationError) as exc_info:\n Model(x=1)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': ('x',),\n 'msg': 'Input should be a valid dictionary or instance of BaseModel',\n 'input': 1,\n 'ctx': {'class_name': 'BaseModel'},\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_sequences_str_test_sequences_str.assert_e_value_errors_inc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_sequences_str_test_sequences_str.assert_e_value_errors_inc", "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": 2478, "end_line": 2519, "span_ids": ["test_sequences_str"], "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 ('sequence_type', 'input_data', 'expected_error_type', 'expected_error_msg', 'expected_error_ctx'),\n [\n pytest.param(List[str], '1bc', 'list_type', 'Input should be a valid list', None, id='list[str]'),\n pytest.param(\n Sequence[str],\n '1bc',\n 'sequence_str',\n \"'str' instances are not allowed as a Sequence value\",\n {'type_name': 'str'},\n id='Sequence[str]',\n ),\n pytest.param(\n Sequence[bytes],\n b'1bc',\n 'sequence_str',\n \"'bytes' instances are not allowed as a Sequence value\",\n {'type_name': 'bytes'},\n id='Sequence[bytes]',\n ),\n ],\n)\ndef test_sequences_str(sequence_type, input_data, expected_error_type, expected_error_msg, expected_error_ctx):\n input_sequence = [input_data[:1], input_data[1:]]\n expected_error = {\n 'type': expected_error_type,\n 'input': input_data,\n 'loc': ('str_sequence',),\n 'msg': expected_error_msg,\n }\n if expected_error_ctx is not None:\n expected_error.update(ctx=expected_error_ctx)\n\n class Model(BaseModel):\n str_sequence: sequence_type\n\n assert Model(str_sequence=input_sequence).str_sequence == input_sequence\n\n with pytest.raises(ValidationError) as e:\n Model(str_sequence=input_data)\n\n assert e.value.errors(include_url=False) == [expected_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_edge_cases.py_test_multiple_enums_test_union_literal_with_other_type.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_multiple_enums_test_union_literal_with_other_type.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": 2522, "end_line": 2553, "span_ids": ["test_union_literal_with_other_type", "test_multiple_enums"], "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_multiple_enums():\n \"\"\"See https://github.com/pydantic/pydantic/issues/6270\"\"\"\n\n class MyEnum(Enum):\n a = auto()\n\n class MyModel(TypedDict):\n a: Optional[MyEnum]\n b: Optional[MyEnum]\n\n TypeAdapter(MyModel)\n\n\n@pytest.mark.parametrize(\n ('literal_type', 'other_type', 'data', 'json_value', 'data_reversed', 'json_value_reversed'),\n [\n (Literal[False], str, False, 'false', False, 'false'),\n (Literal[True], str, True, 'true', True, 'true'),\n (Literal[False], str, 'abc', '\"abc\"', 'abc', '\"abc\"'),\n (Literal[False], int, False, 'false', False, 'false'),\n (Literal[True], int, True, 'true', True, 'true'),\n (Literal[False], int, 42, '42', 42, '42'),\n ],\n)\ndef test_union_literal_with_other_type(literal_type, other_type, data, json_value, data_reversed, json_value_reversed):\n class Model(BaseModel):\n value: Union[literal_type, other_type]\n value_types_reversed: Union[other_type, literal_type]\n\n m = Model(value=data, value_types_reversed=data)\n assert m.model_dump() == {'value': data, 'value_types_reversed': data_reversed}\n assert m.model_dump_json() == f'{{\"value\":{json_value},\"value_types_reversed\":{json_value_reversed}}}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_union_test_model_repr_before_validation.assert_log_before_My": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_type_union_test_model_repr_before_validation.assert_log_before_My", "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": 2556, "end_line": 2580, "span_ids": ["test_type_union", "test_model_repr_before_validation"], "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_type_union():\n class Model(BaseModel):\n a: Type[Union[str, bytes]]\n b: Type[Union[Any, str]]\n\n m = Model(a=bytes, b=int)\n assert m.model_dump() == {'a': bytes, 'b': int}\n assert m.a == bytes\n\n\ndef test_model_repr_before_validation():\n log = []\n\n class MyModel(BaseModel):\n x: int\n\n def __init__(self, **kwargs):\n log.append(f'before={self!r}')\n super().__init__(**kwargs)\n log.append(f'after={self!r}')\n\n m = MyModel(x='10')\n assert m.x == 10\n # insert_assert(log)\n assert log == ['before=MyModel()', 'after=MyModel(x=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_edge_cases.py_test_custom_exception_handler_test_custom_exception_handler.assert_len_traceback_exce": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_custom_exception_handler_test_custom_exception_handler.assert_len_traceback_exce", "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": 2583, "end_line": 2615, "span_ids": ["test_custom_exception_handler"], "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_custom_exception_handler():\n from traceback import TracebackException\n\n from pydantic import BaseModel\n\n traceback_exceptions = []\n\n class MyModel(BaseModel):\n name: str\n\n class CustomErrorCatcher:\n def __enter__(self):\n return None\n\n def __exit__(self, _exception_type, exception, exception_traceback):\n if exception is not None:\n traceback_exceptions.append(\n TracebackException(\n exc_type=type(exception),\n exc_value=exception,\n exc_traceback=exception_traceback,\n capture_locals=True,\n )\n )\n\n return True\n return False\n\n with CustomErrorCatcher():\n data = {'age': 'John Doe'}\n MyModel(**data)\n\n assert len(traceback_exceptions) == 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_recursive_walk_fails_on_double_diamond_composition_test_recursive_walk_fails_on_double_diamond_composition.assert_E_c_C_b_B_a_1_A_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_recursive_walk_fails_on_double_diamond_composition_test_recursive_walk_fails_on_double_diamond_composition.assert_E_c_C_b_B_a_1_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": 2618, "end_line": 2637, "span_ids": ["test_recursive_walk_fails_on_double_diamond_composition"], "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_recursive_walk_fails_on_double_diamond_composition():\n class A(BaseModel):\n pass\n\n class B(BaseModel):\n a_1: A\n a_2: A\n\n class C(BaseModel):\n b: B\n\n class D(BaseModel):\n c_1: C\n c_2: C\n\n class E(BaseModel):\n c: C\n\n # This is just to check that above model contraption doesn't fail\n assert E(c=C(b=B(a_1=A(), a_2=A()))).model_dump() == {'c': {'b': {'a_1': {}, '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_exports.py_importlib_test_public_api_dynamic_imports.if_module_name___modu.else_.assert_isinstance_importe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py_importlib_test_public_api_dynamic_imports.if_module_name___modu.else_.assert_isinstance_importe", "embedding": null, "metadata": {"file_path": "tests/test_exports.py", "file_name": "test_exports.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports", "test_init_export", "test_public_api_dynamic_imports"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import importlib\nimport importlib.util\nimport json\nimport platform\nimport sys\nfrom pathlib import Path\nfrom types import ModuleType\n\nimport pytest\n\nimport pydantic\n\n\n@pytest.mark.filterwarnings('ignore::DeprecationWarning')\ndef test_init_export():\n for name in dir(pydantic):\n getattr(pydantic, name)\n\n\n@pytest.mark.filterwarnings('ignore::DeprecationWarning')\n@pytest.mark.parametrize(('attr_name', 'value'), list(pydantic._dynamic_imports.items()))\ndef test_public_api_dynamic_imports(attr_name, value):\n package, module_name = value\n if module_name == '__module__':\n module = importlib.import_module(attr_name, package=package)\n assert isinstance(module, ModuleType)\n else:\n imported_object = getattr(importlib.import_module(module_name, package=package), attr_name)\n assert isinstance(imported_object, 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_exports.py_test_public_internal_test_public_internal.if_public_internal_attrib.pytest_fail_The_followin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py_test_public_internal_test_public_internal.if_public_internal_attrib.pytest_fail_The_followin", "embedding": null, "metadata": {"file_path": "tests/test_exports.py", "file_name": "test_exports.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 62, "span_ids": ["test_public_internal"], "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": "@pytest.mark.skipif(\n platform.python_implementation() == 'PyPy' and platform.python_version_tuple() < ('3', '8'),\n reason='Produces a weird error on pypy<3.8',\n)\n@pytest.mark.filterwarnings('ignore::DeprecationWarning')\ndef test_public_internal():\n \"\"\"\n check we don't make anything from _internal public\n \"\"\"\n public_internal_attributes = []\n for file in (Path(__file__).parent.parent / 'pydantic').glob('*.py'):\n if file.name != '__init__.py' and not file.name.startswith('_'):\n module_name = f'pydantic.{file.stem}'\n module = sys.modules.get(module_name)\n if module is None:\n spec = importlib.util.spec_from_file_location(module_name, str(file))\n module = importlib.util.module_from_spec(spec)\n try:\n spec.loader.exec_module(module)\n except ImportError:\n continue\n\n for name, attr in vars(module).items():\n if not name.startswith('_'):\n attr_module = getattr(attr, '__module__', '')\n if attr_module.startswith('pydantic._internal'):\n public_internal_attributes.append(f'{module.__name__}:{name} from {attr_module}')\n\n if public_internal_attributes:\n pytest.fail('The following should not be publicly accessible:\\n ' + '\\n '.join(public_internal_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/tests/test_forward_ref.py_test_recursive_models_union_test_recursive_models_union.assert_module_Bar_model_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_recursive_models_union_test_recursive_models_union.assert_module_Bar_model_f", "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": 710, "end_line": 740, "span_ids": ["test_recursive_models_union"], "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.skipif(sys.version_info < (3, 10), reason='needs 3.10 or newer')\ndef test_recursive_models_union(create_module):\n # This test should pass because PydanticRecursiveRef.__or__ is implemented,\n # not because `eval_type_backport` magically makes `|` work,\n # since it's installed for tests but otherwise optional.\n sys.modules['eval_type_backport'] = None # type: ignore\n try:\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\n\nfrom pydantic import BaseModel\nfrom typing import TypeVar, Generic\n\nT = TypeVar(\"T\")\n\nclass Foo(BaseModel):\n bar: Bar[str] | None = None\n bar2: int | Bar[float]\n\nclass Bar(BaseModel, Generic[T]):\n foo: Foo\n \"\"\"\n )\n finally:\n del sys.modules['eval_type_backport']\n\n assert module.Foo.model_fields['bar'].annotation == typing.Optional[module.Bar[str]]\n assert module.Foo.model_fields['bar2'].annotation == typing.Union[int, module.Bar[float]]\n assert module.Bar.model_fields['foo'].annotation == module.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_forward_ref.py_test_rebuild_recursive_schema_test_rebuild_recursive_schema.for_m_in_models_.m_model_rebuild__types_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_rebuild_recursive_schema_test_rebuild_recursive_schema.for_m_in_models_.m_model_rebuild__types_na", "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": 969, "end_line": 1000, "span_ids": ["test_rebuild_recursive_schema"], "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_rebuild_recursive_schema():\n from typing import ForwardRef, List\n\n class Expressions_(BaseModel):\n model_config = dict(undefined_types_warning=False)\n items: List[\"types['Expression']\"]\n\n class Expression_(BaseModel):\n model_config = dict(undefined_types_warning=False)\n Or: ForwardRef(\"types['allOfExpressions']\")\n Not: ForwardRef(\"types['allOfExpression']\")\n\n class allOfExpression_(BaseModel):\n model_config = dict(undefined_types_warning=False)\n Not: ForwardRef(\"types['Expression']\")\n\n class allOfExpressions_(BaseModel):\n model_config = dict(undefined_types_warning=False)\n items: List[\"types['Expression']\"]\n\n types_namespace = {\n 'types': {\n 'Expression': Expression_,\n 'Expressions': Expressions_,\n 'allOfExpression': allOfExpression_,\n 'allOfExpressions': allOfExpressions_,\n }\n }\n\n models = [allOfExpressions_, Expressions_]\n for m in models:\n m.model_rebuild(_types_namespace=types_namespace)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_in_generic_": {"__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_in_generic_", "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": 1003, "end_line": 1047, "span_ids": ["test_forward_ref_in_generic", "test_forward_ref_in_generic_separate_modules"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_forward_ref_in_generic(create_module: Any) -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6503\"\"\"\n\n @create_module\n def module():\n import typing as tp\n\n from pydantic import BaseModel\n\n class Foo(BaseModel):\n x: tp.Dict['tp.Type[Bar]', tp.Type['Bar']]\n\n class Bar(BaseModel):\n pass\n\n Foo = module.Foo\n Bar = module.Bar\n\n assert Foo(x={Bar: Bar}).x[Bar] is Bar\n\n\ndef test_forward_ref_in_generic_separate_modules(create_module: Any) -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6503\"\"\"\n\n @create_module\n def module_1():\n import typing as tp\n\n from pydantic import BaseModel\n\n class Foo(BaseModel):\n x: tp.Dict['tp.Type[Bar]', tp.Type['Bar']]\n\n @create_module\n def module_2():\n from pydantic import BaseModel\n\n class Bar(BaseModel):\n pass\n\n Foo = module_1.Foo\n Bar = module_2.Bar\n Foo.model_rebuild(_types_namespace={'tp': typing, 'Bar': Bar})\n assert Foo(x={Bar: Bar}).x[Bar] is 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_generics.py_test_circular_generic_refs_get_cleaned_up_test_circular_generic_refs_get_cleaned_up.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_circular_generic_refs_get_cleaned_up_test_circular_generic_refs_get_cleaned_up.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": 423, "end_line": 449, "span_ids": ["test_circular_generic_refs_get_cleaned_up"], "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.skipif(platform.python_implementation() == 'PyPy', reason='PyPy does not play nice with PyO3 gc')\n@pytest.mark.skipif(sys.version_info[:2] == (3, 9), reason='The test randomly fails on Python 3.9')\ndef test_circular_generic_refs_get_cleaned_up():\n initial_cache_size = len(_GENERIC_TYPES_CACHE)\n\n def fn():\n T = TypeVar('T')\n C = TypeVar('C')\n\n class Inner(BaseModel, Generic[T, C]):\n a: T\n b: C\n\n class Outer(BaseModel, Generic[C]):\n c: Inner[int, C]\n\n klass = Outer[str]\n assert len(_GENERIC_TYPES_CACHE) > initial_cache_size\n assert klass in _GENERIC_TYPES_CACHE.values()\n\n fn()\n\n gc.collect(0)\n gc.collect(1)\n gc.collect(2)\n\n assert len(_GENERIC_TYPES_CACHE) == initial_cache_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_partial_specification_with_inner_typevar_test_partial_specification_with_inner_typevar.assert_nested_resolved_b_": {"__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_with_inner_typevar.assert_nested_resolved_b_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 762, "end_line": 779, "span_ids": ["test_partial_specification_with_inner_typevar"], "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_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_metadata__['parameters']\n concrete_model = partial_model[int]\n\n assert not concrete_model.__pydantic_generic_metadata__['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]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_name_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_name_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": 782, "end_line": 794, "span_ids": ["test_partial_specification_name"], "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": "@pytest.mark.skipif(sys.version_info < (3, 12), reason='repr different on older versions')\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, TypeVar]'\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_replace_types_with_user_defined_generic_type_field_test_replace_types_with_user_defined_generic_type_field.CustomSet.__get_pydantic_core_schema__.return.core_schema_no_info_after": {"__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.CustomSet.__get_pydantic_core_schema__.return.core_schema_no_info_after", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1164, "end_line": 1233, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "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 test_replace_types_with_user_defined_generic_type_field(): # noqa: C901\n \"\"\"Test that using user defined generic types as generic model fields are handled correctly.\"\"\"\n T = TypeVar('T')\n KT = TypeVar('KT')\n VT = TypeVar('VT')\n\n class CustomCounter(Counter[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(Counter[get_args(source_type)[0]]))\n\n class CustomDefaultDict(DefaultDict[KT, VT]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n keys_type, values_type = get_args(source_type)\n return core_schema.no_info_after_validator_function(\n lambda x: cls(x.default_factory, x), handler(DefaultDict[keys_type, values_type])\n )\n\n class CustomDeque(Deque[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(Deque[get_args(source_type)[0]]))\n\n class CustomDict(Dict[KT, VT]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n keys_type, values_type = get_args(source_type)\n return core_schema.no_info_after_validator_function(cls, handler(Dict[keys_type, values_type]))\n\n class CustomFrozenset(FrozenSet[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(FrozenSet[get_args(source_type)[0]]))\n\n class CustomIterable(Iterable[T]):\n def __init__(self, iterable):\n self.iterable = iterable\n\n def __iter__(self):\n return self\n\n def __next__(self):\n return next(self.iterable)\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(Iterable[get_args(source_type)[0]]))\n\n class CustomList(List[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(List[get_args(source_type)[0]]))\n\n class CustomMapping(Mapping[KT, VT]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n keys_type, values_type = get_args(source_type)\n return handler(Mapping[keys_type, values_type])\n\n class CustomOrderedDict(OrderedDict[KT, VT]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n keys_type, values_type = get_args(source_type)\n return core_schema.no_info_after_validator_function(cls, handler(OrderedDict[keys_type, values_type]))\n\n class CustomSet(Set[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(Set[get_args(source_type)[0]]))\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_replace_types_with_user_defined_generic_type_field.CustomTuple_test_replace_types_with_user_defined_generic_type_field.CustomLongTuple.__get_pydantic_core_schema__.return.core_schema_no_info_after": {"__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.CustomTuple_test_replace_types_with_user_defined_generic_type_field.CustomLongTuple.__get_pydantic_core_schema__.return.core_schema_no_info_after", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1235, "end_line": 1243, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "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_replace_types_with_user_defined_generic_type_field():\n # ... other code\n\n class CustomTuple(Tuple[T]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(Tuple[get_args(source_type)[0]]))\n\n class CustomLongTuple(Tuple[T, VT]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(cls, handler(Tuple[get_args(source_type)]))\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_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.long_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.long_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": 1245, "end_line": 1257, "span_ids": ["test_replace_types_with_user_defined_generic_type_field"], "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_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 set_field: CustomSet[T]\n tuple_field: CustomTuple[T]\n long_tuple_field: CustomLongTuple[T, VT]\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_with_referenced_generic_union_type_bound_test_generic_with_callable.assert_Model___pydantic_g": {"__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_union_type_bound_test_generic_with_callable.assert_Model___pydantic_g", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1515, "end_line": 1568, "span_ids": ["test_generic_with_referenced_generic_type_constraints", "test_generic_with_referenced_nested_typevar", "test_generic_with_callable", "test_generic_with_referenced_generic_union_type_bound"], "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_generic_with_referenced_generic_union_type_bound():\n T = TypeVar('T', bound=Union[str, int])\n\n class ModelWithType(BaseModel, Generic[T]):\n some_type: Type[T]\n\n class MyInt(int):\n ...\n\n class MyStr(str):\n ...\n\n ModelWithType[MyInt]\n ModelWithType[MyStr]\n\n\ndef test_generic_with_referenced_generic_type_constraints():\n T = TypeVar('T', int, str)\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_metadata__['parameters']\n assert Model.__pydantic_generic_metadata__['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_enum_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_generic_enum_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": 1899, "end_line": 1925, "span_ids": ["test_generic_enum", "test_generic_literal"], "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_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_annotated_test_generic_subclass_with_extra_type_requires_all_params.with_pytest_raises_.B._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_annotated_test_generic_subclass_with_extra_type_requires_all_params.with_pytest_raises_.B._", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 1965, "end_line": 2050, "span_ids": ["test_generic_subclass_with_extra_type_requires_all_params", "test_generic_annotated", "test_generic_subclass", "test_generic_subclass_with_extra_type", "test_generic_subclass_with_partial_application", "test_multilevel_generic_binding"], "tokens": 473}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_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_generic_subclass_with_extra_type_requires_all_params():\n T = TypeVar('T')\n S = TypeVar('S')\n\n class A(BaseModel, Generic[T]):\n ...\n\n with pytest.raises(\n TypeError,\n match=re.escape(\n 'All parameters must be present on typing.Generic; you should inherit from typing.Generic[~T, ~S]'\n ),\n ):\n\n class B(A[T], Generic[S]):\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_subclass_with_extra_type_with_hint_message_test_generic_subclass_with_extra_type_with_hint_message.with_pytest_raises_.with_pytest_warns_.ChildGenericClass._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_subclass_with_extra_type_with_hint_message_test_generic_subclass_with_extra_type_with_hint_message.with_pytest_raises_.with_pytest_warns_.ChildGenericClass._", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2053, "end_line": 2080, "span_ids": ["test_generic_subclass_with_extra_type_with_hint_message"], "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_generic_subclass_with_extra_type_with_hint_message():\n E = TypeVar('E', bound=BaseModel)\n D = TypeVar('D')\n\n with pytest.warns(\n GenericBeforeBaseModelWarning,\n match='Classes should inherit from `BaseModel` before generic classes',\n ):\n\n class BaseGenericClass(Generic[E, D], BaseModel):\n uid: str\n name: str\n\n with pytest.raises(\n TypeError,\n match=re.escape(\n 'All parameters must be present on typing.Generic; you should inherit from typing.Generic[~E, ~D].'\n ' Note: `typing.Generic` must go last:'\n ' `class ChildGenericClass(BaseGenericClass, typing.Generic[~E, ~D]): ...`'\n ),\n ):\n with pytest.warns(\n GenericBeforeBaseModelWarning,\n match='Classes should inherit from `BaseModel` before generic classes',\n ):\n\n class ChildGenericClass(BaseGenericClass[E, Dict[str, 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_generics.py_test_multi_inheritance_generic_binding_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_multi_inheritance_generic_binding_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": 2083, "end_line": 2119, "span_ids": ["test_multi_inheritance_generic_binding", "test_parent_field_parametrization"], "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_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)\n\n\ndef 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(include_url=False) == [\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_variadic_generic_with_variadic_fields_test_variadic_generic_with_variadic_fields.with_pytest_raises_TypeEr.MyToolboxClass_manual_too": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_variadic_generic_with_variadic_fields_test_variadic_generic_with_variadic_fields.with_pytest_raises_TypeEr.MyToolboxClass_manual_too", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2532, "end_line": 2560, "span_ids": ["test_variadic_generic_with_variadic_fields"], "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": "@pytest.mark.skipif(sys.version_info < (3, 11), reason='requires python 3.11 or higher')\n@pytest.mark.xfail(\n reason='TODO: Variadic fields are not supported yet; Issue: https://github.com/pydantic/pydantic/issues/5804'\n)\ndef test_variadic_generic_with_variadic_fields():\n class ComponentModel(BaseModel):\n pass\n\n class Wrench(ComponentModel):\n pass\n\n class Screwdriver(ComponentModel):\n pass\n\n ComponentVar = TypeVar('ComponentVar', bound=ComponentModel)\n NumberOfComponents = TypeVarTuple('NumberOfComponents')\n\n class VariadicToolbox(BaseModel, Generic[ComponentVar, Unpack[NumberOfComponents]]):\n toolbelt_cm_size: Optional[tuple[Unpack[NumberOfComponents]]] = Field(default_factory=tuple)\n manual_toolset: Optional[tuple[ComponentVar, Unpack[NumberOfComponents]]] = Field(default_factory=tuple)\n\n MyToolboxClass = VariadicToolbox[Screwdriver, Screwdriver, Wrench]\n\n sa, sb, w = Screwdriver(), Screwdriver(), Wrench()\n MyToolboxClass(toolbelt_cm_size=(5, 10.5, 4), manual_toolset=(sa, sb, w))\n\n with pytest.raises(TypeError):\n # Should raise error because integer 5 does not meet the bound requirements of ComponentVar\n MyToolboxClass(manual_toolset=(sa, sb, 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_generics.py_test_generic_namedtuple_test_generic_none.assert_Container_None_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_generic_namedtuple_test_generic_none.assert_Container_None_va", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2563, "end_line": 2594, "span_ids": ["test_generic_namedtuple", "test_generic_none"], "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.skipif(\n sys.version_info < (3, 11),\n reason=(\n 'Multiple inheritance with NamedTuple and the corresponding type annotations'\n \" aren't supported before Python 3.11\"\n ),\n)\ndef test_generic_namedtuple():\n T = TypeVar('T')\n\n class FlaggedValue(NamedTuple, Generic[T]):\n value: T\n flag: bool\n\n class Model(BaseModel):\n f_value: FlaggedValue[float]\n\n assert Model(f_value=(1, True)).model_dump() == {'f_value': (1, True)}\n with pytest.raises(ValidationError):\n Model(f_value=(1, 'abc'))\n with pytest.raises(ValidationError):\n Model(f_value=('abc', True))\n\n\ndef test_generic_none():\n T = TypeVar('T')\n\n class Container(BaseModel, Generic[T]):\n value: T\n\n assert Container[type(None)](value=None).value is None\n assert Container[None](value=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_generics.py_test_paramspec_is_usable_test_parametrize_with_basemodel.Concrete.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_paramspec_is_usable_test_parametrize_with_basemodel.Concrete.pass", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2597, "end_line": 2621, "span_ids": ["test_paramspec_is_usable", "test_parametrize_with_basemodel"], "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": "@pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason='PyPy does not allow ParamSpec in generics')\ndef test_paramspec_is_usable():\n # This used to cause a recursion error due to `P in P is True`\n # This test doesn't actually test that ParamSpec works properly for validation or anything.\n\n P = ParamSpec('P')\n\n class MyGenericParamSpecClass(Generic[P]):\n def __init__(self, func: Callable[P, None], *args: P.args, **kwargs: P.kwargs) -> None:\n super().__init__()\n\n class ParamSpecGenericModel(BaseModel, Generic[P]):\n my_generic: MyGenericParamSpecClass[P]\n\n model_config = dict(arbitrary_types_allowed=True)\n\n\ndef test_parametrize_with_basemodel():\n T = TypeVar('T')\n\n class SimpleGenericModel(BaseModel, Generic[T]):\n pass\n\n class Concrete(SimpleGenericModel[BaseModel]):\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_no_generic_base_test_reverse_order_generic_hashability.assert_len_m1_m2_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_no_generic_base_test_reverse_order_generic_hashability.assert_len_m1_m2_1", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2624, "end_line": 2669, "span_ids": ["test_no_generic_base", "test_reverse_order_generic_hashability"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_no_generic_base():\n T = TypeVar('T')\n\n class A(BaseModel, Generic[T]):\n a: T\n\n class B(A[T]):\n b: T\n\n class C(B[int]):\n pass\n\n assert C(a='1', b='2').model_dump() == {'a': 1, 'b': 2}\n with pytest.raises(ValidationError) as exc_info:\n C(a='a', b='b')\n assert exc_info.value.errors(include_url=False) == [\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 {\n 'input': 'b',\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\ndef test_reverse_order_generic_hashability():\n T = TypeVar('T')\n\n with pytest.warns(\n GenericBeforeBaseModelWarning,\n match='Classes should inherit from `BaseModel` before generic classes',\n ):\n\n class Model(Generic[T], BaseModel):\n x: T\n model_config = dict(frozen=True)\n\n m1 = Model[int](x=1)\n m2 = Model[int](x=1)\n assert len({m1, m2}) == 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_serialize_unsubstituted_typevars_bound_test_serialize_unsubstituted_typevars_bound.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_serialize_unsubstituted_typevars_bound_test_serialize_unsubstituted_typevars_bound.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": 2672, "end_line": 2731, "span_ids": ["test_serialize_unsubstituted_typevars_bound"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_serialize_unsubstituted_typevars_bound() -> None:\n class ErrorDetails(BaseModel):\n foo: str\n\n # This version of `TypeVar` does not support `default` on Python <3.12\n ErrorDataT = TypeVar('ErrorDataT', bound=ErrorDetails)\n\n class Error(BaseModel, Generic[ErrorDataT]):\n message: str\n details: ErrorDataT\n\n class MyErrorDetails(ErrorDetails):\n bar: str\n\n sample_error = Error(\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n 'bar': 'baz',\n },\n }\n\n sample_error = Error[ErrorDetails](\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n },\n }\n\n sample_error = Error[MyErrorDetails](\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n 'bar': 'baz',\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_serialize_unsubstituted_typevars_bound_default_supported_test_serialize_unsubstituted_typevars_bound_default_supported.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_serialize_unsubstituted_typevars_bound_default_supported_test_serialize_unsubstituted_typevars_bound_default_supported.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": 2734, "end_line": 2793, "span_ids": ["test_serialize_unsubstituted_typevars_bound_default_supported"], "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_serialize_unsubstituted_typevars_bound_default_supported() -> None:\n class ErrorDetails(BaseModel):\n foo: str\n\n # This version of `TypeVar` always support `default`\n ErrorDataT = TypingExtensionsTypeVar('ErrorDataT', bound=ErrorDetails)\n\n class Error(BaseModel, Generic[ErrorDataT]):\n message: str\n details: ErrorDataT\n\n class MyErrorDetails(ErrorDetails):\n bar: str\n\n sample_error = Error(\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n 'bar': 'baz',\n },\n }\n\n sample_error = Error[ErrorDetails](\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n },\n }\n\n sample_error = Error[MyErrorDetails](\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n 'bar': 'baz',\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_serialize_unsubstituted_typevars_variants_test_serialize_unsubstituted_typevars_variants.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_serialize_unsubstituted_typevars_variants_test_serialize_unsubstituted_typevars_variants.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": 2796, "end_line": 2859, "span_ids": ["test_serialize_unsubstituted_typevars_variants"], "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": "@pytest.mark.parametrize(\n 'type_var',\n [\n TypingExtensionsTypeVar('ErrorDataT', default=BaseModel),\n TypeVar('ErrorDataT', BaseModel, str),\n ],\n ids=['default', 'constraint'],\n)\ndef test_serialize_unsubstituted_typevars_variants(\n type_var: Type[BaseModel],\n) -> None:\n class ErrorDetails(BaseModel):\n foo: str\n\n class Error(BaseModel, Generic[type_var]): # type: ignore\n message: str\n details: type_var\n\n class MyErrorDetails(ErrorDetails):\n bar: str\n\n sample_error = Error(\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {},\n }\n\n sample_error = Error[ErrorDetails](\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n },\n }\n\n sample_error = Error[MyErrorDetails](\n message='We just had an error',\n details=MyErrorDetails(foo='var', bar='baz'),\n )\n assert sample_error.details.model_dump() == {\n 'foo': 'var',\n 'bar': 'baz',\n }\n assert sample_error.model_dump() == {\n 'message': 'We just had an error',\n 'details': {\n 'foo': 'var',\n 'bar': 'baz',\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_mix_default_and_constraints_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_generics.py_test_mix_default_and_constraints_", "embedding": null, "metadata": {"file_path": "tests/test_generics.py", "file_name": "test_generics.py", "file_type": "text/x-python", "category": "test", "start_line": 2862, "end_line": 2887, "span_ids": ["test_generic_with_not_required_in_typed_dict", "test_mix_default_and_constraints"], "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_mix_default_and_constraints() -> None:\n T = TypingExtensionsTypeVar('T', str, int, default=str)\n\n msg = 'Pydantic does not support mixing more than one of TypeVar bounds, constraints and defaults'\n with pytest.raises(NotImplementedError, match=msg):\n\n class _(BaseModel, Generic[T]):\n x: T\n\n\ndef test_generic_with_not_required_in_typed_dict() -> None:\n T = TypingExtensionsTypeVar('T')\n\n class FooStr(TypedDict):\n type: NotRequired[str]\n\n class FooGeneric(TypedDict, Generic[T]):\n type: NotRequired[T]\n\n ta_foo_str = TypeAdapter(FooStr)\n assert ta_foo_str.validate_python({'type': 'tomato'}) == {'type': 'tomato'}\n assert ta_foo_str.validate_python({}) == {}\n ta_foo_generic = TypeAdapter(FooGeneric[str])\n assert ta_foo_generic.validate_python({'type': 'tomato'}) == {'type': 'tomato'}\n assert ta_foo_generic.validate_python({}) == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py___remove_metadata.return.walk_core_schema_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py___remove_metadata.return.walk_core_schema_schema_", "embedding": null, "metadata": {"file_path": "tests/test_internal.py", "file_name": "test_internal.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["remove_metadata", "docstring"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nTests for internal things that are complex enough to warrant their own unit tests.\n\"\"\"\nfrom dataclasses import dataclass\n\nimport pytest\nfrom pydantic_core import CoreSchema, SchemaValidator\nfrom pydantic_core import core_schema as cs\n\nfrom pydantic._internal._core_utils import (\n HAS_INVALID_SCHEMAS_METADATA_KEY,\n Walk,\n collect_invalid_schemas,\n simplify_schema_references,\n walk_core_schema,\n)\nfrom pydantic._internal._repr import Representation\n\n\ndef remove_metadata(schema: CoreSchema) -> CoreSchema:\n def inner(s: CoreSchema, recurse: Walk) -> CoreSchema:\n s = s.copy()\n s.pop('metadata', None)\n return recurse(s, inner)\n\n return walk_core_schema(schema, 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/tests/test_internal.py_test_build_schema_defs_test_build_schema_defs._check_for_validity": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_internal.py_test_build_schema_defs_test_build_schema_defs._check_for_validity", "embedding": null, "metadata": {"file_path": "tests/test_internal.py", "file_name": "test_internal.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 181, "span_ids": ["test_build_schema_defs"], "tokens": 1095}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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_schema,inlined',\n [\n # Test case 1: Simple schema with no references\n (cs.list_schema(cs.int_schema()), cs.list_schema(cs.int_schema())),\n # Test case 2: Schema with single-level nested references\n (\n cs.definitions_schema(\n cs.list_schema(cs.definition_reference_schema('list_of_ints')),\n definitions=[\n cs.list_schema(cs.definition_reference_schema('int'), ref='list_of_ints'),\n cs.int_schema(ref='int'),\n ],\n ),\n cs.list_schema(cs.list_schema(cs.int_schema(ref='int'), ref='list_of_ints')),\n ),\n # Test case 3: Schema with multiple single-level nested references\n (\n cs.list_schema(\n cs.definitions_schema(cs.definition_reference_schema('int'), definitions=[cs.int_schema(ref='int')])\n ),\n cs.list_schema(cs.int_schema(ref='int')),\n ),\n # Test case 4: A simple recursive schema\n (\n cs.list_schema(cs.definition_reference_schema(schema_ref='list'), ref='list'),\n cs.definitions_schema(\n cs.definition_reference_schema(schema_ref='list'),\n definitions=[cs.list_schema(cs.definition_reference_schema(schema_ref='list'), ref='list')],\n ),\n ),\n # Test case 5: Deeply nested schema with multiple references\n (\n cs.definitions_schema(\n cs.list_schema(cs.definition_reference_schema('list_of_lists_of_ints')),\n definitions=[\n cs.list_schema(cs.definition_reference_schema('list_of_ints'), ref='list_of_lists_of_ints'),\n cs.list_schema(cs.definition_reference_schema('int'), ref='list_of_ints'),\n cs.int_schema(ref='int'),\n ],\n ),\n cs.list_schema(\n cs.list_schema(\n cs.list_schema(cs.int_schema(ref='int'), ref='list_of_ints'), ref='list_of_lists_of_ints'\n )\n ),\n ),\n # Test case 6: More complex recursive schema\n (\n cs.definitions_schema(\n cs.list_schema(cs.definition_reference_schema(schema_ref='list_of_ints_and_lists')),\n definitions=[\n cs.list_schema(\n cs.definitions_schema(\n cs.definition_reference_schema(schema_ref='int_or_list'),\n definitions=[\n cs.int_schema(ref='int'),\n cs.tuple_variable_schema(\n cs.definition_reference_schema(schema_ref='list_of_ints_and_lists'), ref='a tuple'\n ),\n ],\n ),\n ref='list_of_ints_and_lists',\n ),\n cs.int_schema(ref='int_or_list'),\n ],\n ),\n cs.list_schema(cs.list_schema(cs.int_schema(ref='int_or_list'), ref='list_of_ints_and_lists')),\n ),\n # Test case 7: Schema with multiple definitions and nested references, some of which are unused\n (\n cs.definitions_schema(\n cs.list_schema(cs.definition_reference_schema('list_of_ints')),\n definitions=[\n cs.list_schema(\n cs.definitions_schema(\n cs.definition_reference_schema('int'), definitions=[cs.int_schema(ref='int')]\n ),\n ref='list_of_ints',\n )\n ],\n ),\n cs.list_schema(cs.list_schema(cs.int_schema(ref='int'), ref='list_of_ints')),\n ),\n # Test case 8: Reference is used in multiple places\n (\n cs.definitions_schema(\n cs.union_schema(\n [\n cs.definition_reference_schema('list_of_ints'),\n cs.tuple_variable_schema(cs.definition_reference_schema('int')),\n ]\n ),\n definitions=[\n cs.list_schema(cs.definition_reference_schema('int'), ref='list_of_ints'),\n cs.int_schema(ref='int'),\n ],\n ),\n cs.definitions_schema(\n cs.union_schema(\n [\n cs.list_schema(cs.definition_reference_schema('int'), ref='list_of_ints'),\n cs.tuple_variable_schema(cs.definition_reference_schema('int')),\n ]\n ),\n definitions=[cs.int_schema(ref='int')],\n ),\n ),\n # Test case 9: https://github.com/pydantic/pydantic/issues/6270\n (\n cs.definitions_schema(\n cs.definition_reference_schema('model'),\n definitions=[\n cs.typed_dict_schema(\n {\n 'a': cs.typed_dict_field(\n cs.nullable_schema(\n cs.int_schema(ref='ref'),\n ),\n ),\n 'b': cs.typed_dict_field(\n cs.nullable_schema(\n cs.int_schema(ref='ref'),\n ),\n ),\n },\n ref='model',\n ),\n ],\n ),\n cs.definitions_schema(\n cs.typed_dict_schema(\n {\n 'a': cs.typed_dict_field(\n cs.nullable_schema(cs.definition_reference_schema(schema_ref='ref')),\n ),\n 'b': cs.typed_dict_field(\n cs.nullable_schema(cs.definition_reference_schema(schema_ref='ref')),\n ),\n },\n ref='model',\n ),\n definitions=[\n cs.int_schema(ref='ref'),\n ],\n ),\n ),\n ],\n)\ndef test_build_schema_defs(input_schema: cs.CoreSchema, inlined: cs.CoreSchema):\n actual_inlined = remove_metadata(simplify_schema_references(input_schema))\n assert actual_inlined == inlined\n SchemaValidator(actual_inlined) # check for validity", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_resolve_ref_schema_recursive_model_test_resolve_ref_schema_recursive_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.py_test_resolve_ref_schema_recursive_model_test_resolve_ref_schema_recursive_model.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 369, "end_line": 394, "span_ids": ["test_resolve_ref_schema_recursive_model"], "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_resolve_ref_schema_recursive_model():\n class Model(BaseModel):\n mini_me: Union['Model', None]\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = super().__get_pydantic_json_schema__(core_schema, handler)\n json_schema = handler.resolve_ref_schema(json_schema)\n json_schema['examples'] = {'foo': {'mini_me': None}}\n return json_schema\n\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n '$defs': {\n 'Model': {\n 'examples': {'foo': {'mini_me': None}},\n 'properties': {'mini_me': {'anyOf': [{'$ref': '#/$defs/Model'}, {'type': 'null'}]}},\n 'required': ['mini_me'],\n 'title': 'Model',\n 'type': 'object',\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.py_test_custom_json_encoder_config_test_custom_iso_timedelta.assert_json_loads_m_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_json_encoder_config_test_custom_iso_timedelta.assert_json_loads_m_model", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 397, "end_line": 420, "span_ids": ["test_custom_iso_timedelta", "test_custom_json_encoder_config"], "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_custom_json_encoder_config():\n class Model(BaseModel):\n x: timedelta\n y: Decimal\n z: date\n\n model_config = ConfigDict(\n json_encoders={timedelta: lambda v: f'{v.total_seconds():0.3f}s', Decimal: lambda v: 'a decimal'}\n )\n\n assert json.loads(Model(x=123, y=5, z='2032-06-01').model_dump_json()) == {\n 'x': '123.000s',\n 'y': 'a decimal',\n 'z': '2032-06-01',\n }\n\n\ndef test_custom_iso_timedelta():\n class Model(BaseModel):\n x: timedelta\n model_config = ConfigDict(json_encoders={timedelta: lambda _: 'P0DT0H2M3.000000S'})\n\n m = Model(x=321)\n assert json.loads(m.model_dump_json()) == {'x': 'P0DT0H2M3.000000S'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_encoders_config_simple_inheritance_test_json_encoders_config_simple_inheritance.assert_json_loads_Child_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoders_config_simple_inheritance_test_json_encoders_config_simple_inheritance.assert_json_loads_Child_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 423, "end_line": 436, "span_ids": ["test_json_encoders_config_simple_inheritance"], "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_json_encoders_config_simple_inheritance():\n \"\"\"json_encoders is not \"inheritable\", this is different than v1 but much simpler\"\"\"\n\n class Parent(BaseModel):\n dt: datetime = datetime.now()\n timedt: timedelta = timedelta(hours=100)\n\n model_config = ConfigDict(json_encoders={timedelta: lambda _: 'parent_encoder'})\n\n class Child(Parent):\n model_config = ConfigDict(json_encoders={datetime: lambda _: 'child_encoder'})\n\n # insert_assert(Child().model_dump())\n assert json.loads(Child().model_dump_json()) == {'dt': 'child_encoder', 'timedt': 'P4DT14400S'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_iso_timedelta_annotated_test_custom_iso_timedelta_annotated.assert_json_loads_m_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_custom_iso_timedelta_annotated_test_custom_iso_timedelta_annotated.assert_json_loads_m_model", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 439, "end_line": 447, "span_ids": ["test_custom_iso_timedelta_annotated"], "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_custom_iso_timedelta_annotated():\n class Model(BaseModel):\n # the json_encoders config applies to the type but the annotation overrides it\n y: timedelta\n x: Annotated[timedelta, AfterValidator(lambda x: x), PlainSerializer(lambda _: 'P0DT0H1M2.000000S')]\n model_config = ConfigDict(json_encoders={timedelta: lambda _: 'P0DT0H2M3.000000S'})\n\n m = Model(x=321, y=456)\n assert json.loads(m.model_dump_json()) == {'x': 'P0DT0H1M2.000000S', 'y': 'P0DT0H2M3.000000S'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_encoders_on_model_test_json_encoders_on_model.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoders_on_model_test_json_encoders_on_model.None_1", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 450, "end_line": 474, "span_ids": ["test_json_encoders_on_model"], "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_json_encoders_on_model() -> None:\n \"\"\"Make sure that applying json_encoders to a BaseModel\n does not edit its schema in place.\n \"\"\"\n\n class Model(BaseModel):\n x: int\n\n class Outer1(BaseModel):\n m: Model\n model_config = ConfigDict(json_encoders={Model: lambda x: 'encoded!'})\n\n class Outer2(BaseModel):\n m: Model\n\n class Outermost(BaseModel):\n inner: Union[Outer1, Outer2]\n\n m = Outermost(inner=Outer1(m=Model(x=1)))\n # insert_assert(m.model_dump())\n assert json.loads(m.model_dump_json()) == {'inner': {'m': 'encoded!'}}\n\n m = Outermost(inner=Outer2(m=Model(x=1)))\n # insert_assert(m.model_dump())\n assert json.loads(m.model_dump_json()) == {'inner': {'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_json.py_test_json_encoders_not_used_for_python_dumps_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json.py_test_json_encoders_not_used_for_python_dumps_", "embedding": null, "metadata": {"file_path": "tests/test_json.py", "file_name": "test_json.py", "file_type": "text/x-python", "category": "test", "start_line": 477, "end_line": 503, "span_ids": ["test_json_encoders_types", "test_json_encoders_not_used_for_python_dumps"], "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_json_encoders_not_used_for_python_dumps() -> None:\n class Model(BaseModel):\n x: int\n model_config = ConfigDict(json_encoders={int: lambda x: 'encoded!'})\n\n m = Model(x=1)\n assert m.model_dump() == {'x': 1}\n assert m.model_dump_json() == '{\"x\":\"encoded!\"}'\n\n\ndef test_json_encoders_types() -> None:\n class MyEnum(Enum):\n A = 'a'\n B = 'b'\n\n class A(BaseModel):\n a: MyEnum\n b: List[int]\n c: Decimal\n model_config = ConfigDict(\n json_encoders={Enum: lambda val: val.name, List[int]: lambda val: 'list!', Decimal: lambda val: 'decimal!'}\n )\n\n m = A(a=MyEnum.A, b=[1, 2, 3], c=Decimal('0'))\n assert m.model_dump_json() == '{\"a\":\"A\",\"b\":\"list!\",\"c\":\"decimal!\"}'\n assert m.model_dump() == {'a': MyEnum.A, 'b': [1, 2, 3], 'c': Decimal('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_schema.py_test_schema_ref_template_key_error_test_enum_int_default.assert_default_value_M": {"__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_default_value_M", "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": 1578, "end_line": 1630, "span_ids": ["test_list_default", "test_schema_no_definitions", "test_schema_ref_template_key_error", "test_enum_int_default", "test_enum_str_default"], "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_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, 'validation'), (Baz, 'validation')], ref_template='/schemas/{bad_name}.json#/')\n\n\ndef test_schema_no_definitions():\n keys_map, model_schema = models_json_schema([], title='Schema without definitions')\n assert keys_map == {}\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 default_value = UserModel.model_json_schema()['properties']['friends']['default']\n assert type(default_value) is str\n assert default_value == 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 default_value = UserModel.model_json_schema()['properties']['friends']['default']\n assert type(default_value) is int\n assert default_value == 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_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": 1651, "end_line": 1678, "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_model_default_timedelta_test_model_default_timedelta.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_model_default_timedelta_test_model_default_timedelta.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": 1681, "end_line": 1699, "span_ids": ["test_model_default_timedelta"], "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": "@pytest.mark.parametrize(\n 'ser_json_timedelta,properties',\n [\n ('float', {'duration': {'default': 300.0, 'title': 'Duration', 'type': 'number'}}),\n ('iso8601', {'duration': {'default': 'PT300S', 'format': 'duration', 'title': 'Duration', 'type': 'string'}}),\n ],\n)\ndef test_model_default_timedelta(ser_json_timedelta: Literal['float', 'iso8601'], properties: typing.Dict[str, Any]):\n class Model(BaseModel):\n model_config = ConfigDict(ser_json_timedelta=ser_json_timedelta)\n\n duration: timedelta = timedelta(minutes=5)\n\n # insert_assert(Model.model_json_schema(mode='serialization'))\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': properties,\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_default_bytes_test_model_default_bytes.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_model_default_bytes_test_model_default_bytes.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": 1702, "end_line": 1720, "span_ids": ["test_model_default_bytes"], "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": "@pytest.mark.parametrize(\n 'ser_json_bytes,properties',\n [\n ('base64', {'data': {'default': 'Zm9vYmFy', 'format': 'base64url', 'title': 'Data', 'type': 'string'}}),\n ('utf8', {'data': {'default': 'foobar', 'format': 'binary', 'title': 'Data', 'type': 'string'}}),\n ],\n)\ndef test_model_default_bytes(ser_json_bytes: Literal['base64', 'utf8'], properties: typing.Dict[str, Any]):\n class Model(BaseModel):\n model_config = ConfigDict(ser_json_bytes=ser_json_bytes)\n\n data: bytes = b'foobar'\n\n # insert_assert(Model.model_json_schema(mode='serialization'))\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': properties,\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_dataclass_default_timedelta_test_dataclass_default_timedelta.assert_TypeAdapter_Datacl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_default_timedelta_test_dataclass_default_timedelta.assert_TypeAdapter_Datacl", "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": 1723, "end_line": 1742, "span_ids": ["test_dataclass_default_timedelta"], "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": "@pytest.mark.parametrize(\n 'ser_json_timedelta,properties',\n [\n ('float', {'duration': {'default': 300.0, 'title': 'Duration', 'type': 'number'}}),\n ('iso8601', {'duration': {'default': 'PT300S', 'format': 'duration', 'title': 'Duration', 'type': 'string'}}),\n ],\n)\ndef test_dataclass_default_timedelta(\n ser_json_timedelta: Literal['float', 'iso8601'], properties: typing.Dict[str, Any]\n):\n @dataclass(config=ConfigDict(ser_json_timedelta=ser_json_timedelta))\n class Dataclass:\n duration: timedelta = timedelta(minutes=5)\n\n # insert_assert(TypeAdapter(Dataclass).json_schema(mode='serialization'))\n assert TypeAdapter(Dataclass).json_schema(mode='serialization') == {\n 'properties': properties,\n 'title': 'Dataclass',\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_dataclass_default_bytes_test_dataclass_default_bytes.assert_TypeAdapter_Datacl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_dataclass_default_bytes_test_dataclass_default_bytes.assert_TypeAdapter_Datacl", "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": 1745, "end_line": 1762, "span_ids": ["test_dataclass_default_bytes"], "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 'ser_json_bytes,properties',\n [\n ('base64', {'data': {'default': 'Zm9vYmFy', 'format': 'base64url', 'title': 'Data', 'type': 'string'}}),\n ('utf8', {'data': {'default': 'foobar', 'format': 'binary', 'title': 'Data', 'type': 'string'}}),\n ],\n)\ndef test_dataclass_default_bytes(ser_json_bytes: Literal['base64', 'utf8'], properties: typing.Dict[str, Any]):\n @dataclass(config=ConfigDict(ser_json_bytes=ser_json_bytes))\n class Dataclass:\n data: bytes = b'foobar'\n\n # insert_assert(TypeAdapter(Dataclass).json_schema(mode='serialization'))\n assert TypeAdapter(Dataclass).json_schema(mode='serialization') == {\n 'properties': properties,\n 'title': 'Dataclass',\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_typeddict_default_timedelta_test_typeddict_default_timedelta.assert_TypeAdapter_MyType": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_default_timedelta_test_typeddict_default_timedelta.assert_TypeAdapter_MyType", "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": 1765, "end_line": 1785, "span_ids": ["test_typeddict_default_timedelta"], "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.parametrize(\n 'ser_json_timedelta,properties',\n [\n ('float', {'duration': {'default': 300.0, 'title': 'Duration', 'type': 'number'}}),\n ('iso8601', {'duration': {'default': 'PT300S', 'format': 'duration', 'title': 'Duration', 'type': 'string'}}),\n ],\n)\ndef test_typeddict_default_timedelta(\n ser_json_timedelta: Literal['float', 'iso8601'], properties: typing.Dict[str, Any]\n):\n class MyTypedDict(TypedDict):\n __pydantic_config__ = ConfigDict(ser_json_timedelta=ser_json_timedelta)\n\n duration: Annotated[timedelta, Field(timedelta(minutes=5))]\n\n # insert_assert(TypeAdapter(MyTypedDict).json_schema(mode='serialization'))\n assert TypeAdapter(MyTypedDict).json_schema(mode='serialization') == {\n 'properties': properties,\n 'title': 'MyTypedDict',\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_typeddict_default_bytes_test_typeddict_default_bytes.assert_TypeAdapter_MyType": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_default_bytes_test_typeddict_default_bytes.assert_TypeAdapter_MyType", "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": 1806, "span_ids": ["test_typeddict_default_bytes"], "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.parametrize(\n 'ser_json_bytes,properties',\n [\n ('base64', {'data': {'default': 'Zm9vYmFy', 'format': 'base64url', 'title': 'Data', 'type': 'string'}}),\n ('utf8', {'data': {'default': 'foobar', 'format': 'binary', 'title': 'Data', 'type': 'string'}}),\n ],\n)\ndef test_typeddict_default_bytes(ser_json_bytes: Literal['base64', 'utf8'], properties: typing.Dict[str, Any]):\n class MyTypedDict(TypedDict):\n __pydantic_config__ = ConfigDict(ser_json_bytes=ser_json_bytes)\n\n data: Annotated[bytes, Field(b'foobar')]\n\n # insert_assert(TypeAdapter(MyTypedDict).json_schema(mode='serialization'))\n assert TypeAdapter(MyTypedDict).json_schema(mode='serialization') == {\n 'properties': properties,\n 'title': 'MyTypedDict',\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_subclass_metadata_test_docstring.assert_A_model_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_subclass_metadata_test_docstring.assert_A_model_json_schem", "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": 1809, "end_line": 1841, "span_ids": ["test_model_subclass_metadata", "test_docstring"], "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_model_subclass_metadata():\n class A(BaseModel):\n \"\"\"A Model docstring\"\"\"\n\n class B(A):\n pass\n\n assert A.model_json_schema() == {\n 'title': 'A',\n 'description': 'A Model docstring',\n 'type': 'object',\n 'properties': {},\n }\n assert B.model_json_schema() == {'title': 'B', 'type': 'object', 'properties': {}}\n\n\n@pytest.mark.parametrize(\n 'docstring,description',\n [\n ('foobar', 'foobar'),\n ('\\n foobar\\n ', 'foobar'),\n ('foobar\\n ', 'foobar\\n '),\n ('foo\\n bar\\n ', 'foo\\nbar'),\n ('\\n foo\\n bar\\n ', 'foo\\nbar'),\n ],\n)\ndef test_docstring(docstring, description):\n class A(BaseModel):\n x: int\n\n A.__doc__ = docstring\n\n assert A.model_json_schema()['description'] == description", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_optional_validator_test_optional_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_json_schema.py_test_optional_validator_test_optional_validator.assert_exc_info_value_err", "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": 2061, "end_line": 2096, "span_ids": ["test_optional_validator"], "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_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(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(ValueError('should not contain x')))},\n 'input': 'hellox',\n 'loc': ('something',),\n 'msg': 'Value error, should not contain x',\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_json_schema.py_test_field_with_validator_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_field_with_validator_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": 2099, "end_line": 2152, "span_ids": ["test_unparameterized_schema_generation", "test_field_with_validator"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 }\n\n\ndef 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_typeddict_with_extra_behavior_allow_test_typeddict_with_extra_behavior_allow.assert_TypeAdapter_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_behavior_allow_test_typeddict_with_extra_behavior_allow.assert_TypeAdapter_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": 2409, "end_line": 2423, "span_ids": ["test_typeddict_with_extra_behavior_allow"], "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_typeddict_with_extra_behavior_allow():\n class Model:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.typed_dict_schema(\n {'a': core_schema.typed_dict_field(core_schema.str_schema())},\n extra_behavior='allow',\n )\n\n assert TypeAdapter(Model).json_schema() == {\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'additionalProperties': 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_json_schema.py_test_typeddict_with_extra_ignore_test_typeddict_with_extra_behavior_ignore.assert_TypeAdapter_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_ignore_test_typeddict_with_extra_behavior_ignore.assert_TypeAdapter_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": 2426, "end_line": 2452, "span_ids": ["test_typeddict_with_extra_behavior_ignore", "test_typeddict_with_extra_ignore"], "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_typeddict_with_extra_ignore():\n class Model(TypedDict):\n __pydantic_config__ = ConfigDict(extra='ignore') # type: ignore\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n }\n\n\ndef test_typeddict_with_extra_behavior_ignore():\n class Model:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.typed_dict_schema(\n {'a': core_schema.typed_dict_field(core_schema.str_schema())},\n extra_behavior='ignore',\n )\n\n assert TypeAdapter(Model).json_schema() == {\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_typeddict_with_extra_forbid_test_typeddict_with_extra_forbid.assert_TypeAdapter_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_forbid_test_typeddict_with_extra_forbid.assert_TypeAdapter_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": 2455, "end_line": 2467, "span_ids": ["test_typeddict_with_extra_forbid"], "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_typeddict_with_extra_forbid():\n @pydantic.dataclasses.dataclass\n class Model:\n __pydantic_config__ = ConfigDict(extra='forbid')\n a: str\n\n assert TypeAdapter(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_typeddict_with_extra_behavior_forbid_test_typeddict_with_extra_behavior_forbid.assert_TypeAdapter_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_extra_behavior_forbid_test_typeddict_with_extra_behavior_forbid.assert_TypeAdapter_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": 2470, "end_line": 2484, "span_ids": ["test_typeddict_with_extra_behavior_forbid"], "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_typeddict_with_extra_behavior_forbid():\n class Model:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.typed_dict_schema(\n {'a': core_schema.typed_dict_field(core_schema.str_schema())},\n extra_behavior='forbid',\n )\n\n assert TypeAdapter(Model).json_schema() == {\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_multiple_models_with_same_input_output_test_multiple_models_with_same_input_output.None_3": {"__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_input_output_test_multiple_models_with_same_input_output.None_3", "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": 2759, "end_line": 2818, "span_ids": ["test_multiple_models_with_same_input_output"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multiple_models_with_same_input_output(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 # All validation\n keys_map, schema = models_json_schema(\n [(module.ModelOne, 'validation'), (module.ModelTwo, 'validation'), (module.NestedModel, 'validation')]\n )\n model_names = set(schema['$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\n\n # Validation + serialization\n keys_map, schema = models_json_schema(\n [\n (module.ModelOne, 'validation'),\n (module.ModelTwo, 'validation'),\n (module.NestedModel, 'validation'),\n (module.ModelOne, 'serialization'),\n (module.ModelTwo, 'serialization'),\n (module.NestedModel, 'serialization'),\n ]\n )\n model_names = set(schema['$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_models_with_same_name_different_input_output_test_multiple_models_with_same_name_different_input_output.None_3": {"__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_different_input_output_test_multiple_models_with_same_name_different_input_output.None_3", "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": 2821, "end_line": 2887, "span_ids": ["test_multiple_models_with_same_name_different_input_output"], "tokens": 456}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multiple_models_with_same_name_different_input_output(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom decimal import Decimal\n\nfrom pydantic import BaseModel\n\n\nclass ModelOne(BaseModel):\n class NestedModel(BaseModel):\n a: Decimal\n\n nested: NestedModel\n\n\nclass ModelTwo(BaseModel):\n class NestedModel(BaseModel):\n b: Decimal\n\n nested: NestedModel\n\n\nclass NestedModel(BaseModel):\n c: Decimal\n \"\"\"\n )\n\n # All validation\n keys_map, schema = models_json_schema(\n [(module.ModelOne, 'validation'), (module.ModelTwo, 'validation'), (module.NestedModel, 'validation')]\n )\n model_names = set(schema['$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\n\n # Validation + serialization\n keys_map, schema = models_json_schema(\n [\n (module.ModelOne, 'validation'),\n (module.ModelTwo, 'validation'),\n (module.NestedModel, 'validation'),\n (module.ModelOne, 'serialization'),\n (module.ModelTwo, 'serialization'),\n (module.NestedModel, 'serialization'),\n ]\n )\n model_names = set(schema['$defs'].keys())\n expected_model_names = {\n 'ModelOne-Input',\n 'ModelOne-Output',\n 'ModelTwo-Input',\n 'ModelTwo-Output',\n f'{module.__name__}__ModelOne__NestedModel-Input',\n f'{module.__name__}__ModelOne__NestedModel-Output',\n f'{module.__name__}__ModelTwo__NestedModel-Input',\n f'{module.__name__}__ModelTwo__NestedModel-Output',\n f'{module.__name__}__NestedModel-Input',\n f'{module.__name__}__NestedModel-Output',\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_mode_name_causes_no_conflict_test_mode_name_causes_no_conflict.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_mode_name_causes_no_conflict_test_mode_name_causes_no_conflict.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": 2942, "end_line": 2987, "span_ids": ["test_mode_name_causes_no_conflict"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_mode_name_causes_no_conflict():\n class Organization(BaseModel):\n pass\n\n class OrganizationInput(BaseModel):\n pass\n\n class OrganizationOutput(BaseModel):\n pass\n\n class Model(BaseModel):\n # Ensure the validation and serialization schemas are different:\n x: Organization = Field(validation_alias='x_validation', serialization_alias='x_serialization')\n y: OrganizationInput\n z: OrganizationOutput\n\n assert Model.model_json_schema(mode='validation') == {\n '$defs': {\n 'Organization': {'properties': {}, 'title': 'Organization', 'type': 'object'},\n 'OrganizationInput': {'properties': {}, 'title': 'OrganizationInput', 'type': 'object'},\n 'OrganizationOutput': {'properties': {}, 'title': 'OrganizationOutput', 'type': 'object'},\n },\n 'properties': {\n 'x_validation': {'$ref': '#/$defs/Organization'},\n 'y': {'$ref': '#/$defs/OrganizationInput'},\n 'z': {'$ref': '#/$defs/OrganizationOutput'},\n },\n 'required': ['x_validation', 'y', 'z'],\n 'title': 'Model',\n 'type': 'object',\n }\n assert Model.model_json_schema(mode='serialization') == {\n '$defs': {\n 'Organization': {'properties': {}, 'title': 'Organization', 'type': 'object'},\n 'OrganizationInput': {'properties': {}, 'title': 'OrganizationInput', 'type': 'object'},\n 'OrganizationOutput': {'properties': {}, 'title': 'OrganizationOutput', 'type': 'object'},\n },\n 'properties': {\n 'x_serialization': {'$ref': '#/$defs/Organization'},\n 'y': {'$ref': '#/$defs/OrganizationInput'},\n 'z': {'$ref': '#/$defs/OrganizationOutput'},\n },\n 'required': ['x_serialization', 'y', 'z'],\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_ref_conflict_resolution_without_mode_difference_test_ref_conflict_resolution_without_mode_difference.assert_defs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ref_conflict_resolution_without_mode_difference_test_ref_conflict_resolution_without_mode_difference.assert_defs_", "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": 2990, "end_line": 3018, "span_ids": ["test_ref_conflict_resolution_without_mode_difference"], "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_ref_conflict_resolution_without_mode_difference():\n class OrganizationInput(BaseModel):\n pass\n\n class Organization(BaseModel):\n x: int\n\n schema_with_defs, defs = GenerateJsonSchema().generate_definitions(\n [\n (Organization, 'validation', Organization.__pydantic_core_schema__),\n (Organization, 'serialization', Organization.__pydantic_core_schema__),\n (OrganizationInput, 'validation', OrganizationInput.__pydantic_core_schema__),\n ]\n )\n assert schema_with_defs == {\n (Organization, 'serialization'): {'$ref': '#/$defs/Organization'},\n (Organization, 'validation'): {'$ref': '#/$defs/Organization'},\n (OrganizationInput, 'validation'): {'$ref': '#/$defs/OrganizationInput'},\n }\n\n assert defs == {\n 'OrganizationInput': {'properties': {}, 'title': 'OrganizationInput', 'type': 'object'},\n 'Organization': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Organization',\n '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_json_schema.py_test_ref_conflict_resolution_with_mode_difference_test_ref_conflict_resolution_with_mode_difference.assert_defs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_ref_conflict_resolution_with_mode_difference_test_ref_conflict_resolution_with_mode_difference.assert_defs_", "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": 3021, "end_line": 3059, "span_ids": ["test_ref_conflict_resolution_with_mode_difference"], "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_ref_conflict_resolution_with_mode_difference():\n class OrganizationInput(BaseModel):\n pass\n\n class Organization(BaseModel):\n x: int\n\n @field_serializer('x')\n def serialize_x(self, v: int) -> str:\n return str(v)\n\n schema_with_defs, defs = GenerateJsonSchema().generate_definitions(\n [\n (Organization, 'validation', Organization.__pydantic_core_schema__),\n (Organization, 'serialization', Organization.__pydantic_core_schema__),\n (OrganizationInput, 'validation', OrganizationInput.__pydantic_core_schema__),\n ]\n )\n assert schema_with_defs == {\n (Organization, 'serialization'): {'$ref': '#/$defs/Organization-Output'},\n (Organization, 'validation'): {'$ref': '#/$defs/Organization-Input'},\n (OrganizationInput, 'validation'): {'$ref': '#/$defs/OrganizationInput'},\n }\n\n assert defs == {\n 'OrganizationInput': {'properties': {}, 'title': 'OrganizationInput', 'type': 'object'},\n 'Organization-Input': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Organization',\n 'type': 'object',\n },\n 'Organization-Output': {\n 'properties': {'x': {'title': 'X', 'type': 'string'}},\n 'required': ['x'],\n 'title': 'Organization',\n '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_json_schema.py_test_conflicting_names_test_conflicting_names.assert_defs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_conflicting_names_test_conflicting_names.assert_defs_", "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": 3062, "end_line": 3100, "span_ids": ["test_conflicting_names"], "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_conflicting_names():\n class Organization__Input(BaseModel):\n pass\n\n class Organization(BaseModel):\n x: int\n\n @field_serializer('x')\n def serialize_x(self, v: int) -> str:\n return str(v)\n\n schema_with_defs, defs = GenerateJsonSchema().generate_definitions(\n [\n (Organization, 'validation', Organization.__pydantic_core_schema__),\n (Organization, 'serialization', Organization.__pydantic_core_schema__),\n (Organization__Input, 'validation', Organization__Input.__pydantic_core_schema__),\n ]\n )\n assert schema_with_defs == {\n (Organization, 'serialization'): {'$ref': '#/$defs/Organization-Output'},\n (Organization, 'validation'): {'$ref': '#/$defs/Organization-Input'},\n (Organization__Input, 'validation'): {'$ref': '#/$defs/Organization__Input'},\n }\n\n assert defs == {\n 'Organization__Input': {'properties': {}, 'title': 'Organization__Input', 'type': 'object'},\n 'Organization-Input': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Organization',\n 'type': 'object',\n },\n 'Organization-Output': {\n 'properties': {'x': {'title': 'X', 'type': 'string'}},\n 'required': ['x'],\n 'title': 'Organization',\n '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_json_schema.py_test_schema_for_generic_field_test_schema_for_generic_field.GenModel.__get_pydantic_core_schema__.return.core_schema_with_info_pla": {"__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_with_info_pla", "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": 3103, "end_line": 3130, "span_ids": ["test_schema_for_generic_field"], "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_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,\n source: Any,\n handler: GetCoreSchemaHandler,\n ) -> core_schema.PlainValidatorFunctionSchema:\n source_args = getattr(source, '__args__', [Any])\n param = source_args[0]\n metadata = build_metadata_dict(js_functions=[lambda _c, h: h(handler.generate_schema(param))])\n return core_schema.with_info_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_model_with_strict_mode_test_model_with_schema_extra_callable_instance_method.with_pytest_warns_Pydanti.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_model_with_strict_mode_test_model_with_schema_extra_callable_instance_method.with_pytest_warns_Pydanti.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": 4544, "end_line": 4663, "span_ids": ["test_model_with_schema_extra_callable_config_class", "test_model_with_schema_extra_callable_no_model_class_config_class", "test_model_with_schema_extra_callable_classmethod", "test_model_with_schema_extra_callable_no_model_class", "test_model_with_strict_mode", "test_model_with_schema_extra_callable", "test_model_with_schema_extra_callable_instance_method", "test_model_with_schema_extra"], "tokens": 743}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_model_with_strict_mode():\n class Model(BaseModel):\n model_config = ConfigDict(strict=True)\n\n a: str\n\n assert Model.model_json_schema() == {\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n\ndef test_model_with_schema_extra():\n class Model(BaseModel):\n a: str\n\n model_config = dict(json_schema_extra={'examples': [{'a': 'Foo'}]})\n\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'examples': [{'a': 'Foo'}],\n }\n\n\ndef test_model_with_schema_extra_callable():\n class Model(BaseModel):\n name: str = None\n\n @staticmethod\n def json_schema_extra(schema, model_class):\n schema.pop('properties')\n schema['type'] = 'override'\n assert model_class is Model\n\n model_config = dict(json_schema_extra=json_schema_extra)\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': 'override'}\n\n\ndef test_model_with_schema_extra_callable_no_model_class():\n class Model(BaseModel):\n name: str = None\n\n @classmethod\n def json_schema_extra(cls, schema):\n schema.pop('properties')\n schema['type'] = 'override'\n\n model_config = dict(json_schema_extra=json_schema_extra)\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': 'override'}\n\n\ndef test_model_with_schema_extra_callable_config_class():\n with pytest.warns(PydanticDeprecatedSince20, match='use ConfigDict instead'):\n\n class Model(BaseModel):\n name: str = None\n\n class Config:\n @staticmethod\n def json_schema_extra(schema, model_class):\n schema.pop('properties')\n schema['type'] = 'override'\n assert model_class is Model\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': 'override'}\n\n\ndef test_model_with_schema_extra_callable_no_model_class_config_class():\n with pytest.warns(PydanticDeprecatedSince20):\n\n class Model(BaseModel):\n name: str = None\n\n class Config:\n @staticmethod\n def json_schema_extra(schema):\n schema.pop('properties')\n schema['type'] = 'override'\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': 'override'}\n\n\ndef test_model_with_schema_extra_callable_classmethod():\n with pytest.warns(PydanticDeprecatedSince20):\n\n class Model(BaseModel):\n name: str = None\n\n class Config:\n type = 'foo'\n\n @classmethod\n def json_schema_extra(cls, schema, model_class):\n schema.pop('properties')\n schema['type'] = cls.type\n assert model_class is Model\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': 'foo'}\n\n\ndef test_model_with_schema_extra_callable_instance_method():\n with pytest.warns(PydanticDeprecatedSince20):\n\n class Model(BaseModel):\n name: str = None\n\n class Config:\n def json_schema_extra(schema, model_class):\n schema.pop('properties')\n schema['type'] = 'override'\n assert model_class is Model\n\n assert Model.model_json_schema() == {'title': 'Model', 'type': '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/tests/test_json_schema.py_test_extras_and_examples_are_json_encoded_test_extras_and_examples_are_json_encoded.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_extras_and_examples_are_json_encoded_test_extras_and_examples_are_json_encoded.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": 4754, "end_line": 4765, "span_ids": ["test_extras_and_examples_are_json_encoded"], "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_extras_and_examples_are_json_encoded():\n class Toy(BaseModel):\n name: Annotated[str, Field(examples=['mouse', 'ball'])]\n\n class Cat(BaseModel):\n toys: Annotated[\n List[Toy],\n Field(examples=[[Toy(name='mouse'), Toy(name='ball')]], json_schema_extra={'special': Toy(name='bird')}),\n ]\n\n assert Cat.model_json_schema()['properties']['toys']['examples'] == [[{'name': 'mouse'}, {'name': 'ball'}]]\n assert Cat.model_json_schema()['properties']['toys']['special'] == {'name': 'bird'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_hashable_types_test_hashable_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_hashable_types_test_hashable_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": 4904, "end_line": 4936, "span_ids": ["test_hashable_types"], "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": "@pytest.mark.parametrize(\n 'metadata,json_schema',\n [\n (\n WithJsonSchema({'type': 'float'}),\n {\n 'properties': {'x': {'anyOf': [{'type': 'float'}, {'type': 'null'}], 'title': 'X'}},\n 'required': ['x'],\n 'title': 'Model',\n 'type': 'object',\n },\n ),\n (\n Examples({'Custom Example': [1, 2, 3]}),\n {\n 'properties': {\n 'x': {\n 'anyOf': [{'examples': {'Custom Example': [1, 2, 3]}, 'type': 'integer'}, {'type': 'null'}],\n 'title': 'X',\n }\n },\n 'required': ['x'],\n 'title': 'Model',\n 'type': 'object',\n },\n ),\n ],\n)\ndef test_hashable_types(metadata, json_schema):\n class Model(BaseModel):\n x: Union[Annotated[int, metadata], None]\n\n assert Model.model_json_schema() == 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_skip_json_schema_annotation_test_skip_json_schema_annotation.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_skip_json_schema_annotation_test_skip_json_schema_annotation.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": 5232, "end_line": 5248, "span_ids": ["test_skip_json_schema_annotation"], "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_skip_json_schema_annotation() -> None:\n class Model(BaseModel):\n x: Union[int, SkipJsonSchema[None]] = None\n y: Union[int, SkipJsonSchema[None]] = 1\n z: Union[int, SkipJsonSchema[str]] = 'foo'\n\n assert Model(y=None).y is None\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'properties': {\n 'x': {'default': None, 'title': 'X', 'type': 'integer'},\n 'y': {'default': 1, 'title': 'Y', 'type': 'integer'},\n 'z': {'default': 'foo', 'title': 'Z', 'type': 'integer'},\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_skip_json_schema_exclude_default_test_skip_json_schema_exclude_default.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_skip_json_schema_exclude_default_test_skip_json_schema_exclude_default.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": 5251, "end_line": 5263, "span_ids": ["test_skip_json_schema_exclude_default"], "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": "def test_skip_json_schema_exclude_default():\n class Model(BaseModel):\n x: Union[int, SkipJsonSchema[None]] = Field(default=None, json_schema_extra=lambda s: s.pop('default'))\n\n assert Model().x is None\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'properties': {\n 'x': {'title': 'X', 'type': 'integer'},\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_json_schema_keys_sorting_test_json_schema_keys_sorting.assert_json_dumps_actual_": {"__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_keys_sorting_test_json_schema_keys_sorting.assert_json_dumps_actual_", "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": 5305, "end_line": 5342, "span_ids": ["test_json_schema_keys_sorting"], "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_json_schema_keys_sorting() -> None:\n \"\"\"We sort all keys except those under a 'property' parent key\"\"\"\n\n class Model(BaseModel):\n b: int\n a: str\n\n class OuterModel(BaseModel):\n inner: List[Model] = Field(default=[Model(b=1, a='fruit')])\n\n # verify the schema contents\n # this is just to get a nicer error message / diff if it fails\n expected = {\n '$defs': {\n 'Model': {\n 'properties': {'b': {'title': 'B', 'type': 'integer'}, 'a': {'title': 'A', 'type': 'string'}},\n 'required': ['b', 'a'],\n 'title': 'Model',\n 'type': 'object',\n }\n },\n 'properties': {\n 'inner': {\n 'default': [{'b': 1, 'a': 'fruit'}],\n 'items': {'$ref': '#/$defs/Model'},\n 'title': 'Inner',\n 'type': 'array',\n }\n },\n 'title': 'OuterModel',\n 'type': 'object',\n }\n actual = OuterModel.model_json_schema()\n assert actual == expected\n\n # verify order\n # dumping to json just happens to be a simple way to verify the order\n assert json.dumps(actual, indent=2) == json.dumps(expected, indent=2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_custom_type_gets_unpacked_ref_test_custom_type_gets_unpacked_ref.assert_ta_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_custom_type_gets_unpacked_ref_test_custom_type_gets_unpacked_ref.assert_ta_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": 5345, "end_line": 5379, "span_ids": ["test_custom_type_gets_unpacked_ref"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_custom_type_gets_unpacked_ref() -> None:\n class Annotation:\n def __get_pydantic_json_schema__(\n self, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = handler(schema)\n assert '$ref' in json_schema\n json_schema['title'] = 'Set from annotation'\n return json_schema\n\n class Model(BaseModel):\n x: int\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = handler(schema)\n assert json_schema['type'] == 'object' and '$ref' not in json_schema\n return json_schema\n\n ta = TypeAdapter(Annotated[Model, Annotation()])\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {\n '$defs': {\n 'Model': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Model',\n 'type': 'object',\n }\n },\n 'allOf': [{'$ref': '#/$defs/Model'}],\n 'title': 'Set from annotation',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_field_json_schema_metadata_test_field_json_schema_metadata.assert_ta_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_field_json_schema_metadata_test_field_json_schema_metadata.assert_ta_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": 5382, "end_line": 5401, "span_ids": ["test_field_json_schema_metadata"], "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.parametrize(\n 'annotation, expected',\n [\n (Annotated[int, Field(json_schema_extra={'title': 'abc'})], {'type': 'integer', 'title': 'abc'}),\n (\n Annotated[int, Field(title='abc'), Field(description='xyz')],\n {'type': 'integer', 'title': 'abc', 'description': 'xyz'},\n ),\n (Annotated[int, Field(gt=0)], {'type': 'integer', 'exclusiveMinimum': 0}),\n (\n Annotated[int, Field(gt=0), Field(lt=100)],\n {'type': 'integer', 'exclusiveMinimum': 0, 'exclusiveMaximum': 100},\n ),\n (Annotated[int, Field(examples={'number': 1})], {'type': 'integer', 'examples': {'number': 1}}),\n ],\n ids=repr,\n)\ndef test_field_json_schema_metadata(annotation: Type[Any], expected: JsonSchemaValue) -> None:\n ta = TypeAdapter(annotation)\n assert ta.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_multiple_models_with_same_qualname_test_multiple_models_with_same_qualname.assert_model_c_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_multiple_models_with_same_qualname_test_multiple_models_with_same_qualname.assert_model_c_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": 5404, "end_line": 5445, "span_ids": ["test_multiple_models_with_same_qualname"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_multiple_models_with_same_qualname():\n from pydantic import create_model\n\n model_a1 = create_model(\n 'A',\n inner_a1=(str, ...),\n )\n model_a2 = create_model(\n 'A',\n inner_a2=(str, ...),\n )\n\n model_c = create_model(\n 'B',\n outer_a1=(model_a1, ...),\n outer_a2=(model_a2, ...),\n )\n\n # insert_assert(model_c.model_json_schema())\n assert model_c.model_json_schema() == {\n '$defs': {\n 'tests__test_json_schema__A__1': {\n 'properties': {'inner_a1': {'title': 'Inner A1', 'type': 'string'}},\n 'required': ['inner_a1'],\n 'title': 'A',\n 'type': 'object',\n },\n 'tests__test_json_schema__A__2': {\n 'properties': {'inner_a2': {'title': 'Inner A2', 'type': 'string'}},\n 'required': ['inner_a2'],\n 'title': 'A',\n 'type': 'object',\n },\n },\n 'properties': {\n 'outer_a1': {'$ref': '#/$defs/tests__test_json_schema__A__1'},\n 'outer_a2': {'$ref': '#/$defs/tests__test_json_schema__A__2'},\n },\n 'required': ['outer_a1', 'outer_a2'],\n 'title': 'B',\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_generate_definitions_for_no_ref_schemas_test_generate_definitions_for_no_ref_schemas.assert_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_generate_definitions_for_no_ref_schemas_test_generate_definitions_for_no_ref_schemas.assert_result_", "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": 5448, "end_line": 5468, "span_ids": ["test_generate_definitions_for_no_ref_schemas"], "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_generate_definitions_for_no_ref_schemas():\n decimal_schema = TypeAdapter(Decimal).core_schema\n\n class Model(BaseModel):\n pass\n\n result = GenerateJsonSchema().generate_definitions(\n [\n ('Decimal', 'validation', decimal_schema),\n ('Decimal', 'serialization', decimal_schema),\n ('Model', 'validation', Model.__pydantic_core_schema__),\n ]\n )\n assert result == (\n {\n ('Decimal', 'serialization'): {'type': 'string'},\n ('Decimal', 'validation'): {'anyOf': [{'type': 'number'}, {'type': 'string'}]},\n ('Model', 'validation'): {'$ref': '#/$defs/Model'},\n },\n {'Model': {'properties': {}, 'title': 'Model', '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_chain_schema_test_chain_schema.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_chain_schema_test_chain_schema.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": 5471, "end_line": 5477, "span_ids": ["test_chain_schema"], "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": "def test_chain_schema():\n # this is a contrived schema which requires a string input that can be coerced to an int:\n s = core_schema.chain_schema([core_schema.str_schema(), core_schema.int_schema()])\n assert SchemaValidator(s).validate_python('1') == 1 # proof it works this way\n\n assert GenerateJsonSchema().generate(s, mode='validation') == {'type': 'string'}\n assert GenerateJsonSchema().generate(s, mode='serialization') == {'type': '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/test_json_schema.py_test_deferred_json_schema_test_dollar_ref_alias.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_deferred_json_schema_test_dollar_ref_alias.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": 5480, "end_line": 5509, "span_ids": ["test_dollar_ref_alias", "test_deferred_json_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": "def test_deferred_json_schema():\n class Foo(BaseModel):\n x: 'Bar'\n\n with pytest.raises(PydanticUserError, match='`Foo` is not fully defined'):\n Foo.model_json_schema()\n\n class Bar(BaseModel):\n pass\n\n Foo.model_rebuild()\n assert Foo.model_json_schema() == {\n '$defs': {'Bar': {'properties': {}, 'title': 'Bar', 'type': 'object'}},\n 'properties': {'x': {'$ref': '#/$defs/Bar'}},\n 'required': ['x'],\n 'title': 'Foo',\n 'type': 'object',\n }\n\n\ndef test_dollar_ref_alias():\n class MyModel(BaseModel):\n my_field: str = Field(alias='$ref')\n\n assert MyModel.model_json_schema() == {\n 'properties': {'$ref': {'title': '$Ref', 'type': 'string'}},\n 'required': ['$ref'],\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_multiple_parametrization_of_generic_model_test_multiple_parametrization_of_generic_model.assert_calls_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_multiple_parametrization_of_generic_model_test_multiple_parametrization_of_generic_model.assert_calls_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": 5512, "end_line": 5547, "span_ids": ["test_multiple_parametrization_of_generic_model"], "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_multiple_parametrization_of_generic_model() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6708\"\"\"\n T = TypeVar('T')\n\n calls = 0\n\n class Inner(BaseModel):\n a: int\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n nonlocal calls\n calls += 1\n json_schema = handler(core_schema)\n return json_schema\n\n class Outer(BaseModel, Generic[T]):\n b: Optional[T]\n\n class ModelTest(BaseModel):\n c: Outer[Inner]\n\n for _ in range(sys.getrecursionlimit() + 1):\n\n class ModelTest(BaseModel):\n c: Outer[Inner]\n\n ModelTest.model_json_schema()\n\n # this is not necessarily a promise we make\n # (in fact, we've had bugs in the past where this was not the case and we'd\n # call the __get_pydantic_json_schema__ method multiple times)\n # but it's much easier to test for than absence of a recursion limit\n assert 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_json_schema.py_test_callable_json_schema_extra_test_callable_json_schema_extra.for_key_in_abc_._default_is_not_present": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_test_callable_json_schema_extra.for_key_in_abc_._default_is_not_present", "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": 5550, "end_line": 5568, "span_ids": ["test_callable_json_schema_extra"], "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_callable_json_schema_extra():\n def pop_default(s):\n s.pop('default')\n\n class Model(BaseModel):\n a: int = Field(default=1, json_schema_extra=pop_default)\n b: Annotated[int, Field(default=2), Field(json_schema_extra=pop_default)]\n c: Annotated[int, Field(default=3)] = Field(json_schema_extra=pop_default)\n\n assert Model().model_dump() == {'a': 1, 'b': 2, 'c': 3}\n assert Model(a=11, b=12, c=13).model_dump() == {\n 'a': 11,\n 'b': 12,\n 'c': 13,\n }\n\n json_schema = Model.model_json_schema()\n for key in 'abc':\n assert json_schema['properties'][key] == {'title': key.upper(), 'type': 'integer'} # default is not present", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_json_schema_extra_dataclass_test_callable_json_schema_extra_dataclass.MyDataclass.f.Field_json_schema_extra_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_dataclass_test_callable_json_schema_extra_dataclass.MyDataclass.f.Field_json_schema_extra_p", "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": 5571, "end_line": 5585, "span_ids": ["test_callable_json_schema_extra_dataclass"], "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_callable_json_schema_extra_dataclass():\n def pop_default(s):\n s.pop('default')\n\n @pydantic.dataclasses.dataclass\n class MyDataclass:\n # Note that a and b here have to come first since dataclasses requires annotation-only fields to come before\n # fields with defaults (for similar reasons to why function arguments with defaults must come later)\n # But otherwise, evnerything seems to work properly\n a: Annotated[int, Field(json_schema_extra=pop_default), Field(default=1)]\n b: Annotated[int, Field(default=2), Field(json_schema_extra=pop_default)]\n c: int = Field(default=3, json_schema_extra=pop_default)\n d: Annotated[int, Field(json_schema_extra=pop_default)] = 4\n e: Annotated[int, Field(json_schema_extra=pop_default)] = Field(default=5)\n f: Annotated[int, Field(default=6)] = Field(json_schema_extra=pop_default)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_dataclass.adapter_test_callable_json_schema_extra_dataclass.for_key_in_abcdef_._default_is_not_present": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_callable_json_schema_extra_dataclass.adapter_test_callable_json_schema_extra_dataclass.for_key_in_abcdef_._default_is_not_present", "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": 5587, "end_line": 5600, "span_ids": ["test_callable_json_schema_extra_dataclass"], "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_callable_json_schema_extra_dataclass():\n # ... other code\n\n adapter = TypeAdapter(MyDataclass)\n assert adapter.dump_python(MyDataclass()) == {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6}\n assert adapter.dump_python(MyDataclass(a=11, b=12, c=13, d=14, e=15, f=16)) == {\n 'a': 11,\n 'b': 12,\n 'c': 13,\n 'd': 14,\n 'e': 15,\n 'f': 16,\n }\n\n json_schema = adapter.json_schema()\n for key in 'abcdef':\n assert json_schema['properties'][key] == {'title': key.upper(), 'type': 'integer'} # default is not present", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_rebuild_happens_even_with_parent_classes_test_model_rebuild_happens_even_with_parent_classes.assert_module_B_model_jso": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_model_rebuild_happens_even_with_parent_classes_test_model_rebuild_happens_even_with_parent_classes.assert_module_B_model_jso", "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": 5603, "end_line": 5633, "span_ids": ["test_model_rebuild_happens_even_with_parent_classes"], "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_model_rebuild_happens_even_with_parent_classes(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\nfrom pydantic import BaseModel\n\nclass MyBaseModel(BaseModel):\n pass\n\nclass B(MyBaseModel):\n b: A\n\nclass A(MyBaseModel):\n a: str\n \"\"\"\n )\n assert module.B.model_json_schema() == {\n '$defs': {\n 'A': {\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'A',\n 'type': 'object',\n }\n },\n 'properties': {'b': {'$ref': '#/$defs/A'}},\n 'required': ['b'],\n 'title': 'B',\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_complex_value_test_json_schema_serialization_defaults_required.assert_sdr_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_enum_complex_value_test_json_schema_serialization_defaults_required.assert_sdr_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": 5636, "end_line": 5660, "span_ids": ["test_enum_complex_value", "test_json_schema_serialization_defaults_required"], "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_enum_complex_value() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/7045\"\"\"\n\n class MyEnum(Enum):\n foo = (1, 2)\n bar = (2, 3)\n\n ta = TypeAdapter(MyEnum)\n\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {'enum': [[1, 2], [2, 3]], 'title': 'MyEnum', 'type': 'array'}\n\n\ndef test_json_schema_serialization_defaults_required():\n class Model(BaseModel):\n a: str = 'a'\n\n class SerializationDefaultsRequiredModel(Model):\n model_config = ConfigDict(json_schema_serialization_defaults_required=True)\n\n model_schema = Model.model_json_schema(mode='serialization')\n sdr_model_schema = SerializationDefaultsRequiredModel.model_json_schema(mode='serialization')\n\n assert 'required' not in model_schema\n assert sdr_model_schema['required'] == ['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_json_schema.py_test_json_schema_mode_override_test_json_schema_mode_override.None_4": {"__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_mode_override_test_json_schema_mode_override.None_4", "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": 5663, "end_line": 5686, "span_ids": ["test_json_schema_mode_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_schema_mode_override():\n class Model(BaseModel):\n a: Json[int] # requires a string to validate, but will dump an int\n\n class ValidationModel(Model):\n model_config = ConfigDict(json_schema_mode_override='validation', title='Model')\n\n class SerializationModel(Model):\n model_config = ConfigDict(json_schema_mode_override='serialization', title='Model')\n\n # Ensure the ValidationModel and SerializationModel schemas do not depend on the value of the mode\n assert ValidationModel.model_json_schema(mode='validation') == ValidationModel.model_json_schema(\n mode='serialization'\n )\n assert SerializationModel.model_json_schema(mode='validation') == SerializationModel.model_json_schema(\n mode='serialization'\n )\n\n # Ensure the two submodels models have different JSON schemas\n assert ValidationModel.model_json_schema() != SerializationModel.model_json_schema()\n\n # Ensure the submodels' JSON schemas match the expected mode even when the opposite value is specified:\n assert ValidationModel.model_json_schema(mode='serialization') == Model.model_json_schema(mode='validation')\n assert SerializationModel.model_json_schema(mode='validation') == Model.model_json_schema(mode='serialization')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_models_json_schema_generics_test_models_json_schema_generics.assert_models_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_models_json_schema_generics_test_models_json_schema_generics.assert_models_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": 5689, "end_line": 5726, "span_ids": ["test_models_json_schema_generics"], "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_models_json_schema_generics() -> None:\n class G(BaseModel, Generic[T]):\n foo: T\n\n class M(BaseModel):\n foo: Literal['a', 'b']\n\n GLiteral = G[Literal['a', 'b']]\n\n assert models_json_schema(\n [\n (GLiteral, 'serialization'),\n (GLiteral, 'validation'),\n (M, 'validation'),\n ]\n ) == (\n {\n (GLiteral, 'serialization'): {'$ref': '#/$defs/G_Literal__a____b___'},\n (GLiteral, 'validation'): {'$ref': '#/$defs/G_Literal__a____b___'},\n (M, 'validation'): {'$ref': '#/$defs/M'},\n },\n {\n '$defs': {\n 'G_Literal__a____b___': {\n 'properties': {'foo': {'enum': ['a', 'b'], 'title': 'Foo', 'type': 'string'}},\n 'required': ['foo'],\n 'title': \"G[Literal['a', 'b']]\",\n 'type': 'object',\n },\n 'M': {\n 'properties': {'foo': {'enum': ['a', 'b'], 'title': 'Foo', 'type': 'string'}},\n 'required': ['foo'],\n 'title': 'M',\n 'type': 'object',\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/tests/test_json_schema.py_test_recursive_non_generic_model_test_recursive_non_generic_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_recursive_non_generic_model_test_recursive_non_generic_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": 5729, "end_line": 5755, "span_ids": ["test_recursive_non_generic_model"], "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_recursive_non_generic_model() -> None:\n class Foo(BaseModel):\n maybe_bar: Union[None, 'Bar']\n\n class Bar(BaseModel):\n foo: Foo\n\n # insert_assert(Bar(foo=Foo(maybe_bar=None)).model_dump())\n assert Bar.model_validate({'foo': {'maybe_bar': None}}).model_dump() == {'foo': {'maybe_bar': None}}\n # insert_assert(Bar.model_json_schema())\n assert Bar.model_json_schema() == {\n '$defs': {\n 'Bar': {\n 'properties': {'foo': {'$ref': '#/$defs/Foo'}},\n 'required': ['foo'],\n 'title': 'Bar',\n 'type': 'object',\n },\n 'Foo': {\n 'properties': {'maybe_bar': {'anyOf': [{'$ref': '#/$defs/Bar'}, {'type': 'null'}]}},\n 'required': ['maybe_bar'],\n 'title': 'Foo',\n 'type': 'object',\n },\n },\n 'allOf': [{'$ref': '#/$defs/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_main.py_parent_sub_model_fixture_test_not_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_parent_sub_model_fixture_test_not_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": 185, "end_line": 226, "span_ids": ["test_not_required", "parent_sub_model_fixture", "test_parent_sub_model_fails", "test_parent_sub_model"], "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": "@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(include_url=False) == [\n {\n 'type': 'float_type',\n 'loc': ('a',),\n 'msg': 'Input should be a valid number',\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_test_allow_extra_test_allow_extra.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_allow_extra_test_allow_extra.assert_m_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": 229, "end_line": 243, "span_ids": ["test_allow_extra"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_allow_extra():\n class Model(BaseModel):\n model_config = ConfigDict(extra='allow')\n a: float\n\n m = Model(a='10.2', b=12)\n assert m.__dict__ == {'a': 10.2}\n assert m.__pydantic_extra__ == {'b': 12}\n assert m.a == 10.2\n assert m.b == 12\n assert m.model_extra == {'b': 12}\n m.c = 42\n assert 'c' not in m.__dict__\n assert m.__pydantic_extra__ == {'b': 12, 'c': 42}\n assert m.model_dump() == {'a': 10.2, 'b': 12, 'c': 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_main.py_test_allow_extra_from_attributes_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_test_allow_extra_from_attributes_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": 246, "end_line": 276, "span_ids": ["test_allow_extra_from_attributes", "test_forbidden_extra_success", "test_allow_extra_repr"], "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('extra', ['ignore', 'forbid', 'allow'])\ndef test_allow_extra_from_attributes(extra: Literal['ignore', 'forbid', 'allow']):\n class Model(BaseModel):\n a: float\n\n model_config = ConfigDict(extra=extra, from_attributes=True)\n\n class TestClass:\n a = 1.0\n b = 12\n\n m = Model.model_validate(TestClass())\n assert m.a == 1.0\n assert not hasattr(m, 'b')\n\n\ndef test_allow_extra_repr():\n class Model(BaseModel):\n model_config = ConfigDict(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='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_assign_extra_no_validate_test_extra_allowed.assert_model_c_1": {"__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_extra_allowed.assert_model_c_1", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 343, "span_ids": ["test_model_property_attribute_error", "test_extra_allowed", "test_assign_extra_no_validate", "test_assign_extra_validate"], "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_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_model_property_attribute_error():\n class Model(BaseModel):\n @property\n def a_property(self):\n raise AttributeError('Internal Error')\n\n with pytest.raises(AttributeError, match='Internal Error'):\n Model().a_property\n\n\ndef test_extra_allowed():\n class Model(BaseModel):\n model_config = ConfigDict(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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_reassign_instance_method_with_extra_allow_test_extra_ignored.assert_model_model_extra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_reassign_instance_method_with_extra_allow_test_extra_ignored.assert_model_model_extra_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 346, "end_line": 376, "span_ids": ["test_extra_ignored", "test_reassign_instance_method_with_extra_allow"], "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_reassign_instance_method_with_extra_allow():\n class Model(BaseModel):\n model_config = ConfigDict(extra='allow')\n name: str\n\n def not_extra_func(self) -> str:\n return f'hello {self.name}'\n\n def not_extra_func_replacement(self_sub: Model) -> str:\n return f'hi {self_sub.name}'\n\n m = Model(name='james')\n assert m.not_extra_func() == 'hello james'\n\n m.not_extra_func = partial(not_extra_func_replacement, m)\n assert m.not_extra_func() == 'hi james'\n assert 'not_extra_func' in m.__dict__\n\n\ndef test_extra_ignored():\n class Model(BaseModel):\n model_config = ConfigDict(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 \"b\"'):\n model.b = 1\n\n assert model.model_extra 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_model_extra_is_none_when_extra_is_forbid_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_model_extra_is_none_when_extra_is_forbid_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": 420, "end_line": 479, "span_ids": ["test_field_order", "test_set_attr_invalid", "test_any", "test_population_by_field_name", "test_model_extra_is_none_when_extra_is_forbid", "test_set_attr"], "tokens": 430}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_model_extra_is_none_when_extra_is_forbid():\n class Foo(BaseModel):\n model_config = ConfigDict(extra='forbid')\n\n assert Foo().model_extra is None\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_mutability.assert_m_a_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_required_test_mutability.assert_m_a_11", "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": 508, "span_ids": ["test_mutability", "test_required"], "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_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(include_url=False) == [\n {'type': 'missing', 'loc': ('a',), 'msg': 'Field required', 'input': {}}\n ]\n\n\ndef test_mutability():\n class TestModel(BaseModel):\n a: int = 10\n\n model_config = ConfigDict(extra='forbid', frozen=False)\n\n m = TestModel()\n\n assert m.a == 10\n m.a = 11\n assert m.a == 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_main.py_test_frozen_model_test_frozen_model.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_frozen_model_test_frozen_model.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": 511, "end_line": 532, "span_ids": ["test_frozen_model"], "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_frozen_model():\n class FrozenModel(BaseModel):\n model_config = ConfigDict(extra='forbid', frozen=True)\n\n a: int = 10\n\n m = FrozenModel()\n assert m.a == 10\n\n with pytest.raises(ValidationError) as exc_info:\n m.a = 11\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_instance', 'loc': ('a',), 'msg': 'Instance is frozen', 'input': 11}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n del m.a\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_instance', 'loc': ('a',), 'msg': 'Instance is frozen', 'input': None}\n ]\n\n assert m.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_frozen_field_test_frozen_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_frozen_field_test_frozen_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": 535, "end_line": 554, "span_ids": ["test_frozen_field"], "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_frozen_field():\n class FrozenModel(BaseModel):\n a: int = Field(10, frozen=True)\n\n m = FrozenModel()\n assert m.a == 10\n\n with pytest.raises(ValidationError) as exc_info:\n m.a = 11\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_field', 'loc': ('a',), 'msg': 'Field is frozen', 'input': 11}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n del m.a\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_field', 'loc': ('a',), 'msg': 'Field is frozen', 'input': None}\n ]\n\n assert m.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_validating_assignment_fail_test_validating_assignment_fail.None_1": {"__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_validating_assignment_fail.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": 720, "end_line": 744, "span_ids": ["test_validating_assignment_fail"], "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_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(include_url=False) == [\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(include_url=False) == [\n {\n 'type': 'string_too_short',\n 'loc': ('b',),\n 'msg': 'String should have at least 1 character',\n 'input': '',\n 'ctx': {'min_length': 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_main.py_Foo_test_enum_values.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_Foo_test_enum_values.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": 704, "end_line": 723, "span_ids": ["Foo", "test_enum_values"], "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 Foo(Enum):\n foo = 'foo'\n bar = 'bar'\n\n\n@pytest.mark.parametrize('value', [Foo.foo, Foo.foo.value, 'foo'])\ndef test_enum_values(value: Any) -> None:\n class Model(BaseModel):\n foo: Foo\n model_config = ConfigDict(use_enum_values=True)\n\n m = Model(foo=value)\n\n foo = m.foo\n assert type(foo) is str, type(foo)\n assert foo == 'foo'\n\n foo = m.model_dump()['foo']\n assert type(foo) is str, type(foo)\n assert 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_main.py_test_strict_enum_values_OtherClass.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_strict_enum_values_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": 754, "end_line": 827, "span_ids": ["test_strict_enum_values", "ArbitraryType", "OtherClass", "test_arbitrary_type_allowed_validation_success", "test_enum_raw", "test_default_copy", "test_union_enum_values", "test_set_tuple_values"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_strict_enum_values():\n class MyEnum(Enum):\n val = 'val'\n\n class Model(BaseModel):\n model_config = ConfigDict(use_enum_values=True)\n x: MyEnum\n\n assert Model.model_validate({'x': MyEnum.val}, strict=True).x == 'val'\n\n\ndef test_union_enum_values():\n class MyEnum(Enum):\n val = 'val'\n\n class NormalModel(BaseModel):\n x: Union[MyEnum, int]\n\n class UseEnumValuesModel(BaseModel):\n model_config = ConfigDict(use_enum_values=True)\n x: Union[MyEnum, int]\n\n assert NormalModel(x=MyEnum.val).x != 'val'\n assert UseEnumValuesModel(x=MyEnum.val).x == 'val'\n\n\ndef 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_model_iteration_extra_test_model_iteration_extra.assert_dict_m_a_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_iteration_extra_test_model_iteration_extra.assert_dict_m_a_1", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1113, "end_line": 1125, "span_ids": ["test_model_iteration_extra"], "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_model_iteration_extra() -> None:\n class Foo(BaseModel):\n x: int = 1\n\n class Bar(BaseModel):\n a: int\n b: Foo\n model_config = ConfigDict(extra='allow')\n\n m = Bar.model_validate({'a': 1, 'b': {}, 'c': 2, 'd': Foo()})\n assert m.model_dump() == {'a': 1, 'b': {'x': 1}, 'c': 2, 'd': {'x': 1}}\n assert list(m) == [('a', 1), ('b', Foo()), ('c', 2), ('d', Foo())]\n assert dict(m) == {'a': 1, 'b': Foo(), 'c': 2, '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_frozen_field_with_validate_assignment_test_frozen_field_with_validate_assignment.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_frozen_field_with_validate_assignment_test_frozen_field_with_validate_assignment.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": 1715, "end_line": 1732, "span_ids": ["test_frozen_field_with_validate_assignment"], "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_frozen_field_with_validate_assignment():\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(ValidationError) as exc_info:\n r.id = 2\n assert exc_info.value.errors(include_url=False) == [\n {'input': 2, 'loc': ('id',), 'msg': 'Field is frozen', 'type': 'frozen_field'}\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_decl_without_default_val_test_frozen_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_frozen_field_decl_without_default_val_test_frozen_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": 1863, "end_line": 1883, "span_ids": ["test_frozen_field_decl_without_default_val"], "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": "@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_frozen_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 assert 'a' not in Model.__class_vars__\n assert 'a' in Model.model_fields\n\n assert Model.model_fields['a'].frozen", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_not_called_without_override_test_model_post_init_subclass_private_attrs.assert_calls_C_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_post_init_not_called_without_override_test_model_post_init_subclass_private_attrs.assert_calls_C_model", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1991, "end_line": 2039, "span_ids": ["test_model_post_init_subclass_private_attrs", "test_post_init_not_called_without_override"], "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_post_init_not_called_without_override():\n calls = []\n\n def monkey_patched_model_post_init(cls, __context):\n calls.append('BaseModel.model_post_init')\n\n original_base_model_post_init = BaseModel.model_post_init\n try:\n BaseModel.model_post_init = monkey_patched_model_post_init\n\n class WithoutOverrideModel(BaseModel):\n pass\n\n WithoutOverrideModel()\n WithoutOverrideModel.model_construct()\n assert calls == []\n\n class WithOverrideModel(BaseModel):\n def model_post_init(self, __context: Any) -> None:\n calls.append('WithOverrideModel.model_post_init')\n\n WithOverrideModel()\n assert calls == ['WithOverrideModel.model_post_init']\n WithOverrideModel.model_construct()\n assert calls == ['WithOverrideModel.model_post_init', 'WithOverrideModel.model_post_init']\n\n finally:\n BaseModel.model_post_init = original_base_model_post_init\n\n\ndef test_model_post_init_subclass_private_attrs():\n \"\"\"https://github.com/pydantic/pydantic/issues/7293\"\"\"\n calls = []\n\n class A(BaseModel):\n a: int = 1\n\n def model_post_init(self, __context: Any) -> None:\n calls.append(f'{self.__class__.__name__}.model_post_init')\n\n class B(A):\n pass\n\n class C(B):\n _private: bool = True\n\n C()\n\n assert calls == ['C.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_model_post_init_subclass_setting_private_attrs_test_model_post_init_subclass_setting_private_attrs.with_pytest_raises_Attrib.assert_m__priv6_94": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_post_init_subclass_setting_private_attrs_test_model_post_init_subclass_setting_private_attrs.with_pytest_raises_Attrib.assert_m__priv6_94", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2042, "end_line": 2071, "span_ids": ["test_model_post_init_subclass_setting_private_attrs"], "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_model_post_init_subclass_setting_private_attrs():\n \"\"\"https://github.com/pydantic/pydantic/issues/7091\"\"\"\n\n class Model(BaseModel):\n _priv1: int = PrivateAttr(91)\n _priv2: int = PrivateAttr(92)\n\n def model_post_init(self, __context) -> None:\n self._priv1 = 100\n\n class SubModel(Model):\n _priv3: int = PrivateAttr(93)\n _priv4: int = PrivateAttr(94)\n _priv5: int = PrivateAttr()\n _priv6: int = PrivateAttr()\n\n def model_post_init(self, __context) -> None:\n self._priv3 = 200\n self._priv5 = 300\n super().model_post_init(__context)\n\n m = SubModel()\n\n assert m._priv1 == 100\n assert m._priv2 == 92\n assert m._priv3 == 200\n assert m._priv4 == 94\n assert m._priv5 == 300\n with pytest.raises(AttributeError):\n assert m._priv6 == 94", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_post_init_correct_mro_test_deeper_recursive_model.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_post_init_correct_mro_test_deeper_recursive_model.assert_m_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": 2074, "end_line": 2110, "span_ids": ["test_model_post_init_correct_mro", "test_deeper_recursive_model"], "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_model_post_init_correct_mro():\n \"\"\"https://github.com/pydantic/pydantic/issues/7293\"\"\"\n calls = []\n\n class A(BaseModel):\n a: int = 1\n\n class B(BaseModel):\n b: int = 1\n\n def model_post_init(self, __context: Any) -> None:\n calls.append(f'{self.__class__.__name__}.model_post_init')\n\n class C(A, B):\n _private: bool = True\n\n C()\n\n assert calls == ['C.model_post_init']\n\n\ndef test_deeper_recursive_model():\n class A(BaseModel):\n b: 'B'\n\n class B(BaseModel):\n c: 'C'\n\n class C(BaseModel):\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}}}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_rebuild_localns_test_model_rebuild_localns.with_pytest_raises_Pydant.C_model_rebuild__types_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_rebuild_localns_test_model_rebuild_localns.with_pytest_raises_Pydant.C_model_rebuild__types_na", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2113, "end_line": 2130, "span_ids": ["test_model_rebuild_localns"], "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_model_rebuild_localns():\n class A(BaseModel):\n x: int\n\n class B(BaseModel):\n a: 'Model' # noqa: F821\n\n B.model_rebuild(_types_namespace={'Model': A})\n\n m = B(a={'x': 1})\n assert m.model_dump() == {'a': {'x': 1}}\n assert isinstance(m.a, A)\n\n class C(BaseModel):\n a: 'Model' # noqa: F821\n\n with pytest.raises(PydanticUndefinedAnnotation, match=\"name 'Model' is not defined\"):\n C.model_rebuild(_types_namespace={'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_main.py_test_protected_namespace_default_test_multiple_protected_namespace.with_pytest_warns_.Model.model_config.ConfigDict_protected_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_protected_namespace_default_test_multiple_protected_namespace.with_pytest_warns_.Model.model_config.ConfigDict_protected_name", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2471, "end_line": 2507, "span_ids": ["test_custom_protected_namespace", "test_protected_namespace_real_conflict", "test_protected_namespace_default", "test_multiple_protected_namespace"], "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_protected_namespace_default():\n with pytest.warns(UserWarning, match='Field \"model_prefixed_field\" has conflict with protected namespace \"model_\"'):\n\n class Model(BaseModel):\n model_prefixed_field: str\n\n\ndef test_protected_namespace_real_conflict():\n with pytest.raises(\n NameError, match=r'Field \"model_validate\" conflicts with member .* of protected namespace \"model_\"\\.'\n ):\n\n class Model(BaseModel):\n model_validate: str\n\n\ndef test_custom_protected_namespace():\n with pytest.warns(UserWarning, match='Field \"test_field\" has conflict with protected namespace \"test_\"'):\n\n class Model(BaseModel):\n # this field won't raise error because we changed the default value for the\n # `protected_namespaces` config.\n model_prefixed_field: str\n test_field: str\n\n model_config = ConfigDict(protected_namespaces=('test_',))\n\n\ndef test_multiple_protected_namespace():\n with pytest.warns(\n UserWarning, match='Field \"also_protect_field\" has conflict with protected namespace \"also_protect_\"'\n ):\n\n class Model(BaseModel):\n also_protect_field: str\n\n model_config = ConfigDict(protected_namespaces=('protect_me_', 'also_protect_'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_get_core_schema_test_model_get_core_schema.Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_get_core_schema_test_model_get_core_schema.Model_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2510, "end_line": 2522, "span_ids": ["test_model_get_core_schema"], "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_model_get_core_schema() -> None:\n class Model(BaseModel):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler(int)\n schema.pop('metadata', None) # we don't care about this in tests\n assert schema == {'type': 'int'}\n schema = handler.generate_schema(int)\n schema.pop('metadata', None) # we don't care about this in tests\n assert schema == {'type': 'int'}\n return handler(source_type)\n\n 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_validate_python_from_attributes_test_validate_python_from_attributes.assert_res_ModelFromAt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_validate_python_from_attributes_test_validate_python_from_attributes.assert_res_ModelFromAt", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2552, "end_line": 2614, "span_ids": ["test_validate_python_from_attributes"], "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 test_validate_python_from_attributes() -> None:\n class Model(BaseModel):\n x: int\n\n class ModelFromAttributesTrue(Model):\n model_config = ConfigDict(from_attributes=True)\n\n class ModelFromAttributesFalse(Model):\n model_config = ConfigDict(from_attributes=False)\n\n @dataclass\n class UnrelatedClass:\n x: int = 1\n\n input = UnrelatedClass(1)\n\n for from_attributes in (False, None):\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate(UnrelatedClass(), from_attributes=from_attributes)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of Model',\n 'input': input,\n 'ctx': {'class_name': 'Model'},\n }\n ]\n\n res = Model.model_validate(UnrelatedClass(), from_attributes=True)\n assert res == Model(x=1)\n\n with pytest.raises(ValidationError) as exc_info:\n ModelFromAttributesTrue.model_validate(UnrelatedClass(), from_attributes=False)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of ModelFromAttributesTrue',\n 'input': input,\n 'ctx': {'class_name': 'ModelFromAttributesTrue'},\n }\n ]\n\n for from_attributes in (True, None):\n res = ModelFromAttributesTrue.model_validate(UnrelatedClass(), from_attributes=from_attributes)\n assert res == ModelFromAttributesTrue(x=1)\n\n for from_attributes in (False, None):\n with pytest.raises(ValidationError) as exc_info:\n ModelFromAttributesFalse.model_validate(UnrelatedClass(), from_attributes=from_attributes)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of ModelFromAttributesFalse',\n 'input': input,\n 'ctx': {'class_name': 'ModelFromAttributesFalse'},\n }\n ]\n\n res = ModelFromAttributesFalse.model_validate(UnrelatedClass(), from_attributes=True)\n assert res == ModelFromAttributesFalse(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_main.py_test_model_validate_strings_test_model_validate_strings.if_raises_match_is_not_No.else_.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_strings_test_model_validate_strings.if_raises_match_is_not_No.else_.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2617, "end_line": 2650, "span_ids": ["test_model_validate_strings"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n 'field_type,input_value,expected,raises_match,strict',\n [\n (bool, 'true', True, None, False),\n (bool, 'true', True, None, True),\n (bool, 'false', False, None, False),\n (bool, 'e', ValidationError, 'type=bool_parsing', False),\n (int, '1', 1, None, False),\n (int, '1', 1, None, True),\n (int, 'xxx', ValidationError, 'type=int_parsing', True),\n (float, '1.1', 1.1, None, False),\n (float, '1.10', 1.1, None, False),\n (float, '1.1', 1.1, None, True),\n (float, '1.10', 1.1, None, True),\n (date, '2017-01-01', date(2017, 1, 1), None, False),\n (date, '2017-01-01', date(2017, 1, 1), None, True),\n (date, '2017-01-01T12:13:14.567', ValidationError, 'type=date_from_datetime_inexact', False),\n (date, '2017-01-01T12:13:14.567', ValidationError, 'type=date_parsing', True),\n (date, '2017-01-01T00:00:00', date(2017, 1, 1), None, False),\n (date, '2017-01-01T00:00:00', ValidationError, 'type=date_parsing', True),\n (datetime, '2017-01-01T12:13:14.567', datetime(2017, 1, 1, 12, 13, 14, 567_000), None, False),\n (datetime, '2017-01-01T12:13:14.567', datetime(2017, 1, 1, 12, 13, 14, 567_000), None, True),\n ],\n ids=repr,\n)\ndef test_model_validate_strings(field_type, input_value, expected, raises_match, strict):\n class Model(BaseModel):\n x: field_type\n\n if raises_match is not None:\n with pytest.raises(expected, match=raises_match):\n Model.model_validate_strings({'x': input_value}, strict=strict)\n else:\n assert Model.model_validate_strings({'x': input_value}, strict=strict).x == 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_main.py_test_model_validate_strings_dict_test_model_signature_annotated.assert_Model___signature_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_validate_strings_dict_test_model_signature_annotated.assert_Model___signature_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2653, "end_line": 2670, "span_ids": ["test_model_validate_strings_dict", "test_model_signature_annotated"], "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.mark.parametrize('strict', [True, False])\ndef test_model_validate_strings_dict(strict):\n class Model(BaseModel):\n x: Dict[int, date]\n\n assert Model.model_validate_strings({'x': {'1': '2017-01-01', '2': '2017-01-02'}}, strict=strict).x == {\n 1: date(2017, 1, 1),\n 2: date(2017, 1, 2),\n }\n\n\ndef test_model_signature_annotated() -> None:\n class Model(BaseModel):\n x: Annotated[int, 123]\n\n # we used to accidentally convert `__metadata__` to a list\n # which caused things like `typing.get_args()` to fail\n assert Model.__signature__.parameters['x'].annotation.__metadata__ == (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_main.py_test_super_getattr_extra_test_help.assert_class_Model_in_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_super_getattr_extra_test_help.assert_class_Model_in_m", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2871, "end_line": 2994, "span_ids": ["test_super_delattr_extra", "test_help", "test_super_getattr_extra", "test_super_getattr_private", "test_super_delattr_private", "test_deferred_core_schema", "test_arbitrary_types_not_a_type"], "tokens": 648}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_super_getattr_extra():\n class Model(BaseModel):\n model_config = {'extra': 'allow'}\n\n def __getattr__(self, item):\n if item == 'test':\n return 'success'\n return super().__getattr__(item)\n\n m = Model(x=1)\n assert m.x == 1\n with pytest.raises(AttributeError):\n m.y\n assert m.test == 'success'\n\n\ndef test_super_getattr_private():\n class Model(BaseModel):\n _x: int = PrivateAttr()\n\n def __getattr__(self, item):\n if item == 'test':\n return 'success'\n else:\n return super().__getattr__(item)\n\n m = Model()\n m._x = 1\n assert m._x == 1\n with pytest.raises(AttributeError):\n m._y\n assert m.test == 'success'\n\n\ndef test_super_delattr_extra():\n test_calls = []\n\n class Model(BaseModel):\n model_config = {'extra': 'allow'}\n\n def __delattr__(self, item):\n if item == 'test':\n test_calls.append('success')\n else:\n super().__delattr__(item)\n\n m = Model(x=1)\n assert m.x == 1\n del m.x\n with pytest.raises(AttributeError):\n m._x\n assert test_calls == []\n del m.test\n assert test_calls == ['success']\n\n\ndef test_super_delattr_private():\n test_calls = []\n\n class Model(BaseModel):\n _x: int = PrivateAttr()\n\n def __delattr__(self, item):\n if item == 'test':\n test_calls.append('success')\n else:\n super().__delattr__(item)\n\n m = Model()\n m._x = 1\n assert m._x == 1\n del m._x\n with pytest.raises(AttributeError):\n m._x\n assert test_calls == []\n del m.test\n assert test_calls == ['success']\n\n\ndef test_arbitrary_types_not_a_type() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6477\"\"\"\n\n class Foo:\n pass\n\n class Bar:\n pass\n\n with pytest.warns(UserWarning, match='is not a Python type'):\n ta = TypeAdapter(Foo(), config=ConfigDict(arbitrary_types_allowed=True))\n\n bar = Bar()\n assert ta.validate_python(bar) is bar\n\n\ndef test_deferred_core_schema() -> None:\n class Foo(BaseModel):\n x: 'Bar'\n\n with pytest.raises(PydanticUserError, match='`Foo` is not fully defined'):\n Foo.__pydantic_core_schema__\n\n class Bar(BaseModel):\n pass\n\n assert Foo.__pydantic_core_schema__\n\n\ndef test_help(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nimport pydoc\n\nfrom pydantic import BaseModel\n\nclass Model(BaseModel):\n x: int\n\n\nhelp_result_string = pydoc.render_doc(Model)\n\"\"\"\n )\n assert 'class Model' in module.help_result_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_main.py_test_cannot_use_leading_underscore_field_names_test_schema_generator_customize_type.assert_Model_x_1_x_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_cannot_use_leading_underscore_field_names_test_schema_generator_customize_type.assert_Model_x_1_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": 2956, "end_line": 2988, "span_ids": ["test_schema_generator_customize_type", "test_cannot_use_leading_underscore_field_names"], "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_cannot_use_leading_underscore_field_names():\n with pytest.raises(\n NameError, match=\"Fields must not use names with leading underscores; e.g., use 'x' instead of '_x'\"\n ):\n\n class Model1(BaseModel):\n _x: int = Field(alias='x')\n\n with pytest.raises(\n NameError, match=\"Fields must not use names with leading underscores; e.g., use 'x__' instead of '__x__'\"\n ):\n\n class Model2(BaseModel):\n __x__: int = Field()\n\n with pytest.raises(\n NameError, match=\"Fields must not use names with leading underscores; e.g., use 'my_field' instead of '___'\"\n ):\n\n class Model3(BaseModel):\n ___: int = Field(default=1)\n\n\ndef test_schema_generator_customize_type() -> None:\n class LaxStrGenerator(GenerateSchema):\n def str_schema(self) -> CoreSchema:\n return core_schema.no_info_plain_validator_function(str)\n\n class Model(BaseModel):\n x: str\n model_config = ConfigDict(schema_generator=LaxStrGenerator)\n\n assert Model(x=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_main.py_test_schema_generator_customize_type_constraints_test_schema_generator_customize_type_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_main.py_test_schema_generator_customize_type_constraints_test_schema_generator_customize_type_constraints.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": 2991, "end_line": 3031, "span_ids": ["test_schema_generator_customize_type_constraints"], "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_schema_generator_customize_type_constraints() -> None:\n class LaxStrGenerator(GenerateSchema):\n def str_schema(self) -> CoreSchema:\n return core_schema.no_info_plain_validator_function(str)\n\n class Model(BaseModel):\n x: Annotated[str, Field(pattern='^\\\\d+$')]\n y: Annotated[float, Field(gt=0)]\n z: Annotated[List[int], Field(min_length=1)]\n model_config = ConfigDict(schema_generator=LaxStrGenerator)\n\n # insert_assert(Model(x='123', y=1, z=[-1]).model_dump())\n assert Model(x='123', y=1, z=[-1]).model_dump() == {'x': '123', 'y': 1.0, 'z': [-1]}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x='abc', y=-1, z=[])\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'string_pattern_mismatch',\n 'loc': ('x',),\n 'msg': \"String should match pattern '^\\\\d+$'\",\n 'input': 'abc',\n 'ctx': {'pattern': '^\\\\d+$'},\n },\n {\n 'type': 'greater_than',\n 'loc': ('y',),\n 'msg': 'Input should be greater than 0',\n 'input': -1,\n 'ctx': {'gt': 0.0},\n },\n {\n 'type': 'too_short',\n 'loc': ('z',),\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_main.py_test_schema_generator_customize_type_constraints_order_test_schema_generator_customize_type_constraints_order.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_schema_generator_customize_type_constraints_order_test_schema_generator_customize_type_constraints_order.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": 3075, "end_line": 3094, "span_ids": ["test_schema_generator_customize_type_constraints_order"], "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_schema_generator_customize_type_constraints_order() -> None:\n class Model(BaseModel):\n # whitespace will be stripped first, then max length will be checked, should pass on ' 1 '\n x: Annotated[str, AfterValidator(lambda x: x.strip()), StringConstraints(max_length=1)]\n # max length will be checked first, then whitespace will be stripped, should fail on ' 1 '\n y: Annotated[str, StringConstraints(max_length=1), AfterValidator(lambda x: x.strip())]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=' 1 ', y=' 1 ')\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'string_too_long',\n 'loc': ('y',),\n 'msg': 'String should have at most 1 character',\n 'input': ' 1 ',\n 'ctx': {'max_length': 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_networks.py_test_mongodsn_default_ports_test_mongodsn_default_ports.assert_str_m_dsn_expe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_mongodsn_default_ports_test_mongodsn_default_ports.assert_str_m_dsn_expe", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 618, "end_line": 639, "span_ids": ["test_mongodsn_default_ports"], "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 ('dsn', 'expected'),\n [\n ('mongodb://user:pass@localhost/app', 'mongodb://user:pass@localhost:27017/app'),\n pytest.param(\n 'mongodb+srv://user:pass@localhost/app',\n 'mongodb+srv://user:pass@localhost/app',\n marks=pytest.mark.xfail(\n reason=(\n 'This case is not supported. '\n 'Check https://github.com/pydantic/pydantic/pull/7116 for more details.'\n )\n ),\n ),\n ],\n)\ndef test_mongodsn_default_ports(dsn: str, expected: str):\n class Model(BaseModel):\n dsn: MongoDsn\n\n m = Model(dsn=dsn)\n assert str(m.dsn) == 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_ipaddress.py_json_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_json_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": 43, "span_ids": ["imports", "test_ipaddress_success"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import json\nfrom 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_ipvany_serialization_test_ipvany_serialization.assert_json_loads_m_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks_ipaddress.py_test_ipvany_serialization_test_ipvany_serialization.assert_json_loads_m_model", "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": 352, "end_line": 363, "span_ids": ["test_ipvany_serialization"], "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_ipvany_serialization():\n class Model(BaseModel):\n address: IPvAnyAddress\n network: IPvAnyNetwork\n interface: IPvAnyInterface\n\n m = Model(address='127.0.0.1', network='192.0.2.0/27', interface='127.0.0.1/32')\n assert json.loads(m.model_dump_json()) == {\n 'address': '127.0.0.1',\n 'interface': '127.0.0.1/32',\n 'network': '192.0.2.0/27',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_dataclasses_IntWrapper.__eq__.return.self_get_other_get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_dataclasses_IntWrapper.__eq__.return.self_get_other_get_", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["IntWrapper", "imports", "IntWrapper.get", "IntWrapper.__init__", "IntWrapper.__eq__"], "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 dataclasses\nimport gc\nimport pickle\nfrom typing import Optional, Type\n\nimport cloudpickle\nimport pytest\n\nimport pydantic\nfrom pydantic import BaseModel, PositiveFloat, ValidationError\nfrom pydantic._internal._model_construction import _PydanticWeakRef\nfrom pydantic.config import ConfigDict\n\n\nclass IntWrapper:\n def __init__(self, v: int):\n self._v = v\n\n def get(self) -> int:\n return self._v\n\n def __eq__(self, other: 'IntWrapper') -> bool:\n return self.get() == other.get()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_test_pickle_pydantic_weakref_test_pickle_pydantic_weakref.assert_loaded_ref_out_of": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_test_pickle_pydantic_weakref_test_pickle_pydantic_weakref.assert_loaded_ref_out_of", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 60, "span_ids": ["test_pickle_pydantic_weakref"], "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 test_pickle_pydantic_weakref():\n obj1 = IntWrapper(1)\n ref1 = _PydanticWeakRef(obj1)\n assert ref1() is obj1\n\n obj2 = IntWrapper(2)\n ref2 = _PydanticWeakRef(obj2)\n assert ref2() is obj2\n\n ref3 = _PydanticWeakRef(IntWrapper(3))\n gc.collect() # PyPy does not use reference counting and always relies on GC.\n assert ref3() is None\n\n d = {\n # Hold a hard reference to the underlying object for ref1 that will also\n # be pickled.\n 'hard_ref': obj1,\n # ref1's underlying object has a hard reference in the pickled object so it\n # should maintain the reference after deserialization.\n 'has_hard_ref': ref1,\n # ref2's underlying object has no hard reference in the pickled object so it\n # should be `None` after deserialization.\n 'has_no_hard_ref': ref2,\n # ref3's underlying object had already gone out of scope before pickling so it\n # should be `None` after deserialization.\n 'ref_out_of_scope': ref3,\n }\n\n loaded = pickle.loads(pickle.dumps(d))\n gc.collect() # PyPy does not use reference counting and always relies on GC.\n\n assert loaded['hard_ref'] == IntWrapper(1)\n assert loaded['has_hard_ref']() is loaded['hard_ref']\n assert loaded['has_no_hard_ref']() is None\n assert loaded['ref_out_of_scope']() 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_pickle.py_ImportableModel_test_pickle_model.with_pytest_raises_Valida.model_type_foo_hi_val_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableModel_test_pickle_model.with_pytest_raises_Valida.model_type_foo_hi_val_", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 109, "span_ids": ["model_factory", "ImportableModel", "test_pickle_model"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportableModel(BaseModel):\n foo: str\n bar: Optional[str] = None\n val: PositiveFloat = 0.7\n\n\ndef model_factory() -> Type:\n class NonImportableModel(BaseModel):\n foo: str\n bar: Optional[str] = None\n val: PositiveFloat = 0.7\n\n return NonImportableModel\n\n\n@pytest.mark.parametrize(\n 'model_type,use_cloudpickle',\n [\n # Importable model can be pickled with either pickle or cloudpickle.\n (ImportableModel, False),\n (ImportableModel, True),\n # Locally-defined model can only be pickled with cloudpickle.\n (model_factory(), True),\n ],\n)\ndef test_pickle_model(model_type: Type, use_cloudpickle: bool):\n if use_cloudpickle:\n model_type = cloudpickle.loads(cloudpickle.dumps(model_type))\n else:\n model_type = pickle.loads(pickle.dumps(model_type))\n\n m = model_type(foo='hi', val=1)\n assert m.foo == 'hi'\n assert m.bar is None\n assert m.val == 1.0\n\n if use_cloudpickle:\n m = cloudpickle.loads(cloudpickle.dumps(m))\n else:\n m = pickle.loads(pickle.dumps(m))\n\n assert m.foo == 'hi'\n assert m.bar is None\n assert m.val == 1.0\n\n with pytest.raises(ValidationError):\n model_type(foo='hi', val=-1.1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableNestedModel_test_pickle_nested_model.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableNestedModel_test_pickle_nested_model.None_5", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 151, "span_ids": ["nested_model_factory", "test_pickle_nested_model", "ImportableNestedModel"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportableNestedModel(BaseModel):\n inner: ImportableModel\n\n\ndef nested_model_factory() -> Type:\n class NonImportableNestedModel(BaseModel):\n inner: ImportableModel\n\n return NonImportableNestedModel\n\n\n@pytest.mark.parametrize(\n 'model_type,use_cloudpickle',\n [\n # Importable model can be pickled with either pickle or cloudpickle.\n (ImportableNestedModel, False),\n (ImportableNestedModel, True),\n # Locally-defined model can only be pickled with cloudpickle.\n (nested_model_factory(), True),\n ],\n)\ndef test_pickle_nested_model(model_type: Type, use_cloudpickle: bool):\n if use_cloudpickle:\n model_type = cloudpickle.loads(cloudpickle.dumps(model_type))\n else:\n model_type = pickle.loads(pickle.dumps(model_type))\n\n m = model_type(inner=ImportableModel(foo='hi', val=1))\n assert m.inner.foo == 'hi'\n assert m.inner.bar is None\n assert m.inner.val == 1.0\n\n if use_cloudpickle:\n m = cloudpickle.loads(cloudpickle.dumps(m))\n else:\n m = pickle.loads(pickle.dumps(m))\n\n assert m.inner.foo == 'hi'\n assert m.inner.bar is None\n assert m.inner.val == 1.0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableDataclass_child_dataclass_factory.return.NonImportableChildDatacla": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableDataclass_child_dataclass_factory.return.NonImportableChildDatacla", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 192, "span_ids": ["ImportableChildDataclass", "ImportableDataclass", "dataclass_factory", "child_dataclass_factory", "builtin_dataclass_factory", "ImportableBuiltinDataclass"], "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": "@pydantic.dataclasses.dataclass\nclass ImportableDataclass:\n a: int\n b: float\n\n\ndef dataclass_factory() -> Type:\n @pydantic.dataclasses.dataclass\n class NonImportableDataclass:\n a: int\n b: float\n\n return NonImportableDataclass\n\n\n@dataclasses.dataclass\nclass ImportableBuiltinDataclass:\n a: int\n b: float\n\n\ndef builtin_dataclass_factory() -> Type:\n @dataclasses.dataclass\n class NonImportableBuiltinDataclass:\n a: int\n b: float\n\n return NonImportableBuiltinDataclass\n\n\nclass ImportableChildDataclass(ImportableDataclass):\n pass\n\n\ndef child_dataclass_factory() -> Type:\n class NonImportableChildDataclass(ImportableDataclass):\n pass\n\n return NonImportableChildDataclass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_test_pickle_dataclass_test_pickle_dataclass.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_test_pickle_dataclass_test_pickle_dataclass.None_7", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 240, "span_ids": ["test_pickle_dataclass"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n 'dataclass_type,use_cloudpickle',\n [\n # Importable Pydantic dataclass can be pickled with either pickle or cloudpickle.\n (ImportableDataclass, False),\n (ImportableDataclass, True),\n (ImportableChildDataclass, False),\n (ImportableChildDataclass, True),\n # Locally-defined Pydantic dataclass can only be pickled with cloudpickle.\n (dataclass_factory(), True),\n (child_dataclass_factory(), True),\n # Pydantic dataclass generated from builtin can only be pickled with cloudpickle.\n (pydantic.dataclasses.dataclass(ImportableBuiltinDataclass), True),\n # Pydantic dataclass generated from locally-defined builtin can only be pickled with cloudpickle.\n (pydantic.dataclasses.dataclass(builtin_dataclass_factory()), True),\n ],\n)\ndef test_pickle_dataclass(dataclass_type: Type, use_cloudpickle: bool):\n if use_cloudpickle:\n dataclass_type = cloudpickle.loads(cloudpickle.dumps(dataclass_type))\n else:\n dataclass_type = pickle.loads(pickle.dumps(dataclass_type))\n\n d = dataclass_type('1', '2.5')\n assert d.a == 1\n assert d.b == 2.5\n\n if use_cloudpickle:\n d = cloudpickle.loads(cloudpickle.dumps(d))\n else:\n d = pickle.loads(pickle.dumps(d))\n\n assert d.a == 1\n assert d.b == 2.5\n\n d = dataclass_type(b=10, a=20)\n assert d.a == 20\n assert d.b == 10\n\n if use_cloudpickle:\n d = cloudpickle.loads(cloudpickle.dumps(d))\n else:\n d = pickle.loads(pickle.dumps(d))\n\n assert d.a == 20\n assert d.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_pickle.py_ImportableNestedDataclassModel_test_pickle_dataclass_nested_in_model.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableNestedDataclassModel_test_pickle_dataclass_nested_in_model.None_3", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 243, "end_line": 280, "span_ids": ["nested_dataclass_model_factory", "test_pickle_dataclass_nested_in_model", "ImportableNestedDataclassModel"], "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 ImportableNestedDataclassModel(BaseModel):\n inner: ImportableBuiltinDataclass\n\n\ndef nested_dataclass_model_factory() -> Type:\n class NonImportableNestedDataclassModel(BaseModel):\n inner: ImportableBuiltinDataclass\n\n return NonImportableNestedDataclassModel\n\n\n@pytest.mark.parametrize(\n 'model_type,use_cloudpickle',\n [\n # Importable model can be pickled with either pickle or cloudpickle.\n (ImportableNestedDataclassModel, False),\n (ImportableNestedDataclassModel, True),\n # Locally-defined model can only be pickled with cloudpickle.\n (nested_dataclass_model_factory(), True),\n ],\n)\ndef test_pickle_dataclass_nested_in_model(model_type: Type, use_cloudpickle: bool):\n if use_cloudpickle:\n model_type = cloudpickle.loads(cloudpickle.dumps(model_type))\n else:\n model_type = pickle.loads(pickle.dumps(model_type))\n\n m = model_type(inner=ImportableBuiltinDataclass(a=10, b=20))\n assert m.inner.a == 10\n assert m.inner.b == 20\n\n if use_cloudpickle:\n m = cloudpickle.loads(cloudpickle.dumps(m))\n else:\n m = pickle.loads(pickle.dumps(m))\n\n assert m.inner.a == 10\n assert m.inner.b == 20", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableModelWithConfig_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_pickle.py_ImportableModelWithConfig_", "embedding": null, "metadata": {"file_path": "tests/test_pickle.py", "file_name": "test_pickle.py", "file_type": "text/x-python", "category": "test", "start_line": 283, "end_line": 309, "span_ids": ["model_with_config_factory", "test_pickle_model_with_config", "ImportableModelWithConfig"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportableModelWithConfig(BaseModel):\n model_config = ConfigDict(title='MyTitle')\n\n\ndef model_with_config_factory() -> Type:\n class NonImportableModelWithConfig(BaseModel):\n model_config = ConfigDict(title='MyTitle')\n\n return NonImportableModelWithConfig\n\n\n@pytest.mark.parametrize(\n 'model_type,use_cloudpickle',\n [\n (ImportableModelWithConfig, False),\n (ImportableModelWithConfig, True),\n (model_with_config_factory(), True),\n ],\n)\ndef test_pickle_model_with_config(model_type: Type, use_cloudpickle: bool):\n if use_cloudpickle:\n model_type = cloudpickle.loads(cloudpickle.dumps(model_type))\n else:\n model_type = pickle.loads(pickle.dumps(model_type))\n\n assert model_type.model_config['title'] == 'MyTitle'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_from___future___import_an_install_plugin.try_.finally_._plugins_clear_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_from___future___import_an_install_plugin.try_.finally_._plugins_clear_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "install_plugin"], "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": "from __future__ import annotations\n\nimport contextlib\nfrom functools import partial\nfrom typing import Any, Generator, List\n\nfrom pydantic_core import ValidationError\n\nfrom pydantic import BaseModel, TypeAdapter, create_model, dataclasses, field_validator, validate_call\nfrom pydantic.plugin import (\n PydanticPluginProtocol,\n SchemaTypePath,\n ValidateJsonHandlerProtocol,\n ValidatePythonHandlerProtocol,\n ValidateStringsHandlerProtocol,\n)\nfrom pydantic.plugin._loader import _plugins\n\n\n@contextlib.contextmanager\ndef install_plugin(plugin: PydanticPluginProtocol) -> Generator[None, None, None]:\n _plugins[plugin.__class__.__qualname__] = plugin\n try:\n yield\n finally:\n _plugins.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_success_test_on_validate_json_on_success.CustomOnValidateJson.on_success.assert_isinstance_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_success_test_on_validate_json_on_success.CustomOnValidateJson.on_success.assert_isinstance_result_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 45, "span_ids": ["test_on_validate_json_on_success"], "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_on_validate_json_on_success() -> None:\n class CustomOnValidateJson(ValidateJsonHandlerProtocol):\n def on_enter(\n self,\n input: str | bytes | bytearray,\n *,\n strict: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n assert input == '{\"a\": 1}'\n assert strict is None\n assert context is None\n assert self_instance is None\n\n def on_success(self, result: Any) -> None:\n assert isinstance(result, Model)\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_plugins.py_test_on_validate_json_on_error_test_on_validate_json_on_error.CustomOnValidateJson.on_error.assert_error_errors_inclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_error_test_on_validate_json_on_error.CustomOnValidateJson.on_error.assert_error_errors_inclu", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 92, "span_ids": ["test_on_validate_json_on_error"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_on_validate_json_on_error() -> None:\n class CustomOnValidateJson:\n def on_enter(\n self,\n input: str | bytes | bytearray,\n *,\n strict: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n assert input == '{\"a\": \"potato\"}'\n assert strict is None\n assert context is None\n assert self_instance is None\n\n def on_error(self, error: ValidationError) -> None:\n assert error.title == 'Model'\n assert error.errors(include_url=False) == [\n {\n 'input': 'potato',\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 # ... 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_plugins.py_test_on_validate_json_on_error.Plugin_test_on_validate_json_on_error.with_install_plugin_plugi.with_contextlib_suppress_.Model_model_validate_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_error.Plugin_test_on_validate_json_on_error.with_install_plugin_plugi.with_contextlib_suppress_.Model_model_validate_json", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 110, "span_ids": ["test_on_validate_json_on_error"], "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_on_validate_json_on_error() -> None:\n # ... other code\n\n class Plugin(PydanticPluginProtocol):\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert config == {'title': 'Model'}\n assert plugin_settings == {'observe': 'all'}\n return None, CustomOnValidateJson(), None\n\n plugin = Plugin()\n with install_plugin(plugin):\n\n class Model(BaseModel, plugin_settings={'observe': 'all'}):\n a: int\n\n assert Model.model_validate({'a': 1}) == Model(a=1)\n with contextlib.suppress(ValidationError):\n Model.model_validate_json('{\"a\": \"potato\"}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_success_test_on_validate_python_on_success.CustomOnValidatePython.on_success.assert_isinstance_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_success_test_on_validate_python_on_success.CustomOnValidatePython.on_success.assert_isinstance_result_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 128, "span_ids": ["test_on_validate_python_on_success"], "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_on_validate_python_on_success() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n def on_enter(\n self,\n input: Any,\n *,\n strict: bool | None = None,\n from_attributes: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n assert input == {'a': 1}\n assert strict is None\n assert context is None\n assert self_instance is None\n\n def on_success(self, result: Any) -> None:\n assert isinstance(result, Model)\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_plugins.py_test_on_validate_python_on_error_test_on_validate_python_on_error.CustomOnValidatePython.on_error.assert_error_errors_inclu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_error_test_on_validate_python_on_error.CustomOnValidatePython.on_error.assert_error_errors_inclu", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 173, "span_ids": ["test_on_validate_python_on_error"], "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_on_validate_python_on_error() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n def on_enter(\n self,\n input: Any,\n *,\n strict: bool | None = None,\n from_attributes: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n assert input == {'a': 'potato'}\n assert strict is None\n assert context is None\n assert self_instance is None\n\n def on_error(self, error: ValidationError) -> None:\n assert error.title == 'Model'\n assert error.errors(include_url=False) == [\n {\n 'input': 'potato',\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 # ... 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_plugins.py_test_stateful_plugin_test_stateful_plugin.CustomOnValidatePython.on_exception.stack_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_stateful_plugin_test_stateful_plugin.CustomOnValidatePython.on_exception.stack_pop_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 194, "end_line": 216, "span_ids": ["test_stateful_plugin"], "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_stateful_plugin() -> None:\n stack: list[Any] = []\n\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n def on_enter(\n self,\n input: Any,\n *,\n strict: bool | None = None,\n from_attributes: bool | None = None,\n context: dict[str, Any] | None = None,\n self_instance: Any | None = None,\n ) -> None:\n stack.append(input)\n\n def on_success(self, result: Any) -> None:\n stack.pop()\n\n def on_error(self, error: Exception) -> None:\n stack.pop()\n\n def on_exception(self, exception: Exception) -> None:\n stack.pop()\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_plugins.py_test_stateful_plugin.Plugin_test_stateful_plugin.with_install_plugin_plugi.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_stateful_plugin.Plugin_test_stateful_plugin.with_install_plugin_plugi.None_3", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 218, "end_line": 245, "span_ids": ["test_stateful_plugin"], "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_stateful_plugin() -> None:\n # ... other code\n\n class Plugin(PydanticPluginProtocol):\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n\n class MyException(Exception):\n pass\n\n with install_plugin(plugin):\n\n class Model(BaseModel, plugin_settings={'observe': 'all'}):\n a: int\n\n @field_validator('a')\n def validate_a(cls, v: int) -> int:\n if v < 0:\n raise MyException\n return v\n\n with contextlib.suppress(ValidationError):\n Model.model_validate({'a': 'potato'})\n assert not stack\n with contextlib.suppress(MyException):\n Model.model_validate({'a': -1})\n assert not stack\n assert Model.model_validate({'a': 1}).a == 1\n assert not stack", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_all_handlers_test_all_handlers.with_install_plugin_plugi.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_all_handlers_test_all_handlers.with_install_plugin_plugi.None_5", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 248, "end_line": 307, "span_ids": ["test_all_handlers"], "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": "def test_all_handlers():\n log = []\n\n class Python(ValidatePythonHandlerProtocol):\n def on_enter(self, input, **kwargs) -> None:\n log.append(f'python enter input={input} kwargs={kwargs}')\n\n def on_success(self, result: Any) -> None:\n log.append(f'python success result={result}')\n\n def on_error(self, error: ValidationError) -> None:\n log.append(f'python error error={error}')\n\n class Json(ValidateJsonHandlerProtocol):\n def on_enter(self, input, **kwargs) -> None:\n log.append(f'json enter input={input} kwargs={kwargs}')\n\n def on_success(self, result: Any) -> None:\n log.append(f'json success result={result}')\n\n def on_error(self, error: ValidationError) -> None:\n log.append(f'json error error={error}')\n\n class Strings(ValidateStringsHandlerProtocol):\n def on_enter(self, input, **kwargs) -> None:\n log.append(f'strings enter input={input} kwargs={kwargs}')\n\n def on_success(self, result: Any) -> None:\n log.append(f'strings success result={result}')\n\n def on_error(self, error: ValidationError) -> None:\n log.append(f'strings error error={error}')\n\n class Plugin(PydanticPluginProtocol):\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n return Python(), Json(), Strings()\n\n plugin = Plugin()\n with install_plugin(plugin):\n\n class Model(BaseModel):\n a: int\n\n assert Model(a=1).model_dump() == {'a': 1}\n # insert_assert(log)\n assert log == [\"python enter input={'a': 1} kwargs={'self_instance': Model()}\", 'python success result=a=1']\n log.clear()\n assert Model.model_validate_json('{\"a\": 2}', context={'c': 2}).model_dump() == {'a': 2}\n # insert_assert(log)\n assert log == [\n \"json enter input={\\\"a\\\": 2} kwargs={'strict': None, 'context': {'c': 2}}\",\n 'json success result=a=2',\n ]\n log.clear()\n assert Model.model_validate_strings({'a': '3'}, strict=True, context={'c': 3}).model_dump() == {'a': 3}\n # insert_assert(log)\n assert log == [\n \"strings enter input={'a': '3'} kwargs={'strict': True, 'context': {'c': 3}}\",\n 'strings success result=a=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_plugins.py_test_plugin_path_dataclass_test_plugin_path_dataclass.with_install_plugin_plugi.Bar.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_dataclass_test_plugin_path_dataclass.with_install_plugin_plugi.Bar.a", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 310, "end_line": 326, "span_ids": ["test_plugin_path_dataclass"], "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_plugin_path_dataclass() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert schema_type.__name__ == 'Bar'\n assert schema_type_path == SchemaTypePath('tests.test_plugins', 'test_plugin_path_dataclass..Bar')\n assert schema_kind == 'dataclass'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n\n @dataclasses.dataclass\n class Bar:\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_plugins.py_test_plugin_path_type_adapter_test_plugin_path_type_adapter.with_install_plugin_plugi.TypeAdapter_List_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_test_plugin_path_type_adapter.with_install_plugin_plugi.TypeAdapter_List_str_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 329, "end_line": 342, "span_ids": ["test_plugin_path_type_adapter"], "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_plugin_path_type_adapter() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert str(schema_type) == 'typing.List[str]'\n assert schema_type_path == SchemaTypePath('tests.test_plugins', 'typing.List[str]')\n assert schema_kind == 'TypeAdapter'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n TypeAdapter(List[str])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_with_module_test_plugin_path_type_adapter_with_module.with_install_plugin_plugi.TypeAdapter_List_str_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_with_module_test_plugin_path_type_adapter_with_module.with_install_plugin_plugi.TypeAdapter_List_str_mo", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 345, "end_line": 358, "span_ids": ["test_plugin_path_type_adapter_with_module"], "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_plugin_path_type_adapter_with_module() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert str(schema_type) == 'typing.List[str]'\n assert schema_type_path == SchemaTypePath('provided_module_by_type_adapter', 'typing.List[str]')\n assert schema_kind == 'TypeAdapter'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n TypeAdapter(List[str], module='provided_module_by_type_adapter')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_validate_call_test_plugin_path_validate_call.None_1.validate_call_my_partial_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_validate_call_test_plugin_path_validate_call.None_1.validate_call_my_partial_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 361, "end_line": 397, "span_ids": ["test_plugin_path_validate_call"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_plugin_path_validate_call() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin1:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert schema_type.__name__ == 'foo'\n assert schema_type_path == SchemaTypePath(\n 'tests.test_plugins', 'test_plugin_path_validate_call..foo'\n )\n assert schema_kind == 'validate_call'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin1()\n with install_plugin(plugin):\n\n @validate_call()\n def foo(a: int):\n return a\n\n class Plugin2:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert schema_type.__name__ == 'my_wrapped_function'\n assert schema_type_path == SchemaTypePath(\n 'tests.test_plugins', 'partial(test_plugin_path_validate_call..my_wrapped_function)'\n )\n assert schema_kind == 'validate_call'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin2()\n with install_plugin(plugin):\n\n def my_wrapped_function(a: int, b: int, c: int):\n return a + b + c\n\n my_partial_function = partial(my_wrapped_function, c=3)\n validate_call(my_partial_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/tests/test_plugins.py_test_plugin_path_create_model_test_plugin_path_create_model.with_install_plugin_plugi.create_model_FooModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_create_model_test_plugin_path_create_model.with_install_plugin_plugi.create_model_FooModel_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 400, "end_line": 414, "span_ids": ["test_plugin_path_create_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_plugin_path_create_model() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert schema_type.__name__ == 'FooModel'\n assert list(schema_type.model_fields.keys()) == ['foo', 'bar']\n assert schema_type_path == SchemaTypePath('tests.test_plugins', 'FooModel')\n assert schema_kind == 'create_model'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n create_model('FooModel', foo=(str, ...), bar=(int, 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_plugins.py_test_plugin_path_complex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_complex_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 417, "end_line": 454, "span_ids": ["test_plugin_path_complex"], "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_plugin_path_complex() -> None:\n paths: list[tuple(str, str)] = []\n\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n paths.append((schema_type.__name__, schema_type_path, schema_kind))\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n\n def foo():\n class Model1(BaseModel):\n pass\n\n def bar():\n class Model2(BaseModel):\n pass\n\n foo()\n bar()\n\n assert paths == [\n (\n 'Model1',\n SchemaTypePath('tests.test_plugins', 'test_plugin_path_complex..foo..Model1'),\n 'BaseModel',\n ),\n (\n 'Model2',\n SchemaTypePath('tests.test_plugins', 'test_plugin_path_complex..bar..Model2'),\n 'BaseModel',\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_private_attributes.py_functools_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_functools_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": 27, "span_ids": ["imports", "test_private_attribute"], "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": "import functools\nfrom typing import ClassVar, Generic, TypeVar\n\nimport pytest\nfrom pydantic_core import PydanticUndefined\n\nfrom pydantic import BaseModel, ConfigDict, PrivateAttr, computed_field\n\n\ndef test_private_attribute():\n default = {'a': {}}\n\n class Model(BaseModel):\n _foo = PrivateAttr(default)\n\n assert set(Model.__private_attributes__) == {'_foo'}\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_double_leading_underscore_test_private_attribute_double_leading_underscore.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_double_leading_underscore_test_private_attribute_double_leading_underscore.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": 30, "end_line": 50, "span_ids": ["test_private_attribute_double_leading_underscore"], "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_private_attribute_double_leading_underscore():\n default = {'a': {}}\n\n class Model(BaseModel):\n __foo = PrivateAttr(default)\n\n assert set(Model.__private_attributes__) == {'_Model__foo'}\n\n m = Model()\n\n with pytest.raises(AttributeError, match='__foo'):\n m.__foo\n assert m._Model__foo == default\n assert m._Model__foo is not default\n assert m._Model__foo['a'] is not default['a']\n\n m._Model__foo = None\n assert m._Model__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": 53, "end_line": 86, "span_ids": ["test_private_attribute_factory", "test_private_attribute_nested"], "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_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.__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_layout_compatible_multiple_private_parents_test_layout_compatible_multiple_private_parents.assert_m__private_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_layout_compatible_multiple_private_parents_test_layout_compatible_multiple_private_parents.assert_m__private_2", "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": 342, "end_line": 364, "span_ids": ["test_layout_compatible_multiple_private_parents"], "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_layout_compatible_multiple_private_parents():\n import typing as t\n\n import pydantic\n\n class ModelMixin(pydantic.BaseModel):\n _mixin_private: t.Optional[str] = pydantic.PrivateAttr(None)\n\n class Model(pydantic.BaseModel):\n public: str = 'default'\n _private: t.Optional[str] = pydantic.PrivateAttr(None)\n\n class NewModel(ModelMixin, Model):\n pass\n\n assert set(NewModel.__private_attributes__) == {'_mixin_private', '_private'}\n m = NewModel()\n m._mixin_private = 1\n m._private = 2\n\n assert m.__pydantic_private__ == {'_mixin_private': 1, '_private': 2}\n assert m._mixin_private == 1\n assert m._private == 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_private_attributes.py_test_unannotated_private_attr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_private_attributes.py_test_unannotated_private_attr_", "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": 367, "end_line": 452, "span_ids": ["test_private_properties_not_included_in_iter_property", "test_private_properties_not_included_in_repr_by_default_cached_property", "test_private_properties_not_included_in_repr_by_default_property", "test_classvar_collision_prevention", "test_unannotated_private_attr", "test_private_properties_not_included_in_iter_cached_property"], "tokens": 543}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_unannotated_private_attr():\n from pydantic import BaseModel, PrivateAttr\n\n class A(BaseModel):\n _x = PrivateAttr()\n _y = 52\n\n a = A()\n assert a._y == 52\n assert a.__pydantic_private__ == {'_y': 52}\n a._x = 1\n assert a.__pydantic_private__ == {'_x': 1, '_y': 52}\n\n\ndef test_classvar_collision_prevention(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\n\nfrom pydantic import BaseModel\nimport typing as t\n\nclass BaseConfig(BaseModel):\n _FIELD_UPDATE_STRATEGY: t.ClassVar[t.Dict[str, t.Any]] = {}\n\"\"\"\n )\n\n assert module.BaseConfig._FIELD_UPDATE_STRATEGY == {}\n\n\n@pytest.mark.skipif(not hasattr(functools, 'cached_property'), reason='cached_property is not available')\ndef test_private_properties_not_included_in_iter_cached_property() -> None:\n class Model(BaseModel):\n foo: int\n\n @computed_field\n @functools.cached_property\n def _foo(self) -> int:\n return -self.foo\n\n m = Model(foo=1)\n assert '_foo' not in list(k for k, _ in m)\n\n\ndef test_private_properties_not_included_in_iter_property() -> None:\n class Model(BaseModel):\n foo: int\n\n @computed_field\n @property\n def _foo(self) -> int:\n return -self.foo\n\n m = Model(foo=1)\n assert '_foo' not in list(k for k, _ in m)\n\n\ndef test_private_properties_not_included_in_repr_by_default_property() -> None:\n class Model(BaseModel):\n foo: int\n\n @computed_field\n @property\n def _private_property(self) -> int:\n return -self.foo\n\n m = Model(foo=1)\n m_repr = repr(m)\n assert '_private_property' not in m_repr\n\n\n@pytest.mark.skipif(not hasattr(functools, 'cached_property'), reason='cached_property is not available')\ndef test_private_properties_not_included_in_repr_by_default_cached_property() -> None:\n class Model(BaseModel):\n foo: int\n\n @computed_field\n @functools.cached_property\n def _private_cached_property(self) -> int:\n return -self.foo\n\n m = Model(foo=1)\n m_repr = repr(m)\n assert '_private_cached_property' not in m_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_root_model.py_pickle_from_pydantic_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_pickle_from_pydantic_import_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports"], "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": "import pickle\nfrom datetime import date, datetime\nfrom typing import Any, Dict, Generic, List, Optional, Union\n\nimport pytest\nfrom pydantic_core import CoreSchema\nfrom pydantic_core.core_schema import SerializerFunctionWrapHandler\nfrom typing_extensions import Annotated, Literal, TypeVar\n\nfrom pydantic import (\n Base64Str,\n BaseModel,\n ConfigDict,\n Field,\n PrivateAttr,\n PydanticDeprecatedSince20,\n PydanticUserError,\n RootModel,\n ValidationError,\n field_serializer,\n model_validator,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_parametrize_root_model_parametrize_root_model.return.pytest_mark_parametrize_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_parametrize_root_model_parametrize_root_model.return.pytest_mark_parametrize_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 44, "span_ids": ["parametrize_root_model"], "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 parametrize_root_model():\n class InnerModel(BaseModel):\n int_field: int\n str_field: str\n\n return pytest.mark.parametrize(\n ('root_type', 'root_value', 'dump_value'),\n [\n pytest.param(int, 42, 42, id='int'),\n pytest.param(str, 'forty two', 'forty two', id='str'),\n pytest.param(Dict[int, bool], {1: True, 2: False}, {1: True, 2: False}, id='dict[int, bool]'),\n pytest.param(List[int], [4, 2, -1], [4, 2, -1], id='list[int]'),\n pytest.param(\n InnerModel,\n InnerModel(int_field=42, str_field='forty two'),\n {'int_field': 42, 'str_field': 'forty two'},\n id='InnerModel',\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_root_model.py_check_schema_test_root_model_recursive.assert_repr_A_model_valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_check_schema_test_root_model_recursive.assert_repr_A_model_valid", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 122, "span_ids": ["test_root_model_recursive", "test_root_model_validation_error", "test_root_model_specialized", "test_root_model_repr", "test_root_model_inherited", "check_schema"], "tokens": 528}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_schema(schema: CoreSchema) -> None:\n # we assume the shape of the core schema here, which is not a guarantee\n # pydantic makes to its users but is useful to check here to make sure\n # we are doing the right thing internally\n assert schema['type'] == 'model'\n assert schema['root_model'] is True\n assert schema['custom_init'] is False\n\n\n@parametrize_root_model()\ndef test_root_model_specialized(root_type, root_value, dump_value):\n Model = RootModel[root_type]\n\n check_schema(Model.__pydantic_core_schema__)\n\n m = Model(root_value)\n\n assert m.model_dump() == dump_value\n assert dict(m) == {'root': m.root}\n assert m.__pydantic_fields_set__ == {'root'}\n\n\n@parametrize_root_model()\ndef test_root_model_inherited(root_type, root_value, dump_value):\n class Model(RootModel[root_type]):\n pass\n\n check_schema(Model.__pydantic_core_schema__)\n\n m = Model(root_value)\n\n assert m.model_dump() == dump_value\n assert dict(m) == {'root': m.root}\n assert m.__pydantic_fields_set__ == {'root'}\n\n\ndef test_root_model_validation_error():\n Model = RootModel[int]\n\n with pytest.raises(ValidationError) as e:\n Model('forty two')\n\n assert e.value.errors(include_url=False) == [\n {\n 'input': 'forty two',\n 'loc': (),\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_root_model_repr():\n SpecializedRootModel = RootModel[int]\n\n class SubRootModel(RootModel):\n pass\n\n class SpecializedSubRootModel(RootModel[int]):\n pass\n\n assert repr(SpecializedRootModel(1)) == 'RootModel[int](root=1)'\n assert repr(SubRootModel(1)) == 'SubRootModel(root=1)'\n assert repr(SpecializedSubRootModel(1)) == 'SpecializedSubRootModel(root=1)'\n\n\ndef test_root_model_recursive():\n class A(RootModel[List['B']]):\n def my_a_method(self):\n pass\n\n class B(RootModel[Dict[str, Optional[A]]]):\n def my_b_method(self):\n pass\n\n assert repr(A.model_validate([{}])) == 'A(root=[B(root={})])'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_v1_compatibility_serializer_test_v1_compatibility_serializer.with_pytest_warns_Pydanti.assert_m_dict_my_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_v1_compatibility_serializer_test_v1_compatibility_serializer.with_pytest_warns_Pydanti.assert_m_dict_my_r", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 160, "end_line": 177, "span_ids": ["test_v1_compatibility_serializer"], "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_v1_compatibility_serializer():\n class MyInnerModel(BaseModel):\n x: int\n\n class MyRootModel(RootModel[MyInnerModel]):\n # The following field_serializer can be added to achieve the same behavior as v1 had for .dict()\n @field_serializer('root', mode='wrap')\n def embed_in_dict(self, v: Any, handler: SerializerFunctionWrapHandler):\n return {'__root__': handler(v)}\n\n class MyOuterModel(BaseModel):\n my_root: MyRootModel\n\n m = MyOuterModel.model_validate({'my_root': {'x': 1}})\n\n assert m.model_dump() == {'my_root': {'__root__': {'x': 1}}}\n with pytest.warns(PydanticDeprecatedSince20):\n assert m.dict() == {'my_root': {'__root__': {'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_root_model.py_test_root_model_dump_with_base_model_test_root_model_dump_with_base_model.assert_m_model_dump_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_model_dump_with_base_model_test_root_model_dump_with_base_model.assert_m_model_dump_json_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 466, "end_line": 488, "span_ids": ["test_root_model_dump_with_base_model"], "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": "@pytest.mark.parametrize('order', ['BR', 'RB'])\ndef test_root_model_dump_with_base_model(order):\n class BModel(BaseModel):\n value: str\n\n class RModel(RootModel):\n root: int\n\n if order == 'BR':\n\n class Model(RootModel):\n root: List[Union[BModel, RModel]]\n\n elif order == 'RB':\n\n class Model(RootModel):\n root: List[Union[RModel, BModel]]\n\n m = Model([1, 2, {'value': 'abc'}])\n\n assert m.root == [RModel(1), RModel(2), BModel.model_construct(value='abc')]\n assert m.model_dump() == [1, 2, {'value': 'abc'}]\n assert m.model_dump_json() == '[1,2,{\"value\":\"abc\"}]'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_mixed_discriminated_union_test_mixed_discriminated_union.assert_Model_data_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_mixed_discriminated_union_test_mixed_discriminated_union.assert_Model_data_mode", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 491, "end_line": 514, "span_ids": ["test_mixed_discriminated_union"], "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": "@pytest.mark.parametrize(\n 'data',\n [\n pytest.param({'kind': 'IModel', 'int_value': 42}, id='IModel'),\n pytest.param({'kind': 'SModel', 'str_value': 'abc'}, id='SModel'),\n ],\n)\ndef test_mixed_discriminated_union(data):\n class IModel(BaseModel):\n kind: Literal['IModel']\n int_value: int\n\n class RModel(RootModel):\n root: IModel\n\n class SModel(BaseModel):\n kind: Literal['SModel']\n str_value: str\n\n class Model(RootModel):\n root: Union[SModel, RModel] = Field(discriminator='kind')\n\n assert Model(data).model_dump() == data\n assert Model(**data).model_dump() == 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_root_model.py_test_list_rootmodel_test_list_rootmodel.assert_obj_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_list_rootmodel_test_list_rootmodel.assert_obj_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 517, "end_line": 532, "span_ids": ["test_list_rootmodel"], "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_list_rootmodel():\n class A(BaseModel):\n type: Literal['a']\n a: str\n\n class B(BaseModel):\n type: Literal['b']\n b: str\n\n class D(RootModel[Annotated[Union[A, B], Field(discriminator='type')]]):\n pass\n\n LD = RootModel[List[D]]\n\n obj = LD.model_validate([{'type': 'a', 'a': 'a'}, {'type': 'b', 'b': 'b'}])\n assert obj.model_dump() == [{'type': 'a', 'a': 'a'}, {'type': 'b', '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_root_model.py_test_root_and_data_error_test_copy_preserves_equality.assert_model_deepcopie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_root_and_data_error_test_copy_preserves_equality.assert_model_deepcopie", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 535, "end_line": 615, "span_ids": ["test_json_schema_extra_on_field", "test_help", "test_pickle_root_model", "test_json_schema_extra_on_model", "test_copy_preserves_equality", "test_json_schema_extra_on_model_and_on_field", "test_root_and_data_error"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_root_and_data_error():\n class BModel(BaseModel):\n value: int\n other_value: str\n\n Model = RootModel[BModel]\n\n with pytest.raises(\n ValueError,\n match='\"RootModel.__init__\" accepts either a single positional argument or arbitrary keyword arguments',\n ):\n Model({'value': 42}, other_value='abc')\n\n\ndef test_pickle_root_model(create_module):\n @create_module\n def module():\n from pydantic import RootModel\n\n class MyRootModel(RootModel[str]):\n pass\n\n MyRootModel = module.MyRootModel\n assert MyRootModel(root='abc') == pickle.loads(pickle.dumps(MyRootModel(root='abc')))\n\n\ndef test_json_schema_extra_on_model():\n class Model(RootModel):\n model_config = ConfigDict(json_schema_extra={'schema key': 'schema value'})\n root: str\n\n assert Model.model_json_schema() == {\n 'schema key': 'schema value',\n 'title': 'Model',\n 'type': 'string',\n }\n\n\ndef test_json_schema_extra_on_field():\n class Model(RootModel):\n root: str = Field(json_schema_extra={'schema key': 'schema value'})\n\n assert Model.model_json_schema() == {\n 'schema key': 'schema value',\n 'title': 'Model',\n 'type': 'string',\n }\n\n\ndef test_json_schema_extra_on_model_and_on_field():\n class Model(RootModel):\n model_config = ConfigDict(json_schema_extra={'schema key on model': 'schema value on model'})\n root: str = Field(json_schema_extra={'schema key on field': 'schema value on field'})\n\n with pytest.raises(ValueError, match=r'json_schema_extra.*?must not be set simultaneously'):\n Model.model_json_schema()\n\n\ndef test_help(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nimport pydoc\n\nfrom pydantic import RootModel\n\n\nhelp_result_string = pydoc.render_doc(RootModel)\n\"\"\"\n )\n assert 'class RootModel' in module.help_result_string\n\n\ndef test_copy_preserves_equality():\n model = RootModel()\n\n copied = model.__copy__()\n assert model == copied\n\n deepcopied = model.__deepcopy__()\n assert model == deepcopied", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_model_validate_strings_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_root_model.py_test_model_validate_strings_", "embedding": null, "metadata": {"file_path": "tests/test_root_model.py", "file_name": "test_root_model.py", "file_type": "text/x-python", "category": "test", "start_line": 618, "end_line": 660, "span_ids": ["test_model_construction_with_invalid_generic_specification", "test_model_validate_strings"], "tokens": 619}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n 'root_type,input_value,expected,raises_match,strict',\n [\n (bool, 'true', True, None, False),\n (bool, 'true', True, None, True),\n (bool, 'false', False, None, False),\n (bool, 'e', ValidationError, 'type=bool_parsing', False),\n (int, '1', 1, None, False),\n (int, '1', 1, None, True),\n (int, 'xxx', ValidationError, 'type=int_parsing', True),\n (float, '1.1', 1.1, None, False),\n (float, '1.10', 1.1, None, False),\n (float, '1.1', 1.1, None, True),\n (float, '1.10', 1.1, None, True),\n (date, '2017-01-01', date(2017, 1, 1), None, False),\n (date, '2017-01-01', date(2017, 1, 1), None, True),\n (date, '2017-01-01T12:13:14.567', ValidationError, 'type=date_from_datetime_inexact', False),\n (date, '2017-01-01T12:13:14.567', ValidationError, 'type=date_parsing', True),\n (date, '2017-01-01T00:00:00', date(2017, 1, 1), None, False),\n (date, '2017-01-01T00:00:00', ValidationError, 'type=date_parsing', True),\n (datetime, '2017-01-01T12:13:14.567', datetime(2017, 1, 1, 12, 13, 14, 567_000), None, False),\n (datetime, '2017-01-01T12:13:14.567', datetime(2017, 1, 1, 12, 13, 14, 567_000), None, True),\n ],\n ids=repr,\n)\ndef test_model_validate_strings(root_type, input_value, expected, raises_match, strict):\n Model = RootModel[root_type]\n\n if raises_match is not None:\n with pytest.raises(expected, match=raises_match):\n Model.model_validate_strings(input_value, strict=strict)\n else:\n assert Model.model_validate_strings(input_value, strict=strict).root == expected\n\n\ndef test_model_construction_with_invalid_generic_specification() -> None:\n T_ = TypeVar('T_', bound=BaseModel)\n\n with pytest.raises(TypeError, match='You should parametrize RootModel directly'):\n\n class GenericRootModel(RootModel, Generic[T_]):\n root: Union[T_, 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_serialize.py_test_serialize_as_any_test_serialize_as_any.assert_json_loads_OuterMo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_as_any_test_serialize_as_any.assert_json_loads_OuterMo", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 893, "end_line": 912, "span_ids": ["test_serialize_as_any"], "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_serialize_as_any() -> None:\n class User(BaseModel):\n name: str\n\n class UserLogin(User):\n password: SecretStr\n\n class OuterModel(BaseModel):\n maybe_as_any: Optional[SerializeAsAny[User]] = None\n as_any: SerializeAsAny[User]\n without: User\n\n user = UserLogin(name='pydantic', password='password')\n\n # insert_assert(json.loads(OuterModel(as_any=user, without=user).model_dump_json()))\n assert json.loads(OuterModel(maybe_as_any=user, as_any=user, without=user).model_dump_json()) == {\n 'maybe_as_any': {'name': 'pydantic', 'password': '**********'},\n 'as_any': {'name': 'pydantic', 'password': '**********'},\n 'without': {'name': 'pydantic'},\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_forward_ref_for_serializers_test_forward_ref_for_serializers.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_forward_ref_for_serializers_test_forward_ref_for_serializers.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 915, "end_line": 963, "span_ids": ["test_forward_ref_for_serializers"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize('as_annotation', [True, False])\n@pytest.mark.parametrize('mode', ['plain', 'wrap'])\ndef test_forward_ref_for_serializers(as_annotation, mode):\n if mode == 'plain':\n\n def ser_model_func(v) -> 'SomeOtherModel': # noqa F821\n return OtherModel(y=v + 1)\n\n def ser_model_method(self, v) -> 'SomeOtherModel': # noqa F821\n return ser_model_func(v)\n\n annotation = PlainSerializer(ser_model_func)\n else:\n\n def ser_model_func(v, handler) -> 'SomeOtherModel': # noqa F821\n return OtherModel(y=v + 1)\n\n def ser_model_method(self, v, handler) -> 'SomeOtherModel': # noqa F821\n return ser_model_func(v, handler)\n\n annotation = WrapSerializer(ser_model_func)\n\n class Model(BaseModel):\n if as_annotation:\n x: Annotated[int, annotation]\n else:\n x: int\n ser_model = field_serializer('x', mode=mode)(ser_model_method)\n\n class OtherModel(BaseModel):\n y: int\n\n Model.model_rebuild(_types_namespace={'SomeOtherModel': OtherModel})\n\n assert Model(x=1).model_dump() == {'x': {'y': 2}}\n assert Model.model_json_schema(mode='serialization') == {\n '$defs': {\n 'OtherModel': {\n 'properties': {'y': {'title': 'Y', 'type': 'integer'}},\n 'required': ['y'],\n 'title': 'OtherModel',\n 'type': 'object',\n }\n },\n 'properties': {'x': {'allOf': [{'$ref': '#/$defs/OtherModel'}], 'title': 'X'}},\n 'required': ['x'],\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_serialize.py_test_forward_ref_for_computed_fields_test_forward_ref_for_computed_fields.assert_Model_x_1_model_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_forward_ref_for_computed_fields_test_forward_ref_for_computed_fields.assert_Model_x_1_model_d", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 966, "end_line": 987, "span_ids": ["test_forward_ref_for_computed_fields"], "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_forward_ref_for_computed_fields():\n class Model(BaseModel):\n x: int\n\n @computed_field\n @property\n def two_x(self) -> 'IntAlias': # noqa F821\n return self.x * 2\n\n Model.model_rebuild(_types_namespace={'IntAlias': int})\n\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {\n 'two_x': {'readOnly': True, 'title': 'Two X', 'type': 'integer'},\n 'x': {'title': 'X', 'type': 'integer'},\n },\n 'required': ['x', 'two_x'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n assert Model(x=1).model_dump() == {'two_x': 2, '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_serialize.py_test_computed_field_custom_serializer_test_computed_field_custom_serializer.assert_json_loads_m_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_computed_field_custom_serializer_test_computed_field_custom_serializer.assert_json_loads_m_model", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 990, "end_line": 1006, "span_ids": ["test_computed_field_custom_serializer"], "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_computed_field_custom_serializer():\n class Model(BaseModel):\n x: int\n\n @computed_field\n @property\n def two_x(self) -> int:\n return self.x * 2\n\n @field_serializer('two_x', when_used='json')\n def ser_two_x(self, v):\n return f'The double of x is {v}'\n\n m = Model(x=1)\n\n assert m.model_dump() == {'two_x': 2, 'x': 1}\n assert json.loads(m.model_dump_json()) == {'two_x': 'The double of x is 2', '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_serialize.py_test_annotated_computed_field_custom_serializer_test_annotated_computed_field_custom_serializer.Model.quadruple_x_plus_one.return.self_two_x_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_annotated_computed_field_custom_serializer_test_annotated_computed_field_custom_serializer.Model.quadruple_x_plus_one.return.self_two_x_2", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1009, "end_line": 1026, "span_ids": ["test_annotated_computed_field_custom_serializer"], "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_annotated_computed_field_custom_serializer():\n class Model(BaseModel):\n x: int\n\n @computed_field\n @property\n def two_x(self) -> Annotated[int, PlainSerializer(lambda v: f'The double of x is {v}', return_type=str)]:\n return self.x * 2\n\n @computed_field\n @property\n def triple_x(self) -> Annotated[int, PlainSerializer(lambda v: f'The triple of x is {v}', return_type=str)]:\n return self.two_x * 3\n\n @computed_field\n @property\n def quadruple_x_plus_one(self) -> Annotated[int, PlainSerializer(lambda v: v + 1, return_type=int)]:\n return self.two_x * 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_serialize.py_test_annotated_computed_field_custom_serializer.m_test_annotated_computed_field_custom_serializer.assert_Model_model_json_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_annotated_computed_field_custom_serializer.m_test_annotated_computed_field_custom_serializer.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1028, "end_line": 1061, "span_ids": ["test_annotated_computed_field_custom_serializer"], "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": "def test_annotated_computed_field_custom_serializer():\n # ... other code\n\n m = Model(x=1)\n assert m.x == 1\n assert m.two_x == 2\n assert m.triple_x == 6\n assert m.quadruple_x_plus_one == 4\n\n # insert_assert(m.model_dump())\n assert m.model_dump() == {\n 'x': 1,\n 'two_x': 'The double of x is 2',\n 'triple_x': 'The triple of x is 6',\n 'quadruple_x_plus_one': 5,\n }\n\n # insert_assert(json.loads(m.model_dump_json()))\n assert json.loads(m.model_dump_json()) == {\n 'x': 1,\n 'two_x': 'The double of x is 2',\n 'triple_x': 'The triple of x is 6',\n 'quadruple_x_plus_one': 5,\n }\n\n # insert_assert(Model.model_json_schema(mode='serialization'))\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {\n 'x': {'title': 'X', 'type': 'integer'},\n 'two_x': {'readOnly': True, 'title': 'Two X', 'type': 'string'},\n 'triple_x': {'readOnly': True, 'title': 'Triple X', 'type': 'string'},\n 'quadruple_x_plus_one': {'readOnly': True, 'title': 'Quadruple X Plus One', 'type': 'integer'},\n },\n 'required': ['x', 'two_x', 'triple_x', 'quadruple_x_plus_one'],\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_serialize.py_test_computed_field_custom_serializer_bad_signature_test_computed_field_custom_serializer_bad_signature.with_pytest_raises_Pydant.Model.ser_two_x_bad_signature.return.f_The_double_of_x_is_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_computed_field_custom_serializer_bad_signature_test_computed_field_custom_serializer_bad_signature.with_pytest_raises_Pydant.Model.ser_two_x_bad_signature.return.f_The_double_of_x_is_v_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1064, "end_line": 1079, "span_ids": ["test_computed_field_custom_serializer_bad_signature"], "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_computed_field_custom_serializer_bad_signature():\n error_msg = 'field_serializer on computed_field does not use info signature'\n\n with pytest.raises(PydanticUserError, match=error_msg):\n\n class Model(BaseModel):\n x: int\n\n @computed_field\n @property\n def two_x(self) -> int:\n return self.x * 2\n\n @field_serializer('two_x')\n def ser_two_x_bad_signature(self, v, _info):\n return f'The double of x is {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_serialize.py_test_forward_ref_for_classmethod_computed_fields_test_enum_as_dict_key.assert_MyModel_foo_MyEnu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_forward_ref_for_classmethod_computed_fields_test_enum_as_dict_key.assert_MyModel_foo_MyEnu", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1082, "end_line": 1117, "span_ids": ["test_enum_as_dict_key", "test_forward_ref_for_classmethod_computed_fields"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(sys.version_info < (3, 9), reason='@computed_field @classmethod @property only works in 3.9+')\ndef test_forward_ref_for_classmethod_computed_fields():\n class Model(BaseModel):\n y: ClassVar[int] = 4\n\n @computed_field\n @classmethod\n @property\n def two_y(cls) -> 'IntAlias': # noqa F821\n return cls.y * 2\n\n Model.model_rebuild(_types_namespace={'IntAlias': int})\n\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {\n 'two_y': {'readOnly': True, 'title': 'Two Y', 'type': 'integer'},\n },\n 'required': ['two_y'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n assert Model().model_dump() == {'two_y': 8}\n\n\ndef test_enum_as_dict_key() -> None:\n # See https://github.com/pydantic/pydantic/issues/7639\n class MyEnum(Enum):\n A = 'a'\n B = 'b'\n\n class MyModel(BaseModel):\n foo: Dict[MyEnum, str]\n bar: MyEnum\n\n assert MyModel(foo={MyEnum.A: 'hello'}, bar=MyEnum.B).model_dump_json() == '{\"foo\":{\"a\":\"hello\"},\"bar\":\"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_serialize.py_test_subclass_support_unions_test_subclass_support_unions.assert_s_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_subclass_support_unions_test_subclass_support_unions.assert_s_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1120, "end_line": 1144, "span_ids": ["test_subclass_support_unions"], "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_subclass_support_unions() -> None:\n class Pet(BaseModel):\n name: str\n\n class Dog(Pet):\n breed: str\n\n class Kid(BaseModel):\n age: str\n\n class Home(BaseModel):\n little_guys: Union[List[Pet], List[Kid]]\n\n class Shelter(BaseModel):\n pets: List[Pet]\n\n h1 = Home(little_guys=[Pet(name='spot'), Pet(name='buddy')])\n assert h1.model_dump() == {'little_guys': [{'name': 'spot'}, {'name': 'buddy'}]}\n\n h2 = Home(little_guys=[Dog(name='fluffy', breed='lab'), Dog(name='patches', breed='boxer')])\n assert h2.model_dump() == {'little_guys': [{'name': 'fluffy'}, {'name': 'patches'}]}\n\n # confirming same serialization + validation behavior as for a single list (not a union)\n s = Shelter(pets=[Dog(name='fluffy', breed='lab'), Dog(name='patches', breed='boxer')])\n assert s.model_dump() == {'pets': [{'name': 'fluffy'}, {'name': 'patches'}]}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_subclass_support_unions_with_forward_ref_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_subclass_support_unions_with_forward_ref_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 1159, "end_line": 1185, "span_ids": ["test_subclass_support_unions_with_forward_ref", "test_plain_serializer_with_std_type"], "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_subclass_support_unions_with_forward_ref() -> None:\n class Bar(BaseModel):\n bar_id: int\n\n class Baz(Bar):\n baz_id: int\n\n class Foo(BaseModel):\n items: Union[List['Foo'], List[Bar]]\n\n foo = Foo(items=[Baz(bar_id=1, baz_id=2), Baz(bar_id=3, baz_id=4)])\n assert foo.model_dump() == {'items': [{'bar_id': 1}, {'bar_id': 3}]}\n\n foo_recursive = Foo(items=[Foo(items=[Baz(bar_id=42, baz_id=99)])])\n assert foo_recursive.model_dump() == {'items': [{'items': [{'bar_id': 42}]}]}\n\n\ndef test_plain_serializer_with_std_type() -> None:\n \"\"\"Ensure that a plain serializer can be used with a standard type constructor, rather than having to use lambda x: std_type(x).\"\"\"\n\n class MyModel(BaseModel):\n x: Annotated[int, PlainSerializer(float)]\n\n m = MyModel(x=1)\n assert m.model_dump() == {'x': 1.0}\n assert m.model_dump_json() == '{\"x\":1.0}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_python_from_attributes_test_validate_python_from_attributes.assert_res_ModelFromAt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_python_from_attributes_test_validate_python_from_attributes.assert_res_ModelFromAt", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 201, "end_line": 269, "span_ids": ["test_validate_python_from_attributes"], "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 test_validate_python_from_attributes() -> None:\n class Model(BaseModel):\n x: int\n\n class ModelFromAttributesTrue(Model):\n model_config = ConfigDict(from_attributes=True)\n\n class ModelFromAttributesFalse(Model):\n model_config = ConfigDict(from_attributes=False)\n\n @dataclass\n class UnrelatedClass:\n x: int = 1\n\n input = UnrelatedClass(1)\n\n ta = TypeAdapter(Model)\n\n for from_attributes in (False, None):\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(UnrelatedClass(), from_attributes=from_attributes)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of Model',\n 'input': input,\n 'ctx': {'class_name': 'Model'},\n }\n ]\n\n res = ta.validate_python(UnrelatedClass(), from_attributes=True)\n assert res == Model(x=1)\n\n ta = TypeAdapter(ModelFromAttributesTrue)\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(UnrelatedClass(), from_attributes=False)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of ModelFromAttributesTrue',\n 'input': input,\n 'ctx': {'class_name': 'ModelFromAttributesTrue'},\n }\n ]\n\n for from_attributes in (True, None):\n res = ta.validate_python(UnrelatedClass(), from_attributes=from_attributes)\n assert res == ModelFromAttributesTrue(x=1)\n\n ta = TypeAdapter(ModelFromAttributesFalse)\n\n for from_attributes in (False, None):\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(UnrelatedClass(), from_attributes=from_attributes)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_type',\n 'loc': (),\n 'msg': 'Input should be a valid dictionary or instance of ModelFromAttributesFalse',\n 'input': input,\n 'ctx': {'class_name': 'ModelFromAttributesFalse'},\n }\n ]\n\n res = ta.validate_python(UnrelatedClass(), from_attributes=True)\n assert res == ModelFromAttributesFalse(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_type_alias_type.py_test_recursive_generic_type_alias_annotated_defs_test_recursive_generic_type_alias_annotated_defs.assert_t_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_generic_type_alias_annotated_defs_test_recursive_generic_type_alias_annotated_defs.assert_t_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 302, "span_ids": ["test_recursive_generic_type_alias_annotated_defs"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_generic_type_alias_annotated_defs() -> None:\n # force use of refs by referencing the schema in multiple places\n t = TypeAdapter(Tuple[ShortRecursiveGenericAlias[int], ShortRecursiveGenericAlias[int]])\n\n assert t.validate_python(([[]], [[]])) == ([[]], [[]])\n\n with pytest.raises(ValidationError) as exc_info:\n t.validate_python(([[], []], [[]]))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': (0,),\n 'msg': 'List should have at most 1 item after validation, not 2',\n 'input': [[], []],\n 'ctx': {'field_type': 'List', 'max_length': 1, 'actual_length': 2},\n }\n ]\n\n # insert_assert(t.json_schema())\n assert t.json_schema() == {\n 'type': 'array',\n 'minItems': 2,\n 'prefixItems': [\n {'$ref': '#/$defs/RecursiveGenericAlias_int__MaxLen_max_length_1_'},\n {'$ref': '#/$defs/RecursiveGenericAlias_int__MaxLen_max_length_1_'},\n ],\n 'maxItems': 2,\n '$defs': {\n 'RecursiveGenericAlias_int_': {\n 'type': 'array',\n 'items': {'anyOf': [{'$ref': '#/$defs/RecursiveGenericAlias_int_'}, {'type': 'integer'}]},\n },\n 'RecursiveGenericAlias_int__MaxLen_max_length_1_': {\n 'type': 'array',\n 'items': {'anyOf': [{'$ref': '#/$defs/RecursiveGenericAlias_int_'}, {'type': 'integer'}]},\n 'maxItems': 1,\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_type_alias_type.py_test_field_test_field.assert_ta_json_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_field_test_field.assert_ta_json_schema_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 305, "end_line": 316, "span_ids": ["test_field"], "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": "@pytest.mark.xfail(reason='description is currently dropped')\ndef test_field() -> None:\n SomeAlias = TypeAliasType('SomeAlias', Annotated[int, Field(description='number')])\n\n ta = TypeAdapter(Annotated[SomeAlias, Field(title='abc')])\n\n # insert_assert(ta.json_schema())\n assert ta.json_schema() == {\n '$defs': {'SomeAlias': {'type': 'integer', 'description': 'number'}},\n 'allOf': [{'$ref': '#/$defs/SomeAlias'}],\n 'title': 'abc',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_collections_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_collections_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": 1, "end_line": 306, "span_ids": ["imports:25", "test_constrained_bytes_strict_default", "imports", "test_constrained_bytes_strict_false", "test_constrained_list_good", "test_constrained_list_too_short", "test_constrained_list_optional", "test_strict_raw_type", "test_constrained_bytes_default", "test_constrained_bytes_strict_true", "con_bytes_model_fixture", "test_constrained_list_default", "test_constrained_bytes_too_long", "test_constrained_bytes_good", "test_constrained_list_too_long"], "tokens": 1963}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nimport itertools\nimport json\nimport math\nimport os\nimport re\nimport sys\nimport typing\nimport uuid\nfrom collections import OrderedDict, defaultdict, deque\nfrom dataclasses import dataclass\nfrom datetime import date, datetime, time, timedelta, timezone\nfrom decimal import Decimal\nfrom enum import Enum, IntEnum\nfrom numbers import Number\nfrom pathlib import Path\nfrom typing import (\n Any,\n Callable,\n Counter,\n DefaultDict,\n Deque,\n Dict,\n FrozenSet,\n Iterable,\n List,\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 dirty_equals\nimport pytest\nfrom dirty_equals import HasRepr, IsFloatNan, IsOneOf, IsStr\nfrom pydantic_core import CoreSchema, PydanticCustomError, SchemaError, core_schema\nfrom typing_extensions import Annotated, Literal, NotRequired, TypedDict, get_args\n\nfrom pydantic import (\n UUID1,\n UUID3,\n UUID4,\n UUID5,\n AfterValidator,\n AllowInfNan,\n AwareDatetime,\n Base64Bytes,\n Base64Str,\n Base64UrlBytes,\n Base64UrlStr,\n BaseModel,\n ByteSize,\n ConfigDict,\n DirectoryPath,\n EmailStr,\n Field,\n FilePath,\n FiniteFloat,\n FutureDate,\n FutureDatetime,\n GetCoreSchemaHandler,\n GetPydanticSchema,\n ImportString,\n InstanceOf,\n Json,\n JsonValue,\n NaiveDatetime,\n NameEmail,\n NegativeFloat,\n NegativeInt,\n NewPath,\n NonNegativeFloat,\n NonNegativeInt,\n NonPositiveFloat,\n NonPositiveInt,\n OnErrorOmit,\n PastDate,\n PastDatetime,\n PlainSerializer,\n PositiveFloat,\n PositiveInt,\n PydanticInvalidForJsonSchema,\n PydanticSchemaGenerationError,\n Secret,\n SecretBytes,\n SecretStr,\n SerializeAsAny,\n SkipValidation,\n Strict,\n StrictBool,\n StrictBytes,\n StrictFloat,\n StrictInt,\n StrictStr,\n StringConstraints,\n Tag,\n TypeAdapter,\n ValidationError,\n conbytes,\n condate,\n condecimal,\n confloat,\n confrozenset,\n conint,\n conlist,\n conset,\n constr,\n field_serializer,\n field_validator,\n validate_call,\n)\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\n\ntry:\n import email_validator\nexcept ImportError:\n email_validator = None\n\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')\n\n\n@pytest.mark.parametrize(\n ('data', 'valid'),\n [(b'this is too long', False), ('\u2ab6\u24f2\u2f7701'.encode(), False), (b'not long90', True), ('\u2ab6\u24f2\u2f770'.encode(), True)],\n)\ndef test_constrained_bytes_too_long(ConBytesModel, data: bytes, valid: bool):\n if valid:\n assert ConBytesModel(v=data).model_dump() == {'v': data}\n else:\n with pytest.raises(ValidationError) as exc_info:\n ConBytesModel(v=data)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'max_length': 10},\n 'input': data,\n 'loc': ('v',),\n 'msg': 'Data should have at most 10 bytes',\n 'type': 'bytes_too_long',\n }\n ]\n\n\ndef 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 == []\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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_list_constraints_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": 300, "end_line": 512, "span_ids": ["test_constrained_list_item_type_fails", "test_constrained_list_constraints", "test_constrained_set_too_long", "test_constrained_set_default_invalid", "test_constrained_set_optional", "test_constrained_set_too_short", "test_constrained_set_good", "test_conlist", "test_conlist_wrong_type_default", "test_constrained_set_default"], "tokens": 1876}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'list_type', 'loc': ('v',), 'msg': 'Input should be a valid list', 'input': 1}\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'list_type', 'loc': ('foo',), 'msg': 'Input should be a valid list', 'input': 1}\n ]\n\n\ndef 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'\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': ('v',),\n 'msg': 'Set should have at most 10 items after validation, not more',\n 'input': {'4', '3', '10', '9', '5', '6', '1', '8', '0', '7', '2'},\n 'ctx': {'field_type': 'Set', 'max_length': 10, 'actual_length': None},\n }\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_str_default.assert_m_v_foobar_": {"__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_str_default.assert_m_v_foobar_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 515, "end_line": 735, "span_ids": ["test_constrained_frozenset_optional", "test_constrained_set_constraints", "test_constrained_str_good", "constring_model_fixture", "test_confrozenset", "test_confrozenset_not_required", "test_constrained_str_default", "test_conset_not_required", "test_constrained_set_item_type_fails", "test_conset"], "tokens": 2061}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': ('v',),\n 'msg': 'Set should have at most 11 items after validation, not more',\n 'input': {0, 8, 1, 9, 2, 10, 3, 7, 11, 4, 6, 5},\n 'ctx': {'field_type': 'Set', 'max_length': 11, 'actual_length': None},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n ConSetModelBoth(v=1)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'set_type', 'loc': ('v',), 'msg': 'Input should be a valid set', 'input': 1}\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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 more'):\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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\n\n\ndef 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 more'):\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'frozen_set_type', 'loc': ('foo',), 'msg': 'Input should be a valid frozenset', 'input': 1}\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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'}}\n\n\n@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'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_too_long_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_too_long_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": 738, "end_line": 807, "span_ids": ["test_constrained_str_too_long", "test_constrained_str_lower", "test_constrained_str_max_length_0", "test_constrained_str_upper"], "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": "@pytest.mark.parametrize(\n ('data', 'valid'),\n [('this is too long', False), ('\u26c4' * 11, False), ('not long90', True), ('\u26c4' * 10, True)],\n)\ndef test_constrained_str_too_long(ConStringModel, data, valid):\n if valid:\n assert ConStringModel(v=data).model_dump() == {'v': data}\n else:\n with pytest.raises(ValidationError) as exc_info:\n ConStringModel(v=data)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'max_length': 10},\n 'input': data,\n 'loc': ('v',),\n 'msg': 'String should have at most 10 characters',\n 'type': 'string_too_long',\n }\n ]\n\n\n@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\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_fails_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_string_fails_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": 1790, "end_line": 2038, "span_ids": ["test_email_validator_not_installed_name_email", "test_email_validator_not_installed_email_str", "test_tuple_variable_len_fails", "test_tuple_variable_len_success", "test_tuple_fails", "test_set_success", "test_ordered_dict", "test_dict", "test_list_fails", "test_tuple_success", "test_list_success", "test_string_fails"], "tokens": 2007}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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: '<'.\"\n ),\n 'input': 'foobar<@example.com',\n 'ctx': {'reason': \"The email address contains invalid characters before the @-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 ]\n\n\n@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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'dict_type', 'loc': ('v',), 'msg': 'Input should be a valid dictionary', 'input': [1, 2, 3]}\n ]\n\n\n@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 ({1, '2'}, IsOneOf([1, '2'], ['2', 1])),\n ),\n)\ndef test_list_success(value, result):\n class Model(BaseModel):\n v: list\n\n assert Model(v=value).v == result\n\n\n@pytest.mark.parametrize('value', (123, '123'))\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'list_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid list',\n 'input': value,\n }\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'dict_type', 'loc': ('v',), 'msg': 'Input should be a valid dictionary', 'input': [1, 2, 3]}\n ]\n\n\n@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 ({1, '2'}, IsOneOf((1, '2'), ('2', 1))),\n ),\n)\ndef test_tuple_success(value, result):\n class Model(BaseModel):\n v: tuple\n\n assert Model(v=value).v == result\n\n\n@pytest.mark.parametrize('value', (123, '123'))\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'tuple_type', 'loc': ('v',), 'msg': 'Input should be a valid tuple', 'input': value}\n ]\n\n\n@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\n\n\n@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(include_url=False) == exc\n\n\n@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_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_set_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": 2041, "end_line": 2246, "span_ids": ["test_list_type_fails", "test_infinite_iterable_validate_first", "test_iterable_error_hide_input", "str_iterable", "test_sequence_generator_fails", "test_sequence_success", "test_set_type_fails", "test_set_fails", "test_infinite_iterable_int", "test_iterable_any", "test_invalid_iterable", "int_iterable"], "tokens": 1574}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'set_type', 'loc': ('v',), 'msg': 'Input should be a valid set', 'input': '123'}\n ]\n\n\n@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\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\n@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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'iterable_type', 'loc': ('it',), 'msg': 'Input should be iterable', 'input': 3}\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'iterable_type', 'loc': ('it',), 'msg': 'Input should be iterable', 'input': 3}\n ]\n\n\n@pytest.mark.parametrize(\n 'config,input_str',\n (\n ({}, 'type=iterable_type, input_value=5, input_type=int'),\n ({'hide_input_in_errors': False}, 'type=iterable_type, input_value=5, input_type=int'),\n ({'hide_input_in_errors': True}, 'type=iterable_type'),\n ),\n)\ndef test_iterable_error_hide_input(config, input_str):\n class Model(BaseModel):\n it: Iterable[int]\n\n model_config = ConfigDict(**config)\n\n with pytest.raises(ValidationError, match=re.escape(f'Input should be iterable [{input_str}]')):\n Model(it=5)\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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_sequence_fails_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": 2276, "end_line": 2486, "span_ids": ["test_sequence_fails", "test_float_validation", "test_sequence_strict", "test_int_validation"], "tokens": 1677}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 a 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 a 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(include_url=False) == errors\n\n\ndef test_sequence_strict():\n assert TypeAdapter(Sequence[int]).validate_python((), strict=True) == ()\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_float_validation.assert_exc_info_value_err_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_float_validation.assert_exc_info_value_err_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": 2463, "end_line": 2740, "span_ids": ["test_float_validation", "test_infinite_float_json_serialization", "test_infinite_float_validation", "test_strict_int", "test_strict_bytes_max_length", "test_strict_str", "test_finite_float_config", "test_strict_float", "test_big_int_json", "test_bool_unhashable_fails", "test_strict_str_max_length", "test_strict_bytes", "test_strict_bool", "test_finite_float_validation_error"], "tokens": 2057}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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(include_url=False) == [\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 ]\n\n\ndef test_infinite_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(\n ('ser_json_inf_nan', 'input', 'output', 'python_roundtrip'),\n (\n ('null', float('inf'), 'null', None),\n ('null', float('-inf'), 'null', None),\n ('null', float('nan'), 'null', None),\n ('constants', float('inf'), 'Infinity', float('inf')),\n ('constants', float('-inf'), '-Infinity', float('-inf')),\n ('constants', float('nan'), 'NaN', IsFloatNan),\n ),\n)\ndef test_infinite_float_json_serialization(ser_json_inf_nan, input, output, python_roundtrip):\n class Model(BaseModel):\n model_config = ConfigDict(ser_json_inf_nan=ser_json_inf_nan)\n a: float\n\n json_string = Model(a=input).model_dump_json()\n assert json_string == f'{{\"a\":{output}}}'\n assert json.loads(json_string) == {'a': python_roundtrip}\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'finite_number',\n 'loc': ('a',),\n 'msg': 'Input should be a finite number',\n 'input': HasRepr(repr(value)),\n }\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'finite_number',\n 'loc': ('a',),\n 'msg': 'Input should be a finite number',\n 'input': HasRepr('nan'),\n }\n ]\n\n\ndef 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)\n\n\ndef 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')\n\n\ndef test_strict_str():\n class FruitEnum(str, Enum):\n \"\"\"A subclass of a string\"\"\"\n\n pear = 'pear'\n banana = 'banana'\n\n class Model(BaseModel):\n v: StrictStr\n\n assert Model(v='foobar').v == 'foobar'\n\n assert Model.model_validate({'v': FruitEnum.banana}) == Model.model_construct(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')\n\n\ndef 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')\n\n\ndef 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=True)\n\n\n@pytest.mark.parametrize(\n ('input', 'expected_json'),\n (\n (9_223_372_036_854_775_807, b'9223372036854775807'),\n (-9_223_372_036_854_775_807, b'-9223372036854775807'),\n (1433352099889938534014333520998899385340, b'1433352099889938534014333520998899385340'),\n (-1433352099889938534014333520998899385340, b'-1433352099889938534014333520998899385340'),\n ),\n)\ndef test_big_int_json(input, expected_json):\n v = TypeAdapter(int)\n dumped = v.dump_json(input)\n assert dumped == expected_json\n assert v.validate_json(dumped) == input\n\n\ndef 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(include_url=False) == [\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_validation.None_2": {"__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_validation.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": 2715, "end_line": 2859, "span_ids": ["test_uuid_error", "test_uuid_json", "test_uuid_validation"], "tokens": 1213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 v = TypeAdapter(UUID)\n\n valid = UUID('49fdfa1d856d4003a83e4b9236532ec6')\n\n # sanity check\n assert v.validate_python(valid) == valid\n assert v.validate_python(valid.hex) == valid\n\n with pytest.raises(ValidationError) as exc_info:\n v.validate_python('ebcdab58-6eb8-46fb-a190-d07a3')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'loc': (),\n 'msg': 'Input should be a valid UUID, invalid group length in group 4: expected 12, found 5',\n 'input': 'ebcdab58-6eb8-46fb-a190-d07a3',\n 'ctx': {'error': 'invalid group length in group 4: expected 12, found 5'},\n 'type': 'uuid_parsing',\n }\n ]\n\n not_a_valid_input_type = object()\n with pytest.raises(ValidationError) as exc_info:\n v.validate_python(not_a_valid_input_type)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': not_a_valid_input_type,\n 'loc': (),\n 'msg': 'UUID input should be a string, bytes or UUID object',\n 'type': 'uuid_type',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n v.validate_python(valid.hex, strict=True)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'is_instance_of',\n 'loc': (),\n 'msg': 'Input should be an instance of UUID',\n 'input': '49fdfa1d856d4003a83e4b9236532ec6',\n 'ctx': {'class': 'UUID'},\n }\n ]\n\n assert v.validate_json(json.dumps(valid.hex), strict=True) == valid\n\n\ndef test_uuid_json():\n class Model(BaseModel):\n v: UUID\n v1: UUID1\n v3: UUID3\n v4: UUID4\n\n m = Model(v=uuid.uuid4(), v1=uuid.uuid1(), v3=uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org'), v4=uuid.uuid4())\n assert m.model_dump_json() == f'{{\"v\":\"{m.v}\",\"v1\":\"{m.v1}\",\"v3\":\"{m.v3}\",\"v4\":\"{m.v4}\"}}'\n\n\ndef test_uuid_validation():\n class UUIDModel(BaseModel):\n a: UUID1\n b: UUID3\n c: UUID4\n d: UUID5\n e: UUID\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 e = UUID('{00000000-7fff-4000-7fff-000000000000}')\n\n m = UUIDModel(a=a, b=b, c=c, d=d, e=e)\n assert m.model_dump() == {'a': a, 'b': b, 'c': c, 'd': d, 'e': e}\n\n with pytest.raises(ValidationError) as exc_info:\n UUIDModel(a=d, b=c, c=b, d=a, e=e)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'uuid_version',\n 'loc': ('a',),\n 'msg': 'UUID version 1 expected',\n 'input': d,\n 'ctx': {'expected_version': 1},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('b',),\n 'msg': 'UUID version 3 expected',\n 'input': c,\n 'ctx': {'expected_version': 3},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('c',),\n 'msg': 'UUID version 4 expected',\n 'input': b,\n 'ctx': {'expected_version': 4},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('d',),\n 'msg': 'UUID version 5 expected',\n 'input': a,\n 'ctx': {'expected_version': 5},\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n UUIDModel(a=e, b=e, c=e, d=e, e=e)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'uuid_version',\n 'loc': ('a',),\n 'msg': 'UUID version 1 expected',\n 'input': e,\n 'ctx': {'expected_version': 1},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('b',),\n 'msg': 'UUID version 3 expected',\n 'input': e,\n 'ctx': {'expected_version': 3},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('c',),\n 'msg': 'UUID version 4 expected',\n 'input': e,\n 'ctx': {'expected_version': 4},\n },\n {\n 'type': 'uuid_version',\n 'loc': ('d',),\n 'msg': 'UUID version 5 expected',\n 'input': e,\n 'ctx': {'expected_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_path_strict_override.assert_m_x_Path_foo_": {"__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_path_strict_override.assert_m_x_Path_foo_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 2862, "end_line": 3319, "span_ids": ["test_decimal_invalid", "test_path_validation_constrained", "test_path_like_strict", "test_str_strip_whitespace", "test_uuid_strict", "test_str_to_lower", "test_path_validation_success", "test_path_strict_override", "test_decimal_not_finite", "test_str_to_upper", "impl:5", "fix_allow_inf_model", "test_path_like"], "tokens": 1996}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 StrictByConfig(BaseModel):\n a: UUID1\n b: UUID3\n c: UUID4\n d: UUID5\n e: uuid.UUID\n\n model_config = ConfigDict(strict=True)\n\n class StrictByField(BaseModel):\n a: UUID1 = Field(..., strict=True)\n b: UUID3 = Field(..., strict=True)\n c: UUID4 = Field(..., strict=True)\n d: UUID5 = Field(..., strict=True)\n e: uuid.UUID = Field(..., 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 e = uuid.UUID('7fb48116-ca6b-11ed-a439-3274d3adddac') # any uuid\n\n strict_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 'type': 'is_instance_of',\n 'loc': ('e',),\n 'msg': 'Input should be an instance of UUID',\n 'input': '7fb48116-ca6b-11ed-a439-3274d3adddac',\n 'ctx': {'class': 'UUID'},\n },\n ]\n\n for model in [StrictByConfig, StrictByField]:\n with pytest.raises(ValidationError) as exc_info:\n model(a=str(a), b=str(b), c=str(c), d=str(d), e=str(e))\n assert exc_info.value.errors(include_url=False) == strict_errors\n\n m = model(a=a, b=b, c=c, d=d, e=e)\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\n assert isinstance(m.e, type(e)) and m.e == e\n\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)\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\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_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()\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\n\n\n@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\n\n\ndef test_decimal_invalid():\n with pytest.raises(SchemaError, 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 assert Model.model_validate_json(json.dumps({'foo': str(value)})).foo == result\n\n\ndef test_path_validation_constrained():\n ta = TypeAdapter(Annotated[Path, Field(min_length=9, max_length=20)])\n with pytest.raises(ValidationError):\n ta.validate_python('/short')\n with pytest.raises(ValidationError):\n ta.validate_python('/' + 'long' * 100)\n assert ta.validate_python('/just/right/enough') == Path('/just/right/enough')\n\n\ndef test_path_like():\n class Model(BaseModel):\n foo: os.PathLike\n\n assert Model(foo='/foo/bar').foo == Path('/foo/bar')\n assert Model(foo=Path('/foo/bar')).foo == Path('/foo/bar')\n assert Model.model_validate_json('{\"foo\": \"abc\"}').foo == Path('abc')\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'type': 'object',\n 'properties': {'foo': {'type': 'string', 'format': 'path', 'title': 'Foo'}},\n 'required': ['foo'],\n 'title': 'Model',\n }\n\n\ndef test_path_like_strict():\n class Model(BaseModel):\n model_config = dict(strict=True)\n\n foo: os.PathLike\n\n with pytest.raises(ValidationError, match='Input should be an instance of PathLike'):\n Model(foo='/foo/bar')\n assert Model(foo=Path('/foo/bar')).foo == Path('/foo/bar')\n assert Model.model_validate_json('{\"foo\": \"abc\"}').foo == Path('abc')\n # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'type': 'object',\n 'properties': {'foo': {'type': 'string', 'format': 'path', 'title': 'Foo'}},\n 'required': ['foo'],\n 'title': 'Model',\n }\n\n\ndef test_path_strict_override():\n class Model(BaseModel):\n model_config = ConfigDict(strict=True)\n\n x: Path = Field(strict=False)\n\n m = Model(x='/foo/bar')\n assert m.x == Path('/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_types.py_test_path_validation_fails_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_path_validation_fails_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": 3322, "end_line": 3607, "span_ids": ["test_directory_path_validation_fails", "test_path_validation_strict", "test_file_path_validation_fails", "test_number_multiple_of_float_invalid", "test_number_le", "test_new_type_success", "test_number_multiple_of_int_valid", "test_number_multiple_of_int_invalid", "test_number_lt", "test_new_path_validation_success", "test_number_multiple_of_float_valid", "test_path_validation_fails", "test_new_path_validation_parent_does_not_exist", "test_directory_path_validation_success", "test_file_path_validation_success", "test_number_ge", "test_number_gt", "test_new_path_validation_path_already_exists"], "tokens": 2039}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'path_type', 'loc': ('foo',), 'msg': 'Input is not a valid path', 'input': 123}\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=None)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'path_type', 'loc': ('foo',), 'msg': 'Input is not a valid path', 'input': None}\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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')\n\n\n@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(include_url=False) == [\n {\n 'type': 'path_not_file',\n 'loc': ('foo',),\n 'msg': 'Path does not point to a file',\n 'input': value,\n }\n ]\n\n\n@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(include_url=False) == [\n {\n 'type': 'path_not_directory',\n 'loc': ('foo',),\n 'msg': 'Path does not point to a directory',\n 'input': value,\n }\n ]\n\n\n@pytest.mark.parametrize('value', ('tests/test_types.py', Path('tests/test_types.py')))\ndef test_new_path_validation_path_already_exists(value):\n class Model(BaseModel):\n foo: NewPath\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'path_exists',\n 'loc': ('foo',),\n 'msg': 'Path already exists',\n 'input': value,\n }\n ]\n\n\n@pytest.mark.parametrize('value', ('/nonexistentdir/foo.py', Path('/nonexistentdir/foo.py')))\ndef test_new_path_validation_parent_does_not_exist(value):\n class Model(BaseModel):\n foo: NewPath\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=value)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'parent_does_not_exist',\n 'loc': ('foo',),\n 'msg': 'Parent directory does not exist',\n 'input': value,\n }\n ]\n\n\n@pytest.mark.parametrize(\n 'value,result', (('tests/foo.py', Path('tests/foo.py')), (Path('tests/foo.py'), Path('tests/foo.py')))\n)\ndef test_new_path_validation_success(value, result):\n class Model(BaseModel):\n foo: NewPath\n\n assert Model(foo=value).foo == result\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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}\n\n\n@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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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}\n\n\n@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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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_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_new_type_fails_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": 3610, "end_line": 3853, "span_ids": ["test_json_before_validator", "test_valid_simple_json", "test_valid_simple_json_any", "test_json_not_str", "test_json_optional_simple", "test_invalid_detailed_json_type_error", "test_invalid_simple_json", "test_valid_detailed_json", "test_valid_model_json", "test_json_required", "test_valid_simple_json_bytes", "test_new_type_fails", "test_invalid_model_json", "test_json_optional_complex"], "tokens": 1966}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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]}}\n\n\n@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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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]}}\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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]}}\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing', 'loc': ('json_obj', 'b'), 'msg': 'Field required', 'input': {'a': 1, 'c': [2, 3]}}\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'json_type',\n 'loc': ('json_obj',),\n 'msg': 'JSON input should be string, bytes or bytearray',\n 'input': 12,\n }\n ]\n\n\ndef 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']}\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_namedtuple.py_test_namedtuple_postponed_annotation_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_types_namedtuple.py_test_namedtuple_postponed_annotation_test_namedtuple_arbitrary_type.with_pytest_raises_Pydant.ModelNoArbitraryTypes.x", "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": 122, "end_line": 158, "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_namedtuple.py_test_recursive_namedtuple_test_recursive_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_recursive_namedtuple_test_recursive_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": 161, "end_line": 178, "span_ids": ["test_recursive_namedtuple"], "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_recursive_namedtuple():\n class MyNamedTuple(NamedTuple):\n x: int\n y: Optional['MyNamedTuple']\n\n ta = TypeAdapter(MyNamedTuple)\n assert ta.validate_python({'x': 1, 'y': {'x': 2, 'y': None}}) == (1, (2, None))\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python({'x': 1, 'y': {'x': 2, 'y': {'x': 'a', 'y': None}}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'a',\n 'loc': ('y', '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_typeddict_model_serializer_test_typeddict_model_serializer.assert_ta_dump_python_Mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_model_serializer_test_typeddict_model_serializer.assert_ta_dump_python_Mod", "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": 846, "end_line": 857, "span_ids": ["test_typeddict_model_serializer"], "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_typeddict_model_serializer(TypedDict) -> None:\n class Model(TypedDict):\n x: int\n y: float\n\n @model_serializer(mode='plain')\n def ser_model(self) -> Dict[str, Any]:\n return {'x': self['x'] * 2, 'y': self['y'] * 3}\n\n ta = TypeAdapter(Model)\n\n assert ta.dump_python(Model({'x': 1, 'y': 2.5})) == {'x': 2, 'y': 7.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_typeddict.py_test_model_config_test_schema_generator.assert_ta_validate_python": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_model_config_test_schema_generator.assert_ta_validate_python", "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": 860, "end_line": 893, "span_ids": ["test_model_config", "test_schema_generator", "test_model_config_inherited"], "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_model_config() -> None:\n class Model(TypedDict):\n x: str\n __pydantic_config__ = ConfigDict(str_to_lower=True) # type: ignore\n\n ta = TypeAdapter(Model)\n\n assert ta.validate_python({'x': 'ABC'}) == {'x': 'abc'}\n\n\ndef test_model_config_inherited() -> None:\n class Base(TypedDict):\n __pydantic_config__ = ConfigDict(str_to_lower=True) # type: ignore\n\n class Model(Base):\n x: str\n\n ta = TypeAdapter(Model)\n\n assert ta.validate_python({'x': 'ABC'}) == {'x': 'abc'}\n\n\ndef test_schema_generator() -> None:\n class LaxStrGenerator(GenerateSchema):\n def str_schema(self) -> CoreSchema:\n return core_schema.no_info_plain_validator_function(str)\n\n class Model(TypedDict):\n x: str\n __pydantic_config__ = ConfigDict(schema_generator=LaxStrGenerator) # type: ignore\n\n ta = TypeAdapter(Model)\n\n assert ta.validate_python(dict(x=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_typeddict.py_test_grandparent_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_grandparent_config_", "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": 897, "end_line": 933, "span_ids": ["test_typeddict_with_config_decorator", "test_typeddict_mro", "test_grandparent_config"], "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_grandparent_config():\n class MyTypedDict(TypedDict):\n __pydantic_config__ = ConfigDict(str_to_lower=True)\n x: str\n\n class MyMiddleTypedDict(MyTypedDict):\n y: str\n\n class MySubTypedDict(MyMiddleTypedDict):\n z: str\n\n validated_data = TypeAdapter(MySubTypedDict).validate_python({'x': 'ABC', 'y': 'DEF', 'z': 'GHI'})\n assert validated_data == {'x': 'abc', 'y': 'def', 'z': 'ghi'}\n\n\ndef test_typeddict_mro():\n class A(TypedDict):\n x = 1\n\n class B(A):\n x = 2\n\n class C(B):\n pass\n\n assert get_attribute_from_bases(C, 'x') == 2\n\n\ndef test_typeddict_with_config_decorator():\n @with_config(ConfigDict(str_to_lower=True))\n class Model(TypedDict):\n x: str\n\n ta = TypeAdapter(Model)\n\n assert ta.validate_python({'x': 'ABC'}) == {'x': 'abc'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_partial_test_positional_and_keyword_with_same_name.assert_module_f_1_a_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_partial_test_positional_and_keyword_with_same_name.assert_module_f_1_a_2_", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 587, "end_line": 619, "span_ids": ["test_partial", "test_validator_init", "test_positional_and_keyword_with_same_name"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_partial():\n def my_wrapped_function(a: int, b: int, c: int):\n return a + b + c\n\n my_partial_function = partial(my_wrapped_function, c=3)\n f = validate_call(my_partial_function)\n assert f(1, 2) == 6\n\n\ndef test_validator_init():\n class Foo:\n @validate_call\n def __init__(self, a: int, b: int):\n self.v = a + b\n\n assert Foo(1, 2).v == 3\n assert Foo(1, '2').v == 3\n with pytest.raises(ValidationError, match=\"type=int_parsing, input_value='x', input_type=str\"):\n Foo(1, 'x')\n\n\ndef test_positional_and_keyword_with_same_name(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import validate_call\n\n@validate_call\ndef f(a: int, /, **kwargs):\n return a, kwargs\n\"\"\"\n )\n assert module.f(1, a=2) == (1, {'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_validate_call.py_test_model_as_arg_test_model_as_arg.assert_res_x_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_model_as_arg_test_model_as_arg.assert_res_x_1_", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 628, "end_line": 640, "span_ids": ["test_model_as_arg"], "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_model_as_arg() -> None:\n class Model1(TypedDict):\n x: int\n\n class Model2(BaseModel):\n y: int\n\n @validate_call(validate_return=True)\n def f1(m1: Model1, m2: Model2) -> Tuple[Model1, Model2]:\n return (m1, m2.model_dump()) # type: ignore\n\n res = f1({'x': '1'}, {'y': '2'}) # type: ignore\n assert res == ({'x': 1}, Model2(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_validate_call.py_test_do_not_call_repr_on_validate_call_test_classmethod_order_error.with_pytest_raises_.A.method.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_do_not_call_repr_on_validate_call_test_classmethod_order_error.with_pytest_raises_.A.method.pass", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 637, "end_line": 711, "span_ids": ["test_classmethod_order_error", "test_methods_are_not_rebound", "test_dynamic_method_decoration", "test_do_not_call_repr_on_validate_call", "test_basemodel_method"], "tokens": 432}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_do_not_call_repr_on_validate_call() -> None:\n class Class:\n @validate_call\n def __init__(self, number: int) -> None:\n ...\n\n def __repr__(self) -> str:\n assert False\n\n Class(50)\n\n\ndef test_methods_are_not_rebound():\n class Thing:\n def __init__(self, x: int):\n self.x = x\n\n def a(self, x: int):\n return x + self.x\n\n c = validate_call(a)\n\n thing = Thing(1)\n assert thing.a == thing.a\n assert thing.c == thing.c\n assert Thing.c == Thing.c\n\n # Ensure validation is still happening\n assert Thing.c(thing, '2') == 3\n assert Thing(2).c('3') == 5\n\n\ndef test_basemodel_method():\n class Foo(BaseModel):\n @classmethod\n @validate_call\n def test(cls, x: int):\n return cls, x\n\n assert Foo.test('1') == (Foo, 1)\n\n class Bar(BaseModel):\n @validate_call\n def test(self, x: int):\n return self, x\n\n bar = Bar()\n assert bar.test('1') == (bar, 1)\n\n\ndef test_dynamic_method_decoration():\n class Foo:\n def bar(self, value: str) -> str:\n return f'bar-{value}'\n\n Foo.bar = validate_call(Foo.bar)\n assert Foo.bar\n\n foo = Foo()\n assert foo.bar('test') == 'bar-test'\n\n\n@pytest.mark.parametrize('decorator', [staticmethod, classmethod])\ndef test_classmethod_order_error(decorator):\n name = decorator.__name__\n with pytest.raises(\n TypeError,\n match=re.escape(f'The `@{name}` decorator should be applied after `@validate_call` (put `@{name}` on top)'),\n ):\n\n class A:\n @validate_call\n @decorator\n def method(self, x: 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_validate_call.py_test_async_func_test_async_func.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_async_func_test_async_func.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 708, "end_line": 727, "span_ids": ["test_async_func"], "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_async_func() -> None:\n @validate_call(validate_return=True)\n async def foo(a: Any) -> int:\n return a\n\n res = asyncio.run(foo(1))\n assert res == 1\n\n with pytest.raises(ValidationError) as exc_info:\n asyncio.run(foo('x'))\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': (),\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_contextlib_test_annotated_validator_before.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_contextlib_test_annotated_validator_before.None_2", "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": 64, "span_ids": ["imports", "test_annotated_validator_before", "test_annotated_validator_after"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import contextlib\nimport re\nimport sys\nfrom collections import deque\nfrom dataclasses import dataclass\nfrom datetime import date, datetime\nfrom enum import Enum\nfrom functools import partial, partialmethod\nfrom itertools import product\nfrom typing import Any, Callable, Deque, Dict, FrozenSet, List, NamedTuple, Optional, Tuple, Union\nfrom unittest.mock import MagicMock\n\nimport pytest\nfrom dirty_equals import HasRepr, IsInstance\nfrom pydantic_core import core_schema\nfrom typing_extensions import Annotated, Literal, TypedDict\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n Field,\n GetCoreSchemaHandler,\n PlainSerializer,\n PydanticDeprecatedSince20,\n PydanticUserError,\n TypeAdapter,\n ValidationError,\n ValidationInfo,\n ValidatorFunctionWrapHandler,\n errors,\n field_validator,\n model_validator,\n root_validator,\n validate_call,\n validator,\n)\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\nfrom pydantic.functional_validators import AfterValidator, BeforeValidator, PlainValidator, WrapValidator\n\nV1_VALIDATOR_DEPRECATION_MATCH = r'Pydantic V1 style `@validator` validators are deprecated'\n\n\ndef test_annotated_validator_after() -> None:\n MyInt = Annotated[int, AfterValidator(lambda x, _info: x if x != -1 else 0)]\n\n class Model(BaseModel):\n x: MyInt\n\n assert Model(x=0).x == 0\n assert Model(x=-1).x == 0\n assert Model(x=-2).x == -2\n assert Model(x=1).x == 1\n assert Model(x='-1').x == 0\n\n\ndef test_annotated_validator_before() -> None:\n FloatMaybeInf = Annotated[float, BeforeValidator(lambda x, _info: x if x != 'zero' else 0.0)]\n\n class Model(BaseModel):\n x: FloatMaybeInf\n\n assert Model(x='zero').x == 0.0\n assert Model(x=1.0).x == 1.0\n assert Model(x='1.0').x == 1.0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_builtin_test_annotated_validator_plain.assert_Model_x_2_x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_annotated_validator_builtin_test_annotated_validator_plain.assert_Model_x_2_x_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 66, "end_line": 89, "span_ids": ["test_annotated_validator_plain", "test_annotated_validator_builtin"], "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": "@pytest.mark.xfail(sys.version_info >= (3, 9) and sys.implementation.name == 'pypy', reason='PyPy 3.9+ bug')\ndef test_annotated_validator_builtin() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6752\"\"\"\n TruncatedFloat = Annotated[float, BeforeValidator(int)]\n DateTimeFromIsoFormat = Annotated[datetime, BeforeValidator(datetime.fromisoformat)]\n\n class Model(BaseModel):\n x: TruncatedFloat\n y: DateTimeFromIsoFormat\n\n m = Model(x=1.234, y='2011-11-04T00:05:23')\n assert m.x == 1\n assert m.y == datetime(2011, 11, 4, 0, 5, 23)\n\n\ndef test_annotated_validator_plain() -> None:\n MyInt = Annotated[int, PlainValidator(lambda x, _info: x if x != -1 else 0)]\n\n class Model(BaseModel):\n x: MyInt\n\n assert Model(x=0).x == 0\n assert Model(x=-1).x == 0\n assert Model(x=-2).x == -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_bad_fields_throws_configerror_test_validator_bad_fields_throws_configerror.with_pytest_raises_TypeEr.Model.with_pytest_warns_Pydanti.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_Pydanti.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": 577, "end_line": 592, "span_ids": ["test_validator_bad_fields_throws_configerror"], "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_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(PydanticDeprecatedSince20, 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_root_validator_test_root_validator.Model.with_pytest_warns_Pydanti.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.with_pytest_warns_Pydanti.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": 1320, "end_line": 1347, "span_ids": ["test_root_validator"], "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_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 with pytest.warns(PydanticDeprecatedSince20):\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_pre_test_root_validator_pre.Model.with_pytest_warns_Pydanti.root_validator.return._a_42_b_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_pre_test_root_validator_pre.Model.with_pytest_warns_Pydanti.root_validator.return._a_42_b_changed_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1423, "end_line": 1442, "span_ids": ["test_root_validator_pre"], "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_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 with pytest.warns(PydanticDeprecatedSince20):\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 # ... 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_test_root_validator_classmethod.Model.with_pytest_warns_Pydanti.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.with_pytest_warns_Pydanti.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": 1529, "end_line": 1554, "span_ids": ["test_root_validator_classmethod"], "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.parametrize('validator_classmethod,root_validator_classmethod', product(*[[True, False]] * 2))\ndef test_root_validator_classmethod(validator_classmethod, root_validator_classmethod):\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\n with pytest.warns(PydanticDeprecatedSince20):\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_skip_on_failure_invalid_test_root_validator_skip_on_failure_invalid.with_pytest_raises_TypeEr.with_pytest_warns_.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.with_pytest_warns_.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": 1832, "end_line": 1849, "span_ids": ["test_root_validator_skip_on_failure_invalid"], "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": "@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 with pytest.warns(\n PydanticDeprecatedSince20, match='Pydantic V1 style `@root_validator` validators are deprecated.'\n ):\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.with_pytest_warns_.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.with_pytest_warns_.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": 1852, "end_line": 1869, "span_ids": ["test_root_validator_skip_on_failure_valid"], "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": "@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 with pytest.warns(\n PydanticDeprecatedSince20, match='Pydantic V1 style `@root_validator` validators are deprecated.'\n ):\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_self_test_v1_validator_signature_kwargs_not_allowed.with_pytest_warns_Pydanti.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_Pydanti.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": 1978, "end_line": 2022, "span_ids": ["test_v1_validator_signature_kwargs_not_allowed", "test_field_validator_self", "test_validator_self", "test_root_validator_self"], "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_root_validator_self():\n with pytest.raises(TypeError, match=r'`@root_validator` cannot be applied to instance methods'):\n with pytest.warns(PydanticDeprecatedSince20):\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(PydanticDeprecatedSince20, 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(PydanticDeprecatedSince20, 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_with_field_test_v1_validator_signature_with_config.with_pytest_warns_Pydanti.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_Pydanti.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": 2090, "end_line": 2113, "span_ids": ["test_v1_validator_signature_with_config", "test_v1_validator_signature_with_field"], "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_v1_validator_signature_with_field() -> None:\n with pytest.warns(PydanticDeprecatedSince20, 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(PydanticDeprecatedSince20, 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_functools_partialmethod_validator_v1_test_functools_partialmethod_validator_v1.with_pytest_warns_Pydanti.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_functools_partialmethod_validator_v1_test_functools_partialmethod_validator_v1.with_pytest_warns_Pydanti.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2353, "end_line": 2375, "span_ids": ["test_functools_partialmethod_validator_v1"], "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": "@pytest.mark.parametrize(\n 'func',\n [\n partial_val_func1,\n partial_val_func2,\n partial_values_val_func1,\n partial_values_val_func2,\n ],\n)\ndef test_functools_partialmethod_validator_v1(\n func: Callable[..., Any],\n) -> None:\n with pytest.warns(PydanticDeprecatedSince20, match=V1_VALIDATOR_DEPRECATION_MATCH):\n\n class Model(BaseModel):\n x: int\n\n val = validator('x')(partialmethod(func, allowed=42))\n\n Model(x=42)\n\n with pytest.raises(ValidationError):\n Model(x=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_validator_function_error_hide_input_test_validator_function_error_hide_input.with_pytest_raises_Valida.Model_x_123_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validator_function_error_hide_input_test_validator_function_error_hide_input.with_pytest_raises_Valida.Model_x_123_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2591, "end_line": 2617, "span_ids": ["test_validator_function_error_hide_input"], "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": "@pytest.mark.parametrize(\n 'mode,config,input_str',\n (\n ('before', {}, \"type=value_error, input_value='123', input_type=str\"),\n ('before', {'hide_input_in_errors': False}, \"type=value_error, input_value='123', input_type=str\"),\n ('before', {'hide_input_in_errors': True}, 'type=value_error'),\n ('after', {}, \"type=value_error, input_value='123', input_type=str\"),\n ('after', {'hide_input_in_errors': False}, \"type=value_error, input_value='123', input_type=str\"),\n ('after', {'hide_input_in_errors': True}, 'type=value_error'),\n ('plain', {}, \"type=value_error, input_value='123', input_type=str\"),\n ('plain', {'hide_input_in_errors': False}, \"type=value_error, input_value='123', input_type=str\"),\n ('plain', {'hide_input_in_errors': True}, 'type=value_error'),\n ),\n)\ndef test_validator_function_error_hide_input(mode, config, input_str):\n class Model(BaseModel):\n x: str\n\n model_config = ConfigDict(**config)\n\n @field_validator('x', mode=mode)\n @classmethod\n def check_a1(cls, v: str) -> str:\n raise ValueError('foo')\n\n with pytest.raises(ValidationError, match=re.escape(f'Value error, foo [{input_str}]')):\n Model(x='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_foobar_validate_test_before_validator_field_name.assert_m_foobar_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_foobar_validate_test_before_validator_field_name.assert_m_foobar_valu", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2620, "end_line": 2712, "span_ids": ["test_after_validator_field_name", "test_before_validator_field_name", "Foobar", "Foobar.__get_pydantic_core_schema__", "test_custom_type_field_name_typed_dict", "foobar_validate", "test_custom_type_field_name_dataclass", "test_custom_type_field_name_model", "test_custom_type_field_name_model_nested", "test_custom_type_field_name_validate_call", "test_custom_type_field_name_named_tuple"], "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 foobar_validate(value: Any, info: core_schema.ValidationInfo):\n data = info.data\n if isinstance(data, dict):\n data = data.copy()\n return {'value': value, 'field_name': info.field_name, 'data': data}\n\n\nclass Foobar:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n return core_schema.with_info_plain_validator_function(foobar_validate, field_name=handler.field_name)\n\n\ndef test_custom_type_field_name_model():\n class MyModel(BaseModel):\n foobar: Foobar\n\n m = MyModel(foobar=1, tuple_nesting=(1, 2))\n # insert_assert(m.foobar)\n assert m.foobar == {'value': 1, 'field_name': 'foobar', 'data': {}}\n\n\ndef test_custom_type_field_name_model_nested():\n class MyModel(BaseModel):\n x: int\n tuple_nested: Tuple[int, Foobar]\n\n m = MyModel(x='123', tuple_nested=(1, 2))\n # insert_assert(m.tuple_nested[1])\n assert m.tuple_nested[1] == {'value': 2, 'field_name': 'tuple_nested', 'data': {'x': 123}}\n\n\ndef test_custom_type_field_name_typed_dict():\n class MyDict(TypedDict):\n x: int\n foobar: Foobar\n\n ta = TypeAdapter(MyDict)\n m = ta.validate_python({'x': '123', 'foobar': 1})\n # insert_assert(m['foobar'])\n assert m['foobar'] == {'value': 1, 'field_name': 'foobar', 'data': {'x': 123}}\n\n\ndef test_custom_type_field_name_dataclass():\n @dataclass\n class MyDc:\n x: int\n foobar: Foobar\n\n ta = TypeAdapter(MyDc)\n m = ta.validate_python({'x': '123', 'foobar': 1})\n # insert_assert(m.foobar)\n assert m.foobar == {'value': 1, 'field_name': 'foobar', 'data': {'x': 123}}\n\n\ndef test_custom_type_field_name_named_tuple():\n class MyNamedTuple(NamedTuple):\n x: int\n foobar: Foobar\n\n ta = TypeAdapter(MyNamedTuple)\n m = ta.validate_python({'x': '123', 'foobar': 1})\n # insert_assert(m.foobar)\n assert m.foobar == {'value': 1, 'field_name': 'foobar', 'data': None}\n\n\ndef test_custom_type_field_name_validate_call():\n @validate_call\n def foobar(x: int, y: Foobar):\n return x, y\n\n # insert_assert(foobar(1, 2))\n assert foobar(1, 2) == (1, {'value': 2, 'field_name': 'y', 'data': None})\n\n\ndef test_after_validator_field_name():\n class MyModel(BaseModel):\n x: int\n foobar: Annotated[int, AfterValidator(foobar_validate)]\n\n m = MyModel(x='123', foobar='1')\n # insert_assert(m.foobar)\n assert m.foobar == {'value': 1, 'field_name': 'foobar', 'data': {'x': 123}}\n\n\ndef test_before_validator_field_name():\n class MyModel(BaseModel):\n x: int\n foobar: Annotated[Dict[Any, Any], BeforeValidator(foobar_validate)]\n\n m = MyModel(x='123', foobar='1')\n # insert_assert(m.foobar)\n assert m.foobar == {'value': '1', 'field_name': 'foobar', 'data': {'x': 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_plain_validator_field_name_test_wrap_validator_field_name.assert_m_foobar_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_plain_validator_field_name_test_wrap_validator_field_name.assert_m_foobar_valu", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2715, "end_line": 2739, "span_ids": ["validate_wrap", "test_wrap_validator_field_name", "test_plain_validator_field_name"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_plain_validator_field_name():\n class MyModel(BaseModel):\n x: int\n foobar: Annotated[int, PlainValidator(foobar_validate)]\n\n m = MyModel(x='123', foobar='1')\n # insert_assert(m.foobar)\n assert m.foobar == {'value': '1', 'field_name': 'foobar', 'data': {'x': 123}}\n\n\ndef validate_wrap(value: Any, handler: core_schema.ValidatorFunctionWrapHandler, info: core_schema.ValidationInfo):\n data = info.data\n if isinstance(data, dict):\n data = data.copy()\n return {'value': handler(value), 'field_name': info.field_name, 'data': data}\n\n\ndef test_wrap_validator_field_name():\n class MyModel(BaseModel):\n x: int\n foobar: Annotated[int, WrapValidator(validate_wrap)]\n\n m = MyModel(x='123', foobar='1')\n # insert_assert(m.foobar)\n assert m.foobar == {'value': 1, 'field_name': 'foobar', 'data': {'x': 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_validate_default_raises_for_basemodel_test_validate_default_raises_for_basemodel.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_default_raises_for_basemodel_test_validate_default_raises_for_basemodel.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": 2742, "end_line": 2775, "span_ids": ["test_validate_default_raises_for_basemodel"], "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_validate_default_raises_for_basemodel() -> None:\n class Model(BaseModel):\n value_0: str\n value_a: Annotated[Optional[str], Field(None, validate_default=True)]\n value_b: Annotated[Optional[str], Field(None, validate_default=True)]\n\n @field_validator('value_a', mode='after')\n def value_a_validator(cls, value):\n raise AssertionError\n\n @field_validator('value_b', mode='after')\n def value_b_validator(cls, value):\n raise AssertionError\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing', 'loc': ('value_0',), 'msg': 'Field required', 'input': {}},\n {\n 'type': 'assertion_error',\n 'loc': ('value_a',),\n 'msg': 'Assertion failed, ',\n 'input': None,\n 'ctx': {'error': IsInstance(AssertionError)},\n },\n {\n 'type': 'assertion_error',\n 'loc': ('value_b',),\n 'msg': 'Assertion failed, ',\n 'input': None,\n 'ctx': {'error': IsInstance(AssertionError)},\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_warnings.py_from_pydantic_import_Pyda_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_warnings.py_from_pydantic_import_Pyda_", "embedding": null, "metadata": {"file_path": "tests/test_warnings.py", "file_name": "test_warnings.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["test_pydantic_deprecated_since_2_0_warning", "test_pydantic_deprecation_warning", "imports", "test_pydantic_deprecation_warning_2_0_migration_guide_link", "test_pydantic_deprecation_warning_calculated_expected_removal", "test_pydantic_deprecation_warning_tailing_dot_in_message"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from pydantic import PydanticDeprecatedSince20, PydanticDeprecationWarning\nfrom pydantic.version import version_short\n\n\ndef test_pydantic_deprecation_warning():\n warning = PydanticDeprecationWarning('Warning message', 'Arbitrary argument', since=(2, 1), expected_removal=(4, 0))\n\n assert str(warning) == 'Warning message. Deprecated in Pydantic V2.1 to be removed in V4.0.'\n assert warning.args[0] == 'Warning message'\n assert warning.args[1] == 'Arbitrary argument'\n\n\ndef test_pydantic_deprecation_warning_tailing_dot_in_message():\n warning = PydanticDeprecationWarning('Warning message.', since=(2, 1), expected_removal=(4, 0))\n\n assert str(warning) == 'Warning message. Deprecated in Pydantic V2.1 to be removed in V4.0.'\n assert warning.args[0] == 'Warning message.'\n\n\ndef test_pydantic_deprecation_warning_calculated_expected_removal():\n warning = PydanticDeprecationWarning('Warning message', since=(2, 1))\n\n assert str(warning) == 'Warning message. Deprecated in Pydantic V2.1 to be removed in V3.0.'\n\n\ndef test_pydantic_deprecation_warning_2_0_migration_guide_link():\n warning = PydanticDeprecationWarning('Warning message', since=(2, 0))\n\n assert (\n str(warning)\n == f'Warning message. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/{version_short()}/migration/'\n )\n\n\ndef test_pydantic_deprecated_since_2_0_warning():\n warning = PydanticDeprecatedSince20('Warning message')\n\n assert isinstance(warning, PydanticDeprecationWarning)\n assert warning.message == 'Warning message'\n assert warning.since == (2, 0)\n assert warning.expected_removal == (3, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapperStack_ConfigWrapperStack.push.try_.finally_.self__config_wrapper_stac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_config.py_ConfigWrapperStack_ConfigWrapperStack.push.try_.finally_.self__config_wrapper_stac", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_config.py", "file_name": "_config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 215, "span_ids": ["ConfigWrapperStack.push", "ConfigWrapperStack.tail", "ConfigWrapperStack", "ConfigWrapperStack.__init__"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigWrapperStack:\n \"\"\"A stack of `ConfigWrapper` instances.\"\"\"\n\n def __init__(self, config_wrapper: ConfigWrapper):\n self._config_wrapper_stack: list[ConfigWrapper] = [config_wrapper]\n\n @property\n def tail(self) -> ConfigWrapper:\n return self._config_wrapper_stack[-1]\n\n @contextmanager\n def push(self, config_wrapper: ConfigWrapper | ConfigDict | None):\n if config_wrapper is None:\n yield\n return\n\n if not isinstance(config_wrapper, ConfigWrapper):\n config_wrapper = ConfigWrapper(config_wrapper, check=False)\n\n self._config_wrapper_stack.append(config_wrapper)\n try:\n yield\n finally:\n self._config_wrapper_stack.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_complete_dataclass_complete_dataclass.cls.__pydantic_core_schema__.schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_complete_dataclass_complete_dataclass.cls.__pydantic_core_schema__.schema", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_dataclasses.py", "file_name": "_dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 179, "span_ids": ["complete_dataclass"], "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 complete_dataclass(\n cls: type[Any],\n config_wrapper: _config.ConfigWrapper,\n *,\n raise_errors: bool = True,\n types_namespace: dict[str, Any] | None,\n) -> bool:\n \"\"\"Finish building a pydantic dataclass.\n\n This logic is called on a class which has already been wrapped in `dataclasses.dataclass()`.\n\n This is somewhat analogous to `pydantic._internal._model_construction.complete_model_class`.\n\n Args:\n cls: The class.\n config_wrapper: The config wrapper instance.\n raise_errors: Whether to raise errors, defaults to `True`.\n types_namespace: The types namespace.\n\n Returns:\n `True` if building a pydantic dataclass is successfully completed, `False` otherwise.\n\n Raises:\n PydanticUndefinedAnnotation: If `raise_error` is `True` and there is an undefined annotations.\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 if types_namespace is None:\n types_namespace = _typing_extra.get_cls_types_namespace(cls)\n\n set_dataclass_fields(cls, types_namespace, config_wrapper=config_wrapper)\n\n typevars_map = get_standard_typevars_map(cls)\n gen_schema = GenerateSchema(\n config_wrapper,\n types_namespace,\n typevars_map,\n )\n\n # This needs to be called before we change the __init__\n sig = generate_pydantic_signature(\n init=cls.__init__,\n fields=cls.__pydantic_fields__, # type: ignore\n config_wrapper=config_wrapper,\n is_dataclass=True,\n )\n\n # dataclass.__init__ must be defined here so its `__qualname__` can be changed since functions can't be copied.\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\n cls.__init__ = __init__ # type: ignore\n cls.__pydantic_config__ = config_wrapper.config_dict # type: ignore\n cls.__signature__ = sig # type: ignore\n get_core_schema = getattr(cls, '__get_pydantic_core_schema__', None)\n try:\n if get_core_schema:\n schema = get_core_schema(\n cls,\n CallbackGetCoreSchemaHandler(\n partial(gen_schema.generate_schema, from_dunder_get_core_schema=False),\n gen_schema,\n ref_mode='unpack',\n ),\n )\n else:\n schema = gen_schema.generate_schema(cls, from_dunder_get_core_schema=False)\n except PydanticUndefinedAnnotation as e:\n if raise_errors:\n raise\n set_dataclass_mocks(cls, cls.__name__, f'`{e.name}`')\n return False\n\n core_config = config_wrapper.core_config(cls)\n\n try:\n schema = gen_schema.clean_schema(schema)\n except gen_schema.CollectedInvalid:\n set_dataclass_mocks(cls, cls.__name__, 'all referenced types')\n return False\n\n # We are about to set all the remaining required properties expected for this cast;\n # __pydantic_decorators__ and __pydantic_fields__ should already be set\n cls = typing.cast('type[PydanticDataclass]', cls)\n # debug(schema)\n\n cls.__pydantic_core_schema__ = 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/pydantic/_internal/_dataclasses.py_complete_dataclass.cls.__pydantic_validator___complete_dataclass.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_dataclasses.py_complete_dataclass.cls.__pydantic_validator___complete_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": 180, "end_line": 193, "span_ids": ["complete_dataclass"], "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 complete_dataclass(\n cls: type[Any],\n config_wrapper: _config.ConfigWrapper,\n *,\n raise_errors: bool = True,\n types_namespace: dict[str, Any] | None,\n) -> bool:\n # ... other code\n cls.__pydantic_validator__ = validator = create_schema_validator(\n schema, cls, cls.__module__, cls.__qualname__, 'dataclass', core_config, config_wrapper.plugin_settings\n )\n cls.__pydantic_serializer__ = SchemaSerializer(schema, core_config)\n\n if config_wrapper.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) # type: ignore\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/_decorators.py__Logic_related_to_valid_if_TYPE_CHECKING_.FieldValidatorModes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_decorators.py__Logic_related_to_valid_if_TYPE_CHECKING_.FieldValidatorModes", "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": 21, "span_ids": ["docstring"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Logic related to validators applied to models etc. via the `@field_validator` and `@model_validator` decorators.\"\"\"\nfrom __future__ import annotations as _annotations\n\nfrom collections import deque\nfrom dataclasses import dataclass, field\nfrom functools import cached_property, partial, partialmethod\nfrom inspect import Parameter, Signature, isdatadescriptor, ismethoddescriptor, signature\nfrom itertools import islice\nfrom typing import TYPE_CHECKING, Any, Callable, ClassVar, Generic, Iterable, TypeVar, Union\n\nfrom pydantic_core import PydanticUndefined, core_schema\nfrom typing_extensions import Literal, TypeAlias, is_typeddict\n\nfrom ..errors import PydanticUserError\nfrom ._core_utils import get_type_ref\nfrom ._internal_dataclass import slots_true\nfrom ._typing_extra import get_function_type_hints\n\nif TYPE_CHECKING:\n from ..fields import ComputedFieldInfo\n from ..functional_validators import FieldValidatorModes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._computed_field_schema.set_computed_field_metadata_GenerateSchema._computed_field_schema.return.core_schema_computed_fiel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._computed_field_schema.set_computed_field_metadata_GenerateSchema._computed_field_schema.return.core_schema_computed_fiel", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1682, "end_line": 1711, "span_ids": ["GenerateSchema._computed_field_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": "class GenerateSchema:\n\n def _computed_field_schema(\n self,\n d: Decorator[ComputedFieldInfo],\n field_serializers: dict[str, Decorator[FieldSerializerDecoratorInfo]],\n ) -> core_schema.ComputedField:\n # ... other code\n\n def set_computed_field_metadata(schema: CoreSchemaOrField, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n json_schema = handler(schema)\n\n json_schema['readOnly'] = True\n\n title = d.info.title\n if title is not None:\n json_schema['title'] = title\n\n description = d.info.description\n if description is not None:\n json_schema['description'] = description\n\n if d.info.deprecated or d.info.deprecated == '':\n json_schema['deprecated'] = True\n\n examples = d.info.examples\n if examples is not None:\n json_schema['examples'] = to_jsonable_python(examples)\n\n json_schema_extra = d.info.json_schema_extra\n if json_schema_extra is not None:\n add_json_schema_extra(json_schema, json_schema_extra)\n\n return json_schema\n\n metadata = build_metadata_dict(js_annotation_functions=[set_computed_field_metadata])\n return core_schema.computed_field(\n d.cls_var_name, return_schema=return_type_schema, alias=d.info.alias, 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_get_json_schema_update_func_get_json_schema_update_func.return.json_schema_update_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_get_json_schema_update_func_get_json_schema_update_func.return.json_schema_update_func", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2057, "end_line": 2067, "span_ids": ["get_json_schema_update_func"], "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 get_json_schema_update_func(\n json_schema_update: JsonSchemaValue, json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None\n) -> GetJsonSchemaFunction:\n def json_schema_update_func(\n core_schema_or_field: CoreSchemaOrField, handler: GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n json_schema = {**handler(core_schema_or_field), **json_schema_update}\n add_json_schema_extra(json_schema, json_schema_extra)\n return json_schema\n\n return json_schema_update_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/_generate_schema.py_add_json_schema_extra__CommonField.metadata": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_add_json_schema_extra__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": 2070, "end_line": 2085, "span_ids": ["_CommonField", "add_json_schema_extra"], "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 add_json_schema_extra(\n json_schema: JsonSchemaValue, json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None\n):\n if isinstance(json_schema_extra, dict):\n json_schema.update(to_jsonable_python(json_schema_extra))\n elif callable(json_schema_extra):\n json_schema_extra(json_schema)\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 frozen: bool | None\n metadata: 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/_internal/_generate_schema.py__common_field__common_field.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__common_field__common_field.return._", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2088, "end_line": 2104, "span_ids": ["_common_field"], "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 _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 frozen: 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 'frozen': frozen,\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_resolve_original_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_resolve_original_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": 2146, "end_line": 2172, "span_ids": ["resolve_original_schema", "_FieldNameStack.push", "_FieldNameStack", "_FieldNameStack.__init__", "_FieldNameStack.get"], "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 resolve_original_schema(schema: CoreSchema, definitions: dict[str, CoreSchema]) -> CoreSchema | None:\n if schema['type'] == 'definition-ref':\n return definitions.get(schema['schema_ref'], None)\n elif schema['type'] == 'definitions':\n return schema['schema']\n else:\n return schema\n\n\nclass _FieldNameStack:\n __slots__ = ('_stack',)\n\n def __init__(self) -> None:\n self._stack: list[str] = []\n\n @contextmanager\n def push(self, field_name: str) -> Iterator[None]:\n self._stack.append(field_name)\n yield\n self._stack.pop()\n\n def get(self) -> str | None:\n if self._stack:\n return self._stack[-1]\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generics.py_from___future___import_an__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_from___future___import_an__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": 1, "end_line": 107, "span_ids": ["imports", "impl:13"], "tokens": 851}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 PydanticRecursiveRef\nfrom ._typing_extra import TypeVarType, typing_base\nfrom ._utils import all_identical, is_model_class\n\nif sys.version_info >= (3, 10):\n from typing import _UnionGenericAlias # type: ignore[attr-defined]\n\nif TYPE_CHECKING:\n from ..main import BaseModel\n\nGenericTypesCacheKey = Tuple[Any, Any, Tuple[Any, ...]]\n\n# Note: We want to remove LimitedDict, but to do this, we'd 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]):\n def __init__(self, size_limit: int = _LIMITED_DICT_SIZE):\n ...\n\nelse:\n\n class LimitedDict(dict):\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 k in to_remove:\n del self[k]\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\n\nif TYPE_CHECKING:\n\n class DeepChainMap(ChainMap[KT, VT]): # type: ignore\n ...\n\nelse:\n\n class DeepChainMap(ChainMap):\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_PydanticGenericMetadata_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_PydanticGenericMetadata_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": 110, "end_line": 160, "span_ids": ["PydanticGenericMetadata", "create_generic_submodel"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticGenericMetadata(typing_extensions.TypedDict):\n origin: type[BaseModel] | None # analogous to typing._GenericAlias.__origin__\n args: tuple[Any, ...] # analogous to typing._GenericAlias.__args__\n parameters: tuple[type[Any], ...] # analogous to typing.Generic.__parameters__\n\n\ndef create_generic_submodel(\n model_name: str, origin: type[BaseModel], args: tuple[Any, ...], params: tuple[Any, ...]\n) -> type[BaseModel]:\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 Args:\n model_name: The name of the newly created model.\n origin: The base class for the new model to inherit from.\n args: A tuple of generic metadata arguments.\n params: A tuple of generic metadata parameters.\n\n Returns:\n The created submodel.\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_metadata__={\n 'origin': origin,\n 'args': args,\n 'parameters': params,\n },\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/_git.py__Git_utilities_adopted_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_git.py__Git_utilities_adopted_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_git.py", "file_name": "_git.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["have_git", "git_revision", "is_git_repo", "docstring"], "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": "\"\"\"Git utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).\"\"\"\nfrom __future__ import annotations\n\nimport os\nimport subprocess\n\n\ndef is_git_repo(dir: str) -> bool:\n \"\"\"Is the given directory version-controlled with git?\"\"\"\n return os.path.exists(os.path.join(dir, '.git'))\n\n\ndef have_git() -> bool:\n \"\"\"Can we run the git executable?\"\"\"\n try:\n subprocess.check_output(['git', '--help'])\n return True\n except subprocess.CalledProcessError:\n return False\n except OSError:\n return False\n\n\ndef git_revision(dir: str) -> str:\n \"\"\"Get the SHA-1 of the HEAD of a git repository.\"\"\"\n return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=dir).decode('utf-8').strip()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass._collect_bases_data_ModelMetaclass._collect_bases_data.return.field_names_class_vars_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass._collect_bases_data_ModelMetaclass._collect_bases_data.return.field_names_class_vars_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 242, "span_ids": ["ModelMetaclass._collect_bases_data"], "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": "@dataclass_transform(kw_only_default=True, field_specifiers=(PydanticModelField,))\nclass ModelMetaclass(ABCMeta):\n\n @staticmethod\n def _collect_bases_data(bases: tuple[type[Any], ...]) -> tuple[set[str], set[str], dict[str, ModelPrivateAttr]]:\n from ..main import BaseModel\n\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 issubclass(base, BaseModel) and base is not 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/_internal/_model_construction.py_ModelMetaclass.__fields___ModelMetaclass.__dir__.return.attributes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_ModelMetaclass.__fields___ModelMetaclass.__dir__.return.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": 249, "end_line": 261, "span_ids": ["ModelMetaclass.__fields__", "ModelMetaclass.__dir__"], "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": "@dataclass_transform(kw_only_default=True, field_specifiers=(PydanticModelField,))\nclass ModelMetaclass(ABCMeta):\n\n @property\n @deprecated('The `__fields__` attribute is deprecated, use `model_fields` instead.', category=None)\n def __fields__(self) -> dict[str, FieldInfo]:\n warnings.warn(\n 'The `__fields__` attribute is deprecated, use `model_fields` instead.', PydanticDeprecatedSince20\n )\n return self.model_fields # type: ignore\n\n def __dir__(self) -> list[str]:\n attributes = list(super().__dir__())\n if '__fields__' in attributes:\n attributes.remove('__fields__')\n return attributes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace.for_var_name_value_in_li_inspect_namespace.for_var_name_value_in_li.if_var_name_model_con.elif_var_name_not_in_raw_.if_var_name_in_base_class.else_.raise_PydanticUserError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_inspect_namespace.for_var_name_value_in_li_inspect_namespace.for_var_name_value_in_li.if_var_name_model_con.elif_var_name_not_in_raw_.if_var_name_in_base_class.else_.raise_PydanticUserError_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 331, "end_line": 390, "span_ids": ["inspect_namespace"], "tokens": 685}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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 # ... other code\n for var_name, value in list(namespace.items()):\n if var_name == 'model_config':\n continue\n elif (\n isinstance(value, type)\n and value.__module__ == namespace['__module__']\n and '__qualname__' in namespace\n and value.__qualname__.startswith(namespace['__qualname__'])\n ):\n # `value` is a nested type defined in this namespace; don't error\n continue\n elif isinstance(value, all_ignored_types) or value.__class__.__module__ == 'functools':\n ignored_names.add(var_name)\n continue\n elif isinstance(value, ModelPrivateAttr):\n if var_name.startswith('__'):\n raise NameError(\n 'Private attributes must not use dunder names;'\n f' use a single underscore prefix instead of {var_name!r}.'\n )\n elif is_valid_field_name(var_name):\n raise NameError(\n 'Private attributes must not use valid field names;'\n f' use sunder names, e.g. {\"_\" + var_name!r} instead of {var_name!r}.'\n )\n private_attributes[var_name] = value\n del namespace[var_name]\n elif isinstance(value, FieldInfo) and not is_valid_field_name(var_name):\n suggested_name = var_name.lstrip('_') or 'my_field' # don't suggest '' for all-underscore name\n raise NameError(\n f'Fields must not use names with leading underscores;'\n f' e.g., use {suggested_name!r} instead of {var_name!r}.'\n )\n\n elif var_name.startswith('__'):\n continue\n elif is_valid_privateattr_name(var_name):\n if var_name not in raw_annotations or 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 code='model-field-overridden',\n )\n elif isinstance(value, FieldInfo):\n raise PydanticUserError(\n f'Field {var_name!r} requires a type annotation', code='model-field-missing-annotation'\n )\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}` 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 code='model-field-missing-annotation',\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/_internal/_model_construction.py_inspect_namespace.for_ann_name_ann_type_in_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.for_ann_name_ann_type_in_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": 386, "end_line": 403, "span_ids": ["inspect_namespace"], "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 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 # ... other code\n\n for ann_name, ann_type in raw_annotations.items():\n if (\n is_valid_privateattr_name(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 and getattr(ann_type, '__module__', None) != 'functools'\n ):\n if is_annotated(ann_type):\n _, *metadata = typing_extensions.get_args(ann_type)\n private_attr = next((v for v in metadata if isinstance(v, ModelPrivateAttr)), None)\n if private_attr is not None:\n private_attributes[ann_name] = private_attr\n continue\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_set_default_hash_func_set_default_hash_func.if_base_hash_func_in_Non.cls.__hash__.new_hash_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_set_default_hash_func_set_default_hash_func.if_base_hash_func_in_Non.cls.__hash__.new_hash_func", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 406, "end_line": 416, "span_ids": ["set_default_hash_func"], "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 set_default_hash_func(cls: type[BaseModel], bases: tuple[type[Any], ...]) -> None:\n base_hash_func = get_attribute_from_bases(bases, '__hash__')\n new_hash_func = make_hash_func(cls)\n if base_hash_func in {None, object.__hash__} or getattr(base_hash_func, '__code__', None) == new_hash_func.__code__:\n # If `__hash__` is some default, we generate a hash function.\n # It will be `None` if not overridden from BaseModel.\n # It may be `object.__hash__` if there is another\n # parent class earlier in the bases which doesn't override `__hash__` (e.g. `typing.Generic`).\n # It may be a value set by `set_default_hash_func` if `cls` is a subclass of another frozen model.\n # In the last case we still need a new hash function to account for new `model_fields`.\n cls.__hash__ = new_hash_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/_model_construction.py_make_hash_func_make_hash_func.return.hash_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_make_hash_func_make_hash_func.return.hash_func", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 419, "end_line": 432, "span_ids": ["make_hash_func"], "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 make_hash_func(cls: type[BaseModel]) -> Any:\n getter = operator.itemgetter(*cls.model_fields.keys()) if cls.model_fields else lambda _: 0\n\n def hash_func(self: Any) -> int:\n try:\n return hash(getter(self.__dict__))\n except KeyError:\n # In rare cases (such as when using the deprecated copy method), the __dict__ may not contain\n # all model fields, which is how we can get here.\n # getter(self.__dict__) is much faster than any 'safe' method that accounts for missing keys,\n # and wrapping it in a `try` doesn't slow things down much in the common case.\n return hash(getter(SafeGetItemProxy(self.__dict__)))\n\n return hash_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/_model_construction.py__PydanticWeakRef__PydanticWeakRef.__reduce__.return._PydanticWeakRef_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__PydanticWeakRef__PydanticWeakRef.__reduce__.return._PydanticWeakRef_self_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 582, "span_ids": ["_PydanticWeakRef.__init__", "_PydanticWeakRef.__reduce__", "_PydanticWeakRef.__call__", "_PydanticWeakRef"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _PydanticWeakRef:\n \"\"\"Wrapper for `weakref.ref` that enables `pickle` serialization.\n\n Cloudpickle fails to serialize `weakref.ref` objects due to an arcane error related\n to abstract base classes (`abc.ABC`). This class works around the issue by wrapping\n `weakref.ref` instead of subclassing it.\n\n See https://github.com/pydantic/pydantic/issues/6763 for context.\n\n Semantics:\n - If not pickled, behaves the same as a `weakref.ref`.\n - If pickled along with the referenced object, the same `weakref.ref` behavior\n will be maintained between them after unpickling.\n - If pickled without the referenced object, after unpickling the underlying\n reference will be cleared (`__call__` will always return `None`).\n \"\"\"\n\n def __init__(self, obj: Any):\n if obj is None:\n # The object will be `None` upon deserialization if the serialized weakref\n # had lost its underlying object.\n self._wr = None\n else:\n self._wr = weakref.ref(obj)\n\n def __call__(self) -> Any:\n if self._wr is None:\n return None\n else:\n return self._wr()\n\n def __reduce__(self) -> tuple[Callable, tuple[weakref.ReferenceType | None]]:\n return _PydanticWeakRef, (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/_utils.py__SENTINEL_all_identical.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py__SENTINEL_all_identical.return.True", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 336, "span_ids": ["all_identical", "impl:18"], "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": "_SENTINEL = object()\n\n\ndef all_identical(left: typing.Iterable[Any], right: typing.Iterable[Any]) -> bool:\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=_SENTINEL):\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/_utils.py_SafeGetItemProxy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_utils.py_SafeGetItemProxy_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_utils.py", "file_name": "_utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 363, "span_ids": ["SafeGetItemProxy:6", "SafeGetItemProxy", "SafeGetItemProxy.__getitem__"], "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": "@dataclasses.dataclass(frozen=True)\nclass SafeGetItemProxy:\n \"\"\"Wrapper redirecting `__getitem__` to `get` with a sentinel value as default\n\n This makes is safe to use in `operator.itemgetter` when some keys may be missing\n \"\"\"\n\n # Define __slots__manually for performances\n # @dataclasses.dataclass() only support slots=True in python>=3.10\n __slots__ = ('wrapped',)\n\n wrapped: Mapping[str, Any]\n\n def __getitem__(self, key: str, /) -> Any:\n return self.wrapped.get(key, _SENTINEL)\n\n # required to pass the object to operator.itemgetter() instances due to a quirk of typeshed\n # https://github.com/python/mypy/issues/13713\n # https://github.com/python/typeshed/pull/8785\n # Since this is typing-only, hide it in a typing.TYPE_CHECKING block\n if typing.TYPE_CHECKING:\n\n def __contains__(self, key: str, /) -> bool:\n return self.wrapped.__contains__(key)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py__Support_for_alias_conf_AliasPath.convert_to_aliases.return.self_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py__Support_for_alias_conf_AliasPath.convert_to_aliases.return.self_path", "embedding": null, "metadata": {"file_path": "pydantic/aliases.py", "file_name": "aliases.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["AliasPath.__init__", "AliasPath.convert_to_aliases", "AliasPath", "docstring"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Support for alias configurations.\"\"\"\nfrom __future__ import annotations\n\nimport dataclasses\nfrom typing import Callable, Literal\n\nfrom ._internal import _internal_dataclass\n\n__all__ = ('AliasGenerator', 'AliasPath', 'AliasChoices')\n\n\n@dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass AliasPath:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/alias#aliaspath-and-aliaschoices\n\n A data class used by `validation_alias` as a convenience to create aliases.\n\n Attributes:\n path: A list of string or integer aliases.\n \"\"\"\n\n path: list[int | str]\n\n def __init__(self, first_arg: str, *args: str | int) -> None:\n self.path = [first_arg] + list(args)\n\n def convert_to_aliases(self) -> list[str | int]:\n \"\"\"Converts arguments to a list of string or integer aliases.\n\n Returns:\n The list of aliases.\n \"\"\"\n return self.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/aliases.py_AliasChoices_AliasChoices.convert_to_aliases.return.aliases": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasChoices_AliasChoices.convert_to_aliases.return.aliases", "embedding": null, "metadata": {"file_path": "pydantic/aliases.py", "file_name": "aliases.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 63, "span_ids": ["AliasChoices.convert_to_aliases", "AliasChoices", "AliasChoices.__init__"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass AliasChoices:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/alias#aliaspath-and-aliaschoices\n\n A data class used by `validation_alias` as a convenience to create aliases.\n\n Attributes:\n choices: A list containing a string or `AliasPath`.\n \"\"\"\n\n choices: list[str | AliasPath]\n\n def __init__(self, first_choice: str | AliasPath, *choices: str | AliasPath) -> None:\n self.choices = [first_choice] + list(choices)\n\n def convert_to_aliases(self) -> list[list[str | int]]:\n \"\"\"Converts arguments to a list of lists containing string or integer aliases.\n\n Returns:\n The list of aliases.\n \"\"\"\n aliases: list[list[str | int]] = []\n for c in self.choices:\n if isinstance(c, AliasPath):\n aliases.append(c.convert_to_aliases())\n else:\n aliases.append([c])\n return aliases", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator_AliasGenerator.serialization_alias.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator_AliasGenerator.serialization_alias.None", "embedding": null, "metadata": {"file_path": "pydantic/aliases.py", "file_name": "aliases.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 80, "span_ids": ["AliasGenerator"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass AliasGenerator:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/alias#using-an-aliasgenerator\n\n A data class used by `alias_generator` as a convenience to create various aliases.\n\n Attributes:\n alias: A callable that takes a field name and returns an alias for it.\n validation_alias: A callable that takes a field name and returns a validation alias for it.\n serialization_alias: A callable that takes a field name and returns a serialization alias for it.\n \"\"\"\n\n alias: Callable[[str], str] | None = None\n validation_alias: Callable[[str], str | AliasPath | AliasChoices] | None = None\n serialization_alias: Callable[[str], str] | 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/pydantic/aliases.py_AliasGenerator._generate_alias_AliasGenerator._generate_alias.return.alias": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator._generate_alias_AliasGenerator._generate_alias.return.alias", "embedding": null, "metadata": {"file_path": "pydantic/aliases.py", "file_name": "aliases.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 100, "span_ids": ["AliasGenerator._generate_alias"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass AliasGenerator:\n\n def _generate_alias(\n self,\n alias_kind: Literal['alias', 'validation_alias', 'serialization_alias'],\n allowed_types: tuple[type[str] | type[AliasPath] | type[AliasChoices], ...],\n field_name: str,\n ) -> str | AliasPath | AliasChoices | None:\n \"\"\"Generate an alias of the specified kind. Returns None if the alias generator is None.\n\n Raises:\n TypeError: If the alias generator produces an invalid type.\n \"\"\"\n alias = None\n if alias_generator := getattr(self, alias_kind):\n alias = alias_generator(field_name)\n if alias and not isinstance(alias, allowed_types):\n raise TypeError(\n f'Invalid `{alias_kind}` type. `{alias_kind}` generator must produce one of `{allowed_types}`'\n )\n return 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/aliases.py_AliasGenerator.generate_aliases_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/aliases.py_AliasGenerator.generate_aliases_", "embedding": null, "metadata": {"file_path": "pydantic/aliases.py", "file_name": "aliases.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 113, "span_ids": ["AliasGenerator.generate_aliases"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass AliasGenerator:\n\n def generate_aliases(self, field_name: str) -> tuple[str | None, str | AliasPath | AliasChoices | None, str | None]:\n \"\"\"Generate `alias`, `validation_alias`, and `serialization_alias` for a field.\n\n Returns:\n A tuple of three aliases - validation, alias, and serialization.\n \"\"\"\n alias = self._generate_alias('alias', (str,), field_name)\n validation_alias = self._generate_alias('validation_alias', (str, AliasChoices, AliasPath), field_name)\n serialization_alias = self._generate_alias('serialization_alias', (str,), field_name)\n\n return alias, validation_alias, serialization_alias # 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_ConfigDict.None_15_ConfigDict.json_encoders": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_15_ConfigDict.json_encoders", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 391, "span_ids": ["ConfigDict"], "tokens": 685}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigDict(TypedDict, total=False):\n \"\"\"\n A callable that takes a field name and returns an alias for it\n or an instance of [`AliasGenerator`][pydantic.aliases.AliasGenerator]. Defaults to `None`.\n\n When using a callable, the alias generator is used for both validation and serialization.\n If you want to use different alias generators for validation and serialization, you can use\n [`AliasGenerator`][pydantic.aliases.AliasGenerator] instead.\n\n If data source field names do not match your code style (e. g. CamelCase fields),\n you can automatically generate aliases using `alias_generator`. Here's an example with\n a basic callable:\n\n ```py\n from pydantic import BaseModel, ConfigDict\n from pydantic.alias_generators import to_pascal\n\n class Voice(BaseModel):\n model_config = ConfigDict(alias_generator=to_pascal)\n\n name: str\n language_code: str\n\n voice = Voice(Name='Filiz', LanguageCode='tr-TR')\n print(voice.language_code)\n #> tr-TR\n print(voice.model_dump(by_alias=True))\n #> {'Name': 'Filiz', 'LanguageCode': 'tr-TR'}\n ```\n\n If you want to use different alias generators for validation and serialization, you can use\n [`AliasGenerator`][pydantic.aliases.AliasGenerator].\n\n ```py\n from pydantic import AliasGenerator, BaseModel, ConfigDict\n from pydantic.alias_generators import to_camel, to_pascal\n\n class Athlete(BaseModel):\n first_name: str\n last_name: str\n sport: str\n\n model_config = ConfigDict(\n alias_generator=AliasGenerator(\n validation_alias=to_camel,\n serialization_alias=to_pascal,\n )\n )\n\n athlete = Athlete(firstName='John', lastName='Doe', sport='track')\n print(athlete.model_dump(by_alias=True))\n #> {'FirstName': 'John', 'LastName': 'Doe', 'Sport': 'track'}\n ```\n\n Note:\n Pydantic offers three built-in alias generators: [`to_pascal`][pydantic.alias_generators.to_pascal],\n [`to_camel`][pydantic.alias_generators.to_camel], and [`to_snake`][pydantic.alias_generators.to_snake].\n \"\"\"\n\n ignored_types: tuple[type, ...]\n \"\"\"A tuple of types that may occur as values of class attributes without annotations. This is\n typically used for custom descriptors (classes that behave like `property`). If an attribute is set on a\n class without an annotation and has a type that is not in this tuple (or otherwise recognized by\n _pydantic_), an error will be raised. Defaults to `()`.\n \"\"\"\n\n allow_inf_nan: bool\n \"\"\"Whether to allow infinity (`+inf` an `-inf`) and NaN values to float fields. Defaults to `True`.\"\"\"\n\n json_schema_extra: JsonDict | JsonSchemaExtraCallable | None\n \"\"\"A dict or callable to provide extra JSON schema properties. Defaults to `None`.\"\"\"\n\n json_encoders: dict[type[object], JsonEncoder] | 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/config.py_ConfigDict.None_19_ConfigDict.revalidate_instances": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_19_ConfigDict.revalidate_instances", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 392, "end_line": 429, "span_ids": ["ConfigDict"], "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 ConfigDict(TypedDict, total=False):\n \"\"\"\n A `dict` of custom JSON encoders for specific types. Defaults to `None`.\n\n !!! warning \"Deprecated\"\n This config option is a carryover from v1.\n We originally planned to remove it in v2 but didn't have a 1:1 replacement so we are keeping it for now.\n It is still deprecated and will likely be removed in the future.\n \"\"\"\n\n # new in V2\n strict: bool\n \"\"\"\n _(new in V2)_ If `True`, strict validation is applied to all fields on the model.\n\n By default, Pydantic attempts to coerce values to the correct type, when possible.\n\n There are situations in which you may want to disable this behavior, and instead raise an error if a value's type\n does not match the field's type annotation.\n\n To configure strict mode for all fields on a model, you can set `strict=True` on the model.\n\n ```py\n from pydantic import BaseModel, ConfigDict\n\n class Model(BaseModel):\n model_config = ConfigDict(strict=True)\n\n name: str\n age: int\n ```\n\n See [Strict Mode](../concepts/strict_mode.md) for more details.\n\n See the [Conversion Table](../concepts/conversion_table.md) for more details on how Pydantic converts data in both\n strict and lax modes.\n \"\"\"\n # whether instances of models and dataclasses (including subclass instances) should re-validate, default 'never'\n revalidate_instances: Literal['always', 'never', 'subclass-instances']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.ser_json_timedelta_ConfigDict.protected_namespaces": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.ser_json_timedelta_ConfigDict.protected_namespaces", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 556, "end_line": 590, "span_ids": ["ConfigDict"], "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 ConfigDict(TypedDict, total=False):\n\n ser_json_timedelta: Literal['iso8601', 'float']\n \"\"\"\n The format of JSON serialized timedeltas. Accepts the string values of `'iso8601'` and\n `'float'`. Defaults to `'iso8601'`.\n\n - `'iso8601'` will serialize timedeltas to ISO 8601 durations.\n - `'float'` will serialize timedeltas to the total number of seconds.\n \"\"\"\n\n ser_json_bytes: Literal['utf8', 'base64']\n \"\"\"\n The encoding of JSON serialized bytes. Accepts the string values of `'utf8'` and `'base64'`.\n Defaults to `'utf8'`.\n\n - `'utf8'` will serialize bytes to UTF-8 strings.\n - `'base64'` will serialize bytes to URL safe base64 strings.\n \"\"\"\n\n ser_json_inf_nan: Literal['null', 'constants']\n \"\"\"\n The encoding of JSON serialized infinity and NaN float values. Accepts the string values of `'null'` and `'constants'`.\n Defaults to `'null'`.\n\n - `'null'` will serialize infinity and NaN values as `null`.\n - `'constants'` will serialize infinity and NaN values as `Infinity` and `NaN`.\n \"\"\"\n\n # whether to validate default values during validation, default False\n validate_default: bool\n \"\"\"Whether to validate default values during validation. Defaults to `False`.\"\"\"\n\n validate_return: bool\n \"\"\"whether to validate the return value from call validators. Defaults to `False`.\"\"\"\n\n protected_namespaces: tuple[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/config.py_ConfigDict.None_30_ConfigDict.defer_build": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_30_ConfigDict.defer_build", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 591, "end_line": 710, "span_ids": ["ConfigDict"], "tokens": 707}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"\n A `tuple` of strings that prevent model to have field which conflict with them.\n Defaults to `('model_', )`).\n\n Pydantic prevents collisions between model attributes and `BaseModel`'s own methods by\n namespacing them with the prefix `model_`.\n\n ```py\n import warnings\n\n from pydantic import BaseModel\n\n warnings.filterwarnings('error') # Raise warnings as errors\n\n try:\n\n class Model(BaseModel):\n model_prefixed_field: str\n\n except UserWarning as e:\n print(e)\n '''\n Field \"model_prefixed_field\" has conflict with protected namespace \"model_\".\n\n You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.\n '''\n ```\n\n You can customize this behavior using the `protected_namespaces` setting:\n\n ```py\n import warnings\n\n from pydantic import BaseModel, ConfigDict\n\n warnings.filterwarnings('error') # Raise warnings as errors\n\n try:\n\n class Model(BaseModel):\n model_prefixed_field: str\n also_protect_field: str\n\n model_config = ConfigDict(\n protected_namespaces=('protect_me_', 'also_protect_')\n )\n\n except UserWarning as e:\n print(e)\n '''\n Field \"also_protect_field\" has conflict with protected namespace \"also_protect_\".\n\n You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ('protect_me_',)`.\n '''\n ```\n\n While Pydantic will only emit a warning when an item is in a protected namespace but does not actually have a collision,\n an error _is_ raised if there is an actual collision with an existing attribute:\n\n ```py\n from pydantic import BaseModel\n\n try:\n\n class Model(BaseModel):\n model_validate: str\n\n except NameError as e:\n print(e)\n '''\n Field \"model_validate\" conflicts with member > of protected namespace \"model_\".\n '''\n ```\n \"\"\"\n\n hide_input_in_errors: bool\n \"\"\"\n Whether to hide inputs when printing errors. Defaults to `False`.\n\n Pydantic shows the input value and type when it raises `ValidationError` during the validation.\n\n ```py\n from pydantic import BaseModel, ValidationError\n\n class Model(BaseModel):\n a: str\n\n try:\n Model(a=123)\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n a\n Input should be a valid string [type=string_type, input_value=123, input_type=int]\n '''\n ```\n\n You can hide the input value and type by setting the `hide_input_in_errors` config to `True`.\n\n ```py\n from pydantic import BaseModel, ConfigDict, ValidationError\n\n class Model(BaseModel):\n a: str\n model_config = ConfigDict(hide_input_in_errors=True)\n\n try:\n Model(a=123)\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n a\n Input should be a valid string [type=string_type]\n '''\n ```\n \"\"\"\n\n defer_build: 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_ConfigDict.None_32_ConfigDict.json_schema_mode_override": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_32_ConfigDict.json_schema_mode_override", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 711, "end_line": 774, "span_ids": ["ConfigDict"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConfigDict(TypedDict, total=False):\n \"\"\"\n Whether to defer model validator and serializer construction until the first model validation.\n\n This can be useful to avoid the overhead of building models which are only\n used nested within other models, or when you want to manually define type namespace via\n [`Model.model_rebuild(_types_namespace=...)`][pydantic.BaseModel.model_rebuild]. Defaults to False.\n \"\"\"\n\n plugin_settings: dict[str, object] | None\n \"\"\"A `dict` of settings for plugins. Defaults to `None`.\n\n See [Pydantic Plugins](../concepts/plugins.md) for details.\n \"\"\"\n\n schema_generator: type[_GenerateSchema] | None\n \"\"\"\n A custom core schema generator class to use when generating JSON schemas.\n Useful if you want to change the way types are validated across an entire model/schema. Defaults to `None`.\n\n The `GenerateSchema` interface is subject to change, currently only the `string_schema` method is public.\n\n See [#6737](https://github.com/pydantic/pydantic/pull/6737) for details.\n \"\"\"\n\n json_schema_serialization_defaults_required: bool\n \"\"\"\n Whether fields with default values should be marked as required in the serialization schema. Defaults to `False`.\n\n This ensures that the serialization schema will reflect the fact a field with a default will always be present\n when serializing the model, even though it is not required for validation.\n\n However, there are scenarios where this may be undesirable \u2014 in particular, if you want to share the schema\n between validation and serialization, and don't mind fields with defaults being marked as not required during\n serialization. See [#7209](https://github.com/pydantic/pydantic/issues/7209) for more details.\n\n ```py\n from pydantic import BaseModel, ConfigDict\n\n class Model(BaseModel):\n a: str = 'a'\n\n model_config = ConfigDict(json_schema_serialization_defaults_required=True)\n\n print(Model.model_json_schema(mode='validation'))\n '''\n {\n 'properties': {'a': {'default': 'a', 'title': 'A', 'type': 'string'}},\n 'title': 'Model',\n 'type': 'object',\n }\n '''\n print(Model.model_json_schema(mode='serialization'))\n '''\n {\n 'properties': {'a': {'default': 'a', 'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'title': 'Model',\n 'type': 'object',\n }\n '''\n ```\n \"\"\"\n\n json_schema_mode_override: Literal['validation', 'serialization', 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/config.py_ConfigDict.None_36_ConfigDict.regex_engine": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_36_ConfigDict.regex_engine", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 775, "end_line": 867, "span_ids": ["ConfigDict"], "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 ConfigDict(TypedDict, total=False):\n \"\"\"\n If not `None`, the specified mode will be used to generate the JSON schema regardless of what `mode` was passed to\n the function call. Defaults to `None`.\n\n This provides a way to force the JSON schema generation to reflect a specific mode, e.g., to always use the\n validation schema.\n\n It can be useful when using frameworks (such as FastAPI) that may generate different schemas for validation\n and serialization that must both be referenced from the same schema; when this happens, we automatically append\n `-Input` to the definition reference for the validation schema and `-Output` to the definition reference for the\n serialization schema. By specifying a `json_schema_mode_override` though, this prevents the conflict between\n the validation and serialization schemas (since both will use the specified schema), and so prevents the suffixes\n from being added to the definition references.\n\n ```py\n from pydantic import BaseModel, ConfigDict, Json\n\n class Model(BaseModel):\n a: Json[int] # requires a string to validate, but will dump an int\n\n print(Model.model_json_schema(mode='serialization'))\n '''\n {\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\n 'title': 'Model',\n 'type': 'object',\n }\n '''\n\n class ForceInputModel(Model):\n # the following ensures that even with mode='serialization', we\n # will get the schema that would be generated for validation.\n model_config = ConfigDict(json_schema_mode_override='validation')\n\n print(ForceInputModel.model_json_schema(mode='serialization'))\n '''\n {\n 'properties': {\n 'a': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'type': 'integer'},\n 'title': 'A',\n 'type': 'string',\n }\n },\n 'required': ['a'],\n 'title': 'ForceInputModel',\n 'type': 'object',\n }\n '''\n ```\n \"\"\"\n\n coerce_numbers_to_str: bool\n \"\"\"\n If `True`, enables automatic coercion of any `Number` type to `str` in \"lax\" (non-strict) mode. Defaults to `False`.\n\n Pydantic doesn't allow number types (`int`, `float`, `Decimal`) to be coerced as type `str` by default.\n\n ```py\n from decimal import Decimal\n\n from pydantic import BaseModel, ConfigDict, ValidationError\n\n class Model(BaseModel):\n value: str\n\n try:\n print(Model(value=42))\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n value\n Input should be a valid string [type=string_type, input_value=42, input_type=int]\n '''\n\n class Model(BaseModel):\n model_config = ConfigDict(coerce_numbers_to_str=True)\n\n value: str\n\n repr(Model(value=42).value)\n #> \"42\"\n repr(Model(value=42.13).value)\n #> \"42.13\"\n repr(Model(value=Decimal('42.13')).value)\n #> \"42.13\"\n ```\n \"\"\"\n\n regex_engine: Literal['rust-regex', 'python-re']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.from_field_FieldInfo.from_field.return.FieldInfo_default_default": {"__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.FieldInfo_default_default", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 237, "span_ids": ["FieldInfo.from_field"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def from_field(default: Any = PydanticUndefined, **kwargs: Unpack[_FromFieldInfoInputs]) -> FieldInfo:\n \"\"\"Create a new `FieldInfo` object with the `Field` function.\n\n Args:\n default: The default value for the field. Defaults to Undefined.\n **kwargs: Additional arguments dictionary.\n\n Raises:\n TypeError: If 'annotation' is passed as a keyword argument.\n\n Returns:\n A new FieldInfo object with the given parameters.\n\n Example:\n This is how you can create a field with default value like this:\n\n ```python\n import pydantic\n\n class MyModel(pydantic.BaseModel):\n foo: int = pydantic.Field(4)\n ```\n \"\"\"\n if 'annotation' in kwargs:\n raise TypeError('\"annotation\" is not permitted as a Field keyword argument')\n return FieldInfo(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.FieldInfo_annotation_anno": {"__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.FieldInfo_annotation_anno", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 321, "span_ids": ["FieldInfo.from_annotation"], "tokens": 472}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def from_annotation(annotation: type[Any]) -> FieldInfo:\n \"\"\"Creates a `FieldInfo` instance from a bare annotation.\n\n This function is used internally to create a `FieldInfo` from a bare annotation like this:\n\n ```python\n import pydantic\n\n class MyModel(pydantic.BaseModel):\n foo: int # <-- like this\n ```\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` is an instance of `FieldInfo`, e.g.:\n\n ```python\n import annotated_types\n from typing_extensions import Annotated\n\n import pydantic\n\n class MyModel(pydantic.BaseModel):\n foo: Annotated[int, annotated_types.Gt(42)]\n bar: Annotated[int, pydantic.Field(gt=42)]\n ```\n\n Args:\n annotation: An annotation object.\n\n Returns:\n An instance of the field metadata.\n \"\"\"\n final = False\n if _typing_extra.is_finalvar(annotation):\n final = True\n if annotation is not typing_extensions.Final:\n annotation = typing_extensions.get_args(annotation)[0]\n\n if _typing_extra.is_annotated(annotation):\n first_arg, *extra_args = typing_extensions.get_args(annotation)\n if _typing_extra.is_finalvar(first_arg):\n final = True\n field_info_annotations = [a for a in extra_args if isinstance(a, FieldInfo)]\n field_info = FieldInfo.merge_field_infos(*field_info_annotations, annotation=first_arg)\n if field_info:\n new_field_info = copy(field_info)\n new_field_info.annotation = first_arg\n new_field_info.frozen = final or field_info.frozen\n metadata: list[Any] = []\n for a in extra_args:\n if _typing_extra.is_deprecated_instance(a):\n new_field_info.deprecated = a.message\n elif not isinstance(a, FieldInfo):\n metadata.append(a)\n else:\n metadata.extend(a.metadata)\n new_field_info.metadata = metadata\n return new_field_info\n\n return FieldInfo(annotation=annotation, frozen=final or 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_annotated_attribute_FieldInfo.from_annotated_attribute.if_isinstance_default_Fi.else_.return.FieldInfo_annotation_anno": {"__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_Fi.else_.return.FieldInfo_annotation_anno", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 323, "end_line": 406, "span_ids": ["FieldInfo.from_annotated_attribute"], "tokens": 729}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def from_annotated_attribute(annotation: type[Any], default: Any) -> FieldInfo:\n \"\"\"Create `FieldInfo` from an annotation with a default value.\n\n This is used in cases like the following:\n\n ```python\n import annotated_types\n from typing_extensions import Annotated\n\n import pydantic\n\n class MyModel(pydantic.BaseModel):\n foo: int = 4 # <-- like this\n bar: Annotated[int, annotated_types.Gt(4)] = 4 # <-- or this\n spam: Annotated[int, pydantic.Field(gt=4)] = 4 # <-- or this\n ```\n\n Args:\n annotation: The type annotation of the field.\n default: The default value of the field.\n\n Returns:\n A field object with the passed values.\n \"\"\"\n if annotation is default:\n raise PydanticUserError(\n 'Error when building FieldInfo from annotated attribute. '\n \"Make sure you don't have any field name clashing with a type annotation \",\n code='unevaluable-type-annotation',\n )\n\n final = False\n if _typing_extra.is_finalvar(annotation):\n final = True\n if annotation is not typing_extensions.Final:\n annotation = typing_extensions.get_args(annotation)[0]\n\n if isinstance(default, FieldInfo):\n default.annotation, annotation_metadata = FieldInfo._extract_metadata(annotation)\n default.metadata += annotation_metadata\n default = default.merge_field_infos(\n *[x for x in annotation_metadata if isinstance(x, FieldInfo)], default, annotation=default.annotation\n )\n default.frozen = final or default.frozen\n return default\n elif isinstance(default, dataclasses.Field):\n init_var = False\n if annotation is dataclasses.InitVar:\n init_var = True\n annotation = Any\n elif isinstance(annotation, dataclasses.InitVar):\n init_var = True\n annotation = annotation.type\n pydantic_field = FieldInfo._from_dataclass_field(default)\n pydantic_field.annotation, annotation_metadata = FieldInfo._extract_metadata(annotation)\n pydantic_field.metadata += annotation_metadata\n pydantic_field = pydantic_field.merge_field_infos(\n *[x for x in annotation_metadata if isinstance(x, FieldInfo)],\n pydantic_field,\n annotation=pydantic_field.annotation,\n )\n pydantic_field.frozen = final or pydantic_field.frozen\n pydantic_field.init_var = init_var\n pydantic_field.init = getattr(default, 'init', None)\n pydantic_field.kw_only = getattr(default, 'kw_only', None)\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_infos = [a for a in extra_args if isinstance(a, FieldInfo)]\n field_info = FieldInfo.merge_field_infos(*field_infos, annotation=first_arg, default=default)\n metadata: list[Any] = []\n for a in extra_args:\n if _typing_extra.is_deprecated_instance(a):\n field_info.deprecated = a.message\n elif not isinstance(a, FieldInfo):\n metadata.append(a)\n else:\n metadata.extend(a.metadata)\n field_info.metadata = metadata\n return field_info\n\n return FieldInfo(annotation=annotation, default=default, frozen=final or 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__wrapped_property_is_private_PropertyT.typing_TypeVar_PropertyT": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__wrapped_property_is_private_PropertyT.typing_TypeVar_PropertyT", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 999, "end_line": 1013, "span_ids": ["_wrapped_property_is_private", "impl:20"], "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 _wrapped_property_is_private(property_: cached_property | property) -> bool: # type: ignore\n \"\"\"Returns true if provided property is private, False otherwise.\"\"\"\n wrapped_name: str = ''\n\n if isinstance(property_, property):\n wrapped_name = getattr(property_.fget, '__name__', '')\n elif isinstance(property_, cached_property): # type: ignore\n wrapped_name = getattr(property_.func, '__name__', '') # type: ignore\n\n return wrapped_name.startswith('_') and not wrapped_name.startswith('__')\n\n\n# this should really be `property[T], cached_property[T]` but property is not generic unlike cached_property\n# See https://github.com/python/typing/issues/985 and linked issues\nPropertyT = typing.TypeVar('PropertyT')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_computed_field_computed_field_4._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_computed_field_4._", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1016, "end_line": 1034, "span_ids": ["computed_field", "computed_field_4"], "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": "@typing.overload\ndef computed_field(\n *,\n alias: str | None = None,\n alias_priority: int | None = None,\n title: str | None = None,\n description: str | None = None,\n deprecated: Deprecated | str | bool | None = None,\n examples: list[Any] | None = None,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = None,\n repr: bool = True,\n return_type: Any = PydanticUndefined,\n) -> typing.Callable[[PropertyT], PropertyT]:\n ...\n\n\n@typing.overload\ndef computed_field(__func: PropertyT) -> PropertyT:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_computed_field_5_computed_field_5._Usage_docs_https_do": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_computed_field_5_computed_field_5._Usage_docs_https_do", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1037, "end_line": 1190, "span_ids": ["computed_field_5"], "tokens": 1292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def computed_field(\n func: PropertyT | None = None,\n /,\n *,\n alias: str | None = None,\n alias_priority: int | None = None,\n title: str | None = None,\n description: str | None = None,\n deprecated: Deprecated | str | bool | None = None,\n examples: list[Any] | None = None,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = None,\n repr: bool | None = None,\n return_type: Any = PydanticUndefined,\n) -> PropertyT | typing.Callable[[PropertyT], PropertyT]:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/fields#the-computed_field-decorator\n\n Decorator to include `property` and `cached_property` when serializing models or dataclasses.\n\n This is useful for fields that are computed from other fields, or for fields that are expensive to compute and should be cached.\n\n ```py\n from pydantic import BaseModel, computed_field\n\n class Rectangle(BaseModel):\n width: int\n length: int\n\n @computed_field\n @property\n def area(self) -> int:\n return self.width * self.length\n\n print(Rectangle(width=3, length=2).model_dump())\n #> {'width': 3, 'length': 2, 'area': 6}\n ```\n\n If applied to functions not yet decorated with `@property` or `@cached_property`, the function is\n automatically wrapped with `property`. Although this is more concise, you will lose IntelliSense in your IDE,\n and confuse static type checkers, thus explicit use of `@property` is recommended.\n\n !!! warning \"Mypy Warning\"\n Even with the `@property` or `@cached_property` applied to your function before `@computed_field`,\n mypy may throw a `Decorated property not supported` error.\n See [mypy issue #1362](https://github.com/python/mypy/issues/1362), for more information.\n To avoid this error message, add `# type: ignore[misc]` to the `@computed_field` line.\n\n [pyright](https://github.com/microsoft/pyright) supports `@computed_field` without error.\n\n ```py\n import random\n\n from pydantic import BaseModel, computed_field\n\n class Square(BaseModel):\n width: float\n\n @computed_field\n def area(self) -> float: # converted to a `property` by `computed_field`\n return round(self.width**2, 2)\n\n @area.setter\n def area(self, new_area: float) -> None:\n self.width = new_area**0.5\n\n @computed_field(alias='the magic number', repr=False)\n def random_number(self) -> int:\n return random.randint(0, 1_000)\n\n square = Square(width=1.3)\n\n # `random_number` does not appear in representation\n print(repr(square))\n #> Square(width=1.3, area=1.69)\n\n print(square.random_number)\n #> 3\n\n square.area = 4\n\n print(square.model_dump_json(by_alias=True))\n #> {\"width\":2.0,\"area\":4.0,\"the magic number\":3}\n ```\n\n !!! warning \"Overriding with `computed_field`\"\n You can't override a field from a parent class with a `computed_field` in the child class.\n `mypy` complains about this behavior if allowed, and `dataclasses` doesn't allow this pattern either.\n See the example below:\n\n ```py\n from pydantic import BaseModel, computed_field\n\n class Parent(BaseModel):\n a: str\n\n try:\n\n class Child(Parent):\n @computed_field\n @property\n def a(self) -> str:\n return 'new a'\n\n except ValueError as e:\n print(repr(e))\n #> ValueError(\"you can't override a field with a computed field\")\n ```\n\n Private properties decorated with `@computed_field` have `repr=False` by default.\n\n ```py\n from functools import cached_property\n\n from pydantic import BaseModel, computed_field\n\n class Model(BaseModel):\n foo: int\n\n @computed_field\n @cached_property\n def _private_cached_property(self) -> int:\n return -self.foo\n\n @computed_field\n @property\n def _private_property(self) -> int:\n return -self.foo\n\n m = Model(foo=1)\n print(repr(m))\n #> M(foo=1)\n ```\n\n Args:\n func: the function to wrap.\n alias: alias to use when serializing this computed field, only used when `by_alias=True`\n alias_priority: priority of the alias. This affects whether an alias generator is used\n title: Title to use when including this computed field in JSON Schema\n description: Description to use when including this computed field in JSON Schema, defaults to the function's\n docstring\n deprecated: A deprecation message (or an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport).\n to be emitted when accessing the field. Or a boolean. This will automatically be set if the property is decorated with the\n `deprecated` decorator.\n examples: Example values to use when including this computed field in JSON Schema\n json_schema_extra: A dict or callable to provide extra JSON schema properties.\n repr: whether to include this computed field in model repr.\n Default is `False` for private properties and `True` for public properties.\n return_type: optional return for serialization logic to expect when serializing to JSON, if included\n this must be correct, otherwise a `TypeError` is raised.\n If you don't include a return type Any is used, which does runtime introspection to handle arbitrary\n objects.\n\n Returns:\n A proxy wrapper for the property.\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/functional_validators.py_FreeModelBeforeValidatorWithoutInfo_FreeModelBeforeValidatorWithoutInfo.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_FreeModelBeforeValidatorWithoutInfo_FreeModelBeforeValidatorWithoutInfo.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 426, "end_line": 439, "span_ids": ["FreeModelBeforeValidatorWithoutInfo.__call__", "FreeModelBeforeValidatorWithoutInfo"], "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": "class FreeModelBeforeValidatorWithoutInfo(Protocol):\n \"\"\"A @model_validator decorated function signature.\n This is used when `mode='before'` and the function does not have info argument.\n \"\"\"\n\n def __call__( # noqa: D102\n self,\n # this can be a dict, a model instance\n # or anything else that gets passed to validate_python\n # thus validators _must_ handle all cases\n value: Any,\n /,\n ) -> Any:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_FreeModelBeforeValidator_FreeModelBeforeValidator.__call__._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_validators.py_FreeModelBeforeValidator_FreeModelBeforeValidator.__call__._", "embedding": null, "metadata": {"file_path": "pydantic/functional_validators.py", "file_name": "functional_validators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 459, "end_line": 471, "span_ids": ["FreeModelBeforeValidator", "FreeModelBeforeValidator.__call__"], "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": "class FreeModelBeforeValidator(Protocol):\n \"\"\"A `@model_validator` decorated function signature. This is used when `mode='before'`.\"\"\"\n\n def __call__( # noqa: D102\n self,\n # this can be a dict, a model instance\n # or anything else that gets passed to validate_python\n # thus validators _must_ handle all cases\n value: Any,\n info: _core_schema.ValidationInfo,\n /,\n ) -> Any:\n ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelClassVar_PydanticModelClassVar.serialize.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelClassVar_PydanticModelClassVar.serialize.return._", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 425, "span_ids": ["PydanticModelClassVar.serialize", "PydanticModelClassVar", "PydanticModelClassVar.__init__", "PydanticModelClassVar.deserialize"], "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 PydanticModelClassVar:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.\n\n ClassVars are ignored by subclasses.\n\n Attributes:\n name: the ClassVar name\n \"\"\"\n\n def __init__(self, name):\n self.name = name\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> PydanticModelClassVar:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.deserialize.\"\"\"\n data = data.copy()\n return cls(**data)\n\n def serialize(self) -> JsonDict:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.serialize.\"\"\"\n return {\n 'name': self.name,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_fields_and_class_vars_PydanticModelTransformer.collect_fields_and_class_vars.return.list_found_fields_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_fields_and_class_vars_PydanticModelTransformer.collect_fields_and_class_vars.return.list_found_fields_values_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 599, "end_line": 662, "span_ids": ["PydanticModelTransformer.collect_fields_and_class_vars"], "tokens": 773}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_and_class_vars(\n self, model_config: ModelConfigData, is_root_model: bool\n ) -> tuple[list[PydanticModelField] | None, list[PydanticModelClassVar] | None]:\n \"\"\"Collects the fields for the model, accounting for parent classes.\"\"\"\n cls = self._cls\n\n # First, collect fields and ClassVars belonging to any class in the MRO, ignoring duplicates.\n #\n # We iterate through the MRO in reverse because attrs defined in the parent must appear\n # earlier in the attributes list than attrs defined in the child. See:\n # https://docs.python.org/3/library/dataclasses.html#inheritance\n #\n # However, we also want fields defined in the subtype to override ones defined\n # in the parent. We can implement this via a dict without disrupting the attr order\n # because dicts preserve insertion order in Python 3.7+.\n found_fields: dict[str, PydanticModelField] = {}\n found_class_vars: dict[str, PydanticModelClassVar] = {}\n for info in reversed(cls.info.mro[1:-1]): # 0 is the current class, -2 is BaseModel, -1 is object\n # if BASEMODEL_METADATA_TAG_KEY in info.metadata and BASEMODEL_METADATA_KEY not in info.metadata:\n # # We haven't processed the base class yet. Need another pass.\n # return None, None\n if METADATA_KEY not in info.metadata:\n continue\n\n # Each class depends on the set of attributes in its dataclass ancestors.\n self._api.add_plugin_dependency(make_wildcard_trigger(info.fullname))\n\n for name, data in info.metadata[METADATA_KEY]['fields'].items():\n field = PydanticModelField.deserialize(info, data, self._api)\n # (The following comment comes directly from the dataclasses plugin)\n # TODO: We shouldn't be performing type operations during the main\n # semantic analysis pass, since some TypeInfo attributes might\n # still be in flux. This should be performed in a later phase.\n field.expand_typevar_from_subtype(cls.info, self._api)\n found_fields[name] = field\n\n sym_node = cls.info.names.get(name)\n if sym_node and sym_node.node and not isinstance(sym_node.node, Var):\n self._api.fail(\n 'BaseModel field may only be overridden by another field',\n sym_node.node,\n )\n # Collect ClassVars\n for name, data in info.metadata[METADATA_KEY]['class_vars'].items():\n found_class_vars[name] = PydanticModelClassVar.deserialize(data)\n\n # Second, collect fields and ClassVars belonging to the current class.\n current_field_names: set[str] = set()\n current_class_vars_names: set[str] = set()\n for stmt in self._get_assignment_statements_from_block(cls.defs):\n maybe_field = self.collect_field_or_class_var_from_stmt(stmt, model_config, found_class_vars)\n if isinstance(maybe_field, PydanticModelField):\n lhs = stmt.lvalues[0]\n if is_root_model and lhs.name != 'root':\n error_extra_fields_on_root_model(self._api, stmt)\n else:\n current_field_names.add(lhs.name)\n found_fields[lhs.name] = maybe_field\n elif isinstance(maybe_field, PydanticModelClassVar):\n lhs = stmt.lvalues[0]\n current_class_vars_names.add(lhs.name)\n found_class_vars[lhs.name] = maybe_field\n\n return list(found_fields.values()), list(found_class_vars.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/mypy.py_PydanticModelTransformer.collect_field_or_class_var_from_stmt_PydanticModelTransformer.collect_field_or_class_var_from_stmt.node_type.get_proper_type_node_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_or_class_var_from_stmt_PydanticModelTransformer.collect_field_or_class_var_from_stmt.node_type.get_proper_type_node_type", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 679, "end_line": 761, "span_ids": ["PydanticModelTransformer.collect_field_or_class_var_from_stmt"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_or_class_var_from_stmt( # noqa C901\n self, stmt: AssignmentStmt, model_config: ModelConfigData, class_vars: dict[str, PydanticModelClassVar]\n ) -> PydanticModelField | PydanticModelClassVar | None:\n \"\"\"Get pydantic model field from statement.\n\n Args:\n stmt: The statement.\n model_config: Configuration settings for the model.\n class_vars: ClassVars already known to be defined on the model.\n\n Returns:\n A pydantic model field if it could find the field in statement. Otherwise, `None`.\n \"\"\"\n cls = self._cls\n\n lhs = stmt.lvalues[0]\n if not isinstance(lhs, NameExpr) or not _fields.is_valid_field_name(lhs.name) 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')(f)\n # Eventually, we may want to attempt to respect model_config['ignored_types']\n return None\n\n if lhs.name in class_vars:\n # Class vars are not fields and are not required to be annotated\n return None\n\n # The assignment does not have an annotation, and it's not anything else we recognize\n error_untyped_fields(self._api, stmt)\n return None\n\n lhs = stmt.lvalues[0]\n if not isinstance(lhs, NameExpr):\n return None\n\n if not _fields.is_valid_field_name(lhs.name) or lhs.name == 'model_config':\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\n # The dataclasses plugin now asserts this cannot happen, but I'd rather not error if it does..\n return None\n\n if isinstance(node, TypeAlias):\n self._api.fail(\n 'Type aliases inside BaseModel definitions are not supported at runtime',\n node,\n )\n # Skip processing this node. This doesn't match the runtime behaviour,\n # but the only alternative would be to modify the SymbolTable,\n # and it's a little hairy to do that in a plugin.\n return None\n\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\n # The dataclasses plugin now asserts this cannot happen, but I'd rather not error if it does..\n return None\n\n # x: ClassVar[int] is not a field\n if node.is_classvar:\n return PydanticModelClassVar(lhs.name)\n\n # x: InitVar[int] is not supported in BaseModel\n node_type = get_proper_type(node.type)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelTransformer.collect_field_or_class_var_from_stmt.if_isinstance_node_type__PydanticModelTransformer.collect_field_or_class_var_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_or_class_var_from_stmt.if_isinstance_node_type__PydanticModelTransformer.collect_field_or_class_var_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": 762, "end_line": 802, "span_ids": ["PydanticModelTransformer.collect_field_or_class_var_from_stmt"], "tokens": 443}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelTransformer:\n\n def collect_field_or_class_var_from_stmt( # noqa C901\n self, stmt: AssignmentStmt, model_config: ModelConfigData, class_vars: dict[str, PydanticModelClassVar]\n ) -> PydanticModelField | PydanticModelClassVar | None:\n # ... other code\n if isinstance(node_type, Instance) and node_type.type.fullname == 'dataclasses.InitVar':\n self._api.fail(\n 'InitVar is not supported in BaseModel',\n node,\n )\n\n has_default = self.get_has_default(stmt)\n\n if sym.type is None and node.is_final and node.is_inferred:\n # This follows the logic from the dataclasses plugin. The following comment is taken verbatim:\n #\n # This is a special case, assignment like x: Final = 42 is classified\n # annotated above, but mypy strips the `Final` turning it into x = 42.\n # We do not support inferred types in dataclasses, so we can try inferring\n # type for simple literals, and otherwise require an explicit type\n # argument for Final[...].\n typ = self._api.analyze_simple_literal_type(stmt.rvalue, is_final=True)\n if typ:\n node.type = typ\n else:\n self._api.fail(\n 'Need type argument for Final[...] with non-literal default in BaseModel',\n stmt,\n )\n node.type = AnyType(TypeOfAny.from_error)\n\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(self._api, stmt)\n\n init_type = self._infer_dataclass_attr_init_type(sym, lhs.name, stmt)\n return PydanticModelField(\n name=lhs.name,\n has_dynamic_alias=has_dynamic_alias,\n has_default=has_default,\n alias=alias,\n line=stmt.line,\n column=stmt.column,\n type=init_type,\n info=cls.info,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__Type_adapter_specifica_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/type_adapter.py__Type_adapter_specifica_if_TYPE_CHECKING_.IncEx.Union_Set_int_Set_str_", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["docstring"], "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": "\"\"\"Type adapter specification.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport sys\nfrom dataclasses import is_dataclass\nfrom typing import TYPE_CHECKING, Any, Dict, Generic, Iterable, Set, TypeVar, Union, cast, final, overload\n\nfrom pydantic_core import CoreSchema, SchemaSerializer, SchemaValidator, Some\nfrom typing_extensions import Literal, get_args, is_typeddict\n\nfrom pydantic.errors import PydanticUserError\nfrom pydantic.main import BaseModel\n\nfrom ._internal import _config, _generate_schema, _typing_extra\nfrom .config import ConfigDict\nfrom .json_schema import (\n DEFAULT_REF_TEMPLATE,\n GenerateJsonSchema,\n JsonSchemaKeyT,\n JsonSchemaMode,\n JsonSchemaValue,\n)\nfrom .plugin._schema_validator import create_schema_validator\n\nT = TypeVar('T')\n\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/types.py__The_types_module_conta_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__The_types_module_conta_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 114, "span_ids": ["impl:3", "docstring"], "tokens": 597}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The types module contains custom types used by pydantic.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport base64\nimport dataclasses as _dataclasses\nimport re\nfrom datetime import date, datetime\nfrom decimal import Decimal\nfrom enum import Enum\nfrom pathlib import Path\nfrom types import ModuleType\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n ClassVar,\n Dict,\n FrozenSet,\n Generic,\n Hashable,\n Iterator,\n List,\n Set,\n TypeVar,\n Union,\n cast,\n get_args,\n get_origin,\n)\nfrom uuid import UUID\n\nimport annotated_types\nfrom annotated_types import BaseMetadata, MaxLen, MinLen\nfrom pydantic_core import CoreSchema, PydanticCustomError, core_schema\nfrom typing_extensions import Annotated, Literal, Protocol, TypeAlias, TypeAliasType, deprecated\n\nfrom ._internal import (\n _core_utils,\n _fields,\n _internal_dataclass,\n _typing_extra,\n _utils,\n _validators,\n)\nfrom ._migration import getattr_migration\nfrom .annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler\nfrom .errors import PydanticUserError\nfrom .json_schema import JsonSchemaValue\nfrom .warnings import PydanticDeprecatedSince20\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 'NewPath',\n 'Json',\n 'Secret',\n 'SecretStr',\n 'SecretBytes',\n 'StrictBool',\n 'StrictBytes',\n 'StrictInt',\n 'StrictFloat',\n 'PaymentCardNumber',\n 'ByteSize',\n 'PastDate',\n 'FutureDate',\n 'PastDatetime',\n 'FutureDatetime',\n 'condate',\n 'AwareDatetime',\n 'NaiveDatetime',\n 'AllowInfNan',\n 'EncoderProtocol',\n 'EncodedBytes',\n 'EncodedStr',\n 'Base64Encoder',\n 'Base64Bytes',\n 'Base64Str',\n 'Base64UrlBytes',\n 'Base64UrlStr',\n 'GetPydanticSchema',\n 'StringConstraints',\n 'Tag',\n 'Discriminator',\n 'JsonValue',\n 'OnErrorOmit',\n)\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/types.py_Discriminator_Discriminator._Type_to_use_in_custom": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Discriminator_Discriminator._Type_to_use_in_custom", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2718, "end_line": 2801, "span_ids": ["Discriminator"], "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": "@_dataclasses.dataclass(**_internal_dataclass.slots_true, frozen=True)\nclass Discriminator:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/unions/#discriminated-unions-with-callable-discriminator\n\n Provides a way to use a custom callable as the way to extract the value of a union discriminator.\n\n This allows you to get validation behavior like you'd get from `Field(discriminator=)`,\n but without needing to have a single shared field across all the union choices. This also makes it\n possible to handle unions of models and primitive types with discriminated-union-style validation errors.\n Finally, this allows you to use a custom callable as the way to identify which member of a union a value\n belongs to, while still seeing all the performance benefits of a discriminated union.\n\n Consider this example, which is much more performant with the use of `Discriminator` and thus a `TaggedUnion`\n than it would be as a normal `Union`.\n\n ```py\n from typing import Any, Union\n\n from typing_extensions import Annotated, Literal\n\n from pydantic import BaseModel, Discriminator, Tag\n\n class Pie(BaseModel):\n time_to_cook: int\n num_ingredients: int\n\n class ApplePie(Pie):\n fruit: Literal['apple'] = 'apple'\n\n class PumpkinPie(Pie):\n filling: Literal['pumpkin'] = 'pumpkin'\n\n def get_discriminator_value(v: Any) -> str:\n if isinstance(v, dict):\n return v.get('fruit', v.get('filling'))\n return getattr(v, 'fruit', getattr(v, 'filling', None))\n\n class ThanksgivingDinner(BaseModel):\n dessert: Annotated[\n Union[\n Annotated[ApplePie, Tag('apple')],\n Annotated[PumpkinPie, Tag('pumpkin')],\n ],\n Discriminator(get_discriminator_value),\n ]\n\n apple_variation = ThanksgivingDinner.model_validate(\n {'dessert': {'fruit': 'apple', 'time_to_cook': 60, 'num_ingredients': 8}}\n )\n print(repr(apple_variation))\n '''\n ThanksgivingDinner(dessert=ApplePie(time_to_cook=60, num_ingredients=8, fruit='apple'))\n '''\n\n pumpkin_variation = ThanksgivingDinner.model_validate(\n {\n 'dessert': {\n 'filling': 'pumpkin',\n 'time_to_cook': 40,\n 'num_ingredients': 6,\n }\n }\n )\n print(repr(pumpkin_variation))\n '''\n ThanksgivingDinner(dessert=PumpkinPie(time_to_cook=40, num_ingredients=6, filling='pumpkin'))\n '''\n ```\n\n See the [Discriminated Unions] concepts docs for more details on how to use `Discriminator`s.\n\n [Discriminated Unions]: ../concepts/unions.md#discriminated-unions\n \"\"\"\n\n discriminator: str | Callable[[Any], Hashable]\n \"\"\"The callable or field name for discriminating the type in a tagged union.\n\n A `Callable` discriminator must extract the value of the discriminator from the input.\n A `str` discriminator must be the name of a field to discriminate against.\n \"\"\"\n custom_error_type: str | None = None\n \"\"\"Type to use in [custom errors](../errors/errors.md#custom-errors) replacing the standard discriminated union\n validation 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/types.py_Discriminator.custom_error_message_Discriminator.__get_pydantic_core_schema__.if_isinstance_self_discri.else_.return.self__convert_schema_orig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Discriminator.custom_error_message_Discriminator.__get_pydantic_core_schema__.if_isinstance_self_discri.else_.return.self__convert_schema_orig", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2629, "end_line": 2645, "span_ids": ["Discriminator", "Discriminator.__get_pydantic_core_schema__"], "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": "@_dataclasses.dataclass(**_internal_dataclass.slots_true, frozen=True)\nclass Discriminator:\n custom_error_message: str | None = None\n \"\"\"Message to use in custom errors.\"\"\"\n custom_error_context: dict[str, int | str | float] | None = None\n \"\"\"Context to use in custom errors.\"\"\"\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n origin = _typing_extra.get_origin(source_type)\n if not origin or not _typing_extra.origin_is_union(origin):\n raise TypeError(f'{type(self).__name__} must be used with a Union type, not {source_type}')\n\n if isinstance(self.discriminator, str):\n from pydantic import Field\n\n return handler(Annotated[source_type, Field(discriminator=self.discriminator)])\n else:\n original_schema = handler(source_type)\n return self._convert_schema(original_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/types.py_Discriminator._convert_schema_Discriminator._convert_schema.return.core_schema_tagged_union_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Discriminator._convert_schema_Discriminator._convert_schema.return.core_schema_tagged_union_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2647, "end_line": 2696, "span_ids": ["Discriminator._convert_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": "@_dataclasses.dataclass(**_internal_dataclass.slots_true, frozen=True)\nclass Discriminator:\n\n def _convert_schema(self, original_schema: core_schema.CoreSchema) -> core_schema.TaggedUnionSchema:\n if original_schema['type'] != 'union':\n # This likely indicates that the schema was a single-item union that was simplified.\n # In this case, we do the same thing we do in\n # `pydantic._internal._discriminated_union._ApplyInferredDiscriminator._apply_to_root`, namely,\n # package the generated schema back into a single-item union.\n original_schema = core_schema.union_schema([original_schema])\n\n tagged_union_choices = {}\n for i, choice in enumerate(original_schema['choices']):\n tag = None\n if isinstance(choice, tuple):\n choice, tag = choice\n metadata = choice.get('metadata')\n if metadata is not None:\n metadata_tag = metadata.get(_core_utils.TAGGED_UNION_TAG_KEY)\n if metadata_tag is not None:\n tag = metadata_tag\n if tag is None:\n raise PydanticUserError(\n f'`Tag` not provided for choice {choice} used with `Discriminator`',\n code='callable-discriminator-no-tag',\n )\n tagged_union_choices[tag] = choice\n\n # Have to do these verbose checks to ensure falsy values ('' and {}) don't get ignored\n custom_error_type = self.custom_error_type\n if custom_error_type is None:\n custom_error_type = original_schema.get('custom_error_type')\n\n custom_error_message = self.custom_error_message\n if custom_error_message is None:\n custom_error_message = original_schema.get('custom_error_message')\n\n custom_error_context = self.custom_error_context\n if custom_error_context is None:\n custom_error_context = original_schema.get('custom_error_context')\n\n custom_error_type = original_schema.get('custom_error_type') if custom_error_type is None else custom_error_type\n return core_schema.tagged_union_schema(\n tagged_union_choices,\n self.discriminator,\n custom_error_type=custom_error_type,\n custom_error_message=custom_error_message,\n custom_error_context=custom_error_context,\n strict=original_schema.get('strict'),\n ref=original_schema.get('ref'),\n metadata=original_schema.get('metadata'),\n serialization=original_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/types.py__JSON_TYPES__get_type_name.return.getattr_type____name___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__JSON_TYPES__get_type_name.return.getattr_type____name___", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2754, "end_line": 2775, "span_ids": ["_get_type_name", "impl:89"], "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": "_JSON_TYPES = {int, float, str, bool, list, dict, type(None)}\n\n\ndef _get_type_name(x: Any) -> str:\n type_ = type(x)\n if type_ in _JSON_TYPES:\n return type_.__name__\n\n # Handle proper subclasses; note we don't need to handle None or bool here\n if isinstance(x, int):\n return 'int'\n if isinstance(x, float):\n return 'float'\n if isinstance(x, str):\n return 'str'\n if isinstance(x, list):\n return 'list'\n if isinstance(x, dict):\n return 'dict'\n\n # Fail by returning the type's actual name\n return getattr(type_, '__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/types.py__AllowAnyJson_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__AllowAnyJson_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2778, "end_line": 2878, "span_ids": ["_AllowAnyJson", "_OnErrorOmit", "_OnErrorOmit.__get_pydantic_core_schema__", "_AllowAnyJson.__get_pydantic_core_schema__", "impl:91", "impl:97"], "tokens": 796}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _AllowAnyJson:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n python_schema = handler(source_type)\n return core_schema.json_or_python_schema(json_schema=core_schema.any_schema(), python_schema=python_schema)\n\n\nif TYPE_CHECKING:\n # This seems to only be necessary for mypy\n JsonValue: TypeAlias = Union[\n List['JsonValue'],\n Dict[str, 'JsonValue'],\n str,\n bool,\n int,\n float,\n None,\n ]\n \"\"\"A `JsonValue` is used to represent a value that can be serialized to JSON.\n\n It may be one of:\n\n * `List['JsonValue']`\n * `Dict[str, 'JsonValue']`\n * `str`\n * `bool`\n * `int`\n * `float`\n * `None`\n\n The following example demonstrates how to use `JsonValue` to validate JSON data,\n and what kind of errors to expect when input data is not json serializable.\n\n ```py\n import json\n\n from pydantic import BaseModel, JsonValue, ValidationError\n\n class Model(BaseModel):\n j: JsonValue\n\n valid_json_data = {'j': {'a': {'b': {'c': 1, 'd': [2, None]}}}}\n invalid_json_data = {'j': {'a': {'b': ...}}}\n\n print(repr(Model.model_validate(valid_json_data)))\n #> Model(j={'a': {'b': {'c': 1, 'd': [2, None]}}})\n print(repr(Model.model_validate_json(json.dumps(valid_json_data))))\n #> Model(j={'a': {'b': {'c': 1, 'd': [2, None]}}})\n\n try:\n Model.model_validate(invalid_json_data)\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n j.dict.a.dict.b\n input was not a valid JSON value [type=invalid-json-value, input_value=Ellipsis, input_type=ellipsis]\n '''\n ```\n \"\"\"\n\nelse:\n JsonValue = TypeAliasType(\n 'JsonValue',\n Annotated[\n Union[\n Annotated[List['JsonValue'], Tag('list')],\n Annotated[Dict[str, 'JsonValue'], Tag('dict')],\n Annotated[str, Tag('str')],\n Annotated[bool, Tag('bool')],\n Annotated[int, Tag('int')],\n Annotated[float, Tag('float')],\n Annotated[None, Tag('NoneType')],\n ],\n Discriminator(\n _get_type_name,\n custom_error_type='invalid-json-value',\n custom_error_message='input was not a valid JSON value',\n ),\n _AllowAnyJson,\n ],\n )\n\n\nclass _OnErrorOmit:\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n # there is no actual default value here but we use with_default_schema since it already has the on_error\n # behavior implemented and it would be no more efficient to implement it on every other validator\n # or as a standalone validator\n return core_schema.with_default_schema(schema=handler(source_type), on_error='omit')\n\n\nOnErrorOmit = Annotated[T, _OnErrorOmit]\n\"\"\"\nWhen used as an item in a list, the key type in a dict, optional values of a TypedDict, etc.\nthis annotation omits the item from the iteration if there is any error validating it.\nThat is, instead of a [`ValidationError`][pydantic_core.ValidationError] being propagated up and the entire iterable being discarded\nany invalid items are discarded and the valid ones are returned.\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_from___future___import_an_PYDANTIC_VERSION.metadata_version_pydanti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_from___future___import_an_PYDANTIC_VERSION.metadata_version_pydanti", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["imports"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations\n\nimport dataclasses\nimport enum\nimport gc\nimport itertools\nimport operator\nimport sys\nimport textwrap\nimport timeit\nfrom importlib import metadata\nfrom typing import TYPE_CHECKING, Any, Callable, Generic, Iterable, Sized, TypeVar\n\n# Do not import additional dependencies at top-level\nif TYPE_CHECKING:\n import matplotlib.pyplot as plt\n import numpy as np\n from matplotlib import axes, figure\n\nimport pydantic\n\nPYTHON_VERSION = '.'.join(map(str, sys.version_info))\nPYDANTIC_VERSION = metadata.version('pydantic')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py__New_implementation_of_p_OldImplementationModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py__New_implementation_of_p_OldImplementationModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 45, "span_ids": ["OldImplementationModel", "imports", "OldImplementationModel.__eq__"], "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": "# New implementation of pydantic.BaseModel.__eq__ to test\n\n\nclass OldImplementationModel(pydantic.BaseModel, frozen=True):\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, pydantic.BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n return (\n self_type == other_type\n and self.__dict__ == other.__dict__\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n )\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_DictComprehensionEqModel_DictComprehensionEqModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_DictComprehensionEqModel_DictComprehensionEqModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 66, "span_ids": ["DictComprehensionEqModel", "DictComprehensionEqModel.__eq__"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DictComprehensionEqModel(pydantic.BaseModel, frozen=True):\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, pydantic.BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n field_names = type(self).model_fields.keys()\n\n return (\n self_type == other_type\n and ({k: self.__dict__[k] for k in field_names} == {k: other.__dict__[k] for k in field_names})\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n )\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModel_ItemGetterEqModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModel_ItemGetterEqModel.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 88, "span_ids": ["ItemGetterEqModel", "ItemGetterEqModel.__eq__"], "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 ItemGetterEqModel(pydantic.BaseModel, frozen=True):\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, pydantic.BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n model_fields = type(self).model_fields.keys()\n getter = operator.itemgetter(*model_fields) if model_fields else lambda _: None\n\n return (\n self_type == other_type\n and getter(self.__dict__) == getter(other.__dict__)\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n )\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModelFastPath_ItemGetterEqModelFastPath.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModelFastPath_ItemGetterEqModelFastPath.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 120, "span_ids": ["ItemGetterEqModelFastPath", "ItemGetterEqModelFastPath.__eq__"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ItemGetterEqModelFastPath(pydantic.BaseModel, frozen=True):\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, pydantic.BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n # Perform common checks first\n if not (\n self_type == other_type\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n ):\n return False\n\n # Fix GH-7444 by comparing only pydantic fields\n # We provide a fast-path for performance: __dict__ comparison is *much* faster\n # See tests/benchmarks/test_basemodel_eq_performances.py and GH-7825 for benchmarks\n if self.__dict__ == other.__dict__:\n # If the check above passes, then pydantic fields are equal, we can return early\n return True\n else:\n # Else, we need to perform a more detailed, costlier comparison\n model_fields = type(self).model_fields.keys()\n getter = operator.itemgetter(*model_fields) if model_fields else lambda _: None\n return getter(self.__dict__) == getter(other.__dict__)\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_K__SafeGetItemProxy.__contains__.return.self_wrapped___contains__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_K__SafeGetItemProxy.__contains__.return.self_wrapped___contains__", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 151, "span_ids": ["impl:10", "_SafeGetItemProxy.__getitem__", "_SafeGetItemProxy.__contains__", "_SentinelType", "_SafeGetItemProxy", "impl:6"], "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": "K = TypeVar('K')\nV = TypeVar('V')\n\n\n# We need a sentinel value for missing fields when comparing models\n# Models are equals if-and-only-if they miss the same fields, and since None is a legitimate value\n# we can't default to None\n# We use the single-value enum trick to allow correct typing when using a sentinel\nclass _SentinelType(enum.Enum):\n SENTINEL = enum.auto()\n\n\n_SENTINEL = _SentinelType.SENTINEL\n\n\n@dataclasses.dataclass\nclass _SafeGetItemProxy(Generic[K, V]):\n \"\"\"Wrapper redirecting `__getitem__` to `get` and a sentinel value\n\n This makes is safe to use in `operator.itemgetter` when some keys may be missing\n \"\"\"\n\n wrapped: dict[K, V]\n\n def __getitem__(self, key: K, /) -> V | _SentinelType:\n return self.wrapped.get(key, _SENTINEL)\n\n def __contains__(self, key: K, /) -> bool:\n return self.wrapped.__contains__(key)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_SafeItemGetterEqModelFastPath_SafeItemGetterEqModelFastPath.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_SafeItemGetterEqModelFastPath_SafeItemGetterEqModelFastPath.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 183, "span_ids": ["SafeItemGetterEqModelFastPath", "SafeItemGetterEqModelFastPath.__eq__"], "tokens": 382}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SafeItemGetterEqModelFastPath(pydantic.BaseModel, frozen=True):\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, pydantic.BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n # Perform common checks first\n if not (\n self_type == other_type\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n ):\n return False\n\n # Fix GH-7444 by comparing only pydantic fields\n # We provide a fast-path for performance: __dict__ comparison is *much* faster\n # See tests/benchmarks/test_basemodel_eq_performances.py and GH-7825 for benchmarks\n if self.__dict__ == other.__dict__:\n # If the check above passes, then pydantic fields are equal, we can return early\n return True\n else:\n # Else, we need to perform a more detailed, costlier comparison\n model_fields = type(self).model_fields.keys()\n getter = operator.itemgetter(*model_fields) if model_fields else lambda _: None\n return getter(_SafeGetItemProxy(self.__dict__)) == getter(_SafeGetItemProxy(other.__dict__))\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModelFastPathFallback_ItemGetterEqModelFastPathFallback.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_ItemGetterEqModelFastPathFallback_ItemGetterEqModelFastPathFallback.__eq__.if_isinstance_other_pyda.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 218, "span_ids": ["ItemGetterEqModelFastPathFallback.__eq__", "ItemGetterEqModelFastPathFallback"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ItemGetterEqModelFastPathFallback(pydantic.BaseModel, frozen=True):\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, pydantic.BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n # Perform common checks first\n if not (\n self_type == other_type\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n ):\n return False\n\n # Fix GH-7444 by comparing only pydantic fields\n # We provide a fast-path for performance: __dict__ comparison is *much* faster\n # See tests/benchmarks/test_basemodel_eq_performances.py and GH-7825 for benchmarks\n if self.__dict__ == other.__dict__:\n # If the check above passes, then pydantic fields are equal, we can return early\n return True\n else:\n # Else, we need to perform a more detailed, costlier comparison\n model_fields = type(self).model_fields.keys()\n getter = operator.itemgetter(*model_fields) if model_fields else lambda _: None\n try:\n return getter(self.__dict__) == getter(other.__dict__)\n except KeyError:\n return getter(_SafeGetItemProxy(self.__dict__)) == getter(_SafeGetItemProxy(other.__dict__))\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_IMPLEMENTATIONS_IMPLEMENTATIONS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_IMPLEMENTATIONS_IMPLEMENTATIONS._", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 221, "end_line": 229, "span_ids": ["impl:12"], "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": "IMPLEMENTATIONS = {\n # Commented out because it is too slow for benchmark to complete in reasonable time\n # \"dict comprehension\": DictComprehensionEqModel,\n 'itemgetter': ItemGetterEqModel,\n 'itemgetter+fastpath': ItemGetterEqModelFastPath,\n # Commented-out because it is too slow to run with run_benchmark_random_unequal\n #'itemgetter+safety+fastpath': SafeItemGetterEqModelFastPath,\n 'itemgetter+fastpath+safe-fallback': ItemGetterEqModelFastPathFallback,\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py__Benchmark_running_plo_plot_all_benchmark.return.fig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py__Benchmark_running_plo_plot_all_benchmark.return.fig", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 256, "span_ids": ["impl:12", "plot_all_benchmark"], "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": "# Benchmark running & plotting code\n\n\ndef plot_all_benchmark(\n bases: dict[str, type[pydantic.BaseModel]],\n sizes: list[int],\n) -> figure.Figure:\n import matplotlib.pyplot as plt\n\n n_rows, n_cols = len(BENCHMARKS), 2\n fig, axes = plt.subplots(n_rows, n_cols, figsize=(n_cols * 6, n_rows * 4))\n\n for row, (name, benchmark) in enumerate(BENCHMARKS.items()):\n for col, mimic_cached_property in enumerate([False, True]):\n plot_benchmark(\n f'{name}, {mimic_cached_property=}',\n benchmark,\n bases=bases,\n sizes=sizes,\n mimic_cached_property=mimic_cached_property,\n ax=axes[row, col],\n )\n for ax in axes.ravel():\n ax.legend()\n fig.suptitle(f'python {PYTHON_VERSION}, pydantic {PYDANTIC_VERSION}')\n return fig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_plot_benchmark_SizedIterable.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_plot_benchmark_SizedIterable.pass", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 297, "span_ids": ["SizedIterable", "plot_benchmark"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def plot_benchmark(\n title: str,\n benchmark: Callable,\n bases: dict[str, type[pydantic.BaseModel]],\n sizes: list[int],\n mimic_cached_property: bool,\n ax: axes.Axes | None = None,\n):\n import matplotlib.pyplot as plt\n import numpy as np\n\n ax = ax or plt.gca()\n arr_sizes = np.asarray(sizes)\n\n baseline = benchmark(\n title=f'{title}, baseline',\n base=OldImplementationModel,\n sizes=sizes,\n mimic_cached_property=mimic_cached_property,\n )\n ax.plot(sizes, baseline / baseline, label='baseline')\n for name, base in bases.items():\n times = benchmark(\n title=f'{title}, {name}',\n base=base,\n sizes=sizes,\n mimic_cached_property=mimic_cached_property,\n )\n mask_valid = ~np.isnan(times)\n ax.plot(arr_sizes[mask_valid], times[mask_valid] / baseline[mask_valid], label=name)\n\n ax.set_title(title)\n ax.set_xlabel('Number of pydantic fields')\n ax.set_ylabel('Average time relative to baseline')\n return ax\n\n\nclass SizedIterable(Sized, Iterable):\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/benchmarks/basemodel_eq_performance.py_run_benchmark_nodiff_run_benchmark_nodiff.return.run_benchmark_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_nodiff_run_benchmark_nodiff.return.run_benchmark_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 343, "span_ids": ["run_benchmark_nodiff"], "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 run_benchmark_nodiff(\n title: str,\n base: type[pydantic.BaseModel],\n sizes: SizedIterable,\n mimic_cached_property: bool,\n n_execution: int = 10_000,\n n_repeat: int = 5,\n) -> np.ndarray:\n setup = textwrap.dedent(\n \"\"\"\n import pydantic\n\n Model = pydantic.create_model(\n \"Model\",\n __base__=Base,\n **{f'x{i}': (int, i) for i in range(%(size)d)}\n )\n left = Model()\n right = Model()\n \"\"\"\n )\n if mimic_cached_property:\n # Mimic functools.cached_property editing __dict__\n # NOTE: we must edit both objects, otherwise the dict don't have the same size and\n # dict.__eq__ has a very fast path. This makes our timing comparison incorrect\n # However, the value must be different, otherwise *our* __dict__ == right.__dict__\n # fast-path prevents our correct code from running\n setup += textwrap.dedent(\n \"\"\"\n object.__setattr__(left, 'cache', None)\n object.__setattr__(right, 'cache', -1)\n \"\"\"\n )\n statement = 'left == right'\n namespace = {'Base': base}\n return run_benchmark(\n title,\n setup=setup,\n statement=statement,\n n_execution=n_execution,\n n_repeat=n_repeat,\n globals=namespace,\n params={'size': sizes},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_first_diff_run_benchmark_first_diff.return.run_benchmark_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_first_diff_run_benchmark_first_diff.return.run_benchmark_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 346, "end_line": 389, "span_ids": ["run_benchmark_first_diff"], "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 run_benchmark_first_diff(\n title: str,\n base: type[pydantic.BaseModel],\n sizes: SizedIterable,\n mimic_cached_property: bool,\n n_execution: int = 10_000,\n n_repeat: int = 5,\n) -> np.ndarray:\n setup = textwrap.dedent(\n \"\"\"\n import pydantic\n\n Model = pydantic.create_model(\n \"Model\",\n __base__=Base,\n **{f'x{i}': (int, i) for i in range(%(size)d)}\n )\n left = Model()\n right = Model(f0=-1) if %(size)d > 0 else Model()\n \"\"\"\n )\n if mimic_cached_property:\n # Mimic functools.cached_property editing __dict__\n # NOTE: we must edit both objects, otherwise the dict don't have the same size and\n # dict.__eq__ has a very fast path. This makes our timing comparison incorrect\n # However, the value must be different, otherwise *our* __dict__ == right.__dict__\n # fast-path prevents our correct code from running\n setup += textwrap.dedent(\n \"\"\"\n object.__setattr__(left, 'cache', None)\n object.__setattr__(right, 'cache', -1)\n \"\"\"\n )\n statement = 'left == right'\n namespace = {'Base': base}\n return run_benchmark(\n title,\n setup=setup,\n statement=statement,\n n_execution=n_execution,\n n_repeat=n_repeat,\n globals=namespace,\n params={'size': sizes},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_last_diff_run_benchmark_last_diff.return.run_benchmark_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_last_diff_run_benchmark_last_diff.return.run_benchmark_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 392, "end_line": 436, "span_ids": ["run_benchmark_last_diff"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_benchmark_last_diff(\n title: str,\n base: type[pydantic.BaseModel],\n sizes: SizedIterable,\n mimic_cached_property: bool,\n n_execution: int = 10_000,\n n_repeat: int = 5,\n) -> np.ndarray:\n setup = textwrap.dedent(\n \"\"\"\n import pydantic\n\n Model = pydantic.create_model(\n \"Model\",\n __base__=Base,\n # shift the range() so that there is a field named size\n **{f'x{i}': (int, i) for i in range(1, %(size)d + 1)}\n )\n left = Model()\n right = Model(f%(size)d=-1) if %(size)d > 0 else Model()\n \"\"\"\n )\n if mimic_cached_property:\n # Mimic functools.cached_property editing __dict__\n # NOTE: we must edit both objects, otherwise the dict don't have the same size and\n # dict.__eq__ has a very fast path. This makes our timing comparison incorrect\n # However, the value must be different, otherwise *our* __dict__ == right.__dict__\n # fast-path prevents our correct code from running\n setup += textwrap.dedent(\n \"\"\"\n object.__setattr__(left, 'cache', None)\n object.__setattr__(right, 'cache', -1)\n \"\"\"\n )\n statement = 'left == right'\n namespace = {'Base': base}\n return run_benchmark(\n title,\n setup=setup,\n statement=statement,\n n_execution=n_execution,\n n_repeat=n_repeat,\n globals=namespace,\n params={'size': sizes},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_random_unequal_run_benchmark_random_unequal.return.times": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_run_benchmark_random_unequal_run_benchmark_random_unequal.return.times", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 439, "end_line": 498, "span_ids": ["run_benchmark_random_unequal"], "tokens": 542}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_benchmark_random_unequal(\n title: str,\n base: type[pydantic.BaseModel],\n sizes: SizedIterable,\n mimic_cached_property: bool,\n n_samples: int = 100,\n n_execution: int = 1_000,\n n_repeat: int = 5,\n) -> np.ndarray:\n import numpy as np\n\n setup = textwrap.dedent(\n \"\"\"\n import pydantic\n\n Model = pydantic.create_model(\n \"Model\",\n __base__=Base,\n **{f'x{i}': (int, i) for i in range(%(size)d)}\n )\n left = Model()\n right = Model(f%(field)d=-1)\n \"\"\"\n )\n if mimic_cached_property:\n # Mimic functools.cached_property editing __dict__\n # NOTE: we must edit both objects, otherwise the dict don't have the same size and\n # dict.__eq__ has a very fast path. This makes our timing comparison incorrect\n # However, the value must be different, otherwise *our* __dict__ == right.__dict__\n # fast-path prevents our correct code from running\n setup += textwrap.dedent(\n \"\"\"\n object.__setattr__(left, 'cache', None)\n object.__setattr__(right, 'cache', -1)\n \"\"\"\n )\n statement = 'left == right'\n namespace = {'Base': base}\n arr_sizes = np.fromiter(sizes, dtype=int)\n mask_valid_sizes = arr_sizes > 0\n arr_valid_sizes = arr_sizes[mask_valid_sizes] # we can't support 0 when sampling the field\n rng = np.random.default_rng()\n arr_fields = rng.integers(arr_valid_sizes, size=(n_samples, *arr_valid_sizes.shape))\n # broadcast the sizes against their sample, so we can iterate on (size, field) tuple\n # as parameters of the timing test\n arr_size_broadcast, _ = np.meshgrid(arr_valid_sizes, arr_fields[:, 0])\n\n results = run_benchmark(\n title,\n setup=setup,\n statement=statement,\n n_execution=n_execution,\n n_repeat=n_repeat,\n globals=namespace,\n params={'size': arr_size_broadcast.ravel(), 'field': arr_fields.ravel()},\n )\n times = np.empty(arr_sizes.shape, dtype=float)\n times[~mask_valid_sizes] = np.nan\n times[mask_valid_sizes] = results.reshape((n_samples, *arr_valid_sizes.shape)).mean(axis=0)\n return times", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_BENCHMARKS_run_benchmark.return.np_asarray_times_dtype_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_BENCHMARKS_run_benchmark.return.np_asarray_times_dtype_f", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 501, "end_line": 549, "span_ids": ["impl:14", "run_benchmark"], "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": "BENCHMARKS = {\n 'All field equals': run_benchmark_nodiff,\n 'First field unequal': run_benchmark_first_diff,\n 'Last field unequal': run_benchmark_last_diff,\n 'Random unequal field': run_benchmark_random_unequal,\n}\n\n\ndef run_benchmark(\n title: str,\n setup: str,\n statement: str,\n n_execution: int = 10_000,\n n_repeat: int = 5,\n globals: dict[str, Any] | None = None,\n progress_bar: bool = True,\n params: dict[str, SizedIterable] | None = None,\n) -> np.ndarray:\n import numpy as np\n import tqdm.auto as tqdm\n\n namespace = globals or {}\n # fast-path\n if not params:\n length = 1\n packed_params = [()]\n else:\n length = len(next(iter(params.values())))\n # This iterator yields a tuple of (key, value) pairs\n # First, make a list of N iterator over (key, value), where the provided values are iterated\n param_pairs = [zip(itertools.repeat(name), value) for name, value in params.items()]\n # Then pack our individual parameter iterator into one\n packed_params = zip(*param_pairs)\n\n times = [\n # Take the min of the repeats as recommended by timeit doc\n min(\n timeit.Timer(\n setup=setup % dict(local_params),\n stmt=statement,\n globals=namespace,\n ).repeat(repeat=n_repeat, number=n_execution)\n )\n / n_execution\n for local_params in tqdm.tqdm(packed_params, desc=title, total=length, disable=not progress_bar)\n ]\n gc.collect()\n\n return np.asarray(times, dtype=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/benchmarks/basemodel_eq_performance.py_if___name_____main____": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/basemodel_eq_performance.py_if___name_____main____", "embedding": null, "metadata": {"file_path": "tests/benchmarks/basemodel_eq_performance.py", "file_name": "basemodel_eq_performance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 552, "end_line": 615, "span_ids": ["impl:16"], "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": "if __name__ == '__main__':\n # run with `pdm run tests/benchmarks/test_basemodel_eq_performance.py`\n import argparse\n import pathlib\n\n try:\n import matplotlib # noqa: F401\n import numpy # noqa: F401\n import tqdm # noqa: F401\n except ImportError as err:\n raise ImportError(\n 'This benchmark additionally depends on numpy, matplotlib and tqdm. '\n 'Install those in your environment to run the benchmark.'\n ) from err\n\n parser = argparse.ArgumentParser(\n description='Test the performance of various BaseModel.__eq__ implementations fixing GH-7444.'\n )\n parser.add_argument(\n '-o',\n '--output-path',\n default=None,\n type=pathlib.Path,\n help=(\n 'Output directory or file in which to save the benchmark results. '\n 'If a directory is passed, a default filename is used.'\n ),\n )\n parser.add_argument(\n '--min-n-fields',\n type=int,\n default=0,\n help=('Test the performance of BaseModel.__eq__ on models with at least this number of fields. Defaults to 0.'),\n )\n parser.add_argument(\n '--max-n-fields',\n type=int,\n default=100,\n help=('Test the performance of BaseModel.__eq__ on models with up to this number of fields. Defaults to 100.'),\n )\n\n args = parser.parse_args()\n\n import matplotlib.pyplot as plt\n\n sizes = list(range(args.min_n_fields, args.max_n_fields))\n fig = plot_all_benchmark(IMPLEMENTATIONS, sizes=sizes)\n plt.tight_layout()\n\n if args.output_path is None:\n plt.show()\n else:\n if args.output_path.suffix:\n filepath = args.output_path\n else:\n filepath = args.output_path / f\"eq-benchmark_python-{PYTHON_VERSION.replace('.', '-')}.png\"\n fig.savefig(\n filepath,\n dpi=200,\n facecolor='white',\n transparent=False,\n )\n print(f'wrote {filepath!s}', file=sys.stderr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_north_star.py__NORTH_STAR_DATA_PATH_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_north_star.py__NORTH_STAR_DATA_PATH_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_north_star.py", "file_name": "test_north_star.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 125, "span_ids": ["test_north_star_validate_json_strict", "test_north_star_validate_python_strict", "test_north_star_json_dumps", "impl", "north_star_data_bytes", "test_north_star_dump_python", "test_north_star_validate_python", "test_north_star_dump_json", "_north_star_data_bytes", "test_north_star_validate_json", "test_north_star_json_loads"], "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": "_NORTH_STAR_DATA_PATH = Path(__file__).parent / 'north_star_data.json'\n\n\n@pytest.fixture(scope='module')\ndef north_star_data_bytes():\n return _north_star_data_bytes()\n\n\ndef _north_star_data_bytes() -> bytes:\n from .generate_north_star_data import person_data\n\n needs_generating = not _NORTH_STAR_DATA_PATH.exists()\n if needs_generating:\n data = json.dumps(person_data(length=1000)).encode()\n _NORTH_STAR_DATA_PATH.write_bytes(data)\n else:\n data = _NORTH_STAR_DATA_PATH.read_bytes()\n\n return data\n\n\ndef test_north_star_validate_json(pydantic_type_adapter, north_star_data_bytes, benchmark):\n benchmark(pydantic_type_adapter.validate_json, north_star_data_bytes)\n\n\ndef test_north_star_validate_json_strict(pydantic_type_adapter, north_star_data_bytes, benchmark):\n coerced_north_star_data = pydantic_type_adapter.dump_json(\n pydantic_type_adapter.validate_json(north_star_data_bytes)\n )\n benchmark(pydantic_type_adapter.validate_json, coerced_north_star_data, strict=True)\n\n\ndef test_north_star_dump_json(pydantic_type_adapter, north_star_data_bytes, benchmark):\n parsed = pydantic_type_adapter.validate_json(north_star_data_bytes)\n benchmark(pydantic_type_adapter.dump_json, parsed)\n\n\ndef test_north_star_validate_python(pydantic_type_adapter, north_star_data_bytes, benchmark):\n benchmark(pydantic_type_adapter.validate_python, json.loads(north_star_data_bytes))\n\n\ndef test_north_star_validate_python_strict(pydantic_type_adapter, north_star_data_bytes, benchmark):\n coerced_north_star_data = pydantic_type_adapter.dump_python(\n pydantic_type_adapter.validate_json(north_star_data_bytes)\n )\n benchmark(pydantic_type_adapter.validate_python, coerced_north_star_data, strict=True)\n\n\ndef test_north_star_dump_python(pydantic_type_adapter, north_star_data_bytes, benchmark):\n parsed = pydantic_type_adapter.validate_python(json.loads(north_star_data_bytes))\n benchmark(pydantic_type_adapter.dump_python, parsed)\n\n\ndef test_north_star_json_loads(north_star_data_bytes, benchmark):\n benchmark(json.loads, north_star_data_bytes)\n\n\ndef test_north_star_json_dumps(north_star_data_bytes, benchmark):\n parsed = json.loads(north_star_data_bytes)\n benchmark(json.dumps, parsed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_create_module.return.run": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_create_module_create_module.return.run", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 85, "span_ids": ["create_module"], "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": "@pytest.fixture\ndef create_module(tmp_path, request):\n def run(source_code_or_function, rewrite_assertions=True, module_name_prefix=None):\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 :param module_name_prefix: string prefix to use in the name of the module, does not affect the name of the file.\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 if module_name_prefix:\n module_name = module_name_prefix + module_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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_subprocess_run_code_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/conftest.py_subprocess_run_code_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 117, "span_ids": ["Err.__repr__", "subprocess_run_code", "Err", "Err.message_escaped"], "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": "@pytest.fixture\ndef subprocess_run_code(tmp_path: Path):\n def run_code(source_code_or_function) -> str:\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 py_file = tmp_path / 'test.py'\n py_file.write_text(source_code)\n\n return subprocess.check_output([sys.executable, str(py_file)], cwd=tmp_path, encoding='utf8')\n\n return run_code\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/plugin_success.py_from_dataclasses_import_I_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_dataclasses_import_I_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": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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)\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 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/outputs/1.0.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 165, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "FrozenModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "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": 822}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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)\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 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# MYPY: error: Unexpected keyword argument \"name\" for \"AddProject\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"slug\" for \"AddProject\" [call-arg]\n# MYPY: error: Unexpected keyword argument \"description\" for \"AddProject\" [call-arg]\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 164, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "FrozenModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "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": 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": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py_NotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py_NotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 309, "span_ids": ["impl:54", "impl:61", "impl:44", "foo", "NotFrozenModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "KwargsFrozenModel", "impl:47", "Response", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 738}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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\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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/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": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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)\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 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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py_from_dataclasses_import_I_FrozenModel.model_config.ConfigDict_frozen_True_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 164, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "FrozenModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "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": 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": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py_NotFrozenModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py_NotFrozenModel_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 309, "span_ids": ["impl:54", "impl:61", "impl:44", "foo", "NotFrozenModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "KwargsFrozenModel", "impl:47", "Response", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 738}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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\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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_success.py_from_dataclasses_import_I_KwargsFrozenModel.x", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/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": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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)\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 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/outputs/1.1.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I__.NestedModel_Model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I__.NestedModel_Model", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 155, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "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": 812}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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# MYPY: error: Cannot inherit frozen dataclass from a non-frozen one [misc]\n x: int\n\n\nclass KwargsMutationModel(KwargsNoMutationModel, frozen=False, from_attributes=True):\n# MYPY: error: Cannot inherit non-frozen dataclass from a frozen one [misc]\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\n# MYPY: error: Property \"x\" defined in \"KwargsNoMutationModel\" is read-only [misc]\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_DynamicModel.create_model_DynamicMode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_DynamicModel.create_model_DynamicMode", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 157, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "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": 806}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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# MYPY: error: Cannot inherit non-frozen dataclass from a frozen one [misc]\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\n# MYPY: error: Property \"x\" defined in \"KwargsNoMutationModel\" is read-only [misc]\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.2.0/mypy-default_ini/plugin_success.py_dynamic_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success.py_dynamic_model_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 312, "span_ids": ["impl:54", "impl:61", "impl:44", "foo", "NotFrozenModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "InnerModel", "FrozenModel", "KwargsFrozenModel", "impl:47", "Response", "impl:36", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OuterModel", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "tokens": 794}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "dynamic_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\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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_validator\n\n\ndef foo() -> None:\n class MyModel(BaseModel):\n number: int\n custom_validator = get_my_custom_validator('number') # type: ignore[pydantic-field]\n# MYPY: error: Unused \"type: ignore\" comment\n\n @model_validator(mode='before')\n @classmethod\n def validate_before(cls, values: Any) -> Any:\n return values\n\n @model_validator(mode='after')\n def validate_after(self) -> Self:\n return self\n\n MyModel(number=2)\n\n\nclass InnerModel(BaseModel):\n my_var: Union[str, None] = Field(default=None)\n\n\nclass OuterModel(InnerModel):\n pass\n\n\nm = OuterModel()\nif m.my_var is None:\n # In https://github.com/pydantic/pydantic/issues/7399, this was unreachable\n print('not unreachable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_DynamicModel.create_model_DynamicMode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_from_dataclasses_import_I_DynamicModel.create_model_DynamicMode", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 157, "span_ids": ["impl:22", "impl:30", "KwargsModel", "impl", "impl:29", "MutationModel", "AddProject", "Model", "MultiInheritanceModel", "InheritingModel", "SelfReferencingModel.prop", "impl:33", "impl:17", "AliasModel", "KwargsMutationModel", "NestedModel", "TypeAliasAsAttribute", "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": 806}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dataclasses import InitVar\nfrom typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union\n\nfrom typing_extensions import Self\n\nfrom pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator\nfrom pydantic.dataclasses import dataclass\n\n\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel.x = 2\nmodel.model_validate(model)\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\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\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# MYPY: error: Cannot inherit non-frozen dataclass from a frozen one [misc]\n a: int = 1\n\n\nKwargsMutationModel(x=1).x = 2\n# MYPY: error: Property \"x\" defined in \"KwargsNoMutationModel\" is read-only [misc]\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.4.1/mypy-default_ini/plugin_success.py_dynamic_model_get_my_custom_validator.return.my_custom_validator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py_dynamic_model_get_my_custom_validator.return.my_custom_validator", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-default_ini/plugin_success.py", "file_name": "plugin_success.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 279, "span_ids": ["impl:54", "impl:44", "NotFrozenModel", "f", "_default_factory_str", "ModelWithAnnotatedValidator", "FrozenModel", "KwargsFrozenModel", "impl:47", "Response", "impl:36", "ModelWithSelfField", "get_my_custom_validator", "ModelWithAllowReuseValidator", "OrmMixin.from_orm_optional", "KwargsNotFrozenModel", "impl:60", "OrmMixin.from_orm", "MyDataClass", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:50", "impl:56", "_default_factory_list", "OrmMixin"], "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": "dynamic_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\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')(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\n@dataclass\nclass MyDataClass:\n foo: InitVar[str]\n bar: str\n\n\nMyDataClass(foo='foo', bar='bar')\n\n\ndef get_my_custom_validator(field_name: str) -> Any:\n @validator(field_name, allow_reuse=True)\n def my_custom_validator(cls: Any, v: int) -> int:\n return v\n\n return my_custom_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_aliases.py_test_alias_generator_parent_upper_alias_generator._": {"__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_upper_alias_generator._", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 182, "end_line": 204, "span_ids": ["impl", "test_alias_generator_parent"], "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_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\nupper_alias_generator = [\n pytest.param(\n lambda x: x.upper(),\n id='basic_callable',\n ),\n pytest.param(\n AliasGenerator(lambda x: x.upper()),\n id='alias_generator',\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_on_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_on_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": 207, "end_line": 222, "span_ids": ["test_alias_generator_on_parent"], "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('alias_generator', upper_alias_generator)\ndef test_alias_generator_on_parent(alias_generator):\n class Parent(BaseModel):\n model_config = ConfigDict(alias_generator=alias_generator)\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_alias_generator_on_child.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_alias_generator_on_child.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": 225, "end_line": 238, "span_ids": ["test_alias_generator_on_child"], "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": "@pytest.mark.parametrize('alias_generator', upper_alias_generator)\ndef test_alias_generator_on_child(alias_generator):\n class Parent(BaseModel):\n x: bool = Field(..., alias='abc')\n y: str\n\n class Child(Parent):\n model_config = ConfigDict(alias_generator=alias_generator)\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']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_used_by_default_test_alias_generator_used_by_default.Model.g.Field_alias_g_alias": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_used_by_default_test_alias_generator_used_by_default.Model.g.Field_alias_g_alias", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 241, "end_line": 252, "span_ids": ["test_alias_generator_used_by_default"], "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": "@pytest.mark.parametrize('alias_generator', upper_alias_generator)\ndef test_alias_generator_used_by_default(alias_generator):\n class Model(BaseModel):\n model_config = ConfigDict(alias_generator=alias_generator)\n\n a: str\n b: str = Field(..., alias='b_alias')\n c: str = Field(..., validation_alias='c_val_alias')\n d: str = Field(..., serialization_alias='d_ser_alias')\n e: str = Field(..., alias='e_alias', validation_alias='e_val_alias')\n f: str = Field(..., alias='f_alias', serialization_alias='f_ser_alias')\n g: str = Field(..., alias='g_alias', validation_alias='g_val_alias', serialization_alias='g_ser_alias')\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_aliases.py_test_validation_alias_parse_data_test_validation_alias_parse_data.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_validation_alias_parse_data_test_validation_alias_parse_data.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": 596, "end_line": 613, "span_ids": ["test_validation_alias_parse_data"], "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_validation_alias_parse_data():\n class Model(BaseModel):\n x: str = Field(validation_alias=AliasChoices('a', AliasPath('b', 1), 'c'))\n\n assert Model.model_fields['x'].validation_alias == AliasChoices('a', AliasPath('b', 1), 'c')\n assert Model.model_validate({'a': 'hello'}).x == 'hello'\n assert Model.model_validate({'b': ['hello', 'world']}).x == 'world'\n assert Model.model_validate({'c': 'test'}).x == 'test'\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'b': ['hello']})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'missing',\n 'loc': ('a',),\n 'msg': 'Field required',\n 'input': {'b': ['hello']},\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_28_test_alias_generator_with_positional_arg.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_28_test_alias_generator_with_positional_arg.None_2", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 616, "end_line": 651, "span_ids": ["test_alias_generator_with_positional_arg", "test_alias_generator_28", "test_alias_generator_with_alias"], "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": "def test_alias_generator() -> None:\n class Model(BaseModel):\n a: str\n\n model_config = ConfigDict(\n alias_generator=AliasGenerator(\n validation_alias=lambda field_name: f'validation_{field_name}',\n serialization_alias=lambda field_name: f'serialization_{field_name}',\n )\n )\n\n assert Model.model_fields['a'].validation_alias == 'validation_a'\n assert Model.model_fields['a'].serialization_alias == 'serialization_a'\n assert Model.model_fields['a'].alias is None\n\n\ndef test_alias_generator_with_alias() -> None:\n class Model(BaseModel):\n a: str\n\n model_config = ConfigDict(alias_generator=AliasGenerator(alias=lambda field_name: f'{field_name}_alias'))\n\n assert Model.model_fields['a'].validation_alias == 'a_alias'\n assert Model.model_fields['a'].serialization_alias == 'a_alias'\n assert Model.model_fields['a'].alias == 'a_alias'\n\n\ndef test_alias_generator_with_positional_arg() -> None:\n class Model(BaseModel):\n a: str\n\n model_config = ConfigDict(alias_generator=AliasGenerator(lambda field_name: f'{field_name}_alias'))\n\n assert Model.model_fields['a'].validation_alias == 'a_alias'\n assert Model.model_fields['a'].serialization_alias == 'a_alias'\n assert Model.model_fields['a'].alias == 'a_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/tests/test_aliases.py_test_alias_generator_with_computed_field_test_alias_generator_with_invalid_callables.for_alias_kind_in_valid.with_pytest_raises_.Foo.model_config.ConfigDict_alias_generato": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_alias_generator_with_computed_field_test_alias_generator_with_invalid_callables.for_alias_kind_in_valid.with_pytest_raises_.Foo.model_config.ConfigDict_alias_generato", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 654, "end_line": 680, "span_ids": ["test_alias_generator_with_invalid_callables", "test_alias_generator_with_computed_field"], "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": "@pytest.mark.parametrize('alias_generator', upper_alias_generator)\ndef test_alias_generator_with_computed_field(alias_generator) -> None:\n class Rectangle(BaseModel):\n model_config = ConfigDict(populate_by_name=True, alias_generator=alias_generator)\n\n width: int\n height: int\n\n @computed_field\n @property\n def area(self) -> int:\n return self.width * self.height\n\n r = Rectangle(width=10, height=20)\n assert r.model_dump(by_alias=True) == {'WIDTH': 10, 'HEIGHT': 20, 'AREA': 200}\n\n\ndef test_alias_generator_with_invalid_callables() -> None:\n for alias_kind in ('validation_alias', 'serialization_alias', 'alias'):\n with pytest.raises(\n TypeError, match=f'Invalid `{alias_kind}` type. `{alias_kind}` generator must produce one of'\n ):\n\n class Foo(BaseModel):\n a: str\n\n model_config = ConfigDict(alias_generator=AliasGenerator(**{alias_kind: lambda 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_annotated.py_test_annotated_field_info_not_lost_from_forwardref_test_annotated_field_info_not_lost_from_forwardref.assert_exc_info_value_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_field_info_not_lost_from_forwardref_test_annotated_field_info_not_lost_from_forwardref.assert_exc_info_value_err", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 382, "end_line": 405, "span_ids": ["test_annotated_field_info_not_lost_from_forwardref"], "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_annotated_field_info_not_lost_from_forwardref():\n from pydantic import BaseModel\n\n class ForwardRefAnnotatedFieldModel(BaseModel):\n foo: 'Annotated[Integer, Field(alias=\"bar\", default=1)]' = 2\n foo2: 'Annotated[Integer, Field(alias=\"bar2\", default=1)]' = Field(default=2, alias='baz')\n\n Integer = int\n\n ForwardRefAnnotatedFieldModel.model_rebuild()\n\n assert ForwardRefAnnotatedFieldModel(bar=3).foo == 3\n assert ForwardRefAnnotatedFieldModel(baz=3).foo2 == 3\n\n with pytest.raises(ValidationError) as exc_info:\n ForwardRefAnnotatedFieldModel(bar='bar')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'bar',\n 'loc': ('bar',),\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_computed_fields.py_test_computed_fields_json_schema_test_computed_fields_json_schema.Rectangle.double_width.return.self_width_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_json_schema_test_computed_fields_json_schema.Rectangle.double_width.return.self_width_2", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 66, "end_line": 88, "span_ids": ["test_computed_fields_json_schema"], "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_computed_fields_json_schema():\n class Rectangle(BaseModel):\n width: int\n length: int\n\n @computed_field\n def area(self) -> int:\n \"\"\"An awesome area\"\"\"\n return self.width * self.length\n\n @computed_field(\n title='Pikarea',\n description='Another area',\n examples=[100, 200],\n json_schema_extra={'foo': 42},\n )\n @property\n def area2(self) -> int:\n return self.width * self.length\n\n @property\n def double_width(self) -> int:\n return self.width * 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_computed_fields.py_test_computed_fields_json_schema.assert_Rectangle_model_js_test_computed_fields_json_schema.assert_Rectangle_model_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_json_schema.assert_Rectangle_model_js_test_computed_fields_json_schema.assert_Rectangle_model_js", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 118, "span_ids": ["test_computed_fields_json_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": "def test_computed_fields_json_schema():\n # ... other code\n\n assert Rectangle.model_json_schema(mode='serialization') == {\n 'title': 'Rectangle',\n 'type': 'object',\n 'properties': {\n 'width': {\n 'title': 'Width',\n 'type': 'integer',\n },\n 'length': {\n 'title': 'Length',\n 'type': 'integer',\n },\n 'area': {\n 'title': 'Area',\n 'description': 'An awesome area',\n 'type': 'integer',\n 'readOnly': True,\n },\n 'area2': {\n 'title': 'Pikarea',\n 'description': 'Another area',\n 'examples': [100, 200],\n 'foo': 42,\n 'type': 'integer',\n 'readOnly': True,\n },\n },\n 'required': ['width', 'length', 'area', 'area2'],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_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_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": 617, "end_line": 641, "span_ids": ["test_initvar", "test_derived_field_from_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": "def 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\n\n\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_deprecated.py_test_fields_set_test_fields_dir.assert___fields___not_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_fields_set_test_fields_dir.assert___fields___not_i", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 323, "end_line": 340, "span_ids": ["test_fields_dir", "test_fields_set"], "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_fields_set():\n class Model(BaseModel):\n x: int\n y: int = 2\n\n m = Model(x=1)\n assert m.model_fields_set == {'x'}\n match = '^The `__fields_set__` attribute is deprecated, use `model_fields_set` instead.'\n with pytest.warns(PydanticDeprecatedSince20, match=match):\n assert m.__fields_set__ == {'x'}\n\n\ndef test_fields_dir():\n class Model(BaseModel):\n x: int\n y: int = 2\n\n assert '__fields__' not in dir(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_deprecated.py_test_extra_used_as_enum_test_extra_used_as_enum.with_pytest_warns_.assert_getattr_Extra_att": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_extra_used_as_enum_test_extra_used_as_enum.with_pytest_warns_.assert_getattr_Extra_att", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 343, "end_line": 352, "span_ids": ["test_extra_used_as_enum"], "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": "@pytest.mark.parametrize('attribute,value', [('allow', 'allow'), ('ignore', 'ignore'), ('forbid', 'forbid')])\ndef test_extra_used_as_enum(\n attribute: str,\n value: str,\n) -> None:\n with pytest.warns(\n PydanticDeprecatedSince20,\n match=re.escape(\"`pydantic.config.Extra` is deprecated, use literal values instead (e.g. `extra='allow'`)\"),\n ):\n assert getattr(Extra, attribute) == 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_discriminated_union.py_test_discriminated_union_validation_test_discriminated_union_validation.None_3.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_3.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": 133, "end_line": 216, "span_ids": ["test_discriminated_union_validation"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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('color_discriminator_kind', ['discriminator', 'field_str', 'field_discriminator'])\n@pytest.mark.parametrize('pet_discriminator_kind', ['discriminator', 'field_str', 'field_discriminator'])\ndef test_discriminated_union_validation(color_discriminator_kind, pet_discriminator_kind):\n def _get_str_discriminator(discriminator: str, kind: str):\n if kind == 'discriminator':\n return Discriminator(discriminator)\n elif kind == 'field_str':\n return Field(discriminator=discriminator)\n elif kind == 'field_discriminator':\n return Field(discriminator=Discriminator(discriminator))\n raise ValueError(f'Invalid kind: {kind}')\n\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 color_discriminator = _get_str_discriminator('color', color_discriminator_kind)\n Cat = Annotated[Union[BlackCat, WhiteCat], color_discriminator]\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 pet_discriminator = _get_str_discriminator('pet_type', pet_discriminator_kind)\n\n class Model(BaseModel):\n pet: Annotated[Union[Cat, Dog, Lizard], pet_discriminator]\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(include_url=False) == [\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 # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'model_attributes_type',\n 'loc': ('pet',),\n 'msg': 'Input should be a valid dictionary or object to extract fields from',\n 'input': 'fish',\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(include_url=False) == [\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(include_url=False) == [\n {'input': {'pet_type': 'lizard'}, 'loc': ('pet', 'lizard', 'm'), 'msg': 'Field required', 'type': 'missing'}\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_discriminated_union.py_test_discriminated_union_validation.None_3_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_3_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": 217, "end_line": 236, "span_ids": ["test_discriminated_union_validation"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize('color_discriminator_kind', ['discriminator', 'field_str', 'field_discriminator'])\n@pytest.mark.parametrize('pet_discriminator_kind', ['discriminator', 'field_str', 'field_discriminator'])\ndef test_discriminated_union_validation(color_discriminator_kind, pet_discriminator_kind):\n # ... other code\n\n with pytest.raises(ValidationError) as exc_info:\n # ... other code\n assert exc_info.value.errors(include_url=False) == [\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 assert exc_info.value.errors(include_url=False) == [\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_callable_discriminated_union_recursive_test_callable_discriminated_union_recursive.None_2.DiscriminatedModel_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_recursive_test_callable_discriminated_union_recursive.None_2.DiscriminatedModel_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": 1557, "end_line": 1635, "span_ids": ["test_callable_discriminated_union_recursive"], "tokens": 774}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_callable_discriminated_union_recursive():\n # Demonstrate that the errors are very verbose without a callable discriminator:\n class Model(BaseModel):\n x: Union[str, 'Model']\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'x': {'x': {'x': 1}}})\n assert exc_info.value.errors(include_url=False) == [\n {'input': {'x': {'x': 1}}, 'loc': ('x', 'str'), 'msg': 'Input should be a valid string', 'type': 'string_type'},\n {\n 'input': {'x': 1},\n 'loc': ('x', 'Model', 'x', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': 1,\n 'loc': ('x', 'Model', 'x', 'Model', 'x', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'ctx': {'class_name': 'Model'},\n 'input': 1,\n 'loc': ('x', 'Model', 'x', 'Model', 'x', 'Model'),\n 'msg': 'Input should be a valid dictionary or instance of Model',\n 'type': 'model_type',\n },\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate({'x': {'x': {'x': {}}}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': {'x': {'x': {}}},\n 'loc': ('x', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': {'x': {}},\n 'loc': ('x', 'Model', 'x', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': {},\n 'loc': ('x', 'Model', 'x', 'Model', 'x', 'str'),\n 'msg': 'Input should be a valid string',\n 'type': 'string_type',\n },\n {\n 'input': {},\n 'loc': ('x', 'Model', 'x', 'Model', 'x', 'Model', 'x'),\n 'msg': 'Field required',\n 'type': 'missing',\n },\n ]\n\n # Demonstrate that the errors are less verbose _with_ a callable discriminator:\n def model_x_discriminator(v):\n if isinstance(v, str):\n return 'str'\n if isinstance(v, (dict, BaseModel)):\n return 'model'\n\n class DiscriminatedModel(BaseModel):\n x: Annotated[\n Union[Annotated[str, Tag('str')], Annotated['DiscriminatedModel', Tag('model')]],\n Discriminator(\n model_x_discriminator,\n custom_error_type='invalid_union_member',\n custom_error_message='Invalid union member',\n custom_error_context={'discriminator': 'str_or_model'},\n ),\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n DiscriminatedModel.model_validate({'x': {'x': {'x': 1}}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'str_or_model'},\n 'input': 1,\n 'loc': ('x', 'model', 'x', 'model', 'x'),\n 'msg': 'Invalid union member',\n 'type': 'invalid_union_member',\n }\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_discriminated_union.py_test_callable_discriminated_union_recursive.None_2_test_callable_discriminated_union_recursive.assert_m_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_recursive.None_2_test_callable_discriminated_union_recursive.assert_m_model_dump_", "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": 1636, "end_line": 1660, "span_ids": ["test_callable_discriminated_union_recursive"], "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_callable_discriminated_union_recursive():\n # ... other code\n\n with pytest.raises(ValidationError) as exc_info:\n # ... other code\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'discriminator': 'str_or_model'},\n 'input': 1,\n 'loc': ('x', 'model', 'x', 'model', 'x'),\n 'msg': 'Invalid union member',\n 'type': 'invalid_union_member',\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n DiscriminatedModel.model_validate({'x': {'x': {'x': {}}}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': {},\n 'loc': ('x', 'model', 'x', 'model', 'x', 'model', 'x'),\n 'msg': 'Field required',\n 'type': 'missing',\n }\n ]\n # Demonstrate that the data is still handled properly when valid:\n data = {'x': {'x': {'x': 'a'}}}\n m = DiscriminatedModel.model_validate(data)\n assert m == DiscriminatedModel(x=DiscriminatedModel(x=DiscriminatedModel(x='a')))\n assert m.model_dump() == 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_edge_cases.py_functools_from_pydantic_functional_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_functools_from_pydantic_functional_", "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": 51, "span_ids": ["imports"], "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": "import functools\nimport importlib.util\nimport re\nimport sys\nfrom abc import ABC, abstractmethod\nfrom collections.abc import Hashable\nfrom decimal import Decimal\nfrom enum import Enum, auto\nfrom typing import (\n Any,\n Dict,\n ForwardRef,\n FrozenSet,\n Generic,\n List,\n Optional,\n Sequence,\n Set,\n Tuple,\n Type,\n TypeVar,\n Union,\n)\n\nimport pytest\nfrom dirty_equals import HasRepr, IsStr\nfrom pydantic_core import ErrorDetails, InitErrorDetails, PydanticSerializationError, core_schema\nfrom typing_extensions import Annotated, Literal, TypedDict, get_args\n\nfrom pydantic import (\n BaseModel,\n ConfigDict,\n GetCoreSchemaHandler,\n PydanticDeprecatedSince20,\n PydanticInvalidForJsonSchema,\n PydanticSchemaGenerationError,\n RootModel,\n TypeAdapter,\n ValidationError,\n constr,\n errors,\n field_validator,\n model_validator,\n root_validator,\n validator,\n)\nfrom pydantic.fields import Field, computed_field\nfrom pydantic.functional_serializers import (\n field_serializer,\n model_serializer,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_root_models_in_discriminated_union_test_recursive_root_models_in_discriminated_union.assert_Outer_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_recursive_root_models_in_discriminated_union_test_recursive_root_models_in_discriminated_union.assert_Outer_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": 2640, "end_line": 2707, "span_ids": ["test_recursive_root_models_in_discriminated_union"], "tokens": 715}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_root_models_in_discriminated_union():\n class Model1(BaseModel):\n kind: Literal['1'] = '1'\n two: Optional['Model2']\n\n class Model2(BaseModel):\n kind: Literal['2'] = '2'\n one: Optional[Model1]\n\n class Root1(RootModel[Model1]):\n @property\n def kind(self):\n # Ensures discriminated union validation works even with model instances\n return self.root.kind\n\n class Root2(RootModel[Model2]):\n @property\n def kind(self):\n # Ensures discriminated union validation works even with model instances\n return self.root.kind\n\n class Outer(BaseModel):\n a: Annotated[Union[Root1, Root2], Field(discriminator='kind')]\n b: Annotated[Union[Root1, Root2], Field(discriminator='kind')]\n\n validated = Outer.model_validate({'a': {'kind': '1', 'two': None}, 'b': {'kind': '2', 'one': None}})\n assert validated == Outer(a=Root1(root=Model1(two=None)), b=Root2(root=Model2(one=None)))\n\n # insert_assert(Outer.model_json_schema())\n assert Outer.model_json_schema() == {\n '$defs': {\n 'Model1': {\n 'properties': {\n 'kind': {'const': '1', 'default': '1', 'enum': ['1'], 'title': 'Kind', 'type': 'string'},\n 'two': {'anyOf': [{'$ref': '#/$defs/Model2'}, {'type': 'null'}]},\n },\n 'required': ['two'],\n 'title': 'Model1',\n 'type': 'object',\n },\n 'Model2': {\n 'properties': {\n 'kind': {'const': '2', 'default': '2', 'enum': ['2'], 'title': 'Kind', 'type': 'string'},\n 'one': {'anyOf': [{'$ref': '#/$defs/Model1'}, {'type': 'null'}]},\n },\n 'required': ['one'],\n 'title': 'Model2',\n 'type': 'object',\n },\n 'Root1': {'allOf': [{'$ref': '#/$defs/Model1'}], 'title': 'Root1'},\n 'Root2': {'allOf': [{'$ref': '#/$defs/Model2'}], 'title': 'Root2'},\n },\n 'properties': {\n 'a': {\n 'discriminator': {'mapping': {'1': '#/$defs/Root1', '2': '#/$defs/Root2'}, 'propertyName': 'kind'},\n 'oneOf': [{'$ref': '#/$defs/Root1'}, {'$ref': '#/$defs/Root2'}],\n 'title': 'A',\n },\n 'b': {\n 'discriminator': {'mapping': {'1': '#/$defs/Root1', '2': '#/$defs/Root2'}, 'propertyName': 'kind'},\n 'oneOf': [{'$ref': '#/$defs/Root1'}, {'$ref': '#/$defs/Root2'}],\n 'title': 'B',\n },\n },\n 'required': ['a', 'b'],\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_edge_cases.py_test_eq_with_cached_property_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_edge_cases.py_test_eq_with_cached_property_", "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": 2718, "end_line": 2744, "span_ids": ["test_eq_with_cached_property"], "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_eq_with_cached_property():\n \"\"\"\n Test BaseModel.__eq__ compatibility with functools.cached_property\n\n See GH-7444: https://github.com/pydantic/pydantic/issues/7444\n Previously, pydantic BaseModel.__eq__ compared the full __dict__ of\n model instances. This is not compatible with e.g. functools.cached_property,\n which caches the computed values in the instance's __dict__\n \"\"\"\n\n class Model(BaseModel):\n attr: int\n\n @functools.cached_property\n def cached(self) -> int:\n return 0\n\n obj1 = Model(attr=1)\n obj2 = Model(attr=1)\n # ensure the instances are indeed equal before __dict__ mutations\n assert obj1 == obj2\n # This access to the cached_property has the side-effect of modifying obj1.__dict__\n # See functools.cached_property documentation and source code\n obj1.cached\n # Ensure the objects still compare equals after caching a property\n assert obj1 == obj2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py__language_Python_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_exports.py__language_Python_", "embedding": null, "metadata": {"file_path": "tests/test_exports.py", "file_name": "test_exports.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 142, "span_ids": ["impl:3", "impl", "test_public_internal", "test_dataclass_import2", "test_dataclass_import", "test_import_base_model", "test_import_pydantic"], "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": "# language=Python\nIMPORTED_PYDANTIC_CODE = \"\"\"\nimport sys\nimport pydantic\n\nmodules = list(sys.modules.keys())\n\nimport json\nprint(json.dumps(modules))\n\"\"\"\n\n\ndef test_import_pydantic(subprocess_run_code):\n output = subprocess_run_code(IMPORTED_PYDANTIC_CODE)\n imported_modules = json.loads(output)\n # debug(imported_modules)\n assert 'pydantic' in imported_modules\n assert 'pydantic.deprecated' not in imported_modules\n\n\n# language=Python\nIMPORTED_BASEMODEL_CODE = \"\"\"\nimport sys\nfrom pydantic import BaseModel\n\nmodules = list(sys.modules.keys())\n\nimport json\nprint(json.dumps(modules))\n\"\"\"\n\n\ndef test_import_base_model(subprocess_run_code):\n output = subprocess_run_code(IMPORTED_BASEMODEL_CODE)\n imported_modules = json.loads(output)\n # debug(sorted(imported_modules))\n assert 'pydantic' in imported_modules\n assert 'pydantic.fields' not in imported_modules\n assert 'pydantic.types' not in imported_modules\n assert 'annotated_types' not in imported_modules\n\n\ndef test_dataclass_import(subprocess_run_code):\n @subprocess_run_code\n def run_in_subprocess():\n import pydantic\n\n assert pydantic.dataclasses.__name__ == 'pydantic.dataclasses'\n\n @pydantic.dataclasses.dataclass\n class Foo:\n a: int\n\n try:\n Foo('not an int')\n except ValueError:\n pass\n else:\n raise AssertionError('Should have raised a ValueError')\n\n\ndef test_dataclass_import2(subprocess_run_code):\n @subprocess_run_code\n def run_in_subprocess():\n import pydantic.dataclasses\n\n assert pydantic.dataclasses.__name__ == 'pydantic.dataclasses'\n\n @pydantic.dataclasses.dataclass\n class Foo:\n a: int\n\n try:\n Foo('not an int')\n except ValueError:\n pass\n else:\n raise AssertionError('Should have raised a ValueError')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_module_with_colon_in_name_test_module_with_colon_in_name.assert_v_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_module_with_colon_in_name_test_module_with_colon_in_name.assert_v_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": 5759, "end_line": 5782, "span_ids": ["test_module_with_colon_in_name"], "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_module_with_colon_in_name(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom pydantic import BaseModel\n\nclass Foo(BaseModel):\n x: int\n \"\"\",\n module_name_prefix='C:\\\\',\n )\n\n foo_model = module.Foo\n _, v_schema = models_json_schema([(foo_model, 'validation')])\n assert v_schema == {\n '$defs': {\n 'Foo': {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'Foo',\n 'type': 'object',\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_main.py_test_not_frozen_are_not_hashable_test_hash_function_give_different_result_for_different_object.assert_hash_m_hash_m3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_not_frozen_are_not_hashable_test_hash_function_give_different_result_for_different_object.assert_hash_m_hash_m3", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 557, "end_line": 630, "span_ids": ["test_with_declared_hash", "test_hash_function_empty_model", "test_frozen_with_hashable_fields_are_hashable", "test_not_frozen_are_not_hashable", "test_hash_function_give_different_result_for_different_object", "test_frozen_with_unhashable_fields_are_not_hashable"], "tokens": 474}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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]\n\n\ndef test_hash_function_empty_model():\n class TestModel(BaseModel):\n model_config = ConfigDict(frozen=True)\n\n m = TestModel()\n m2 = TestModel()\n assert m == m2\n assert hash(m) == hash(m2)\n\n\ndef 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_works_when_instance_dict_modified_test_hash_function_works_when_instance_dict_modified.hash_m_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_hash_function_works_when_instance_dict_modified_test_hash_function_works_when_instance_dict_modified.hash_m_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 633, "end_line": 657, "span_ids": ["test_hash_function_works_when_instance_dict_modified"], "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_hash_function_works_when_instance_dict_modified():\n class TestModel(BaseModel):\n model_config = ConfigDict(frozen=True)\n\n a: int\n b: int\n\n m = TestModel(a=1, b=2)\n h = hash(m)\n\n # Test edge cases where __dict__ is modified\n # @functools.cached_property can add keys to __dict__, these should be ignored.\n m.__dict__['c'] = 1\n assert hash(m) == h\n\n # Order of keys can be changed, e.g. with the deprecated copy method, which shouldn't matter.\n m.__dict__ = {'b': 2, 'a': 1}\n assert hash(m) == h\n\n # Keys can be missing, e.g. when using the deprecated copy method.\n # This could change the hash, and more importantly hashing shouldn't raise a KeyError\n # We don't assert here, because a hash collision is possible: the hash is not guaranteed to change\n # However, hashing must not raise an exception, which simply calling hash() checks for\n del m.__dict__['a']\n hash(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_main.py_test_default_hash_function_overrides_default_hash_function_test_hash_method_is_inherited_for_frozen_models.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_default_hash_function_overrides_default_hash_function_test_hash_method_is_inherited_for_frozen_models.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": 660, "end_line": 697, "span_ids": ["test_hash_method_is_inherited_for_frozen_models", "test_default_hash_function_overrides_default_hash_function"], "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 test_default_hash_function_overrides_default_hash_function():\n class A(BaseModel):\n model_config = ConfigDict(frozen=True)\n\n x: int\n\n class B(A):\n model_config = ConfigDict(frozen=True)\n\n y: int\n\n assert A.__hash__ != B.__hash__\n assert hash(A(x=1)) != hash(B(x=1, y=2)) != hash(B(x=1, y=3))\n\n\ndef test_hash_method_is_inherited_for_frozen_models():\n from functools import lru_cache\n\n class MyBaseModel(BaseModel):\n \"\"\"A base model with sensible configurations.\"\"\"\n\n model_config = ConfigDict(frozen=True)\n\n def __hash__(self):\n return hash(id(self))\n\n class MySubClass(MyBaseModel):\n x: Dict[str, int]\n\n @lru_cache(maxsize=None)\n def cached_method(self):\n return len(self.x)\n\n my_instance = MySubClass(x={'a': 1, 'b': 2})\n assert my_instance.cached_method() == 2\n\n object.__setattr__(my_instance, 'x', {}) # can't change the \"normal\" way due to frozen\n assert my_instance.cached_method() == 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_copy_extra_test_model_copy_extra.assert_m5_model_extra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_copy_extra_test_model_copy_extra.assert_m5_model_extra_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2279, "end_line": 2302, "span_ids": ["test_model_copy_extra"], "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_model_copy_extra():\n class Model(BaseModel, extra='allow'):\n x: int\n\n m = Model(x=1, y=2)\n assert m.model_dump() == {'x': 1, 'y': 2}\n assert m.model_extra == {'y': 2}\n m2 = m.model_copy()\n assert m2.model_dump() == {'x': 1, 'y': 2}\n assert m2.model_extra == {'y': 2}\n\n m3 = m.model_copy(update={'x': 4, 'z': 3})\n assert m3.model_dump() == {'x': 4, 'y': 2, 'z': 3}\n assert m3.model_extra == {'y': 2, 'z': 3}\n\n m4 = m.model_copy(update={'x': 4, 'z': 3})\n assert m4.model_dump() == {'x': 4, 'y': 2, 'z': 3}\n assert m4.model_extra == {'y': 2, 'z': 3}\n\n m = Model(x=1, a=2)\n m.__pydantic_extra__ = None\n m5 = m.model_copy(update={'x': 4, 'b': 3})\n assert m5.model_dump() == {'x': 4, 'b': 3}\n assert m5.model_extra == {'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_main.py_test_model_parametrized_name_not_generic_test_model_equality_generics.for_m1_in_models_.for_m2_in_models_.assert_hash_m3_hash_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_model_parametrized_name_not_generic_test_model_equality_generics.for_m1_in_models_.for_m2_in_models_.assert_hash_m3_hash_m", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 2305, "end_line": 2344, "span_ids": ["test_model_parametrized_name_not_generic", "test_model_equality_generics"], "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_model_parametrized_name_not_generic():\n class Model(BaseModel):\n x: int\n\n with pytest.raises(TypeError, match='Concrete names should only be generated for generic models.'):\n Model.model_parametrized_name(())\n\n\ndef test_model_equality_generics():\n T = TypeVar('T')\n\n class GenericModel(BaseModel, Generic[T], frozen=True):\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 models = [\n GenericModel(x=1),\n GenericModel[S](x=1),\n GenericModel[Any](x=1),\n GenericModel[int](x=1),\n GenericModel[float](x=1),\n ]\n for m1 in models:\n for m2 in models:\n # Test that it works with nesting as well\n m3 = GenericModel[type(m1)](x=m1)\n m4 = GenericModel[type(m2)](x=m2)\n assert m1 == m2\n assert m3 == m4\n assert hash(m1) == hash(m2)\n assert hash(m3) == 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_networks.py_test_nats_dsns_test_nats_dsns.assert_str_Model_dsn_dsn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_nats_dsns_test_nats_dsns.assert_str_Model_dsn_dsn_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 665, "end_line": 679, "span_ids": ["test_nats_dsns"], "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": "@pytest.mark.parametrize(\n 'dsn,result',\n [\n ('nats://user:pass@localhost:4222', 'nats://user:pass@localhost:4222'),\n ('tls://user@localhost', 'tls://user@localhost:4222'),\n ('ws://localhost:2355', 'ws://localhost:2355/'),\n ('tls://', 'tls://localhost:4222'),\n ('ws://:password@localhost:9999', 'ws://:password@localhost:9999/'),\n ],\n)\ndef test_nats_dsns(dsn, result):\n class Model(BaseModel):\n dsn: NatsDsn\n\n assert str(Model(dsn=dsn).dsn) == 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_plugins.py_test_on_validate_json_on_success.CustomPlugin_test_on_validate_json_on_success.with_install_plugin_plugi.assert_Model___pydantic_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_json_on_success.CustomPlugin_test_on_validate_json_on_success.with_install_plugin_plugi.assert_Model___pydantic_v", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 67, "span_ids": ["test_on_validate_json_on_success"], "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_on_validate_json_on_success() -> None:\n # ... other code\n\n class CustomPlugin(PydanticPluginProtocol):\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert config == {'title': 'Model'}\n assert plugin_settings == {'observe': 'all'}\n assert schema_type.__name__ == 'Model'\n assert schema_type_path == SchemaTypePath(\n 'tests.test_plugins', 'test_on_validate_json_on_success..Model'\n )\n assert schema_kind == 'BaseModel'\n return None, CustomOnValidateJson(), None\n\n plugin = CustomPlugin()\n with install_plugin(plugin):\n\n class Model(BaseModel, plugin_settings={'observe': 'all'}):\n a: int\n\n assert Model.model_validate({'a': 1}) == Model(a=1)\n assert Model.model_validate_json('{\"a\": 1}') == Model(a=1)\n\n assert Model.__pydantic_validator__.title == '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_plugins.py_test_on_validate_python_on_success.Plugin_test_on_validate_python_on_success.with_install_plugin_plugi.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_success.Plugin_test_on_validate_python_on_success.with_install_plugin_plugi.None_1", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 147, "span_ids": ["test_on_validate_python_on_success"], "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_on_validate_python_on_success() -> None:\n # ... other code\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert config == {'title': 'Model'}\n assert plugin_settings == {'observe': 'all'}\n assert schema_type.__name__ == 'Model'\n assert schema_kind == 'BaseModel'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n\n class Model(BaseModel, plugin_settings={'observe': 'all'}):\n a: int\n\n assert Model.model_validate({'a': 1}).model_dump() == {'a': 1}\n assert Model.model_validate_json('{\"a\": 1}').model_dump() == {'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_plugins.py_test_on_validate_python_on_error.Plugin_test_on_validate_python_on_error.with_install_plugin_plugi.assert_Model_model_valida": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_on_validate_python_on_error.Plugin_test_on_validate_python_on_error.with_install_plugin_plugi.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 193, "span_ids": ["test_on_validate_python_on_error"], "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_on_validate_python_on_error() -> None:\n # ... other code\n\n class Plugin(PydanticPluginProtocol):\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert config == {'title': 'Model'}\n assert plugin_settings == {'observe': 'all'}\n assert schema_type.__name__ == 'Model'\n assert schema_kind == 'BaseModel'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n\n class Model(BaseModel, plugin_settings={'observe': 'all'}):\n a: int\n\n with contextlib.suppress(ValidationError):\n Model.model_validate({'a': 'potato'})\n assert Model.model_validate_json('{\"a\": 1}').model_dump() == {'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_type_alias_type.py_test_nested_generic_type_alias_type_test_nested_generic_type_alias_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_type_alias_type.py_test_nested_generic_type_alias_type_test_nested_generic_type_alias_type.assert_model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 319, "end_line": 335, "span_ids": ["test_nested_generic_type_alias_type"], "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_nested_generic_type_alias_type() -> None:\n class MyModel(BaseModel):\n field_1: MyList[bool]\n field_2: MyList[str]\n\n model = MyModel(field_1=[True], field_2=['abc'])\n\n assert model.model_json_schema() == {\n '$defs': {\n 'MyList_bool_': {'items': {'type': 'boolean'}, 'type': 'array'},\n 'MyList_str_': {'items': {'type': 'string'}, 'type': 'array'},\n },\n 'properties': {'field_1': {'$ref': '#/$defs/MyList_bool_'}, 'field_2': {'$ref': '#/$defs/MyList_str_'}},\n 'required': ['field_1', 'field_2'],\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_validate_call.py_test_json_schema_test_json_schema.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_json_schema_test_json_schema.None_12", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 400, "end_line": 468, "span_ids": ["test_json_schema"], "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": "def test_json_schema():\n @validate_call\n def foo(a: int, b: int = None):\n return f'{a}, {b}'\n\n assert foo(1, 2) == '1, 2'\n assert foo(1, b=2) == '1, 2'\n assert foo(1) == '1, None'\n assert TypeAdapter(foo).json_schema() == {\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'default': None, 'title': 'B', 'type': 'integer'}},\n 'required': ['a'],\n 'additionalProperties': False,\n }\n\n @validate_call\n def foo(a: int, /, b: int):\n return f'{a}, {b}'\n\n assert foo(1, 2) == '1, 2'\n assert TypeAdapter(foo).json_schema() == {\n 'maxItems': 2,\n 'minItems': 2,\n 'prefixItems': [{'title': 'A', 'type': 'integer'}, {'title': 'B', 'type': 'integer'}],\n 'type': 'array',\n }\n\n @validate_call\n def foo(a: int, /, *, b: int, c: int):\n return f'{a}, {b}, {c}'\n\n assert foo(1, b=2, c=3) == '1, 2, 3'\n with pytest.raises(\n PydanticInvalidForJsonSchema,\n match=(\n 'Unable to generate JSON schema for arguments validator ' 'with positional-only and keyword-only arguments'\n ),\n ):\n TypeAdapter(foo).json_schema()\n\n @validate_call\n def foo(*numbers: int) -> int:\n return sum(numbers)\n\n assert foo(1, 2, 3) == 6\n assert TypeAdapter(foo).json_schema() == {'items': {'type': 'integer'}, 'prefixItems': [], 'type': 'array'}\n\n @validate_call\n def foo(**scores: int) -> str:\n return ', '.join(f'{k}={v}' for k, v in sorted(scores.items()))\n\n assert foo(a=1, b=2) == 'a=1, b=2'\n assert TypeAdapter(foo).json_schema() == {\n 'additionalProperties': {'type': 'integer'},\n 'properties': {},\n 'type': 'object',\n }\n\n @validate_call\n def foo(a: Annotated[int, Field(..., alias='A')]):\n return a\n\n assert foo(1) == 1\n assert TypeAdapter(foo).json_schema() == {\n 'additionalProperties': False,\n 'properties': {'A': {'title': 'A', 'type': 'integer'}},\n 'required': ['A'],\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_validators.py_test_v1_validator_deprecated_test_v1_validator_deprecated.assert_validator_x_": {"__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_validator_x_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 1900, "end_line": 1923, "span_ids": ["test_v1_validator_deprecated"], "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_v1_validator_deprecated():\n with pytest.warns(PydanticDeprecatedSince20, 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 assert \"@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_version.py_from_unittest_mock_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_version.py_from_unittest_mock_import_", "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": 44, "span_ids": ["test_version_attribute_is_present", "test_version_short", "imports", "test_version_info", "test_standard_version", "test_version_attribute_is_a_string"], "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": "from unittest.mock import patch\n\nimport pytest\nfrom packaging.version import parse as parse_version\n\nimport pydantic\nfrom pydantic.version import version_info, version_short\n\n\ndef test_version_info():\n version_info_fields = [\n 'pydantic version',\n 'pydantic-core version',\n 'pydantic-core build',\n 'install path',\n 'python version',\n 'platform',\n 'related packages',\n 'commit',\n ]\n\n s = version_info()\n assert all([f'{field}:' in s for field in version_info_fields])\n assert s.count('\\n') == 7\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)\n\n\n@pytest.mark.parametrize('version,expected', (('2.1', '2.1'), ('2.1.0', '2.1')))\ndef test_version_short(version, expected):\n with patch('pydantic.version.VERSION', version):\n assert version_short() == 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/docs/plugins/main.py_build_conversion_table_build_conversion_table.return.markdown": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_build_conversion_table_build_conversion_table.return.markdown", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 289, "end_line": 306, "span_ids": ["build_conversion_table"], "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 build_conversion_table(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'concepts/conversion_table.md':\n return None\n\n filtered_table_predicates = {\n 'all': lambda r: True,\n 'json': lambda r: r.json_input,\n 'json_strict': lambda r: r.json_input and r.strict,\n 'python': lambda r: r.python_input,\n 'python_strict': lambda r: r.python_input and r.strict,\n }\n\n for table_id, predicate in filtered_table_predicates.items():\n table_markdown = conversion_table.filtered(predicate).as_markdown()\n table_markdown = textwrap.indent(table_markdown, ' ')\n markdown = re.sub(rf'{{{{ *conversion_table_{table_id} *}}}}', table_markdown, markdown)\n\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_devtools_example_maintainers_template.Template_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_devtools_example_maintainers_template.Template_", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 309, "end_line": 406, "span_ids": ["impl:15", "devtools_example"], "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": "def devtools_example(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'integrations/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)\n\n\nexperts_template = Template(\n \"\"\"\n
\n {% for user in people.experts %}\n
\n \n
\n \n
\n
@{{ user.login }}
\n
\n
Questions replied: {{ user.count }}
\n
\n {% endfor %}\n
\n\"\"\"\n)\n\nmost_active_users_template = Template(\n \"\"\"\n\n
\n {% for user in people.last_month_active %}\n
\n \n
\n \n
\n
@{{ user.login }}
\n
\n
Questions replied: {{ user.count }}
\n
\n {% endfor %}\n
\n\"\"\"\n)\n\ntop_contributors_template = Template(\n \"\"\"\n
\n {% for user in people.top_contributors %}\n
\n \n
\n \n
\n
@{{ user.login }}
\n
\n
Contributions: {{ user.count }}
\n
\n {% endfor %}\n
\n\"\"\"\n)\n\ntop_reviewers_template = Template(\n \"\"\"\n
\n {% for user in people.top_reviewers %}\n
\n \n
\n \n
\n
@{{ user.login }}
\n
\n
Reviews: {{ user.count }}
\n
\n {% endfor %}\n
\n\"\"\"\n)\n\nmaintainers_template = Template(\n \"\"\"\n
\n {% for user in people.maintainers %}\n \n {% endfor %}\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/docs/plugins/main.py_populate_pydantic_people_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/docs/plugins/main.py_populate_pydantic_people_", "embedding": null, "metadata": {"file_path": "docs/plugins/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 429, "span_ids": ["populate_pydantic_people"], "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 populate_pydantic_people(markdown: str, page: Page) -> str | None:\n if page.file.src_uri != 'pydantic_people.md':\n return None\n\n # read people.yml file data\n with (THIS_DIR / 'people.yml').open('rb') as f:\n people = yaml.load(f, Loader=yaml.FullLoader)\n\n # Render the templates\n for name, template in [\n ('experts', experts_template),\n ('most_active_users', most_active_users_template),\n ('top_contributors', top_contributors_template),\n ('top_reviewers', top_reviewers_template),\n ('maintainers', maintainers_template),\n ]:\n rendered = template.render(people=people)\n markdown = re.sub(f'{{{{ {name} }}}}', rendered, markdown)\n\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/pydantic/_internal/_validate_call.py_from___future___import_an_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_validate_call.py_from___future___import_an_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_validate_call.py", "file_name": "_validate_call.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 85, "span_ids": ["imports", "ValidateCallWrapper.__init__", "ValidateCallWrapper.__call__", "ValidateCallWrapper"], "tokens": 624}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom functools import partial\nfrom typing import Any, Awaitable, Callable\n\nimport pydantic_core\n\nfrom ..config import ConfigDict\nfrom ..plugin._schema_validator import create_schema_validator\nfrom . import _generate_schema, _typing_extra\nfrom ._config import ConfigWrapper\n\n\nclass ValidateCallWrapper:\n \"\"\"This is a wrapper around a function that validates the arguments passed to it, and optionally the return value.\"\"\"\n\n __slots__ = (\n '__pydantic_validator__',\n '__name__',\n '__qualname__',\n '__annotations__',\n '__dict__', # required for __module__\n )\n\n def __init__(self, function: Callable[..., Any], config: ConfigDict | None, validate_return: bool):\n if isinstance(function, partial):\n func = function.func\n schema_type = func\n self.__name__ = f'partial({func.__name__})'\n self.__qualname__ = f'partial({func.__qualname__})'\n self.__module__ = func.__module__\n else:\n schema_type = function\n self.__name__ = function.__name__\n self.__qualname__ = function.__qualname__\n self.__module__ = function.__module__\n\n namespace = _typing_extra.add_module_globals(function, None)\n config_wrapper = ConfigWrapper(config)\n gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)\n schema = gen_schema.clean_schema(gen_schema.generate_schema(function))\n core_config = config_wrapper.core_config(self)\n\n self.__pydantic_validator__ = create_schema_validator(\n schema,\n schema_type,\n self.__module__,\n self.__qualname__,\n 'validate_call',\n core_config,\n config_wrapper.plugin_settings,\n )\n\n if validate_return:\n signature = inspect.signature(function)\n return_type = signature.return_annotation if signature.return_annotation is not signature.empty else Any\n gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)\n schema = gen_schema.clean_schema(gen_schema.generate_schema(return_type))\n validator = create_schema_validator(\n schema,\n schema_type,\n self.__module__,\n self.__qualname__,\n 'validate_call',\n core_config,\n config_wrapper.plugin_settings,\n )\n if inspect.iscoroutinefunction(function):\n\n async def return_val_wrapper(aw: Awaitable[Any]) -> None:\n return validator.validate_python(await aw)\n\n self.__return_pydantic_validator__ = return_val_wrapper\n else:\n self.__return_pydantic_validator__ = validator.validate_python\n else:\n self.__return_pydantic_validator__ = None\n\n def __call__(self, *args: Any, **kwargs: Any) -> Any:\n res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))\n if self.__return_pydantic_validator__:\n return self.__return_pydantic_validator__(res)\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__getattr_no_parents__type_has_config.try_.except_TypeError_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py__getattr_no_parents__type_has_config.try_.except_TypeError_.return.False", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 106, "span_ids": ["_type_has_config", "_getattr_no_parents"], "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 _getattr_no_parents(obj: Any, attribute: str) -> Any:\n \"\"\"Returns the attribute value without attempting to look up attributes from parent types.\"\"\"\n if hasattr(obj, '__dict__'):\n try:\n return obj.__dict__[attribute]\n except KeyError:\n pass\n\n slots = getattr(obj, '__slots__', None)\n if slots is not None and attribute in slots:\n return getattr(obj, attribute)\n else:\n raise AttributeError(attribute)\n\n\ndef _type_has_config(type_: Any) -> bool:\n \"\"\"Returns whether the type has config.\"\"\"\n try:\n return issubclass(type_, BaseModel) or is_dataclass(type_) or is_typeddict(type_)\n except TypeError:\n # type is not a class\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/validate_call_decorator.py_validate_call_2_validate_call_2._Usage_docs_https_do": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py_validate_call_2_validate_call_2._Usage_docs_https_do", "embedding": null, "metadata": {"file_path": "pydantic/validate_call_decorator.py", "file_name": "validate_call_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 49, "span_ids": ["validate_call_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 validate_call(\n func: AnyCallableT | None = None,\n /,\n *,\n config: ConfigDict | None = None,\n validate_return: bool = False,\n) -> AnyCallableT | Callable[[AnyCallableT], AnyCallableT]:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/validation_decorator/\n\n Returns a decorated wrapper around the function that validates the arguments and, optionally, the return value.\n\n Usage may be either as a plain decorator `@validate_call` or with arguments `@validate_call(...)`.\n\n Args:\n func: The function to be decorated.\n config: The configuration dictionary.\n validate_return: Whether to validate the return value.\n\n Returns:\n 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/validate_call_decorator.py_validate_call_2.validate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/validate_call_decorator.py_validate_call_2.validate_", "embedding": null, "metadata": {"file_path": "pydantic/validate_call_decorator.py", "file_name": "validate_call_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 69, "span_ids": ["validate_call_2"], "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 validate_call(\n func: AnyCallableT | None = None,\n /,\n *,\n config: ConfigDict | None = None,\n validate_return: bool = False,\n) -> AnyCallableT | Callable[[AnyCallableT], AnyCallableT]:\n\n def validate(function: AnyCallableT) -> AnyCallableT:\n if isinstance(function, (classmethod, staticmethod)):\n name = type(function).__name__\n raise TypeError(f'The `@{name}` decorator should be applied after `@validate_call` (put `@{name}` on top)')\n validate_call_wrapper = _validate_call.ValidateCallWrapper(function, config, validate_return)\n\n @functools.wraps(function)\n def wrapper_function(*args, **kwargs):\n return validate_call_wrapper(*args, **kwargs)\n\n wrapper_function.raw_function = function # type: ignore\n\n return wrapper_function # type: ignore\n\n if func:\n return validate(func)\n else:\n return validate", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_multi_inheritance.assert_FooModel___orig_ba": {"__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_multi_inheritance.assert_FooModel___orig_ba", "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": 38, "end_line": 79, "span_ids": ["test_create_model_pickle", "test_create_model_usage", "test_create_model_multi_inheritance"], "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_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\n\n\ndef test_create_model_multi_inheritance():\n class Mixin:\n pass\n\n Generic_T = Generic[TypeVar('T')]\n FooModel = create_model('FooModel', value=(int, ...), __base__=(BaseModel, Generic_T))\n\n assert FooModel.__orig_bases__ == (BaseModel, Generic_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_create_model.py_test_create_model_must_not_reset_parent_namespace_test_create_model_must_not_reset_parent_namespace.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_create_model_must_not_reset_parent_namespace_test_create_model_must_not_reset_parent_namespace.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": 82, "end_line": 111, "span_ids": ["test_create_model_must_not_reset_parent_namespace"], "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_create_model_must_not_reset_parent_namespace():\n # It's important to use the annotation `'namespace'` as this is a particular string that is present\n # in the parent namespace if you reset the parent namespace in the call to `create_model`.\n\n AbcModel = create_model('AbcModel', abc=('namespace', None))\n with pytest.raises(\n PydanticUserError,\n match=re.escape(\n '`AbcModel` is not fully defined; you should define `namespace`, then call `AbcModel.model_rebuild()`.'\n ),\n ):\n AbcModel(abc=1)\n\n # Rebuild the model now that `namespace` is defined\n namespace = int # noqa F841\n AbcModel.model_rebuild()\n\n assert AbcModel(abc=1).abc == 1\n\n with pytest.raises(ValidationError) as exc_info:\n AbcModel(abc='a')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_parsing',\n 'loc': ('abc',),\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_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": 114, "end_line": 127, "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_datetime.py_test_datetime_parsing_from_str_test_datetime_parsing_from_str.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_from_str_test_datetime_parsing_from_str.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": 200, "end_line": 219, "span_ids": ["test_datetime_parsing_from_str"], "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": "@pytest.mark.parametrize(\n 'value,result',\n [\n # Invalid inputs\n ('2012-4-9 4:8:16', Err('Input should be a valid datetime or date, invalid character in month')),\n ('x20120423091500', Err('Input should be a valid datetime or date, invalid character in year')),\n ('2012-04-56T09:15:90', Err('Input should be a valid datetime or date, day value is outside expected range')),\n (\n '2012-04-23T11:05:00-25:00',\n Err('Input should be a valid datetime or date, unexpected extra characters at the end of the input'),\n ),\n ('infinity', Err('Input should be a valid datetime or date, input is too short')),\n ],\n)\ndef test_datetime_parsing_from_str(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_type_adapter.py_test_validate_strings_test_validate_strings.if_raises_match_is_not_No.else_.assert_ta_validate_string": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_strings_test_validate_strings.if_raises_match_is_not_No.else_.assert_ta_validate_string", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 273, "end_line": 304, "span_ids": ["test_validate_strings"], "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": "@pytest.mark.parametrize(\n 'field_type,input_value,expected,raises_match,strict',\n [\n (bool, 'true', True, None, False),\n (bool, 'true', True, None, True),\n (bool, 'false', False, None, False),\n (bool, 'e', ValidationError, 'type=bool_parsing', False),\n (int, '1', 1, None, False),\n (int, '1', 1, None, True),\n (int, 'xxx', ValidationError, 'type=int_parsing', True),\n (float, '1.1', 1.1, None, False),\n (float, '1.10', 1.1, None, False),\n (float, '1.1', 1.1, None, True),\n (float, '1.10', 1.1, None, True),\n (date, '2017-01-01', date(2017, 1, 1), None, False),\n (date, '2017-01-01', date(2017, 1, 1), None, True),\n (date, '2017-01-01T12:13:14.567', ValidationError, 'type=date_from_datetime_inexact', False),\n (date, '2017-01-01T12:13:14.567', ValidationError, 'type=date_parsing', True),\n (date, '2017-01-01T00:00:00', date(2017, 1, 1), None, False),\n (date, '2017-01-01T00:00:00', ValidationError, 'type=date_parsing', True),\n (datetime, '2017-01-01T12:13:14.567', datetime(2017, 1, 1, 12, 13, 14, 567_000), None, False),\n (datetime, '2017-01-01T12:13:14.567', datetime(2017, 1, 1, 12, 13, 14, 567_000), None, True),\n ],\n ids=repr,\n)\ndef test_validate_strings(field_type, input_value, expected, raises_match, strict):\n ta = TypeAdapter(field_type)\n if raises_match is not None:\n with pytest.raises(expected, match=raises_match):\n ta.validate_strings(input_value, strict=strict)\n else:\n assert ta.validate_strings(input_value, strict=strict) == 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_type_adapter.py_test_validate_strings_dict_test_annotated_type_disallows_config.with_pytest_raises_Pydant.TypeAdapter_Annotated_Mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_validate_strings_dict_test_annotated_type_disallows_config.with_pytest_raises_Pydant.TypeAdapter_Annotated_Mod", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 307, "end_line": 320, "span_ids": ["test_validate_strings_dict", "test_annotated_type_disallows_config"], "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": "@pytest.mark.parametrize('strict', [True, False])\ndef test_validate_strings_dict(strict):\n assert TypeAdapter(Dict[int, date]).validate_strings({'1': '2017-01-01', '2': '2017-01-02'}, strict=strict) == {\n 1: date(2017, 1, 1),\n 2: date(2017, 1, 2),\n }\n\n\ndef test_annotated_type_disallows_config() -> None:\n class Model(BaseModel):\n x: int\n\n with pytest.raises(PydanticUserError, match='Cannot use `config`'):\n TypeAdapter(Annotated[Model, ...], config=ConfigDict(strict=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_type_alias_type.py_test_recursive_type_alias.assert_t_json_schema__test_recursive_type_alias_name.assert_sorted_json_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_recursive_type_alias.assert_t_json_schema__test_recursive_type_alias_name.assert_sorted_json_schema", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 146, "span_ids": ["test_recursive_type_alias", "test_recursive_type_alias_name"], "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_recursive_type_alias() -> None:\n # ... other code\n\n assert t.json_schema() == {\n 'allOf': [{'$ref': '#/$defs/JsonType'}],\n '$defs': {\n 'JsonType': {\n 'anyOf': [\n {'type': 'array', 'items': {'$ref': '#/$defs/JsonType'}},\n {'type': 'object', 'additionalProperties': {'$ref': '#/$defs/JsonType'}},\n {'type': 'string'},\n {'type': 'integer'},\n {'type': 'number'},\n {'type': 'boolean'},\n {'type': 'null'},\n ]\n }\n },\n }\n\n\ndef test_recursive_type_alias_name():\n T = TypeVar('T')\n\n @dataclass\n class MyGeneric(Generic[T]):\n field: T\n\n MyRecursiveType = TypeAliasType('MyRecursiveType', Union[MyGeneric['MyRecursiveType'], int])\n json_schema = TypeAdapter(MyRecursiveType).json_schema()\n assert sorted(json_schema['$defs'].keys()) == ['MyGeneric_MyRecursiveType_', 'MyRecursiveType']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_decimal_strict.assert_Model_model_valida": {"__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_decimal_strict.assert_Model_model_valida", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 817, "end_line": 1089, "span_ids": ["test_decimal", "test_string_import_any_expected_failure", "test_string_import_callable", "test_decimal_strict", "test_string_import_errors", "test_string_import_default_value", "test_string_import_any", "test_string_import_constraints", "test_string_import_examples", "test_decimal_dont_allow_inf", "test_decimal_allow_inf"], "tokens": 2080}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'import_error',\n 'loc': ('callable',),\n 'msg': \"Invalid python path: No module named 'foobar'\",\n 'input': 'foobar',\n 'ctx': {'error': \"No module named 'foobar'\"},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n PyObjectModel(callable='os.missing')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'import_error',\n 'loc': ('callable',),\n 'msg': \"Invalid python path: No module named 'os.missing'\",\n 'input': 'os.missing',\n 'ctx': {'error': \"No module named 'os.missing'\"},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n PyObjectModel(callable='os.path')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'callable_type', 'loc': ('callable',), 'msg': 'Input should be callable', 'input': [1, 2, 3]}\n ]\n\n\n@pytest.mark.parametrize(\n ('value', 'expected', 'mode'),\n [\n ('math:cos', 'math.cos', 'json'),\n ('math:cos', math.cos, 'python'),\n ('math.cos', 'math.cos', 'json'),\n ('math.cos', math.cos, 'python'),\n pytest.param(\n 'os.path', 'posixpath', 'json', marks=pytest.mark.skipif(sys.platform == 'win32', reason='different output')\n ),\n pytest.param(\n 'os.path', 'ntpath', 'json', marks=pytest.mark.skipif(sys.platform != 'win32', reason='different output')\n ),\n ('os.path', os.path, 'python'),\n ([1, 2, 3], [1, 2, 3], 'json'),\n ([1, 2, 3], [1, 2, 3], 'python'),\n ('math', 'math', 'json'),\n ('math', math, 'python'),\n ('builtins.list', 'builtins.list', 'json'),\n ('builtins.list', list, 'python'),\n (list, 'builtins.list', 'json'),\n (list, list, 'python'),\n (f'{__name__}.pytest', 'pytest', 'json'),\n (f'{__name__}.pytest', pytest, 'python'),\n ],\n)\ndef test_string_import_any(value: Any, expected: Any, mode: Literal['json', 'python']):\n class PyObjectModel(BaseModel):\n thing: ImportString\n\n assert PyObjectModel(thing=value).model_dump(mode=mode) == {'thing': expected}\n\n\n@pytest.mark.parametrize(\n ('value', 'validate_default', 'expected'),\n [\n (math.cos, True, math.cos),\n ('math:cos', True, math.cos),\n (math.cos, False, math.cos),\n ('math:cos', False, 'math:cos'),\n ],\n)\ndef test_string_import_default_value(value: Any, validate_default: bool, expected: Any):\n class PyObjectModel(BaseModel):\n thing: ImportString = Field(default=value, validate_default=validate_default)\n\n assert PyObjectModel().thing == expected\n\n\n@pytest.mark.parametrize('value', ['oss', 'os.os', f'{__name__}.x'])\ndef test_string_import_any_expected_failure(value: Any):\n \"\"\"Ensure importString correctly fails to instantiate when it's supposed to\"\"\"\n\n class PyObjectModel(BaseModel):\n thing: ImportString\n\n with pytest.raises(ValidationError, match='type=import_error'):\n PyObjectModel(thing=value)\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')\n\n\ndef test_string_import_examples():\n import collections\n\n adapter = TypeAdapter(ImportString)\n assert adapter.validate_python('collections') is collections\n assert adapter.validate_python('collections.abc') is collections.abc\n assert adapter.validate_python('collections.abc.Mapping') is collections.abc.Mapping\n assert adapter.validate_python('collections.abc:Mapping') is collections.abc.Mapping\n\n\n@pytest.mark.parametrize(\n 'import_string,errors',\n [\n (\n 'collections.abc.def',\n [\n {\n 'ctx': {'error': \"No module named 'collections.abc.def'\"},\n 'input': 'collections.abc.def',\n 'loc': (),\n 'msg': \"Invalid python path: No module named 'collections.abc.def'\",\n 'type': 'import_error',\n }\n ],\n ),\n (\n 'collections.abc:def',\n [\n {\n 'ctx': {'error': \"cannot import name 'def' from 'collections.abc'\"},\n 'input': 'collections.abc:def',\n 'loc': (),\n 'msg': \"Invalid python path: cannot import name 'def' from 'collections.abc'\",\n 'type': 'import_error',\n }\n ],\n ),\n (\n 'collections:abc:Mapping',\n [\n {\n 'ctx': {'error': \"Import strings should have at most one ':'; received 'collections:abc:Mapping'\"},\n 'input': 'collections:abc:Mapping',\n 'loc': (),\n 'msg': \"Invalid python path: Import strings should have at most one ':';\"\n \" received 'collections:abc:Mapping'\",\n 'type': 'import_error',\n }\n ],\n ),\n (\n '123_collections:Mapping',\n [\n {\n 'ctx': {'error': \"No module named '123_collections'\"},\n 'input': '123_collections:Mapping',\n 'loc': (),\n 'msg': \"Invalid python path: No module named '123_collections'\",\n 'type': 'import_error',\n }\n ],\n ),\n (\n ':Mapping',\n [\n {\n 'ctx': {'error': \"Import strings should have a nonempty module name; received ':Mapping'\"},\n 'input': ':Mapping',\n 'loc': (),\n 'msg': 'Invalid python path: Import strings should have a nonempty module '\n \"name; received ':Mapping'\",\n 'type': 'import_error',\n }\n ],\n ),\n ],\n)\ndef test_string_import_errors(import_string, errors):\n with pytest.raises(ValidationError) as exc_info:\n TypeAdapter(ImportString).validate_python(import_string)\n assert exc_info.value.errors() == errors\n\n\ndef 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_allow_inf():\n class MyModel(BaseModel):\n value: Annotated[Decimal, AllowInfNan(True)]\n\n m = MyModel(value='inf')\n assert m.value == Decimal('inf')\n\n m = MyModel(value=Decimal('inf'))\n assert m.value == Decimal('inf')\n\n\ndef test_decimal_dont_allow_inf():\n class MyModel(BaseModel):\n value: Decimal\n\n with pytest.raises(ValidationError, match=r'Input should be a finite number \\[type=finite_number'):\n MyModel(value='inf')\n with pytest.raises(ValidationError, match=r'Input should be a finite number \\[type=finite_number'):\n MyModel(value=Decimal('inf'))\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\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'is_instance_of',\n 'loc': ('v',),\n 'msg': 'Input should be an instance of Decimal',\n 'input': 1.23,\n 'ctx': {'class': 'Decimal'},\n }\n ]\n\n v = Decimal(1.23)\n assert Model(v=v).v == v\n assert Model(v=v).model_dump() == {'v': v}\n\n assert Model.model_validate_json('{\"v\": \"1.23\"}').v == Decimal('1.23')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_precision_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_decimal_precision_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": 1092, "end_line": 1128, "span_ids": ["test_decimal_precision", "test_strict_date"], "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_decimal_precision() -> None:\n ta = TypeAdapter(Decimal)\n\n num = f'{1234567890 * 100}.{1234567890 * 100}'\n\n expected = Decimal(num)\n assert ta.validate_python(num) == expected\n assert ta.validate_json(f'\"{num}\"') == expected\n\n\ndef 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(include_url=False) == [\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(include_url=False) == [\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_typeddict.py_test_typeddict_alias_generator_test_typeddict_inheritance.assert_ta_validate_python": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_typeddict.py_test_typeddict_alias_generator_test_typeddict_inheritance.assert_ta_validate_python", "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": 714, "end_line": 746, "span_ids": ["test_typeddict_inheritance", "test_typeddict_alias_generator"], "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_typeddict_alias_generator(TypedDict):\n def alias_generator(name: str) -> str:\n return 'alias_' + name\n\n class MyDict(TypedDict):\n __pydantic_config__ = ConfigDict(alias_generator=alias_generator, extra='forbid')\n foo: str\n\n class Model(BaseModel):\n d: MyDict\n\n ta = TypeAdapter(MyDict)\n model = ta.validate_python({'alias_foo': 'bar'})\n\n assert model['foo'] == 'bar'\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python({'foo': 'bar'})\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing', 'loc': ('alias_foo',), 'msg': 'Field required', 'input': {'foo': 'bar'}},\n {'input': 'bar', 'loc': ('foo',), 'msg': 'Extra inputs are not permitted', 'type': 'extra_forbidden'},\n ]\n\n\ndef test_typeddict_inheritance(TypedDict: Any) -> None:\n class Parent(TypedDict):\n x: int\n\n class Child(Parent):\n y: float\n\n ta = TypeAdapter(Child)\n assert ta.validate_python({'x': '1', 'y': '1.0'}) == {'x': 1, 'y': 1.0}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._common_field_schema_GenerateSchema._common_field_schema.schema_6.self__apply_field_seriali": {"__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.schema_6.self__apply_field_seriali", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1003, "end_line": 1073, "span_ids": ["GenerateSchema._common_field_schema"], "tokens": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _common_field_schema( # C901\n self, name: str, field_info: FieldInfo, decorators: DecoratorInfos\n ) -> _CommonField:\n # Update FieldInfo annotation if appropriate:\n from .. import AliasChoices, AliasPath\n from ..fields import FieldInfo\n\n if has_instance_in_type(field_info.annotation, (ForwardRef, str)):\n types_namespace = self._types_namespace\n if self._typevars_map:\n types_namespace = (types_namespace or {}).copy()\n # Ensure that typevars get mapped to their concrete types:\n types_namespace.update({k.__name__: v for k, v in self._typevars_map.items()})\n\n evaluated = _typing_extra.eval_type_lenient(field_info.annotation, types_namespace)\n if evaluated is not field_info.annotation and not has_instance_in_type(evaluated, PydanticRecursiveRef):\n new_field_info = FieldInfo.from_annotation(evaluated)\n field_info.annotation = new_field_info.annotation\n\n # Handle any field info attributes that may have been obtained from now-resolved annotations\n for k, v in new_field_info._attributes_set.items():\n # If an attribute is already set, it means it was set by assigning to a call to Field (or just a\n # default value), and that should take the highest priority. So don't overwrite existing attributes.\n # We skip over \"attributes\" that are present in the metadata_lookup dict because these won't\n # actually end up as attributes of the `FieldInfo` instance.\n if k not in field_info._attributes_set and k not in field_info.metadata_lookup:\n setattr(field_info, k, v)\n\n # Finally, ensure the field info also reflects all the `_attributes_set` that are actually metadata.\n field_info.metadata = [*new_field_info.metadata, *field_info.metadata]\n\n source_type, annotations = field_info.annotation, field_info.metadata\n\n def set_discriminator(schema: CoreSchema) -> CoreSchema:\n schema = self._apply_discriminator_to_union(schema, field_info.discriminator)\n return schema\n\n with self.field_name_stack.push(name):\n if field_info.discriminator is not None:\n schema = self._apply_annotations(source_type, annotations, transform_inner_schema=set_discriminator)\n else:\n schema = self._apply_annotations(\n source_type,\n annotations,\n )\n\n # This V1 compatibility shim should eventually be removed\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.validators.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, name)\n\n schema = apply_validators(schema, filter_field_decorator_info_by_field(this_field_validators, name), name)\n schema = apply_validators(\n schema, filter_field_decorator_info_by_field(decorators.field_validators.values(), name), 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 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 = self._apply_field_serializers(\n schema, filter_field_decorator_info_by_field(decorators.field_serializers.values(), name)\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/_internal/_generate_schema.py_GenerateSchema._common_field_schema.json_schema_updates_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.json_schema_updates_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": 1097, "end_line": 1127, "span_ids": ["GenerateSchema._common_field_schema"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _common_field_schema( # C901\n self, name: str, field_info: FieldInfo, decorators: DecoratorInfos\n ) -> _CommonField:\n # ... other code\n json_schema_updates = {\n 'title': field_info.title,\n 'description': field_info.description,\n 'deprecated': bool(field_info.deprecated) or field_info.deprecated == '' or None,\n 'examples': to_jsonable_python(field_info.examples),\n }\n json_schema_updates = {k: v for k, v in json_schema_updates.items() if v is not None}\n\n json_schema_extra = field_info.json_schema_extra\n\n metadata = build_metadata_dict(\n js_annotation_functions=[get_json_schema_update_func(json_schema_updates, json_schema_extra)]\n )\n\n alias_generator = self._config_wrapper.alias_generator\n if alias_generator is not None:\n self._apply_alias_generator_to_field_info(alias_generator, field_info, name)\n\n if isinstance(field_info.validation_alias, (AliasChoices, AliasPath)):\n validation_alias = field_info.validation_alias.convert_to_aliases()\n else:\n validation_alias = field_info.validation_alias\n\n return _common_field(\n schema,\n serialization_exclude=True if field_info.exclude else None,\n validation_alias=validation_alias,\n serialization_alias=field_info.serialization_alias,\n frozen=field_info.frozen,\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/tests/test_annotated.py_test_annotated_private_field_with_default_test_annotated_private_field_with_default.None_1.assert_model_bar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_annotated_private_field_with_default_test_annotated_private_field_with_default.None_1.assert_model_bar", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 408, "end_line": 426, "span_ids": ["test_annotated_private_field_with_default"], "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_annotated_private_field_with_default():\n class AnnotatedPrivateFieldModel(BaseModel):\n _foo: Annotated[int, PrivateAttr(default=1)]\n _bar: Annotated[str, 'hello']\n\n model = AnnotatedPrivateFieldModel()\n assert model._foo == 1\n\n assert model.__pydantic_private__ == {'_foo': 1}\n\n with pytest.raises(AttributeError):\n assert model._bar\n\n model._bar = 'world'\n assert model._bar == 'world'\n assert model.__pydantic_private__ == {'_foo': 1, '_bar': 'world'}\n\n with pytest.raises(AttributeError):\n assert model.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_annotated.py_test_min_length_field_info_not_lost_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_annotated.py_test_min_length_field_info_not_lost_", "embedding": null, "metadata": {"file_path": "tests/test_annotated.py", "file_name": "test_annotated.py", "file_type": "text/x-python", "category": "test", "start_line": 429, "end_line": 473, "span_ids": ["test_min_length_field_info_not_lost"], "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_min_length_field_info_not_lost():\n class AnnotatedFieldModel(BaseModel):\n foo: 'Annotated[String, Field(min_length=3)]' = Field(description='hello')\n\n String = str\n\n AnnotatedFieldModel.model_rebuild()\n\n assert AnnotatedFieldModel(foo='000').foo == '000'\n\n with pytest.raises(ValidationError) as exc_info:\n AnnotatedFieldModel(foo='00')\n\n assert exc_info.value.errors(include_url=False) == [\n {\n 'loc': ('foo',),\n 'input': '00',\n 'ctx': {'min_length': 3},\n 'msg': 'String should have at least 3 characters',\n 'type': 'string_too_short',\n }\n ]\n\n # Ensure that the inner annotation does not override the outer, even for metadata:\n class AnnotatedFieldModel2(BaseModel):\n foo: 'Annotated[String, Field(min_length=3)]' = Field(description='hello', min_length=2)\n\n AnnotatedFieldModel2(foo='00')\n\n class AnnotatedFieldModel4(BaseModel):\n foo: 'Annotated[String, Field(min_length=3)]' = Field(description='hello', min_length=4)\n\n with pytest.raises(ValidationError) as exc_info:\n AnnotatedFieldModel4(foo='00')\n\n assert exc_info.value.errors(include_url=False) == [\n {\n 'loc': ('foo',),\n 'input': '00',\n 'ctx': {'min_length': 4},\n 'msg': 'String should have at least 4 characters',\n 'type': 'string_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_plugins.py_test_plugin_path_type_adapter_without_name_in_globals_test_plugin_path_type_adapter_without_name_in_globals.with_install_plugin_plugi.exec_code_bar_baz_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugins.py_test_plugin_path_type_adapter_without_name_in_globals_test_plugin_path_type_adapter_without_name_in_globals.with_install_plugin_plugi.exec_code_bar_baz_", "embedding": null, "metadata": {"file_path": "tests/test_plugins.py", "file_name": "test_plugins.py", "file_type": "text/x-python", "category": "test", "start_line": 363, "end_line": 382, "span_ids": ["test_plugin_path_type_adapter_without_name_in_globals"], "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_plugin_path_type_adapter_without_name_in_globals() -> None:\n class CustomOnValidatePython(ValidatePythonHandlerProtocol):\n pass\n\n class Plugin:\n def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings):\n assert str(schema_type) == 'typing.List[str]'\n assert schema_type_path == SchemaTypePath('', 'typing.List[str]')\n assert schema_kind == 'TypeAdapter'\n return CustomOnValidatePython(), None, None\n\n plugin = Plugin()\n with install_plugin(plugin):\n code = \"\"\"\nfrom typing import List\n\nimport pydantic\npydantic.TypeAdapter(List[str])\n\"\"\"\n exec(code, {'bar': '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/pydantic/main.py_BaseModel._iter_BaseModel._iter.return.copy_internals__iter_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._iter_BaseModel._iter.return.copy_internals__iter_self", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1308, "end_line": 1318, "span_ids": ["BaseModel._iter"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @typing_extensions.deprecated(\n 'The private method `_iter` will be removed and should no longer be used.', category=None\n )\n def _iter(self, *args: Any, **kwargs: Any) -> Any:\n warnings.warn(\n 'The private method `_iter` will be removed and should no longer be used.',\n category=PydanticDeprecatedSince20,\n )\n from .deprecated import copy_internals\n\n return copy_internals._iter(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_BaseModel._copy_and_set_values_BaseModel._copy_and_set_values.return.copy_internals__copy_and_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel._copy_and_set_values_BaseModel._copy_and_set_values.return.copy_internals__copy_and_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1320, "end_line": 1331, "span_ids": ["BaseModel._copy_and_set_values"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @typing_extensions.deprecated(\n 'The private method `_copy_and_set_values` will be removed and should no longer be used.',\n category=None,\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 category=PydanticDeprecatedSince20,\n )\n from .deprecated import copy_internals\n\n return copy_internals._copy_and_set_values(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/tests/test_computed_fields.py_test_computed_fields_get_test_computed_fields_get.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_fields_get_test_computed_fields_get.None_14", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 70, "span_ids": ["test_computed_fields_get"], "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_computed_fields_get():\n class Rectangle(BaseModel):\n width: int\n length: int\n\n @computed_field\n def area(self) -> int:\n \"\"\"An awesome area\"\"\"\n return self.width * self.length\n\n @computed_field(title='Pikarea', description='Another area')\n @property\n def area2(self) -> int:\n return self.width * self.length\n\n @property\n def double_width(self) -> int:\n return self.width * 2\n\n rect = Rectangle(width=10, length=5)\n assert set(rect.model_fields) == {'width', 'length'}\n assert set(rect.model_computed_fields) == {'area', 'area2'}\n assert rect.__dict__ == {'width': 10, 'length': 5}\n\n assert rect.model_computed_fields['area'].description == 'An awesome area'\n assert rect.model_computed_fields['area2'].title == 'Pikarea'\n assert rect.model_computed_fields['area2'].description == 'Another area'\n\n assert rect.area == 50\n assert rect.double_width == 20\n assert rect.model_dump() == {'width': 10, 'length': 5, 'area': 50, 'area2': 50}\n assert rect.model_dump_json() == '{\"width\":10,\"length\":5,\"area\":50,\"area2\":50}'\n\n assert set(Rectangle.model_fields) == {'width', 'length'}\n assert set(Rectangle.model_computed_fields) == {'area', 'area2'}\n\n assert Rectangle.model_computed_fields['area'].description == 'An awesome area'\n assert Rectangle.model_computed_fields['area2'].title == 'Pikarea'\n assert Rectangle.model_computed_fields['area2'].description == 'Another area'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__WalkCoreSchema.handle_list_schema__WalkCoreSchema.handle_json_or_python_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__WalkCoreSchema.handle_list_schema__WalkCoreSchema.handle_json_or_python_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": 256, "end_line": 328, "span_ids": ["_WalkCoreSchema.handle_frozenset_schema", "_WalkCoreSchema.handle_json_or_python_schema", "_WalkCoreSchema.handle_set_schema", "_WalkCoreSchema.handle_tagged_union_schema", "_WalkCoreSchema.handle_chain_schema", "_WalkCoreSchema.handle_function_schema", "_WalkCoreSchema.handle_generator_schema", "_WalkCoreSchema.handle_union_schema", "_WalkCoreSchema.handle_lax_or_strict_schema", "_WalkCoreSchema.handle_dict_schema", "_WalkCoreSchema.handle_tuple_schema", "_WalkCoreSchema.handle_list_schema"], "tokens": 820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _WalkCoreSchema:\n\n def handle_list_schema(self, schema: core_schema.ListSchema, f: Walk) -> core_schema.CoreSchema:\n items_schema = schema.get('items_schema')\n if items_schema is not None:\n schema['items_schema'] = self.walk(items_schema, f)\n return schema\n\n def handle_set_schema(self, schema: core_schema.SetSchema, f: Walk) -> core_schema.CoreSchema:\n items_schema = schema.get('items_schema')\n if items_schema is not None:\n schema['items_schema'] = self.walk(items_schema, f)\n return schema\n\n def handle_frozenset_schema(self, schema: core_schema.FrozenSetSchema, f: Walk) -> core_schema.CoreSchema:\n items_schema = schema.get('items_schema')\n if items_schema is not None:\n schema['items_schema'] = self.walk(items_schema, f)\n return schema\n\n def handle_generator_schema(self, schema: core_schema.GeneratorSchema, f: Walk) -> core_schema.CoreSchema:\n items_schema = schema.get('items_schema')\n if items_schema is not None:\n schema['items_schema'] = self.walk(items_schema, f)\n return schema\n\n def handle_tuple_schema(self, schema: core_schema.TupleSchema, f: Walk) -> core_schema.CoreSchema:\n schema['items_schema'] = [self.walk(v, f) for v in schema['items_schema']]\n return schema\n\n def handle_dict_schema(self, schema: core_schema.DictSchema, f: Walk) -> core_schema.CoreSchema:\n keys_schema = schema.get('keys_schema')\n if keys_schema is not None:\n schema['keys_schema'] = self.walk(keys_schema, f)\n values_schema = schema.get('values_schema')\n if values_schema:\n schema['values_schema'] = self.walk(values_schema, f)\n return schema\n\n def handle_function_schema(self, schema: AnyFunctionSchema, f: Walk) -> core_schema.CoreSchema:\n if not is_function_with_inner_schema(schema):\n return schema\n schema['schema'] = self.walk(schema['schema'], f)\n return schema\n\n def handle_union_schema(self, schema: core_schema.UnionSchema, f: Walk) -> core_schema.CoreSchema:\n new_choices: list[CoreSchema | tuple[CoreSchema, str]] = []\n for v in schema['choices']:\n if isinstance(v, tuple):\n new_choices.append((self.walk(v[0], f), v[1]))\n else:\n new_choices.append(self.walk(v, f))\n schema['choices'] = new_choices\n return schema\n\n def handle_tagged_union_schema(self, schema: core_schema.TaggedUnionSchema, f: Walk) -> core_schema.CoreSchema:\n new_choices: dict[Hashable, core_schema.CoreSchema] = {}\n for k, v in schema['choices'].items():\n new_choices[k] = v if isinstance(v, (str, int)) else self.walk(v, f)\n schema['choices'] = new_choices\n return schema\n\n def handle_chain_schema(self, schema: core_schema.ChainSchema, f: Walk) -> core_schema.CoreSchema:\n schema['steps'] = [self.walk(v, f) for v in schema['steps']]\n return schema\n\n def handle_lax_or_strict_schema(self, schema: core_schema.LaxOrStrictSchema, f: Walk) -> core_schema.CoreSchema:\n schema['lax_schema'] = self.walk(schema['lax_schema'], f)\n schema['strict_schema'] = self.walk(schema['strict_schema'], f)\n return schema\n\n def handle_json_or_python_schema(self, schema: core_schema.JsonOrPythonSchema, f: Walk) -> core_schema.CoreSchema:\n schema['json_schema'] = self.walk(schema['json_schema'], f)\n schema['python_schema'] = self.walk(schema['python_schema'], f)\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._config_wrapper_GenerateSchema._frozenset_schema.return.core_schema_frozenset_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._config_wrapper_GenerateSchema._frozenset_schema.return.core_schema_frozenset_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": 344, "end_line": 382, "span_ids": ["GenerateSchema._config_wrapper", "GenerateSchema._dict_schema", "GenerateSchema.str_schema", "GenerateSchema._set_schema", "GenerateSchema._current_generate_schema", "GenerateSchema._frozenset_schema", "GenerateSchema._types_namespace", "GenerateSchema._list_schema", "GenerateSchema._arbitrary_types"], "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 GenerateSchema:\n\n @property\n def _config_wrapper(self) -> ConfigWrapper:\n return self._config_wrapper_stack.tail\n\n @property\n def _types_namespace(self) -> dict[str, Any] | None:\n return self._types_namespace_stack.tail\n\n @property\n def _current_generate_schema(self) -> GenerateSchema:\n cls = self._config_wrapper.schema_generator or GenerateSchema\n return cls.__from_parent(\n self._config_wrapper_stack,\n self._types_namespace_stack,\n self._typevars_map,\n self.defs,\n )\n\n @property\n def _arbitrary_types(self) -> bool:\n return self._config_wrapper.arbitrary_types_allowed\n\n def str_schema(self) -> CoreSchema:\n \"\"\"Generate a CoreSchema for `str`\"\"\"\n return core_schema.str_schema()\n\n # the following methods can be overridden but should be considered\n # unstable / private APIs\n def _list_schema(self, tp: Any, items_type: Any) -> CoreSchema:\n return core_schema.list_schema(self.generate_schema(items_type))\n\n def _dict_schema(self, tp: Any, keys_type: Any, values_type: Any) -> CoreSchema:\n return core_schema.dict_schema(self.generate_schema(keys_type), self.generate_schema(values_type))\n\n def _set_schema(self, tp: Any, items_type: Any) -> CoreSchema:\n return core_schema.set_schema(self.generate_schema(items_type))\n\n def _frozenset_schema(self, tp: Any, items_type: Any) -> CoreSchema:\n return core_schema.frozenset_schema(self.generate_schema(items_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._tuple_schema_GenerateSchema._tuple_schema.if_not_params_.else_.return.core_schema_tuple_schema_": {"__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_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": 1322, "end_line": 1350, "span_ids": ["GenerateSchema._tuple_schema"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n def _tuple_schema(self, tuple_type: Any) -> core_schema.CoreSchema:\n \"\"\"Generate schema for a Tuple, e.g. `tuple[int, str]` or `tuple[int, ...]`.\"\"\"\n # TODO: do we really need to resolve type vars here?\n typevars_map = get_standard_typevars_map(tuple_type)\n params = self._get_args_resolving_forward_refs(tuple_type)\n\n if typevars_map and params:\n params = tuple(replace_types(param, typevars_map) for param in params)\n\n # NOTE: subtle difference: `tuple[()]` gives `params=()`, whereas `typing.Tuple[()]` gives `params=((),)`\n # This is only true for <3.11, on Python 3.11+ `typing.Tuple[()]` gives `params=()`\n if not params:\n if tuple_type in TUPLE_TYPES:\n return core_schema.tuple_schema([core_schema.any_schema()], variadic_item_index=0)\n else:\n # special case for `tuple[()]` which means `tuple[]` - an empty tuple\n return core_schema.tuple_schema([])\n elif params[-1] is Ellipsis:\n if len(params) == 2:\n return core_schema.tuple_schema([self.generate_schema(params[0])], variadic_item_index=0)\n else:\n # TODO: something like https://github.com/pydantic/pydantic/issues/5952\n raise ValueError('Variable tuples can only have one type')\n elif len(params) == 1 and params[0] == ():\n # special case for `Tuple[()]` which means `Tuple[]` - an empty tuple\n # NOTE: This conditional can be removed when we drop support for Python 3.10.\n return core_schema.tuple_schema([])\n else:\n return core_schema.tuple_schema([self.generate_schema(param) for param 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/_typing_extra.py_eval_type_backport_eval_type_backport.try_.except_TypeError_as_e_.return.eval_type_backport_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_eval_type_backport_eval_type_backport.try_.except_TypeError_as_e_.return.eval_type_backport_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": 230, "end_line": 256, "span_ids": ["eval_type_backport"], "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 eval_type_backport(\n value: Any, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None\n) -> Any:\n \"\"\"Like `typing._eval_type`, but falls back to the `eval_type_backport` package if it's\n installed to let older Python versions use newer typing features.\n Specifically, this transforms `X | Y` into `typing.Union[X, Y]`\n and `list[X]` into `typing.List[X]` etc. (for all the types made generic in PEP 585)\n if the original syntax is not supported in the current Python version.\n \"\"\"\n try:\n return typing._eval_type( # type: ignore\n value, globalns, localns\n )\n except TypeError as e:\n if not (isinstance(value, typing.ForwardRef) and is_backport_fixable_error(e)):\n raise\n try:\n from eval_type_backport import eval_type_backport\n except ImportError:\n raise TypeError(\n f'You have a type annotation {value.__forward_arg__!r} '\n f'which makes use of newer typing features than are supported in your version of Python. '\n f'To handle this error, you should either remove the use of new syntax '\n f'or install the `eval_type_backport` package.'\n ) from e\n\n return eval_type_backport(value, globalns, localns, try_default=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/_typing_extra.py_is_backport_fixable_error_get_function_type_hints.return.type_hints": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_backport_fixable_error_get_function_type_hints.return.type_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": 269, "end_line": 303, "span_ids": ["is_backport_fixable_error", "get_function_type_hints"], "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 is_backport_fixable_error(e: TypeError) -> bool:\n msg = str(e)\n return msg.startswith('unsupported operand type(s) for |: ') or \"' object is not subscriptable\" in msg\n\n\ndef get_function_type_hints(\n function: Callable[..., Any], *, include_keys: set[str] | None = None, types_namespace: dict[str, Any] | None = None\n) -> dict[str, Any]:\n \"\"\"Like `typing.get_type_hints`, but doesn't convert `X` to `Optional[X]` if the default value is `None`, also\n copes with `partial`.\n \"\"\"\n try:\n if isinstance(function, partial):\n annotations = function.func.__annotations__\n else:\n annotations = function.__annotations__\n except AttributeError:\n type_hints = get_type_hints(function)\n if isinstance(function, type):\n type_hints.setdefault('return', type)\n return type_hints\n\n globalns = add_module_globals(function)\n type_hints = {}\n for name, value in annotations.items():\n if include_keys is not None and name not in include_keys:\n continue\n if value is None:\n value = NoneType\n elif isinstance(value, str):\n value = _make_forward_ref(value)\n\n type_hints[name] = eval_type_backport(value, globalns, types_namespace)\n\n return type_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_is_dataclass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_is_dataclass_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 467, "end_line": 486, "span_ids": ["is_dataclass", "impl:47", "origin_is_type_alias_type"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_dataclass(_cls: type[Any]) -> TypeGuard[type[StandardDataclass]]:\n # The dataclasses.is_dataclass function doesn't seem to provide TypeGuard functionality,\n # so I created this convenience function\n return dataclasses.is_dataclass(_cls)\n\n\ndef origin_is_type_alias_type(origin: Any) -> TypeGuard[TypeAliasType]:\n return isinstance(origin, TypeAliasType)\n\n\nif sys.version_info >= (3, 10):\n\n def is_generic_alias(type_: type[Any]) -> bool:\n return isinstance(type_, (types.GenericAlias, typing._GenericAlias)) # type: ignore[attr-defined]\n\nelse:\n\n def is_generic_alias(type_: type[Any]) -> bool:\n return isinstance(type_, typing._GenericAlias) # 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/dataclasses.py_dataclass_dataclass.if_sys_version_info_3.else_.kwargs._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass_dataclass.if_sys_version_info_3.else_.kwargs._", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 147, "span_ids": ["dataclass"], "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": "@dataclass_transform(field_specifiers=(dataclasses.field, Field))\ndef dataclass( # noqa: C901\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 slots: bool = False,\n) -> Callable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/dataclasses/\n\n A decorator used to create a Pydantic-enhanced dataclass, similar to the standard Python `dataclass`,\n but with added validation.\n\n This function should be used similarly to `dataclasses.dataclass`.\n\n Args:\n _cls: The target `dataclass`.\n init: Included for signature compatibility with `dataclasses.dataclass`, and is passed through to\n `dataclasses.dataclass` when appropriate. If specified, must be set to `False`, as pydantic inserts its\n own `__init__` function.\n repr: A boolean indicating whether to include the field in the `__repr__` output.\n eq: Determines if a `__eq__` method should be generated for the class.\n order: Determines if comparison magic methods should be generated, such as `__lt__`, but not `__eq__`.\n unsafe_hash: Determines if a `__hash__` method should be included in the class, as in `dataclasses.dataclass`.\n frozen: Determines if the generated class should be a 'frozen' `dataclass`, which does not allow its\n attributes to be modified after it has been initialized.\n config: The Pydantic config to use for the `dataclass`.\n validate_on_init: A deprecated parameter included for backwards compatibility; in V2, all Pydantic dataclasses\n are validated on init.\n kw_only: Determines if `__init__` method parameters must be specified by keyword only. Defaults to `False`.\n slots: Determines if the generated class should be a 'slots' `dataclass`, which does not allow the addition of\n new attributes after instantiation.\n\n Returns:\n A decorator that accepts a class as its argument and returns a Pydantic `dataclass`.\n\n Raises:\n AssertionError: Raised if `init` is not `False` or `validate_on_init` is `False`.\n \"\"\"\n assert init is False, 'pydantic.dataclasses.dataclass only supports init=False'\n assert validate_on_init is not False, 'validate_on_init=False is no longer supported'\n\n if sys.version_info >= (3, 10):\n kwargs = dict(kw_only=kw_only, slots=slots)\n else:\n kwargs = {}\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/root_model.py_RootModel_RootModel._pyright_ignore_reportF": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/root_model.py_RootModel_RootModel._pyright_ignore_reportF", "embedding": null, "metadata": {"file_path": "pydantic/root_model.py", "file_name": "root_model.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 75, "span_ids": ["RootModel:10", "RootModel.__init__", "RootModel", "RootModel.__init_subclass__"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RootModel(BaseModel, typing.Generic[RootModelRootType], metaclass=_RootModelMetaclass):\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/models/#rootmodel-and-custom-root-types\n\n A Pydantic `BaseModel` for the root object of the model.\n\n Attributes:\n root: The root object of the model.\n __pydantic_root_model__: Whether the model is a RootModel.\n __pydantic_private__: Private fields in the model.\n __pydantic_extra__: Extra fields in the model.\n\n \"\"\"\n\n __pydantic_root_model__ = True\n __pydantic_private__ = None\n __pydantic_extra__ = None\n\n root: RootModelRootType\n\n def __init_subclass__(cls, **kwargs):\n extra = cls.model_config.get('extra')\n if extra is not None:\n raise PydanticUserError(\n \"`RootModel` does not support setting `model_config['extra']`\", code='root-model-extra'\n )\n super().__init_subclass__(**kwargs)\n\n def __init__(self, /, root: RootModelRootType = PydanticUndefined, **data) -> None: # type: ignore\n __tracebackhide__ = True\n if data:\n if root is not PydanticUndefined:\n raise ValueError(\n '\"RootModel.__init__\" accepts either a single positional argument or arbitrary keyword arguments'\n )\n root = data # type: ignore\n self.__pydantic_validator__.validate_python(root, self_instance=self)\n\n __init__.__pydantic_base_init__ = True # pyright: ignore[reportFunctionMemberAccess]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter_TypeAdapter.__init___1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter_TypeAdapter.__init___1._", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 150, "span_ids": ["TypeAdapter.__init___1", "TypeAdapter.__init__", "TypeAdapter"], "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": "@final\nclass TypeAdapter(Generic[T]):\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/type_adapter/\n\n Type adapters provide a flexible way to perform validation and serialization based on a Python type.\n\n A `TypeAdapter` instance exposes some of the functionality from `BaseModel` instance methods\n for types that do not have such methods (such as dataclasses, primitive types, and more).\n\n **Note:** `TypeAdapter` instances are not types, and cannot be used as type annotations for fields.\n\n Attributes:\n core_schema: The core schema for the type.\n validator (SchemaValidator): The schema validator for the type.\n serializer: The schema serializer for the type.\n \"\"\"\n\n @overload\n def __init__(\n self: TypeAdapter[T],\n type: type[T],\n *,\n config: ConfigDict | None = ...,\n _parent_depth: int = ...,\n module: str | None = ...,\n ) -> None:\n ...\n\n # This second overload is for unsupported special forms (such as Annotated, Union, etc.)\n # Currently there is no way to type this correctly\n # See https://github.com/python/typing/pull/1618\n @overload\n def __init__(\n self: TypeAdapter[Any],\n type: Any,\n *,\n config: ConfigDict | None = ...,\n _parent_depth: int = ...,\n module: str | None = ...,\n ) -> 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/type_adapter.py_TypeAdapter.__init___2_TypeAdapter.__init___2.self.serializer.serializer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/type_adapter.py_TypeAdapter.__init___2_TypeAdapter.__init___2.self.serializer.serializer", "embedding": null, "metadata": {"file_path": "pydantic/type_adapter.py", "file_name": "type_adapter.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 234, "span_ids": ["TypeAdapter.__init___2"], "tokens": 793}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@final\nclass TypeAdapter(Generic[T]):\n\n def __init__(\n self,\n type: Any,\n *,\n config: ConfigDict | None = None,\n _parent_depth: int = 2,\n module: str | None = None,\n ) -> None:\n \"\"\"Initializes the TypeAdapter object.\n\n Args:\n type: The type associated with the `TypeAdapter`.\n config: Configuration for the `TypeAdapter`, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].\n _parent_depth: depth at which to search the parent namespace to construct the local namespace.\n module: The module that passes to plugin if provided.\n\n !!! note\n You cannot use the `config` argument when instantiating a `TypeAdapter` if the type you're using has its own\n config that cannot be overridden (ex: `BaseModel`, `TypedDict`, and `dataclass`). A\n [`type-adapter-config-unused`](../errors/usage_errors.md#type-adapter-config-unused) error will be raised in this case.\n\n !!! note\n The `_parent_depth` argument is named with an underscore to suggest its private nature and discourage use.\n It may be deprecated in a minor version, so we only recommend using it if you're\n comfortable with potential change in behavior / support.\n\n ??? tip \"Compatibility with `mypy`\"\n Depending on the type used, `mypy` might raise an error when instantiating a `TypeAdapter`. As a workaround, you can explicitly\n annotate your variable:\n\n ```py\n from typing import Union\n\n from pydantic import TypeAdapter\n\n ta: TypeAdapter[Union[str, int]] = TypeAdapter(Union[str, int]) # type: ignore[arg-type]\n ```\n\n Returns:\n A type adapter configured for the specified `type`.\n \"\"\"\n type_is_annotated: bool = _typing_extra.is_annotated(type)\n annotated_type: Any = get_args(type)[0] if type_is_annotated else None\n type_has_config: bool = _type_has_config(annotated_type if type_is_annotated else type)\n\n if type_has_config and config is not None:\n raise PydanticUserError(\n 'Cannot use `config` when the type is a BaseModel, dataclass or TypedDict.'\n ' These types can have their own config and setting the config via the `config`'\n ' parameter to TypeAdapter will not override it, thus the `config` you passed to'\n ' TypeAdapter becomes meaningless, which is probably not what you want.',\n code='type-adapter-config-unused',\n )\n\n config_wrapper = _config.ConfigWrapper(config)\n\n core_schema: CoreSchema\n try:\n core_schema = _getattr_no_parents(type, '__pydantic_core_schema__')\n except AttributeError:\n core_schema = _get_schema(type, config_wrapper, parent_depth=_parent_depth + 1)\n\n core_config = config_wrapper.core_config(None)\n validator: SchemaValidator\n try:\n validator = _getattr_no_parents(type, '__pydantic_validator__')\n except AttributeError:\n if module is None:\n f = sys._getframe(1)\n module = cast(str, f.f_globals.get('__name__', ''))\n validator = create_schema_validator(\n core_schema, type, module, str(type), 'TypeAdapter', core_config, config_wrapper.plugin_settings\n ) # type: ignore\n\n serializer: SchemaSerializer\n try:\n serializer = _getattr_no_parents(type, '__pydantic_serializer__')\n except AttributeError:\n serializer = SchemaSerializer(core_schema, core_config)\n\n self.core_schema = core_schema\n self.validator = validator\n self.serializer = 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/warnings.py_PydanticDeprecationWarning.__str___PydanticDeprecationWarning.__str__.return.message": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py_PydanticDeprecationWarning.__str___PydanticDeprecationWarning.__str__.return.message", "embedding": null, "metadata": {"file_path": "pydantic/warnings.py", "file_name": "warnings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 40, "span_ids": ["PydanticDeprecationWarning.__str__"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticDeprecationWarning(DeprecationWarning):\n\n def __str__(self) -> str:\n message = (\n f'{self.message}. Deprecated in Pydantic V{self.since[0]}.{self.since[1]}'\n f' to be removed in V{self.expected_removal[0]}.{self.expected_removal[1]}.'\n )\n if self.since == (2, 0):\n message += f' See Pydantic V2 Migration Guide at https://errors.pydantic.dev/{version_short()}/migration/'\n return message", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py_PydanticDeprecatedSince20_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/warnings.py_PydanticDeprecatedSince20_", "embedding": null, "metadata": {"file_path": "pydantic/warnings.py", "file_name": "warnings.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 59, "span_ids": ["PydanticDeprecatedSince20", "PydanticDeprecatedSince26.__init__", "PydanticDeprecatedSince26", "GenericBeforeBaseModelWarning", "PydanticDeprecatedSince20.__init__"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticDeprecatedSince20(PydanticDeprecationWarning):\n \"\"\"A specific `PydanticDeprecationWarning` subclass defining functionality deprecated since Pydantic 2.0.\"\"\"\n\n def __init__(self, message: str, *args: object) -> None:\n super().__init__(message, *args, since=(2, 0), expected_removal=(3, 0))\n\n\nclass PydanticDeprecatedSince26(PydanticDeprecationWarning):\n \"\"\"A specific `PydanticDeprecationWarning` subclass defining functionality deprecated since Pydantic 2.6.\"\"\"\n\n def __init__(self, message: str, *args: object) -> None:\n super().__init__(message, *args, since=(2, 0), expected_removal=(3, 0))\n\n\nclass GenericBeforeBaseModelWarning(Warning):\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/mypy/outputs/1.1.1/mypy-default_ini/root_models.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-default_ini/root_models.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-default_ini/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "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": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n# MYPY: error: Missing type parameters for generic type \"RootModel\" [type-arg]\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-plugin_ini/root_models.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/mypy-plugin_ini/root_models.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/mypy-plugin_ini/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "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": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n# MYPY: error: Missing type parameters for generic type \"RootModel\" [type-arg]\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]\n# MYPY: error: Only `root` is allowed as a field of a `RootModel` [pydantic-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/mypy/outputs/1.1.1/pyproject-default_toml/root_models.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/root_models.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/pyproject-default_toml/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "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": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n# MYPY: error: Missing type parameters for generic type \"RootModel\" [type-arg]\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/root_models.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-default_ini/root_models.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-default_ini/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "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": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n# MYPY: error: Missing type parameters for generic type \"RootModel\" [type-arg]\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-default_toml/root_models.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-default_toml/root_models.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-default_toml/root_models.py", "file_name": "root_models.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl:3", "Pets1", "impl", "imports", "Pets4", "Pets3"], "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": "from typing import List\n\nfrom pydantic import RootModel\n\n\nclass Pets1(RootModel[List[str]]):\n pass\n\n\nPets2 = RootModel[List[str]]\n\n\nclass Pets3(RootModel):\n# MYPY: error: Missing type parameters for generic type \"RootModel\" [type-arg]\n root: List[str]\n\n\npets1 = Pets1(['dog', 'cat'])\npets2 = Pets2(['dog', 'cat'])\npets3 = Pets3(['dog', 'cat'])\n\n\nclass Pets4(RootModel[List[str]]):\n pets: List[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_repr_false_test_repr_false.assert_hidden_field_thi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_repr_false_test_repr_false.assert_hidden_field_thi", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1652, "end_line": 1661, "span_ids": ["test_repr_false"], "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": "@pytest.mark.parametrize('field_constructor', [pydantic.dataclasses.Field, dataclasses.field])\ndef test_repr_false(field_constructor: Callable):\n @pydantic.dataclasses.dataclass\n class A:\n visible_field: str\n hidden_field: str = field_constructor(repr=False)\n\n instance = A(visible_field='this_should_be_included', hidden_field='this_should_not_be_included')\n assert \"visible_field='this_should_be_included'\" in repr(instance)\n assert \"hidden_field='this_should_not_be_included'\" not in repr(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/tests/test_edge_cases.py_test_pep585_generic_types_test_pep585_generic_types.Model.f1": {"__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.Model.f1", "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": 299, "end_line": 327, "span_ids": ["test_pep585_generic_types"], "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.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)\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 # ... 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_pep585_generic_types.default_model_kwargs_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.default_model_kwargs_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": 329, "end_line": 388, "span_ids": ["test_pep585_generic_types"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@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)\ndef test_pep585_generic_types(dict_cls, frozenset_cls, list_cls, set_cls, tuple_cls, type_cls):\n # ... other code\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_fields.py_test_field_info_annotated_attribute_name_clashing_test_root_model_arbitrary_private_field_works.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_field_info_annotated_attribute_name_clashing_test_root_model_arbitrary_private_field_works.None_1", "embedding": null, "metadata": {"file_path": "tests/test_fields.py", "file_name": "test_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 20, "end_line": 65, "span_ids": ["test_init_var_field", "test_root_model_arbitrary_private_field_works", "test_field_info_annotated_attribute_name_clashing", "test_root_model_arbitrary_field_name_error"], "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_field_info_annotated_attribute_name_clashing():\n \"\"\"This tests that `FieldInfo.from_annotated_attribute` will raise a `PydanticUserError` if attribute names clashes\n with a type.\n \"\"\"\n\n with pytest.raises(PydanticUserError):\n\n class SubModel(BaseModel):\n a: int = 1\n\n class Model(BaseModel):\n SubModel: SubModel = Field()\n\n\ndef test_init_var_field():\n @pydantic.dataclasses.dataclass\n class Foo:\n bar: str\n baz: str = Field(init_var=True)\n\n class Model(BaseModel):\n foo: Foo\n\n model = Model(foo=Foo('bar', baz='baz'))\n assert 'bar' in model.foo.__pydantic_fields__\n assert 'baz' not in model.foo.__pydantic_fields__\n\n\ndef test_root_model_arbitrary_field_name_error():\n with pytest.raises(\n NameError, match=\"Unexpected field with name 'a_field'; only 'root' is allowed as a field of a `RootModel`\"\n ):\n\n class Model(RootModel[int]):\n a_field: str\n\n\ndef test_root_model_arbitrary_private_field_works():\n class Model(RootModel[int]):\n _a_field: str = 'value 1'\n\n m = Model(1)\n assert m._a_field == 'value 1'\n\n m._a_field = 'value 2'\n assert m._a_field == '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_forward_ref.py_test_recursive_models_union_backport_test_recursive_models_union_backport.assert_module_Bar_model_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_forward_ref.py_test_recursive_models_union_backport_test_recursive_models_union_backport.assert_module_Bar_model_f", "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": 743, "end_line": 768, "span_ids": ["test_recursive_models_union_backport"], "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_recursive_models_union_backport(create_module):\n module = create_module(\n # language=Python\n \"\"\"\nfrom __future__ import annotations\n\nfrom pydantic import BaseModel\nfrom typing import TypeVar, Generic\n\nT = TypeVar(\"T\")\n\nclass Foo(BaseModel):\n bar: Bar[str] | None = None\n # The `int | str` here differs from the previous test and requires the backport.\n # At the same time, `PydanticRecursiveRef.__or__` means that the second `|` works normally,\n # which actually triggered a bug in the backport that needed fixing.\n bar2: int | str | Bar[float]\n\nclass Bar(BaseModel, Generic[T]):\n foo: Foo\n\"\"\"\n )\n\n assert module.Foo.model_fields['bar'].annotation == typing.Optional[module.Bar[str]]\n assert module.Foo.model_fields['bar2'].annotation == typing.Union[int, str, module.Bar[float]]\n assert module.Bar.model_fields['foo'].annotation == module.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_byte_size_type_test_byte_size_type.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_byte_size_type_test_byte_size_type.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": 1311, "end_line": 1352, "span_ids": ["test_byte_size_type"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_byte_size_type():\n class Model(BaseModel):\n a: ByteSize\n b: ByteSize = Field('1MB', validate_default=True)\n\n model_json_schema_validation = Model.model_json_schema(mode='validation')\n model_json_schema_serialization = Model.model_json_schema(mode='serialization')\n\n print(model_json_schema_serialization)\n\n assert model_json_schema_validation == {\n 'properties': {\n 'a': {\n 'anyOf': [\n {'pattern': '^\\\\s*(\\\\d*\\\\.?\\\\d+)\\\\s*(\\\\w+)?', 'type': 'string'},\n {'minimum': 0, 'type': 'integer'},\n ],\n 'title': 'A',\n },\n 'b': {\n 'anyOf': [\n {'pattern': '^\\\\s*(\\\\d*\\\\.?\\\\d+)\\\\s*(\\\\w+)?', 'type': 'string'},\n {'minimum': 0, 'type': 'integer'},\n ],\n 'default': '1MB',\n 'title': 'B',\n },\n },\n 'required': ['a'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n assert model_json_schema_serialization == {\n 'properties': {\n 'a': {'minimum': 0, 'title': 'A', 'type': 'integer'},\n 'b': {'default': '1MB', 'minimum': 0, 'title': 'B', 'type': 'integer'},\n },\n 'required': ['a'],\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_main.py_test_new_union_origin_test_new_union_origin.assert_Model_model_json_s": {"__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.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 1887, "end_line": 1901, "span_ids": ["test_new_union_origin"], "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_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_shadow_attribute_test_shadow_attribute.assert_getattr_Three_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_shadow_attribute_test_shadow_attribute.assert_getattr_Three_fo", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 3095, "end_line": 3127, "span_ids": ["test_shadow_attribute"], "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_shadow_attribute() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/7108\"\"\"\n\n class Model(BaseModel):\n foo: str\n\n @classmethod\n def __pydantic_init_subclass__(cls, **kwargs: Any):\n super().__pydantic_init_subclass__(**kwargs)\n for key in cls.model_fields.keys():\n setattr(cls, key, getattr(cls, key, '') + ' edited!')\n\n class One(Model):\n foo: str = 'abc'\n\n with pytest.warns(UserWarning, match=r'\"foo\" shadows an attribute in parent \".*One\"'):\n\n class Two(One):\n foo: str\n\n with pytest.warns(UserWarning, match=r'\"foo\" shadows an attribute in parent \".*One\"'):\n\n class Three(One):\n foo: str = 'xyz'\n\n # unlike dataclasses BaseModel does not preserve the value of defaults\n # so when we access the attribute in `Model.__pydantic_init_subclass__` there is no default\n # and hence we append `edited!` to an empty string\n # we've talked about changing this but this is the current behavior as of this test\n assert getattr(Model, 'foo', None) is None\n assert getattr(One, 'foo', None) == ' edited!'\n assert getattr(Two, 'foo', None) == ' edited! edited!'\n assert getattr(Three, 'foo', None) == ' edited! edited!'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_eval_type_backport_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_main.py_test_eval_type_backport_", "embedding": null, "metadata": {"file_path": "tests/test_main.py", "file_name": "test_main.py", "file_type": "text/x-python", "category": "test", "start_line": 3130, "end_line": 3164, "span_ids": ["test_eval_type_backport"], "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_eval_type_backport():\n class Model(BaseModel):\n foo: 'list[int | str]'\n\n assert Model(foo=[1, '2']).model_dump() == {'foo': [1, '2']}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(foo='not a list')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'list_type',\n 'loc': ('foo',),\n 'msg': 'Input should be a valid list',\n 'input': 'not a list',\n }\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(foo=[{'not a str or int'}])\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_type',\n 'loc': ('foo', 0, 'int'),\n 'msg': 'Input should be a valid integer',\n 'input': {'not a str or int'},\n },\n {\n 'type': 'string_type',\n 'loc': ('foo', 0, 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'not a str or int'},\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_type_adapter.py_test_ta_config_with_annotated_type_test_ta_config_with_annotated_type.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_ta_config_with_annotated_type_test_ta_config_with_annotated_type.None_6", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 323, "end_line": 345, "span_ids": ["test_ta_config_with_annotated_type"], "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_ta_config_with_annotated_type() -> None:\n class TestValidator(BaseModel):\n x: str\n\n model_config = ConfigDict(str_to_lower=True)\n\n assert TestValidator(x='ABC').x == 'abc'\n assert TypeAdapter(TestValidator).validate_python({'x': 'ABC'}).x == 'abc'\n assert TypeAdapter(Annotated[TestValidator, ...]).validate_python({'x': 'ABC'}).x == 'abc'\n\n class TestSerializer(BaseModel):\n some_bytes: bytes\n model_config = ConfigDict(ser_json_bytes='base64')\n\n result = TestSerializer(some_bytes=b'\\xaa')\n assert result.model_dump(mode='json') == {'some_bytes': 'qg=='}\n assert TypeAdapter(TestSerializer).dump_python(result, mode='json') == {'some_bytes': 'qg=='}\n\n # cases where SchemaSerializer is constructed within TypeAdapter's __init__\n assert TypeAdapter(Annotated[TestSerializer, ...]).dump_python(result, mode='json') == {'some_bytes': 'qg=='}\n assert TypeAdapter(Annotated[List[TestSerializer], ...]).dump_python([result], mode='json') == [\n {'some_bytes': 'qg=='}\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_eval_type_backport_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_adapter.py_test_eval_type_backport_", "embedding": null, "metadata": {"file_path": "tests/test_type_adapter.py", "file_name": "test_type_adapter.py", "file_type": "text/x-python", "category": "test", "start_line": 348, "end_line": 374, "span_ids": ["test_eval_type_backport"], "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": "def test_eval_type_backport():\n v = TypeAdapter('list[int | str]').validate_python\n assert v([1, '2']) == [1, '2']\n with pytest.raises(ValidationError) as exc_info:\n v([{'not a str or int'}])\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_type',\n 'loc': (0, 'int'),\n 'msg': 'Input should be a valid integer',\n 'input': {'not a str or int'},\n },\n {\n 'type': 'string_type',\n 'loc': (0, 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'not a str or int'},\n },\n ]\n with pytest.raises(ValidationError) as exc_info:\n v('not a list')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'list_type', 'loc': (), 'msg': 'Input should be a valid list', 'input': 'not a list'}\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_non_specified_generic_type_alias_type_test_redefined_type_alias.assert_MyOuterModel_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_non_specified_generic_type_alias_type_test_redefined_type_alias.assert_MyOuterModel_model", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 351, "end_line": 368, "span_ids": ["test_non_specified_generic_type_alias_type", "test_redefined_type_alias"], "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_non_specified_generic_type_alias_type() -> None:\n assert TypeAdapter(MyList).json_schema() == {'items': {}, 'type': 'array'}\n\n\ndef test_redefined_type_alias():\n MyType = TypeAliasType('MyType', str)\n\n class MyInnerModel(BaseModel):\n x: MyType\n\n MyType = TypeAliasType('MyType', int)\n\n class MyOuterModel(BaseModel):\n inner: MyInnerModel\n y: MyType\n\n data = {'inner': {'x': 'hello'}, 'y': 1}\n assert MyOuterModel.model_validate(data).model_dump() == 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_type_alias_type.py_test_type_alias_to_type_with_ref_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_alias_type.py_test_type_alias_to_type_with_ref_", "embedding": null, "metadata": {"file_path": "tests/test_type_alias_type.py", "file_name": "test_type_alias_type.py", "file_type": "text/x-python", "category": "test", "start_line": 371, "end_line": 391, "span_ids": ["test_type_alias_to_type_with_ref"], "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_type_alias_to_type_with_ref():\n class Div(BaseModel):\n type: Literal['Div'] = 'Div'\n components: List['AnyComponent']\n\n AnyComponent = TypeAliasType('AnyComponent', Div)\n\n adapter = TypeAdapter(AnyComponent)\n adapter.validate_python({'type': 'Div', 'components': [{'type': 'Div', 'components': []}]})\n with pytest.raises(ValidationError) as exc_info:\n adapter.validate_python({'type': 'Div', 'components': [{'type': 'NotDiv', 'components': []}]})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'expected': \"'Div'\"},\n 'input': 'NotDiv',\n 'loc': ('components', 0, 'type'),\n 'msg': \"Input should be 'Div'\",\n 'type': 'literal_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_types.py_test_strict_datetime_test_int_enum_successful_for_str_int.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_test_strict_datetime_test_int_enum_successful_for_str_int.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": 1131, "end_line": 1579, "span_ids": ["BoolCastable", "test_datetime_errors", "test_strict_timedelta", "test_int_enum_successful_for_str_int", "test_enum_fails_error_msg", "test_string_too_long", "test_strict_time", "test_strict_datetime", "check_model_fixture", "test_string_too_short", "cooking_model", "str_model_fixture", "BoolCastable.__bool__", "test_datetime_successful", "test_enum_successful", "datetime_model_fixture", "test_enum_fails"], "tokens": 2119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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(include_url=False) == [\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(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False) == [\n {\n 'type': 'time_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid time',\n 'input': '10:10:10',\n }\n ]\n\n\ndef 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(include_url=False) == [\n {\n 'type': 'time_delta_type',\n 'loc': ('v',),\n 'msg': 'Input should be a valid timedelta',\n 'input': '1 days',\n }\n ]\n\n\n@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\n\n\nclass 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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\n\n\ndef 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)\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'datetime_from_date_parsing',\n 'loc': ('dt',),\n 'msg': 'Input should be a valid datetime or date, 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 ]\n\n\n@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) == ''\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'expected': '1 or 2'},\n 'input': 3,\n 'loc': ('tool',),\n 'msg': 'Input should be 1 or 2',\n 'type': 'enum',\n }\n ]\n\n\ndef test_enum_fails_error_msg():\n class Number(IntEnum):\n one = 1\n two = 2\n three = 3\n\n class Model(BaseModel):\n num: Number\n\n with pytest.raises(ValueError) as exc_info:\n Model(num=4)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'enum',\n 'loc': ('num',),\n 'msg': 'Input should be 1, 2 or 3',\n 'input': 4,\n 'ctx': {'expected': '1, 2 or 3'},\n }\n ]\n\n\ndef 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) == ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_plain_enum_validate_test_string_success.assert_m_str_gt_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_plain_enum_validate_test_string_success.assert_m_str_gt_b_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 1582, "end_line": 1812, "span_ids": ["test_int_enum_type", "test_string_success", "test_enum_with_no_cases", "test_invalid_decimal_constraint", "test_strict_enum", "test_plain_enum_validate", "test_enum_type", "test_enum_from_json", "test_invalid_schema_constraints", "test_plain_enum_validate_json"], "tokens": 1767}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_enum_validate():\n class MyEnum(Enum):\n a = 1\n\n class Model(BaseModel):\n x: MyEnum\n\n m = Model(x=MyEnum.a)\n assert m.x is MyEnum.a\n\n assert TypeAdapter(MyEnum).validate_python(1) is MyEnum.a\n with pytest.raises(ValidationError) as exc_info:\n TypeAdapter(MyEnum).validate_python(1, strict=True)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'test_plain_enum_validate..MyEnum'},\n 'input': 1,\n 'loc': (),\n 'msg': IsStr(regex='Input should be an instance of test_plain_enum_validate..MyEnum'),\n 'type': 'is_instance_of',\n }\n ]\n\n assert TypeAdapter(MyEnum).validate_json('1') is MyEnum.a\n TypeAdapter(MyEnum).validate_json('1', strict=True)\n with pytest.raises(ValidationError) as exc_info:\n TypeAdapter(MyEnum).validate_json('\"1\"', strict=True)\n assert exc_info.value.errors(include_url=False) == [\n {'ctx': {'expected': '1'}, 'input': '1', 'loc': (), 'msg': 'Input should be 1', 'type': 'enum'}\n ]\n\n\ndef test_plain_enum_validate_json():\n class MyEnum(Enum):\n a = 1\n\n class Model(BaseModel):\n x: MyEnum\n\n m = Model.model_validate_json('{\"x\":1}')\n assert m.x is MyEnum.a\n\n\ndef test_enum_type():\n class Model(BaseModel):\n my_enum: Enum\n\n class MyEnum(Enum):\n a = 1\n\n m = Model(my_enum=MyEnum.a)\n assert m.my_enum == MyEnum.a\n assert m.model_dump() == {'my_enum': MyEnum.a}\n assert m.model_dump_json() == '{\"my_enum\":1}'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(my_enum=1)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'Enum'},\n 'input': 1,\n 'loc': ('my_enum',),\n 'msg': 'Input should be an instance of Enum',\n 'type': 'is_instance_of',\n }\n ]\n\n\ndef test_int_enum_type():\n class Model(BaseModel):\n my_enum: IntEnum\n\n class MyEnum(Enum):\n a = 1\n\n class MyIntEnum(IntEnum):\n b = 2\n\n m = Model(my_enum=MyIntEnum.b)\n assert m.my_enum == MyIntEnum.b\n assert m.model_dump() == {'my_enum': MyIntEnum.b}\n assert m.model_dump_json() == '{\"my_enum\":2}'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(my_enum=MyEnum.a)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'IntEnum'},\n 'input': MyEnum.a,\n 'loc': ('my_enum',),\n 'msg': 'Input should be an instance of IntEnum',\n 'type': 'is_instance_of',\n }\n ]\n\n\n@pytest.mark.parametrize('enum_base,strict', [(Enum, False), (IntEnum, False), (IntEnum, True)])\ndef test_enum_from_json(enum_base, strict):\n class MyEnum(enum_base):\n a = 1\n b = 3\n\n class Model(BaseModel):\n my_enum: MyEnum\n\n m = Model.model_validate_json('{\"my_enum\":1}', strict=strict)\n assert m.my_enum is MyEnum.a\n\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate_json('{\"my_enum\":2}', strict=strict)\n\n MyEnum.__name__ if sys.version_info[:2] <= (3, 8) else MyEnum.__qualname__\n\n if strict:\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'expected': '1 or 3'},\n 'input': 2,\n 'loc': ('my_enum',),\n 'msg': 'Input should be 1 or 3',\n 'type': 'enum',\n }\n ]\n else:\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'expected': '1 or 3'},\n 'input': 2,\n 'loc': ('my_enum',),\n 'msg': 'Input should be 1 or 3',\n 'type': 'enum',\n }\n ]\n\n\ndef test_strict_enum() -> None:\n class Demo(Enum):\n A = 0\n B = 1\n\n class User(BaseModel):\n model_config = ConfigDict(strict=True)\n\n demo_strict: Demo\n demo_not_strict: Demo = Field(strict=False)\n\n user = User(demo_strict=Demo.A, demo_not_strict=1)\n\n assert isinstance(user.demo_strict, Demo)\n assert isinstance(user.demo_not_strict, Demo)\n assert user.demo_strict.value == 0\n assert user.demo_not_strict.value == 1\n\n with pytest.raises(ValidationError, match='Input should be an instance of test_strict_enum..Demo'):\n User(demo_strict=0, demo_not_strict=1)\n\n\ndef test_enum_with_no_cases() -> None:\n class MyEnum(Enum):\n pass\n\n class MyModel(BaseModel):\n e: MyEnum\n\n json_schema = MyModel.model_json_schema()\n assert json_schema['properties']['e']['enum'] == []\n\n\n@pytest.mark.parametrize(\n 'kwargs,type_',\n [\n pytest.param(\n {'pattern': '^foo$'},\n int,\n marks=pytest.mark.xfail(\n reason='int cannot be used with pattern but we do not currently validate that at schema build time'\n ),\n ),\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 match = (\n r'(:?Invalid Schema:\\n.*\\n Extra inputs are not permitted)|(:?The following constraints cannot be applied to)'\n )\n with pytest.raises((SchemaError, TypeError), match=match):\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(\n TypeError, match=\"The following constraints cannot be applied to : 'max_length'\"\n ):\n\n class Foo(BaseModel):\n a: Decimal = Field('foo', title='A title', description='A description', max_length=5)\n\n\n@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 str_gt: Annotated[str, annotated_types.Gt('a')]\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 str_gt='b',\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'\n assert m.str_gt == '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_types_namedtuple.py_test_recursive_generic_namedtuple_test_namedtuple_defaults.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_recursive_generic_namedtuple_test_namedtuple_defaults.None_1", "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": 181, "end_line": 210, "span_ids": ["test_recursive_generic_namedtuple", "test_namedtuple_defaults"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_generic_namedtuple():\n # Need to use TypingExtensionsNamedTuple to make it work with Python <3.11\n T = TypeVar('T')\n\n class MyNamedTuple(TypingExtensionsNamedTuple, Generic[T]):\n x: T\n y: Optional['MyNamedTuple[T]']\n\n ta = TypeAdapter(MyNamedTuple[int])\n assert ta.validate_python({'x': 1, 'y': {'x': 2, 'y': None}}) == (1, (2, None))\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python({'x': 1, 'y': {'x': 2, 'y': {'x': 'a', 'y': None}}})\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'a',\n 'loc': ('y', 'y', 'x'),\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_namedtuple_defaults():\n class NT(NamedTuple):\n x: int\n y: int = 33\n\n assert TypeAdapter(NT).validate_python([1]) == (1, 33)\n assert TypeAdapter(NT).validate_python({'x': 22}) == (22, 33)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_eval_type_backport_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types_namedtuple.py_test_eval_type_backport_", "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": 213, "end_line": 250, "span_ids": ["test_eval_type_backport"], "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_eval_type_backport():\n class MyNamedTuple(NamedTuple):\n foo: 'list[int | str]'\n\n class Model(BaseModel):\n t: MyNamedTuple\n\n assert Model(t=([1, '2'],)).model_dump() == {'t': ([1, '2'],)}\n\n with pytest.raises(ValidationError) as exc_info:\n Model(t=('not a list',))\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'list_type',\n 'loc': ('t', 0),\n 'msg': 'Input should be a valid list',\n 'input': 'not a list',\n }\n ]\n with pytest.raises(ValidationError) as exc_info:\n Model(t=([{'not a str or int'}],))\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_type',\n 'loc': ('t', 0, 0, 'int'),\n 'msg': 'Input should be a valid integer',\n 'input': {'not a str or int'},\n },\n {\n 'type': 'string_type',\n 'loc': ('t', 0, 0, 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'not a str or int'},\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_sys_test_get_function_type_hints_none_type.assert_get_function_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_typing.py_sys_test_get_function_type_hints_none_type.assert_get_function_type_", "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": 119, "span_ids": ["test_parent_frame_namespace", "imports", "test_is_none_type", "test_get_function_type_hints_none_type", "test_is_literal_with_typing_literal", "test_is_namedtuple", "test_is_classvar", "test_is_literal_with_typing_extension_literal", "test_is_union"], "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": "import sys\nimport typing\nfrom collections import namedtuple\nfrom typing import Callable, ClassVar, ForwardRef, NamedTuple\n\nimport pytest\nfrom typing_extensions import Literal, get_origin\n\nfrom pydantic import BaseModel, Field # noqa: F401\nfrom pydantic._internal._typing_extra import (\n NoneType,\n eval_type_lenient,\n get_function_type_hints,\n is_classvar,\n is_literal_type,\n is_namedtuple,\n is_none_type,\n origin_is_union,\n parent_frame_namespace,\n)\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\nALL_TYPEDDICT_KINDS = (typing_TypedDict, typing_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(\n 'union',\n [\n typing.Union[int, str],\n eval_type_lenient('int | str'),\n *([int | str] if sys.version_info >= (3, 10) else []),\n ],\n)\ndef test_is_union(union):\n origin = get_origin(union)\n assert origin_is_union(origin)\n\n\ndef test_is_literal_with_typing_extension_literal():\n from typing_extensions import Literal\n\n assert is_literal_type(Literal) is False\n assert is_literal_type(Literal['foo']) is True\n\n\ndef test_is_literal_with_typing_literal():\n from typing import Literal\n\n assert is_literal_type(Literal) is False\n assert is_literal_type(Literal['foo']) is True\n\n\n@pytest.mark.parametrize(\n 'ann_type,extepcted',\n (\n (None, False),\n (ForwardRef('ClassVar[int]'), True),\n (ClassVar[int], True),\n ),\n)\ndef test_is_classvar(ann_type, extepcted):\n assert is_classvar(ann_type) is extepcted\n\n\ndef test_parent_frame_namespace(mocker):\n assert parent_frame_namespace() is not None\n\n from dataclasses import dataclass\n\n @dataclass\n class MockedFrame:\n f_back = None\n\n mocker.patch('sys._getframe', return_value=MockedFrame())\n assert parent_frame_namespace() is None\n\n\ndef test_get_function_type_hints_none_type():\n def f(x: int, y: None) -> int:\n return x\n\n assert get_function_type_hints(f) == {'return': int, 'x': int, 'y': 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/tests/test_typing.py_test_eval_type_backport_not_installed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_typing.py_test_eval_type_backport_not_installed_", "embedding": null, "metadata": {"file_path": "tests/test_typing.py", "file_name": "test_typing.py", "file_type": "text/x-python", "category": "test", "start_line": 122, "end_line": 140, "span_ids": ["test_eval_type_backport_not_installed"], "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.skipif(sys.version_info[:2] > (3, 9), reason='testing using a feature not supported by older Python')\ndef test_eval_type_backport_not_installed():\n sys.modules['eval_type_backport'] = None\n try:\n with pytest.raises(TypeError) as exc_info:\n\n class _Model(BaseModel):\n foo: 'int | str'\n\n assert str(exc_info.value) == (\n \"You have a type annotation 'int | str' which makes use of newer typing \"\n 'features than are supported in your version of Python. To handle this error, '\n 'you should either remove the use of new syntax or install the '\n '`eval_type_backport` package.'\n )\n\n finally:\n del sys.modules['eval_type_backport']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_handle_tuple_schema_test_handle_tuple_schema.assert_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_utils.py_test_handle_tuple_schema_test_handle_tuple_schema.assert_schema_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 546, "end_line": 559, "span_ids": ["test_handle_tuple_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": "def test_handle_tuple_schema():\n schema = core_schema.tuple_schema([core_schema.float_schema(), core_schema.int_schema()])\n\n def walk(s, recurse):\n # change extra_schema['type'] to 'str'\n if s['type'] == 'float':\n s['type'] = 'str'\n return s\n\n schema = _WalkCoreSchema().handle_tuple_schema(schema, walk)\n assert schema == {\n 'items_schema': [{'type': 'str'}, {'type': 'int'}],\n 'type': 'tuple',\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_asyncio_test_args.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_asyncio_test_args.None_9", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 64, "span_ids": ["imports", "test_args"], "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": "import asyncio\nimport inspect\nimport re\nfrom datetime import datetime, timezone\nfrom functools import partial\nfrom typing import Any, List, Tuple\n\nimport pytest\nfrom pydantic_core import ArgsKwargs\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import Field, PydanticInvalidForJsonSchema, TypeAdapter, ValidationError, validate_call\nfrom pydantic.main import BaseModel\n\n\ndef test_args():\n @validate_call\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 assert foo(a=1, b=2) == '1, 2'\n assert foo(1, b=2) == '1, 2'\n assert foo(b=2, a=1) == '1, 2'\n\n with pytest.raises(ValidationError) as exc_info:\n foo()\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing_argument', 'loc': ('a',), 'msg': 'Missing required argument', 'input': ArgsKwargs(())},\n {'type': 'missing_argument', 'loc': ('b',), 'msg': 'Missing required argument', 'input': ArgsKwargs(())},\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n foo(1, 'x')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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': 'x',\n }\n ]\n\n with pytest.raises(ValidationError, match=r'2\\s+Unexpected positional argument'):\n foo(1, 2, 3)\n\n with pytest.raises(ValidationError, match=r'apple\\s+Unexpected keyword argument'):\n foo(1, 2, apple=3)\n\n with pytest.raises(ValidationError, match=r'a\\s+Got multiple values for argument'):\n foo(1, 2, a=3)\n\n with pytest.raises(ValidationError) as exc_info:\n foo(1, 2, a=3, b=4)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'multiple_argument_values', 'loc': ('a',), 'msg': 'Got multiple values for argument', 'input': 3},\n {'type': 'multiple_argument_values', 'loc': ('b',), 'msg': 'Got multiple values for argument', 'input': 4},\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_validate_call_with_slots_test_validate_call_with_slots.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_validate_call_with_slots_test_validate_call_with_slots.None_5", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 730, "end_line": 756, "span_ids": ["test_validate_call_with_slots"], "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_validate_call_with_slots() -> None:\n class ClassWithSlots:\n __slots__ = {}\n\n @validate_call(validate_return=True)\n def some_instance_method(self, x: str) -> str:\n return x\n\n @classmethod\n @validate_call(validate_return=True)\n def some_class_method(cls, x: str) -> str:\n return x\n\n @staticmethod\n @validate_call(validate_return=True)\n def some_static_method(x: str) -> str:\n return x\n\n c = ClassWithSlots()\n assert c.some_instance_method(x='potato') == 'potato'\n assert c.some_class_method(x='pepper') == 'pepper'\n assert c.some_static_method(x='onion') == 'onion'\n\n # verify that equality still holds for instance methods\n assert c.some_instance_method == c.some_instance_method\n assert c.some_class_method == c.some_class_method\n assert c.some_static_method == c.some_static_method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_eval_type_backport_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validate_call.py_test_eval_type_backport_", "embedding": null, "metadata": {"file_path": "tests/test_validate_call.py", "file_name": "test_validate_call.py", "file_type": "text/x-python", "category": "test", "start_line": 759, "end_line": 793, "span_ids": ["test_eval_type_backport"], "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_eval_type_backport():\n @validate_call\n def foo(bar: 'list[int | str]') -> 'list[int | str]':\n return bar\n\n assert foo([1, '2']) == [1, '2']\n with pytest.raises(ValidationError) as exc_info:\n foo('not a list') # type: ignore\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'list_type',\n 'loc': (0,),\n 'msg': 'Input should be a valid list',\n 'input': 'not a list',\n }\n ]\n with pytest.raises(ValidationError) as exc_info:\n foo([{'not a str or int'}]) # type: ignore\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'int_type',\n 'loc': (0, 0, 'int'),\n 'msg': 'Input should be a valid integer',\n 'input': {'not a str or int'},\n },\n {\n 'type': 'string_type',\n 'loc': (0, 0, 'str'),\n 'msg': 'Input should be a valid string',\n 'input': {'not a str or int'},\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/_signature.py_from___future___import_an__field_name_for_signature.return._alias_if_valid_field_inf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py_from___future___import_an__field_name_for_signature.return._alias_if_valid_field_inf", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_signature.py", "file_name": "_signature.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["imports", "_field_name_for_signature"], "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": "from __future__ import annotations\n\nimport dataclasses\nfrom inspect import Parameter, Signature, signature\nfrom typing import TYPE_CHECKING, Any, Callable\n\nfrom pydantic_core import PydanticUndefined\n\nfrom ._config import ConfigWrapper\nfrom ._utils import is_valid_identifier\n\nif TYPE_CHECKING:\n from ..fields import FieldInfo\n\n\ndef _field_name_for_signature(field_name: str, field_info: FieldInfo) -> str:\n \"\"\"Extract the correct name to use for the field when generating a signature.\n\n Assuming the field has a valid alias, this will return the alias. Otherwise, it will return the field name.\n First priority is given to the validation_alias, then the alias, then the field name.\n\n Args:\n field_name: The name of the field\n field_info: The corresponding FieldInfo object.\n\n Returns:\n The correct name to use when generating a signature.\n \"\"\"\n\n def _alias_if_valid(x: Any) -> str | None:\n \"\"\"Return the alias if it is a valid alias and identifier, else None.\"\"\"\n return x if isinstance(x, str) and is_valid_identifier(x) else None\n\n return _alias_if_valid(field_info.alias) or _alias_if_valid(field_info.validation_alias) or field_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/_internal/_signature.py__process_param_defaults__process_param_defaults.return.param": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py__process_param_defaults__process_param_defaults.return.param", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_signature.py", "file_name": "_signature.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 68, "span_ids": ["_process_param_defaults"], "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 _process_param_defaults(param: Parameter) -> Parameter:\n \"\"\"Modify the signature for a parameter in a dataclass where the default value is a FieldInfo instance.\n\n Args:\n param (Parameter): The parameter\n\n Returns:\n Parameter: The custom processed parameter\n \"\"\"\n from ..fields import FieldInfo\n\n param_default = param.default\n if isinstance(param_default, FieldInfo):\n annotation = param.annotation\n # Replace the annotation if appropriate\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 annotation == 'Any':\n annotation = Any\n\n # Replace the field default\n default = param_default.default\n if default is PydanticUndefined:\n if param_default.default_factory is PydanticUndefined:\n default = Signature.empty\n else:\n # this is used by dataclasses to indicate a factory exists:\n default = dataclasses._HAS_DEFAULT_FACTORY # type: ignore\n return param.replace(\n annotation=annotation, name=_field_name_for_signature(param.name, param_default), default=default\n )\n return 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/_signature.py__generate_signature_parameters__generate_signature_parameters.return.merged_params": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py__generate_signature_parameters__generate_signature_parameters.return.merged_params", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_signature.py", "file_name": "_signature.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 142, "span_ids": ["_generate_signature_parameters"], "tokens": 632}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_signature_parameters( # noqa: C901 (ignore complexity, could use a refactor)\n init: Callable[..., None],\n fields: dict[str, FieldInfo],\n config_wrapper: ConfigWrapper,\n) -> dict[str, Parameter]:\n \"\"\"Generate a mapping of parameter names to Parameter objects for a pydantic BaseModel or dataclass.\"\"\"\n from itertools import islice\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 fields.get(param.name):\n # exclude params with init=False\n if getattr(fields[param.name], 'init', True) is False:\n continue\n param = param.replace(name=_field_name_for_signature(param.name, fields[param.name]))\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_wrapper.populate_by_name\n for field_name, field in fields.items():\n # when alias is a str it should be used for signature generation\n param_name = _field_name_for_signature(field_name, field)\n\n if field_name in merged_params or param_name in merged_params:\n continue\n\n if not is_valid_identifier(param_name):\n if allow_names:\n param_name = field_name\n else:\n use_var_kw = True\n continue\n\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_wrapper.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 ('self', Parameter.POSITIONAL_ONLY),\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 merged_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/_signature.py_generate_pydantic_signature_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_signature.py_generate_pydantic_signature_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_signature.py", "file_name": "_signature.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 165, "span_ids": ["generate_pydantic_signature"], "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 generate_pydantic_signature(\n init: Callable[..., None], fields: dict[str, FieldInfo], config_wrapper: ConfigWrapper, is_dataclass: bool = False\n) -> Signature:\n \"\"\"Generate signature for a pydantic BaseModel or dataclass.\n\n Args:\n init: The class init.\n fields: The model fields.\n config_wrapper: The config wrapper instance.\n is_dataclass: Whether the model is a dataclass.\n\n Returns:\n The dataclass/BaseModel subclass signature.\n \"\"\"\n merged_params = _generate_signature_parameters(init, fields, config_wrapper)\n\n if is_dataclass:\n merged_params = {k: _process_param_defaults(v) for k, v in merged_params.items()}\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/fields.py_FieldInfo_FieldInfo._None_has_a_special_mean": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo_FieldInfo._None_has_a_special_mean", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 172, "span_ids": ["FieldInfo"], "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": "class FieldInfo(_repr.Representation):\n \"\"\"This class holds information about a field.\n\n `FieldInfo` is used for any field definition regardless of whether the [`Field()`][pydantic.fields.Field]\n function is explicitly used.\n\n !!! warning\n You generally shouldn't be creating `FieldInfo` directly, you'll only need to use it when accessing\n [`BaseModel`][pydantic.main.BaseModel] `.model_fields` internals.\n\n Attributes:\n annotation: The type annotation of the field.\n default: The default value of the field.\n default_factory: The factory function used to construct the default for the field.\n alias: The alias name of the field.\n alias_priority: The priority of the field's alias.\n validation_alias: The validation alias of the field.\n serialization_alias: The serialization alias of the field.\n title: The title of the field.\n description: The description of the field.\n examples: List of examples of the field.\n exclude: Whether to exclude the field from the model serialization.\n discriminator: Field name or Discriminator for discriminating the type in a tagged union.\n deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,\n or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.\n json_schema_extra: A dict or callable to provide extra JSON schema properties.\n frozen: Whether the field is frozen.\n validate_default: Whether to validate the default value of the field.\n repr: Whether to include the field in representation of the model.\n init: Whether the field should be included in the constructor of the dataclass.\n init_var: Whether the field should _only_ be included in the constructor of the dataclass, and not stored.\n kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.\n metadata: List of metadata constraints.\n \"\"\"\n\n annotation: type[Any] | None\n default: Any\n default_factory: typing.Callable[[], Any] | None\n alias: str | None\n alias_priority: int | None\n validation_alias: str | AliasPath | AliasChoices | None\n serialization_alias: str | None\n title: str | None\n description: str | None\n examples: list[Any] | None\n exclude: bool | None\n discriminator: str | types.Discriminator | None\n deprecated: Deprecated | str | bool | None\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None\n frozen: bool | None\n validate_default: bool | None\n repr: bool\n init: bool | None\n init_var: bool | None\n kw_only: bool | None\n metadata: list[Any]\n\n __slots__ = (\n 'annotation',\n 'default',\n 'default_factory',\n 'alias',\n 'alias_priority',\n 'validation_alias',\n 'serialization_alias',\n 'title',\n 'description',\n 'examples',\n 'exclude',\n 'discriminator',\n 'deprecated',\n 'json_schema_extra',\n 'frozen',\n 'validate_default',\n 'repr',\n 'init',\n 'init_var',\n 'kw_only',\n 'metadata',\n '_attributes_set',\n )\n\n # used to convert kwargs to metadata/constraints,\n # None has a special meaning - these items are collected into a `PydanticGeneralMetadata`", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._Check_deprecated_and_re_Field.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field._Check_deprecated_and_re_Field.None_6", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 758, "end_line": 785, "span_ids": ["Field"], "tokens": 760}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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( # noqa: C901\n default: Any = PydanticUndefined,\n *,\n default_factory: typing.Callable[[], Any] | None = _Unset,\n alias: str | None = _Unset,\n alias_priority: int | None = _Unset,\n validation_alias: str | AliasPath | AliasChoices | None = _Unset,\n serialization_alias: str | None = _Unset,\n title: str | None = _Unset,\n description: str | None = _Unset,\n examples: list[Any] | None = _Unset,\n exclude: bool | None = _Unset,\n discriminator: str | types.Discriminator | None = _Unset,\n deprecated: Deprecated | str | bool | None = _Unset,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = _Unset,\n frozen: bool | None = _Unset,\n validate_default: bool | None = _Unset,\n repr: bool = _Unset,\n init: bool | None = _Unset,\n init_var: bool | None = _Unset,\n kw_only: bool | None = _Unset,\n pattern: str | None = _Unset,\n strict: bool | None = _Unset,\n gt: float | None = _Unset,\n ge: float | None = _Unset,\n lt: float | None = _Unset,\n le: float | None = _Unset,\n multiple_of: float | None = _Unset,\n allow_inf_nan: bool | None = _Unset,\n max_digits: int | None = _Unset,\n decimal_places: int | None = _Unset,\n min_length: int | None = _Unset,\n max_length: int | None = _Unset,\n union_mode: Literal['smart', 'left_to_right'] = _Unset,\n **extra: Unpack[_EmptyKwargs],\n) -> Any:\n # Check deprecated and removed params from V1. This logic should eventually be removed.\n const = extra.pop('const', None) # type: ignore\n if const is not None:\n raise PydanticUserError('`const` is removed, use `Literal` instead', code='removed-kwargs')\n\n min_items = extra.pop('min_items', None) # type: ignore\n if min_items is not None:\n warn('`min_items` is deprecated and will be removed, use `min_length` instead', DeprecationWarning)\n if min_length in (None, _Unset):\n min_length = min_items # type: ignore\n\n max_items = extra.pop('max_items', None) # type: ignore\n if max_items is not None:\n warn('`max_items` is deprecated and will be removed, use `max_length` instead', DeprecationWarning)\n if max_length in (None, _Unset):\n max_length = max_items # type: ignore\n\n unique_items = extra.pop('unique_items', None) # type: ignore\n if unique_items is not None:\n raise PydanticUserError(\n (\n '`unique_items` is removed, use `Set` instead'\n '(this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296)'\n ),\n code='removed-kwargs',\n )\n\n allow_mutation = extra.pop('allow_mutation', None) # type: ignore\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.if_allow_mutation_is_not__Field.if_include_is_not_None_.warn_include_is_deprec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_Field.if_allow_mutation_is_not__Field.if_include_is_not_None_.warn_include_is_deprec", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 786, "end_line": 820, "span_ids": ["Field"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def Field( # noqa: C901\n default: Any = PydanticUndefined,\n *,\n default_factory: typing.Callable[[], Any] | None = _Unset,\n alias: str | None = _Unset,\n alias_priority: int | None = _Unset,\n validation_alias: str | AliasPath | AliasChoices | None = _Unset,\n serialization_alias: str | None = _Unset,\n title: str | None = _Unset,\n description: str | None = _Unset,\n examples: list[Any] | None = _Unset,\n exclude: bool | None = _Unset,\n discriminator: str | types.Discriminator | None = _Unset,\n deprecated: Deprecated | str | bool | None = _Unset,\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None = _Unset,\n frozen: bool | None = _Unset,\n validate_default: bool | None = _Unset,\n repr: bool = _Unset,\n init: bool | None = _Unset,\n init_var: bool | None = _Unset,\n kw_only: bool | None = _Unset,\n pattern: str | None = _Unset,\n strict: bool | None = _Unset,\n gt: float | None = _Unset,\n ge: float | None = _Unset,\n lt: float | None = _Unset,\n le: float | None = _Unset,\n multiple_of: float | None = _Unset,\n allow_inf_nan: bool | None = _Unset,\n max_digits: int | None = _Unset,\n decimal_places: int | None = _Unset,\n min_length: int | None = _Unset,\n max_length: int | None = _Unset,\n union_mode: Literal['smart', 'left_to_right'] = _Unset,\n **extra: Unpack[_EmptyKwargs],\n) -> Any:\n # ... other code\n if allow_mutation is not None:\n warn('`allow_mutation` is deprecated and will be removed. use `frozen` instead', DeprecationWarning)\n if allow_mutation is False:\n frozen = True\n\n regex = extra.pop('regex', None) # type: ignore\n if regex is not None:\n raise PydanticUserError('`regex` is removed. use `pattern` instead', code='removed-kwargs')\n\n if extra:\n warn(\n 'Using extra keyword arguments on `Field` is deprecated and will be removed.'\n ' Use `json_schema_extra` instead.'\n f' (Extra keys: {\", \".join(k.__repr__() for k in extra.keys())})',\n DeprecationWarning,\n )\n if not json_schema_extra or json_schema_extra is _Unset:\n json_schema_extra = extra # type: ignore\n\n if (\n validation_alias\n and validation_alias is not _Unset\n and not isinstance(validation_alias, (str, AliasChoices, AliasPath))\n ):\n raise TypeError('Invalid `validation_alias` type. it should be `str`, `AliasChoices`, or `AliasPath`')\n\n if serialization_alias in (_Unset, None) and isinstance(alias, str):\n serialization_alias = alias\n\n if validation_alias in (_Unset, None):\n validation_alias = alias\n\n include = extra.pop('include', None) # type: ignore\n if include is not None:\n warn('`include` is deprecated and does nothing. It will be removed, use `exclude` instead', DeprecationWarning)\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_inherited_dataclass_signature_test_alias_with_dashes.assert_obj_some_var_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_inherited_dataclass_signature_test_alias_with_dashes.assert_obj_some_var_s", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2511, "end_line": 2639, "span_ids": ["test_is_pydantic_dataclass", "test_can_inherit_stdlib_dataclasses_with_defaults", "test_can_inherit_stdlib_dataclasses_default_factories_and_provide_a_value", "test_inherited_dataclass_signature", "test_schema_generator", "test_can_inherit_stdlib_dataclasses_default_factories_and_use_them", "test_alias_with_dashes", "test_annotated_before_validator_called_once", "test_can_inherit_stdlib_dataclasses_with_dataclass_fields", "test_dataclasses_with_slots_and_default"], "tokens": 777}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_inherited_dataclass_signature():\n @pydantic.dataclasses.dataclass\n class A:\n a: int\n\n @pydantic.dataclasses.dataclass\n class B(A):\n b: int\n\n assert str(inspect.signature(A)) == '(a: int) -> None'\n assert str(inspect.signature(B)) == '(a: int, b: int) -> None'\n\n\ndef test_dataclasses_with_slots_and_default():\n @pydantic.dataclasses.dataclass(slots=True)\n class A:\n a: int = 0\n\n assert A().a == 0\n\n @pydantic.dataclasses.dataclass(slots=True)\n class B:\n b: int = Field(1)\n\n assert B().b == 1\n\n\ndef test_schema_generator() -> None:\n class LaxStrGenerator(GenerateSchema):\n def str_schema(self) -> CoreSchema:\n return core_schema.no_info_plain_validator_function(str)\n\n @pydantic.dataclasses.dataclass\n class Model:\n x: str\n __pydantic_config__ = ConfigDict(schema_generator=LaxStrGenerator)\n\n assert Model(x=1).x == '1'\n\n\n@pytest.mark.parametrize('decorator1', **dataclass_decorators())\ndef test_annotated_before_validator_called_once(decorator1):\n count = 0\n\n def convert(value: int) -> str:\n nonlocal count\n count += 1\n return str(value)\n\n IntToStr = Annotated[str, BeforeValidator(convert)]\n\n @decorator1\n class A:\n a: IntToStr\n\n assert count == 0\n TypeAdapter(A).validate_python({'a': 123})\n assert count == 1\n\n\ndef test_is_pydantic_dataclass():\n @pydantic.dataclasses.dataclass\n class PydanticDataclass:\n a: int\n\n @dataclasses.dataclass\n class StdLibDataclass:\n b: int\n\n assert is_pydantic_dataclass(PydanticDataclass) is True\n assert is_pydantic_dataclass(StdLibDataclass) is False\n\n\ndef test_can_inherit_stdlib_dataclasses_with_defaults():\n @dataclasses.dataclass\n class Base:\n a: None = None\n\n class Model(BaseModel, Base):\n pass\n\n assert Model().a is None\n\n\ndef test_can_inherit_stdlib_dataclasses_default_factories_and_use_them():\n \"\"\"This test documents that default factories are not supported\"\"\"\n\n @dataclasses.dataclass\n class Base:\n a: str = dataclasses.field(default_factory=lambda: 'TEST')\n\n class Model(BaseModel, Base):\n pass\n\n with pytest.raises(ValidationError):\n assert Model().a == 'TEST'\n\n\ndef test_can_inherit_stdlib_dataclasses_default_factories_and_provide_a_value():\n @dataclasses.dataclass\n class Base:\n a: str = dataclasses.field(default_factory=lambda: 'TEST')\n\n class Model(BaseModel, Base):\n pass\n\n assert Model(a='NOT_THE_SAME').a == 'NOT_THE_SAME'\n\n\ndef test_can_inherit_stdlib_dataclasses_with_dataclass_fields():\n @dataclasses.dataclass\n class Base:\n a: int = dataclasses.field(default=5)\n\n class Model(BaseModel, Base):\n pass\n\n assert Model().a == 5\n\n\ndef test_alias_with_dashes():\n \"\"\"Test for fix issue #7226.\"\"\"\n\n @pydantic.dataclasses.dataclass\n class Foo:\n some_var: str = Field(alias='some-var')\n\n obj = Foo(**{'some-var': 'some_value'})\n assert obj.some_var == 'some_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_dataclasses.py_test_validate_strings_test_init_false_not_in_signature.assert_b_in_signature_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_validate_strings_test_init_false_not_in_signature.assert_b_in_signature_p", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2642, "end_line": 2664, "span_ids": ["test_init_false_not_in_signature", "test_validate_strings"], "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_validate_strings():\n @pydantic.dataclasses.dataclass\n class Nested:\n d: date\n\n class Model(BaseModel):\n n: Nested\n\n assert Model.model_validate_strings({'n': {'d': '2017-01-01'}}).n.d == date(2017, 1, 1)\n\n\n@pytest.mark.parametrize('field_constructor', [dataclasses.field, pydantic.dataclasses.Field])\n@pytest.mark.parametrize('extra', ['ignore', 'forbid'])\ndef test_init_false_not_in_signature(extra, field_constructor):\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=extra))\n class MyDataclass:\n a: int = field_constructor(init=False, default=-1)\n b: int = pydantic.dataclasses.Field(default=2)\n\n signature = inspect.signature(MyDataclass)\n # `a` should not be in the __init__\n assert 'a' not in signature.parameters.keys()\n assert 'b' in signature.parameters.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_dataclasses.py_init_test_cases_init_test_cases._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_init_test_cases_init_test_cases._", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2667, "end_line": 2683, "span_ids": ["impl"], "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": "init_test_cases = [\n ({'a': 2, 'b': -1}, 'ignore', {'a': 2, 'b': 1}),\n ({'a': 2}, 'ignore', {'a': 2, 'b': 1}),\n (\n {'a': 2, 'b': -1},\n 'forbid',\n [\n {\n 'type': 'unexpected_keyword_argument',\n 'loc': ('b',),\n 'msg': 'Unexpected keyword argument',\n 'input': -1,\n }\n ],\n ),\n ({'a': 2}, 'forbid', {'a': 2, 'b': 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_dataclasses.py_test_init_false_with_post_init_test_init_false_with_post_init.if_isinstance_expected_l.else_.assert_dataclasses_asdict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_false_with_post_init_test_init_false_with_post_init.if_isinstance_expected_l.else_.assert_dataclasses_asdict", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2686, "end_line": 2706, "span_ids": ["test_init_false_with_post_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": "@pytest.mark.parametrize('field_constructor', [dataclasses.field, pydantic.dataclasses.Field])\n@pytest.mark.parametrize(\n 'input_data,extra,expected',\n init_test_cases,\n)\ndef test_init_false_with_post_init(input_data, extra, expected, field_constructor):\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=extra))\n class MyDataclass:\n a: int\n b: int = field_constructor(init=False)\n\n def __post_init__(self):\n self.b = 1\n\n if isinstance(expected, list):\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(**input_data)\n\n assert exc_info.value.errors(include_url=False) == expected\n else:\n assert dataclasses.asdict(MyDataclass(**input_data)) == 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_dataclasses.py_test_init_false_with_default_test_init_false_with_default.if_isinstance_expected_l.else_.assert_dataclasses_asdict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_init_false_with_default_test_init_false_with_default.if_isinstance_expected_l.else_.assert_dataclasses_asdict", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2709, "end_line": 2726, "span_ids": ["test_init_false_with_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": "@pytest.mark.parametrize('field_constructor', [dataclasses.field, pydantic.dataclasses.Field])\n@pytest.mark.parametrize(\n 'input_data,extra,expected',\n init_test_cases,\n)\ndef test_init_false_with_default(input_data, extra, expected, field_constructor):\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra=extra))\n class MyDataclass:\n a: int\n b: int = field_constructor(init=False, default=1)\n\n if isinstance(expected, list):\n with pytest.raises(ValidationError) as exc_info:\n MyDataclass(**input_data)\n\n assert exc_info.value.errors(include_url=False) == expected\n else:\n assert dataclasses.asdict(MyDataclass(**input_data)) == 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_validators.py_test_validate_default_raises_for_dataclasses_test_validate_default_raises_for_dataclasses.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_default_raises_for_dataclasses_test_validate_default_raises_for_dataclasses.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": 2775, "end_line": 2809, "span_ids": ["test_validate_default_raises_for_dataclasses"], "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": "def test_validate_default_raises_for_dataclasses() -> None:\n @pydantic_dataclass\n class Model:\n value_0: str\n value_a: Annotated[Optional[str], Field(None, validate_default=True)]\n value_b: Annotated[Optional[str], Field(None, validate_default=True)]\n\n @field_validator('value_a', mode='after')\n def value_a_validator(cls, value):\n raise AssertionError\n\n @field_validator('value_b', mode='after')\n def value_b_validator(cls, value):\n raise AssertionError\n\n with pytest.raises(ValidationError) as exc_info:\n Model()\n\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'missing', 'loc': ('value_0',), 'msg': 'Field required', 'input': HasRepr('ArgsKwargs(())')},\n {\n 'type': 'assertion_error',\n 'loc': ('value_a',),\n 'msg': 'Assertion failed, ',\n 'input': None,\n 'ctx': {'error': IsInstance(AssertionError)},\n },\n {\n 'type': 'assertion_error',\n 'loc': ('value_b',),\n 'msg': 'Assertion failed, ',\n 'input': None,\n 'ctx': {'error': IsInstance(AssertionError)},\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_plain_validator_plain_serializer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_plain_validator_plain_serializer_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 2810, "end_line": 2840, "span_ids": ["test_plain_validator_plain_serializer", "test_plain_validator_with_unsupported_type"], "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_plain_validator_plain_serializer() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/8512\"\"\"\n ser_type = str\n serializer = PlainSerializer(lambda x: ser_type(int(x)), return_type=ser_type)\n validator = PlainValidator(lambda x: bool(int(x)))\n\n class Blah(BaseModel):\n foo: Annotated[bool, validator, serializer]\n bar: Annotated[bool, serializer, validator]\n\n blah = Blah(foo='0', bar='1')\n data = blah.model_dump()\n assert isinstance(data['foo'], ser_type)\n assert isinstance(data['bar'], ser_type)\n\n\ndef test_plain_validator_with_unsupported_type() -> None:\n class UnsupportedClass:\n pass\n\n PreviouslySupportedType = Annotated[\n UnsupportedClass,\n PlainValidator(lambda _: UnsupportedClass()),\n ]\n\n type_adapter = TypeAdapter(PreviouslySupportedType)\n\n model = type_adapter.validate_python('abcdefg')\n assert isinstance(model, UnsupportedClass)\n assert isinstance(type_adapter.dump_python(model), UnsupportedClass)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_docs_extraction.py__dedent_source_lines__dedent_source_lines.return.dedent_source": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py__dedent_source_lines__dedent_source_lines.return.dedent_source", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_docs_extraction.py", "file_name": "_docs_extraction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 43, "span_ids": ["_dedent_source_lines"], "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 _dedent_source_lines(source: list[str]) -> str:\n # Required for nested class definitions, e.g. in a function block\n dedent_source = textwrap.dedent(''.join(source))\n if dedent_source.startswith((' ', '\\t')):\n # We are in the case where there's a dedented (usually multiline) string\n # at a lower indentation level than the class itself. We wrap our class\n # in a function as a workaround.\n dedent_source = f'def dedent_workaround():\\n{dedent_source}'\n return dedent_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/_docs_extraction.py__extract_source_from_frame__extract_source_from_frame.while_frame_.frame.frame_f_back": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py__extract_source_from_frame__extract_source_from_frame.while_frame_.frame.frame_f_back", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_docs_extraction.py", "file_name": "_docs_extraction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 73, "span_ids": ["_extract_source_from_frame"], "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 _extract_source_from_frame(cls: type[Any]) -> list[str] | None:\n frame = inspect.currentframe()\n\n while frame:\n if inspect.getmodule(frame) is inspect.getmodule(cls):\n lnum = frame.f_lineno\n try:\n lines, _ = inspect.findsource(frame)\n except OSError:\n # Source can't be retrieved (maybe because running in an interactive terminal),\n # we don't want to error here.\n pass\n else:\n block_lines = inspect.getblock(lines[lnum - 1 :])\n dedent_source = _dedent_source_lines(block_lines)\n try:\n block_tree = ast.parse(dedent_source)\n except SyntaxError:\n pass\n else:\n stmt = block_tree.body[0]\n if isinstance(stmt, ast.FunctionDef) and stmt.name == 'dedent_workaround':\n # `_dedent_source_lines` wrapped the class around the workaround function\n stmt = stmt.body[0]\n if isinstance(stmt, ast.ClassDef) and stmt.name == cls.__name__:\n return block_lines\n\n frame = frame.f_back", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/_docs_extraction.py_extract_docstrings_from_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py_extract_docstrings_from_cls_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_docs_extraction.py", "file_name": "_docs_extraction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 104, "span_ids": ["extract_docstrings_from_cls"], "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 extract_docstrings_from_cls(cls: type[Any], use_inspect: bool = False) -> dict[str, str]:\n \"\"\"Map model attributes and their corresponding docstring.\n\n Args:\n cls: The class of the Pydantic model to inspect.\n use_inspect: Whether to skip usage of frames to find the object and use\n the `inspect` module instead.\n\n Returns:\n A mapping containing attribute names and their corresponding docstring.\n \"\"\"\n if use_inspect:\n # Might not work as expected if two classes have the same name in the same source file.\n try:\n source, _ = inspect.getsourcelines(cls)\n except OSError:\n return {}\n else:\n source = _extract_source_from_frame(cls)\n\n if not source:\n return {}\n\n dedent_source = _dedent_source_lines(source)\n\n visitor = DocstringVisitor()\n visitor.visit(ast.parse(dedent_source))\n return visitor.attrs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_PydanticMetadata__update_fields_from_docstrings.if_config_wrapper_use_att.for_ann_name_field_info_.if_field_info_description.field_info.description.fields_docs_ann_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_fields.py_PydanticMetadata__update_fields_from_docstrings.if_config_wrapper_use_att.for_ann_name_field_info_.if_field_info_description.field_info.description.fields_docs_ann_name_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_fields.py", "file_name": "_fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 96, "span_ids": ["_general_metadata_cls", "_update_fields_from_docstrings", "PydanticMetadata", "pydantic_general_metadata"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticMetadata(Representation):\n \"\"\"Base class for annotation markers like `Strict`.\"\"\"\n\n __slots__ = ()\n\n\ndef pydantic_general_metadata(**metadata: Any) -> BaseMetadata:\n \"\"\"Create a new `_PydanticGeneralMetadata` class with the given metadata.\n\n Args:\n **metadata: The metadata to add.\n\n Returns:\n The new `_PydanticGeneralMetadata` class.\n \"\"\"\n return _general_metadata_cls()(metadata) # type: ignore\n\n\n@lru_cache(maxsize=None)\ndef _general_metadata_cls() -> type[BaseMetadata]:\n \"\"\"Do it this way to avoid importing `annotated_types` at import time.\"\"\"\n from annotated_types import BaseMetadata\n\n class _PydanticGeneralMetadata(PydanticMetadata, BaseMetadata):\n \"\"\"Pydantic general metadata like `max_digits`.\"\"\"\n\n def __init__(self, metadata: Any):\n self.__dict__ = metadata\n\n return _PydanticGeneralMetadata # type: ignore\n\n\ndef _update_fields_from_docstrings(cls: type[Any], fields: dict[str, FieldInfo], config_wrapper: ConfigWrapper) -> None:\n if config_wrapper.use_attribute_docstrings:\n fields_docs = extract_docstrings_from_cls(cls)\n for ann_name, field_info in fields.items():\n if field_info.description is None and ann_name in fields_docs:\n field_info.description = fields_docs[ann_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/config.py_ConfigDict.None_38_ConfigDict.None_40": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py_ConfigDict.None_38_ConfigDict.None_40", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 868, "end_line": 945, "span_ids": ["ConfigDict"], "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": "class ConfigDict(TypedDict, total=False):\n \"\"\"\n The regex engine to be used for pattern validation.\n Defaults to `'rust-regex'`.\n\n - `rust-regex` uses the [`regex`](https://docs.rs/regex) Rust crate,\n which is non-backtracking and therefore more DDoS resistant, but does not support all regex features.\n - `python-re` use the [`re`](https://docs.python.org/3/library/re.html) module,\n which supports all regex features, but may be slower.\n\n ```py\n from pydantic import BaseModel, ConfigDict, Field, ValidationError\n\n class Model(BaseModel):\n model_config = ConfigDict(regex_engine='python-re')\n\n value: str = Field(pattern=r'^abc(?=def)')\n\n print(Model(value='abcdef').value)\n #> abcdef\n\n try:\n print(Model(value='abxyzcdef'))\n except ValidationError as e:\n print(e)\n '''\n 1 validation error for Model\n value\n String should match pattern '^abc(?=def)' [type=string_pattern_mismatch, input_value='abxyzcdef', input_type=str]\n '''\n ```\n \"\"\"\n\n validation_error_cause: bool\n \"\"\"\n If `True`, Python exceptions that were part of a validation failure will be shown as an exception group as a cause. Can be useful for debugging. Defaults to `False`.\n\n Note:\n Python 3.10 and older don't support exception groups natively. <=3.10, backport must be installed: `pip install exceptiongroup`.\n\n Note:\n The structure of validation errors are likely to change in future Pydantic versions. Pydantic offers no guarantees about their structure. Should be used for visual traceback debugging only.\n \"\"\"\n\n use_attribute_docstrings: bool\n '''\n Whether docstrings of attributes (bare string literals immediately following the attribute declaration)\n should be used for field descriptions. Defaults to `False`.\n\n ```py\n from pydantic import BaseModel, ConfigDict, Field\n\n\n class Model(BaseModel):\n model_config = ConfigDict(use_attribute_docstrings=True)\n\n x: str\n \"\"\"\n Example of an attribute docstring\n \"\"\"\n\n y: int = Field(description=\"Description in Field\")\n \"\"\"\n Description in Field overrides attribute docstring\n \"\"\"\n\n\n print(Model.model_fields[\"x\"].description)\n # > Example of an attribute docstring\n print(Model.model_fields[\"y\"].description)\n # > Description in Field\n ```\n This requires the source code of the class to be available at runtime.\n\n !!! warning \"Usage with `TypedDict`\"\n Due to current limitations, attribute docstrings detection may not work as expected when using `TypedDict`\n (in particular when multiple `TypedDict` classes have the same name in the same source file). The behavior\n can be different depending on the Python version used.\n '''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__TypeT_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/config.py__TypeT_", "embedding": null, "metadata": {"file_path": "pydantic/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 948, "end_line": 985, "span_ids": ["with_config", "impl:15", "impl:17"], "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": "_TypeT = TypeVar('_TypeT', bound=type)\n\n\ndef with_config(config: ConfigDict) -> Callable[[_TypeT], _TypeT]:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/config/#configuration-with-dataclass-from-the-standard-library-or-typeddict\n\n A convenience decorator to set a [Pydantic configuration](config.md) on a `TypedDict` or a `dataclass` from the standard library.\n\n Although the configuration can be set using the `__pydantic_config__` attribute, it does not play well with type checkers,\n especially with `TypedDict`.\n\n !!! example \"Usage\"\n\n ```py\n from typing_extensions import TypedDict\n\n from pydantic import ConfigDict, TypeAdapter, with_config\n\n @with_config(ConfigDict(str_to_lower=True))\n class Model(TypedDict):\n x: str\n\n ta = TypeAdapter(Model)\n\n print(ta.validate_python({'x': 'ABC'}))\n #> {'x': 'abc'}\n ```\n \"\"\"\n\n def inner(TypedDictClass: _TypeT, /) -> _TypeT:\n TypedDictClass.__pydantic_config__ = config\n return TypedDictClass\n\n return inner\n\n\n__getattr__ = getattr_migration(__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/dataclasses.py_dataclass.make_pydantic_fields_compatible_dataclass.make_pydantic_fields_compatible.for_annotation_cls_in_cls.for_field_name_in_annotat.cls___annotations___field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/dataclasses.py_dataclass.make_pydantic_fields_compatible_dataclass.make_pydantic_fields_compatible.for_annotation_cls_in_cls.for_field_name_in_annotat.cls___annotations___field", "embedding": null, "metadata": {"file_path": "pydantic/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 182, "span_ids": ["dataclass"], "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": "@dataclass_transform(field_specifiers=(dataclasses.field, Field))\ndef dataclass( # noqa: C901\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 slots: bool = False,\n) -> Callable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]:\n # ... other code\n\n def make_pydantic_fields_compatible(cls: type[Any]) -> None:\n \"\"\"Make sure that stdlib `dataclasses` understands `Field` kwargs like `kw_only`\n To do that, we simply change\n `x: int = pydantic.Field(..., kw_only=True)`\n into\n `x: int = dataclasses.field(default=pydantic.Field(..., kw_only=True), kw_only=True)`\n \"\"\"\n for annotation_cls in cls.__mro__:\n # In Python < 3.9, `__annotations__` might not be present if there are no fields.\n # we therefore need to use `getattr` to avoid an `AttributeError`.\n annotations = getattr(annotation_cls, '__annotations__', [])\n for field_name in annotations:\n field_value = getattr(cls, field_name, None)\n # Process only if this is an instance of `FieldInfo`.\n if not isinstance(field_value, FieldInfo):\n continue\n\n # Initialize arguments for the standard `dataclasses.field`.\n field_args: dict = {'default': field_value}\n\n # Handle `kw_only` for Python 3.10+\n if sys.version_info >= (3, 10) and field_value.kw_only:\n field_args['kw_only'] = True\n\n # Set `repr` attribute if it's explicitly specified to be not `True`.\n if field_value.repr is not True:\n field_args['repr'] = field_value.repr\n\n setattr(cls, field_name, dataclasses.field(**field_args))\n # In Python 3.8, dataclasses checks cls.__dict__['__annotations__'] for annotations,\n # so we must make sure it's initialized before we add to it.\n if cls.__dict__.get('__annotations__') is None:\n cls.__annotations__ = {}\n cls.__annotations__[field_name] = annotations[field_name]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.if_not_typing_TYPE_CHECKI_BaseModel.if_not_typing_TYPE_CHECKI.__delattr__.if_item_in_self_model_fie.else_.try_.except_AttributeError_.raise_AttributeError_f_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.if_not_typing_TYPE_CHECKI_BaseModel.if_not_typing_TYPE_CHECKI.__delattr__.if_item_in_self_model_fie.else_.try_.except_AttributeError_.raise_AttributeError_f_t", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 734, "end_line": 837, "span_ids": ["BaseModel:49"], "tokens": 1121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(metaclass=_model_construction.ModelMetaclass):\n\n if not typing.TYPE_CHECKING:\n # We put `__getattr__` in a non-TYPE_CHECKING block because otherwise, mypy allows arbitrary attribute access\n # The same goes for __setattr__ and __delattr__, see: https://github.com/pydantic/pydantic/issues/8643\n\n def __getattr__(self, item: str) -> Any:\n private_attributes = object.__getattribute__(self, '__private_attributes__')\n if item in private_attributes:\n attribute = private_attributes[item]\n if hasattr(attribute, '__get__'):\n return attribute.__get__(self, type(self)) # type: ignore\n\n try:\n # Note: self.__pydantic_private__ cannot be None if self.__private_attributes__ has items\n return self.__pydantic_private__[item] # type: ignore\n except KeyError as exc:\n raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc\n else:\n # `__pydantic_extra__` can fail to be set if the model is not yet fully initialized.\n # See `BaseModel.__repr_args__` for more details\n try:\n pydantic_extra = object.__getattribute__(self, '__pydantic_extra__')\n except AttributeError:\n pydantic_extra = None\n\n if pydantic_extra is not None:\n try:\n return pydantic_extra[item]\n except KeyError as exc:\n raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc\n else:\n if hasattr(self.__class__, item):\n return super().__getattribute__(item) # Raises AttributeError if appropriate\n else:\n # this is the current error\n raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')\n\n def __setattr__(self, name: str, value: Any) -> None:\n if name in self.__class_vars__:\n raise AttributeError(\n f'{name!r} 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 elif not _fields.is_valid_field_name(name):\n if self.__pydantic_private__ is None or name not in self.__private_attributes__:\n _object_setattr(self, name, value)\n else:\n attribute = self.__private_attributes__[name]\n if hasattr(attribute, '__set__'):\n attribute.__set__(self, value) # type: ignore\n else:\n self.__pydantic_private__[name] = value\n return\n\n self._check_frozen(name, value)\n\n attr = getattr(self.__class__, name, None)\n if isinstance(attr, property):\n attr.__set__(self, value)\n elif self.model_config.get('validate_assignment', None):\n self.__pydantic_validator__.validate_assignment(self, name, value)\n elif self.model_config.get('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 elif self.model_config.get('extra') == 'allow' and name not in self.model_fields:\n if self.model_extra and name in self.model_extra:\n self.__pydantic_extra__[name] = value # type: ignore\n else:\n try:\n getattr(self, name)\n except AttributeError:\n # attribute does not already exist on instance, so put it in extra\n self.__pydantic_extra__[name] = value # type: ignore\n else:\n # attribute _does_ already exist on instance, and was not in extra, so update it\n _object_setattr(self, name, value)\n else:\n self.__dict__[name] = value\n self.__pydantic_fields_set__.add(name)\n\n def __delattr__(self, item: str) -> Any:\n if item in self.__private_attributes__:\n attribute = self.__private_attributes__[item]\n if hasattr(attribute, '__delete__'):\n attribute.__delete__(self) # type: ignore\n return\n\n try:\n # Note: self.__pydantic_private__ cannot be None if self.__private_attributes__ has items\n del self.__pydantic_private__[item] # type: ignore\n return\n except KeyError as exc:\n raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc\n\n self._check_frozen(item, None)\n\n if item in self.model_fields:\n object.__delattr__(self, item)\n elif self.__pydantic_extra__ is not None and item in self.__pydantic_extra__:\n del self.__pydantic_extra__[item]\n else:\n try:\n object.__delattr__(self, item)\n except AttributeError:\n raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!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_SecretType__SecretBase._display.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretType__SecretBase._display.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1446, "end_line": 1474, "span_ids": ["_SecretBase.__str__", "_SecretBase.__init__", "impl:61", "_SecretBase.get_secret_value", "_SecretBase.__repr__", "_SecretBase.__eq__", "_SecretBase.__hash__", "_SecretBase._display", "_SecretBase"], "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": "SecretType = TypeVar('SecretType')\n\n\nclass _SecretBase(Generic[SecretType]):\n def __init__(self, secret_value: SecretType) -> None:\n self._secret_value: SecretType = secret_value\n\n def get_secret_value(self) -> SecretType:\n \"\"\"Get the secret value.\n\n Returns:\n The secret value.\n \"\"\"\n return self._secret_value\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 __str__(self) -> str:\n return str(self._display())\n\n def __repr__(self) -> str:\n return f'{self.__class__.__name__}({self._display()!r})'\n\n def _display(self) -> str | bytes:\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Secret_Secret._display.return._if_self_get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Secret_Secret._display.return._if_self_get_", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1477, "end_line": 1534, "span_ids": ["Secret._display", "Secret"], "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": "class Secret(_SecretBase[SecretType]):\n \"\"\"A generic base class used for defining a field with sensitive information that you do not want to be visible in logging or tracebacks.\n\n You may either directly parametrize `Secret` with a type, or subclass from `Secret` with a parametrized type. The benefit of subclassing\n is that you can define a custom `_display` method, which will be used for `repr()` and `str()` methods. The examples below demonstrate both\n ways of using `Secret` to create a new secret type.\n\n 1. Directly parametrizing `Secret` with a type:\n\n ```py\n from pydantic import BaseModel, Secret\n\n SecretBool = Secret[bool]\n\n class Model(BaseModel):\n secret_bool: SecretBool\n\n m = Model(secret_bool=True)\n print(m.model_dump())\n #> {'secret_bool': Secret('**********')}\n\n print(m.model_dump_json())\n #> {\"secret_bool\":\"**********\"}\n\n print(m.secret_bool.get_secret_value())\n #> True\n ```\n\n 2. Subclassing from parametrized `Secret`:\n\n ```py\n from datetime import date\n\n from pydantic import BaseModel, Secret\n\n class SecretDate(Secret[date]):\n def _display(self) -> str:\n return '****/**/**'\n\n class Model(BaseModel):\n secret_date: SecretDate\n\n m = Model(secret_date=date(2022, 1, 1))\n print(m.model_dump())\n #> {'secret_date': SecretDate('****/**/**')}\n\n print(m.model_dump_json())\n #> {\"secret_date\":\"****/**/**\"}\n\n print(m.secret_date.get_secret_value())\n #> 2022-01-01\n ```\n\n The value returned by the `_display` method will be used for `repr()` and `str()`.\n \"\"\"\n\n def _display(self) -> str | bytes:\n return '**********' if self.get_secret_value() 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/pydantic/types.py_Secret.__get_pydantic_core_schema___Secret.__get_pydantic_core_schema__.return.core_schema_json_or_pytho": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_Secret.__get_pydantic_core_schema___Secret.__get_pydantic_core_schema__.return.core_schema_json_or_pytho", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1536, "end_line": 1572, "span_ids": ["Secret.__get_pydantic_core_schema__"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Secret(_SecretBase[SecretType]):\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n inner_type = None\n # if origin_type is Secret, then cls is a GenericAlias, and we can extract the inner type directly\n origin_type = get_origin(source)\n if origin_type is not None:\n inner_type = get_args(source)[0]\n # otherwise, we need to get the inner type from the base class\n else:\n bases = getattr(cls, '__orig_bases__', getattr(cls, '__bases__', []))\n for base in bases:\n if get_origin(base) is Secret:\n inner_type = get_args(base)[0]\n if bases == [] or inner_type is None:\n raise TypeError(\n f\"Can't get secret type from {cls.__name__}. \"\n 'Please use Secret[], or subclass from Secret[] instead.'\n )\n\n inner_schema = handler.generate_schema(inner_type) # type: ignore\n\n def validate_secret_value(value, handler) -> Secret[SecretType]:\n if isinstance(value, Secret):\n value = value.get_secret_value()\n validated_inner = handler(value)\n return cls(validated_inner)\n\n return core_schema.json_or_python_schema(\n python_schema=core_schema.no_info_wrap_validator_function(\n validate_secret_value,\n inner_schema,\n serialization=core_schema.plain_serializer_function_ser_schema(lambda x: x),\n ),\n json_schema=core_schema.no_info_after_validator_function(\n lambda x: cls(x), inner_schema, serialization=core_schema.to_string_ser_schema(when_used='json')\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__secret_display__SecretField.__get_pydantic_core_schema__.json_schema.core_schema_no_info_after": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py__secret_display__SecretField.__get_pydantic_core_schema__.json_schema.core_schema_no_info_after", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1575, "end_line": 1608, "span_ids": ["_SecretField.__get_pydantic_core_schema__", "_secret_display", "_SecretField"], "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 _secret_display(value: SecretType) -> str: # type: ignore\n return '**********' if value else ''\n\n\nclass _SecretField(_SecretBase[SecretType]):\n _inner_schema: ClassVar[CoreSchema]\n _error_kind: ClassVar[str]\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n def serialize(\n 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 bytes,\n # hence we just use `secret_display`\n return _secret_display(value.get_secret_value())\n else:\n return value\n\n def get_json_schema(_core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n json_schema = handler(cls._inner_schema)\n _utils.update_not_none(\n json_schema,\n type='string',\n writeOnly=True,\n format='password',\n )\n return json_schema\n\n json_schema = core_schema.no_info_after_validator_function(\n source, # construct the type\n cls._inner_schema,\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/types.py__SecretField.__get_pydantic_core_schema__.get_secret_schema__SecretField.__get_pydantic_core_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/types.py__SecretField.__get_pydantic_core_schema__.get_secret_schema__SecretField.__get_pydantic_core_schema__.return.core_schema_lax_or_strict", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1610, "end_line": 1633, "span_ids": ["_SecretField.__get_pydantic_core_schema__"], "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 _SecretField(_SecretBase[SecretType]):\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n # ... other code\n\n def get_secret_schema(strict: bool) -> CoreSchema:\n return core_schema.json_or_python_schema(\n python_schema=core_schema.union_schema(\n [\n core_schema.is_instance_schema(source),\n json_schema,\n ],\n custom_error_type=cls._error_kind,\n strict=strict,\n ),\n json_schema=json_schema,\n serialization=core_schema.plain_serializer_function_ser_schema(\n serialize,\n info_arg=True,\n return_schema=core_schema.str_schema(),\n when_used='json',\n ),\n )\n\n return core_schema.lax_or_strict_schema(\n lax_schema=get_secret_schema(strict=False),\n strict_schema=get_secret_schema(strict=True),\n metadata={'pydantic_js_functions': [get_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/pydantic/types.py_SecretStr_SecretStr._display.return._secret_display_self__sec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_SecretStr_SecretStr._display.return._secret_display_self__sec", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1636, "end_line": 1667, "span_ids": ["SecretStr._display", "SecretStr", "SecretStr.__len__"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SecretStr(_SecretField[str]):\n \"\"\"A string used for storing sensitive information that you do not want to be visible in logging or tracebacks.\n\n When the secret value is nonempty, it is displayed as `'**********'` instead of the underlying value in\n calls to `repr()` and `str()`. If the value _is_ empty, it is displayed as `''`.\n\n ```py\n from pydantic import BaseModel, SecretStr\n\n class User(BaseModel):\n username: str\n password: SecretStr\n\n user = User(username='scolvin', password='password1')\n\n print(user)\n #> username='scolvin' password=SecretStr('**********')\n print(user.password.get_secret_value())\n #> password1\n print((SecretStr('password'), SecretStr('')))\n #> (SecretStr('**********'), SecretStr(''))\n ```\n \"\"\"\n\n _inner_schema: ClassVar[CoreSchema] = core_schema.str_schema()\n _error_kind: ClassVar[str] = 'string_type'\n\n def __len__(self) -> int:\n return len(self._secret_value)\n\n def _display(self) -> str:\n return _secret_display(self._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/pydantic/types.py_None_35_ByteSize.byte_sizes_update_k_lowe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_None_35_ByteSize.byte_sizes_update_k_lowe", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1824, "end_line": 1892, "span_ids": ["ByteSize", "PaymentCardNumber.validate_brand"], "tokens": 747}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BYTE SIZE TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nclass ByteSize(int):\n \"\"\"Converts a string representing a number of bytes with units (such as `'1KB'` or `'11.5MiB'`) into an integer.\n\n You can use the `ByteSize` data type to (case-insensitively) convert a string representation of a number of bytes into\n an integer, and also to print out human-readable strings representing a number of bytes.\n\n In conformance with [IEC 80000-13 Standard](https://en.wikipedia.org/wiki/ISO/IEC_80000) we interpret `'1KB'` to mean 1000 bytes,\n and `'1KiB'` to mean 1024 bytes. In general, including a middle `'i'` will cause the unit to be interpreted as a power of 2,\n rather than a power of 10 (so, for example, `'1 MB'` is treated as `1_000_000` bytes, whereas `'1 MiB'` is treated as `1_048_576` bytes).\n\n !!! info\n Note that `1b` will be parsed as \"1 byte\" and not \"1 bit\".\n\n ```py\n from pydantic import BaseModel, ByteSize\n\n class MyModel(BaseModel):\n size: ByteSize\n\n print(MyModel(size=52000).size)\n #> 52000\n print(MyModel(size='3000 KiB').size)\n #> 3072000\n\n m = MyModel(size='50 PB')\n print(m.size.human_readable())\n #> 44.4PiB\n print(m.size.human_readable(decimal=True))\n #> 50.0PB\n print(m.size.human_readable(separator=' '))\n #> 44.4 PiB\n\n print(m.size.to('TiB'))\n #> 45474.73508864641\n ```\n \"\"\"\n\n byte_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 'bit': 1 / 8,\n 'kbit': 10**3 / 8,\n 'mbit': 10**6 / 8,\n 'gbit': 10**9 / 8,\n 'tbit': 10**12 / 8,\n 'pbit': 10**15 / 8,\n 'ebit': 10**18 / 8,\n 'kibit': 2**10 / 8,\n 'mibit': 2**20 / 8,\n 'gibit': 2**30 / 8,\n 'tibit': 2**40 / 8,\n 'pibit': 2**50 / 8,\n 'eibit': 2**60 / 8,\n }\n byte_sizes.update({k.lower()[0]: v for k, v in byte_sizes.items() if 'i' not in k})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.byte_string_pattern_ByteSize.__get_pydantic_core_schema__.return.core_schema_with_info_aft": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.byte_string_pattern_ByteSize.__get_pydantic_core_schema__.return.core_schema_with_info_aft", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1894, "end_line": 1912, "span_ids": ["ByteSize", "ByteSize.__get_pydantic_core_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": "class ByteSize(int):\n\n byte_string_pattern = r'^\\s*(\\d*\\.?\\d+)\\s*(\\w+)?'\n byte_string_re = re.compile(byte_string_pattern, re.IGNORECASE)\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema:\n return core_schema.with_info_after_validator_function(\n function=cls._validate,\n schema=core_schema.union_schema(\n [\n core_schema.str_schema(pattern=cls.byte_string_pattern),\n core_schema.int_schema(ge=0),\n ],\n custom_error_type='byte_size',\n custom_error_message='could not parse value and unit from byte string',\n ),\n serialization=core_schema.plain_serializer_function_ser_schema(\n int, return_schema=core_schema.int_schema(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/pydantic/types.py_ByteSize.human_readable_ByteSize.human_readable.return.f_num_0_1f_separator_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/types.py_ByteSize.human_readable_ByteSize.human_readable.return.f_num_0_1f_separator_f", "embedding": null, "metadata": {"file_path": "pydantic/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1936, "end_line": 1965, "span_ids": ["ByteSize.human_readable"], "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 ByteSize(int):\n\n def human_readable(self, decimal: bool = False, separator: str = '') -> str:\n \"\"\"Converts a byte size to a human readable string.\n\n Args:\n decimal: If True, use decimal units (e.g. 1000 bytes per KB). If False, use binary units\n (e.g. 1024 bytes per KiB).\n separator: A string used to split the value and unit. Defaults to an empty string ('').\n\n Returns:\n A human readable string representation of the byte size.\n \"\"\"\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}{separator}{unit}'\n else:\n return f'{num:0.1f}{separator}{unit}'\n num /= divisor\n\n return f'{num:0.1f}{separator}{final_unit}'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/no_strict_optional.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/no_strict_optional.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/no_strict_optional.py", "file_name": "no_strict_optional.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["HealthStatus", "CustomBaseModel", "impl", "imports", "MongoSettings"], "tokens": 99}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Union\n\nfrom pydantic import BaseModel, ConfigDict\n\n\nclass MongoSettings(BaseModel):\n MONGO_PASSWORD: Union[str, None]\n\n\nclass CustomBaseModel(BaseModel):\n model_config = ConfigDict(\n validate_assignment=True,\n validate_default=True,\n extra='forbid',\n frozen=True,\n )\n\n\nclass HealthStatus(CustomBaseModel):\n status: str\n description: Optional[str] = None\n\n\nhs = HealthStatus(status='healthy')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/with_config_decorator.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/with_config_decorator.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/with_config_decorator.py", "file_name": "with_config_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["imports", "Model", "impl"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 TypedDict\n\nfrom pydantic import ConfigDict, with_config\n\n\n@with_config(ConfigDict(str_to_lower=True))\nclass Model(TypedDict):\n a: str\n\n\nmodel = Model(a='ABC')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/with_config_decorator.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-default_toml/with_config_decorator.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-default_toml/with_config_decorator.py", "file_name": "with_config_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["imports", "Model", "impl"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 TypedDict\n\nfrom pydantic import ConfigDict, with_config\n\n\n@with_config(ConfigDict(str_to_lower=True))\nclass Model(TypedDict):\n a: str\n\n\nmodel = Model(a='ABC')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-no-strict-optional_toml/no_strict_optional.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-no-strict-optional_toml/no_strict_optional.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-no-strict-optional_toml/no_strict_optional.py", "file_name": "no_strict_optional.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["HealthStatus", "CustomBaseModel", "impl", "imports", "MongoSettings"], "tokens": 99}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Union\n\nfrom pydantic import BaseModel, ConfigDict\n\n\nclass MongoSettings(BaseModel):\n MONGO_PASSWORD: Union[str, None]\n\n\nclass CustomBaseModel(BaseModel):\n model_config = ConfigDict(\n validate_assignment=True,\n validate_default=True,\n extra='forbid',\n frozen=True,\n )\n\n\nclass HealthStatus(CustomBaseModel):\n status: str\n description: Optional[str] = None\n\n\nhs = HealthStatus(status='healthy')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/outputs/1.1.1/pyproject-default_toml/with_config_decorator.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.1.1/pyproject-default_toml/with_config_decorator.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.1.1/pyproject-default_toml/with_config_decorator.py", "file_name": "with_config_decorator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["imports", "Model", "impl"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 TypedDict\n\nfrom pydantic import ConfigDict, with_config\n\n\n@with_config(ConfigDict(str_to_lower=True))\nclass Model(TypedDict):\n a: str\n\n\nmodel = Model(a='ABC')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_json_schema_with_inner_models_with_duplicate_names_test_json_schema_with_inner_models_with_duplicate_names.assert_model_b_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_json_schema_with_inner_models_with_duplicate_names_test_json_schema_with_inner_models_with_duplicate_names.assert_model_b_model_json", "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": 561, "end_line": 583, "span_ids": ["test_json_schema_with_inner_models_with_duplicate_names"], "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_json_schema_with_inner_models_with_duplicate_names():\n model_a = create_model(\n 'a',\n inner=(str, ...),\n )\n model_b = create_model(\n 'a',\n outer=(model_a, ...),\n )\n assert model_b.model_json_schema() == {\n '$defs': {\n 'a': {\n 'properties': {'inner': {'title': 'Inner', 'type': 'string'}},\n 'required': ['inner'],\n 'title': 'a',\n 'type': 'object',\n }\n },\n 'properties': {'outer': {'$ref': '#/$defs/a'}},\n 'required': ['outer'],\n 'title': 'a',\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_resolving_forward_refs_across_modules_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_resolving_forward_refs_across_modules_", "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": 586, "end_line": 613, "span_ids": ["test_resolving_forward_refs_across_modules", "test_type_field_in_the_same_module"], "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_resolving_forward_refs_across_modules(create_module):\n module = create_module(\n # language=Python\n \"\"\"\\\nfrom __future__ import annotations\nfrom dataclasses import dataclass\nfrom pydantic import BaseModel\n\nclass X(BaseModel):\n pass\n\n@dataclass\nclass Y:\n x: X\n \"\"\"\n )\n Z = create_model('Z', y=(module.Y, ...))\n assert Z(y={'x': {}}).y is not None\n\n\ndef test_type_field_in_the_same_module():\n class A:\n pass\n\n B = create_model('B', a_cls=(type, A))\n b = B()\n assert b.a_cls == 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_dataclasses_with_config_decorator_test_dataclasses_with_config_decorator.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_dataclasses_with_config_decorator_test_dataclasses_with_config_decorator.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": 2410, "end_line": 2425, "span_ids": ["test_dataclasses_with_config_decorator"], "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_dataclasses_with_config_decorator():\n @dataclasses.dataclass\n @with_config(ConfigDict(str_to_lower=True))\n class Model1:\n x: str\n\n ta = TypeAdapter(Model1)\n assert ta.validate_python({'x': 'ABC'}).x == 'abc'\n\n @with_config(ConfigDict(str_to_lower=True))\n @dataclasses.dataclass\n class Model2:\n x: str\n\n ta = TypeAdapter(Model2)\n assert ta.validate_python({'x': 'ABC'}).x == 'abc'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_disallow_extra_allow_and_init_false_test_annotations_valid_for_field_inheritance.assert_B_a_1_a_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_disallow_extra_allow_and_init_false_test_annotations_valid_for_field_inheritance.assert_B_a_1_a_1", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2748, "end_line": 2777, "span_ids": ["test_disallow_extra_allow_and_init_false", "test_annotations_valid_for_field_inheritance", "test_disallow_init_false_and_init_var_true"], "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_disallow_extra_allow_and_init_false() -> None:\n with pytest.raises(PydanticUserError, match='This combination is not allowed.'):\n\n @pydantic.dataclasses.dataclass(config=ConfigDict(extra='allow'))\n class A:\n a: int = Field(init=False, default=1)\n\n\ndef test_disallow_init_false_and_init_var_true() -> None:\n with pytest.raises(PydanticUserError, match='mutually exclusive.'):\n\n @pydantic.dataclasses.dataclass\n class Foo:\n bar: str = Field(..., init=False, init_var=True)\n\n\ndef test_annotations_valid_for_field_inheritance() -> None:\n # testing https://github.com/pydantic/pydantic/issues/8670\n\n @pydantic.dataclasses.dataclass()\n class A:\n a: int = pydantic.dataclasses.Field()\n\n @pydantic.dataclasses.dataclass()\n class B(A):\n ...\n\n assert B.__pydantic_fields__['a'].annotation is int\n\n assert B(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_dataclasses.py_test_annotations_valid_for_field_inheritance_with_existing_field_test_annotations_valid_for_field_inheritance_with_existing_field.assert_b_b_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_annotations_valid_for_field_inheritance_with_existing_field_test_annotations_valid_for_field_inheritance_with_existing_field.assert_b_b_b_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2780, "end_line": 2796, "span_ids": ["test_annotations_valid_for_field_inheritance_with_existing_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": "def test_annotations_valid_for_field_inheritance_with_existing_field() -> None:\n # variation on testing https://github.com/pydantic/pydantic/issues/8670\n\n @pydantic.dataclasses.dataclass()\n class A:\n a: int = pydantic.dataclasses.Field()\n\n @pydantic.dataclasses.dataclass()\n class B(A):\n b: str = pydantic.dataclasses.Field()\n\n assert B.__pydantic_fields__['a'].annotation is int\n assert B.__pydantic_fields__['b'].annotation is str\n\n b = B(a=1, b='b')\n assert b.a == 1\n assert b.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_dataclasses.py_test_annotation_with_double_override_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_annotation_with_double_override_", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 2799, "end_line": 2825, "span_ids": ["test_annotation_with_double_override"], "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_annotation_with_double_override() -> None:\n @pydantic.dataclasses.dataclass()\n class A:\n a: int\n b: int\n c: int = pydantic.dataclasses.Field()\n d: int = pydantic.dataclasses.Field()\n\n # note, the order of fields is different here, as to test that the annotation\n # is correctly set on the field no matter the base's default / current class's default\n @pydantic.dataclasses.dataclass()\n class B(A):\n a: str\n c: str\n b: str = pydantic.dataclasses.Field()\n d: str = pydantic.dataclasses.Field()\n\n @pydantic.dataclasses.dataclass()\n class C(B):\n ...\n\n for class_ in [B, C]:\n instance = class_(a='a', b='b', c='c', d='d')\n for field_name in ['a', 'b', 'c', 'd']:\n assert class_.__pydantic_fields__[field_name].annotation is str\n assert getattr(instance, field_name) == field_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/tests/test_discriminated_union.py_test_callable_discriminated_union_with_missing_tag_test_callable_discriminated_union_with_missing_tag.None_2.except_PydanticUserError_.assert_exc_info_code_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_callable_discriminated_union_with_missing_tag_test_callable_discriminated_union_with_missing_tag.None_2.except_PydanticUserError_.assert_exc_info_code_", "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": 1665, "end_line": 1700, "span_ids": ["test_callable_discriminated_union_with_missing_tag"], "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": "def test_callable_discriminated_union_with_missing_tag() -> None:\n def model_x_discriminator(v):\n if isinstance(v, str):\n return 'str'\n if isinstance(v, (dict, BaseModel)):\n return 'model'\n\n try:\n\n class DiscriminatedModel(BaseModel):\n x: Annotated[\n Union[str, 'DiscriminatedModel'],\n Discriminator(model_x_discriminator),\n ]\n except PydanticUserError as exc_info:\n assert exc_info.code == 'callable-discriminator-no-tag'\n\n try:\n\n class DiscriminatedModel(BaseModel):\n x: Annotated[\n Union[Annotated[str, Tag('str')], 'DiscriminatedModel'],\n Discriminator(model_x_discriminator),\n ]\n except PydanticUserError as exc_info:\n assert exc_info.code == 'callable-discriminator-no-tag'\n\n try:\n\n class DiscriminatedModel(BaseModel):\n x: Annotated[\n Union[str, Annotated['DiscriminatedModel', Tag('model')]],\n Discriminator(model_x_discriminator),\n ]\n except PydanticUserError as exc_info:\n assert exc_info.code == 'callable-discriminator-no-tag'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions_test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions.assert_definitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions_test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions.assert_definitions_", "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": 1703, "end_line": 1766, "span_ids": ["test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions"], "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": "@pytest.mark.xfail(reason='Issue not yet fixed, see: https://github.com/pydantic/pydantic/issues/8271.')\ndef test_presence_of_discriminator_when_generating_type_adaptor_json_schema_definitions() -> None:\n class ItemType(str, Enum):\n ITEM1 = 'item1'\n ITEM2 = 'item2'\n\n class CreateItem1(BaseModel):\n item_type: Annotated[Literal[ItemType.ITEM1], Field(alias='type')]\n id: int\n\n class CreateItem2(BaseModel):\n item_type: Annotated[Literal[ItemType.ITEM2], Field(alias='type')]\n id: int\n\n class CreateObjectDto(BaseModel):\n id: int\n items: List[\n Annotated[\n Union[\n CreateItem1,\n CreateItem2,\n ],\n Field(discriminator='item_type'),\n ]\n ]\n\n adaptor = TypeAdapter(\n Annotated[CreateObjectDto, FieldInfo(examples=[{'id': 1, 'items': [{'id': 3, 'type': 'ITEM1'}]}])]\n )\n\n schema_map, definitions = GenerateJsonSchema().generate_definitions([(adaptor, 'validation', adaptor.core_schema)])\n assert definitions == {\n 'CreateItem1': {\n 'properties': {'id': {'title': 'Id', 'type': 'integer'}, 'type': {'const': 'item1', 'title': 'Type'}},\n 'required': ['type', 'id'],\n 'title': 'CreateItem1',\n 'type': 'object',\n },\n 'CreateItem2': {\n 'properties': {'id': {'title': 'Id', 'type': 'integer'}, 'type': {'const': 'item2', 'title': 'Type'}},\n 'required': ['type', 'id'],\n 'title': 'CreateItem2',\n 'type': 'object',\n },\n 'CreateObjectDto': {\n 'properties': {\n 'id': {'title': 'Id', 'type': 'integer'},\n 'items': {\n 'items': {\n 'discriminator': {\n 'mapping': {'item1': '#/$defs/CreateItem1', 'item2': '#/$defs/CreateItem2'},\n 'propertyName': 'type',\n },\n 'oneOf': [{'$ref': '#/$defs/CreateItem1'}, {'$ref': '#/$defs/CreateItem2'}],\n },\n 'title': 'Items',\n 'type': 'array',\n },\n },\n 'required': ['id', 'items'],\n 'title': 'CreateObjectDto',\n '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_docs_extraction.py_textwrap_test_model_no_docs_extraction.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_textwrap_test_model_no_docs_extraction.None_1", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "dec_noop", "test_model_no_docs_extraction"], "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": "import textwrap\nfrom typing import Generic, TypeVar\n\nfrom typing_extensions import Annotated, TypedDict\n\nfrom pydantic import BaseModel, ConfigDict, Field, TypeAdapter, create_model\nfrom pydantic.dataclasses import dataclass as pydantic_dataclass\n\nT = TypeVar('T')\n\n\ndef dec_noop(obj):\n return obj\n\n\ndef test_model_no_docs_extraction():\n class MyModel(BaseModel):\n a: int = 1\n \"\"\"A docs\"\"\"\n\n b: str = '1'\n\n \"\"\"B docs\"\"\"\n\n assert MyModel.model_fields['a'].description is None\n assert MyModel.model_fields['b'].description 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_docs_extraction.py_test_model_docs_extraction_test_model_docs_extraction.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_docs_extraction_test_model_docs_extraction.None_5", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 68, "span_ids": ["test_model_docs_extraction"], "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_model_docs_extraction():\n # Using a couple dummy decorators to make sure the frame is pointing at\n # the `class` line:\n @dec_noop\n @dec_noop\n class MyModel(BaseModel):\n a: int\n \"\"\"A docs\"\"\"\n b: int = 1\n\n \"\"\"B docs\"\"\"\n c: int = 1\n # This isn't used as a description.\n\n d: int\n\n def dummy_method(self) -> None:\n \"\"\"Docs for dummy that won't be used for d\"\"\"\n\n e: Annotated[int, Field(description='Real description')]\n \"\"\"Won't be used\"\"\"\n\n f: int\n \"\"\"F docs\"\"\"\n\n \"\"\"Useless docs\"\"\"\n\n g: int\n \"\"\"G docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n assert MyModel.model_fields['a'].description == 'A docs'\n assert MyModel.model_fields['b'].description == 'B docs'\n assert MyModel.model_fields['c'].description is None\n assert MyModel.model_fields['d'].description is None\n assert MyModel.model_fields['e'].description == 'Real description'\n assert MyModel.model_fields['g'].description == 'G docs'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extraction.py_test_model_docs_duplicate_class_test_model_docs_duplicate_class.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_docs_duplicate_class_test_model_docs_duplicate_class.None_1", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 117, "span_ids": ["test_model_docs_duplicate_class"], "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_model_docs_duplicate_class():\n \"\"\"Ensure source parsing is working correctly when using frames.\"\"\"\n\n @dec_noop\n class MyModel(BaseModel):\n a: int\n \"\"\"A docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n @dec_noop\n class MyModel(BaseModel):\n b: int\n \"\"\"B docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n assert MyModel.model_fields['b'].description == 'B docs'\n\n # With https://github.com/python/cpython/pull/106815/ introduced,\n # inspect will fallback to the last found class in the source file.\n # The following is to ensure using frames will still get the correct one\n if True:\n\n class MyModel(BaseModel):\n a: int\n \"\"\"A docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n else:\n\n class MyModel(BaseModel):\n b: int\n \"\"\"B docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n assert MyModel.model_fields['a'].description == 'A docs'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extraction.py_test_model_docs_dedented_string_test_model_docs_inheritance.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_docs_dedented_string_test_model_docs_inheritance.None_2", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 158, "span_ids": ["test_model_docs_inheritance", "test_model_docs_dedented_string"], "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_model_docs_dedented_string():\n # fmt: off\n class MyModel(BaseModel):\n def bar(self):\n \"\"\"\nAn inconveniently dedented string\n \"\"\"\n\n a: int\n \"\"\"A docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n # fmt: on\n assert MyModel.model_fields['a'].description == 'A docs'\n\n\ndef test_model_docs_inheritance():\n class MyModel(BaseModel):\n a: int\n \"\"\"A docs\"\"\"\n\n b: int\n \"\"\"B docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n FirstModel = MyModel\n\n class MyModel(FirstModel):\n a: int\n \"\"\"A overridden docs\"\"\"\n\n assert FirstModel.model_fields['a'].description == 'A docs'\n assert MyModel.model_fields['a'].description == 'A overridden docs'\n assert MyModel.model_fields['b'].description == 'B docs'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extraction.py_test_model_different_name_test_model_generic.assert_MyModel_int_model": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_model_different_name_test_model_generic.assert_MyModel_int_model", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 195, "span_ids": ["test_model_different_name", "test_model_generic"], "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_model_different_name():\n # As we extract docstrings from cls in `ModelMetaclass.__new__`,\n # we are not affected by `__name__` being altered in any way.\n\n class MyModel(BaseModel):\n a: int\n \"\"\"A docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n MyModel.__name__ = 'OtherModel'\n print(MyModel.__name__)\n\n assert MyModel.model_fields['a'].description == 'A docs'\n\n\ndef test_model_generic():\n class MyModel(BaseModel, Generic[T]):\n a: T\n \"\"\"A docs\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n assert MyModel.model_fields['a'].description == 'A docs'\n\n class MyParameterizedModel(MyModel[int]):\n a: int\n \"\"\"A parameterized docs\"\"\"\n\n assert MyParameterizedModel.model_fields['a'].description == 'A parameterized docs'\n assert MyModel[int].model_fields['a'].description == 'A docs'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extraction.py_test_dataclass_no_docs_extraction_test_dataclass_docs_extraction.MyModel.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_dataclass_no_docs_extraction_test_dataclass_docs_extraction.MyModel.None_8", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 198, "end_line": 246, "span_ids": ["test_dataclass_docs_extraction", "test_dataclass_no_docs_extraction"], "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_dataclass_no_docs_extraction():\n @pydantic_dataclass\n class MyModel:\n a: int = 1\n \"\"\"A docs\"\"\"\n\n b: str = '1'\n\n \"\"\"B docs\"\"\"\n\n assert MyModel.__pydantic_fields__['a'].description is None\n assert MyModel.__pydantic_fields__['b'].description is None\n\n\ndef test_dataclass_docs_extraction():\n @pydantic_dataclass(\n config=ConfigDict(use_attribute_docstrings=True),\n )\n @dec_noop\n class MyModel:\n a: int\n \"\"\"A docs\"\"\"\n b: int = 1\n\n \"\"\"B docs\"\"\"\n c: int = 1\n # This isn't used as a description.\n\n d: int = 1\n\n def dummy_method(self) -> None:\n \"\"\"Docs for dummy_method that won't be used for d\"\"\"\n\n e: int = Field(1, description='Real description')\n \"\"\"Won't be used\"\"\"\n\n f: int = 1\n \"\"\"F docs\"\"\"\n\n \"\"\"Useless docs\"\"\"\n\n g: int = 1\n \"\"\"G docs\"\"\"\n\n h = 1\n \"\"\"H docs\"\"\"\n\n i: Annotated[int, Field(description='Real description')] = 1\n \"\"\"Won't be used\"\"\"\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_docs_extraction.py_test_dataclass_docs_extraction.assert_MyModel___pydantic_test_dataclass_docs_extraction.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_dataclass_docs_extraction.assert_MyModel___pydantic_test_dataclass_docs_extraction.None_6", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 248, "end_line": 254, "span_ids": ["test_dataclass_docs_extraction"], "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_dataclass_docs_extraction():\n # ... other code\n\n assert MyModel.__pydantic_fields__['a'].description == 'A docs'\n assert MyModel.__pydantic_fields__['b'].description == 'B docs'\n assert MyModel.__pydantic_fields__['c'].description is None\n assert MyModel.__pydantic_fields__['d'].description is None\n assert MyModel.__pydantic_fields__['e'].description == 'Real description'\n assert MyModel.__pydantic_fields__['g'].description == 'G docs'\n assert MyModel.__pydantic_fields__['i'].description == 'Real description'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_typeddict_test_typeddict_as_field.assert_a_property_descri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_typeddict_test_typeddict_as_field.assert_a_property_descri", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 257, "end_line": 297, "span_ids": ["test_typeddict", "test_typeddict_as_field"], "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_typeddict():\n class MyModel(TypedDict):\n a: int\n \"\"\"A docs\"\"\"\n\n ta = TypeAdapter(MyModel)\n assert ta.json_schema() == {\n 'properties': {'a': {'title': 'A', 'type': 'integer'}},\n 'required': ['a'],\n 'title': 'MyModel',\n 'type': 'object',\n }\n\n class MyModel(TypedDict):\n a: int\n \"\"\"A docs\"\"\"\n\n __pydantic_config__ = ConfigDict(use_attribute_docstrings=True)\n\n ta = TypeAdapter(MyModel)\n\n assert ta.json_schema() == {\n 'properties': {'a': {'title': 'A', 'type': 'integer', 'description': 'A docs'}},\n 'required': ['a'],\n 'title': 'MyModel',\n 'type': 'object',\n }\n\n\ndef test_typeddict_as_field():\n class ModelTDAsField(TypedDict):\n a: int\n \"\"\"A docs\"\"\"\n\n __pydantic_config__ = ConfigDict(use_attribute_docstrings=True)\n\n class MyModel(BaseModel):\n td: ModelTDAsField\n\n a_property = MyModel.model_json_schema()['$defs']['ModelTDAsField']['properties']['a']\n assert a_property['description'] == 'A docs'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_extraction.py_test_create_model_test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_docs_extraction.py_test_create_model_test_", "embedding": null, "metadata": {"file_path": "tests/test_docs_extraction.py", "file_name": "test_docs_extraction.py", "file_type": "text/x-python", "category": "test", "start_line": 300, "end_line": 338, "span_ids": ["test_create_model_test", "test_exec_cant_be_parsed"], "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_create_model_test():\n # Duplicate class creation to ensure create_model\n # doesn't fallback to using inspect, which could\n # in turn use the wrong class:\n class MyModel(BaseModel):\n foo: str = '123'\n \"\"\"Shouldn't be used\"\"\"\n\n model_config = ConfigDict(\n use_attribute_docstrings=True,\n )\n\n assert MyModel.model_fields['foo'].description == \"Shouldn't be used\"\n\n MyModel = create_model(\n 'MyModel',\n foo=(int, 123),\n __config__=ConfigDict(use_attribute_docstrings=True),\n )\n\n assert MyModel.model_fields['foo'].description is None\n\n\ndef test_exec_cant_be_parsed():\n source = textwrap.dedent(\n '''\n class MyModel(BaseModel):\n a: int\n \"\"\"A docs\"\"\"\n\n model_config = ConfigDict(use_attribute_docstrings=True)\n '''\n )\n\n locals_dict = {}\n\n exec(source, globals(), locals_dict)\n assert locals_dict['MyModel'].model_fields['a'].description 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_typeddict_with_title_test_typeddict_with__callable_json_schema_extra.assert_TypeAdapter_Model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_typeddict_with_title_test_typeddict_with__callable_json_schema_extra.assert_TypeAdapter_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": 2548, "end_line": 2585, "span_ids": ["test_typeddict_with_json_schema_extra", "test_typeddict_with__callable_json_schema_extra", "test_typeddict_with_title"], "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 test_typeddict_with_title():\n class Model(TypedDict):\n __pydantic_config__ = ConfigDict(title='Test') # type: ignore\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Test',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n }\n\n\ndef test_typeddict_with_json_schema_extra():\n class Model(TypedDict):\n __pydantic_config__ = ConfigDict(title='Test', json_schema_extra={'foobar': 'hello'}) # type: ignore\n a: str\n\n assert TypeAdapter(Model).json_schema() == {\n 'title': 'Test',\n 'type': 'object',\n 'properties': {'a': {'title': 'A', 'type': 'string'}},\n 'required': ['a'],\n 'foobar': 'hello',\n }\n\n\ndef test_typeddict_with__callable_json_schema_extra():\n def json_schema_extra(schema, model_class):\n schema.pop('properties')\n schema['type'] = 'override'\n assert model_class is Model\n\n class Model(TypedDict):\n __pydantic_config__ = ConfigDict(title='Test', json_schema_extra=json_schema_extra) # type: ignore\n a: str\n\n assert TypeAdapter(Model).json_schema() == {'title': 'Test', 'type': 'override', 'required': ['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_json_schema.py_test_repeated_custom_type_test_repeated_custom_type.with_pytest_raises_Valida.OuterModel_x_2_y_1_z_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_repeated_custom_type_test_repeated_custom_type.with_pytest_raises_Valida.OuterModel_x_2_y_1_z_", "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": 5885, "end_line": 5914, "span_ids": ["test_repeated_custom_type"], "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_repeated_custom_type():\n class Numeric(pydantic.BaseModel):\n value: float\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: pydantic.GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_before_validator_function(cls.validate, handler(source_type))\n\n @classmethod\n def validate(cls, v: Any) -> Union[Dict[str, Any], Self]:\n if isinstance(v, (str, float, int)):\n return cls(value=v)\n if isinstance(v, Numeric):\n return v\n if isinstance(v, dict):\n return v\n raise ValueError(f'Invalid value for {cls}: {v}')\n\n def is_positive(value: Numeric):\n assert value.value > 0.0, 'Must be positive'\n\n class OuterModel(pydantic.BaseModel):\n x: Numeric\n y: Numeric\n z: Annotated[Numeric, AfterValidator(is_positive)]\n\n assert OuterModel(x=2, y=-1, z=1)\n\n with pytest.raises(ValidationError):\n OuterModel(x=2, y=-1, 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/test_types.py_test_pattern_error_test_strict_secretfield_by_config.with_pytest_raises_Valida.Foobar_value_value_": {"__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_strict_secretfield_by_config.with_pytest_raises_Valida.Foobar_value_value_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 3949, "end_line": 4201, "span_ids": ["test_secretstr_subclass", "test_secretstr_equality", "SecretDate", "SecretDate._display", "test_strict_secretfield_by_config", "test_secretenum_json_serializable", "test_secretstr", "test_secretdate", "test_secretdate_json_serializable", "impl:15", "SampleEnum", "test_pattern_error", "test_secretstr_idempotent"], "tokens": 2002}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ('pattern_type', 'pattern_value', 'error_type', 'error_msg'),\n [\n pytest.param(\n re.Pattern,\n '[xx',\n 'pattern_regex',\n 'Input should be a valid regular expression',\n id='re.Pattern-pattern_regex',\n ),\n pytest.param(\n Pattern, '[xx', 'pattern_regex', 'Input should be a valid regular expression', id='re.Pattern-pattern_regex'\n ),\n pytest.param(\n re.Pattern, (), 'pattern_type', 'Input should be a valid pattern', id='typing.Pattern-pattern_type'\n ),\n pytest.param(Pattern, (), 'pattern_type', 'Input should be a valid pattern', id='typing.Pattern-pattern_type'),\n pytest.param(\n Pattern[str],\n re.compile(b''),\n 'pattern_str_type',\n 'Input should be a string pattern',\n id='typing.Pattern[str]-pattern_str_type-non_str',\n ),\n pytest.param(\n Pattern[str],\n b'',\n 'pattern_str_type',\n 'Input should be a string pattern',\n id='typing.Pattern[str]-pattern_str_type-bytes',\n ),\n pytest.param(\n Pattern[str], (), 'pattern_type', 'Input should be a valid pattern', id='typing.Pattern[str]-pattern_type'\n ),\n pytest.param(\n Pattern[bytes],\n re.compile(''),\n 'pattern_bytes_type',\n 'Input should be a bytes pattern',\n id='typing.Pattern[bytes]-pattern_bytes_type-non_bytes',\n ),\n pytest.param(\n Pattern[bytes],\n '',\n 'pattern_bytes_type',\n 'Input should be a bytes pattern',\n id='typing.Pattern[bytes]-pattern_bytes_type-str',\n ),\n pytest.param(\n Pattern[bytes],\n (),\n 'pattern_type',\n 'Input should be a valid pattern',\n id='typing.Pattern[bytes]-pattern_type',\n ),\n ],\n)\ndef test_pattern_error(pattern_type, pattern_value, error_type, error_msg):\n class Foobar(BaseModel):\n pattern: pattern_type\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(pattern=pattern_value)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {'type': error_type, 'loc': ('pattern',), 'msg': error_msg, 'input': pattern_value}\n ]\n\n\n@pytest.mark.parametrize('validate_json', [True, False])\ndef test_secretstr(validate_json):\n class Foobar(BaseModel):\n password: SecretStr\n empty_password: SecretStr\n\n if validate_json:\n f = Foobar.model_validate_json('{\"password\": \"1234\", \"empty_password\": \"\"}')\n with pytest.raises(ValidationError) as exc_info:\n Foobar.model_validate_json('{\"password\": 1234, \"empty_password\": null}')\n else:\n f = Foobar(password='1234', empty_password='')\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password=1234, empty_password=None)\n\n assert exc_info.value.errors(include_url=False) == [\n {'type': 'string_type', 'loc': ('password',), 'msg': 'Input should be a valid string', 'input': 1234},\n {'type': 'string_type', 'loc': ('empty_password',), 'msg': 'Input should be a valid string', 'input': None},\n ]\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 assert len(f.password) == 4\n assert len(f.empty_password) == 0\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() == ''\n\n\ndef test_secretstr_subclass():\n class DecryptableStr(SecretStr):\n \"\"\"\n Simulate a SecretStr with decryption capabilities.\n \"\"\"\n\n def decrypt_value(self) -> str:\n return f'MOCK DECRYPTED {self.get_secret_value()}'\n\n class Foobar(BaseModel):\n password: DecryptableStr\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__ == 'DecryptableStr'\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) == \"DecryptableStr('**********')\"\n assert repr(f.empty_password) == \"SecretStr('')\"\n assert len(f.password) == 4\n assert len(f.empty_password) == 0\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() == ''\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\nclass SecretDate(Secret[date]):\n def _display(self) -> str:\n return '****/**/**'\n\n\nclass SampleEnum(str, Enum):\n foo = 'foo'\n bar = 'bar'\n\n\nSecretEnum = Secret[SampleEnum]\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 (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 (19_999_958_400, date(2603, 10, 11)), # just before watershed\n ],\n)\ndef test_secretdate(value, result):\n class Foobar(BaseModel):\n value: SecretDate\n\n f = Foobar(value=value)\n\n # Assert correct type.\n assert f.value.__class__.__name__ == 'SecretDate'\n\n # Assert str and repr are correct.\n assert str(f.value) == '****/**/**'\n assert repr(f.value) == \"SecretDate('****/**/**')\"\n\n # Assert retrieval of secret value is correct\n assert f.value.get_secret_value() == result\n\n\ndef test_secretdate_json_serializable():\n class _SecretDate(Secret[date]):\n def _display(self) -> str:\n return '****/**/**'\n\n SecretDate = Annotated[\n _SecretDate,\n PlainSerializer(lambda v: v.get_secret_value().strftime('%Y-%m-%d'), when_used='json'),\n ]\n\n class Foobar(BaseModel):\n value: SecretDate\n\n f = Foobar(value='2017-01-01')\n\n assert '2017-01-01' in f.model_dump_json()\n\n\ndef test_secretenum_json_serializable():\n class SampleEnum(str, Enum):\n foo = 'foo'\n bar = 'bar'\n\n SecretEnum = Annotated[\n Secret[SampleEnum],\n PlainSerializer(lambda v: v.get_secret_value(), when_used='json'),\n ]\n\n class Foobar(BaseModel):\n value: SecretEnum\n\n f = Foobar(value='foo')\n\n assert f.model_dump_json() == '{\"value\":\"foo\"}'\n\n\n@pytest.mark.parametrize(\n 'SecretField, value, error_msg',\n [\n (SecretDate, 'not-a-date', r'Input should be a valid date'),\n (SecretStr, 0, r'Input should be a valid string \\[type=string_type,'),\n (SecretBytes, 0, r'Input should be a valid bytes \\[type=bytes_type,'),\n (SecretEnum, 0, r'Input should be an instance of SampleEnum'),\n ],\n)\ndef test_strict_secretfield_by_config(SecretField, value, error_msg):\n class Foobar(BaseModel):\n model_config = ConfigDict(strict=True)\n value: SecretField\n\n with pytest.raises(ValidationError, match=error_msg):\n Foobar(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_strict_secretfield_annotated_test_secretdate_parsing.with_pytest_raises_Valida.FooBar_d_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_strict_secretfield_annotated_test_secretdate_parsing.with_pytest_raises_Valida.FooBar_d_value_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 4204, "end_line": 4245, "span_ids": ["test_strict_secretfield_annotated", "test_secretdate_parsing"], "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": "@pytest.mark.parametrize(\n 'field, value, error_msg',\n [\n (date, 'not-a-date', r'Input should be a valid date'),\n (str, 0, r'Input should be a valid string \\[type=string_type,'),\n (bytes, 0, r'Input should be a valid bytes \\[type=bytes_type,'),\n (SampleEnum, 0, r'Input should be an instance of SampleEnum'),\n ],\n)\ndef test_strict_secretfield_annotated(field, value, error_msg):\n SecretField = Annotated[field, Strict()]\n\n class Foobar(BaseModel):\n value: Secret[SecretField]\n\n with pytest.raises(ValidationError, match=error_msg):\n Foobar(value=value)\n\n\n@pytest.mark.parametrize(\n 'value',\n [\n datetime(2012, 4, 9, 12, 15),\n 'x20120423',\n '2012-04-56',\n 20000044800, # just after watershed\n 1_549_238_400_000_000, # nowish in \u03bcs\n 1_549_238_400_000_000_000, # nowish in ns\n 'infinity',\n float('inf'),\n int('1' + '0' * 100),\n 1e1000,\n float('-infinity'),\n float('nan'),\n ],\n)\ndef test_secretdate_parsing(value):\n class FooBar(BaseModel):\n d: SecretDate\n\n with pytest.raises(ValidationError):\n FooBar(d=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_secretdate_equality_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_secretdate_equality_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": 4248, "end_line": 4522, "span_ids": ["test_secretbytes_idempotent", "test_secret_str_min_max_length", "test_model_contain_hashable_type", "test_secret_str_hashable", "test_secretdate_idempotent", "test_secret_bytes_hashable", "test_is_hashable", "test_secretbytes_equality", "test_secret_bytes_min_max_length", "test_generic_without_params", "test_secretbytes_error", "test_secretbytes_json", "test_generic_without_params_error", "test_secretstr_error", "test_secretdate_equality", "test_secretbytes"], "tokens": 2018}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_secretdate_equality():\n assert SecretDate('2017-01-01') == SecretDate('2017-01-01')\n assert SecretDate('2017-01-01') != SecretDate('2018-01-01')\n assert SecretDate(date(2017, 1, 1)) != date(2017, 1, 1)\n assert SecretDate('2017-01-01') is not SecretDate('2017-01-01')\n\n\ndef test_secretdate_idempotent():\n class Foobar(BaseModel):\n value: SecretDate\n\n # Should not raise an exception\n m = Foobar(value=SecretDate(date(2017, 1, 1)))\n assert m.value.get_secret_value() == date(2017, 1, 1)\n\n\n@pytest.mark.parametrize(\n 'pydantic_type',\n [\n Strict,\n StrictBool,\n conint,\n PositiveInt,\n NegativeInt,\n NonPositiveInt,\n NonNegativeInt,\n StrictInt,\n confloat,\n PositiveFloat,\n NegativeFloat,\n NonPositiveFloat,\n NonNegativeFloat,\n StrictFloat,\n FiniteFloat,\n conbytes,\n Secret,\n SecretBytes,\n constr,\n StrictStr,\n SecretStr,\n ImportString,\n conset,\n confrozenset,\n conlist,\n condecimal,\n UUID1,\n UUID3,\n UUID4,\n UUID5,\n FilePath,\n DirectoryPath,\n NewPath,\n Json,\n ByteSize,\n condate,\n PastDate,\n FutureDate,\n PastDatetime,\n FutureDatetime,\n AwareDatetime,\n NaiveDatetime,\n ],\n)\ndef test_is_hashable(pydantic_type):\n assert type(hash(pydantic_type)) is int\n\n\ndef test_model_contain_hashable_type():\n class MyModel(BaseModel):\n v: Union[str, StrictStr]\n\n assert MyModel(v='test').v == 'test'\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'string_type',\n 'loc': ('password',),\n 'msg': 'Input should be a valid string',\n 'input': [6, 23, 'abc'],\n }\n ]\n\n\ndef test_secret_str_hashable():\n assert type(hash(SecretStr('abs'))) is int\n\n\ndef test_secret_bytes_hashable():\n assert type(hash(SecretBytes(b'abs'))) is int\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_short',\n 'loc': ('password',),\n 'msg': 'Value should have at least 6 items after validation, not 0',\n 'input': '',\n 'ctx': {'field_type': 'Value', 'min_length': 6, 'actual_length': 0},\n }\n ]\n\n with pytest.raises(ValidationError) as exc_info:\n Foobar(password='1' * 20)\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': ('password',),\n 'msg': 'Value should have at most 10 items after validation, not 20',\n 'input': '11111111111111111111',\n 'ctx': {'field_type': 'Value', 'max_length': 10, 'actual_length': 20},\n }\n ]\n\n value = '1' * 8\n assert Foobar(password=value).password.get_secret_value() == value\n\n\ndef test_secretbytes_json():\n class Foobar(BaseModel):\n password: SecretBytes\n\n assert Foobar(password='foo').model_dump_json() == '{\"password\":\"**********\"}'\n\n\ndef test_secretbytes():\n class Foobar(BaseModel):\n password: SecretBytes\n empty_password: SecretBytes\n\n # Initialize the model.\n # Use bytes that can't be decoded with UTF8 (https://github.com/pydantic/pydantic/issues/7971)\n password = b'\\x89PNG\\r\\n\\x1a\\n'\n f = Foobar(password=password, 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() == password\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\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_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'bytes_type',\n 'loc': ('password',),\n 'msg': 'Input should be a valid bytes',\n 'input': [6, 23, 'abc'],\n }\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_short',\n 'loc': ('password',),\n 'msg': 'Value should have at least 6 items after validation, not 0',\n 'input': b'',\n 'ctx': {'field_type': 'Value', 'min_length': 6, 'actual_length': 0},\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_long',\n 'loc': ('password',),\n 'msg': 'Value should have at most 10 items after validation, not 20',\n 'input': b'11111111111111111111',\n 'ctx': {'field_type': 'Value', 'max_length': 10, 'actual_length': 20},\n }\n ]\n\n value = b'1' * 8\n assert Foobar(password=value).password.get_secret_value() == value\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_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_literal_single_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": 4525, "end_line": 4754, "span_ids": ["test_bytesize_conversions", "test_typing_mutable_set", "test_bytesize_raises", "test_deque_generic_success", "test_deque_generic_success_strict", "test_frozenset_field", "test_frozenset_field_conversion", "test_frozenset_field_not_convertible", "test_deque_success", "test_bytesize_to", "test_literal_single", "test_literal_multiple"], "tokens": 2045}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'literal_error',\n 'loc': ('a',),\n 'msg': \"Input should be 'a'\",\n 'input': 'b',\n 'ctx': {'expected': \"'a'\"},\n }\n ]\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_typing_mutable_set():\n s1 = TypeAdapter(Set[int]).core_schema\n s1.pop('metadata', None)\n s2 = TypeAdapter(typing.MutableSet[int]).core_schema\n s2.pop('metadata', None)\n assert s1 == s2\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\n\n\n@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)\n\n\n@pytest.mark.parametrize(\n 'input_value,output,human_bin,human_dec,human_sep',\n (\n (1, 1, '1B', '1B', '1 B'),\n ('1', 1, '1B', '1B', '1 B'),\n ('1.0', 1, '1B', '1B', '1 B'),\n ('1b', 1, '1B', '1B', '1 B'),\n ('1.5 KB', int(1.5e3), '1.5KiB', '1.5KB', '1.5 KiB'),\n ('1.5 K', int(1.5e3), '1.5KiB', '1.5KB', '1.5 KiB'),\n ('1.5 MB', int(1.5e6), '1.4MiB', '1.5MB', '1.4 MiB'),\n ('1.5 M', int(1.5e6), '1.4MiB', '1.5MB', '1.4 MiB'),\n ('5.1kib', 5222, '5.1KiB', '5.2KB', '5.1 KiB'),\n ('6.2EiB', 7148113328562451456, '6.2EiB', '7.1EB', '6.2 EiB'),\n ('8bit', 1, '1B', '1B', '1 B'),\n ('1kbit', 125, '125B', '125B', '125 B'),\n ),\n)\ndef test_bytesize_conversions(input_value, output, human_bin, human_dec, human_sep):\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\n assert m.size.human_readable(separator=' ') == human_sep\n\n\ndef 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 assert m.size.to('bit') == pytest.approx(8589934592)\n assert m.size.to('kbit') == pytest.approx(8589934.592)\n\n\ndef test_bytesize_raises():\n class Model(BaseModel):\n size: ByteSize\n\n with pytest.raises(ValidationError, match='parse value') as exc_info:\n Model(size='d1MB')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'd1MB',\n 'loc': ('size',),\n 'msg': 'could not parse value and unit from byte string',\n 'type': 'byte_size',\n }\n ]\n\n with pytest.raises(ValidationError, match='byte unit') as exc_info:\n Model(size='1LiB')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'unit': 'LiB'},\n 'input': '1LiB',\n 'loc': ('size',),\n 'msg': 'could not interpret byte unit: LiB',\n 'type': 'byte_size_unit',\n }\n ]\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 with pytest.raises(PydanticCustomError, match='byte unit'):\n m.size.to('1ZiB')\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])\n\n\n@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 float,\n {1, 2, 3},\n deque([1, 2, 3]),\n ),\n (\n float,\n frozenset((1, 2, 3)),\n deque([1, 2, 3]),\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\n\n\n@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_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_deque_fails_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": 4757, "end_line": 4966, "span_ids": ["test_deque_json", "test_none", "test_deque_typed_maxlen", "test_deque_fails", "test_deque_any_maxlen", "test_deque_model", "test_deque_set_maxlen"], "tokens": 1771}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 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(include_url=False))\n assert len(exc_info.value.errors(include_url=False)) == 1\n assert expected_error == exc_info.value.errors(include_url=False)[0]\n\n\ndef 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]}'\n\n\ndef test_deque_any_maxlen():\n class DequeModel1(BaseModel):\n field: deque\n\n assert DequeModel1(field=deque()).field.maxlen is None\n assert DequeModel1(field=deque(maxlen=8)).field.maxlen == 8\n\n class DequeModel2(BaseModel):\n field: deque = deque()\n\n assert DequeModel2().field.maxlen is None\n assert DequeModel2(field=deque()).field.maxlen is None\n assert DequeModel2(field=deque(maxlen=8)).field.maxlen == 8\n\n class DequeModel3(BaseModel):\n field: deque = deque(maxlen=5)\n\n assert DequeModel3().field.maxlen == 5\n assert DequeModel3(field=deque()).field.maxlen is None\n assert DequeModel3(field=deque(maxlen=8)).field.maxlen == 8\n\n\ndef test_deque_typed_maxlen():\n class DequeModel1(BaseModel):\n field: Deque[int]\n\n assert DequeModel1(field=deque()).field.maxlen is None\n assert DequeModel1(field=deque(maxlen=8)).field.maxlen == 8\n\n class DequeModel2(BaseModel):\n field: Deque[int] = deque()\n\n assert DequeModel2().field.maxlen is None\n assert DequeModel2(field=deque()).field.maxlen is None\n assert DequeModel2(field=deque(maxlen=8)).field.maxlen == 8\n\n class DequeModel3(BaseModel):\n field: Deque[int] = deque(maxlen=5)\n\n assert DequeModel3().field.maxlen == 5\n assert DequeModel3(field=deque()).field.maxlen is None\n assert DequeModel3(field=deque(maxlen=8)).field.maxlen == 8\n\n\ndef test_deque_set_maxlen():\n class DequeModel1(BaseModel):\n field: Annotated[Deque[int], Field(max_length=10)]\n\n assert DequeModel1(field=deque()).field.maxlen == 10\n assert DequeModel1(field=deque(maxlen=8)).field.maxlen == 8\n assert DequeModel1(field=deque(maxlen=15)).field.maxlen == 10\n\n class DequeModel2(BaseModel):\n field: Annotated[Deque[int], Field(max_length=10)] = deque()\n\n assert DequeModel2().field.maxlen is None\n assert DequeModel2(field=deque()).field.maxlen == 10\n assert DequeModel2(field=deque(maxlen=8)).field.maxlen == 8\n assert DequeModel2(field=deque(maxlen=15)).field.maxlen == 10\n\n class DequeModel3(DequeModel2):\n model_config = ConfigDict(validate_default=True)\n\n assert DequeModel3().field.maxlen == 10\n\n class DequeModel4(BaseModel):\n field: Annotated[Deque[int], Field(max_length=10)] = deque(maxlen=5)\n\n assert DequeModel4().field.maxlen == 5\n\n class DequeModel5(DequeModel4):\n model_config = ConfigDict(validate_default=True)\n\n assert DequeModel4().field.maxlen == 5\n\n\n@pytest.mark.parametrize('value_type', (None, type(None), None.__class__))\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': {'type': 'null', 'title': 'My None'},\n 'my_none_list': {'type': 'array', 'items': {'type': 'null'}, 'title': 'My None List'},\n 'my_none_dict': {'type': 'object', 'additionalProperties': {'type': 'null'}, 'title': 'My None Dict'},\n 'my_json_none': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'type': 'null'},\n 'title': 'My Json None',\n 'type': 'string',\n },\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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_none_literal_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_none_literal_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": 4969, "end_line": 5207, "span_ids": ["test_smart_union_compounded_types_edge_case", "test_union_uuid_str_left_to_right", "test_union_subclass", "test_default_union_types_left_to_right", "test_default_union_types", "test_none_literal", "test_union_enum_int_left_to_right", "test_union_typeddict", "test_default_union_class", "test_union_compound_types"], "tokens": 2097}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_literal():\n class Model(BaseModel):\n my_none: Literal[None]\n my_none_list: List[Literal[None]]\n my_none_dict: Dict[str, Literal[None]]\n my_json_none: Json[Literal[None]]\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 # insert_assert(Model.model_json_schema())\n assert Model.model_json_schema() == {\n 'title': 'Model',\n 'type': 'object',\n 'properties': {\n 'my_none': {'const': None, 'enum': [None], 'title': 'My None'},\n 'my_none_list': {'items': {'const': None, 'enum': [None]}, 'title': 'My None List', 'type': 'array'},\n 'my_none_dict': {\n 'additionalProperties': {'const': None, 'enum': [None]},\n 'title': 'My None Dict',\n 'type': 'object',\n },\n 'my_json_none': {\n 'contentMediaType': 'application/json',\n 'contentSchema': {'const': None, 'enum': [None]},\n 'title': 'My Json None',\n 'type': 'string',\n },\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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'literal_error',\n 'loc': ('my_none',),\n 'msg': 'Input should be None',\n 'input': 'qwe',\n 'ctx': {'expected': 'None'},\n },\n {\n 'type': 'literal_error',\n 'loc': ('my_none_list', 0),\n 'msg': 'Input should be None',\n 'input': 1,\n 'ctx': {'expected': 'None'},\n },\n {\n 'type': 'literal_error',\n 'loc': ('my_none_list', 2),\n 'msg': 'Input should be None',\n 'input': 'qwe',\n 'ctx': {'expected': 'None'},\n },\n {\n 'type': 'literal_error',\n 'loc': ('my_none_dict', 'a'),\n 'msg': 'Input should be None',\n 'input': 1,\n 'ctx': {'expected': 'None'},\n },\n {\n 'type': 'literal_error',\n 'loc': ('my_json_none',),\n 'msg': 'Input should be None',\n 'input': 'a',\n 'ctx': {'expected': 'None'},\n },\n ]\n\n\ndef 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 }\n\n\ndef test_default_union_types_left_to_right():\n class DefaultModel(BaseModel):\n v: Annotated[Union[int, bool, str], Field(union_mode='left_to_right')]\n\n print(DefaultModel.__pydantic_core_schema__)\n\n # int will coerce everything in left-to-right mode\n assert repr(DefaultModel(v=True).v) == '1'\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 }\n\n\ndef test_union_enum_int_left_to_right():\n class BinaryEnum(IntEnum):\n ZERO = 0\n ONE = 1\n\n # int will win over enum in this case\n assert TypeAdapter(Union[BinaryEnum, int]).validate_python(0) is not BinaryEnum.ZERO\n\n # in left to right mode, enum will validate successfully and take precedence\n assert (\n TypeAdapter(Annotated[Union[BinaryEnum, int], Field(union_mode='left_to_right')]).validate_python(0)\n is BinaryEnum.ZERO\n )\n\n\ndef test_union_uuid_str_left_to_right():\n IdOrSlug = Union[UUID, str]\n\n # in smart mode JSON and python are currently validated differently in this\n # case, because in Python this is a str but in JSON a str is also a UUID\n assert TypeAdapter(IdOrSlug).validate_json('\"f4fe10b4-e0c8-4232-ba26-4acd491c2414\"') == UUID(\n 'f4fe10b4-e0c8-4232-ba26-4acd491c2414'\n )\n assert (\n TypeAdapter(IdOrSlug).validate_python('f4fe10b4-e0c8-4232-ba26-4acd491c2414')\n == 'f4fe10b4-e0c8-4232-ba26-4acd491c2414'\n )\n\n IdOrSlugLTR = Annotated[Union[UUID, str], Field(union_mode='left_to_right')]\n\n # in left to right mode both JSON and python are validated as UUID\n assert TypeAdapter(IdOrSlugLTR).validate_json('\"f4fe10b4-e0c8-4232-ba26-4acd491c2414\"') == UUID(\n 'f4fe10b4-e0c8-4232-ba26-4acd491c2414'\n )\n assert TypeAdapter(IdOrSlugLTR).validate_python('f4fe10b4-e0c8-4232-ba26-4acd491c2414') == UUID(\n 'f4fe10b4-e0c8-4232-ba26-4acd491c2414'\n )\n\n\ndef 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\n@pytest.mark.parametrize('max_length', [10, None])\ndef test_union_subclass(max_length: Union[int, None]):\n class MyStr(str):\n ...\n\n class Model(BaseModel):\n x: Union[int, Annotated[str, Field(max_length=max_length)]]\n\n v = Model(x=MyStr('1')).x\n assert type(v) is str\n assert v == '1'\n\n\ndef 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(include_url=False))\n assert e.value.errors(include_url=False) == [\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 ]\n\n\ndef 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_test_base64url.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.py_test_custom_generic_containers_test_base64url.assert_Model_model_json_s", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 5205, "end_line": 5381, "span_ids": ["test_base64_invalid", "test_custom_generic_containers", "test_base64url", "test_base64"], "tokens": 1982}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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 @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(GenericList, handler(List[get_args(source_type)[0]]))\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(include_url=False) == [\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 ]\n\n\n@pytest.mark.parametrize(\n ('field_type', 'input_data', 'expected_value', 'serialized_data'),\n [\n pytest.param(Base64Bytes, b'Zm9vIGJhcg==\\n', b'foo bar', b'Zm9vIGJhcg==\\n', id='Base64Bytes-reversible'),\n pytest.param(Base64Str, 'Zm9vIGJhcg==\\n', 'foo bar', 'Zm9vIGJhcg==\\n', id='Base64Str-reversible'),\n pytest.param(Base64Bytes, b'Zm9vIGJhcg==', b'foo bar', b'Zm9vIGJhcg==\\n', id='Base64Bytes-bytes-input'),\n pytest.param(Base64Bytes, 'Zm9vIGJhcg==', b'foo bar', b'Zm9vIGJhcg==\\n', id='Base64Bytes-str-input'),\n pytest.param(\n Base64Bytes, bytearray(b'Zm9vIGJhcg=='), b'foo bar', b'Zm9vIGJhcg==\\n', id='Base64Bytes-bytearray-input'\n ),\n pytest.param(Base64Str, b'Zm9vIGJhcg==', 'foo bar', 'Zm9vIGJhcg==\\n', id='Base64Str-bytes-input'),\n pytest.param(Base64Str, 'Zm9vIGJhcg==', 'foo bar', 'Zm9vIGJhcg==\\n', id='Base64Str-str-input'),\n pytest.param(\n Base64Str, bytearray(b'Zm9vIGJhcg=='), 'foo bar', 'Zm9vIGJhcg==\\n', id='Base64Str-bytearray-input'\n ),\n pytest.param(\n Base64Bytes,\n b'BCq+6+1/Paun/Q==',\n b'\\x04*\\xbe\\xeb\\xed\\x7f=\\xab\\xa7\\xfd',\n b'BCq+6+1/Paun/Q==\\n',\n id='Base64Bytes-bytes-alphabet-vanilla',\n ),\n ],\n)\ndef test_base64(field_type, input_data, expected_value, serialized_data):\n class Model(BaseModel):\n base64_value: field_type\n base64_value_or_none: Optional[field_type] = None\n\n m = Model(base64_value=input_data)\n assert m.base64_value == expected_value\n\n m = Model.model_construct(base64_value=expected_value)\n assert m.base64_value == expected_value\n\n assert m.model_dump() == {\n 'base64_value': serialized_data,\n 'base64_value_or_none': None,\n }\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'base64_value': {\n 'format': 'base64',\n 'title': 'Base64 Value',\n 'type': 'string',\n },\n 'base64_value_or_none': {\n 'anyOf': [{'type': 'string', 'format': 'base64'}, {'type': 'null'}],\n 'default': None,\n 'title': 'Base64 Value Or None',\n },\n },\n 'required': ['base64_value'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n\n@pytest.mark.parametrize(\n ('field_type', 'input_data'),\n [\n pytest.param(Base64Bytes, b'Zm9vIGJhcg', id='Base64Bytes-invalid-base64-bytes'),\n pytest.param(Base64Bytes, 'Zm9vIGJhcg', id='Base64Bytes-invalid-base64-str'),\n pytest.param(Base64Str, b'Zm9vIGJhcg', id='Base64Str-invalid-base64-bytes'),\n pytest.param(Base64Str, 'Zm9vIGJhcg', id='Base64Str-invalid-base64-str'),\n ],\n)\ndef test_base64_invalid(field_type, input_data):\n class Model(BaseModel):\n base64_value: field_type\n\n with pytest.raises(ValidationError) as e:\n Model(base64_value=input_data)\n\n assert e.value.errors(include_url=False) == [\n {\n 'ctx': {'error': 'Incorrect padding'},\n 'input': input_data,\n 'loc': ('base64_value',),\n 'msg': \"Base64 decoding error: 'Incorrect padding'\",\n 'type': 'base64_decode',\n },\n ]\n\n\n@pytest.mark.parametrize(\n ('field_type', 'input_data', 'expected_value', 'serialized_data'),\n [\n pytest.param(Base64UrlBytes, b'Zm9vIGJhcg==\\n', b'foo bar', b'Zm9vIGJhcg==', id='Base64UrlBytes-reversible'),\n pytest.param(Base64UrlStr, 'Zm9vIGJhcg==\\n', 'foo bar', 'Zm9vIGJhcg==', id='Base64UrlStr-reversible'),\n pytest.param(Base64UrlBytes, b'Zm9vIGJhcg==', b'foo bar', b'Zm9vIGJhcg==', id='Base64UrlBytes-bytes-input'),\n pytest.param(Base64UrlBytes, 'Zm9vIGJhcg==', b'foo bar', b'Zm9vIGJhcg==', id='Base64UrlBytes-str-input'),\n pytest.param(\n Base64UrlBytes, bytearray(b'Zm9vIGJhcg=='), b'foo bar', b'Zm9vIGJhcg==', id='Base64UrlBytes-bytearray-input'\n ),\n pytest.param(Base64UrlStr, b'Zm9vIGJhcg==', 'foo bar', 'Zm9vIGJhcg==', id='Base64UrlStr-bytes-input'),\n pytest.param(Base64UrlStr, 'Zm9vIGJhcg==', 'foo bar', 'Zm9vIGJhcg==', id='Base64UrlStr-str-input'),\n pytest.param(\n Base64UrlStr, bytearray(b'Zm9vIGJhcg=='), 'foo bar', 'Zm9vIGJhcg==', id='Base64UrlStr-bytearray-input'\n ),\n pytest.param(\n Base64UrlBytes,\n b'BCq-6-1_Paun_Q==',\n b'\\x04*\\xbe\\xeb\\xed\\x7f=\\xab\\xa7\\xfd',\n b'BCq-6-1_Paun_Q==',\n id='Base64UrlBytes-bytes-alphabet-url',\n ),\n pytest.param(\n Base64UrlBytes,\n b'BCq+6+1/Paun/Q==',\n b'\\x04*\\xbe\\xeb\\xed\\x7f=\\xab\\xa7\\xfd',\n b'BCq-6-1_Paun_Q==',\n id='Base64UrlBytes-bytes-alphabet-vanilla',\n ),\n ],\n)\ndef test_base64url(field_type, input_data, expected_value, serialized_data):\n class Model(BaseModel):\n base64url_value: field_type\n base64url_value_or_none: Optional[field_type] = None\n\n m = Model(base64url_value=input_data)\n assert m.base64url_value == expected_value\n\n m = Model.model_construct(base64url_value=expected_value)\n assert m.base64url_value == expected_value\n\n assert m.model_dump() == {\n 'base64url_value': serialized_data,\n 'base64url_value_or_none': None,\n }\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'base64url_value': {\n 'format': 'base64url',\n 'title': 'Base64Url Value',\n 'type': 'string',\n },\n 'base64url_value_or_none': {\n 'anyOf': [{'type': 'string', 'format': 'base64url'}, {'type': 'null'}],\n 'default': None,\n 'title': 'Base64Url Value Or None',\n },\n },\n 'required': ['base64url_value'],\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_types.py_test_base64url_invalid_test_ordered_dict_from_dict.assert_m_model_json_schem": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_base64url_invalid_test_ordered_dict_from_dict.assert_m_model_json_schem", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 5384, "end_line": 5629, "span_ids": ["test_defaultdict_unknown_default_factory", "test_base64url_invalid", "test_defaultdict_default_factory_preserved", "test_defaultdict_infer_default_factory", "test_typing_counter_value_validation", "test_sequence_subclass_without_core_schema", "test_mapping_subclass_without_core_schema", "test_ordered_dict_from_ordered_dict_typed", "test_custom_default_dict", "test_ordered_dict_from_ordered_dict", "test_typing_coercion_defaultdict", "test_ordered_dict_from_dict", "test_typing_coercion_counter", "test_defaultdict_explicit_default_factory"], "tokens": 1989}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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', 'input_data'),\n [\n pytest.param(Base64UrlBytes, b'Zm9vIGJhcg', id='Base64UrlBytes-invalid-base64-bytes'),\n pytest.param(Base64UrlBytes, 'Zm9vIGJhcg', id='Base64UrlBytes-invalid-base64-str'),\n pytest.param(Base64UrlStr, b'Zm9vIGJhcg', id='Base64UrlStr-invalid-base64-bytes'),\n pytest.param(Base64UrlStr, 'Zm9vIGJhcg', id='Base64UrlStr-invalid-base64-str'),\n ],\n)\ndef test_base64url_invalid(field_type, input_data):\n class Model(BaseModel):\n base64url_value: field_type\n\n with pytest.raises(ValidationError) as e:\n Model(base64url_value=input_data)\n\n assert e.value.errors(include_url=False) == [\n {\n 'ctx': {'error': 'Incorrect padding'},\n 'input': input_data,\n 'loc': ('base64url_value',),\n 'msg': \"Base64 decoding error: 'Incorrect padding'\",\n 'type': 'base64_decode',\n },\n ]\n\n\ndef test_sequence_subclass_without_core_schema() -> None:\n class MyList(List[int]):\n # The point of this is that subclasses can do arbitrary things\n # This is the reason why we don't try to handle them automatically\n # TBD if we introspect `__init__` / `__new__`\n # (which is the main thing that would mess us up if modified in a subclass)\n # and automatically handle cases where the subclass doesn't override it.\n # There's still edge cases (again, arbitrary behavior...)\n # and it's harder to explain, but could lead to a better user experience in some cases\n # It will depend on how the complaints (which have and will happen in both directions)\n # balance out\n def __init__(self, *args: Any, required: int, **kwargs: Any) -> None:\n super().__init__(*args, **kwargs)\n\n with pytest.raises(\n PydanticSchemaGenerationError, match='implement `__get_pydantic_core_schema__` on your type to fully support it'\n ):\n\n class _(BaseModel):\n x: MyList\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})\"\n\n\ndef 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(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\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 ]\n\n\ndef test_mapping_subclass_without_core_schema() -> None:\n class MyDict(Dict[int, int]):\n # The point of this is that subclasses can do arbitrary things\n # This is the reason why we don't try to handle them automatically\n # TBD if we introspect `__init__` / `__new__`\n # (which is the main thing that would mess us up if modified in a subclass)\n # and automatically handle cases where the subclass doesn't override it.\n # There's still edge cases (again, arbitrary behavior...)\n # and it's harder to explain, but could lead to a better user experience in some cases\n # It will depend on how the complaints (which have and will happen in both directions)\n # balance out\n def __init__(self, *args: Any, required: int, **kwargs: Any) -> None:\n super().__init__(*args, **kwargs)\n\n with pytest.raises(\n PydanticSchemaGenerationError, match='implement `__get_pydantic_core_schema__` on your type to fully support it'\n ):\n\n class _(BaseModel):\n x: MyDict\n\n\ndef test_defaultdict_unknown_default_factory() -> None:\n \"\"\"\n https://github.com/pydantic/pydantic/issues/4687\n \"\"\"\n with pytest.raises(\n PydanticSchemaGenerationError,\n match=r'Unable to infer a default factory for keys of type typing.DefaultDict\\[int, int\\]',\n ):\n\n class Model(BaseModel):\n d: DefaultDict[int, DefaultDict[int, int]]\n\n\ndef test_defaultdict_infer_default_factory() -> None:\n class Model(BaseModel):\n a: DefaultDict[int, List[int]]\n b: DefaultDict[int, int]\n c: DefaultDict[int, set]\n\n m = Model(a={}, b={}, c={})\n assert m.a.default_factory is not None\n assert m.a.default_factory() == []\n assert m.b.default_factory is not None\n assert m.b.default_factory() == 0\n assert m.c.default_factory is not None\n assert m.c.default_factory() == set()\n\n\ndef test_defaultdict_explicit_default_factory() -> None:\n class MyList(List[int]):\n pass\n\n class Model(BaseModel):\n a: DefaultDict[int, Annotated[List[int], Field(default_factory=lambda: MyList())]]\n\n m = Model(a={})\n assert m.a.default_factory is not None\n assert isinstance(m.a.default_factory(), MyList)\n\n\ndef test_defaultdict_default_factory_preserved() -> None:\n class Model(BaseModel):\n a: DefaultDict[int, List[int]]\n\n class MyList(List[int]):\n pass\n\n m = Model(a=defaultdict(lambda: MyList()))\n assert m.a.default_factory is not None\n assert isinstance(m.a.default_factory(), MyList)\n\n\ndef test_custom_default_dict() -> None:\n KT = TypeVar('KT')\n VT = TypeVar('VT')\n\n class CustomDefaultDict(DefaultDict[KT, VT]):\n @classmethod\n def __get_pydantic_core_schema__(cls, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n keys_type, values_type = get_args(source_type)\n return core_schema.no_info_after_validator_function(\n lambda x: cls(x.default_factory, x), handler(DefaultDict[keys_type, values_type])\n )\n\n ta = TypeAdapter(CustomDefaultDict[str, int])\n\n assert ta.validate_python({'a': 1}) == CustomDefaultDict(int, {'a': 1})\n\n\n@pytest.mark.parametrize('field_type', [typing.OrderedDict, collections.OrderedDict])\ndef test_ordered_dict_from_ordered_dict(field_type):\n class Model(BaseModel):\n od_field: field_type\n\n od_value = collections.OrderedDict([('a', 1), ('b', 2)])\n\n m = Model(od_field=od_value)\n\n assert isinstance(m.od_field, collections.OrderedDict)\n assert m.od_field == od_value\n # we don't make any promises about preserving instances\n # at the moment we always copy them for consistency and predictability\n # so this is more so documenting the current behavior than a promise\n # we make to users\n assert m.od_field is not od_value\n\n assert m.model_json_schema() == {\n 'properties': {'od_field': {'title': 'Od Field', 'type': 'object'}},\n 'required': ['od_field'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n\ndef test_ordered_dict_from_ordered_dict_typed():\n class Model(BaseModel):\n od_field: typing.OrderedDict[str, int]\n\n od_value = collections.OrderedDict([('a', 1), ('b', 2)])\n\n m = Model(od_field=od_value)\n\n assert isinstance(m.od_field, collections.OrderedDict)\n assert m.od_field == od_value\n\n assert m.model_json_schema() == {\n 'properties': {\n 'od_field': {\n 'additionalProperties': {'type': 'integer'},\n 'title': 'Od Field',\n 'type': 'object',\n }\n },\n 'required': ['od_field'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n\n@pytest.mark.parametrize('field_type', [typing.OrderedDict, collections.OrderedDict])\ndef test_ordered_dict_from_dict(field_type):\n class Model(BaseModel):\n od_field: field_type\n\n od_value = {'a': 1, 'b': 2}\n\n m = Model(od_field=od_value)\n\n assert isinstance(m.od_field, collections.OrderedDict)\n assert m.od_field == collections.OrderedDict(od_value)\n\n assert m.model_json_schema() == {\n 'properties': {'od_field': {'title': 'Od Field', 'type': 'object'}},\n 'required': ['od_field'],\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_types.py_test_handle_3rd_party_custom_type_reusing_known_metadata_test_transform_schema.assert_Model_x_1_x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_handle_3rd_party_custom_type_reusing_known_metadata_test_transform_schema.assert_Model_x_1_x_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 5632, "end_line": 5714, "span_ids": ["test_skip_validation_model_reference", "test_handle_3rd_party_custom_type_reusing_known_metadata", "test_transform_schema", "test_skip_validation", "test_skip_validation_serialization", "test_skip_validation_json_schema"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_handle_3rd_party_custom_type_reusing_known_metadata() -> None:\n class PdDecimal(Decimal):\n def ___repr__(self) -> str:\n return f'PdDecimal({super().__repr__()})'\n\n class PdDecimalMarker:\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n return core_schema.no_info_after_validator_function(PdDecimal, handler.generate_schema(Decimal))\n\n class Model(BaseModel):\n x: Annotated[PdDecimal, PdDecimalMarker(), annotated_types.Gt(0)]\n\n assert isinstance(Model(x=1).x, PdDecimal)\n with pytest.raises(ValidationError) as exc_info:\n Model(x=-1)\n\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'greater_than',\n 'loc': ('x',),\n 'msg': 'Input should be greater than 0',\n 'input': -1,\n 'ctx': {'gt': 0},\n }\n ]\n\n\n@pytest.mark.parametrize('optional', [True, False])\ndef test_skip_validation(optional):\n type_hint = SkipValidation[int]\n if optional:\n type_hint = Optional[type_hint]\n\n @validate_call\n def my_function(y: type_hint):\n return repr(y)\n\n assert my_function('2') == \"'2'\"\n\n\ndef test_skip_validation_model_reference():\n class ModelA(BaseModel):\n x: int\n\n class ModelB(BaseModel):\n y: SkipValidation[ModelA]\n\n assert ModelB(y=123).y == 123\n\n\ndef test_skip_validation_serialization():\n class A(BaseModel):\n x: SkipValidation[int]\n\n @field_serializer('x')\n def double_x(self, v):\n return v * 2\n\n assert A(x=1).model_dump() == {'x': 2}\n assert A(x='abc').model_dump() == {'x': 'abcabc'} # no validation\n assert A(x='abc').model_dump_json() == '{\"x\":\"abcabc\"}'\n\n\ndef test_skip_validation_json_schema():\n class A(BaseModel):\n x: SkipValidation[int]\n\n assert A.model_json_schema() == {\n 'properties': {'x': {'title': 'X', 'type': 'integer'}},\n 'required': ['x'],\n 'title': 'A',\n 'type': 'object',\n }\n\n\ndef test_transform_schema():\n ValidateStrAsInt = Annotated[str, GetPydanticSchema(lambda _s, h: core_schema.int_schema())]\n\n class Model(BaseModel):\n x: Optional[ValidateStrAsInt]\n\n assert Model(x=None).x is None\n assert Model(x='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_transform_schema_for_first_party_class_test_constraints_arbitrary_type.CustomType.__repr__.return.f_CustomType_self_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_transform_schema_for_first_party_class_test_constraints_arbitrary_type.CustomType.__repr__.return.f_CustomType_self_v_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 5717, "end_line": 5989, "span_ids": ["test_typing_literal_field", "test_transform_schema_for_third_party_class", "test_constraints_arbitrary_type", "test_typing_extension_literal_field", "test_constraint_dataclass", "test_instance_of_annotation", "test_instanceof_serialization", "test_instanceof_invalid_core_schema", "test_transform_schema_for_first_party_class", "test_iterable_arbitrary_type"], "tokens": 2080}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_transform_schema_for_first_party_class():\n # Here, first party means you can define the `__get_pydantic_core_schema__` method on the class directly.\n class LowercaseStr(str):\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n source_type: Any,\n handler: GetCoreSchemaHandler,\n ) -> CoreSchema:\n schema = handler(str)\n return core_schema.no_info_after_validator_function(lambda v: v.lower(), schema)\n\n class Model(BaseModel):\n lower: LowercaseStr = Field(min_length=1)\n\n assert Model(lower='ABC').lower == 'abc'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(lower='')\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'too_short',\n 'loc': ('lower',),\n 'msg': 'Value should have at least 1 item after validation, not 0',\n 'input': '',\n 'ctx': {'field_type': 'Value', 'min_length': 1, 'actual_length': 0},\n }\n ]\n\n\ndef test_constraint_dataclass() -> None:\n @dataclass(order=True)\n # need to make it inherit from int so that\n # because the PydanticKnownError requires it to be a number\n # but it's not really relevant to this test\n class MyDataclass(int):\n x: int\n\n ta = TypeAdapter(Annotated[MyDataclass, annotated_types.Gt(MyDataclass(0))])\n\n assert ta.validate_python(MyDataclass(1)) == MyDataclass(1)\n\n with pytest.raises(ValidationError) as exc_info:\n ta.validate_python(MyDataclass(0))\n\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'greater_than',\n 'loc': (),\n 'msg': 'Input should be greater than 0',\n 'input': MyDataclass(0),\n 'ctx': {'gt': MyDataclass(0)},\n }\n ]\n\n\ndef test_transform_schema_for_third_party_class():\n # Here, third party means you can't define methods on the class directly, so have to use annotations.\n\n class IntWrapper:\n # This is pretending to be a third-party class. This example is specifically inspired by pandas.Timestamp,\n # which can receive an item of type `datetime` as an input to its `__init__`.\n # The important thing here is we are not defining any custom methods on this type directly.\n def __init__(self, t: int) -> None:\n self.t = t\n\n def __eq__(self, value: object) -> bool:\n if isinstance(value, IntWrapper):\n return self.t == value.t\n elif isinstance(value, int):\n return self.t == value\n return False\n\n def __gt__(self, value: object) -> bool:\n if isinstance(value, IntWrapper):\n return self.t > value.t\n elif isinstance(value, int):\n return self.t > value\n return NotImplemented\n\n class _IntWrapperAnnotation:\n # This is an auxiliary class that, when used as the first annotation for DatetimeWrapper,\n # ensures pydantic can produce a valid schema.\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n source_type: Any,\n handler: GetCoreSchemaHandler,\n ) -> CoreSchema:\n schema = handler.generate_schema(int)\n return core_schema.no_info_after_validator_function(IntWrapper, schema)\n\n # Giving a name to Annotated[IntWrapper, _IntWrapperAnnotation] makes it easier to use in code\n # where I want a field of type `IntWrapper` that works as desired with pydantic.\n PydanticDatetimeWrapper = Annotated[IntWrapper, _IntWrapperAnnotation]\n\n class Model(BaseModel):\n # The reason all of the above is necessary is specifically so that we get good behavior\n x: Annotated[PydanticDatetimeWrapper, annotated_types.Gt(123)]\n\n m = Model(x=1234)\n assert isinstance(m.x, IntWrapper)\n assert repr(m.x.t) == '1234'\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=1)\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'greater_than',\n 'loc': ('x',),\n 'msg': 'Input should be greater than 123',\n 'input': 1,\n 'ctx': {'gt': 123},\n }\n ]\n\n\ndef test_iterable_arbitrary_type():\n class CustomIterable(Iterable):\n def __init__(self, iterable):\n self.iterable = iterable\n\n def __iter__(self):\n return self\n\n def __next__(self):\n return next(self.iterable)\n\n with pytest.raises(\n PydanticSchemaGenerationError,\n match='Unable to generate pydantic-core schema for .*CustomIterable.*. Set `arbitrary_types_allowed=True`',\n ):\n\n class Model(BaseModel):\n x: CustomIterable\n\n\ndef test_typing_extension_literal_field():\n from typing_extensions import Literal\n\n class Model(BaseModel):\n foo: Literal['foo']\n\n assert Model(foo='foo').foo == 'foo'\n\n\ndef test_typing_literal_field():\n from typing import Literal\n\n class Model(BaseModel):\n foo: Literal['foo']\n\n assert Model(foo='foo').foo == 'foo'\n\n\ndef test_instance_of_annotation():\n class Model(BaseModel):\n # Note: the generic parameter gets ignored by runtime validation\n x: InstanceOf[Sequence[int]]\n\n class MyList(list):\n pass\n\n assert Model(x='abc').x == 'abc'\n assert type(Model(x=MyList([1, 2, 3])).x) is MyList\n\n with pytest.raises(ValidationError) as exc_info:\n Model(x=1)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'Sequence'},\n 'input': 1,\n 'loc': ('x',),\n 'msg': 'Input should be an instance of Sequence',\n 'type': 'is_instance_of',\n }\n ]\n\n assert Model.model_validate_json('{\"x\": [1,2,3]}').x == [1, 2, 3]\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate_json('{\"x\": \"abc\"}')\n assert exc_info.value.errors(include_url=False) == [\n {'input': 'abc', 'loc': ('x',), 'msg': 'Input should be a valid array', 'type': 'list_type'}\n ]\n\n\ndef test_instanceof_invalid_core_schema():\n class MyClass:\n pass\n\n class MyModel(BaseModel):\n a: InstanceOf[MyClass]\n b: Optional[InstanceOf[MyClass]]\n\n MyModel(a=MyClass(), b=None)\n MyModel(a=MyClass(), b=MyClass())\n with pytest.raises(ValidationError) as exc_info:\n MyModel(a=1, b=1)\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'class': 'test_instanceof_invalid_core_schema..MyClass'},\n 'input': 1,\n 'loc': ('a',),\n 'msg': 'Input should be an instance of ' 'test_instanceof_invalid_core_schema..MyClass',\n 'type': 'is_instance_of',\n },\n {\n 'ctx': {'class': 'test_instanceof_invalid_core_schema..MyClass'},\n 'input': 1,\n 'loc': ('b',),\n 'msg': 'Input should be an instance of ' 'test_instanceof_invalid_core_schema..MyClass',\n 'type': 'is_instance_of',\n },\n ]\n with pytest.raises(\n PydanticInvalidForJsonSchema, match='Cannot generate a JsonSchema for core_schema.IsInstanceSchema'\n ):\n MyModel.model_json_schema()\n\n\ndef test_instanceof_serialization():\n class Inner(BaseModel):\n pass\n\n class SubInner(Inner):\n x: int\n\n class OuterStandard(BaseModel):\n inner: InstanceOf[Inner]\n\n assert OuterStandard(inner=SubInner(x=1)).model_dump() == {'inner': {}}\n\n class OuterAsAny(BaseModel):\n inner1: SerializeAsAny[InstanceOf[Inner]]\n inner2: InstanceOf[SerializeAsAny[Inner]]\n\n assert OuterAsAny(inner1=SubInner(x=2), inner2=SubInner(x=3)).model_dump() == {\n 'inner1': {'x': 2},\n 'inner2': {'x': 3},\n }\n\n\ndef test_constraints_arbitrary_type() -> None:\n class CustomType:\n def __init__(self, v: Any) -> None:\n self.v = v\n\n def __eq__(self, o: object) -> bool:\n return self.v == o\n\n def __le__(self, o: object) -> bool:\n return self.v <= o\n\n def __lt__(self, o: object) -> bool:\n return self.v < o\n\n def __ge__(self, o: object) -> bool:\n return self.v >= o\n\n def __gt__(self, o: object) -> bool:\n return self.v > o\n\n def __mod__(self, o: Any) -> Any:\n return self.v % o\n\n def __len__(self) -> int:\n return len(self.v)\n\n def __repr__(self) -> str:\n return f'CustomType({self.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_types.py_test_constraints_arbitrary_type.Model_test_constraints_arbitrary_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_types.py_test_constraints_arbitrary_type.Model_test_constraints_arbitrary_type.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": 5991, "end_line": 6082, "span_ids": ["test_constraints_arbitrary_type"], "tokens": 832}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_constraints_arbitrary_type() -> None:\n # ... other code\n\n class Model(BaseModel):\n gt: Annotated[CustomType, annotated_types.Gt(0)]\n ge: Annotated[CustomType, annotated_types.Ge(0)]\n lt: Annotated[CustomType, annotated_types.Lt(0)]\n le: Annotated[CustomType, annotated_types.Le(0)]\n multiple_of: Annotated[CustomType, annotated_types.MultipleOf(2)]\n min_length: Annotated[CustomType, annotated_types.MinLen(1)]\n max_length: Annotated[CustomType, annotated_types.MaxLen(1)]\n predicate: Annotated[CustomType, annotated_types.Predicate(lambda x: x > 0)]\n\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n Model(\n gt=CustomType(1),\n ge=CustomType(0),\n lt=CustomType(-1),\n le=CustomType(0),\n min_length=CustomType([1, 2]),\n max_length=CustomType([1]),\n multiple_of=CustomType(4),\n predicate=CustomType(1),\n )\n\n with pytest.raises(ValidationError) as exc_info:\n Model(\n gt=CustomType(-1),\n ge=CustomType(-1),\n lt=CustomType(1),\n le=CustomType(1),\n min_length=CustomType([]),\n max_length=CustomType([1, 2, 3]),\n multiple_of=CustomType(3),\n predicate=CustomType(-1),\n )\n # insert_assert(exc_info.value.errors(include_url=False))\n assert exc_info.value.errors(include_url=False) == [\n {\n 'type': 'greater_than',\n 'loc': ('gt',),\n 'msg': 'Input should be greater than 0',\n 'input': CustomType(-1),\n 'ctx': {'gt': 0},\n },\n {\n 'type': 'greater_than_equal',\n 'loc': ('ge',),\n 'msg': 'Input should be greater than or equal to 0',\n 'input': CustomType(-1),\n 'ctx': {'ge': 0},\n },\n {\n 'type': 'less_than',\n 'loc': ('lt',),\n 'msg': 'Input should be less than 0',\n 'input': CustomType(1),\n 'ctx': {'lt': 0},\n },\n {\n 'type': 'less_than_equal',\n 'loc': ('le',),\n 'msg': 'Input should be less than or equal to 0',\n 'input': CustomType(1),\n 'ctx': {'le': 0},\n },\n {\n 'type': 'multiple_of',\n 'loc': ('multiple_of',),\n 'msg': 'Input should be a multiple of 2',\n 'input': CustomType(3),\n 'ctx': {'multiple_of': 2},\n },\n {\n 'type': 'too_short',\n 'loc': ('min_length',),\n 'msg': 'Value should have at least 1 item after validation, not 0',\n 'input': CustomType([]),\n 'ctx': {'field_type': 'Value', 'min_length': 1, 'actual_length': 0},\n },\n {\n 'type': 'too_long',\n 'loc': ('max_length',),\n 'msg': 'Value should have at most 1 item after validation, not 3',\n 'input': CustomType([1, 2, 3]),\n 'ctx': {'field_type': 'Value', 'max_length': 1, 'actual_length': 3},\n },\n {\n 'type': 'predicate_failed',\n 'loc': ('predicate',),\n 'msg': 'Predicate test_constraints_arbitrary_type..Model. failed',\n 'input': CustomType(-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_annotated_default_value_test_union_tags_in_errors.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_annotated_default_value_test_union_tags_in_errors.None_3", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 6085, "end_line": 6326, "span_ids": ["test_coerce_numbers_to_str_from_json", "test_enum_custom_schema", "test_annotated_default_value", "test_types_repr", "test_union_tags_in_errors", "test_string_constraints", "test_get_pydantic_core_schema_marker_unrelated_type", "test_decimal_float_precision", "test_coerce_numbers_to_str_raises_for_bool", "test_coerce_numbers_to_str", "test_annotated_default_value_validate_default", "test_annotated_default_value_functional_validator", "test_coerce_numbers_to_str_disabled_in_strict_mode"], "tokens": 2010}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_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_default_value() -> None:\n t = TypeAdapter(Annotated[List[int], Field(default=['1', '2'])])\n\n r = t.get_default_value()\n assert r is not None\n assert r.value == ['1', '2']\n\n # insert_assert(t.json_schema())\n assert t.json_schema() == {'type': 'array', 'items': {'type': 'integer'}, 'default': ['1', '2']}\n\n\ndef test_annotated_default_value_validate_default() -> None:\n t = TypeAdapter(Annotated[List[int], Field(default=['1', '2'])], config=ConfigDict(validate_default=True))\n\n r = t.get_default_value()\n assert r is not None\n assert r.value == [1, 2]\n\n # insert_assert(t.json_schema())\n assert t.json_schema() == {'type': 'array', 'items': {'type': 'integer'}, 'default': ['1', '2']}\n\n\ndef test_annotated_default_value_functional_validator() -> None:\n T = TypeVar('T')\n WithAfterValidator = Annotated[T, AfterValidator(lambda x: [v * 2 for v in x])]\n WithDefaultValue = Annotated[T, Field(default=['1', '2'])]\n\n # the order of the args should not matter, we always put the default value on the outside\n for tp in (WithDefaultValue[WithAfterValidator[List[int]]], WithAfterValidator[WithDefaultValue[List[int]]]):\n t = TypeAdapter(tp, config=ConfigDict(validate_default=True))\n\n r = t.get_default_value()\n assert r is not None\n assert r.value == [2, 4]\n\n # insert_assert(t.json_schema())\n assert t.json_schema() == {'type': 'array', 'items': {'type': 'integer'}, 'default': ['1', '2']}\n\n\n@pytest.mark.parametrize(\n 'pydantic_type,expected',\n (\n (Json, 'Json'),\n (PastDate, 'PastDate'),\n (FutureDate, 'FutureDate'),\n (AwareDatetime, 'AwareDatetime'),\n (NaiveDatetime, 'NaiveDatetime'),\n (PastDatetime, 'PastDatetime'),\n (FutureDatetime, 'FutureDatetime'),\n (ImportString, 'ImportString'),\n ),\n)\ndef test_types_repr(pydantic_type, expected):\n assert repr(pydantic_type()) == expected\n\n\ndef test_enum_custom_schema() -> None:\n class MyEnum(str, Enum):\n foo = 'FOO'\n bar = 'BAR'\n baz = 'BAZ'\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n source_type: Any,\n handler: GetCoreSchemaHandler,\n ) -> CoreSchema:\n # check that we can still call handler\n handler(source_type)\n\n # return a custom unrelated schema so we can test that\n # it gets used\n schema = core_schema.union_schema(\n [\n core_schema.str_schema(),\n core_schema.is_instance_schema(cls),\n ]\n )\n return core_schema.no_info_after_validator_function(\n function=lambda x: MyEnum(x.upper()) if isinstance(x, str) else x,\n schema=schema,\n serialization=core_schema.plain_serializer_function_ser_schema(\n lambda x: x.value, return_schema=core_schema.int_schema()\n ),\n )\n\n ta = TypeAdapter(MyEnum)\n\n assert ta.validate_python('foo') == MyEnum.foo\n\n\ndef test_get_pydantic_core_schema_marker_unrelated_type() -> None:\n \"\"\"Test using handler.generate_schema() to generate a schema that ignores\n the current context of annotations and such\n \"\"\"\n\n @dataclass\n class Marker:\n num: int\n\n def __get_pydantic_core_schema__(self, source_type: Any, handler: GetCoreSchemaHandler) -> CoreSchema:\n schema = handler.resolve_ref_schema(handler.generate_schema(source_type))\n return core_schema.no_info_after_validator_function(lambda x: x * self.num, schema)\n\n ta = TypeAdapter(Annotated[int, Marker(2), Marker(3)])\n\n assert ta.validate_python('1') == 3\n\n\ndef test_string_constraints() -> None:\n ta = TypeAdapter(\n Annotated[str, StringConstraints(strip_whitespace=True, to_lower=True), AfterValidator(lambda x: x * 2)]\n )\n assert ta.validate_python(' ABC ') == 'abcabc'\n\n\ndef test_decimal_float_precision() -> None:\n \"\"\"https://github.com/pydantic/pydantic/issues/6807\"\"\"\n ta = TypeAdapter(Decimal)\n assert ta.validate_json('1.1') == Decimal('1.1')\n assert ta.validate_python(1.1) == Decimal('1.1')\n assert ta.validate_json('\"1.1\"') == Decimal('1.1')\n assert ta.validate_python('1.1') == Decimal('1.1')\n assert ta.validate_json('1') == Decimal('1')\n assert ta.validate_python(1) == Decimal('1')\n\n\ndef test_coerce_numbers_to_str_disabled_in_strict_mode() -> None:\n class Model(BaseModel):\n model_config = ConfigDict(strict=True, coerce_numbers_to_str=True)\n value: str\n\n with pytest.raises(ValidationError, match='value'):\n Model.model_validate({'value': 42})\n with pytest.raises(ValidationError, match='value'):\n Model.model_validate_json('{\"value\": 42}')\n\n\n@pytest.mark.parametrize('value_param', [True, False])\ndef test_coerce_numbers_to_str_raises_for_bool(value_param: bool) -> None:\n class Model(BaseModel):\n model_config = ConfigDict(coerce_numbers_to_str=True)\n value: str\n\n with pytest.raises(ValidationError, match='value'):\n Model.model_validate({'value': value_param})\n with pytest.raises(ValidationError, match='value'):\n if value_param is True:\n Model.model_validate_json('{\"value\": true}')\n elif value_param is False:\n Model.model_validate_json('{\"value\": false}')\n\n @pydantic_dataclass(config=ConfigDict(coerce_numbers_to_str=True))\n class Model:\n value: str\n\n with pytest.raises(ValidationError, match='value'):\n Model(value=value_param)\n\n\n@pytest.mark.parametrize(\n ('number', 'expected_str'),\n [\n pytest.param(42, '42', id='42'),\n pytest.param(42.0, '42.0', id='42.0'),\n pytest.param(Decimal('42.0'), '42.0', id=\"Decimal('42.0')\"),\n ],\n)\ndef test_coerce_numbers_to_str(number: Number, expected_str: str) -> None:\n class Model(BaseModel):\n model_config = ConfigDict(coerce_numbers_to_str=True)\n value: str\n\n assert Model.model_validate({'value': number}).model_dump() == {'value': expected_str}\n\n\n@pytest.mark.parametrize(\n ('number', 'expected_str'),\n [\n pytest.param('42', '42', id='42'),\n pytest.param('42.0', '42', id='42.0'),\n pytest.param('42.13', '42.13', id='42.13'),\n ],\n)\ndef test_coerce_numbers_to_str_from_json(number: str, expected_str: str) -> None:\n class Model(BaseModel):\n model_config = ConfigDict(coerce_numbers_to_str=True)\n value: str\n\n assert Model.model_validate_json(f'{{\"value\": {number}}}').model_dump() == {'value': expected_str}\n\n\ndef test_union_tags_in_errors():\n DoubledList = Annotated[List[int], AfterValidator(lambda x: x * 2)]\n StringsMap = Dict[str, str]\n\n adapter = TypeAdapter(Union[DoubledList, StringsMap])\n\n with pytest.raises(ValidationError) as exc_info:\n adapter.validate_python(['a'])\n\n # yuck\n assert '2 validation errors for union[function-after[(), list[int]],dict[str,str]]' in str(exc_info)\n # the loc's are bad here:\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'a',\n 'loc': ('function-after[(), list[int]]', 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': ('dict[str,str]',),\n 'msg': 'Input should be a valid dictionary',\n 'type': 'dict_type',\n },\n ]\n\n tag_adapter = TypeAdapter(\n Union[Annotated[DoubledList, Tag('DoubledList')], Annotated[StringsMap, Tag('StringsMap')]]\n )\n with pytest.raises(ValidationError) as exc_info:\n tag_adapter.validate_python(['a'])\n\n assert '2 validation errors for union[DoubledList,StringsMap]' in str(exc_info) # nice\n # the loc's are good here:\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'a',\n 'loc': ('DoubledList', 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': ('StringsMap',),\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.py_test_json_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_types.py_test_json_value_", "embedding": null, "metadata": {"file_path": "tests/test_types.py", "file_name": "test_types.py", "file_type": "text/x-python", "category": "test", "start_line": 6334, "end_line": 6437, "span_ids": ["test_json_value_roundtrip", "test_json_value", "test_diff_enums_diff_configs", "test_on_error_omit", "test_on_error_omit_top_level", "test_json_value_with_subclassed_types"], "tokens": 833}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_json_value():\n adapter = TypeAdapter(JsonValue)\n valid_json_data = {'a': {'b': {'c': 1, 'd': [2, None]}}}\n # would pass validation as a dict[str, Any]\n invalid_json_data = {'a': {'b': ...}}\n\n assert adapter.validate_python(valid_json_data) == valid_json_data\n assert adapter.validate_json(json.dumps(valid_json_data)) == valid_json_data\n\n with pytest.raises(ValidationError) as exc_info:\n adapter.validate_python(invalid_json_data)\n assert exc_info.value.errors() == [\n {\n 'input': Ellipsis,\n 'loc': ('dict', 'a', 'dict', 'b'),\n 'msg': 'input was not a valid JSON value',\n 'type': 'invalid-json-value',\n }\n ]\n\n\ndef test_json_value_with_subclassed_types():\n class IntType(int):\n pass\n\n class FloatType(float):\n pass\n\n class StrType(str):\n pass\n\n class ListType(list):\n pass\n\n class DictType(dict):\n pass\n\n adapter = TypeAdapter(JsonValue)\n valid_json_data = {'int': IntType(), 'float': FloatType(), 'str': StrType(), 'list': ListType(), 'dict': DictType()}\n assert adapter.validate_python(valid_json_data) == valid_json_data\n\n\ndef test_json_value_roundtrip() -> None:\n # see https://github.com/pydantic/pydantic/issues/8175\n class MyModel(BaseModel):\n val: Union[str, JsonValue]\n\n round_trip_value = json.loads(MyModel(val=True).model_dump_json())['val']\n assert round_trip_value is True, round_trip_value\n\n\ndef test_on_error_omit() -> None:\n OmittableInt = OnErrorOmit[int]\n\n class MyTypedDict(TypedDict):\n a: NotRequired[OmittableInt]\n b: NotRequired[OmittableInt]\n\n class Model(BaseModel):\n a_list: List[OmittableInt]\n a_dict: Dict[OmittableInt, OmittableInt]\n a_typed_dict: MyTypedDict\n\n actual = Model(\n a_list=[1, 2, 'a', 3],\n a_dict={1: 1, 2: 2, 'a': 'a', 'b': 0, 3: 'c', 4: 4},\n a_typed_dict=MyTypedDict(a=1, b='xyz'), # type: ignore\n )\n\n expected = Model(a_list=[1, 2, 3], a_dict={1: 1, 2: 2, 4: 4}, a_typed_dict=MyTypedDict(a=1))\n\n assert actual == expected\n\n\ndef test_on_error_omit_top_level() -> None:\n ta = TypeAdapter(OnErrorOmit[int])\n\n assert ta.validate_python(1) == 1\n assert ta.validate_python('1') == 1\n\n # we might want to just raise the OmitError or convert it to a ValidationError\n # if it hits the top level, but this documents the current behavior at least\n with pytest.raises(SchemaError, match='Uncaught Omit error'):\n ta.validate_python('a')\n\n\ndef test_diff_enums_diff_configs() -> None:\n class MyEnum(str, Enum):\n A = 'a'\n\n class MyModel(BaseModel, use_enum_values=True):\n my_enum: MyEnum\n\n class OtherModel(BaseModel):\n my_enum: MyEnum\n\n class Model(BaseModel):\n my_model: MyModel\n other_model: OtherModel\n\n obj = Model.model_validate({'my_model': {'my_enum': 'a'}, 'other_model': {'my_enum': 'a'}})\n assert not isinstance(obj.my_model.my_enum, MyEnum)\n assert isinstance(obj.other_model.my_enum, MyEnum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_set_discriminator_in_metadata.metadata_CORE_SCHEMA_META": {"__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_set_discriminator_in_metadata.metadata_CORE_SCHEMA_META", "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": 34, "span_ids": ["set_discriminator_in_metadata", "imports", "MissingDefinitionForUnionRef.__init__", "MissingDefinitionForUnionRef"], "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": "from __future__ import annotations as _annotations\n\nfrom typing import TYPE_CHECKING, Any, Hashable, Sequence\n\nfrom pydantic_core import CoreSchema, core_schema\n\nfrom ..errors import PydanticUserError\nfrom . import _core_utils\nfrom ._core_utils import (\n CoreSchemaField,\n collect_definitions,\n)\n\nif TYPE_CHECKING:\n from ..types import Discriminator\n\nCORE_SCHEMA_METADATA_DISCRIMINATOR_PLACEHOLDER_KEY = 'pydantic.internal.union_discriminator'\n\n\nclass MissingDefinitionForUnionRef(Exception):\n \"\"\"Raised when applying a discriminated union discriminator to a schema\n requires a definition that is not yet defined\n \"\"\"\n\n def __init__(self, ref: str) -> None:\n self.ref = ref\n super().__init__(f'Missing definition for ref {self.ref!r}')\n\n\ndef set_discriminator_in_metadata(schema: CoreSchema, discriminator: Any) -> None:\n schema.setdefault('metadata', {})\n metadata = schema.get('metadata')\n assert metadata is not None\n metadata[CORE_SCHEMA_METADATA_DISCRIMINATOR_PLACEHOLDER_KEY] = 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/_internal/_discriminated_union.py_apply_discriminators_apply_discriminators.return._core_utils_walk_core_sch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_discriminated_union.py_apply_discriminators_apply_discriminators.return._core_utils_walk_core_sch", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_discriminated_union.py", "file_name": "_discriminated_union.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 58, "span_ids": ["apply_discriminators"], "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 apply_discriminators(schema: core_schema.CoreSchema) -> core_schema.CoreSchema:\n # We recursively walk through the `schema` passed to `apply_discriminators`, applying discriminators\n # where necessary at each level. During this recursion, we allow references to be resolved from the definitions\n # that are originally present on the original, outermost `schema`. Before `apply_discriminators` is called,\n # `simplify_schema_references` is called on the schema (in the `clean_schema` function),\n # which often puts the definitions in the outermost schema.\n global_definitions: dict[str, CoreSchema] = collect_definitions(schema)\n\n def inner(s: core_schema.CoreSchema, recurse: _core_utils.Recurse) -> core_schema.CoreSchema:\n nonlocal global_definitions\n\n s = recurse(s, inner)\n if s['type'] == 'tagged-union':\n return s\n\n metadata = s.get('metadata', {})\n discriminator = metadata.pop(CORE_SCHEMA_METADATA_DISCRIMINATOR_PLACEHOLDER_KEY, None)\n if discriminator is not None:\n s = apply_discriminator(s, discriminator, global_definitions)\n return s\n\n return _core_utils.walk_core_schema(schema, 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/_internal/_docs_extraction.py__Utilities_related_to_a_DocstringVisitor.visit_Expr.if_.self.target.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_docs_extraction.py__Utilities_related_to_a_DocstringVisitor.visit_Expr.if_.self.target.None", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_docs_extraction.py", "file_name": "_docs_extraction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["DocstringVisitor.visit", "DocstringVisitor.__init__", "DocstringVisitor.visit_Expr", "DocstringVisitor.visit_AnnAssign", "docstring", "DocstringVisitor"], "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": "\"\"\"Utilities related to attribute docstring extraction.\"\"\"\nfrom __future__ import annotations\n\nimport ast\nimport inspect\nimport textwrap\nfrom typing import Any\n\n\nclass DocstringVisitor(ast.NodeVisitor):\n def __init__(self) -> None:\n super().__init__()\n\n self.target: str | None = None\n self.attrs: dict[str, str] = {}\n self.previous_node_type: type[ast.AST] | None = None\n\n def visit(self, node: ast.AST) -> Any:\n node_result = super().visit(node)\n self.previous_node_type = type(node)\n return node_result\n\n def visit_AnnAssign(self, node: ast.AnnAssign) -> Any:\n if isinstance(node.target, ast.Name):\n self.target = node.target.id\n\n def visit_Expr(self, node: ast.Expr) -> Any:\n if (\n isinstance(node.value, ast.Constant)\n and isinstance(node.value.value, str)\n and self.previous_node_type is ast.AnnAssign\n ):\n docstring = inspect.cleandoc(node.value.value)\n if self.target:\n self.attrs[self.target] = docstring\n self.target = 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__Convert_python_types_t_TUPLE_TYPES._tuple_typing_Tuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py__Convert_python_types_t_TUPLE_TYPES._tuple_typing_Tuple_", "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": 108, "span_ids": ["imports:36", "docstring"], "tokens": 788}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Convert python types to pydantic-core schema.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport collections.abc\nimport dataclasses\nimport inspect\nimport re\nimport sys\nimport typing\nimport warnings\nfrom contextlib import ExitStack, contextmanager\nfrom copy import copy, deepcopy\nfrom enum import Enum\nfrom functools import partial\nfrom inspect import Parameter, _ParameterKind, signature\nfrom itertools import chain\nfrom operator import attrgetter\nfrom types import FunctionType, LambdaType, MethodType\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n Final,\n ForwardRef,\n Iterable,\n Iterator,\n Mapping,\n Type,\n TypeVar,\n Union,\n cast,\n overload,\n)\nfrom warnings import warn\n\nfrom pydantic_core import CoreSchema, PydanticUndefined, core_schema, to_jsonable_python\nfrom typing_extensions import Annotated, Literal, TypeAliasType, TypedDict, get_args, get_origin, is_typeddict\n\nfrom ..aliases import AliasGenerator\nfrom ..annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler\nfrom ..config import ConfigDict, JsonDict, JsonEncoder\nfrom ..errors import PydanticSchemaGenerationError, PydanticUndefinedAnnotation, PydanticUserError\nfrom ..json_schema import JsonSchemaValue\nfrom ..version import version_short\nfrom ..warnings import PydanticDeprecatedSince20\nfrom . import _core_utils, _decorators, _discriminated_union, _known_annotated_metadata, _typing_extra\nfrom ._config import ConfigWrapper, ConfigWrapperStack\nfrom ._core_metadata import CoreMetadataHandler, build_metadata_dict\nfrom ._core_utils import (\n CoreSchemaOrField,\n collect_invalid_schemas,\n define_expected_missing_refs,\n get_ref,\n get_type_ref,\n is_function_with_inner_schema,\n is_list_like_schema_with_items_schema,\n simplify_schema_references,\n validate_core_schema,\n)\nfrom ._decorators import (\n Decorator,\n DecoratorInfos,\n FieldSerializerDecoratorInfo,\n FieldValidatorDecoratorInfo,\n ModelSerializerDecoratorInfo,\n ModelValidatorDecoratorInfo,\n RootValidatorDecoratorInfo,\n ValidatorDecoratorInfo,\n get_attribute_from_bases,\n inspect_field_serializer,\n inspect_model_serializer,\n inspect_validator,\n)\nfrom ._docs_extraction import extract_docstrings_from_cls\nfrom ._fields import collect_dataclass_fields, get_type_hints_infer_globalns\nfrom ._forward_ref import PydanticRecursiveRef\nfrom ._generics import get_standard_typevars_map, has_instance_in_type, recursively_defined_type_refs, replace_types\nfrom ._schema_generation_shared import (\n CallbackGetCoreSchemaHandler,\n)\nfrom ._typing_extra import is_finalvar\nfrom ._utils import lenient_issubclass\n\nif TYPE_CHECKING:\n from ..fields import ComputedFieldInfo, FieldInfo\n from ..main import BaseModel\n from ..types import Discriminator\n from ..validators import FieldValidatorModes\n from ._dataclasses import StandardDataclass\n from ._schema_generation_shared import GetJsonSchemaFunction\n\n_SUPPORTS_TYPEDDICT = sys.version_info >= (3, 12)\n_AnnotatedType = type(Annotated[int, 123])\n\nFieldDecoratorInfo = Union[ValidatorDecoratorInfo, FieldValidatorDecoratorInfo, FieldSerializerDecoratorInfo]\nFieldDecoratorInfoType = TypeVar('FieldDecoratorInfoType', bound=FieldDecoratorInfo)\nAnyFieldDecorator = Union[\n Decorator[ValidatorDecoratorInfo],\n Decorator[FieldValidatorDecoratorInfo],\n Decorator[FieldSerializerDecoratorInfo],\n]\n\nModifyCoreSchemaWrapHandler = GetCoreSchemaHandler\nGetCoreSchemaFunction = Callable[[Any, ModifyCoreSchemaWrapHandler], core_schema.CoreSchema]\n\n\nTUPLE_TYPES: list[type] = [tuple, typing.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/_internal/_generate_schema.py_LIST_TYPES_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_LIST_TYPES_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": 109, "end_line": 133, "span_ids": ["check_validator_fields_against_field_name", "imports:36"], "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": "LIST_TYPES: list[type] = [list, typing.List, collections.abc.MutableSequence]\nSET_TYPES: list[type] = [set, typing.Set, collections.abc.MutableSet]\nFROZEN_SET_TYPES: list[type] = [frozenset, typing.FrozenSet, collections.abc.Set]\nDICT_TYPES: list[type] = [dict, typing.Dict, collections.abc.MutableMapping, collections.abc.Mapping]\n\n\ndef check_validator_fields_against_field_name(\n info: FieldDecoratorInfo,\n field: str,\n) -> bool:\n \"\"\"Check if field name is in validator fields.\n\n Args:\n info: The field info.\n field: The field name to check.\n\n Returns:\n `True` if field name is in validator fields, `False` otherwise.\n \"\"\"\n if '*' in 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_TypesNamespace__get_first_non_null.return.a_if_a_is_not_None_else_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_TypesNamespace__get_first_non_null.return.a_if_a_is_not_None_else_b", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 303, "span_ids": ["TypesNamespaceStack", "TypesNamespaceStack.tail", "TypesNamespaceStack.__init__", "TypesNamespaceStack.push", "impl:28", "_get_first_non_null"], "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": "TypesNamespace = Union[Dict[str, Any], None]\n\n\nclass TypesNamespaceStack:\n \"\"\"A stack of types namespaces.\"\"\"\n\n def __init__(self, types_namespace: TypesNamespace):\n self._types_namespace_stack: list[TypesNamespace] = [types_namespace]\n\n @property\n def tail(self) -> TypesNamespace:\n return self._types_namespace_stack[-1]\n\n @contextmanager\n def push(self, for_type: type[Any]):\n types_namespace = {**_typing_extra.get_cls_types_namespace(for_type), **(self.tail or {})}\n self._types_namespace_stack.append(types_namespace)\n try:\n yield\n finally:\n self._types_namespace_stack.pop()\n\n\ndef _get_first_non_null(a: Any, b: Any) -> Any:\n \"\"\"Return the first argument if it is not None, otherwise return the second argument.\n\n Use case: serialization_alias (argument a) and alias (argument b) are both defined, and serialization_alias is ''.\n This function will return serialization_alias, which is the first argument, even though it is an empty string.\n \"\"\"\n return a if a is not None else 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/_internal/_generate_schema.py_GenerateSchema._apply_discriminator_to_union_GenerateSchema.collect_definitions.return.core_schema_definitions_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_discriminator_to_union_GenerateSchema.collect_definitions.return.core_schema_definitions_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": 409, "end_line": 448, "span_ids": ["GenerateSchema.clean_schema", "GenerateSchema.collect_definitions", "GenerateSchema._apply_discriminator_to_union", "GenerateSchema.CollectedInvalid"], "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 GenerateSchema:\n\n def _apply_discriminator_to_union(\n self, schema: CoreSchema, discriminator: str | Discriminator | None\n ) -> CoreSchema:\n if discriminator is None:\n return schema\n try:\n return _discriminated_union.apply_discriminator(\n schema,\n discriminator,\n )\n except _discriminated_union.MissingDefinitionForUnionRef:\n # defer until defs are resolved\n _discriminated_union.set_discriminator_in_metadata(\n schema,\n discriminator,\n )\n return schema\n\n class CollectedInvalid(Exception):\n pass\n\n def clean_schema(self, schema: CoreSchema) -> CoreSchema:\n schema = self.collect_definitions(schema)\n schema = simplify_schema_references(schema)\n schema = _discriminated_union.apply_discriminators(schema)\n if collect_invalid_schemas(schema):\n raise self.CollectedInvalid()\n schema = validate_core_schema(schema)\n return schema\n\n def collect_definitions(self, schema: CoreSchema) -> CoreSchema:\n ref = cast('str | None', schema.get('ref', None))\n if ref:\n self.defs.definitions[ref] = schema\n if 'ref' in schema:\n schema = core_schema.definition_reference_schema(schema['ref'])\n return core_schema.definitions_schema(\n schema,\n list(self.defs.definitions.values()),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._get_args_resolving_forward_refs_GenerateSchema._get_first_two_args_or_any.return.args_0_args_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._get_args_resolving_forward_refs_GenerateSchema._get_first_two_args_or_any.return.args_0_args_1_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 690, "end_line": 719, "span_ids": ["GenerateSchema._get_first_arg_or_any", "GenerateSchema._get_args_resolving_forward_refs_23", "GenerateSchema._get_args_resolving_forward_refs_22", "GenerateSchema._get_first_two_args_or_any", "GenerateSchema._get_args_resolving_forward_refs"], "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 GenerateSchema:\n\n @overload\n def _get_args_resolving_forward_refs(self, obj: Any, required: Literal[True]) -> tuple[Any, ...]:\n ...\n\n @overload\n def _get_args_resolving_forward_refs(self, obj: Any) -> tuple[Any, ...] | None:\n ...\n\n def _get_args_resolving_forward_refs(self, obj: Any, required: bool = False) -> tuple[Any, ...] | None:\n args = get_args(obj)\n if args:\n args = tuple([self._resolve_forward_ref(a) if isinstance(a, ForwardRef) else a for a in args])\n elif required: # pragma: no cover\n raise TypeError(f'Expected {obj} to have generic parameters but it had none')\n return args\n\n def _get_first_arg_or_any(self, obj: Any) -> Any:\n args = self._get_args_resolving_forward_refs(obj)\n if not args:\n return Any\n return args[0]\n\n def _get_first_two_args_or_any(self, obj: Any) -> tuple[Any, Any]:\n args = self._get_args_resolving_forward_refs(obj)\n if not args:\n return (Any, Any)\n if len(args) < 2:\n origin = get_origin(obj)\n raise TypeError(f'Expected two type arguments for {origin}, got 1')\n return args[0], args[1]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_alias_generator_to_field_info_GenerateSchema._apply_alias_generator_to_field_info.if_.if_field_info_validation_.field_info.validation_alias._get_first_non_null_valid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_alias_generator_to_field_info_GenerateSchema._apply_alias_generator_to_field_info.if_.if_field_info_validation_.field_info.validation_alias._get_first_non_null_valid", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 933, "end_line": 981, "span_ids": ["GenerateSchema._apply_alias_generator_to_field_info"], "tokens": 524}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 @staticmethod\n def _apply_alias_generator_to_field_info(\n alias_generator: Callable[[str], str] | AliasGenerator, field_info: FieldInfo, field_name: str\n ) -> None:\n \"\"\"Apply an alias_generator to aliases on a FieldInfo instance if appropriate.\n\n Args:\n alias_generator: A callable that takes a string and returns a string, or an AliasGenerator instance.\n field_info: The FieldInfo instance to which the alias_generator is (maybe) applied.\n field_name: The name of the field from which to generate the alias.\n \"\"\"\n # Apply an alias_generator if\n # 1. An alias is not specified\n # 2. An alias is specified, but the priority is <= 1\n if (\n field_info.alias_priority is None\n or field_info.alias_priority <= 1\n or field_info.alias is None\n or field_info.validation_alias is None\n or field_info.serialization_alias is None\n ):\n alias, validation_alias, serialization_alias = None, None, None\n\n if isinstance(alias_generator, AliasGenerator):\n alias, validation_alias, serialization_alias = alias_generator.generate_aliases(field_name)\n elif isinstance(alias_generator, Callable):\n alias = alias_generator(field_name)\n if not isinstance(alias, str):\n raise TypeError(f'alias_generator {alias_generator} must return str, not {alias.__class__}')\n\n # if priority is not set, we set to 1\n # which supports the case where the alias_generator from a child class is used\n # to generate an alias for a field in a parent class\n if field_info.alias_priority is None or field_info.alias_priority <= 1:\n field_info.alias_priority = 1\n\n # if the priority is 1, then we set the aliases to the generated alias\n if field_info.alias_priority == 1:\n field_info.serialization_alias = _get_first_non_null(serialization_alias, alias)\n field_info.validation_alias = _get_first_non_null(validation_alias, alias)\n field_info.alias = alias\n\n # if any of the aliases are not set, then we set them to the corresponding generated alias\n if field_info.alias is None:\n field_info.alias = alias\n if field_info.serialization_alias is None:\n field_info.serialization_alias = _get_first_non_null(serialization_alias, alias)\n if field_info.validation_alias is None:\n field_info.validation_alias = _get_first_non_null(validation_alias, 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/_internal/_generate_schema.py_GenerateSchema._apply_alias_generator_to_computed_field_info_GenerateSchema._apply_alias_generator_to_computed_field_info.if_.None_2.computed_field_info.alias._get_first_non_null_seria": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._apply_alias_generator_to_computed_field_info_GenerateSchema._apply_alias_generator_to_computed_field_info.if_.None_2.computed_field_info.alias._get_first_non_null_seria", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 983, "end_line": 1024, "span_ids": ["GenerateSchema._apply_alias_generator_to_computed_field_info"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenerateSchema:\n\n @staticmethod\n def _apply_alias_generator_to_computed_field_info(\n alias_generator: Callable[[str], str] | AliasGenerator,\n computed_field_info: ComputedFieldInfo,\n computed_field_name: str,\n ):\n \"\"\"Apply an alias_generator to alias on a ComputedFieldInfo instance if appropriate.\n\n Args:\n alias_generator: A callable that takes a string and returns a string, or an AliasGenerator instance.\n computed_field_info: The ComputedFieldInfo instance to which the alias_generator is (maybe) applied.\n computed_field_name: The name of the computed field from which to generate the alias.\n \"\"\"\n # Apply an alias_generator if\n # 1. An alias is not specified\n # 2. An alias is specified, but the priority is <= 1\n\n if (\n computed_field_info.alias_priority is None\n or computed_field_info.alias_priority <= 1\n or computed_field_info.alias is None\n ):\n alias, validation_alias, serialization_alias = None, None, None\n\n if isinstance(alias_generator, AliasGenerator):\n alias, validation_alias, serialization_alias = alias_generator.generate_aliases(computed_field_name)\n elif isinstance(alias_generator, Callable):\n alias = alias_generator(computed_field_name)\n if not isinstance(alias, str):\n raise TypeError(f'alias_generator {alias_generator} must return str, not {alias.__class__}')\n\n # if priority is not set, we set to 1\n # which supports the case where the alias_generator from a child class is used\n # to generate an alias for a field in a parent class\n if computed_field_info.alias_priority is None or computed_field_info.alias_priority <= 1:\n computed_field_info.alias_priority = 1\n\n # if the priority is 1, then we set the aliases to the generated alias\n # note that we use the serialization_alias with priority over alias, as computed_field\n # aliases are used for serialization only (not validation)\n if computed_field_info.alias_priority == 1:\n computed_field_info.alias = _get_first_non_null(serialization_alias, 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/_internal/_generate_schema.py_GenerateSchema._dataclass_schema_GenerateSchema._dataclass_schema.with_self_defs_get_schema.assert_False_Unreachabl": {"__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._dataclass_schema.with_self_defs_get_schema.assert_False_Unreachabl", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1474, "end_line": 1568, "span_ids": ["GenerateSchema._dataclass_schema"], "tokens": 915}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(\n self, dataclass: type[StandardDataclass], origin: type[StandardDataclass] | None\n ) -> core_schema.CoreSchema:\n \"\"\"Generate schema for a dataclass.\"\"\"\n with self.defs.get_schema_or_ref(dataclass) as (dataclass_ref, maybe_schema):\n if maybe_schema is not None:\n return maybe_schema\n\n typevars_map = get_standard_typevars_map(dataclass)\n if origin is not None:\n dataclass = origin\n\n with ExitStack() as dataclass_bases_stack:\n # Pushing a namespace prioritises items already in the stack, so iterate though the MRO forwards\n for dataclass_base in dataclass.__mro__:\n if dataclasses.is_dataclass(dataclass_base):\n dataclass_bases_stack.enter_context(self._types_namespace_stack.push(dataclass_base))\n\n # Pushing a config overwrites the previous config, so iterate though the MRO backwards\n for dataclass_base in reversed(dataclass.__mro__):\n if dataclasses.is_dataclass(dataclass_base):\n config = getattr(dataclass_base, '__pydantic_config__', None)\n dataclass_bases_stack.enter_context(self._config_wrapper_stack.push(config))\n\n core_config = self._config_wrapper.core_config(dataclass)\n\n self = self._current_generate_schema\n\n from ..dataclasses import is_pydantic_dataclass\n\n if is_pydantic_dataclass(dataclass):\n fields = deepcopy(dataclass.__pydantic_fields__)\n if typevars_map:\n for field in fields.values():\n field.apply_typevars_map(typevars_map, self._types_namespace)\n else:\n fields = collect_dataclass_fields(\n dataclass,\n self._types_namespace,\n typevars_map=typevars_map,\n )\n\n # disallow combination of init=False on a dataclass field and extra='allow' on a dataclass\n if self._config_wrapper_stack.tail.extra == 'allow':\n # disallow combination of init=False on a dataclass field and extra='allow' on a dataclass\n for field_name, field in fields.items():\n if field.init is False:\n raise PydanticUserError(\n f'Field {field_name} has `init=False` and dataclass has config setting `extra=\"allow\"`. '\n f'This combination is not allowed.',\n code='dataclass-init-false-extra-allow',\n )\n\n decorators = dataclass.__dict__.get('__pydantic_decorators__') or DecoratorInfos.build(dataclass)\n # Move kw_only=False args to the start of the list, as this is how vanilla dataclasses work.\n # Note that when kw_only is missing or None, it is treated as equivalent to kw_only=True\n args = sorted(\n (self._generate_dc_field_schema(k, v, decorators) for k, v in fields.items()),\n key=lambda a: a.get('kw_only') is not False,\n )\n has_post_init = hasattr(dataclass, '__post_init__')\n has_slots = hasattr(dataclass, '__slots__')\n\n args_schema = core_schema.dataclass_args_schema(\n dataclass.__name__,\n args,\n computed_fields=[\n self._computed_field_schema(d, decorators.field_serializers)\n for d in decorators.computed_fields.values()\n ],\n collect_init_only=has_post_init,\n )\n\n inner_schema = apply_validators(args_schema, decorators.root_validators.values(), None)\n\n model_validators = decorators.model_validators.values()\n inner_schema = apply_model_validators(inner_schema, model_validators, 'inner')\n\n dc_schema = core_schema.dataclass_schema(\n dataclass,\n inner_schema,\n post_init=has_post_init,\n ref=dataclass_ref,\n fields=[field.name for field in dataclasses.fields(dataclass)],\n slots=has_slots,\n config=core_config,\n )\n schema = self._apply_model_serializers(dc_schema, decorators.model_serializers.values())\n schema = apply_model_validators(schema, model_validators, 'outer')\n self.defs.definitions[dataclass_ref] = schema\n return core_schema.definition_reference_schema(dataclass_ref)\n\n # Type checkers seem to assume ExitStack may suppress exceptions and therefore\n # control flow can exit the `with` block without returning.\n assert False, 'Unreachable'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._computed_field_schema_GenerateSchema._computed_field_schema.if_alias_generator_is_not.self__apply_alias_generat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_generate_schema.py_GenerateSchema._computed_field_schema_GenerateSchema._computed_field_schema.if_alias_generator_is_not.self__apply_alias_generat", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_generate_schema.py", "file_name": "_generate_schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1648, "end_line": 1680, "span_ids": ["GenerateSchema._computed_field_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 GenerateSchema:\n\n def _computed_field_schema(\n self,\n d: Decorator[ComputedFieldInfo],\n field_serializers: dict[str, Decorator[FieldSerializerDecoratorInfo]],\n ) -> core_schema.ComputedField:\n try:\n return_type = _decorators.get_function_return_type(d.func, d.info.return_type, self._types_namespace)\n except NameError as e:\n raise PydanticUndefinedAnnotation.from_name_error(e) from e\n if return_type is PydanticUndefined:\n raise PydanticUserError(\n 'Computed field is missing return type annotation or specifying `return_type`'\n ' to the `@computed_field` decorator (e.g. `@computed_field(return_type=int|str)`)',\n code='model-field-missing-annotation',\n )\n\n return_type = replace_types(return_type, self._typevars_map)\n # Create a new ComputedFieldInfo so that different type parametrizations of the same\n # generic model's computed field can have different return types.\n d.info = dataclasses.replace(d.info, return_type=return_type)\n return_type_schema = self.generate_schema(return_type)\n # Apply serializers to computed field if there exist\n return_type_schema = self._apply_field_serializers(\n return_type_schema,\n filter_field_decorator_info_by_field(field_serializers.values(), d.cls_var_name),\n computed_field=True,\n )\n\n alias_generator = self._config_wrapper.alias_generator\n if alias_generator is not None:\n self._apply_alias_generator_to_computed_field_info(\n alias_generator=alias_generator, computed_field_info=d.info, computed_field_name=d.cls_var_name\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/_internal/_model_construction.py_set_deprecated_descriptors_set_deprecated_descriptors.for_field_computed_field.if_.setattr_cls_field_desc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py_set_deprecated_descriptors_set_deprecated_descriptors.for_field_computed_field.if_.setattr_cls_field_desc_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 577, "end_line": 593, "span_ids": ["set_deprecated_descriptors"], "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 set_deprecated_descriptors(cls: type[BaseModel]) -> None:\n \"\"\"Set data descriptors on the class for deprecated fields.\"\"\"\n for field, field_info in cls.model_fields.items():\n if (msg := field_info.deprecation_message) is not None:\n desc = _DeprecatedFieldDescriptor(msg)\n desc.__set_name__(cls, field)\n setattr(cls, field, desc)\n\n for field, computed_field_info in cls.model_computed_fields.items():\n if (\n (msg := computed_field_info.deprecation_message) is not None\n # Avoid having two warnings emitted:\n and not hasattr(unwrap_wrapped_function(computed_field_info.wrapped_property), '__deprecated__')\n ):\n desc = _DeprecatedFieldDescriptor(msg, computed_field_info.wrapped_property)\n desc.__set_name__(cls, field)\n setattr(cls, field, desc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__DeprecatedFieldDescriptor__DeprecatedFieldDescriptor.__set__.raise_AttributeError_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_model_construction.py__DeprecatedFieldDescriptor__DeprecatedFieldDescriptor.__set__.raise_AttributeError_self", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_model_construction.py", "file_name": "_model_construction.py", "file_type": "text/x-python", "category": "implementation", "start_line": 596, "end_line": 628, "span_ids": ["_DeprecatedFieldDescriptor", "_DeprecatedFieldDescriptor.__set_name__", "_DeprecatedFieldDescriptor.__get__", "_DeprecatedFieldDescriptor.__init__", "_DeprecatedFieldDescriptor.__set__"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _DeprecatedFieldDescriptor:\n \"\"\"Data descriptor used to emit a runtime deprecation warning before accessing a deprecated field.\n\n Attributes:\n msg: The deprecation message to be emitted.\n wrapped_property: The property instance if the deprecated field is a computed field, or `None`.\n field_name: The name of the field being deprecated.\n \"\"\"\n\n field_name: str\n\n def __init__(self, msg: str, wrapped_property: property | None = None) -> None:\n self.msg = msg\n self.wrapped_property = wrapped_property\n\n def __set_name__(self, cls: type[BaseModel], name: str) -> None:\n self.field_name = name\n\n def __get__(self, obj: BaseModel | None, obj_type: type[BaseModel] | None = None) -> Any:\n if obj is None:\n raise AttributeError(self.field_name)\n\n warnings.warn(self.msg, builtins.DeprecationWarning, stacklevel=2)\n\n if self.wrapped_property is not None:\n return self.wrapped_property.__get__(obj, obj_type)\n return obj.__dict__[self.field_name]\n\n # Defined to take precedence over the instance's dictionary\n # Note that it will not be called when setting a value on a model instance\n # as `BaseModel.__setattr__` is defined and takes priority.\n def __set__(self, obj: Any, value: Any) -> NoReturn:\n raise AttributeError(self.field_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/_internal/_schema_generation_shared.py_GenerateJsonSchemaHandler_GenerateJsonSchemaHandler.__call__.return.self_handler_core_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_schema_generation_shared.py_GenerateJsonSchemaHandler_GenerateJsonSchemaHandler.__call__.return.self_handler_core_schema_", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_schema_generation_shared.py", "file_name": "_schema_generation_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 36, "span_ids": ["GenerateJsonSchemaHandler.__call__", "GenerateJsonSchemaHandler.__init__", "GenerateJsonSchemaHandler"], "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 GenerateJsonSchemaHandler(GetJsonSchemaHandler):\n \"\"\"JsonSchemaHandler implementation that doesn't do ref unwrapping by default.\n\n This is used for any Annotated metadata so that we don't end up with conflicting\n modifications to the definition schema.\n\n Used internally by Pydantic, please do not rely on this implementation.\n See `GetJsonSchemaHandler` for the handler API.\n \"\"\"\n\n def __init__(self, generate_json_schema: GenerateJsonSchema, handler_override: HandlerOverride | None) -> None:\n self.generate_json_schema = generate_json_schema\n self.handler = handler_override or generate_json_schema.generate_inner\n self.mode = generate_json_schema.mode\n\n def __call__(self, core_schema: CoreSchemaOrField, /) -> JsonSchemaValue:\n return self.handler(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/_internal/_std_types_schema.py_get_enum_core_schema_get_enum_core_schema.return.enum_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_std_types_schema.py_get_enum_core_schema_get_enum_core_schema.return.enum_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": 60, "end_line": 121, "span_ids": ["get_enum_core_schema"], "tokens": 727}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_enum_core_schema(enum_type: type[Enum], config: ConfigDict) -> CoreSchema:\n cases: list[Any] = list(enum_type.__members__.values())\n\n enum_ref = get_type_ref(enum_type)\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 js_updates = {'title': enum_type.__name__, 'description': description}\n js_updates = {k: v for k, v in js_updates.items() if v is not None}\n\n def get_json_schema(_, handler: GetJsonSchemaHandler) -> JsonSchemaValue:\n json_schema = handler(core_schema.literal_schema([x.value for x in cases], ref=enum_ref))\n original_schema = handler.resolve_ref_schema(json_schema)\n update_json_schema(original_schema, js_updates)\n return json_schema\n\n if not cases:\n # Use an isinstance check for enums with no cases.\n # The most important use case for this is creating TypeVar bounds for generics that should\n # be restricted to enums. This is more consistent than it might seem at first, since you can only\n # subclass enum.Enum (or subclasses of enum.Enum) if all parent classes have no cases.\n # We use the get_json_schema function when an Enum subclass has been declared with no cases\n # so that we can still generate a valid json schema.\n return core_schema.is_instance_schema(enum_type, metadata={'pydantic_js_functions': [get_json_schema]})\n\n if len(cases) == 1:\n expected = repr(cases[0].value)\n else:\n expected = ', '.join([repr(case.value) for case in cases[:-1]]) + f' or {cases[-1].value!r}'\n\n def to_enum(input_value: Any, /) -> Enum:\n try:\n return enum_type(input_value)\n except ValueError:\n raise PydanticCustomError('enum', 'Input should be {expected}', {'expected': expected})\n\n if issubclass(enum_type, int):\n # this handles `IntEnum`, and also `Foobar(int, Enum)`\n js_updates['type'] = 'integer'\n lax_schema = core_schema.no_info_after_validator_function(to_enum, core_schema.int_schema())\n elif issubclass(enum_type, str):\n # this handles `StrEnum` (3.11 only), and also `Foobar(str, Enum)`\n js_updates['type'] = 'string'\n lax_schema = core_schema.no_info_after_validator_function(to_enum, core_schema.str_schema())\n elif issubclass(enum_type, float):\n js_updates['type'] = 'numeric'\n lax_schema = core_schema.no_info_after_validator_function(to_enum, core_schema.float_schema())\n else:\n lax_schema = core_schema.no_info_plain_validator_function(to_enum)\n\n enum_schema = core_schema.lax_or_strict_schema(\n lax_schema=lax_schema,\n strict_schema=core_schema.json_or_python_schema(\n json_schema=lax_schema, python_schema=core_schema.is_instance_schema(enum_type)\n ),\n ref=enum_ref,\n metadata={'pydantic_js_functions': [get_json_schema]},\n )\n if config.get('use_enum_values', False):\n enum_schema = core_schema.no_info_after_validator_function(attrgetter('value'), enum_schema)\n\n return enum_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/_typing_extra.py_None_7_None_7.else_._make_forward_ref.typing_ForwardRef": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/_internal/_typing_extra.py_None_7_None_7.else_._make_forward_ref.typing_ForwardRef", "embedding": null, "metadata": {"file_path": "pydantic/_internal/_typing_extra.py", "file_name": "_typing_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 306, "end_line": 328, "span_ids": ["impl:39"], "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": "if sys.version_info < (3, 9, 8) or (3, 10) <= sys.version_info < (3, 10, 1):\n\n def _make_forward_ref(\n arg: Any,\n is_argument: bool = True,\n *,\n is_class: bool = False,\n ) -> typing.ForwardRef:\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.8, =3.10.0 and isn't used in the calls below.\n\n See https://github.com/python/cpython/pull/28560 for some background.\n The backport happened on 3.9.8, see:\n https://github.com/pydantic/pydantic/discussions/6244#discussioncomment-6275458,\n and on 3.10.1 for the 3.10 branch, see:\n https://github.com/pydantic/pydantic/issues/6912\n\n Implemented as EAFP with memory.\n \"\"\"\n return typing.ForwardRef(arg, is_argument)\n\nelse:\n _make_forward_ref = typing.ForwardRef", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_either_validator_pattern_str_validator.if_isinstance_input_value.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_either_validator_pattern_str_validator.if_isinstance_input_value.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": 120, "end_line": 141, "span_ids": ["pattern_either_validator", "pattern_str_validator"], "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 pattern_either_validator(input_value: Any, /) -> 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) # type: ignore\n else:\n raise PydanticCustomError('pattern_type', 'Input should be a valid pattern')\n\n\ndef pattern_str_validator(input_value: Any, /) -> 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_value.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_value.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": 144, "end_line": 155, "span_ids": ["pattern_bytes_validator"], "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 pattern_bytes_validator(input_value: Any, /) -> typing.Pattern[bytes]:\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/fields.py__Defining_fields_on_mod_if_sys_version_info_3.else_.Deprecated.deprecated": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py__Defining_fields_on_mod_if_sys_version_info_3.else_.Deprecated.deprecated", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["docstring"], "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": "\"\"\"Defining fields on models.\"\"\"\nfrom __future__ import annotations as _annotations\n\nimport dataclasses\nimport inspect\nimport sys\nimport typing\nfrom copy import copy\nfrom dataclasses import Field as DataclassField\nfrom functools import cached_property\nfrom typing import Any, ClassVar\nfrom warnings import warn\n\nimport annotated_types\nimport typing_extensions\nfrom pydantic_core import PydanticUndefined\nfrom typing_extensions import Literal, TypeAlias, Unpack, deprecated\n\nfrom . import types\nfrom ._internal import _decorators, _fields, _generics, _internal_dataclass, _repr, _typing_extra, _utils\nfrom .aliases import AliasChoices, AliasPath\nfrom .config import JsonDict\nfrom .errors import PydanticUserError\nfrom .warnings import PydanticDeprecatedSince20\n\nif typing.TYPE_CHECKING:\n from ._internal._repr import ReprArgs\nelse:\n # See PyCharm issues https://youtrack.jetbrains.com/issue/PY-21915\n # and https://youtrack.jetbrains.com/issue/PY-51428\n DeprecationWarning = PydanticDeprecatedSince20\n\n__all__ = 'Field', 'PrivateAttr', 'computed_field'\n\n\n_Unset: Any = PydanticUndefined\n\nif sys.version_info >= (3, 13):\n import warnings\n\n Deprecated: TypeAlias = warnings.deprecated | deprecated\nelse:\n Deprecated: TypeAlias = deprecated", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.metadata_lookup_FieldInfo.__init__.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo.metadata_lookup_FieldInfo.__init__.None_4", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 173, "end_line": 231, "span_ids": ["FieldInfo", "FieldInfo.__init__"], "tokens": 676}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n metadata_lookup: ClassVar[dict[str, typing.Callable[[Any], Any] | None]] = {\n 'strict': types.Strict,\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 'min_length': annotated_types.MinLen,\n 'max_length': annotated_types.MaxLen,\n 'pattern': None,\n 'allow_inf_nan': None,\n 'max_digits': None,\n 'decimal_places': None,\n 'union_mode': None,\n }\n\n def __init__(self, **kwargs: Unpack[_FieldInfoInputs]) -> None:\n \"\"\"This class should generally not be initialized directly; instead, use the `pydantic.fields.Field` function\n or one of the constructor classmethods.\n\n See the signature of `pydantic.fields.Field` for more details about the expected arguments.\n \"\"\"\n self._attributes_set = {k: v for k, v in kwargs.items() if v is not _Unset}\n kwargs = {k: _DefaultValues.get(k) if v is _Unset else v for k, v in kwargs.items()} # type: ignore\n self.annotation, annotation_metadata = self._extract_metadata(kwargs.get('annotation'))\n\n default = kwargs.pop('default', PydanticUndefined)\n if default is Ellipsis:\n self.default = PydanticUndefined\n else:\n self.default = default\n\n self.default_factory = kwargs.pop('default_factory', None)\n\n if self.default is not PydanticUndefined and self.default_factory is not None:\n raise TypeError('cannot specify both default and default_factory')\n\n self.title = kwargs.pop('title', None)\n self.alias = kwargs.pop('alias', None)\n self.validation_alias = kwargs.pop('validation_alias', None)\n self.serialization_alias = kwargs.pop('serialization_alias', None)\n alias_is_set = any(alias is not None for alias in (self.alias, self.validation_alias, self.serialization_alias))\n self.alias_priority = kwargs.pop('alias_priority', None) or 2 if alias_is_set else None\n self.description = kwargs.pop('description', None)\n self.examples = kwargs.pop('examples', None)\n self.exclude = kwargs.pop('exclude', None)\n self.discriminator = kwargs.pop('discriminator', None)\n # For compatibility with FastAPI<=0.110.0, we preserve the existing value if it is not overridden\n self.deprecated = kwargs.pop('deprecated', getattr(self, 'deprecated', None))\n self.repr = kwargs.pop('repr', True)\n self.json_schema_extra = kwargs.pop('json_schema_extra', None)\n self.validate_default = kwargs.pop('validate_default', None)\n self.frozen = kwargs.pop('frozen', None)\n # currently only used on dataclasses\n self.init = kwargs.pop('init', None)\n self.init_var = kwargs.pop('init_var', None)\n self.kw_only = kwargs.pop('kw_only', None)\n\n self.metadata = self._collect_metadata(kwargs) + annotation_metadata # 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/fields.py_FieldInfo._collect_metadata_FieldInfo.deprecation_message.return.self_deprecated_if_isinst": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_FieldInfo._collect_metadata_FieldInfo.deprecation_message.return.self_deprecated_if_isinst", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 492, "end_line": 528, "span_ids": ["FieldInfo.deprecation_message", "FieldInfo._collect_metadata"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FieldInfo(_repr.Representation):\n\n @staticmethod\n def _collect_metadata(kwargs: dict[str, Any]) -> list[Any]:\n \"\"\"Collect annotations from kwargs.\n\n Args:\n kwargs: Keyword arguments passed to the function.\n\n Returns:\n A list of metadata objects - a combination of `annotated_types.BaseMetadata` and\n `PydanticMetadata`.\n \"\"\"\n metadata: list[Any] = []\n general_metadata = {}\n for key, value in list(kwargs.items()):\n try:\n marker = FieldInfo.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.pydantic_general_metadata(**general_metadata))\n return metadata\n\n @property\n def deprecation_message(self) -> str | None:\n \"\"\"The deprecation message to be emitted, or `None` if not set.\"\"\"\n if self.deprecated is None:\n return None\n if isinstance(self.deprecated, bool):\n return 'deprecated' if self.deprecated else None\n return self.deprecated if isinstance(self.deprecated, str) else self.deprecated.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/fields.py_FieldInfo.__repr_args___FieldInfo.__repr_args__.for_s_in_self___slots___.if_s_default_and_sel.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_and_sel.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": 595, "end_line": 621, "span_ids": ["FieldInfo.__repr_args__"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 == '_attributes_set':\n continue\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 == 'frozen' and self.frozen is False:\n continue\n if s == 'validation_alias' and self.validation_alias == self.alias:\n continue\n if s == 'serialization_alias' and self.serialization_alias == self.alias:\n continue\n if s == 'default' and self.default is not PydanticUndefined:\n yield 'default', self.default\n elif 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 PydanticUndefined:\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_ComputedFieldInfo_ComputedFieldInfo.deprecation_message.return.self_deprecated_if_isinst": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/fields.py_ComputedFieldInfo_ComputedFieldInfo.deprecation_message.return.self_deprecated_if_isinst", "embedding": null, "metadata": {"file_path": "pydantic/fields.py", "file_name": "fields.py", "file_type": "text/x-python", "category": "implementation", "start_line": 958, "end_line": 996, "span_ids": ["ComputedFieldInfo", "ComputedFieldInfo.deprecation_message"], "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": "@dataclasses.dataclass(**_internal_dataclass.slots_true)\nclass ComputedFieldInfo:\n \"\"\"A container for data from `@computed_field` so that we can access it while building the pydantic-core schema.\n\n Attributes:\n decorator_repr: A class variable representing the decorator string, '@computed_field'.\n wrapped_property: The wrapped computed field property.\n return_type: The type of the computed field property's return value.\n alias: The alias of the property to be used during serialization.\n alias_priority: The priority of the alias. This affects whether an alias generator is used.\n title: Title of the computed field to include in the serialization JSON schema.\n description: Description of the computed field to include in the serialization JSON schema.\n deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,\n or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.\n examples: Example values of the computed field to include in the serialization JSON schema.\n json_schema_extra: A dict or callable to provide extra JSON schema properties.\n repr: A boolean indicating whether to include the field in the __repr__ output.\n \"\"\"\n\n decorator_repr: ClassVar[str] = '@computed_field'\n wrapped_property: property\n return_type: Any\n alias: str | None\n alias_priority: int | None\n title: str | None\n description: str | None\n deprecated: Deprecated | str | bool | None\n examples: list[Any] | None\n json_schema_extra: JsonDict | typing.Callable[[JsonDict], None] | None\n repr: bool\n\n @property\n def deprecation_message(self) -> str | None:\n \"\"\"The deprecation message to be emitted, or `None` if not set.\"\"\"\n if self.deprecated is None:\n return None\n if isinstance(self.deprecated, bool):\n return 'deprecated' if self.deprecated else None\n return self.deprecated if isinstance(self.deprecated, str) else self.deprecated.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/functional_serializers.py_model_serializer_6_model_serializer_6.if_f_is_None_.else_._type_ignore": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/functional_serializers.py_model_serializer_6_model_serializer_6.if_f_is_None_.else_._type_ignore", "embedding": null, "metadata": {"file_path": "pydantic/functional_serializers.py", "file_name": "functional_serializers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 309, "end_line": 366, "span_ids": ["model_serializer_6"], "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": "def model_serializer(\n f: Callable[..., Any] | None = None,\n /,\n *,\n mode: Literal['plain', 'wrap'] = 'plain',\n when_used: Literal['always', 'unless-none', 'json', 'json-unless-none'] = 'always',\n return_type: Any = PydanticUndefined,\n) -> Callable[[Any], Any]:\n \"\"\"Decorator that enables custom model serialization.\n\n This is useful when a model need to be serialized in a customized manner, allowing for flexibility beyond just specific fields.\n\n An example would be to serialize temperature to the same temperature scale, such as degrees Celsius.\n\n ```python\n from typing import Literal\n\n from pydantic import BaseModel, model_serializer\n\n class TemperatureModel(BaseModel):\n unit: Literal['C', 'F']\n value: int\n\n @model_serializer()\n def serialize_model(self):\n if self.unit == 'F':\n return {'unit': 'C', 'value': int((self.value - 32) / 1.8)}\n return {'unit': self.unit, 'value': self.value}\n\n temperature = TemperatureModel(unit='F', value=212)\n print(temperature.model_dump())\n #> {'unit': 'C', 'value': 100}\n ```\n\n See [Custom serializers](../concepts/serialization.md#custom-serializers) for more information.\n\n Args:\n f: The function to be decorated.\n mode: The serialization mode.\n\n - `'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\n serialization logic.\n when_used: Determines when this serializer should be used.\n return_type: The return type for the function. If omitted it will be inferred from the type annotation.\n\n Returns:\n The decorator function.\n \"\"\"\n\n def dec(f: Callable[..., Any]) -> _decorators.PydanticDescriptorProxy[Any]:\n dec_info = _decorators.ModelSerializerDecoratorInfo(mode=mode, return_type=return_type, when_used=when_used)\n return _decorators.PydanticDescriptorProxy(f, dec_info)\n\n if f is None:\n return dec\n else:\n return dec(f) # 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/main.py_BaseModel.__get_pydantic_core_schema___BaseModel.__get_pydantic_core_schema__.return.handler_source_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__get_pydantic_core_schema___BaseModel.__get_pydantic_core_schema__.return.handler_source_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 592, "span_ids": ["BaseModel.__get_pydantic_core_schema__"], "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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def __get_pydantic_core_schema__(cls, source: type[BaseModel], handler: GetCoreSchemaHandler, /) -> CoreSchema:\n \"\"\"Hook into generating the model's CoreSchema.\n\n Args:\n source: The class we are generating a schema for.\n This will generally be the same as the `cls` argument if this is a classmethod.\n handler: Call into Pydantic's internal JSON schema generation.\n A callable that calls into Pydantic's internal CoreSchema generation logic.\n\n Returns:\n A `pydantic-core` `CoreSchema`.\n \"\"\"\n # Only use the cached value from this _exact_ class; we don't want one from a parent class\n # This is why we check `cls.__dict__` and don't use `cls.__pydantic_core_schema__` or similar.\n if '__pydantic_core_schema__' in cls.__dict__:\n # Due to the way generic classes are built, it's possible that an invalid schema may be temporarily\n # set on generic classes. I think we could resolve this to ensure that we get proper schema caching\n # for generics, but for simplicity for now, we just always rebuild if the class has a generic origin.\n if not cls.__pydantic_generic_metadata__['origin']:\n return cls.__pydantic_core_schema__\n\n return handler(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/main.py_BaseModel.__get_pydantic_json_schema___BaseModel.__get_pydantic_json_schema__.return.handler_core_schema_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__get_pydantic_json_schema___BaseModel.__get_pydantic_json_schema__.return.handler_core_schema_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 594, "end_line": 618, "span_ids": ["BaseModel.__get_pydantic_json_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 BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls,\n core_schema: CoreSchema,\n handler: GetJsonSchemaHandler,\n /,\n ) -> JsonSchemaValue:\n \"\"\"Hook into generating the model's JSON schema.\n\n Args:\n core_schema: A `pydantic-core` CoreSchema.\n You can ignore this argument and call the handler with a new CoreSchema,\n wrap this CoreSchema (`{'type': 'nullable', 'schema': current_schema}`),\n or just call the handler with the original schema.\n handler: Call into Pydantic's internal JSON schema generation.\n This will raise a `pydantic.errors.PydanticInvalidForJsonSchema` if JSON schema\n generation fails.\n Since this gets called by `BaseModel.model_json_schema` you can override the\n `schema_generator` argument to that function to change JSON schema generation globally\n for a type.\n\n Returns:\n A JSON schema, as a Python object.\n \"\"\"\n return handler(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/main.py_BaseModel.__getstate___BaseModel.__getstate__.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__getstate___BaseModel.__getstate__.return._", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 862, "end_line": 871, "span_ids": ["BaseModel.__getstate__"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def __getstate__(self) -> dict[Any, Any]:\n private = self.__pydantic_private__\n if private:\n private = {k: v for k, v in private.items() if v is not PydanticUndefined}\n return {\n '__dict__': self.__dict__,\n '__pydantic_extra__': self.__pydantic_extra__,\n '__pydantic_fields_set__': self.__pydantic_fields_set__,\n '__pydantic_private__': private,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.__setstate___BaseModel.None_2.__eq__.if_isinstance_other_Base.else_._delegate_to_the_other_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.__setstate___BaseModel.None_2.__eq__.if_isinstance_other_Base.else_._delegate_to_the_other_i", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 873, "end_line": 934, "span_ids": ["BaseModel:50", "BaseModel.__setstate__"], "tokens": 813}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n def __setstate__(self, state: dict[Any, Any]) -> None:\n _object_setattr(self, '__pydantic_fields_set__', state['__pydantic_fields_set__'])\n _object_setattr(self, '__pydantic_extra__', state['__pydantic_extra__'])\n _object_setattr(self, '__pydantic_private__', state['__pydantic_private__'])\n _object_setattr(self, '__dict__', state['__dict__'])\n\n if not typing.TYPE_CHECKING:\n\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, BaseModel):\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 = self.__pydantic_generic_metadata__['origin'] or self.__class__\n other_type = other.__pydantic_generic_metadata__['origin'] or other.__class__\n\n # Perform common checks first\n if not (\n self_type == other_type\n and self.__pydantic_private__ == other.__pydantic_private__\n and self.__pydantic_extra__ == other.__pydantic_extra__\n ):\n return False\n\n # We only want to compare pydantic fields but ignoring fields is costly.\n # We'll perform a fast check first, and fallback only when needed\n # See GH-7444 and GH-7825 for rationale and a performance benchmark\n\n # First, do the fast (and sometimes faulty) __dict__ comparison\n if self.__dict__ == other.__dict__:\n # If the check above passes, then pydantic fields are equal, we can return early\n return True\n\n # We don't want to trigger unnecessary costly filtering of __dict__ on all unequal objects, so we return\n # early if there are no keys to ignore (we would just return False later on anyway)\n model_fields = type(self).model_fields.keys()\n if self.__dict__.keys() <= model_fields and other.__dict__.keys() <= model_fields:\n return False\n\n # If we reach here, there are non-pydantic-fields keys, mapped to unequal values, that we need to ignore\n # Resort to costly filtering of the __dict__ objects\n # We use operator.itemgetter because it is much faster than dict comprehensions\n # NOTE: Contrary to standard python class and instances, when the Model class has a default value for an\n # attribute and the model instance doesn't have a corresponding attribute, accessing the missing attribute\n # raises an error in BaseModel.__getattr__ instead of returning the class attribute\n # So we can use operator.itemgetter() instead of operator.attrgetter()\n getter = operator.itemgetter(*model_fields) if model_fields else lambda _: _utils._SENTINEL\n try:\n return getter(self.__dict__) == getter(other.__dict__)\n except KeyError:\n # In rare cases (such as when using the deprecated BaseModel.copy() method),\n # the __dict__ may not contain all model fields, which is how we can get here.\n # getter(self.__dict__) is much faster than any 'safe' method that accounts\n # for missing keys, and wrapping it in a `try` doesn't slow things down much\n # in the common case.\n self_fields_proxy = _utils.SafeGetItemProxy(self.__dict__)\n other_fields_proxy = _utils.SafeGetItemProxy(other.__dict__)\n return getter(self_fields_proxy) == getter(other_fields_proxy)\n\n # other instance is not a BaseModel\n else:\n return NotImplemented # delegate to the other item in the comparison", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.None_3_BaseModel.__repr__.return.f_self___repr_name___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_BaseModel.None_3_BaseModel.__repr__.return.f_self___repr_name___", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 936, "end_line": 972, "span_ids": ["BaseModel.__repr__", "BaseModel.__iter__", "BaseModel:50"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseModel(metaclass=_model_construction.ModelMetaclass):\n\n if typing.TYPE_CHECKING:\n # We put `__init_subclass__` in a TYPE_CHECKING block because, even though we want the type-checking benefits\n # described in the signature of `__init_subclass__` below, we don't want to modify the default behavior of\n # subclass initialization.\n\n def __init_subclass__(cls, **kwargs: Unpack[ConfigDict]):\n \"\"\"This signature is included purely to help type-checkers check arguments to class declaration, which\n provides a way to conveniently set model_config key/value pairs.\n\n ```py\n from pydantic import BaseModel\n\n class MyModel(BaseModel, extra='allow'):\n ...\n ```\n\n However, this may be deceiving, since the _actual_ calls to `__init_subclass__` will not receive any\n of the config arguments, and will only receive any keyword arguments passed during class initialization\n that are _not_ expected keys in ConfigDict. (This is due to the way `ModelMetaclass.__new__` works.)\n\n Args:\n **kwargs: Keyword arguments passed to the class definition, which set model_config\n\n Note:\n You may want to override `__pydantic_init_subclass__` instead, which behaves similarly but is called\n *after* the class is fully initialized.\n \"\"\"\n\n def __iter__(self) -> TupleGenerator:\n \"\"\"So `dict(model)` works.\"\"\"\n yield from [(k, v) for (k, v) in self.__dict__.items() if not k.startswith('_')]\n extra = self.__pydantic_extra__\n if extra:\n yield from extra.items()\n\n def __repr__(self) -> str:\n return f'{self.__repr_name__()}({self.__repr_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/main.py_create_model_2_create_model_2.annotations._": {"__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.annotations._", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1409, "end_line": 1464, "span_ids": ["create_model_2"], "tokens": 609}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_model( # noqa: C901\n __model_name: str,\n *,\n __config__: ConfigDict | None = None,\n __doc__: str | None = None,\n __base__: type[Model] | tuple[type[Model], ...] | None = None,\n __module__: str | None = None,\n __validators__: dict[str, classmethod] | None = None,\n __cls_kwargs__: dict[str, Any] | None = None,\n __slots__: tuple[str, ...] | None = None,\n **field_definitions: Any,\n) -> type[Model]:\n \"\"\"Usage docs: https://docs.pydantic.dev/2.7/concepts/models/#dynamic-model-creation\n\n Dynamically creates and returns a new Pydantic model, in other words, `create_model` dynamically creates a\n subclass of [`BaseModel`][pydantic.BaseModel].\n\n Args:\n __model_name: The name of the newly created model.\n __config__: The configuration of the new model.\n __doc__: The docstring of the new model.\n __base__: The base class or classes for the new model.\n __module__: The name of the module that the model belongs to;\n if `None`, the value is taken from `sys._getframe(1)`\n __validators__: A dictionary of methods that validate fields.\n __cls_kwargs__: A dictionary of keyword arguments for class creation, such as `metaclass`.\n __slots__: Deprecated. Should not be passed to `create_model`.\n **field_definitions: Attributes of the new model. They should be passed in the format:\n `=(, )`, `=(, )`, or `typing.Annotated[, ]`.\n Any additional metadata in `typing.Annotated[, , ...]` will be ignored.\n\n Returns:\n The new [model][pydantic.BaseModel].\n\n Raises:\n PydanticUserError: If `__base__` and `__config__` are both passed.\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(\n 'to avoid confusion `__config__` and `__base__` cannot be used together',\n code='create-model-config-base',\n )\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 # ... 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/main.py_create_model_2.for_f_name_f_def_in_fiel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/main.py_create_model_2.for_f_name_f_def_in_fiel_", "embedding": null, "metadata": {"file_path": "pydantic/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1466, "end_line": 1527, "span_ids": ["create_model_2", "impl:17"], "tokens": 641}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_model( # noqa: C901\n __model_name: str,\n *,\n __config__: ConfigDict | None = None,\n __doc__: str | None = None,\n __base__: type[Model] | tuple[type[Model], ...] | None = None,\n __module__: str | None = None,\n __validators__: dict[str, classmethod] | None = None,\n __cls_kwargs__: dict[str, Any] | None = None,\n __slots__: tuple[str, ...] | None = None,\n **field_definitions: Any,\n) -> type[Model]:\n # ... other code\n\n for f_name, f_def in field_definitions.items():\n if not _fields.is_valid_field_name(f_name):\n warnings.warn(f'fields may not start with an underscore, ignoring \"{f_name}\"', RuntimeWarning)\n if isinstance(f_def, tuple):\n f_def = typing.cast('tuple[str, Any]', f_def)\n try:\n f_annotation, f_value = f_def\n except ValueError as e:\n raise PydanticUserError(\n 'Field definitions should be a `(, )`.',\n code='create-model-field-definitions',\n ) from e\n\n elif _typing_extra.is_annotated(f_def):\n (f_annotation, f_value, *_) = typing_extensions.get_args(\n f_def\n ) # first two input are expected from Annotated, refer to https://docs.python.org/3/library/typing.html#typing.Annotated\n from .fields import FieldInfo\n\n if not isinstance(f_value, FieldInfo):\n raise PydanticUserError(\n 'Field definitions should be a Annotated[, ]',\n code='create-model-field-definitions',\n )\n\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 if __module__ is None:\n f = sys._getframe(1)\n __module__ = f.f_globals['__name__']\n\n namespace: dict[str, Any] = {'__annotations__': annotations, '__module__': __module__}\n if __doc__:\n namespace.update({'__doc__': __doc__})\n if __validators__:\n namespace.update(__validators__)\n namespace.update(fields)\n if __config__:\n namespace['model_config'] = _config.ConfigWrapper(__config__).config_dict\n resolved_bases = types.resolve_bases(__base__)\n meta, ns, kwds = types.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\n return meta(\n __model_name,\n resolved_bases,\n namespace,\n __pydantic_reset_parent_namespace__=False,\n _create_model_module=__module__,\n **kwds,\n )\n\n\n__getattr__ = getattr_migration(__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/mypy.py_PydanticModelField_PydanticModelField.__init__.self.info.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField_PydanticModelField.__init__.self.info.info", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 337, "span_ids": ["PydanticModelField", "PydanticModelField.__init__"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelField:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.\"\"\"\n\n def __init__(\n self,\n name: str,\n alias: str | None,\n has_dynamic_alias: bool,\n has_default: bool,\n line: int,\n column: int,\n type: Type | None,\n info: TypeInfo,\n ):\n self.name = name\n self.alias = alias\n self.has_dynamic_alias = has_dynamic_alias\n self.has_default = has_default\n self.line = line\n self.column = column\n self.type = type\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/mypy.py_PydanticModelField.to_argument_PydanticModelField.to_argument.return.Argument_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_argument_PydanticModelField.to_argument.return.Argument_", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 355, "span_ids": ["PydanticModelField.to_argument"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelField:\n\n def to_argument(\n self,\n current_info: TypeInfo,\n typed: bool,\n force_optional: bool,\n use_alias: bool,\n api: SemanticAnalyzerPluginInterface,\n ) -> Argument:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.to_argument.\"\"\"\n variable = self.to_var(current_info, api, use_alias)\n type_annotation = self.expand_type(current_info, api) if typed else AnyType(TypeOfAny.explicit)\n return Argument(\n variable=variable,\n type_annotation=type_annotation,\n initializer=None,\n kind=ARG_NAMED_OPT if force_optional or self.has_default else ARG_NAMED,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_var_PydanticModelField.expand_typevar_from_subtype.if_self_type_is_not_None_.with_state_strict_optiona.self.type.map_type_from_supertype_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/mypy.py_PydanticModelField.to_var_PydanticModelField.expand_typevar_from_subtype.if_self_type_is_not_None_.with_state_strict_optiona.self.type.map_type_from_supertype_s", "embedding": null, "metadata": {"file_path": "pydantic/mypy.py", "file_name": "mypy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 404, "span_ids": ["PydanticModelField.expand_typevar_from_subtype", "PydanticModelField.deserialize", "PydanticModelField.serialize", "PydanticModelField.to_var"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PydanticModelField:\n\n def to_var(self, current_info: TypeInfo, api: SemanticAnalyzerPluginInterface, use_alias: bool) -> Var:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.\"\"\"\n if use_alias and self.alias is not None:\n name = self.alias\n else:\n name = self.name\n\n return Var(name, self.expand_type(current_info, api))\n\n def serialize(self) -> JsonDict:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.serialize.\"\"\"\n assert self.type\n return {\n 'name': self.name,\n 'alias': self.alias,\n 'has_dynamic_alias': self.has_dynamic_alias,\n 'has_default': self.has_default,\n 'line': self.line,\n 'column': self.column,\n 'type': self.type.serialize(),\n }\n\n @classmethod\n def deserialize(cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface) -> PydanticModelField:\n \"\"\"Based on mypy.plugins.dataclasses.DataclassAttribute.deserialize.\"\"\"\n data = data.copy()\n typ = deserialize_and_fixup_type(data.pop('type'), api)\n return cls(type=typ, info=info, **data)\n\n def expand_typevar_from_subtype(self, sub_type: TypeInfo, api: SemanticAnalyzerPluginInterface) -> None:\n \"\"\"Expands type vars in the context of a subtype when an attribute is inherited\n from a generic super type.\n \"\"\"\n if self.type is not None:\n with state.strict_optional_set(api.options.strict_optional):\n self.type = map_type_from_supertype(self.type, sub_type, self.info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NatsDsn_None_1.else_.EmailStr._validate.return.validate_email_input_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/pydantic/networks.py_NatsDsn_None_1.else_.EmailStr._validate.return.validate_email_input_valu", "embedding": null, "metadata": {"file_path": "pydantic/networks.py", "file_name": "networks.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 434, "span_ids": ["impl:33", "import_email_validator", "impl:19", "impl:37"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "NatsDsn = Annotated[\n MultiHostUrl, UrlConstraints(allowed_schemes=['nats', 'tls', 'ws'], default_host='localhost', default_port=4222)\n]\n\"\"\"A type that will accept any NATS DSN.\n\nNATS is a connective technology built for the ever increasingly hyper-connected world.\nIt is a single technology that enables applications to securely communicate across\nany combination of cloud vendors, on-premise, edge, web and mobile, and devices.\nMore: https://nats.io\n\"\"\"\nMySQLDsn = 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]\n\"\"\"A type that will accept any MySQL DSN.\n\n* User info required\n* TLD not required\n* Host required\n\"\"\"\nMariaDBDsn = Annotated[\n Url,\n UrlConstraints(\n allowed_schemes=['mariadb', 'mariadb+mariadbconnector', 'mariadb+pymysql'],\n default_port=3306,\n ),\n]\n\"\"\"A type that will accept any MariaDB DSN.\n\n* User info required\n* TLD not required\n* Host required\n\"\"\"\nClickHouseDsn = Annotated[\n Url,\n UrlConstraints(\n allowed_schemes=['clickhouse+native', 'clickhouse+asynch'],\n default_host='localhost',\n default_port=9000,\n ),\n]\n\"\"\"A type that will accept any ClickHouse DSN.\n\n* User info required\n* TLD not required\n* Host required\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 if not version('email-validator').partition('.')[0] == '2':\n raise ImportError('email-validator version >= 2.0 required, run pip install -U email-validator')\n\n\nif TYPE_CHECKING:\n EmailStr = Annotated[str, ...]\nelse:\n\n class EmailStr:\n \"\"\"\n Info:\n To use this type, you need to install the optional\n [`email-validator`](https://github.com/JoshData/python-email-validator) package:\n\n ```bash\n pip install email-validator\n ```\n\n Validate email addresses.\n\n ```py\n from pydantic import BaseModel, EmailStr\n\n class Model(BaseModel):\n email: EmailStr\n\n print(Model(email='contact@mail.com'))\n #> email='contact@mail.com'\n ```\n \"\"\" # noqa: D212\n\n @classmethod\n def __get_pydantic_core_schema__(\n cls,\n _source: type[Any],\n _handler: GetCoreSchemaHandler,\n ) -> core_schema.CoreSchema:\n import_email_validator()\n return core_schema.no_info_after_validator_function(cls._validate, core_schema.str_schema())\n\n @classmethod\n def __get_pydantic_json_schema__(\n cls, core_schema: core_schema.CoreSchema, handler: _schema_generation_shared.GetJsonSchemaHandler\n ) -> JsonSchemaValue:\n field_schema = handler(core_schema)\n field_schema.update(type='string', format='email')\n return field_schema\n\n @classmethod\n def _validate(cls, input_value: str, /) -> 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/tests/benchmarks/test_discriminated_unions.py_from___future___import_an_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/benchmarks/test_discriminated_unions.py_from___future___import_an_", "embedding": null, "metadata": {"file_path": "tests/benchmarks/test_discriminated_unions.py", "file_name": "test_discriminated_unions.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 47, "span_ids": ["impl:3", "impl", "build_nested_state", "imports", "test_efficiency_with_highly_nested_examples", "NestedState", "LoopState", "test_schema_build", "LeafState"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import annotations\n\nfrom typing import Literal, Union\n\nfrom typing_extensions import Annotated\n\nfrom pydantic import BaseModel, Field, TypeAdapter\n\n\nclass NestedState(BaseModel):\n state_type: Literal['nested']\n substate: AnyState\n\n\nclass LoopState(BaseModel):\n state_type: Literal['loop']\n substate: AnyState\n\n\nclass LeafState(BaseModel):\n state_type: Literal['leaf']\n\n\nAnyState = Annotated[Union[NestedState, LoopState, LeafState], Field(..., discriminator='state_type')]\n\n\ndef test_schema_build() -> None:\n adapter = TypeAdapter(AnyState)\n assert adapter.core_schema['schema']['type'] == 'tagged-union'\n\n\nany_state_adapter = TypeAdapter(AnyState)\n\n\ndef build_nested_state(n):\n if n <= 0:\n return {'state_type': 'leaf'}\n else:\n return {'state_type': 'loop', 'substate': {'state_type': 'nested', 'substate': build_nested_state(n - 1)}}\n\n\ndef test_efficiency_with_highly_nested_examples() -> None:\n # can go much higher, but we keep it reasonably low here for a proof of concept\n for i in range(1, 12):\n very_nested_input = build_nested_state(i)\n any_state_adapter.validate_python(very_nested_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/mypy/modules/config_conditional_extra.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/config_conditional_extra.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/config_conditional_extra.py", "file_name": "config_conditional_extra.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["imports", "condition", "MyModel"], "tokens": 44}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, ConfigDict\n\n\ndef condition() -> bool:\n return True\n\n\nclass MyModel(BaseModel):\n model_config = ConfigDict(extra='ignore' if condition() else '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/tests/mypy/modules/plugin_fail.py_from_typing_import_Generi_DynamicAliasModel2_x_y_": {"__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_DynamicAliasModel2_x_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": 1, "end_line": 160, "span_ids": ["DefaultTestingModel", "KwargsModel", "impl", "KwargsBadConfig2", "UndefinedAnnotationModel", "Model", "KwargsInheritingModel", "impl:8", "KwargsBadExtraModel", "InheritingModel", "impl:27", "KwargsModel.method", "impl:17", "AliasModel", "impl:35", "Response", "impl:31", "Model.method", "BadExtraModel", "imports", "KwargsForbidExtraModel", "impl:16", "BadConfig2", "KwargsBadConfig1", "DynamicAliasModel2", "impl:34", "BadConfig1", "Blah", "impl:25", "DynamicAliasModel", "ForbidExtraModel", "impl:18", "impl:15"], "tokens": 811}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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({})\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({})\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=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 model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\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\n\n\nDynamicAliasModel(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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_KwargsDynamicAliasModel_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_fail.py_KwargsDynamicAliasModel_", "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": 163, "end_line": 288, "span_ids": ["impl:49", "KwargsAliasGeneratorModel", "impl:44", "AddProject", "impl:39", "AliasGeneratorModel2", "CoverageTester", "_default_factory", "ModelWithAnnotatedValidator", "FrozenModel", "impl:47", "InheritingModel2", "UntypedFieldModel", "AliasGeneratorModel", "CoverageTester.from_orm", "impl:60", "KwargsAliasGeneratorModel2", "ModelWithAnnotatedValidator.instance_method", "impl:52", "impl:42", "FieldDefaultTestingModel", "ModelWithAnnotatedValidator.noop_validator_with_annotations", "impl:37", "impl:50", "impl:56", "KwargsDynamicAliasModel"], "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 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_optional_inheritance.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/plugin_optional_inheritance.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/plugin_optional_inheritance.py", "file_name": "plugin_optional_inheritance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["impl", "imports", "Foo", "Bar", "Baz"], "tokens": 84}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional\n\nfrom pydantic import BaseModel\n\n\nclass Foo(BaseModel):\n id: Optional[int]\n\n\nclass Bar(BaseModel):\n foo: Optional[Foo]\n\n\nclass Baz(Bar):\n name: str\n\n\nb = Bar(foo={'id': 1})\nassert b.foo.id == 1\n\nz = Baz(foo={'id': 1}, name='test')\nassert z.foo.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/mypy/modules/strict_equality.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/modules/strict_equality.py__", "embedding": null, "metadata": {"file_path": "tests/mypy/modules/strict_equality.py", "file_name": "strict_equality.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["imports", "User", "impl"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 User(BaseModel):\n username: str\n\n\nuser = User(username='test')\nprint(user == 'test')\nprint(user.username == int('1'))\nprint(user.username == '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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model", "KwargsInheritingModel", "impl:8", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "impl:17", "Model.method", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "ForbidExtraModel", "impl:15"], "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": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n model_config = ConfigDict(frozen=False)\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 113, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_39": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_39", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 293, "span_ids": ["KwargsAliasGeneratorModel", "impl:59", "AliasGeneratorModel2", "AliasGeneratorModel", "CoverageTester.from_orm", "CoverageTester", "impl:60", "impl:44", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "impl:47", "KwargsDynamicAliasModel", "UntypedFieldModel"], "tokens": 858}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model", "KwargsInheritingModel", "impl:8", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "impl:17", "Model.method", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "ForbidExtraModel", "impl:15"], "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": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n model_config = ConfigDict(frozen=False)\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 113, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/mypy-plugin_ini/plugin_optional_inheritance.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_optional_inheritance.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/mypy-plugin_ini/plugin_optional_inheritance.py", "file_name": "plugin_optional_inheritance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "Foo", "Bar", "Baz"], "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": "from typing import Optional\n\nfrom pydantic import BaseModel\n\n\nclass Foo(BaseModel):\n id: Optional[int]\n\n\nclass Bar(BaseModel):\n foo: Optional[Foo]\n\n\nclass Baz(Bar):\n name: str\n\n\nb = Bar(foo={'id': 1})\nassert b.foo.id == 1\n# MYPY: error: Item \"None\" of \"Optional[Foo]\" has no attribute \"id\" [union-attr]\n\nz = Baz(foo={'id': 1}, name='test')\nassert z.foo.id == 1\n# MYPY: error: Item \"None\" of \"Optional[Foo]\" has no attribute \"id\" [union-attr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict-equality_toml/strict_equality.py_from_pydantic_import_Base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict-equality_toml/strict_equality.py_from_pydantic_import_Base_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict-equality_toml/strict_equality.py", "file_name": "strict_equality.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["imports", "User", "impl"], "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": "from pydantic import BaseModel\n\n\nclass User(BaseModel):\n username: str\n\n\nuser = User(username='test')\nprint(user == 'test')\n# MYPY: error: Non-overlapping equality check (left operand type: \"User\", right operand type: \"Literal['test']\") [comparison-overlap]\nprint(user.username == int('1'))\n# MYPY: error: Non-overlapping equality check (left operand type: \"str\", right operand type: \"int\") [comparison-overlap]\nprint(user.username == '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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model", "KwargsInheritingModel", "impl:8", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "impl:17", "Model.method", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "ForbidExtraModel", "impl:15"], "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": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n model_config = ConfigDict(frozen=False)\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 113, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_39": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_39", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 293, "span_ids": ["KwargsAliasGeneratorModel", "impl:59", "AliasGeneratorModel2", "AliasGeneratorModel", "CoverageTester.from_orm", "CoverageTester", "impl:60", "impl:44", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "impl:47", "KwargsDynamicAliasModel", "UntypedFieldModel"], "tokens": 858}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\n# MYPY: error: Argument \"x\" to \"Model\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsInheritingModel.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["KwargsModel", "impl", "KwargsBadConfig2", "Model", "KwargsInheritingModel", "impl:8", "KwargsBadExtraModel", "InheritingModel", "KwargsModel.method", "impl:17", "Model.method", "BadExtraModel", "imports", "KwargsForbidExtraModel", "BadConfig2", "KwargsBadConfig1", "BadConfig1", "ForbidExtraModel", "impl:15"], "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": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass InheritingModel(Model):\n model_config = ConfigDict(frozen=False)\n\n\nclass KwargsInheritingModel(KwargsModel, frozen=False):\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/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py_DefaultTestingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 113, "span_ids": ["DefaultTestingModel"], "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 DefaultTestingModel(BaseModel):\n # Required\n a: int\n b: int = ...\n# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.0.1/pyproject-plugin_toml/plugin_optional_inheritance.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_optional_inheritance.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.0.1/pyproject-plugin_toml/plugin_optional_inheritance.py", "file_name": "plugin_optional_inheritance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "Foo", "Bar", "Baz"], "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": "from typing import Optional\n\nfrom pydantic import BaseModel\n\n\nclass Foo(BaseModel):\n id: Optional[int]\n\n\nclass Bar(BaseModel):\n foo: Optional[Foo]\n\n\nclass Baz(Bar):\n name: str\n\n\nb = Bar(foo={'id': 1})\nassert b.foo.id == 1\n# MYPY: error: Item \"None\" of \"Optional[Foo]\" has no attribute \"id\" [union-attr]\n\nz = Baz(foo={'id': 1}, name='test')\nassert z.foo.id == 1\n# MYPY: error: Item \"None\" of \"Optional[Foo]\" has no attribute \"id\" [union-attr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_41", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 295, "span_ids": ["KwargsAliasGeneratorModel", "impl:59", "AliasGeneratorModel2", "AliasGeneratorModel", "CoverageTester.from_orm", "CoverageTester", "impl:60", "impl:44", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "impl:47", "KwargsDynamicAliasModel", "UntypedFieldModel"], "tokens": 856}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_41", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 295, "span_ids": ["KwargsAliasGeneratorModel", "impl:59", "AliasGeneratorModel2", "AliasGeneratorModel", "CoverageTester.from_orm", "CoverageTester", "impl:60", "impl:44", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "impl:47", "KwargsDynamicAliasModel", "UntypedFieldModel"], "tokens": 856}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.2.0/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py_KwargsDynamicAliasModel_None_41", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin-strict_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 295, "span_ids": ["KwargsAliasGeneratorModel", "impl:59", "AliasGeneratorModel2", "AliasGeneratorModel", "CoverageTester.from_orm", "CoverageTester", "impl:60", "impl:44", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "impl:47", "KwargsDynamicAliasModel", "UntypedFieldModel"], "tokens": 856}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/mypy-plugin_ini/plugin_optional_inheritance.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_optional_inheritance.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/mypy-plugin_ini/plugin_optional_inheritance.py", "file_name": "plugin_optional_inheritance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "Foo", "Bar", "Baz"], "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": "from typing import Optional\n\nfrom pydantic import BaseModel\n\n\nclass Foo(BaseModel):\n id: Optional[int]\n\n\nclass Bar(BaseModel):\n foo: Optional[Foo]\n\n\nclass Baz(Bar):\n name: str\n\n\nb = Bar(foo={'id': 1})\nassert b.foo.id == 1\n# MYPY: error: Item \"None\" of \"Foo | None\" has no attribute \"id\" [union-attr]\n\nz = Baz(foo={'id': 1}, name='test')\nassert z.foo.id == 1\n# MYPY: error: Item \"None\" of \"Foo | None\" has no attribute \"id\" [union-attr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_41": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py_KwargsDynamicAliasModel_None_41", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin-strict_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 295, "span_ids": ["KwargsAliasGeneratorModel", "impl:59", "AliasGeneratorModel2", "AliasGeneratorModel", "CoverageTester.from_orm", "CoverageTester", "impl:60", "impl:44", "impl:50", "impl:56", "impl:53", "FrozenModel", "AddProject", "KwargsAliasGeneratorModel2", "impl:62", "impl:47", "KwargsDynamicAliasModel", "UntypedFieldModel"], "tokens": 856}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# MYPY: error: Missing named argument \"y\" for \"model_construct\" of \"Model\" [call-arg]\n# MYPY: error: Argument \"x\" to \"InheritingModel\" has incompatible type \"str\"; expected \"int\" [arg-type]\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)\n# MYPY: error: Unexpected keyword argument \"y\" for \"KwargsDynamicAliasModel\" [call-arg]\nKwargsDynamicAliasModel(x='y', z=1)\n\n\nclass AliasGeneratorModel(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n\n model_config = ConfigDict(alias_generator=lambda x: x + '_')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nAliasGeneratorModel(x=1)\nAliasGeneratorModel(x_=1)\nAliasGeneratorModel(z=1)\n\n\nclass AliasGeneratorModel2(BaseModel):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\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# MYPY: error: Untyped fields disallowed [pydantic-field]\n z = 2 # type: ignore[pydantic-field]\n\n\nAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"AliasGeneratorModel2\" [call-arg]\nAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"AliasGeneratorModel2\" [call-arg]\n\n\nclass KwargsAliasGeneratorModel(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel(x=1)\nKwargsAliasGeneratorModel(x_=1)\nKwargsAliasGeneratorModel(z=1)\n\n\nclass KwargsAliasGeneratorModel2(BaseModel, alias_generator=lambda x: x + '_'):\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n x: int = Field(..., alias='y')\n# MYPY: error: Required dynamic aliases disallowed [pydantic-alias]\n\n\nKwargsAliasGeneratorModel2(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsAliasGeneratorModel2\" [call-arg]\nKwargsAliasGeneratorModel2(y=1, z=1)\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsAliasGeneratorModel2\" [call-arg]\n\n\nclass CoverageTester(Missing): # noqa F821\n# MYPY: error: Name \"Missing\" is not defined [name-defined]\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# MYPY: error: Property \"y\" defined in \"FrozenModel\" is read-only [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/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_from_typing_import_Generi_KwargsBadConfig2.pass", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 88, "span_ids": ["Model.method", "KwargsModel", "impl", "BadExtraModel", "imports", "KwargsModel.method", "KwargsForbidExtraModel", "BadConfig2", "impl:17", "KwargsBadConfig1", "KwargsBadConfig2", "Model", "impl:8", "KwargsBadExtraModel", "ForbidExtraModel", "BadConfig1", "impl:15"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"Model\" [call-arg]\nmodel = Model(x=1)\n# MYPY: error: Missing named argument \"y\" for \"Model\" [call-arg]\nmodel.y = 'a'\n# MYPY: error: Property \"y\" defined in \"Model\" is read-only [misc]\nModel.from_orm({})\n# MYPY: error: \"Model\" does not have from_attributes=True [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')\n# MYPY: error: Unexpected keyword argument \"z\" for \"KwargsModel\" [call-arg]\nkwargs_model = KwargsModel(x=1)\n# MYPY: error: Missing named argument \"y\" for \"KwargsModel\" [call-arg]\nkwargs_model.y = 'a'\n# MYPY: error: Property \"y\" defined in \"KwargsModel\" is read-only [misc]\nKwargsModel.from_orm({})\n# MYPY: error: \"KwargsModel\" does not have from_attributes=True [pydantic-orm]\n\n\nclass ForbidExtraModel(BaseModel):\n model_config = ConfigDict(extra=Extra.forbid)\n\n\nForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"ForbidExtraModel\" [call-arg]\n\n\nclass KwargsForbidExtraModel(BaseModel, extra='forbid'):\n pass\n\n\nKwargsForbidExtraModel(x=1)\n# MYPY: error: Unexpected keyword argument \"x\" for \"KwargsForbidExtraModel\" [call-arg]\n\n\nclass BadExtraModel(BaseModel):\n model_config = ConfigDict(extra=1) # type: ignore[typeddict-item]\n\n\nclass KwargsBadExtraModel(BaseModel, extra=1):\n# MYPY: error: Invalid value for \"Config.extra\" [pydantic-config]\n pass\n\n\nclass BadConfig1(BaseModel):\n model_config = ConfigDict(from_attributes={}) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig1(BaseModel, from_attributes={}):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n pass\n\n\nclass BadConfig2(BaseModel):\n model_config = ConfigDict(from_attributes=list) # type: ignore[typeddict-item]\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\n# MYPY: note: Error code \"pydantic-config\" not covered by \"type: ignore\" comment\n\n\nclass KwargsBadConfig2(BaseModel, from_attributes=list):\n# MYPY: error: Invalid value for \"Config.from_attributes\" [pydantic-config]\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/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py_InheritingModel_DefaultTestingModel.j.1", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_fail.py", "file_name": "plugin_fail.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 115, "span_ids": ["InheritingModel", "DefaultTestingModel", "KwargsInheritingModel"], "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 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# MYPY: error: Incompatible types in assignment (expression has type \"ellipsis\", variable has type \"int\") [assignment]\n c: int = Field(...)\n d: Union[int, str]\n e = ...\n# MYPY: error: Untyped fields disallowed [pydantic-field]\n\n # Not required\n f: Optional[int]\n g: int = 1\n h: int = Field(1)\n i: int = Field(None)\n# MYPY: error: Incompatible types in assignment (expression has type \"None\", variable has type \"int\") [assignment]\n j = 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/outputs/1.4.1/pyproject-plugin_toml/plugin_optional_inheritance.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_optional_inheritance.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "tests/mypy/outputs/1.4.1/pyproject-plugin_toml/plugin_optional_inheritance.py", "file_name": "plugin_optional_inheritance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "imports", "Foo", "Bar", "Baz"], "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": "from typing import Optional\n\nfrom pydantic import BaseModel\n\n\nclass Foo(BaseModel):\n id: Optional[int]\n\n\nclass Bar(BaseModel):\n foo: Optional[Foo]\n\n\nclass Baz(Bar):\n name: str\n\n\nb = Bar(foo={'id': 1})\nassert b.foo.id == 1\n# MYPY: error: Item \"None\" of \"Foo | None\" has no attribute \"id\" [union-attr]\n\nz = Baz(foo={'id': 1}, name='test')\nassert z.foo.id == 1\n# MYPY: error: Item \"None\" of \"Foo | None\" has no attribute \"id\" [union-attr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/mypy/test_mypy.py_test_mypy_results_test_mypy_results.if_merged_output_exis.else_.assert_mypy_returncode_": {"__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.if_merged_output_exis.else_.assert_mypy_returncode_", "embedding": null, "metadata": {"file_path": "tests/mypy/test_mypy.py", "file_name": "test_mypy.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 216, "span_ids": ["test_mypy_results"], "tokens": 638}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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:ast.:DeprecationWarning') # these are produced by mypy in python 3.12\n@pytest.mark.parametrize('config_filename,python_filename', cases)\ndef test_mypy_results(config_filename: str, python_filename: str, request: pytest.FixtureRequest) -> None:\n input_path = PYDANTIC_ROOT / 'tests/mypy/modules' / python_filename\n config_path = PYDANTIC_ROOT / 'tests/mypy/configs' / config_filename\n test_config = get_test_config(input_path, config_path)\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 = [\n str(input_path),\n '--config-file',\n str(config_path),\n '--cache-dir',\n cache_dir,\n '--show-error-codes',\n '--show-traceback',\n ]\n print(f\"\\nExecuting: mypy {' '.join(command)}\") # makes it easier to debug as necessary\n mypy_out, mypy_err, mypy_returncode = mypy_api.run(command)\n\n # Need to strip filenames due to differences in formatting by OS\n mypy_out = '\\n'.join(['.py:'.join(line.split('.py:')[1:]) for line in mypy_out.split('\\n') if line]).strip()\n mypy_out = re.sub(r'\\n\\s*\\n', r'\\n', mypy_out)\n if mypy_out:\n print('{0}\\n{1:^100}\\n{0}\\n{2}\\n{0}'.format('=' * 100, f'mypy {mypy_version} output', mypy_out))\n assert mypy_err == ''\n\n input_code = input_path.read_text()\n\n existing_output_code: Optional[str] = None\n if test_config.existing is not None:\n existing_output_code = test_config.existing.output_path.read_text()\n print(f'Comparing output with {test_config.existing.output_path}')\n else:\n print(f'Comparing output with {input_path} (expecting no mypy errors)')\n\n merged_output = merge_python_and_mypy_output(input_code, mypy_out)\n\n if merged_output == (existing_output_code or input_code):\n # Test passed, no changes needed\n pass\n elif request.config.getoption('update_mypy'):\n test_config.current.output_path.parent.mkdir(parents=True, exist_ok=True)\n test_config.current.output_path.write_text(merged_output)\n else:\n print('**** Merged Output ****')\n print(merged_output)\n print('***********************')\n assert existing_output_code is not None, 'No output file found, run `make test-mypy-update` to create it'\n assert merged_output == existing_output_code\n expected_returncode = get_expected_return_code(existing_output_code)\n assert mypy_returncode == expected_returncode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_all_alias_kinds_specified_test_all_alias_kinds_specified.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_test_all_alias_kinds_specified_test_all_alias_kinds_specified.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": 683, "end_line": 704, "span_ids": ["test_all_alias_kinds_specified"], "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_all_alias_kinds_specified() -> None:\n class Foo(BaseModel):\n a: str\n\n model_config = ConfigDict(\n alias_generator=AliasGenerator(\n alias=lambda field_name: f'{field_name}_alias',\n validation_alias=lambda field_name: f'{field_name}_val_alias',\n serialization_alias=lambda field_name: f'{field_name}_ser_alias',\n )\n )\n\n assert Foo.model_fields['a'].alias == 'a_alias'\n assert Foo.model_fields['a'].validation_alias == 'a_val_alias'\n assert Foo.model_fields['a'].serialization_alias == 'a_ser_alias'\n\n # the same behavior we'd expect if we defined alias, validation_alias\n # and serialization_alias on the field itself\n f = Foo(a_val_alias='a')\n assert f.a == 'a'\n assert f.model_dump(by_alias=True) == {'a_ser_alias': 'a'}\n assert f.model_dump(by_alias=False) == {'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_aliases.py_test_alias_generator_with_computed_field_for_serialization_test_alias_generator_with_computed_field_for_serialization.assert_r_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_test_alias_generator_with_computed_field_for_serialization_test_alias_generator_with_computed_field_for_serialization.assert_r_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": 707, "end_line": 727, "span_ids": ["test_alias_generator_with_computed_field_for_serialization"], "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_alias_generator_with_computed_field_for_serialization() -> None:\n \"\"\"Tests that the alias generator is used for computed fields, with serialization_alias taking precedence over alias.\"\"\"\n\n class Rectangle(BaseModel):\n model_config = ConfigDict(\n alias_generator=AliasGenerator(\n validation_alias=lambda field_name: f'{field_name}_val_alias',\n alias=lambda field_name: f'{field_name}_alias',\n serialization_alias=lambda field_name: f'{field_name}_ser_alias',\n )\n )\n\n width: int\n height: int\n\n @computed_field\n def area(self) -> int:\n return self.width * self.height\n\n r = Rectangle(width_val_alias=10, height_val_alias=20)\n assert r.model_dump(by_alias=True) == {'width_ser_alias': 10, 'height_ser_alias': 20, 'area_ser_alias': 200}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_empty_str_alias_generator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_aliases.py_empty_str_alias_generator_", "embedding": null, "metadata": {"file_path": "tests/test_aliases.py", "file_name": "test_aliases.py", "file_type": "text/x-python", "category": "test", "start_line": 730, "end_line": 760, "span_ids": ["test_alias_gen_with_empty_string", "impl:3", "test_alias_gen_with_empty_string_and_computed_field"], "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": "empty_str_alias_generator = AliasGenerator(\n validation_alias=lambda x: '', alias=lambda x: f'{x}_alias', serialization_alias=lambda x: ''\n)\n\n\ndef test_alias_gen_with_empty_string() -> None:\n class Model(BaseModel):\n a: str\n\n model_config = ConfigDict(alias_generator=empty_str_alias_generator)\n\n assert Model.model_fields['a'].validation_alias == ''\n assert Model.model_fields['a'].serialization_alias == ''\n assert Model.model_fields['a'].alias == 'a_alias'\n\n\ndef test_alias_gen_with_empty_string_and_computed_field() -> None:\n class Model(BaseModel):\n model_config = ConfigDict(alias_generator=empty_str_alias_generator)\n\n a: str\n\n @computed_field\n def b(self) -> str:\n return self.a\n\n assert Model.model_fields['a'].validation_alias == ''\n assert Model.model_fields['a'].serialization_alias == ''\n assert Model.model_fields['a'].alias == 'a_alias'\n assert Model.model_computed_fields['b'].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/tests/test_computed_fields.py_test_generic_computed_field_test_generic_computed_field.with_pytest_warns_UserWar.B_int_model_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_generic_computed_field_test_generic_computed_field.with_pytest_warns_UserWar.B_int_model_dump_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 739, "end_line": 764, "span_ids": ["test_generic_computed_field"], "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_generic_computed_field():\n T = TypeVar('T')\n\n class A(BaseModel, Generic[T]):\n x: T\n\n @computed_field\n @property\n def double_x(self) -> T:\n return self.x * 2\n\n assert A[int](x=1).model_dump() == {'x': 1, 'double_x': 2}\n assert A[str](x='abc').model_dump() == {'x': 'abc', 'double_x': 'abcabc'}\n\n assert A(x='xxxxxx').model_computed_fields['double_x'].return_type == T\n assert A[int](x=123).model_computed_fields['double_x'].return_type == int\n assert A[str](x='x').model_computed_fields['double_x'].return_type == str\n\n class B(BaseModel, Generic[T]):\n @computed_field\n @property\n def double_x(self) -> T:\n return 'abc' # this may not match the annotated return type, and will warn if not\n\n with pytest.warns(UserWarning, match='Expected `int` but got `str` - serialized value may not be as expected'):\n B[int]().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_computed_fields.py_test_computed_field_override_raises_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_computed_fields.py_test_computed_field_override_raises_", "embedding": null, "metadata": {"file_path": "tests/test_computed_fields.py", "file_name": "test_computed_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 767, "end_line": 795, "span_ids": ["test_computed_field_excluded_from_model_dump_recursive", "test_computed_field_override_raises"], "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_computed_field_override_raises():\n class Model(BaseModel):\n name: str = 'foo'\n\n with pytest.raises(ValueError, match=\"you can't override a field with a computed field\"):\n\n class SubModel(Model):\n @computed_field\n @property\n def name(self) -> str:\n return 'bar'\n\n\n@pytest.mark.skip(reason='waiting on next pydantic-core version, right now, causes a recursion error')\ndef test_computed_field_excluded_from_model_dump_recursive() -> None:\n # see https://github.com/pydantic/pydantic/issues/9015 for a more contextualized example\n class Model(BaseModel):\n bar: int\n\n @computed_field\n @property\n def id(self) -> str:\n str_obj = self.model_dump_json(exclude={'id'})\n # you could imagine hashing str_obj, etc. but for simplicity, just wrap it in a descriptive string\n return f'id: {str_obj}'\n\n m = Model(bar=42)\n assert m.model_dump() == {'bar': 42, 'id': 'id: {\"bar\":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_config.py_test_partial_creation_with_defer_build_test_partial_creation_with_defer_build.assert_partial_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_partial_creation_with_defer_build_test_partial_creation_with_defer_build.assert_partial_model_json", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 777, "end_line": 798, "span_ids": ["test_partial_creation_with_defer_build"], "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_partial_creation_with_defer_build():\n class M(BaseModel):\n a: int\n b: int\n\n def create_partial(model, optionals):\n override_fields = {}\n model.model_rebuild()\n for name, field in model.model_fields.items():\n if field.is_required() and name in optionals:\n assert field.annotation is not None\n override_fields[name] = (Optional[field.annotation], FieldInfo.merge_field_infos(field, default=None))\n\n return create_model(f'Partial{model.__name__}', __base__=model, **override_fields)\n\n partial = create_partial(M, {'a'})\n\n # Comment this away and the last assertion works\n assert M.model_json_schema()['required'] == ['a', 'b']\n\n # AssertionError: assert ['a', 'b'] == ['b']\n assert partial.model_json_schema()['required'] == ['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_config.py_test_model_config_as_model_field_raises_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_config.py_test_model_config_as_model_field_raises_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 801, "end_line": 822, "span_ids": ["test_model_config_as_model_field_raises", "test_dataclass_allowes_model_config_as_model_field"], "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_model_config_as_model_field_raises():\n with pytest.raises(PydanticUserError) as exc_info:\n\n class MyModel(BaseModel):\n model_config: str\n\n assert exc_info.value.code == 'model-config-invalid-field-name'\n\n\ndef test_dataclass_allowes_model_config_as_model_field():\n config_title = 'from_config'\n field_title = 'from_field'\n\n @pydantic_dataclass(config={'title': config_title})\n class MyDataclass:\n model_config: dict\n\n m = MyDataclass(model_config={'title': field_title})\n\n assert m.model_config['title'] == field_title\n assert getattr(m, '__pydantic_config__')['title'] == config_title", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_del_model_attr_with_privat_attrs_twice_error_test_create_model_non_annotated.with_pytest_raises_.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_del_model_attr_with_privat_attrs_twice_error_test_create_model_non_annotated.with_pytest_raises_.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": 490, "end_line": 517, "span_ids": ["test_create_model_with_slots", "test_create_model_non_annotated", "test_del_model_attr_with_privat_attrs_twice_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_del_model_attr_with_privat_attrs_twice_error():\n class Model(BaseModel):\n _private_attr: int = 1\n some_field: str\n\n m = Model(some_field='value')\n assert hasattr(m, '_private_attr')\n\n del m._private_attr\n\n with pytest.raises(AttributeError, match=\"'Model' object has no attribute '_private_attr'\"):\n del m._private_attr\n\n\ndef 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_create_model.py_test_create_model_typing_annotated_field_info_test_create_model_typing_annotated_field_info.assert_foo_description_": {"__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_typing_annotated_field_info_test_create_model_typing_annotated_field_info.assert_foo_description_", "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": 520, "end_line": 538, "span_ids": ["test_create_model_typing_annotated_field_info"], "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": "@pytest.mark.parametrize(\n 'annotation_type,field_info',\n [\n (bool, Field(alias='foo_bool_alias', description='foo boolean')),\n (str, Field(alias='foo_str_alis', description='foo string')),\n ],\n)\ndef test_create_model_typing_annotated_field_info(annotation_type, field_info):\n annotated_foo = Annotated[annotation_type, field_info]\n model = create_model('FooModel', foo=annotated_foo, bar=(int, 123))\n\n assert model.model_fields.keys() == {'foo', 'bar'}\n\n foo = model.model_fields.get('foo')\n\n assert foo is not None\n assert foo.annotation == annotation_type\n assert foo.alias == field_info.alias\n assert foo.description == field_info.description", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_create_model.py_test_create_model_expect_field_info_as_metadata_typing_test_create_model_multiple_protected_namespace.with_pytest_warns_.create_model_": {"__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_expect_field_info_as_metadata_typing_test_create_model_multiple_protected_namespace.with_pytest_warns_.create_model_", "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": 541, "end_line": 587, "span_ids": ["test_create_model_protected_namespace_default", "test_create_model_custom_protected_namespace", "test_create_model_tuple_3", "test_create_model_multiple_protected_namespace", "test_create_model_protected_namespace_real_conflict", "test_create_model_expect_field_info_as_metadata_typing", "test_create_model_tuple"], "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_create_model_expect_field_info_as_metadata_typing():\n annotated_foo = Annotated[int, 10]\n\n with pytest.raises(PydanticUserError, match=r'Field definitions should be a Annotated\\[, \\]'):\n create_model('FooModel', foo=annotated_foo)\n\n\ndef test_create_model_tuple():\n model = create_model('FooModel', foo=(Tuple[int, int], (1, 2)))\n assert model().foo == (1, 2)\n assert model(foo=(3, 4)).foo == (3, 4)\n\n\ndef test_create_model_tuple_3():\n with pytest.raises(PydanticUserError, match=r'^Field definitions should be a `\\(, \\)`\\.\\n'):\n create_model('FooModel', foo=(Tuple[int, int], (1, 2), 'more'))\n\n\ndef test_create_model_protected_namespace_default():\n with pytest.warns(UserWarning, match='Field \"model_prefixed_field\" has conflict with protected namespace \"model_\"'):\n create_model('Model', model_prefixed_field=(str, ...))\n\n\ndef test_create_model_protected_namespace_real_conflict():\n with pytest.raises(NameError, match='Field \"model_dump\" conflicts with member .* of protected namespace \"model_\"'):\n create_model('Model', model_dump=(str, ...))\n\n\ndef test_create_model_custom_protected_namespace():\n with pytest.warns(UserWarning, match='Field \"test_field\" has conflict with protected namespace \"test_\"'):\n create_model(\n 'Model',\n __config__=ConfigDict(protected_namespaces=('test_',)),\n model_prefixed_field=(str, ...),\n test_field=(str, ...),\n )\n\n\ndef test_create_model_multiple_protected_namespace():\n with pytest.warns(\n UserWarning, match='Field \"also_protect_field\" has conflict with protected namespace \"also_protect_\"'\n ):\n create_model(\n 'Model',\n __config__=ConfigDict(protected_namespaces=('protect_me_', 'also_protect_')),\n also_protect_field=(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/tests/test_dataclasses.py_test_base_dataclasses_annotations_resolving_test_base_dataclasses_annotations_resolving.assert_TypeAdapter_D2_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_base_dataclasses_annotations_resolving_test_base_dataclasses_annotations_resolving.assert_TypeAdapter_D2_va", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1636, "end_line": 1663, "span_ids": ["test_base_dataclasses_annotations_resolving"], "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": "@pytest.mark.parametrize(\n 'dataclass_decorator',\n [\n pydantic.dataclasses.dataclass,\n dataclasses.dataclass,\n ],\n ids=['pydantic', 'stdlib'],\n)\ndef test_base_dataclasses_annotations_resolving(create_module, dataclass_decorator: Callable):\n @create_module\n def module():\n import dataclasses\n from typing import NewType\n\n OddInt = NewType('OddInt', int)\n\n @dataclasses.dataclass\n class D1:\n d1: 'OddInt'\n s: str\n\n __pydantic_config__ = {'str_to_lower': True}\n\n @dataclass_decorator\n class D2(module.D1):\n d2: int\n\n assert TypeAdapter(D2).validate_python({'d1': 1, 'd2': 2, 's': 'ABC'}) == D2(d1=1, d2=2, s='abc')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_base_dataclasses_annotations_resolving_with_override_test_base_dataclasses_annotations_resolving_with_override.assert_TypeAdapter_D3_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_dataclasses.py_test_base_dataclasses_annotations_resolving_with_override_test_base_dataclasses_annotations_resolving_with_override.assert_TypeAdapter_D3_va", "embedding": null, "metadata": {"file_path": "tests/test_dataclasses.py", "file_name": "test_dataclasses.py", "file_type": "text/x-python", "category": "test", "start_line": 1666, "end_line": 1706, "span_ids": ["test_base_dataclasses_annotations_resolving_with_override"], "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 'dataclass_decorator',\n [\n pydantic.dataclasses.dataclass,\n dataclasses.dataclass,\n ],\n ids=['pydantic', 'stdlib'],\n)\ndef test_base_dataclasses_annotations_resolving_with_override(create_module, dataclass_decorator: Callable):\n @create_module\n def module1():\n import dataclasses\n from typing import NewType\n\n IDType = NewType('IDType', int)\n\n @dataclasses.dataclass\n class D1:\n db_id: 'IDType'\n\n __pydantic_config__ = {'str_to_lower': True}\n\n @create_module\n def module2():\n import dataclasses\n from typing import NewType\n\n IDType = NewType('IDType', str)\n\n @dataclasses.dataclass\n class D2:\n db_id: 'IDType'\n s: str\n\n __pydantic_config__ = {'str_to_lower': False}\n\n @dataclass_decorator\n class D3(module1.D1, module2.D2):\n ...\n\n assert TypeAdapter(D3).validate_python({'db_id': 42, 's': 'ABC'}) == D3(db_id=42, s='abc')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_modify_schema_on_nested_class_error_test_modify_schema_on_nested_class_error.with_pytest_raises_.B.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated.py_test_modify_schema_on_nested_class_error_test_modify_schema_on_nested_class_error.with_pytest_raises_.B.a", "embedding": null, "metadata": {"file_path": "tests/test_deprecated.py", "file_name": "test_deprecated.py", "file_type": "text/x-python", "category": "test", "start_line": 500, "end_line": 515, "span_ids": ["test_modify_schema_on_nested_class_error"], "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_modify_schema_on_nested_class_error() -> None:\n class SomeLongName:\n @classmethod\n def __modify_schema__(cls, field_schema):\n pass\n\n with pytest.raises(\n PydanticUserError,\n match='The `__modify_schema__` method is not supported in Pydantic v2. '\n 'Use `__get_pydantic_json_schema__` instead in class `SomeLongName`.',\n ):\n\n class B(BaseModel):\n model_config = ConfigDict(arbitrary_types_allowed=True)\n\n a: SomeLongName", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_fields.py_importlib.metadata_test_deprecated_fields.assert_b_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_importlib.metadata_test_deprecated_fields.assert_b_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["imports", "test_deprecated_fields"], "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 importlib.metadata\n\nimport pytest\nfrom packaging.version import Version\nfrom typing_extensions import Annotated, Self, deprecated\n\nfrom pydantic import BaseModel, Field, computed_field, field_validator, model_validator\n\n\ndef test_deprecated_fields():\n class Model(BaseModel):\n a: Annotated[int, Field(deprecated='')]\n b: Annotated[int, Field(deprecated='This is deprecated')]\n c: Annotated[int, Field(deprecated=None)]\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'a': {'deprecated': True, 'title': 'A', 'type': 'integer'},\n 'b': {'deprecated': True, 'title': 'B', 'type': 'integer'},\n 'c': {'title': 'C', 'type': 'integer'},\n },\n 'required': ['a', 'b', 'c'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n instance = Model(a=1, b=1, c=1)\n\n pytest.warns(DeprecationWarning, lambda: instance.a, match='^$')\n\n with pytest.warns(DeprecationWarning, match='^This is deprecated$'):\n b = instance.b\n\n assert 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_deprecated_fields.py_test_deprecated_fields_deprecated_class_test_deprecated_fields_deprecated_class.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_deprecated_fields_deprecated_class_test_deprecated_fields_deprecated_class.None_2", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 62, "span_ids": ["test_deprecated_fields_deprecated_class"], "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": "@pytest.mark.skipif(\n Version(importlib.metadata.version('typing_extensions')) < Version('4.9'),\n reason='`deprecated` type annotation requires typing_extensions>=4.9',\n)\ndef test_deprecated_fields_deprecated_class():\n class Model(BaseModel):\n a: Annotated[int, deprecated('')]\n b: Annotated[int, deprecated('This is deprecated')] = 1\n c: Annotated[int, Field(deprecated=deprecated('This is deprecated'))] = 1\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'a': {'deprecated': True, 'title': 'A', 'type': 'integer'},\n 'b': {'default': 1, 'deprecated': True, 'title': 'B', 'type': 'integer'},\n 'c': {'default': 1, 'deprecated': True, 'title': 'C', 'type': 'integer'},\n },\n 'required': ['a'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n instance = Model(a=1)\n\n pytest.warns(DeprecationWarning, lambda: instance.a, match='^$')\n pytest.warns(DeprecationWarning, lambda: instance.b, match='^This is deprecated$')\n pytest.warns(DeprecationWarning, lambda: instance.c, match='^This is deprecated$')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_fields.py_test_deprecated_fields_field_validator_test_deprecated_fields_validate_assignment.None_1.assert_instance_x_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_deprecated_fields_field_validator_test_deprecated_fields_validate_assignment.None_1.assert_instance_x_2", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 108, "span_ids": ["test_deprecated_fields_validate_assignment", "test_deprecated_fields_model_validator", "test_deprecated_fields_field_validator"], "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 test_deprecated_fields_field_validator():\n class Model(BaseModel):\n x: int = Field(deprecated='x is deprecated')\n\n @field_validator('x')\n @classmethod\n def validate_x(cls, v: int) -> int:\n return v * 2\n\n instance = Model(x=1)\n\n with pytest.warns(DeprecationWarning):\n assert instance.x == 2\n\n\ndef test_deprecated_fields_model_validator():\n class Model(BaseModel):\n x: int = Field(deprecated='x is deprecated')\n\n @model_validator(mode='after')\n def validate_x(self) -> Self:\n self.x = self.x * 2\n return self\n\n with pytest.warns(DeprecationWarning):\n instance = Model(x=1)\n assert instance.x == 2\n\n\ndef test_deprecated_fields_validate_assignment():\n class Model(BaseModel):\n x: int = Field(deprecated='x is deprecated')\n\n model_config = {'validate_assignment': True}\n\n instance = Model(x=1)\n\n with pytest.warns(DeprecationWarning):\n assert instance.x == 1\n\n instance.x = 2\n\n with pytest.warns(DeprecationWarning):\n assert instance.x == 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_fields.py_test_computed_field_deprecated_test_computed_field_deprecated.Model.p5.return.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_computed_field_deprecated_test_computed_field_deprecated.Model.p5.return.1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 138, "span_ids": ["test_computed_field_deprecated"], "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_computed_field_deprecated():\n class Model(BaseModel):\n @computed_field\n @property\n @deprecated('This is deprecated')\n def p1(self) -> int:\n return 1\n\n @computed_field(deprecated='This is deprecated')\n @property\n @deprecated('This is deprecated (this message is overridden)')\n def p2(self) -> int:\n return 1\n\n @computed_field(deprecated='')\n @property\n def p3(self) -> int:\n return 1\n\n @computed_field(deprecated='This is deprecated')\n @property\n def p4(self) -> int:\n return 1\n\n @computed_field\n @deprecated('This is deprecated')\n def p5(self) -> int:\n return 1\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_fields.py_test_computed_field_deprecated.assert_Model_model_json_s_test_computed_field_deprecated.assert_p3_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_computed_field_deprecated.assert_Model_model_json_s_test_computed_field_deprecated.assert_p3_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 140, "end_line": 163, "span_ids": ["test_computed_field_deprecated"], "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_computed_field_deprecated():\n # ... other code\n\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {\n 'p1': {'deprecated': True, 'readOnly': True, 'title': 'P1', 'type': 'integer'},\n 'p2': {'deprecated': True, 'readOnly': True, 'title': 'P2', 'type': 'integer'},\n 'p3': {'deprecated': True, 'readOnly': True, 'title': 'P3', 'type': 'integer'},\n 'p4': {'deprecated': True, 'readOnly': True, 'title': 'P4', 'type': 'integer'},\n 'p5': {'deprecated': True, 'readOnly': True, 'title': 'P5', 'type': 'integer'},\n },\n 'required': ['p1', 'p2', 'p3', 'p4', 'p5'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n instance = Model()\n\n pytest.warns(DeprecationWarning, lambda: instance.p1, match='^This is deprecated$')\n pytest.warns(DeprecationWarning, lambda: instance.p2, match='^This is deprecated$')\n pytest.warns(DeprecationWarning, lambda: instance.p4, match='^This is deprecated$')\n pytest.warns(DeprecationWarning, lambda: instance.p5, match='^This is deprecated$')\n\n with pytest.warns(DeprecationWarning, match='^$'):\n p3 = instance.p3\n\n assert p3 == 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_fields.py_test_computed_field_deprecated_deprecated_class_test_computed_field_deprecated_deprecated_class.assert_p1_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_computed_field_deprecated_deprecated_class_test_computed_field_deprecated_deprecated_class.assert_p1_1", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 191, "span_ids": ["test_computed_field_deprecated_deprecated_class"], "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.skipif(\n Version(importlib.metadata.version('typing_extensions')) < Version('4.9'),\n reason='`deprecated` type annotation requires typing_extensions>=4.9',\n)\ndef test_computed_field_deprecated_deprecated_class():\n class Model(BaseModel):\n @computed_field(deprecated=deprecated('This is deprecated'))\n @property\n def p1(self) -> int:\n return 1\n\n assert Model.model_json_schema(mode='serialization') == {\n 'properties': {\n 'p1': {'deprecated': True, 'readOnly': True, 'title': 'P1', 'type': 'integer'},\n },\n 'required': ['p1'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n instance = Model()\n\n with pytest.warns(DeprecationWarning, match='^This is deprecated$'):\n p1 = instance.p1\n\n assert p1 == 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_fields.py_test_deprecated_with_boolean_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_deprecated_fields.py_test_deprecated_with_boolean_", "embedding": null, "metadata": {"file_path": "tests/test_deprecated_fields.py", "file_name": "test_deprecated_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 194, "end_line": 212, "span_ids": ["test_deprecated_with_boolean"], "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_deprecated_with_boolean() -> None:\n class Model(BaseModel):\n a: Annotated[int, Field(deprecated=True)]\n b: Annotated[int, Field(deprecated=False)]\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'a': {'deprecated': True, 'title': 'A', 'type': 'integer'},\n 'b': {'title': 'B', 'type': 'integer'},\n },\n 'required': ['a', 'b'],\n 'title': 'Model',\n 'type': 'object',\n }\n\n instance = Model(a=1, b=1)\n\n pytest.warns(DeprecationWarning, lambda: instance.a, match='deprecated')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_discriminator_test_nested_discriminator._insert_assert_MyModel_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminator_test_nested_discriminator._insert_assert_MyModel_m", "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": 1777, "end_line": 1806, "span_ids": ["test_nested_discriminator"], "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_nested_discriminator() -> None:\n \"\"\"\n The exact details of the JSON schema produced are not necessarily important; the test was added in response to a\n regression that caused the inner union to lose its discriminator. Even if the schema changes, the important\n thing is that the core schema (and therefore JSON schema) produced has an actual discriminated union in it.\n For more context, see: https://github.com/pydantic/pydantic/issues/8688.\n \"\"\"\n\n class Step_A(BaseModel):\n type: Literal['stepA']\n count: int\n\n class Step_B(BaseModel):\n type: Literal['stepB']\n value: float\n\n class MyModel(BaseModel):\n type: Literal['mixed']\n sub_models: List['SubModel']\n steps: Union[Step_A, Step_B] = Field(\n default=None,\n discriminator='type',\n )\n\n class SubModel(MyModel):\n type: Literal['mixed']\n blending: float\n\n MyModel.model_rebuild()\n # insert_assert(MyModel.model_json_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_discriminated_union.py_test_nested_discriminator.assert_MyModel_model_json_test_nested_discriminator.assert_MyModel_model_json": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_discriminator.assert_MyModel_model_json_test_nested_discriminator.assert_MyModel_model_json", "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": 1807, "end_line": 1863, "span_ids": ["test_nested_discriminator"], "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_nested_discriminator() -> None:\n # ... other code\n assert MyModel.model_json_schema() == {\n '$defs': {\n 'Step_A': {\n 'properties': {\n 'count': {'title': 'Count', 'type': 'integer'},\n 'type': {'const': 'stepA', 'enum': ['stepA'], 'title': 'Type', 'type': 'string'},\n },\n 'required': ['type', 'count'],\n 'title': 'Step_A',\n 'type': 'object',\n },\n 'Step_B': {\n 'properties': {\n 'type': {'const': 'stepB', 'enum': ['stepB'], 'title': 'Type', 'type': 'string'},\n 'value': {'title': 'Value', 'type': 'number'},\n },\n 'required': ['type', 'value'],\n 'title': 'Step_B',\n 'type': 'object',\n },\n 'SubModel': {\n 'properties': {\n 'blending': {'title': 'Blending', 'type': 'number'},\n 'steps': {\n 'default': None,\n 'discriminator': {\n 'mapping': {'stepA': '#/$defs/Step_A', 'stepB': '#/$defs/Step_B'},\n 'propertyName': 'type',\n },\n 'oneOf': [{'$ref': '#/$defs/Step_A'}, {'$ref': '#/$defs/Step_B'}],\n 'title': 'Steps',\n },\n 'sub_models': {'items': {'$ref': '#/$defs/SubModel'}, 'title': 'Sub Models', 'type': 'array'},\n 'type': {'const': 'mixed', 'enum': ['mixed'], 'title': 'Type', 'type': 'string'},\n },\n 'required': ['type', 'sub_models', 'blending'],\n 'title': 'SubModel',\n 'type': 'object',\n },\n },\n 'properties': {\n 'steps': {\n 'default': None,\n 'discriminator': {\n 'mapping': {'stepA': '#/$defs/Step_A', 'stepB': '#/$defs/Step_B'},\n 'propertyName': 'type',\n },\n 'oneOf': [{'$ref': '#/$defs/Step_A'}, {'$ref': '#/$defs/Step_B'}],\n 'title': 'Steps',\n },\n 'sub_models': {'items': {'$ref': '#/$defs/SubModel'}, 'title': 'Sub Models', 'type': 'array'},\n 'type': {'const': 'mixed', 'enum': ['mixed'], 'title': 'Type', 'type': 'string'},\n },\n 'required': ['type', 'sub_models'],\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_discriminated_union.py_test_nested_schema_gen_uses_tagged_union_in_ref_test_nested_schema_gen_uses_tagged_union_in_ref.for_definition_in_adapter.if_definition_schema_.assert_definition_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_nested_schema_gen_uses_tagged_union_in_ref_test_nested_schema_gen_uses_tagged_union_in_ref.for_definition_in_adapter.if_definition_schema_.assert_definition_schema", "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": 1866, "end_line": 1885, "span_ids": ["test_nested_schema_gen_uses_tagged_union_in_ref"], "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_nested_schema_gen_uses_tagged_union_in_ref() -> None:\n class NestedState(BaseModel):\n state_type: Literal['nested']\n substate: 'AnyState'\n\n # If this type is left out, the model behaves normally again\n class LoopState(BaseModel):\n state_type: Literal['loop']\n substate: 'AnyState'\n\n class LeafState(BaseModel):\n state_type: Literal['leaf']\n\n AnyState = Annotated[Union[NestedState, LoopState, LeafState], Field(..., discriminator='state_type')]\n adapter = TypeAdapter(AnyState)\n\n assert adapter.core_schema['schema']['type'] == 'tagged-union'\n for definition in adapter.core_schema['definitions']:\n if definition['schema']['model_name'] in ['NestedState', 'LoopState']:\n assert definition['schema']['fields']['substate']['schema']['schema']['type'] == 'tagged-union'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminiated_union_with_typed_dict_test_recursive_discriminiated_union_with_typed_dict.for_definition_in_core_sc.if_Foo_in_definition_r.assert_definition_fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminiated_union_with_typed_dict_test_recursive_discriminiated_union_with_typed_dict.for_definition_in_core_sc.if_Foo_in_definition_r.assert_definition_fields", "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": 1888, "end_line": 1912, "span_ids": ["test_recursive_discriminiated_union_with_typed_dict"], "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_recursive_discriminiated_union_with_typed_dict() -> None:\n class Foo(TypedDict):\n type: Literal['foo']\n x: 'Foobar'\n\n class Bar(TypedDict):\n type: Literal['bar']\n\n Foobar = Annotated[Union[Foo, Bar], Field(discriminator='type')]\n ta = TypeAdapter(Foobar)\n\n # len of errors should be 1 for each case, bc we're using a tagged union\n with pytest.raises(ValidationError) as e:\n ta.validate_python({'type': 'wrong'})\n assert len(e.value.errors()) == 1\n\n with pytest.raises(ValidationError) as e:\n ta.validate_python({'type': 'foo', 'x': {'type': 'wrong'}})\n assert len(e.value.errors()) == 1\n\n core_schema = ta.core_schema\n assert core_schema['schema']['type'] == 'tagged-union'\n for definition in core_schema['definitions']:\n if 'Foo' in definition['ref']:\n assert definition['fields']['x']['schema']['type'] == 'tagged-union'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminiated_union_with_base_model_test_recursive_discriminiated_union_with_base_model.for_definition_in_core_sc.if_Foo_in_definition_r.assert_definition_schema": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminiated_union_with_base_model_test_recursive_discriminiated_union_with_base_model.for_definition_in_core_sc.if_Foo_in_definition_r.assert_definition_schema", "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": 1915, "end_line": 1939, "span_ids": ["test_recursive_discriminiated_union_with_base_model"], "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_recursive_discriminiated_union_with_base_model() -> None:\n class Foo(BaseModel):\n type: Literal['foo']\n x: 'Foobar'\n\n class Bar(BaseModel):\n type: Literal['bar']\n\n Foobar = Annotated[Union[Foo, Bar], Field(discriminator='type')]\n ta = TypeAdapter(Foobar)\n\n # len of errors should be 1 for each case, bc we're using a tagged union\n with pytest.raises(ValidationError) as e:\n ta.validate_python({'type': 'wrong'})\n assert len(e.value.errors()) == 1\n\n with pytest.raises(ValidationError) as e:\n ta.validate_python({'type': 'foo', 'x': {'type': 'wrong'}})\n assert len(e.value.errors()) == 1\n\n core_schema = ta.core_schema\n assert core_schema['schema']['type'] == 'tagged-union'\n for definition in core_schema['definitions']:\n if 'Foo' in definition['ref']:\n assert definition['schema']['fields']['x']['schema']['type'] == 'tagged-union'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminated_union_with_pydantic_dataclass_test_recursive_discriminated_union_with_pydantic_dataclass.for_definition_in_core_sc.if_Foo_in_definition_r.for_field_in_definition_.assert_field_schema_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_recursive_discriminated_union_with_pydantic_dataclass_test_recursive_discriminated_union_with_pydantic_dataclass.for_definition_in_core_sc.if_Foo_in_definition_r.for_field_in_definition_.assert_field_schema_t", "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": 1942, "end_line": 1969, "span_ids": ["test_recursive_discriminated_union_with_pydantic_dataclass"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_discriminated_union_with_pydantic_dataclass() -> None:\n @pydantic_dataclass\n class Foo:\n type: Literal['foo']\n x: 'Foobar'\n\n @pydantic_dataclass\n class Bar:\n type: Literal['bar']\n\n Foobar = Annotated[Union[Foo, Bar], Field(discriminator='type')]\n ta = TypeAdapter(Foobar)\n\n # len of errors should be 1 for each case, bc we're using a tagged union\n with pytest.raises(ValidationError) as e:\n ta.validate_python({'type': 'wrong'})\n assert len(e.value.errors()) == 1\n\n with pytest.raises(ValidationError) as e:\n ta.validate_python({'type': 'foo', 'x': {'type': 'wrong'}})\n assert len(e.value.errors()) == 1\n\n core_schema = ta.core_schema\n assert core_schema['schema']['type'] == 'tagged-union'\n for definition in core_schema['definitions']:\n if 'Foo' in definition['ref']:\n for field in definition['schema']['fields']:\n assert field['schema']['type'] == 'tagged-union' if field['name'] == 'x' else 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_discriminated_union.py_test_discriminated_union_with_nested_dataclass_test_discriminated_union_with_nested_dataclass.assert_ta_core_schema_sc": {"__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_with_nested_dataclass_test_discriminated_union_with_nested_dataclass.assert_ta_core_schema_sc", "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": 1972, "end_line": 1990, "span_ids": ["test_discriminated_union_with_nested_dataclass"], "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 test_discriminated_union_with_nested_dataclass() -> None:\n @pydantic_dataclass\n class Cat:\n type: Literal['cat'] = 'cat'\n\n @pydantic_dataclass\n class Dog:\n type: Literal['dog'] = 'dog'\n\n @pydantic_dataclass\n class NestedDataClass:\n animal: Annotated[Union[Cat, Dog], Discriminator('type')]\n\n @pydantic_dataclass\n class Root:\n data_class: NestedDataClass\n\n ta = TypeAdapter(Root)\n assert ta.core_schema['schema']['fields'][0]['schema']['schema']['fields'][0]['schema']['type'] == 'tagged-union'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_discriminated_union.py_test_discriminated_union_with_nested_typed_dicts_": {"__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_with_nested_typed_dicts_", "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": 1993, "end_line": 2008, "span_ids": ["test_discriminated_union_with_nested_typed_dicts"], "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_discriminated_union_with_nested_typed_dicts() -> None:\n class Cat(TypedDict):\n type: Literal['cat']\n\n class Dog(TypedDict):\n type: Literal['dog']\n\n class NestedTypedDict(TypedDict):\n animal: Annotated[Union[Cat, Dog], Discriminator('type')]\n\n class Root(TypedDict):\n data_class: NestedTypedDict\n\n ta = TypeAdapter(Root)\n assert ta.core_schema['fields']['data_class']['schema']['fields']['animal']['schema']['type'] == 'tagged-union'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_from_typing_import_Union_test_field_info_annotation_keyword_argument.assert_e_value_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_from_typing_import_Union_test_field_info_annotation_keyword_argument.assert_e_value_args_", "embedding": null, "metadata": {"file_path": "tests/test_fields.py", "file_name": "test_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 19, "span_ids": ["test_field_info_annotation_keyword_argument", "imports"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Union\n\nimport pytest\n\nimport pydantic.dataclasses\nfrom pydantic import BaseModel, Field, PydanticUserError, RootModel, ValidationError, fields\n\n\ndef test_field_info_annotation_keyword_argument():\n \"\"\"This tests that `FieldInfo.from_field` raises an error if passed the `annotation` kwarg.\n\n At the time of writing this test there is no way `FieldInfo.from_field` could receive the `annotation` kwarg from\n anywhere inside Pydantic code. However, it is possible that this API is still being in use by applications and\n third-party tools.\n \"\"\"\n with pytest.raises(TypeError) as e:\n fields.FieldInfo.from_field(annotation=())\n\n assert e.value.args == ('\"annotation\" is not permitted as a Field keyword argument',)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_root_model_field_override_test_root_model_field_override.assert_isinstance_validat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_root_model_field_override_test_root_model_field_override.assert_isinstance_validat", "embedding": null, "metadata": {"file_path": "tests/test_fields.py", "file_name": "test_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 102, "span_ids": ["test_root_model_field_override"], "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": "def test_root_model_field_override():\n # Weird as this is, I think it's probably best to allow it to ensure it is possible to override\n # the annotation in subclasses of RootModel subclasses. Basically, I think retaining the flexibility\n # is worth the increased potential for weird/confusing \"accidental\" overrides.\n\n # I'm mostly including this test now to document the behavior\n class Model(RootModel[int]):\n root: str\n\n assert Model.model_validate('abc').root == 'abc'\n with pytest.raises(ValidationError) as exc_info:\n Model.model_validate(1)\n assert exc_info.value.errors(include_url=False) == [\n {'input': 1, 'loc': (), 'msg': 'Input should be a valid string', 'type': 'string_type'}\n ]\n\n class SubModel(Model):\n root: float\n\n with pytest.raises(ValidationError) as exc_info:\n SubModel.model_validate('abc')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'input': 'abc',\n 'loc': (),\n 'msg': 'Input should be a valid number, unable to parse string as a number',\n 'type': 'float_parsing',\n }\n ]\n\n validated = SubModel.model_validate_json('1').root\n assert validated == 1.0\n assert isinstance(validated, 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_fields.py_test_frozen_field_repr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_fields.py_test_frozen_field_repr_", "embedding": null, "metadata": {"file_path": "tests/test_fields.py", "file_name": "test_fields.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 125, "span_ids": ["test_model_field_default_info", "test_frozen_field_repr"], "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_frozen_field_repr():\n class Model(BaseModel):\n non_frozen_field: int = Field(frozen=False)\n frozen_field: int = Field(frozen=True)\n\n assert repr(Model.model_fields['non_frozen_field']) == 'FieldInfo(annotation=int, required=True)'\n assert repr(Model.model_fields['frozen_field']) == 'FieldInfo(annotation=int, required=True, frozen=True)'\n\n\ndef test_model_field_default_info():\n \"\"\"Test that __repr_args__ of FieldInfo includes the default value when it's set to None.\"\"\"\n\n class Model(BaseModel):\n a: Union[int, None] = Field(default=None)\n b: Union[int, None] = None\n\n assert str(Model.model_fields) == (\n \"{'a': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), \"\n \"'b': FieldInfo(annotation=Union[int, NoneType], required=False, default=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_json_schema.py_test_description_not_included_for_basemodel_test_recursive_json_schema_build.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_description_not_included_for_basemodel_test_recursive_json_schema_build.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": 5906, "end_line": 5938, "span_ids": ["test_description_not_included_for_basemodel", "test_recursive_json_schema_build"], "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_description_not_included_for_basemodel() -> None:\n class Model(BaseModel):\n x: BaseModel\n\n assert 'description' not in Model.model_json_schema()['$defs']['BaseModel']\n\n\ndef test_recursive_json_schema_build() -> None:\n \"\"\"\n Schema build for this case is a bit complicated due to the recursive nature of the models.\n This was reported as broken in https://github.com/pydantic/pydantic/issues/8689, which was\n originally caused by the change made in https://github.com/pydantic/pydantic/pull/8583, which has\n since been reverted.\n \"\"\"\n\n class AllowedValues(str, Enum):\n VAL1 = 'Val1'\n VAL2 = 'Val2'\n\n class ModelA(BaseModel):\n modelA_1: AllowedValues = Field(..., max_length=60)\n\n class ModelB(ModelA):\n modelB_1: typing.List[ModelA]\n\n class ModelC(BaseModel):\n modelC_1: ModelB\n\n class Model(BaseModel):\n b: ModelB\n c: ModelC\n\n assert 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_json_schema_annotated_with_field_test_json_schema_annotated_with_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_json_schema_annotated_with_field_test_json_schema_annotated_with_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": 5941, "end_line": 5958, "span_ids": ["test_json_schema_annotated_with_field"], "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_json_schema_annotated_with_field() -> None:\n \"\"\"Ensure field specified with Annotated in create_model call is still marked as required.\"\"\"\n\n from pydantic import create_model\n\n Model = create_model(\n 'test_model',\n bar=(Annotated[int, Field(description='Bar description')], ...),\n )\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'bar': {'description': 'Bar description', 'title': 'Bar', 'type': 'integer'},\n },\n 'required': ['bar'],\n 'title': 'test_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_required_fields_in_annotated_with_create_model_test_required_fields_in_annotated_with_basemodel.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_required_fields_in_annotated_with_create_model_test_required_fields_in_annotated_with_basemodel.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": 5961, "end_line": 5997, "span_ids": ["test_required_fields_in_annotated_with_basemodel", "test_required_fields_in_annotated_with_create_model"], "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_required_fields_in_annotated_with_create_model() -> None:\n \"\"\"Ensure multiple field specified with Annotated in create_model call is still marked as required.\"\"\"\n\n from pydantic import create_model\n\n Model = create_model(\n 'test_model',\n foo=(int, ...),\n bar=(Annotated[int, Field(description='Bar description')], ...),\n baz=(Annotated[int, Field(..., description='Baz description')], ...),\n )\n\n assert Model.model_json_schema() == {\n 'properties': {\n 'foo': {'title': 'Foo', 'type': 'integer'},\n 'bar': {'description': 'Bar description', 'title': 'Bar', 'type': 'integer'},\n 'baz': {'description': 'Baz description', 'title': 'Baz', 'type': 'integer'},\n },\n 'required': ['foo', 'bar', 'baz'],\n 'title': 'test_model',\n 'type': 'object',\n }\n\n\ndef test_required_fields_in_annotated_with_basemodel() -> None:\n \"\"\"\n Ensure multiple field specified with Annotated in BaseModel is marked as required.\n \"\"\"\n\n class Model(BaseModel):\n a: int = ...\n b: Annotated[int, 'placeholder'] = ...\n c: Annotated[int, Field()] = ...\n\n assert Model.model_fields['a'].is_required()\n assert Model.model_fields['b'].is_required()\n assert Model.model_fields['c'].is_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/tests/test_json_schema.py_test_default_value_encoding_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_json_schema.py_test_default_value_encoding_", "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": 6000, "end_line": 6033, "span_ids": ["test_default_value_encoding"], "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.parametrize(\n 'field_type,default_value,expected_schema',\n [\n (\n IPvAnyAddress,\n IPv4Address('127.0.0.1'),\n {\n 'properties': {\n 'field': {'default': '127.0.0.1', 'format': 'ipvanyaddress', 'title': 'Field', 'type': 'string'}\n },\n 'title': 'Model',\n 'type': 'object',\n },\n ),\n (\n IPvAnyAddress,\n IPv6Address('::1'),\n {\n 'properties': {\n 'field': {'default': '::1', 'format': 'ipvanyaddress', 'title': 'Field', 'type': 'string'}\n },\n 'title': 'Model',\n 'type': 'object',\n },\n ),\n ],\n)\ndef test_default_value_encoding(field_type, default_value, expected_schema):\n class Model(BaseModel):\n field: field_type = default_value\n\n schema = Model.model_json_schema()\n assert 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_networks.py_json_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_json_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": 33, "span_ids": ["imports"], "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 json\nfrom typing import Union\n\nimport pytest\nfrom pydantic_core import PydanticCustomError, Url\nfrom typing_extensions import Annotated\n\nfrom pydantic import (\n AmqpDsn,\n AnyUrl,\n BaseModel,\n ClickHouseDsn,\n CockroachDsn,\n FileUrl,\n HttpUrl,\n KafkaDsn,\n MariaDBDsn,\n MongoDsn,\n MySQLDsn,\n NameEmail,\n NatsDsn,\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_mariadb_dsns_test_clickhouse_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_clickhouse_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": 408, "end_line": 434, "span_ids": ["test_mariadb_dsns", "test_clickhouse_dsns"], "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": "@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\n\n\n@pytest.mark.parametrize(\n 'dsn',\n [\n 'clickhouse+native://user:pass@localhost:9000/app',\n 'clickhouse+asynch://user:pass@localhost:9000/app',\n ],\n)\ndef test_clickhouse_dsns(dsn):\n class Model(BaseModel):\n a: ClickHouseDsn\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_address_invalid_test_email_validator_not_installed.with_pytest_raises_Import.validate_email_s_muelcol": {"__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_email_validator_not_installed.with_pytest_raises_Import.validate_email_s_muelcol", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 820, "end_line": 859, "span_ids": ["test_address_invalid", "test_email_validator_not_installed"], "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": "@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 part after the @-sign is not valid. It should have a period.'),\n ('foobar@127.0.0.1', 'The part after the @-sign 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 ('first.last ', None),\n pytest.param('foobar <' + 'a' * 4096 + '@example.com>', 'Length must not exceed 2048 characters', id='long'),\n ],\n)\ndef test_address_invalid(value: str, reason: Union[str, None]):\n with pytest.raises(PydanticCustomError, match=f'value is not a valid email address: {reason or \"\"}'):\n validate_email(value)\n\n\n@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')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_name_email_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_networks.py_test_name_email_", "embedding": null, "metadata": {"file_path": "tests/test_networks.py", "file_name": "test_networks.py", "file_type": "text/x-python", "category": "test", "start_line": 862, "end_line": 899, "span_ids": ["test_name_email_serialization", "test_name_email"], "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": "@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 str(Model(v='foobaR@example.com').v) == 'foobaR '\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')\n\n assert Model.model_validate_json('{\"v\":\"foo bar \"}').v == NameEmail(\n 'foo bar', 'foobaR@example.com'\n )\n assert str(Model.model_validate_json('{\"v\":\"foobaR@example.com\"}').v) == 'foobaR '\n assert (\n Model(v=NameEmail('foo bar', 'foobaR@example.com')).model_dump_json() == '{\"v\":\"foo bar \"}'\n )\n\n with pytest.raises(ValidationError) as exc_info:\n Model(v=1)\n assert exc_info.value.errors() == [\n {'input': 1, 'loc': ('v',), 'msg': 'Input is not a valid NameEmail', 'type': 'name_email_type'}\n ]\n\n\n@pytest.mark.skipif(not email_validator, reason='email_validator not installed')\ndef test_name_email_serialization():\n class Model(BaseModel):\n email: NameEmail\n\n m = Model.model_validate({'email': '\"name@mailbox.com\" '})\n assert m.email.name == 'name@mailbox.com'\n assert str(m.email) == '\"name@mailbox.com\" '\n\n obj = json.loads(m.model_dump_json())\n Model(email=obj['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_plugin_loader.py_importlib_metadata_reset_plugins.loader._plugins_2.initial_plugins": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_importlib_metadata_reset_plugins.loader._plugins_2.initial_plugins", "embedding": null, "metadata": {"file_path": "tests/test_plugin_loader.py", "file_name": "test_plugin_loader.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["EntryPoint", "EntryPoint.load", "Dist.__init__", "Dist", "EntryPoint.__init__", "imports", "reset_plugins"], "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": "import importlib.metadata as importlib_metadata\nimport os\nfrom unittest.mock import patch\n\nimport pytest\n\nimport pydantic.plugin._loader as loader\n\n\nclass EntryPoint:\n def __init__(self, name, value, group):\n self.name = name\n self.value = value\n self.group = group\n\n def load(self):\n return self.value\n\n\nclass Dist:\n entry_points = []\n\n def __init__(self, entry_points):\n self.entry_points = entry_points\n\n\n@pytest.fixture\ndef reset_plugins():\n global loader\n initial_plugins = loader._plugins\n loader._plugins = None\n yield\n # teardown\n loader._plugins = initial_plugins", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_mock_mock.with_patch_object_importl.yield": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_mock_mock.with_patch_object_importl.yield", "embedding": null, "metadata": {"file_path": "tests/test_plugin_loader.py", "file_name": "test_plugin_loader.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 45, "span_ids": ["mock"], "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": "@pytest.fixture(autouse=True)\ndef mock():\n mock_entry_1 = EntryPoint(name='test_plugin1', value='test_plugin:plugin1', group='pydantic')\n mock_entry_2 = EntryPoint(name='test_plugin2', value='test_plugin:plugin2', group='pydantic')\n mock_entry_3 = EntryPoint(name='test_plugin3', value='test_plugin:plugin3', group='pydantic')\n mock_dist = Dist([mock_entry_1, mock_entry_2, mock_entry_3])\n\n with patch.object(importlib_metadata, 'distributions', return_value=[mock_dist]):\n yield", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_test_loader_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_plugin_loader.py_test_loader_", "embedding": null, "metadata": {"file_path": "tests/test_plugin_loader.py", "file_name": "test_plugin_loader.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 84, "span_ids": ["test_disable_all_1", "test_disable_true", "test_disable_multiple", "test_disable_one", "test_loader", "test_disable_all"], "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_loader(reset_plugins):\n res = loader.get_plugins()\n assert list(res) == ['test_plugin:plugin1', 'test_plugin:plugin2', 'test_plugin:plugin3']\n\n\ndef test_disable_all(reset_plugins):\n os.environ['PYDANTIC_DISABLE_PLUGINS'] = '__all__'\n res = loader.get_plugins()\n assert res == ()\n\n\ndef test_disable_all_1(reset_plugins):\n os.environ['PYDANTIC_DISABLE_PLUGINS'] = '1'\n res = loader.get_plugins()\n assert res == ()\n\n\ndef test_disable_true(reset_plugins):\n os.environ['PYDANTIC_DISABLE_PLUGINS'] = 'true'\n res = loader.get_plugins()\n assert res == ()\n\n\ndef test_disable_one(reset_plugins):\n os.environ['PYDANTIC_DISABLE_PLUGINS'] = 'test_plugin1'\n res = loader.get_plugins()\n assert len(list(res)) == 2\n assert 'test_plugin:plugin1' not in list(res)\n\n\ndef test_disable_multiple(reset_plugins):\n os.environ['PYDANTIC_DISABLE_PLUGINS'] = 'test_plugin1,test_plugin2'\n res = loader.get_plugins()\n assert len(list(res)) == 1\n assert 'test_plugin:plugin1' not in list(res)\n assert 'test_plugin:plugin2' not in list(res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_all_fields_int_ser_instance_method_with_info2.return.f_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_serialize.py_test_serialize_all_fields_int_ser_instance_method_with_info2.return.f_v_", "embedding": null, "metadata": {"file_path": "tests/test_serialize.py", "file_name": "test_serialize.py", "file_type": "text/x-python", "category": "test", "start_line": 563, "end_line": 608, "span_ids": ["int_ser_func_without_info1", "int_ser_instance_method_with_info2", "int_ser_instance_method_without_info2", "int_ser_func_with_info2", "int_ser_instance_method_without_info1", "int_ser_instance_method_with_info1", "int_ser_func_with_info1", "int_ser_func_without_info2", "test_serialize_all_fields"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_serialize_all_fields():\n class MyModel(BaseModel):\n x: int\n\n @field_serializer('*')\n @classmethod\n def serialize_all(cls, v: Any):\n return v * 2\n\n assert MyModel(x=10).model_dump() == {'x': 20}\n\n\ndef int_ser_func_without_info1(v: int, expected: int) -> str:\n return f'{v:,}'\n\n\ndef int_ser_func_without_info2(v: int, *, expected: int) -> str:\n return f'{v:,}'\n\n\ndef int_ser_func_with_info1(v: int, info: FieldSerializationInfo, expected: int) -> str:\n return f'{v:,}'\n\n\ndef int_ser_func_with_info2(v: int, info: FieldSerializationInfo, *, expected: int) -> str:\n return f'{v:,}'\n\n\ndef int_ser_instance_method_without_info1(self: Any, v: int, *, expected: int) -> str:\n assert self.x == v\n return f'{v:,}'\n\n\ndef int_ser_instance_method_without_info2(self: Any, v: int, expected: int) -> str:\n assert self.x == v\n return f'{v:,}'\n\n\ndef int_ser_instance_method_with_info1(self: Any, v: int, info: FieldSerializationInfo, expected: int) -> str:\n assert self.x == v\n return f'{v:,}'\n\n\ndef int_ser_instance_method_with_info2(self: Any, v: int, info: FieldSerializationInfo, *, expected: int) -> str:\n assert self.x == v\n return f'{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_type_hints.py___parent_sub_model_fixture.return.ParentModel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py___parent_sub_model_fixture.return.ParentModel", "embedding": null, "metadata": {"file_path": "tests/test_type_hints.py", "file_name": "test_type_hints.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 56, "span_ids": ["parent_sub_model_fixture", "docstring"], "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": "\"\"\"\nTest pydantic model type hints (annotations) and that they can be\nqueried by :py:meth:`typing.get_type_hints`.\n\"\"\"\nimport inspect\nimport sys\nfrom typing import (\n Any,\n Dict,\n Generic,\n Optional,\n Set,\n TypeVar,\n)\n\nimport pytest\nimport typing_extensions\n\nfrom pydantic import (\n BaseModel,\n RootModel,\n)\nfrom pydantic.dataclasses import dataclass\n\nDEPRECATED_MODEL_MEMBERS = {\n 'construct',\n 'copy',\n 'dict',\n 'from_orm',\n 'json',\n 'json_schema',\n 'parse_file',\n 'parse_obj',\n}\n\n# Disable deprecation warnings, as we enumerate members that may be\n# i.e. pydantic.warnings.PydanticDeprecatedSince20: The `__fields__` attribute is deprecated,\n# use `model_fields` instead.\n# Additionally, only run these tests for 3.10+\npytestmark = [\n pytest.mark.filterwarnings('ignore::DeprecationWarning'),\n pytest.mark.skipif(sys.version_info < (3, 10), reason='requires python3.10 or higher to work properly'),\n]\n\n\n@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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_inspect_type_hints_inspect_type_hints.if_isinstance_obj_type_t.for_member_name_member_o.if_inspect_isclass_member.inspect_type_hints_member": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_inspect_type_hints_inspect_type_hints.if_isinstance_obj_type_t.for_member_name_member_o.if_inspect_isclass_member.inspect_type_hints_member", "embedding": null, "metadata": {"file_path": "tests/test_type_hints.py", "file_name": "test_type_hints.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 90, "span_ids": ["inspect_type_hints"], "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 inspect_type_hints(\n obj_type, members: Optional[Set[str]] = None, exclude_members: Optional[Set[str]] = None, recursion_limit: int = 3\n):\n \"\"\"\n Test an object and its members to make sure type hints can be resolved.\n :param obj_type: Type to check\n :param members: Explicit set of members to check, None to check all\n :param exclude_members: Set of member names to exclude\n :param recursion_limit: Recursion limit (0 to disallow)\n \"\"\"\n\n try:\n hints = typing_extensions.get_type_hints(obj_type)\n assert isinstance(hints, dict), f'Type annotation(s) on {obj_type} are invalid'\n except NameError as ex:\n raise AssertionError(f'Type annotation(s) on {obj_type} are invalid: {str(ex)}') from ex\n\n if recursion_limit <= 0:\n return\n\n if isinstance(obj_type, type):\n # Check class members\n for member_name, member_obj in inspect.getmembers(obj_type):\n if member_name.startswith('_'):\n # Ignore private members\n continue\n if (members and member_name not in members) or (exclude_members and member_name in exclude_members):\n continue\n\n if inspect.isclass(member_obj) or inspect.isfunction(member_obj):\n # Inspect all child members (can't exclude specific ones)\n inspect_type_hints(member_obj, recursion_limit=recursion_limit - 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_type_hints.py_test_obj_type_hints_test_obj_type_hints.inspect_type_hints_obj_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_test_obj_type_hints_test_obj_type_hints.inspect_type_hints_obj_ty", "embedding": null, "metadata": {"file_path": "tests/test_type_hints.py", "file_name": "test_type_hints.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 107, "span_ids": ["test_obj_type_hints"], "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 ('obj_type', 'members', 'exclude_members'),\n [\n (BaseModel, None, DEPRECATED_MODEL_MEMBERS),\n (RootModel, None, DEPRECATED_MODEL_MEMBERS),\n ],\n)\ndef test_obj_type_hints(obj_type, members: Optional[Set[str]], exclude_members: Optional[Set[str]]):\n \"\"\"\n Test an object and its members to make sure type hints can be resolved.\n :param obj_type: Type to check\n :param members: Explicit set of members to check, None to check all\n :param exclude_members: Set of member names to exclude\n \"\"\"\n inspect_type_hints(obj_type, members, exclude_members)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_test_parent_sub_model_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_type_hints.py_test_parent_sub_model_", "embedding": null, "metadata": {"file_path": "tests/test_type_hints.py", "file_name": "test_type_hints.py", "file_type": "text/x-python", "category": "test", "start_line": 110, "end_line": 142, "span_ids": ["test_generics", "test_dataclasses", "test_parent_sub_model", "test_root_model_as_field"], "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_parent_sub_model(ParentModel):\n inspect_type_hints(ParentModel, None, DEPRECATED_MODEL_MEMBERS)\n\n\ndef test_root_model_as_field():\n class MyRootModel(RootModel[int]):\n pass\n\n class MyModel(BaseModel):\n root_model: MyRootModel\n\n inspect_type_hints(MyRootModel, None, DEPRECATED_MODEL_MEMBERS)\n inspect_type_hints(MyModel, None, DEPRECATED_MODEL_MEMBERS)\n\n\ndef test_generics():\n data_type = TypeVar('data_type')\n\n class Result(BaseModel, Generic[data_type]):\n data: data_type\n\n inspect_type_hints(Result, None, DEPRECATED_MODEL_MEMBERS)\n inspect_type_hints(Result[Dict[str, Any]], None, DEPRECATED_MODEL_MEMBERS)\n\n\ndef test_dataclasses():\n @dataclass\n class MyDataclass:\n a: int\n b: float\n\n inspect_type_hints(MyDataclass)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_TypeEr.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_TypeEr.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": 514, "end_line": 572, "span_ids": ["test_classmethod", "test_use_no_fields", "test_use_bare", "test_use_no_fields_field_validator", "test_use_bare_field_validator"], "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_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_use_bare():\n with pytest.raises(TypeError, match='`@validator` should be used with fields'):\n\n class Model(BaseModel):\n a: str\n\n with pytest.warns(PydanticDeprecatedSince20, 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_validator` 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 @validator()\n def checker(cls, v):\n return v\n\n\ndef test_use_no_fields_field_validator():\n with pytest.raises(TypeError, match=re.escape(\"field_validator() missing 1 required positional argument: 'field'\")):\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_validate_child_extra_test_validate_all.assert_MyModel_x_10_x_": {"__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_all.assert_MyModel_x_10_x_", "embedding": null, "metadata": {"file_path": "tests/test_validators.py", "file_name": "test_validators.py", "file_type": "text/x-python", "category": "test", "start_line": 822, "end_line": 854, "span_ids": ["test_validate_all", "test_validate_child_extra"], "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_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')\n\n\ndef test_validate_all():\n class MyModel(BaseModel):\n x: int\n\n @field_validator('*')\n @classmethod\n def validate_all(cls, v: Any):\n return v * 2\n\n assert MyModel(x=10).x == 20", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_pydantic__pydantic/tests/test_validators.py_test_validate_child_all_test_validate_child_all.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_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": 857, "end_line": 890, "span_ids": ["test_validate_child_all"], "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_validate_child_all():\n with pytest.warns(PydanticDeprecatedSince20, 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')\n\n class Parent(BaseModel):\n a: str\n\n class Child(Parent):\n @field_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_datetime_field_validator_test_datetime_field_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_field_validator_test_datetime_field_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": 1302, "end_line": 1320, "span_ids": ["test_datetime_field_validator"], "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_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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_pre_called_once_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_pre_called_once_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": 1323, "end_line": 1363, "span_ids": ["test_assert_raises_validation_error", "test_pre_called_once"], "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_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\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: Any):\n if v != 'a':\n raise AssertionError('invalid a')\n return v\n\n Model(a='a')\n\n with pytest.raises(ValidationError) as exc_info:\n Model(a='snap')\n assert exc_info.value.errors(include_url=False) == [\n {\n 'ctx': {'error': HasRepr(repr(AssertionError('invalid a')))},\n 'input': 'snap',\n 'loc': ('a',),\n 'msg': 'Assertion failed, invalid a',\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"}}} \ No newline at end of file