f vUdZddlmZddlZddlZddlZddlZddlZddl m Z m Z ddlm Z m Z m Z mZmZmZmZmZmZmZmZmZmZddlZddlZddlmZddlmZmZmZdd lmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)dd l*m+Z+dd l,m-Z-m.Z.dd l/m0Z0m1Z1dd l2m3Z3ddl4m5Z5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;mZ>ddlm?Z?e r/ddl@mAZAddlBmCZCddlmDZDmEZEmFZFddlGmHZHmIZIddlJmKZLddlMmNZNmOZOmPZPne?ZQdZReeeSe fddfZTdeUd<eeeVeeSeeVedeWffeeSedeWfffZXdeUd<e&jZZGdde&jZ\ede\ Z]eddde^ddd! d'd"Z_edde^ddd# d(d$Z_dddddddd% d)d&Z_e+e^Z`y)*zLogic for creating models.) annotationsN)copydeepcopy) TYPE_CHECKINGAnyCallableClassVarDict GeneratorLiteralSetTupleTypeVarUnioncastoverload)PydanticUndefined)Self TypeAliasUnpack) _config _decorators_fields _forward_ref _generics _import_utils _mock_val_ser_model_construction_repr _typing_extra_utils)getattr_migration) AliasChoices AliasPath)GetCoreSchemaHandlerGetJsonSchemaHandler) ConfigDict)PydanticUndefinedAnnotationPydanticUserError)DEFAULT_REF_TEMPLATEGenerateJsonSchemaJsonSchemaModeJsonSchemaValuemodel_json_schema)PluggableSchemaValidator)PydanticDeprecatedSince20) Signature)Path) CoreSchemaSchemaSerializerSchemaValidator)AbstractSetIntStrMappingIntStrAny)Protocol)ComputedFieldInfo FieldInfoModelPrivateAttr) BaseModel create_modelrTupleGeneratorIncExc  eZdZUdZeZded< iZded< iZded< ded < d ed < d ed < dZ ded< ded< ded< e jZ ded< ded< dZ ded< ded< dZded< ded< d ed!< ej d"Zd#ed$< ej d"Zd%ed&< ej d"Zd#ed'< es>ej,d(d)*Zej0d(d+d),Zej0d(d-d),Zd.Zdd/Zd0e_edd1Zedd2Z e!ddd3Z"ddd4dd5Z#d6ddddddddd0dd7 dd8Z$dddddddddd0dd9 dd:Z%e!d0e&e'd;f dd<Z(e!dd=Z)dd>Z*e!dd0d?dd@ ddAZ+e!ddddB ddCZ,e!dddD ddEZ-e!dddD ddFZ.e!ddGZ/e! ddHZ0e!ddIZ1 ddJZ2ddKZ3dddLZ4esdfdM Z5ddNZ6ddOZ7ddPZ8ddQZ9ddRZ:esddSZ;erddTZddWZ?e@jjZBe@jjZCe@jjZDe@jjZEddXZFeeGjdYdZdd[ZIeeGjd\dZdd]ZJeGjd^dZddddddd_ dd`ZKeGjdadZddddddeLeLdb ddcZMe!eGjdddZddeZNe!eGjdfdZddgdddh ddiZOe!eGjdjdZddgdddh ddkZPe!eGjdldZddmZQe!eGjdndZdddoZReGjdpdZdddddq ddrZSe!eGjdsdZd0e&f ddtZTe!eGjdudZd0e&dv ddwZUe!eGjdxdZddyZVe!eGjdzdZdd{ZWeGjd|dZdd}ZXeGjd~dZddZYe!eGjddZddZZeGjddZddZ[xZ\S)r=auUsage docs: https://docs.pydantic.dev/2.9/concepts/models/ A base class for creating Pydantic models. Attributes: __class_vars__: The names of the class variables defined on the model. __private_attributes__: Metadata about the private attributes of the model. __signature__: The synthesized `__init__` [`Signature`][inspect.Signature] of the model. __pydantic_complete__: Whether model building is completed, or if there are still undefined fields. __pydantic_core_schema__: The core schema of the model. __pydantic_custom_init__: Whether the model has a custom `__init__` function. __pydantic_decorators__: Metadata containing the decorators defined on the model. This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. __pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. __pydantic_post_init__: The name of the post-init method for the model, if defined. __pydantic_root_model__: Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. __pydantic_serializer__: The `pydantic-core` `SchemaSerializer` used to dump instances of the model. __pydantic_validator__: The `pydantic-core` `SchemaValidator` used to validate instances of the model. __pydantic_extra__: A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] is set to `'allow'`. __pydantic_fields_set__: The names of fields explicitly set during instantiation. __pydantic_private__: Values of private attributes set on the model instance. zClassVar[ConfigDict] model_configzClassVar[Dict[str, FieldInfo]] model_fieldsz&ClassVar[Dict[str, ComputedFieldInfo]]model_computed_fieldszClassVar[set[str]]__class_vars__z%ClassVar[Dict[str, ModelPrivateAttr]]__private_attributes__zClassVar[Signature] __signature__FzClassVar[bool]__pydantic_complete__zClassVar[CoreSchema]__pydantic_core_schema____pydantic_custom_init__z$ClassVar[_decorators.DecoratorInfos]__pydantic_decorators__z+ClassVar[_generics.PydanticGenericMetadata]__pydantic_generic_metadata__NzClassVar[Dict[str, Any] | None]__pydantic_parent_namespace__z+ClassVar[None | Literal['model_post_init']]__pydantic_post_init____pydantic_root_model__zClassVar[SchemaSerializer]__pydantic_serializer__z4ClassVar[SchemaValidator | PluggableSchemaValidator]__pydantic_validator__)initdict[str, Any] | None__pydantic_extra__set[str]__pydantic_fields_set____pydantic_private__zXPydantic models should inherit from BaseModel, BaseModel cannot be instantiated directlyzbase-model-instantiatedcode validator) val_or_serrY serializer)__dict__rVrTrWc zd}|jj||}||urtjddyy)a/Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. T) self_instancea*A custom validator is returning a value other than `self`. Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`. See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.Ncategory)rQvalidate_pythonwarningswarn)selfdata__tracebackhide__validated_selfs V/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/pydantic/main.py__init__zBaseModel.__init__sJ!44DDTY]D^ ~ % MML   &Tc|jS)zGet extra fields set during validation. Returns: A dictionary of extra fields, or `None` if `config.extra` is not set to `"allow"`. )rTres ri model_extrazBaseModel.model_extras&&&rkc|jS)zReturns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. )rVrms rimodel_fields_setzBaseModel.model_fields_sets+++rkc *|j|}i}t}|jjD]x\}}|j=|j|vr/|j |j||<|j |||vr|jt|jtr|jjn |jg}|D]} t| tr+| |vr'|j | ||<|j |nDt| tsO| j|} | tusi| ||<|j |n||vs'||vr'|j |||<|j |R|jrd|j!d||<{||}|j"j%ddk(r|nd} t'|d|t'|d||j(s t'|d| |j*ra|j-dt/|d rB|j06|jD]#\} } | |j2vs| |j0| <%|S|j(s t'|d d|S) aJCreates a new instance of the `Model` class with validated data. Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data. Default values are respected, but no other validation is performed. !!! note `model_construct()` generally respects the `model_config.extra` setting on the provided model. That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__` and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored. Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in an error if extra values are passed, but they will be ignored. Args: _fields_set: A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [`model_fields_set`][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the `values` argument will be used. values: Trusted or pre-validated data dictionary. Returns: A new instance of the `Model` class with validated data. NT)call_default_factoryextraallowr]rVrTrW)__new__setrCitemsaliaspopaddvalidation_alias isinstancer$choicesstrr%search_dict_for_pathr is_required get_defaultrBget_object_setattrrOrNmodel_post_inithasattrrWrF)cls _fields_setvaluesm fields_values fields_setnamefieldvalidation_aliasesrxvalue_extrakvs rimodel_constructzBaseModel.model_constructsk. KK (* U ++113KD%{{&5;;&+@&,jj&= d#t$J&U-C-C-O"%"8"8,G**22001# 0E!%-%6/.4jj.? d+"t,#E95 % : :6 B (9927M$/&NN40!0:%6>*0**T*:M$'NN4(**,*/*;*;QU*;*VM$';4<  $K252B2B2F2Fw2OSZ2Z`d:}54kB** A3V <  % %  d #q01a6L6L6X"LLNDAqA44445..q1+ ,, A5t <rk)updatedeepc|r|jn|j}|r|jjddk(rY|j D]E\}}||j vr||j |<$|ji|_||j|<Gn|j j||jj|j|S)aUsage docs: https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy Returns a copy of the model. Args: update: Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data. deep: Set to `True` to make a deep copy of the model. Returns: New model instance. rsrt) __deepcopy____copy__rBrrwrCr]rTrrVkeys)rerrcopiedrrs ri model_copyzBaseModel.model_copyAs)-""$$--/   $$W-8"LLNDAqD----.*!44<8:F57811!4 +&&v.  * * 1 1&++- @ rkpython) modeincludeexcludecontextby_alias exclude_unsetexclude_defaults exclude_none round_triprcserialize_as_anyc P|jj|||||||||| | |  S)aUsage docs: https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. Args: mode: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. include: A set of fields to include in the output. exclude: A set of fields to exclude from the output. context: Additional context to pass to the serializer. by_alias: Whether to use the field's alias in the dictionary key if defined. exclude_unset: Whether to exclude fields that have not been explicitly set. exclude_defaults: Whether to exclude fields that are set to their default value. exclude_none: Whether to exclude fields that have a value of `None`. round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A dictionary representation of the model. ) rrrrrrrrrrcr)rP to_python) rerrrrrrrrrrcrs ri model_dumpzBaseModel.model_dump]sGL++55 '-%!-6  rk indentrrrrrrrrrcrc l|jj|||||||||| | |  jS)a-Usage docs: https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json Generates a JSON representation of the model using Pydantic's `to_json` method. Args: indent: Indentation to use in the JSON output. If None is passed, the output will be compact. include: Field(s) to include in the JSON output. exclude: Field(s) to exclude from the JSON output. context: Additional context to pass to the serializer. by_alias: Whether to serialize using field aliases. exclude_unset: Whether to exclude fields that have not been explicitly set. exclude_defaults: Whether to exclude fields that are set to their default value. exclude_none: Whether to exclude fields that have a value of `None`. round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A JSON string representation of the model. r)rPto_jsondecode) rerrrrrrrrrrcrs rimodel_dump_jsonzBaseModel.model_dump_jsonsPH++33 '-%!-4   &( rk validationc"t|||||S)aGenerates a JSON schema for a model class. Args: by_alias: Whether to use attribute aliases or not. ref_template: The reference template. schema_generator: To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications mode: The mode in which to generate the schema. Returns: The JSON schema for the given model class. )r ref_templateschema_generatorr)r/)rrrrrs rir/zBaseModel.model_json_schemas(! (P`gk  rkct|tjs td|Dcgc])}t |t r|nt j|+}}dj|}|jd|dScc}w)a}Compute the class name for parametrizations of generic classes. This method can be overridden to achieve a custom naming scheme for generic BaseModels. Args: params: Tuple of types of the class. Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`. Returns: String representing the new class where `params` are passed to `cls` as type variables. Raises: TypeError: Raised when trying to generate concrete names for non-generic models. z;Concrete names should only be generated for generic models., []) issubclasstypingGeneric TypeErrorr|r~r display_as_typejoin__name__)rparamsparam param_namesparams_components rimodel_parametrized_namez!BaseModel.model_parametrized_names~"#v~~.YZ Z gmm]b 5# 6uE333vrkc||S)a_Hook into generating the model's JSON schema. Args: core_schema: A `pydantic-core` CoreSchema. You can ignore this argument and call the handler with a new CoreSchema, wrap this CoreSchema (`{'type': 'nullable', 'schema': current_schema}`), or just call the handler with the original schema. handler: Call into Pydantic's internal JSON schema generation. This will raise a `pydantic.errors.PydanticInvalidForJsonSchema` if JSON schema generation fails. Since this gets called by `BaseModel.model_json_schema` you can override the `schema_generator` argument to that function to change JSON schema generation globally for a type. Returns: A JSON schema, as a Python object. r)r core_schemars ri__get_pydantic_json_schema__z&BaseModel.__get_pydantic_json_schema__s0{##rkc y)aThis is intended to behave just like `__init_subclass__`, but is called by `ModelMetaclass` only after the class is actually fully initialized. In particular, attributes like `model_fields` will be present when this is called. This is necessary because `__init_subclass__` will always be called by `type.__new__`, and it would require a prohibitively large refactor to the `ModelMetaclass` to ensure that `type.__new__` was called in such a manner that the class would already be sufficiently initialized. This will receive the same `kwargs` that would be passed to the standard `__init_subclass__`, namely, any kwargs passed to the class definition that aren't used internally by pydantic. Args: **kwargs: Any keyword arguments passed to the class definition that aren't used internally by pydantic. Nrrkwargss ri__pydantic_init_subclass__z$BaseModel.__pydantic_init_subclass__s" rkc tj||}||S|tur tdt |dst|d|j ds*t j|jvrt|dt|ts|f}tj||tt|j d| tj j! j#r r|}tj$||||S|j d}|s|}nt fd|D}|j dxs|}|j'|}ttj( j#Dcic]}|dc}} tj*||5} | | cdddStj,||||}| |cdddS |j/d tj2|||| }tj$|||||ddd|Scc}w#t0$rYKwxYw#1swYSxYw) NzAType parameters should be placed on typing.Generic, not BaseModel__parameters__zG cannot be parametrized because it does not inherit from typing.Generic parametersz is not a generic classargsc3JK|]}tj|ywN)r replace_types).0arg typevars_maps ri z.BaseModel.__class_getitem__..s_CY44S,G_s #r)r)rget_cached_generic_type_earlyr=rrrLrr __bases__r|tuplecheck_parameters_countdictzipr" all_identicalrrset_cached_generic_typeriter_contained_typevarsgeneric_recursion_self_typeget_cached_generic_type_laterr)create_generic_submodel) rtypevar_valuescachedsubmodel parent_argsrr model_namerrmaybe_self_typers @ri__class_getitem__zBaseModel.__class_getitem__ss88nM  M ) _` `s,-se#jkl l00>6>>Y\YfYfCfse#:;< <.%0,.N((n=DH 11,? PD     1 1 3\5H5H5J KP\H  - -c>8 LJG;;FCK%_S^__66x@GCF77=J*3*K*KLL_L_La*bccF66vtD _".* _ _#??^U[]ab%!  _ _(((C%<>o44T:: *%+%<%>46D$) T5)""&&'8=//5>s8 H==IIcN||jvr<|j|}t|dr|j|y |j|=y|j|d||jvrtj||y|j||jvr|j|=y tj||y#t$r)}t t |jd||d}~wwxYw#t $r$t t |jd|wxYw)N __delete__r) rFrr7rWr r!rrr0rCr __delattr__rT)rer$r&r's rir8zBaseModel.__delattr__s0t222 77= 9l3((.o11$7   tT *t(((""4.((4AXAX9X++D1f&&tT2 o(DJ,?,?+BB[\`[c)deknno&f(DJ,?,?+BB[\`[c)deefs# C+C7 C4 $C//C47-D$c |jjddrd}n*t|jj|ddrd}ny||f|d}tj j |jj|g)Nfrozenfrozen_instanceF frozen_fieldrlocinput) rBrr1rC pydantic_coreValidationErrorfrom_exception_datar"r)rerrtyperrors rir0zBaseModel._check_frozens}    4 0#C T&&**40(E B C 71  ++??@W@WZ_Y`aarkc|j}|r,|jDcic]\}}|tus||}}}|j|j|j |dScc}}w)N)r]rTrVrW)rWrwrr]rTrV)reprivaterrs ri __getstate__zBaseModel.__getstate__se++ (/ V11DU;Uq!tVGV "&"9"9'+'C'C$+   Ws A A ct|d|jdit|d|jdit|d|jdit|d|jdiy)NrVrTrWr])rr)restates ri __setstate__zBaseModel.__setstate__sg7C\^`9ab2EII>RTV4WX4eii@VXZ6[\j%))J*CDrkc>t|tr)|jdxs |j}|jdxs |j}||k(r4t |ddt |ddk(r|j |j k(sy|j |j k(ryt|jj}|j j|kr|j j|kry|rtj|nd} ||j ||j k(StS#t$rRtj|j }tj|j }||||k(cYSwxYw)NrrWFTc"tjSr)r" _SENTINEL)_s riz"BaseModel.__eq__..s [a[k[krk)r|r=rLr"r1rTr]rrCroperator itemgetterr r"SafeGetItemProxyNotImplemented)reother self_type other_typerCgetterself_fields_proxyother_fields_proxys ri__eq__zBaseModel.__eq__st%+!>>xHZDNN "@@J]eoo +&>4JJJ&% S )/(?(? (N%)/)@)@)P&!"34?Q8RRRSs$EAFFc y)aThis signature is included purely to help type-checkers check arguments to class declaration, which provides a way to conveniently set model_config key/value pairs. ```py from pydantic import BaseModel class MyModel(BaseModel, extra='allow'): ... ``` However, this may be deceiving, since the _actual_ calls to `__init_subclass__` will not receive any of the config arguments, and will only receive any keyword arguments passed during class initialization that are _not_ expected keys in ConfigDict. (This is due to the way `ModelMetaclass.__new__` works.) Args: **kwargs: Keyword arguments passed to the class definition, which set model_config Note: You may want to override `__pydantic_init_subclass__` instead, which behaves similarly but is called *after* the class is fully initialized. Nrrs ri__init_subclass__zBaseModel.__init_subclass__srkc#K|jjDcgc]\}}|jdr||fc}}Ed{|j}|r|jEd{yycc}}w727w)zSo `dict(model)` works.rNN)r]rw startswithrT)rerrrss ri__iter__zBaseModel.__iter__sl)-)<)<)>Xv1allSVFWQFXXX'' {{} $ $ YX %s3A>A4A4A>A:%A>-A<. A><A>cL|jd|jddS)N(r)) __repr_name__ __repr_str__rms ri__repr__zBaseModel.__repr__s+$$&'q):):4)@(ACCrkc#KjjD]6\}}jj|}|s$|js1||f8 t j d}|d|jDEd{fdjjDEd{y#t$rd}YZwxYw7A7w)NrTc3*K|] \}}||f ywrr)rrrs rirz*BaseModel.__repr_args__..)sB41aABsc3ZK|]"\}}|js|t|f$ywr)reprr1)rrrres rirz*BaseModel.__repr_args__..*s*cda\]\b\bQa()cs++) r]rwrCrrirrr!rD)rerrrr(s` ri __repr_args__zBaseModel.__repr_args__sMM'')DAq%%))!,Ed * "#44T;OPN  %B>+?+?+AB B Bcd6P6P6V6V6Xccc  "!N " CcsS>C CCB;.C C  *C5C6C; C CC  CCc$|jdS)N )rdrms ri__str__zBaseModel.__str__2s  %%rkEThe `__fields__` attribute is deprecated, use `model_fields` instead.r`cPtjdt|jS)Nrnr`)rcrdr1rCrms ri __fields__zBaseModel.__fields__6s$  S^w    rkMThe `__fields_set__` attribute is deprecated, use `model_fields_set` instead.cPtjdt|jS)Nrqr`)rcrdr1rVrms ri__fields_set__zBaseModel.__fields_set__@s$  [. +++rk:The `dict` method is deprecated; use `model_dump` instead.rrrrrrcftjdt|j||||||S)Nrtr`ru)rcrdr1r)rerrrrrrs rirzBaseModel.dictLs<  R]vw'-%   rk?The `json` method is deprecated; use `model_dump_json` instead.)rrrrrrencodermodels_as_dictc tjdt|tur t d|tur t d| r t d|j ||||||S)Nrwr`zMThe `encoder` argument is no longer supported; use field serializers instead.zUThe `models_as_dict` argument is no longer supported; use a model serializer instead.z9`dumps_kwargs` keyword arguments are no longer supported.ru)rcrdr1rrr) rerrrrrrrxry dumps_kwargss rijsonzBaseModel.jsonas{  MXq  + +kl l !2 2st t WX X##'-% $  rkCThe `parse_obj` method is deprecated; use `model_validate` instead.cZtjdt|j|S)Nr}r`rcrdr1rrrs ri parse_objzBaseModel.parse_objs)  Q\u !!#&&rkThe `parse_raw` method is deprecated; if your data is JSON use `model_validate_json`, otherwise load the data then use `model_validate` instead.utf8) content_typeencodingproto allow_picklectjdtddlm} |j |||||}|j%|S#t tf$r}ddl} t|trd} n.t|| jrd} nt|t rd } nd } tj| t|d |d } tjj!|j"| gd}~wwxYw) Nrr`rparserrrrrzvalue_error.unicodedecodezvalue_error.jsondecode value_error type_error)__root__r=)rcrdr1 deprecatedrload_str_bytesr3rr|r|UnicodeDecodeErrorJSONDecodeErrorr@PydanticCustomErrorr~rArBrr) rbrrrrrrr'r|type_strrDs ri parse_rawzBaseModel.parse_raws   I. & [&&)!) 'C8!!#&&+I& [ #126C!5!563C,(' &99(CHM$ 5E  //CCCLLSXRYZ Z) [sA C1BC,,C1The `parse_file` method is deprecated; load the data from file, then if your data is JSON use `model_validate_json`, otherwise `model_validate` instead.ctjdtddlm}|j |||||}|j |S)Nrr`rrr)rcrdr1rr load_filer)rpathrrrrrrs ri parse_filezBaseModel.parse_filesQ   M. &oo %%  }}S!!rkqThe `from_orm` method is deprecated; set `model_config['from_attributes']=True` and use `model_validate` instead.ctjdt|jj dds t dd|j |S)Nrr`rzHYou must set the config attribute `from_attributes=True` to use from_ormrX)rcrdr1rBrr*rrs rifrom_ormzBaseModel.from_ormsX   W. ##$5t<#Zae !!#&&rkDThe `construct` method is deprecated; use `model_construct` instead.c `tjdt|jdd|i|S)Nrr`rr)rcrdr1r)rrrs ri constructzBaseModel.constructs3  R]v #s""E{EfEErkThe `copy` method is deprecated; use `model_copy` instead. See the docstring of `BaseModel.copy` for details about how to handle `include` and `exclude`.)rrrrc tjdtddlm}t |j |dd||dfi|xsi}|jd}n6|jjD cic]\}} | tus|| }}} |jd} n}|jj} t|jD]}||vs| j|t|D]%}||jvs|j|| |<'|r|j|jz} nt!|j} |r| t!|z} |j#||| | ||Scc} }w) aReturns a copy of the model. !!! warning "Deprecated" This method is now deprecated; use `model_copy` instead. If you need `include` or `exclude`, use: ```py data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) ``` Args: include: Optional set or mapping specifying which fields to include in the copied model. exclude: Optional set or mapping specifying which fields to exclude in the copied model. update: Optional dictionary of field-value pairs to override field values in the copied model. deep: If True, the values of fields that are Pydantic models will be deep-copied. Returns: A copy of the model with included, excluded and updated fields as specified. rr`rcopy_internalsF)to_dictrrrrN)r)rcrdr1rrr_iterrWrwrrTrlistryrVrrv_copy_and_set_values) rerrrrrrrFrrrsrs rirzBaseModel.copys|F   m. /  eeWgej !  |    $ $ ,G(,(A(A(G(G(Ih1QVgMgq!thGh  " " *+/E++002E$112F?IIaL3&\///%zz!}E!H" 55 EJT99:J  #g, &J224UT[bf2gg/is 3E4E4CThe `schema` method is deprecated; use `model_json_schema` instead.c^tjdt|j||S)Nrr`rr)rcrdr1r/)rrrs rirzBaseModel.schemaCs.  Q\u $$h\$RRrkWThe `schema_json` method is deprecated; use `model_json_schema` and json.dumps instead.rc tjdtddl}ddlm}|j |j||fd|i|S)Nrr`rr)pydantic_encoderrdefault)rcrdr1r|deprecated.jsonrdumpsr/)rrrr{r|rs ri schema_jsonzBaseModel.schema_jsonMsV  e.  5tzz  ! !8, ! O $   rkBThe `validate` method is deprecated; use `model_validate` instead.cZtjdt|j|S)Nrr`r)rrs rivalidatezBaseModel.validatecs)  P[t !!%((rkLThe `update_forward_refs` method is deprecated; use `model_rebuild` instead.c xtjdt|r td|j dy)Nrr`z,`localns` arguments are not longer accepted.T)r)rcrdr1rr)rlocalnss riupdate_forward_refszBaseModel.update_forward_refsks8  Z.  JK K %rkHThe private method `_iter` will be removed and should no longer be used.cptjdtddlm}|j |g|i|S)Nrr`rr)rcrdr1rrrrerrrs rirzBaseModel._iterys8  V.  /#~##D:4:6::rkWThe private method `_copy_and_set_values` will be removed and should no longer be used.cptjdtddlm}|j |g|i|S)Nrr`rr)rcrdr1rrrrs rirzBaseModel._copy_and_set_valuess8  e.  /2~224I$I&IIrkMThe private method `_get_value` will be removed and should no longer be used.cptjdtddlm}|j |g|i|S)Nrr`rr)rcrdr1rr _get_value)rrrrs rirzBaseModel._get_values8  [.  /(~((>t>v>>rkRThe private method `_calculate_keys` will be removed and should no longer be used.cptjdtddlm}|j |g|i|S)Nrr`rr)rcrdr1rr_calculate_keysrs rirzBaseModel._calculate_keyss8  `.  /-~--dDTDVDDrk)rfrreturnNone)rrS)rrUr)rzset[str] | Nonerrrr)rrSrboolrr)rzLiteral['json', 'python'] | strr IncEx | Nonerrr Any | Nonerrrrrrrrrrrc'bool | Literal['none', 'warn', 'error']rrrdict[str, Any])rz int | Nonerrrrrrrrrrrrrrrrrcrrrrr~) rrrr~rztype[GenerateJsonSchema]rr-rr)rztuple[type[Any], ...]rr~)rrrr) rrrrrintrrSr bool | None) rrrrrrrrrr)rzstr | bytes | bytearrayrrrrrr)rrrrrrrr)rtype[BaseModel]rr&rr4)rr4rr'rr.)rrrr)rz!type[Any] | tuple[type[Any], ...]rz3type[BaseModel] | _forward_ref.PydanticRecursiveRef)rr)rzdict[int, Any] | Nonerr)r$r~rr)rr~rrrr)rdict[Any, Any])rIrrr)rTrrr)rzUnpack[ConfigDict])rr?)rr~)rz_repr.ReprArgs)rzdict[str, FieldInfo])rrrrrrrrrrrrrDict[str, Any])rrrrrrrrrrrrrxzCallable[[Any], Any] | Noneryrr{rrr~)rrrr) rz str | bytesr str | Nonerr~rDeprecatedParseProtocol | Nonerrrr) rz str | Pathrrrr~rrrrrr) r+AbstractSetIntStr | MappingIntStrAny | NonerrrzDict[str, Any] | Nonerrrr)rrrr~rr)rrrr~r{rrr~)rrrr)rrrr)rrrrrr)]r __module__ __qualname____doc__r(rB__annotations__rCrDrHrDecoratorInfosrKrMrOr NoInitFieldrTrVrWrrrrI MockValSerrQrP __slots__rj__pydantic_base_init__r2rnrp classmethodrrrrr+r,r/rrrrrrrrrrrrr)r5r8r0rGrJrZr\r_rerjr Representationrcrd __pretty__ __rich_repr__rmtyping_extensionsrrprsrrr|rrrrrrrrrrrrrr __classcell__)r"s@rir=r=Ns- @*4L&5 46L05EGAFc&&@AA=&&S,1>1V22',,;D^KD^D^D`A`^$ONlFJ!#BIQGGE.3^3N77UPPX0O0C0O0OUZ0[-[s(G(;(G(GU(SXSB2Q2E2Q2QW\2]/]A $@=#?#? f*$  ":!9!9 f"*"  #;-":": f#*#  dI('+H# '',,NN`=Au>19 $ $"#!&" <@!&3 .3  3  3  3 3 3 3 3 3 :3 3  3 p" $ $"#!&" <@!&11 1  1  111111:11 1f05G+    3       .554 !'(26 77 7 "% 7 0 7 77r #'+"     %       8 #" c*c c  c  cc4 #" ` ` `  `  ``*.$$&$  $$2  $>>> <>@&*  j@) 7V f4 b  E 5 &n  ,%Dd(((66M''44L%%00J((66M&!!!OZ^!! !!!W,  ,"!!"^imn!% $#!&"            o ("!!"cnrs!% $#!&"/@0          -     t >!!!"grvw'x' !!! E$(04"-' -'! -'  -' . -'-' -'  -'^!!! I$(04"""! "  " . "" "  "2!!! S '  '!!!"hswxFyF "!! i@D?C(, Eh=Eh= Eh & Eh  Eh Eh  EhN!!!"grvw"8LSS25S SxS!!!a "&;O  58 ad    "!!!"fquv)w) !!!V&  &"!!R]a;;"!!aJ J!!!W?  ?"!!\E Erkr=) metaclassModelT)bound) __config__r__base__r__validators____cls_kwargs__c yrrrrrrrrrfield_definitionss rir>r>srk)rrrrrc yrrrs rir>r>srk)rrrrrrrc j|tjdt|#| tddt |t s|f}nt dtf}|xsi}i} i} |jD]\} } tj| stjd| dtt | t rt d | } | \} }n^tj| rEtj| ^} }}t!j"}t ||std d d| }} | r| | | <|| | <|$t%j&d }|j(d}| |d}|r|j+d|i|r|j+||j+| |r"t-j.|j0|d<t3j4|}t3j6|||\}}}||ur||d<|j+|||||fd|d|S#t$r}td d |d}~wwxYw)aDUsage docs: https://docs.pydantic.dev/2.9/concepts/models/#dynamic-model-creation Dynamically creates and returns a new Pydantic model, in other words, `create_model` dynamically creates a subclass of [`BaseModel`][pydantic.BaseModel]. Args: model_name: The name of the newly created model. __config__: The configuration of the new model. __doc__: The docstring of the new model. __base__: The base class or classes for the new model. __module__: The name of the module that the model belongs to; if `None`, the value is taken from `sys._getframe(1)` __validators__: A dictionary of methods that validate fields. The keys are the names of the validation methods to be added to the model, and the values are the validation methods themselves. You can read more about functional validators [here](https://docs.pydantic.dev/2.9/concepts/validators/#field-validators). __cls_kwargs__: A dictionary of keyword arguments for class creation, such as `metaclass`. __slots__: Deprecated. Should not be passed to `create_model`. **field_definitions: Attributes of the new model. They should be passed in the format: `=(, )`, `=(, )`, or `typing.Annotated[, ]`. Any additional metadata in `typing.Annotated[, , ...]` will be ignored. Returns: The new [model][pydantic.BaseModel]. Raises: PydanticUserError: If `__base__` and `__config__` are both passed. Nz.__slots__ should not be passed to create_modelzFto avoid confusion `__config__` and `__base__` cannot be used togetherzcreate-model-config-baserX type[ModelT]z3fields may not start with an underscore, ignoring "r.ztuple[str, Any]z4Field definitions should be a `(, )`.zcreate-model-field-definitionsz, ]rr)rrrrB)kwds__orig_bases__F)#__pydantic_reset_parent_namespace___create_model_module)rcrdRuntimeWarningr*r|rrr=rwrr/r3r! is_annotatedrget_argsrimport_cached_field_infosys _getframe f_globalsrrr config_dicttypes resolve_bases prepare_class)rrrrrrrrrfieldsrf_namef_def f_annotationf_valueerNr;f namespaceresolved_basesmetansrs rir>r>srP FW  !#X/ (E* {H35#)rN FK*002 **62 MMOPVxWXY[i j eU #*E2E (-% g ' ' .*;*D*D+ '\7Q&>>@Igy1'R9 %)%'L ".K  v=3@ MM! [[, 4?z ZI)W-.( V$+$9$9*$E$Q$Q .!((2N((^.YND"dX%'  R  -2'     W 'J9 sH H2H--H2)rr~rConfigDict | Nonerrrrrr~r$dict[str, Callable[..., Any]] | NonerrSrrrr)rr~rr rrrz'type[ModelT] | tuple[type[ModelT], ...]rr~rr rrSrrrr)rr~rr rrrz.type[ModelT] | tuple[type[ModelT], ...] | Nonerrrr rrSrztuple[str, ...] | Nonerrrr)ar __future__r _annotationsrPrrrrcrrrrrr r r r r rrrrrr@rrrrr _internalrrrrrrrrr r!r" _migrationr#aliasesr$r%annotated_handlersr&r'rr(errorsr)r* json_schemar+r,r-r.r/plugin._schema_validatorr0r1inspectr2pathlibr3r4r5r6_internal._utilsr7r8deprecated.parser9DeprecatedParseProtocolrr:r;r<DeprecationWarning__all__r~r?rrrr@object_setattrrModelMetaclassr=rrr>r)rrkrirs 2  +55    *,JBuu>/!KKEEFF3 %&eCHotT&AB BS3s8T#uWd]7K2K-LdSVX]^egk^kXlSlNmmnyn%44]E-<<]E@+  + %);?,0  "      9 *      %);?,0  "    6  9 *     $%)?C!;?,0(,uu" u  u = uu9u*u&uuup ) rk