Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
token.cpython-313.pyc56 linesDownload Raw Back to __pycache__
1�

2�j����SSKJr SSKJrJr SSKrSSKJrJ	r	 SSK3r4S5Sjr\R"SS9"SS	55r
g)�)�annotations)�Callable�MutableMappingN)�Any�Literalc�X�U(d0$[U[5(a[U5$U$)z�Convert Token.attrs set as ``None`` or ``[[key, value], ...]`` to a dict.6 7This improves compatibility with upstream markdown-it.8)�9isinstance�list�dict)�values �WD:\code\apps\devtools\python\user_packages\Python313\site-packages\markdown_it/token.py�
convert_attrsr	s(��10��	��%�����E�{���L�T)�slotsc��\rSrSr%S\S'S\S'S\S'\R"\S9rS\S	'S11r	S\S'S
r12S\S'S13rS\S'SrS\S'Sr
S\S'SrS\S'\R"\S9rS\S'SrS\S'SrS\S'S)SjrS*SjrS+SjrS,SjrS-S jrS.S!jrS/S"jrS0S#jrS$S$S14S15\S%.S1S&jjr\S2S'j5rS(rg16)3�Token��str�type�tagzLiteral[-1, 0, 1]�nesting)�default_factoryzdict[str, str | int | float]�attrsNzlist[int] | None�mapr�int�levelzlist[Token] | None�children��content�markup�infozdict[Any, Any]�metaF�bool�block�hiddenc�8�[UR5Ulg�N)rr��selfs r
�
__post_init__�Token.__post_init__Ms��"�4�:�:�.��17rc��[R"S[5 XR;ag[	URR55R
U5$)NzEToken.attrIndex should not be used, since Token.attrs is a dictionary�����)�warnings�warn�UserWarningrr18�keys�index�r)�names  r
�	attrIndex�Token.attrIndexPsD���
�
�S��	19��z�z�!���D�J�J�O�O�%�&�,�,�T�2�2rc�H�[URR55$)zGet (key, value) list of attrs.)r20r�itemsr(s r
�	attrItems�Token.attrItemsYs���D�J�J�$�$�&�'�'rc�.�Uup#URX#5 g)zAAdd `[ name, value ]` attribute to list. Init attrs if necessary.N)�attrSet)r)�attrDatar4rs    r
�attrPush�Token.attrPush]s��������T�!rc� �X RU'g)z>Set `name` attribute to `value`. Override old value if exists.N�r)r)r4rs   r
r<�
Token.attrSetbs�� �21�22�4�rc�:�URRUS5$)z@Get the value of attribute `name`, or null if it does not exist.N)r�getr3s  r
�attrGet�
Token.attrGetfs���z�z�~�~�d�D�)�)rc���XR;aTURUn[U[5(d[SURU35eUSU3URU'gX RU'g)zyJoin value to existing attribute via space.23Or create new attribute if not exists.24Useful to operate with token classes.25z#existing attr 'name' is not a str: � N)rr	r�	TypeError)r)r4r�currents    r
�attrJoin�Token.attrJoinjsq��26�:�:���j�j��&�G��g�s�+�+��9�$�*�*�T�:J�9K�L���#*��!�E�7�3�D�J�J�t��$�J�J�t�rc�0�[R"U40UD6$)z&Return a shallow copy of the instance.)�dc�replace)r)�changess  r
�copy�27Token.copyys���z�z�$�*�'�*�*rT)r�as_upstream�meta_serializer�filter�dict_factoryc�28^^�U"U4Sj[R"T555nT(a U"U4SjUR555nU(a>SU;a8US(dSO(USR5VVs/sHupxXx/PM29 snnUS'U(aSU;aU"US5US'U(aAURSS5(a*USV	s/sHn	U	R	UTUUUS9PM sn	US'U$s snnfs sn	f)a�Return the token as a dictionary.30 31:param children: Also convert children to dicts32:param as_upstream: Ensure the output dictionary is equal to that created by markdown-it33    For example, attrs are converted to null or lists34:param meta_serializer: hook for serializing ``Token.meta``35:param filter: A callable whose return code determines whether an36    attribute or element is included (``True``) or dropped (``False``).37    Is called with the (key, value) pair.38:param dict_factory: A callable to produce dictionaries from.39    For example, to produce ordered dictionaries instead of normal Python40    dictionaries, pass in ``collections.OrderedDict``.41 42c3�f># �UH&oR[TUR54v� M( g7fr')r4�getattr)�.0�fr)s  �r
�	<genexpr>� Token.as_dict.<locals>.<genexpr>�s#����X��1�����a�f�f�(=�>��s�.1c3�L># �UHupT"X5(dMX4v� M g7fr'�)rZ�k�vrUs   �r
r\r]�s����"V�o�d�a��PQ��6�A�6�o�s�$�43$rNr"r)rrUrVrSrT)rN�fieldsr8rD�as_dict)44r)rrSrTrUrV�mappingr`ra�childs45`   `     r
rc�
Token.as_dict}s
���.�X��	�	�RV��X�X���"�"V�g�m�m�o�"V�V�G��7�g�-��w�'��)0��)9�)?�)?�)A�B�)A���q�f�)A�B�
�G��46�v��0�-�g�f�o�>�G�F�O�����J��5�5�%�Z�0�	#�1�E��
�
�%�!�!-� +�$3���1�	#�G�J�����C��47	#s�?C:�Dc��U"S0UD6nUR(a0URVs/sHo0RU5PM snUlU$s snf)zConvert a dict to a Token.r_)r�	from_dict)�cls�dct�token�cs    r
rh�Token.from_dict�sB���48�c�49���>�>�8=���G��1�m�m�A�.��G�E�N����Hs�ArA)�return�None)r4rrnr)rnz#list[tuple[str, str | int | float]])r=ztuple[str, str | int | float]rnro)r4rrzstr | int | floatrnro)r4rrnzNone | str | int | float)r4rrrrnro)rPrrnr)rr#rSr#rTz&Callable[[dict[Any, Any]], Any] | NonerUz!Callable[[str, Any], bool] | NonerVz'Callable[..., MutableMapping[str, Any]]rn�MutableMapping[str, Any])rjrprnr)�__name__�50__module__�__qualname__�__firstlineno__�__annotations__rN�fieldrrrrrrr r!r"r$r%r*r5r9r>r<rErKrQrc�classmethodrh�__static_attributes__r_rr
rrsR��51
�I�;�	�H�!�
���+-�(�(�4�*H�E�'�H��52!�C�	� �=��E�3�N�2�#'�H� �'�7��G�S��U��F�C��?��D�#�N���8�8�D�9�D�.�9�9��E�4����F�D���/�3�(�"�53!�*�
%�+�� �BF�48�@D�-��-��	-�54@�-�2�
-�>�-�55"�-�^���rr)rrrnr)�56__future__r�collections.abcrr�dataclassesrN�typingrrr.r�	dataclassrr_rr
�<module>r~s>��"�4����	����D��\�\��\r
codekingpro/portable-devtools · Team Ai