intellecton/venv/lib/python3.12/site-packages/markdown/__pycache__/util.cpython-312.pyc

156 lines
16 KiB
Text
Raw Normal View History

<EFBFBD>
K<>jw6<00><01>H<00>UdZddlmZddlZddlZddlZddlmZmZddl m
Z
ddl m Z m Z mZmZmZmZmZe rddlmZddlmcmZed<08>Z gd <09>Zd
ed < d Z d Z edzZ edzezZ ej>edz<00>Z edzezZ! edzezZ" ej>e"dz<00>Z# edzezZ$ dZ%ed<03><15>d<16><00>Z&d(d)d<17>Z'd*d+d<18>Z(d,d<19>Z)d(d-d<1A>Z*d.d<1B>Z+Gd<1C>de,<2C>Z-Gd<1E>d<1F>Z.e r Gd <20>d!e<11>Z/Gd"<22>d#<23>Z0Gd$<24>d%e<0F>Z1Gd&<26>d'e e<00>Z2y)/zv
This module contains various contacts, classes and functions which get referenced and used
throughout the code base.
<EFBFBD>)<01> annotationsN)<02>wraps<70> lru_cache)<01>count)<07> TYPE_CHECKING<4E>Generic<69>Iterator<6F>
NamedTuple<EFBFBD>TypeVar<61> TypedDict<63>overload)<01>Markdown<77>_T);<3B>address<73>article<6C>aside<64>
blockquote<EFBFBD>details<6C>div<69>dl<64>fieldset<65>
figcaption<EFBFBD>figure<72>footer<65>form<72>h1<68>h2<68>h3<68>h4<68>h5<68>h6<68>header<65>hgroup<75>hr<68>main<69>menu<6E>nav<61>ol<6F>p<>pre<72>section<6F>table<6C>ul<75>canvas<61>colgroup<75>dd<64>body<64>dt<64>group<75>html<6D>iframe<6D>li<6C>legend<6E>math<74>map<61>noscript<70>output<75>object<63>option<6F>progress<73>script<70>style<6C>summary<72>tbody<64>td<74>textarea<65>tfoot<6F>th<74>thead<61>tr<74>video<65>centerz list[str]<5D>BLOCK_LEVEL_ELEMENTS<54><02>zklzzwxh:z%sz([0-9]+)<29>ampz
wzxhzdk:%sz
hzzhzkh:%s))u֐u߿)uⴰu⵿)<01>maxsizec<01>b<00>tjdk\rddlm}nddl}|j d<05><06>S)z= Return all entry_points in the `markdown.extensions` group. )<02><00>
r<00><01>metadataNzmarkdown.extensions)r3)<06>sys<79> version_info<66> importlibrT<00>importlib_metadata<74> entry_pointsrSs <20>P/home/antigravity/intellecton/venv/lib/python3.12/site-packages/markdown/util.py<70>get_installed_extensionsr[gs-<00><00> <0B><17><17>7<EFBFBD>"<22>&<26>-<2D> <13> <20> <20>'<<3C> <20> =<3D>=<3D>c<01><00><00><01><00><00>fd<01>}|S)z<>
Raise a [`DeprecationWarning`][] when wrapped function/method is called.
Usage:
```python
@deprecated("This method will be removed in version X; use Y instead.")
def some_method():
pass
```
c<01>4<00><02><00>t<00><00><00><00><02>fd<01><08>}|S)Nc<01>l<00><03>tjd<01>j<00>d<02><03><00>t<00><04><03><00>|i|<01><01>S)N<>'z' is deprecated. )<02>category<72>
stacklevel)<04>warnings<67>warn<72>__name__<5F>DeprecationWarning)<05>args<67>kwargs<67>func<6E>messagerbs <20><><EFBFBD>rZ<00>deprecated_funcz4deprecated.<locals>.wrapper.<locals>.deprecated_funcs<<00><><00> <14>M<EFBFBD>M<EFBFBD><13>D<EFBFBD>M<EFBFBD>M<EFBFBD>?<3F>"3<>G<EFBFBD>9<EFBFBD>=<3D>+<2B>%<25> <0E>
<18><14>(<28><16>(<28> (r\)r)rirkrjrbs` <20><>rZ<00>wrapperzdeprecated.<locals>.wrapper~s!<00><><00> <0E>t<EFBFBD><1B> )<29>
<15> )<29><1F>r\<00>)rjrbrls`` rZ<00>
deprecatedrnrs<00><><00> <1F> <13>Nr\c<01><><00>t|t<00>s|r|<00>|St|<00>S|r|j<00>dk(ry|j<00>dvry|j<00>dvry|rt d|z<00><00>y)aParses a string representing a boolean value. If parsing was successful,
returns `True` or `False`. If `preserve_none=True`, returns `True`, `False`,
or `None`. If parsing was not successful, raises `ValueError`, or, if
`fail_on_errors=False`, returns `None`.N<>none)<05>true<75>yes<65>y<>on<6F>1T)<06>false<73>no<6E>n<>off<66>0rpFzCannot parse bool value: %r)<05>
isinstance<EFBFBD>str<74>bool<6F>lower<65>
ValueError)<03>value<75>fail_on_errors<72> preserve_nones rZ<00>parseBoolValuer<65><00>st<00><00>
<16>e<EFBFBD>S<EFBFBD> !<21> <18>U<EFBFBD>]<5D><18>L<EFBFBD><13>E<EFBFBD>{<7B><1A> <16>5<EFBFBD>;<3B>;<3B>=<3D>F<EFBFBD>2<><13> <0E><1B><1B><1D>9<> 9<><13> <0E><1B><1B><1D>B<> B<><14> <17><18>6<><15>><3E>?<3F>?<3F>
r\c<01><><00>d|vr|jdd<02>}d|vr|jdd<04>}d|vr|jdd<06>}|S)zHTML escape a string of code.<2E>&z&amp;<3B><z&lt;<3B>>z&gt;)<01>replace)<01>texts rZ<00> code_escaper<65><00>sL<00><00>
<EFBFBD>d<EFBFBD>{<7B><13>|<7C>|<7C>C<EFBFBD><17>)<29><04>
<EFBFBD>d<EFBFBD>{<7B><13>|<7C>|<7C>C<EFBFBD><16>(<28><04>
<EFBFBD>d<EFBFBD>{<7B><13>|<7C>|<7C>C<EFBFBD><16>(<28><04> <0F>Kr\c<01>r<00>tj|<00>}t|<00>D]}|j}|r<01>|cSy)z+Get current stack depth, performantly.
N)rU<00> _getframer<00>f_back)<02>size<7A>frames rZ<00>_get_stack_depthr<68><00>s6<00><00> <10>M<EFBFBD>M<EFBFBD>$<24> <1F>E<EFBFBD><15>d<EFBFBD> <0B><18><04><15> <0C> <0C><05><14><17>K<EFBFBD>r\c<01>F<00>tj<00>t<00>z
dkS)zBReturn true if current stack depth is within 100 of maximum limit.<2E>d)rU<00>getrecursionlimitr<74>rmr\rZ<00>nearing_recursion_limitr<74><00>s<00><00> <0E> <20> <20> "<22>%5<>%7<> 7<>#<23> =<3D>=r\c<01><00>eZdZdZy)<03> AtomicStringz/A string which should not be further processed.N)re<00>
__module__<EFBFBD> __qualname__<5F>__doc__rmr\rZr<>r<><00>s<00><00>9<>r\r<>c<01><00>eZdZdZddd<03>Zy)<06> Processorz<72> The base class for all processors.
Attributes:
Processor.md: The `Markdown` instance passed in an initialization.
Arguments:
md: The `Markdown` instance this processor is a part of.
Nc<01><00>||_y<00>N)<01>md)<02>selfr<66>s rZ<00>__init__zProcessor.__init__<5F>s <00><00><14><04>r\r<>)r<>zMarkdown | None)rer<>r<>r<>r<>rmr\rZr<>r<><00>s <00><00><08>r\r<>c<01>6<00>eZdZUded<ded<ded<ded<y) <09>TagDatar|<00>tag<61>dict[str, str]<5D>attrs<72>int<6E>
left_index<EFBFBD> right_indexN<78>rer<>r<><00>__annotations__rmr\rZr<>r<><00>s<00><00> <10><08><1D><1D><17><0F><18>r\r<>c<01>6<00>eZdZdZd<02>Zdd<03>Zd d<04>Zd
d<05>Zd d<06>Zy) <0C> HtmlStashz{
This class is used for stashing HTML objects that we extract
in the beginning and replace with place-holders.
c<01><<00>d|_g|_d|_g|_y)z Create an `HtmlStash`. rN)<04> html_counter<65> rawHtmlBlocks<6B> tag_counter<65>tag_data<74>r<>s rZr<>zHtmlStash.__init__<5F>s!<00><00><1D><04><19>8:<3A><04><1A><1C><04><18>')<29><04> r\c<01><><00>|jj|<01>|j|j<00>}|xjdz c_|S)a 
Saves an HTML segment for later reinsertion. Returns a
placeholder string that needs to be inserted into the
document.
Keyword arguments:
html: An html segment.
Returns:
A placeholder string.
<20>)r<><00>append<6E>get_placeholderr<72>)r<>r4<00> placeholders rZ<00>storezHtmlStash.store<72>sE<00><00> <0A><1A><1A>!<21>!<21>$<24>'<27><1A>*<2A>*<2A>4<EFBFBD>+<<3C>+<<3C>=<3D> <0B> <0C><19><19>Q<EFBFBD><1E><19><1A>r\c<01> <00>d|_g|_y)z Clear the stash. rN)r<>r<>r<>s rZ<00>resetzHtmlStash.reset<65>s<00><00><1D><04><19><1F><04>r\c<01><00>t|zSr<>)<01>HTML_PLACEHOLDER<45>r<><00>keys rZr<>zHtmlStash.get_placeholder<65>s <00><00><1F>#<23>%<25>%r\c<01><><00>|jj||||d<01><04>tt|j<00>z}|xjdz c_|S)z(Store tag data and return a placeholder.)r<>r<>r<>r<>r<>)r<>r<><00>TAG_PLACEHOLDERr|r<>)r<>r<>r<>r<>r<>r<>s rZ<00> store_tagzHtmlStash.store_tag<61>sQ<00><00> <0C> <0A> <0A><1C><1C>S<EFBFBD>5<EFBFBD>,6<>-8<>:<3A> ;<3B>&<26><03>D<EFBFBD>,<<3C>,<<3C>(=<3D>=<3D> <0B> <0C><18><18>A<EFBFBD><1D><18><1A>r\N)r4zstr | etree.Element<6E>returnr|<00>r<><00>None)r<>r<>r<>r|)
r<EFBFBD>r|r<>r<>r<>r<>r<>r<>r<>r|) rer<>r<>r<>r<>r<>r<>r<>r<>rmr\rZr<>r<><00>s <00><00><08>
*<2A><1B>$ <20>
&<26>r\r<>c<01>"<00>eZdZUded<ded<y)<06> _PriorityItemr|<00>name<6D>float<61>priorityNr<4E>rmr\rZr<>r<> s <00><00>
<0A>I<EFBFBD><13>Or\r<>c<01><><00>eZdZdZd<02>Zdd<03>Zdd<04>Zedd<05><04>Zedd<06><04>Zdd<07>Zdd<08>Z d <09>Z
dd
<EFBFBD>Z dd <0B>Z ddd <0C>Z dd <0A>Zy)<1A>Registrya<79>
A priority sorted registry.
A `Registry` instance provides two public methods to alter the data of the
registry: `register` and `deregister`. Use `register` to add items and
`deregister` to remove items. See each method for specifics.
When registering an item, a "name" and a "priority" must be provided. All
items are automatically sorted by "priority" from highest to lowest. The
"name" is used to remove ("deregister") and get items.
A `Registry` instance it like a list (which maintains order) when reading
data. You may iterate over the items, get an item and get a count (length)
of all items. You may also check that the registry contains an item.
When getting an item you may use either the index of the item or the
string-based "name". For example:
registry = Registry()
registry.register(SomeItem(), 'itemname', 20)
# Get the item by index
item = registry[0]
# Get the item by name
item = registry['itemname']
When checking that the registry contains an item, you may use either the
string-based "name", or a reference to the actual item. For example:
someitem = SomeItem()
registry.register(someitem, 'itemname', 20)
# Contains the name
assert 'itemname' in registry
# Contains the item instance
assert someitem in registry
The method `get_index_for_name` is also available to obtain the index of
an item using that item's assigned "name".
c<01>.<00>i|_g|_d|_y)NF)<03>_data<74> _priority<74>
_is_sortedr<EFBFBD>s rZr<>zRegistry.__init__9s<00><00>$&<26><04>
<EFBFBD>.0<EFBFBD><04><0E><1F><04>r\c<01><><00>t|t<00>r||jj<00>vS||jj <00>vSr<>)r{r|r<><00>keys<79>values)r<><00>items rZ<00> __contains__zRegistry.__contains__>s:<00><00> <15>d<EFBFBD>C<EFBFBD> <20><17>4<EFBFBD>:<3A>:<3A>?<3F>?<3F>,<2C>,<2C> ,<2C><13>t<EFBFBD>z<EFBFBD>z<EFBFBD>(<28>(<28>*<2A>*<2A>*r\c<01><><00>|j<00>t|jD<00><01>cgc]\}}|j|<00><02>c}}<01>Scc}}wr<>)<04>_sort<72>iterr<72>r<>)r<><00>kr)s rZ<00>__iter__zRegistry.__iter__Es4<00><00> <0C>
<EFBFBD>
<EFBFBD> <0C><13>t<EFBFBD>~<7E>~<7E>><3E>t<EFBFBD>q<EFBFBD>!<21>T<EFBFBD>Z<EFBFBD>Z<EFBFBD><01>]<5D>><3E>?<3F>?<3F><>>s<00>A
c<01><00>yr<>rmr<>s rZ<00> __getitem__zRegistry.__getitem__I<00><00><00> r\c<01><00>yr<>rmr<>s rZr<>zRegistry.__getitem__Mr<>r\c<01>R<00>|j<00>t|t<00>rCt<00>}|j|D]%\}}|j |j |||<04><00>'|St|t<00>r&|j |j|jS|j |Sr<>) r<>r{<00>slicer<65>r<><00>registerr<72>r<>r<>)r<>r<><00>datar<61>r)s rZr<>zRegistry.__getitem__Qs<><00><00> <0C>
<EFBFBD>
<EFBFBD> <0C> <15>c<EFBFBD>5<EFBFBD> !<21>!)<29><1A>D<EFBFBD><1C><0E><0E>s<EFBFBD>+<2B> 3<><04><01>1<EFBFBD><14> <0A> <0A>d<EFBFBD>j<EFBFBD>j<EFBFBD><11>m<EFBFBD>Q<EFBFBD><01>2<> 3<><17>K<EFBFBD> <15>c<EFBFBD>3<EFBFBD> <1F><17>:<3A>:<3A>d<EFBFBD>n<EFBFBD>n<EFBFBD>S<EFBFBD>1<>6<>6<>7<> 7<><13>z<EFBFBD>z<EFBFBD>#<23><EFBFBD>r\c<01>,<00>t|j<00>Sr<>)<02>lenr<6E>r<>s rZ<00>__len__zRegistry.__len__\s<00><00><12>4<EFBFBD>><3E>><3E>"<22>"r\c<01>`<00>dj|jjt|<00><00>S)Nz<{}({})>)<04>format<61> __class__re<00>listr<74>s rZ<00>__repr__zRegistry.__repr___s#<00><00><19> <20> <20><14><1E><1E>!8<>!8<>$<24>t<EFBFBD>*<2A>E<>Er\c<01><><00>||vrV|j<00>|jj|jD<00>cgc]}|j|k(s<01>|<02><02>c}d<00>St dj |<01><00><00>cc}w)z5
Return the index of the given name.
rzNo item named "{}" exists.)r<>r<><00>indexr<78>rr<>)r<>r<><00>xs rZ<00>get_index_for_namezRegistry.get_index_for_namebsj<00><00> <10>4<EFBFBD><<3C> <10>J<EFBFBD>J<EFBFBD>L<EFBFBD><17>><3E>><3E>'<27>'<27> <20>N<EFBFBD>N<EFBFBD>=<3D>q<EFBFBD>a<EFBFBD>f<EFBFBD>f<EFBFBD><04>n<EFBFBD><11>=<3D>a<EFBFBD>@<40><0E> <0E><19>5<><<3C><<3C>T<EFBFBD>B<>C<>C<><43>>s <00>A5<08> A5c<01><><00>||vr|j|<02>d|_||j|<|jj t ||<03><00>y)aW
Add an item to the registry with the given name and priority.
Arguments:
item: The item being registered.
name: A string used to reference the item.
priority: An integer or float used to sort against all items.
If an item is registered with a "name" which already exists, the
existing item is replaced with the new item. Treat carefully as the
old item is lost with no way to recover it. The new item will be
sorted according to its priority and will **not** retain the position
of the old item.
FN)<06>
deregisterr<EFBFBD>r<>r<>r<>r<>)r<>r<>r<>r<>s rZr<>zRegistry.registermsE<00><00> <10>4<EFBFBD><<3C> <10>O<EFBFBD>O<EFBFBD>D<EFBFBD> !<21><1F><04><0F><1F><04>
<EFBFBD>
<EFBFBD>4<EFBFBD><18> <0C><0E><0E><1D><1D>m<EFBFBD>D<EFBFBD>(<28>;<3B><r\c<01><><00> |j|<01>}|j|=|j|=y#t$r|r<01>YywxYw)z<>
Remove an item from the registry.
Set `strict=False` to fail silently. Otherwise a [`ValueError`][] is raised for an unknown `name`.
N)r<>r<>r<>r)r<>r<><00>strictr<74>s rZr<>zRegistry.deregister<65>sI<00><00>  <16><18>+<2B>+<2B>D<EFBFBD>1<>E<EFBFBD><14><0E><0E>u<EFBFBD>%<25><14>
<EFBFBD>
<EFBFBD>4<EFBFBD> <20><><19> <16><15><15><16> <16>s <00>+.<00> =<03>=c<01>h<00>|js&|jjd<01>d<02><03>d|_yy)z<>
Sort the registry by priority from highest to lowest.
This method is called internally and should never be explicitly called.
c<01><00>|jSr<>)r<>)r<>s rZ<00><lambda>z Registry._sort.<locals>.<lambda><3E>s
<00><00><14><1D><1D>r\T)r<><00>reverseN)r<>r<><00>sortr<74>s rZr<>zRegistry._sort<72>s/<00><00> <14><EFBFBD><EFBFBD> <10>N<EFBFBD>N<EFBFBD> <1F> <1F>$><3E><04> <1F> M<>"<22>D<EFBFBD>O<EFBFBD>r\N)r<>zstr | _Tr<54>r})r<>z Iterator[_T])r<>z str | intr<74>r)r<>r<>r<>z Registry[_T])r<>zstr | int | slicer<65>z_T | Registry[_T])r<>r<>)r<>r|r<>r<>)r<>rr<>r|r<>r<>r<>r<>)T)r<>r|r<>r}r<>r<>r<>)rer<>r<>r<>r<>r<>r<>r r<>r<>r<>r<>r<>r<>r<>rmr\rZr<>r<>se<00><00>%<08>N <20>
+<2B>@<01><0E> <0C><0E> <0C><0E> <0C><0E> <0C> <1F>#<23>F<01> D<01>=<3D>, <16>#r\r<>)<01>)rjr|rbr<>)TF)r<>z
str | Noner<65>r}r<>r}r<>z bool | None)r<>r|r<>r|)r<>r<>r<>r<>)r<>r})3r<33><00>
__future__r<00>rerUrc<00> functoolsrr<00> itertoolsr<00>typingrrr r
r r r <00>markdownr<00>xml.etree.ElementTree<65>etree<65> ElementTreerrKr<><00>STX<54>ETX<54>INLINE_PLACEHOLDER_PREFIX<49>INLINE_PLACEHOLDER<45>compile<6C>INLINE_PLACEHOLDER_RE<52>AMP_SUBSTITUTEr<45><00>HTML_PLACEHOLDER_REr<45><00>RTL_BIDI_RANGESr[rnr<>r<>r<>r<>r|r<>r<>r<>r<>r<>r<>rmr\rZ<00><module>r
sz<00><01>(<04>
#<23> <09>
<EFBFBD><0F>&<26><1B>]<5D>]<5D>]<5D><10>!<21>)<29>)<29> <0C>T<EFBFBD>]<5D><02><04> #<02><14>i<EFBFBD> <02><04><0F><03>9<><0E><03>7<><1F>
<EFBFBD>N<EFBFBD><19>/<2F>.<2E><14>5<><03>;<3B><12>5<>"<22><02>
<EFBFBD>
<EFBFBD>#5<> <0B>#C<>D<><15>=<3D><14>U<EFBFBD><19>3<EFBFBD><1D><0E>/<2F><16><1C>%<25><03>+<2B><10>*<2A> <20>b<EFBFBD>j<EFBFBD>j<EFBFBD>!1<>K<EFBFBD>!?<3F>@<40><13>;<3B><15> <0C>$<24>s<EFBFBD>*<2A><0F>&<26> <02><0F> <0B>4<EFBFBD><18>><3E><19>><3E><13>2@<01>&<10><18>><3E> <09>3<EFBFBD> <09>
<15> <15><11><19>)<29><19>.<1B>.<1B>h<14>J<EFBFBD><14>
H#<23>w<EFBFBD>r<EFBFBD>{<7B>H#r\