fL iR9 ddlmZddlZddlmZddlmZddlm Z m Z m Z m Z m Z ddlmZddlmZdd lmZdd lmZmZmZmZmZdd lmZdd lmZmZe rdd lmZddl m!Z!m"Z"dZ#GddZ$GddZ%ed(iddddddddddddddddddddddd dd!dd"d#d$dd%dd&dd'd(d)d#d*dd+dd,d-d.d/d0d/d1d2d3d4d5d4d6d7d8dd9dd:d;ddd?dd@ddAddBddCddDdEdFddGddHd#dId#dJddKddLdZ&dQdMZ'e(ejRjUZ+hdNZ,dJdddd'ddd!d*d8dO Z-dRdPZ.y)S) annotationsN)contextmanager)Pattern) TYPE_CHECKINGAnyCallableLiteralcast) core_schema)Self)AliasGenerator) ConfigDict ExtraValuesJsonDict JsonEncoderJsonSchemaExtraCallable)PydanticUserError)PydanticDeprecatedSince20PydanticDeprecatedSince210)GenerateSchema)ComputedFieldInfo FieldInfozGSupport for class-based `config` is deprecated, use ConfigDict instead.cDeZdZUdZdZded<ded<ded<ded <ded <d ed <d ed<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded <d!ed"<d#ed$<ded%<d&ed'<d(ed)<d*ed+<d,ed-<d.ed/<d.ed0<d1ed2<ded3<ded4<d5ed6<ded7<ded8<d9ed:<d;ed<<ded=<d>ed?<ded@<dAedB<dedC<dedD<dEedF<dedG<dedH<dedI<dedJ<dKdLdSdMZe dTdNZe sdUdOZ dVdPZ dQZ yR)W ConfigWrapperzIInternal wrapper for Config which exposes ConfigDict items as attributes.) config_dictrr str | Nonetitlebool str_to_lower str_to_upperstr_strip_whitespaceintstr_min_lengthz int | Nonestr_max_lengthzExtraValues | Noneextrafrozenpopulate_by_nameuse_enum_valuesvalidate_assignmentarbitrary_types_allowedfrom_attributes loc_by_aliasz,Callable[[str], str] | AliasGenerator | Nonealias_generatorzCallable[[type], str] | Nonemodel_title_generatorz:Callable[[str, FieldInfo | ComputedFieldInfo], str] | Nonefield_title_generatorztuple[type, ...] ignored_types allow_inf_nanz)JsonDict | JsonSchemaExtraCallable | Nonejson_schema_extraz&dict[type[object], JsonEncoder] | None json_encodersstrictz0Literal['always', 'never', 'subclass-instances']revalidate_instanceszLiteral['iso8601', 'float']ser_json_timedeltaz-Literal['iso8601', 'seconds', 'milliseconds']ser_json_temporalz+Literal['seconds', 'milliseconds', 'infer']val_temporal_unitz Literal['utf8', 'base64', 'hex']ser_json_bytesval_json_bytesz'Literal['null', 'constants', 'strings']ser_json_inf_nanvalidate_defaultvalidate_returnztuple[str | Pattern[str], ...]protected_namespaceshide_input_in_errors defer_buildzdict[str, object] | Noneplugin_settingsztype[GenerateSchema] | Noneschema_generator+json_schema_serialization_defaults_requiredz,Literal['validation', 'serialization', None]json_schema_mode_overridecoerce_numbers_to_strz"Literal['rust-regex', 'python-re'] regex_enginevalidation_error_causeuse_attribute_docstringsz%bool | Literal['all', 'keys', 'none'] cache_stringsvalidate_by_aliasvalidate_by_nameserialize_by_aliasurl_preserve_empty_pathTcheckcT|rt||_ytt||_yN)prepare_configrr r)selfconfigrPs `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pydantic/_internal/_config.py__init__zConfigWrapper.__init__\s! -f5D #J7D ct}|D]1}t|dd}|s|j|j3|j d}|j d} |j dr| t dd|r| r t dd| xs t |} |j| t|jD]} | tvs |j| || <!||S) aZBuild a new `ConfigWrapper` instance for a `BaseModel`. The config wrapper built based on (in descending order of priority): - options from `kwargs` - options from the `namespace` - options from the base classes (`bases`) Args: bases: A tuple of base classes. namespace: The namespace of the class being created. raw_annotations: The (non-evaluated) annotations of the model. kwargs: The kwargs passed to the class being created. Returns: A `ConfigWrapper` instance for `BaseModel`. model_configNConfigz``model_config` cannot be used as a model field name. Use `model_config` for model configuration.zmodel-config-invalid-field-namecodez3"Config" and "model_config" cannot be used togetherz config-both) rgetattrupdatecopygetrrSlistkeys config_keyspop) clsbases namespaceraw_annotationskwargs config_newbaserUconfig_class_from_namespaceconfig_dict_from_namespaceconfig_from_namespaceks rV for_modelzConfigWrapper.for_modelbs0 \  1DT>48F!!&++-0 1 '0mmH&=#%.]]>%B"   ~ .3M3U#r6  '+E#$Y`mn n : inMh>i/0fkkm$ .AK & 1 1  .:rXc |j|S#t$r) t|cYS#t$rtd|dwxYwwxYw)NzConfig has no attribute )rKeyErrorconfig_defaultsAttributeError)rTnames rV __getattr__zConfigWrapper.__getattr__sb X''-- XX*400X(+CD8)LMSWWX Xs A&A?Ac#|j}|jdtjdtd|jdx}|jd d|d <||d<|jd d ur|jdd|d<|jd ds|jdd s t d d t jd)id|jdxs|xsdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd|jdfd |jd fd!|jd!fd"|jd"fd#|jd#fd$|jd$fd%|jd%fd&|jd&fd |jd fd|jdfd'|jd'fd(|jd(ffDcic] \}}||| c}}Scc}}w)*a Create a pydantic-core config. We don't use getattr here since we don't want to populate with defaults. Args: title: The title to use if not set in config. Returns: A `CoreConfig` object created from config. rCNzfThe `schema_generator` setting has been deprecated since v2.10. This setting no longer has any effect.r  stacklevelr(rLTrKFzNAt least one of `validate_by_alias` or `validate_by_name` must be set to True.z validate-by-alias-and-name-falser\rextra_fields_behaviorr&r2r"r r!r5r7r8r9r:r;r<r,r-r6r=r%r$r@rFrGrHrJrMrN)rrawarningswarnrrr CoreConfig)rTrrUr(rpvs rV core_configzConfigWrapper.core_configs!! ::( ) 5 MMx*  !' += > >  Kzz,-5.2*+-=)* ::) *e 3 CU8V8^)-F% & .5 K]_d@e#`7  %%# fjj1BUBdC,fjj.AB$fjj&AB+VZZ8N-OP#VZZ%?@#VZZ%?@vzz(34)6::6J+KL(&**5H*IJ(&**5H*IJ%vzz2B'CD%vzz2B'CD'4F)GH& 3D(EF#VZZ%?@+VZZ8N-OP'4F)GH%vzz2B'CD%vzz2B'CD+VZZ8N-OP,fjj9P.QR#VZZ%?@-vzz:R/ST$fjj&AB(&**5H*IJ'4F)GH)6::6J+KL. ;T0UV9!Aq<=?1!# # !sK-cndjd|jjD}d|dS)Nz, c30K|]\}}|d|yw)=Nr|).0rprs rV z)ConfigWrapper.__repr__..sHtq!1QElHszConfigWrapper())joinritems)rTcs rV__repr__zConfigWrapper.__repr__s4 IIHt/?/?/E/E/GH Hs!$$rXN)rU.ConfigDict | dict[str, Any] | type[Any] | NonerPr) rgztuple[type[Any], ...]rhdict[str, Any]rirrjrreturnr )rvstrrr)rrrzcore_schema.CoreConfig) __name__ __module__ __qualname____doc__ __slots____annotations__rW classmethodrqrrwrrr|rXrVrrsS I   L!!AA77UU##@@99 LJJ33DDBB4444==88--11155KK44  ""88!!`d8 1$1"1( 1  1  11h  XI V%rXrc<eZdZdZddZeddZeddZy) ConfigWrapperStackz%A stack of `ConfigWrapper` instances.c|g|_yrR_config_wrapper_stackrTconfig_wrappers rVrWzConfigWrapperStack.__init__s ;I:J"rXc |jdS)Nr)rTs rVtailzConfigWrapperStack.tails))"--rXc#K|dyt|ts t|d}|jj| d|jj y#|jj wxYww)NFrO) isinstancerrappendrers rVpushzConfigWrapperStack.pushsh  !  .-8*>GN "")).9 -   & & * * ,D & & * * ,sABA"B"A>>BN)rr)rr)rz!ConfigWrapper | ConfigDict | None) rrrrrWpropertyrrrr|rXrVrrs3/K.. - -rXrrr Fr!r"r$r%r&r'r(r)r*r+r,r-Tr.r/r0r1r|r2r3r5r6neverr7iso8601r8r9inferr:utf8r;r<nullr=r>r?)model_validate model_dumpr@r4rArCrBrDrErFrGz rust-regexrHrIrJrKrLrMrNc(| tSt|tsUtjt t dt|Dcic]!}|jdr|t||#}}tt|}t||Scc}w)zCreate a `ConfigDict` instance from an existing dict, a class (e.g. old class-based config) or None. Args: config: The input config. Returns: A ConfigDict object created from config. ry__) rrdictr}r~DEPRECATION_MESSAGErdir startswithr^r check_deprecated)rUrprs rVrSrS@s}~| fd # )+DQRS14VWAALLQUDV!WVQ''WWz6*K[!  Xs B!B> fields json_dumps json_loads getter_dict smart_unionallow_mutationpost_init_callerror_msg_templatescopy_on_model_validationunderscore_attrs_are_private) allow_population_by_field_name anystr_loweranystr_strip_whitespace anystr_upperkeep_untouchedmax_anystr_lengthmin_anystr_lengthorm_mode schema_extra validate_allct|jz}tj|jz}|s|rt|Dcic] }|t|}}|j Dcgc] \}}d|d|}}}t|Dcgc]}d|d }}dj dg|z|z}t j|tyycc}wcc}}wcc}w)zjCheck for deprecated config keys and warn the user. Args: config_dict: The input config. z* z has been renamed to z has been removed z%Valid config keys have changed in V2:N) V2_REMOVED_KEYSrcV2_RENAMED_KEYSsortedrrr}r~ UserWarning) rdeprecated_removed_keysdeprecated_renamed_keysrp renamingsrrenamed_bulletsremoved_bulletsmessages rVrrrs . 0@0@0BB-224{7G7G7II"94:;R4STqQ**T TLUOOL]^DAqRu$9!?^^@FG^@_`1Ru$56``))DEWZiij g{+ #:T^`sC4C C$)rUrrr)rrrNone)/ __future__r _annotationsr} contextlibrrertypingrrrr r pydantic_corer typing_extensionsr aliasesrrUrrrrrerrorsrrr#_internal._schema_generation_sharedrrrrrrrrtrSsetrrcrdrrrr|rXrVrs2%&"$\\&LD5_R%R%j--41 111 1  1  1 1 1111"111 !1"#1$%1&'1()1*+1, -1.!/10!112 31451671891:;1<=1>?1@:A1BC1DE1FG1HI1JK1L16M1N#O1P Q1RS1T!U1V#W1XY1Z[1\]1^_1`"a1h**,,1134  '9"5"%))!'&  ,rX