a
    $lJh]                     @   s0  d Z ddlZddlmZmZmZmZmZmZm	Z	m
Z
mZ ddlmZmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ g dZG dd	 d	eZ e Z!G d
d deZ"G dd deZ#G dd deZ$G dd deZ%e%Z&G dd deZ'G dd deZ(G dd deZ)G dd de Z*dS )z
    pygments.lexers.python
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Python and related languages.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)	DelegatingLexer
RegexLexerincludebygroupsusingdefaultwordscombinedthis)get_bool_optshebang_matches)TextCommentOperatorKeywordNameStringNumberPunctuationGenericOtherError
Whitespace)	unistring)PythonLexerPythonConsoleLexerPythonTracebackLexerPython2LexerPython2TracebackLexerCythonLexerDgLexer
NumPyLexerc                $   @   s*  e Zd ZdZdZdZg dZg dZg dZdZ	de
j d	e
j d
Zdd Zdd Zdefdeeejejfdeeejejfdejfdejfdefdefededdeeedfdeeedfdeejedfdeejedfed gd!eejejed"d#fd$eejejed"d%fd&eejejed"d'fd(eejejed"d)fd*eejejed+d#fd,eejejed+d%fd-eejejed+d'fd.eejejed+d)fd/eejejd0fd1eejejd2fd3eejejd4fd5eejejd6fd7eejejed8d0fd9eejejed8d2fd:eejejed8d4fd;eejejed8d6fd<eejejed=d0fd>eejejed=d2fd?eejejed=d4fd@eejejed=d6fdAefedBdCefdDefdEej fedFedGedHedIedJgdKedLfdMej!dNfdOej!dNfdPefed gdKedLfdQedNfdPefed ge"dRdSdTefe"dUdSdTej#fge"dVdSdTefe"dUdSdTej#fgdWdX$dYdZ e%j&D  d[ eeed\fgd]eee'e(efe)dNge"d^d_dSd`e*j+fdae*j+j,fe"dbd_dSd`e*j-fge"dcdSdTe*j.j/fge"dddSdTe*j0j/fgdee1j2fdfe1j2fdge1j3fdhe1j4fdie1j5fdje1j6fgdke e*j7fdkefee*fgedHee*j.dNfe)dNgee*j8dNfgdleeeefdme*jfee*jfdneeeefe)dNgdoeeejdNfdme*jfdpej#dNfee*jfe)dNgdqej9fdrej9fged"ed8gdsej9fgdtej9fed=geejeejeejeejduejdNfdvej9fedwgdxejdNfdyej9fedzgduejdNfdvej9fed{gdxejdNfdyej9fed|gd}ejdNfedwdejfgd~ejdNfedzdejfgd}ejdNfed{dejfgd~ejdNfed|dejfgd!Z:dd Z;dS )r   z
    For Python source code (version 3.x).

    .. versionchanged:: 2.5
       This is now the default ``PythonLexer``.  It is still available as the
       alias ``Python3Lexer``.
    Pythonhttps://www.python.org)pythonpyZsagepython3Zpy3ZbazelZstarlarkZpyi)z*.pyz*.pywz*.pyiz*.jyz*.sagez*.scZ
SConstructZ
SConscriptz*.bzlZBUCKBUILDzBUILD.bazelZ	WORKSPACEz*.tac)ztext/x-pythonzapplication/x-pythonztext/x-python3zapplication/x-python30.10[z][z]*c                 C   s&   dt jfdt jfd| fd| fd| fgS )NzH%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsaux%]zg\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\![sra])?(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}z[^\\\'"%{\n]+[\'"\\]z%|(\{{1,2})r   Interpolttype r/   T/var/www/shaz/venv/lib/python3.9/site-packages/pip/_vendor/pygments/lexers/python.pyinnerstring_rulesA   s    zPythonLexer.innerstring_rulesc                 C   s"   dt jfdt jdfd| fd| fgS )Nz\}z\{expr-inside-fstringz[^\\\'"{}\n]+r*   r+   r-   r/   r/   r0   fstring_rulesU   s
    
zPythonLexer.fstring_rules\n&^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")&^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')\A#!.+$#.*$\\\n\\keywordssoft-keywords(def)((?:\s|\\\s)+)funcname(class)((?:\s|\\\s)+)	classname(from)((?:\s|\\\s)+)
fromimport(import)((?:\s|\\\s)+)importexprz(?i)(rf|fr)(""")rfstringescapetdqfz(?i)(rf|fr)(''')tsqfz(?i)(rf|fr)(")dqfz(?i)(rf|fr)(')sqfz([fF])(""")fstringescapez([fF])(''')z	([fF])(")z	([fF])(')z(?i)(rb|br|r)(""")tdqsz(?i)(rb|br|r)(''')tsqsz(?i)(rb|br|r)(")dqsz(?i)(rb|br|r)(')sqsz([uU]?)(""")stringescapez([uU]?)(''')z
([uU]?)(")z
([uU]?)(')z([bB])(""")bytesescapez([bB])(''')z	([bB])(")z	([bB])(')[^\S\n]+numbersz!=|==|<<|>>|:=|[-~+/*%=<>&^|.][]{}:(),;[](in|is|and|or|not)\bexpr-keywordsbuiltins
magicfuncs	magicvarsnamez[{([]expr-inside-fstring-innerz(=\s*)?(\![sraf])?\}#popz(=\s*)?(\![sraf])?:\s+z[])}])z	async forawaitelseforiflambdayield
yield from\bsuffix)TrueFalseNone)assertasyncr^   breakcontinuedelelifr_   exceptfinallyr`   globalra   rb   passraisenonlocalreturntrywhilerc   rd   aswithz6(^[ \t]*)(match|case)\b(?![ \t]*(?:[:,;=^&|@~)\]}]|(?:|c                 c   s   | ]}|d    r|V  qdS )r   N)islower).0kr/   r/   r0   	<genexpr>       zPythonLexer.<genexpr>z)\b))soft-keywords-innerz(\s+)([^\n_]*)(_\b))C
__import__absZaiterallanybinbool	bytearray
breakpointbytescallablechrclassmethodcompilecomplexdelattrdictdirdivmod	enumerateevalfilterfloatformat	frozensetgetattrglobalshasattrhashhexidinputint
isinstance
issubclassiterlenlistlocalsmapmax
memoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypevarszip(?<!\.)prefixrg   z+(?<!\.)(self|Ellipsis|NotImplemented|cls)\b)EArithmeticErrorAssertionErrorAttributeErrorBaseExceptionBufferErrorBytesWarningDeprecationWarningEOFErrorEnvironmentError	ExceptionFloatingPointErrorFutureWarningGeneratorExitIOErrorImportErrorImportWarningIndentationError
IndexErrorKeyErrorKeyboardInterruptLookupErrorMemoryError	NameErrorNotImplementedErrorOSErrorOverflowErrorPendingDeprecationWarningReferenceErrorResourceWarningRuntimeErrorRuntimeWarningStopIterationSyntaxErrorSyntaxWarningSystemError
SystemExitTabError	TypeErrorUnboundLocalErrorUnicodeDecodeErrorUnicodeEncodeErrorUnicodeErrorUnicodeTranslateErrorUnicodeWarningUserWarning
ValueErrorVMSErrorWarningWindowsErrorZeroDivisionErrorBlockingIOErrorChildProcessErrorConnectionErrorBrokenPipeErrorConnectionAbortedErrorConnectionRefusedErrorConnectionResetErrorFileExistsErrorFileNotFoundErrorInterruptedErrorIsADirectoryErrorNotADirectoryErrorPermissionErrorProcessLookupErrorTimeoutErrorStopAsyncIterationModuleNotFoundErrorRecursionErrorZEncodingWarning)^__abs____add__
__aenter__	__aexit__	__aiter____and__	__anext__	__await____bool__	__bytes____call____complex____contains____del____delattr__
__delete____delitem____dir__
__divmod__	__enter____eq____exit__	__float____floordiv__
__format____ge____get____getattr____getattribute____getitem____gt____hash____iadd____iand____ifloordiv____ilshift____imatmul____imod____imul__	__index____init____instancecheck____int__
__invert____ior____ipow____irshift____isub____iter____itruediv____ixor____le____len____length_hint__
__lshift____lt__
__matmul____missing____mod____mul____ne____neg____new____next____or____pos____pow____prepare____radd____rand____rdivmod____repr____reversed____rfloordiv____rlshift____rmatmul____rmod____rmul____ror__	__round____rpow____rrshift__
__rshift____rsub____rtruediv____rxor____set____setattr____setitem____str____sub____subclasscheck____truediv____xor__)__annotations__	__bases__	__class____closure____code____defaults____dict____doc____file____func____globals____kwdefaults__
__module____mro____name____objclass____qualname____self__	__slots____weakref__zT(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)([eE][+-]?\d(?:_?\d)*)?z!\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?z0[oO](?:_?[0-7])+z0[bB](?:_?[01])+z0[xX](?:_?[a-fA-F0-9])+z\d(?:_?\d)*@(\s+)(as)(\s+)z\.(\s*)(,)(\s*)z(\s+)(import)\bNone\bz\{\{z\}\}z0\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})z,\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})"\\\\|\\"|\\\nfstrings-double'\\\\|\\'|\\\nfstrings-singlestrings-doublestrings-single"""''')!rootrE   r2   r[   rV   r;   r<   r   rW   rX   rY   rS   rZ   r>   r@   rD   rB   rF   rK   rQ   rP   r  r  r  r  rI   rJ   rN   rO   rG   rH   rL   rM   c                 C   s   t | dpd| d d v S )Npythonw?(3(\.\d)?)?import   r   textr/   r/   r0   analyse_text  s    
zPythonLexer.analyse_textN)<rx  rv  rz  rq  rZ   urlaliases	filenames	mimetypesversion_addeduniZ	xid_startZxid_continueZuni_namer1   r3   r   r   r   AffixDocr   HashbangSingler   r   r   	NamespaceDoubler	   r   r   Wordr,   r   Constantjoinkeywordkwlistr   r
   r   r   BuiltinPseudor   FunctionMagicVariabler   FloatOctBinHexInteger	DecoratorClassEscapetokensr  r/   r/   r/   r0   r      s   ?	


*













    7r   c                    @   sj  e Zd ZdZdZdZddgZg ZddgZdZ	d	d
 Z
defdeeejejfdeeejejfdefdejfdejfdefdefdefdejfdefeddeeedfdeeedfdeejedfdeejedfeded ed!ed"d#eejejd$fd%eejejd&fd'eejejd(fd)eejejd*fd+eejejed,d$fd-eejejed,d&fd.eejejed,d(fd/eejejed,d*fed0ed1ged2d3d4efged5d6d3d7ejfd8ejjfed9d6d3d7ej fged:d3d4ej!j"fged;d3d4ej#j"fgd<e$j%fd=e$j%fd>e$j&fd?e$j'fd@e$j(fdAe$j)j*fdBe$j)fgdCej+fgdDej,fdEefged dEej!dFfe-dFgdEej.dFfgdGefdHejfdIefdJejfe-dFgdGefdKejdFfdLejjdFfdMejfe-dFgdNej/fge
eje
ejdOejdFfdPej/fedQgdRejdFfdSej/fedTgdUejdFfedQdejfgdVejdFfedTdejfgdWZ0dXdY Z1dZS )[r   a  
    For Python 2.x source code.

    .. versionchanged:: 2.5
       This class has been renamed from ``PythonLexer``.  ``PythonLexer`` now
       refers to the Python 3 variant.  File name patterns like ``*.py`` have
       been moved to Python 3 as well.
    z
Python 2.xr#   Zpython2Zpy2ztext/x-python2zapplication/x-python2 c                 C   s   dt jfd| fd| fd| fgS )NG%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%][^\\\'"%\n]+r*   %r+   r-   r/   r/   r0   r1     s    zPython2Lexer.innerstring_rulesr4   r5   r6   rR   r7   r8   rT   r9   r:   rU   z!=|==|<<|>>|[-~+/*%=<>&^|.]r;   r=   r>   r?   r@   rA   rB   rC   rD   rW   rX   rY   backtickz!([rR]|[uUbB][rR]|[rR][uUbB])(""")rL   z!([rR]|[uUbB][rR]|[rR][uUbB])(''')rM   z([rR]|[uUbB][rR]|[rR][uUbB])(")rN   z([rR]|[uUbB][rR]|[rR][uUbB])(')rO   z([uUbB]?)(""")rP   z([uUbB]?)(''')z([uUbB]?)(")z([uUbB]?)(')rZ   rS   )rk   rm   rn   ro   rp   r_   rq   execrr   r`   rs   ra   rb   rt   r   ru   rw   rx   ry   rc   rd   rz   r{   re   rf   )Nr   r   r   r   apply
basestringr   r   bufferr   r   r   r   r   cmpcoercer   r   r   r   r   r   r   r   execfileexitfiler   r   r   r   r   r   r   r   r   r   r   internr   r   r   r   r   r   longr   r   r   r   r   r   r   r   r   r   r   	raw_inputreducereloadr   r   r   r   r   r   r   r   r   r   r   r   r   unichrunicoder   xranger   r   r   z;(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls)\b)1r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   OverflowWarningr   r   r   r   StandardErrorr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )_r  r  r  r  Z__cmp__Z
__coerce__r  r  r  r  r  r  Z__delslice__Z__div__r  r  r   r!  r"  r#  r%  r&  r'  r(  r)  Z__getslice__r*  r+  Z__hex__r,  r-  Z__idiv__r.  r/  r1  r2  r3  r4  r5  r6  r7  Z__iop__r8  r9  r:  r;  r<  r=  r>  r?  r@  Z__long__rB  rC  rE  rF  rG  rH  rI  rJ  __nonzero__Z__oct__Z__op__rL  rM  rN  rP  rQ  Z__rcmp__Z__rdiv__rR  rS  rT  rU  rV  rX  rY  Z__rop__rZ  r\  r]  r^  r_  r`  ra  rb  rc  rd  Z__setslice__re  rf  rg  rh  __unicode__ri  )rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  __metaclass__rv  rw  rx  r{  r|  r}  z'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?z\d+[eE][+-]?[0-9]+j?z	0[0-7]+j?z
0[bB][01]+0[xX][a-fA-F0-9]+\d+Lz\d+j?`.*?`z@[\w.]+[a-zA-Z_]\w*r\   z(?:[ \t]|\\\n)+as\b,[a-zA-Z_][\w.]*zimport\br  [a-zA-Z_.][\w.]*Y\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})r  r  r  r  r  r  r  r  )r  r;   rW   rX   rY   rS   r  rZ   r>   r@   rD   rB   rP   r  r  rN   rO   rL   rM   c                 C   s
   t | dS )Nzpythonw?2(\.\d)?r  r  r/   r/   r0   r  {  s    zPython2Lexer.analyse_textN)2rx  rv  rz  rq  rZ   r  r  r  r  r  r1   r   r   r   r  r  r   r   r  r  r   r   r  r   r   r  r  r	   r   r   r  r  r   r  r  r  r   r  r  r  r  r  LongBacktickr  r   r  r  r  r  r/   r/   r/   r0   r     s0  	-	#









  >r   c                   @   s   e Zd ZdZddgZdgZdeeje	j
dfdeejefde	jd	fd
e	jd	fdejfgdeeje	j
fdeejefedgdedfdeejefde	jfgdZdS )_PythonConsoleLexerBasePython console sessionpyconpython-consoletext/x-python-doctestz(>>> )(.*\n)continuationsz	(>>>)(\n)z,(\^C)?Traceback \(most recent call last\):\n	tracebackz  File "[^"]+", line \d+z.*\nz(\.\.\. )(.*\n)z(\.\.\.)(\n)r\   z(?=>>>( |$))z(KeyboardInterrupt)(\n))r  r  r  N)rx  rv  rz  rZ   r  r  r   r   ZPromptr   Coder   	TracebackZOutputr   r   r   r  r  r/   r/   r/   r0   r    s$   	

	r  c                       s:   e Zd ZdZdZddgZdgZdZdZ fdd	Z	  Z
S )
r   a  
    For Python console output or doctests, such as:

    .. sourcecode:: pycon

        >>> a = 'foo'
        >>> print(a)
        foo
        >>> 1 / 0
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ZeroDivisionError: integer division or modulo by zero

    Additional options:

    `python3`
        Use Python 3 lexer for code.  Default is ``True``.

        .. versionadded:: 1.0
        .. versionchanged:: 2.5
           Now defaults to ``True``.
    r  r  r  r  https://python.orgr  c                    sT   t |dd}|rt t}nt t}G  fdddt}t j||tj	fi | d S )Nr&   Tc                       s   e Zd Z fddZ  ZS )z6PythonConsoleLexer.__init__.<locals>._ReplaceInnerCodec                    s   t  jttjfi | d S N)r   r4  r  r   r  )selfoptions)rl  pylexerr/   r0   r4    s    z?PythonConsoleLexer.__init__.<locals>._ReplaceInnerCode.__init__)rx  rv  rz  r4  __classcell__r/   r  rl  r0   _ReplaceInnerCode  s   r  )
r   r   r   r   r   r   r   r4  r   r  )r  r  r&   Ztblexerr  r  r  r0   r4    s    zPythonConsoleLexer.__init__)rx  rv  rz  rq  rZ   r  r  r  r  r4  r  r/   r/   r  r0   r     s   r   c                   @   s   e Zd ZdZdZddgZddgZddgZd	Zd
Z	de
fdejdfdejfdejfdejdfdefgdeeejeeeee
fdeeejeee
fdee
eee
dfdee
ee
fdeejeee
dfdeeje
dfedgdee
eje
dfedgdZdS )r   z
    For Python 3.x tracebacks, with support for chained exceptions.

    .. versionchanged:: 2.5
       This is now the default ``PythonTracebackLexer``.  It is still available
       as the alias ``Python3TracebackLexer``.
    zPython TracebackZpytbZpy3tbz*.pytbz*.py3tbztext/x-python-tracebackztext/x-python3-tracebackr  z1.0r4   z-^(\^C)?Traceback \(most recent call last\):\nintbzH^During handling of the above exception, another exception occurred:\n\nzI^The above exception was the direct cause of the following exception:\n\n^(?=  File "[^"]+", line \d+)^.*\n0^(  File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)%^(  File )("[^"]+")(, line )(\d+)(\n)^(    )(.+)(\n)markers^([ \t]*)(\.\.\.)(\n)^([^:]+)(: )(.+)(\n)r\   z^([a-zA-Z_][\w.]*)(:?\n)z^( {4,})([~^]+)(\n))r  r  r  N)rx  rv  rz  rq  rZ   r  r  r  r  r  r   r   r  r   r   r   r   r  r   r   r   r   r   r   r   Markerr  r/   r/   r/   r0   r     sZ   


r   c                   @   s   e Zd ZdZdZdgZdgZdgZdZdZ	de
eejd	fd
ejd	fdefgde
eejeeeeefde
eejeeefde
eeeedfde
eeefde
ejeeedfde
ejedfgde
eejdfedgdZdS )r   z
    For Python tracebacks.

    .. versionchanged:: 2.5
       This class has been renamed from ``PythonTracebackLexer``.
       ``PythonTracebackLexer`` now refers to the Python 3 variant.
    zPython 2.x TracebackZpy2tbz*.py2tbztext/x-python2-tracebackr  z0.7z^(\^C)?(Traceback.*\n)r  r  r  r  r  r  markerr  r  r\   z^([a-zA-Z_]\w*)(:?\n)z( {4,})(\^))r  r  r  N)rx  rv  rz  rq  rZ   r  r  r  r  r  r   r   r   r  r   r   r  r   r   r   r   r   r   r   r  r   r  r/   r/   r/   r0   r     sH   


r   c                !   @   sP  e Zd ZdZdZdZg dZg dZddgZdZ	d	e
fd
ee
ejfdee
ejfdefdefdefde
fdefdejfdeeejefdefdeeejee
eeefeddeee
dfdeee
dfdeeefdeee
dfdeee
dfdeee
d fed!ed"d#ed$fd%ed&fd'ed(fd)ed*fd+eed,d$fd-eed,d&fd.eed,d(fd/eed,d*fed0ed1ged2d3d4efd5ejfged6d7d3d8ejfd9ejjfed:d7d3d8ejfgd;ejfd<ej fd=ej!fd>ejj"fd?ejfgd@ej#fgdAej$fdBefgdBej%dCfgdDej&fdEefdFeej%e
dCfdGeej%e
efdHedCfdIefdJedCfdKedCfdBejfdLefg
dBej'dCfgdMee
ee
fdNej(fdOee
ee
fe)dCgdPee
edCfdQej(fe)dCgdRej*fgdSej+fdTefdUefdVefgd	efgdWedCfdXej*fedYgdZedCfd[ej*fedYgd\edCfedYed]gd^edCfedYed]gd_Z,d`S )ar   z+
    For Pyrex and Cython source code.
    ZCythonzhttps://cython.org)ZcythonZpyxZpyrex)z*.pyxz*.pxdz*.pxiztext/x-cythonzapplication/x-cythonz1.1r4   z^(\s*)("""(?:.|\n)*?""")z^(\s*)('''(?:.|\n)*?''')rR   r8   rT   r9   r:   rU   z(<)([a-zA-Z0-9.?]+)(>)z!=|==|<<|>>|[-~+/*%=<>&^|.?]z(from)(\d+)(<=)(\s+)(<)(\d+)(:)r;   z(def|property)(\s+)r>   z(cp?def)(\s+)cdefz	(cdef)(:)z(class|struct)(\s+)r@   z(from)(\s+)rB   z(c?import)(\s+)rD   rW   r  z(?:[rR]|[uU][rR]|[rR][uU])"""rL   z(?:[rR]|[uU][rR]|[rR][uU])'''rM   z(?:[rR]|[uU][rR]|[rR][uU])"rN   z(?:[rR]|[uU][rR]|[rR][uU])'rO   z[uU]?"""rP   z[uU]?'''z[uU]?"z[uU]?'rZ   rS   )rk   rl   r^   rm   Zbyrn   Zctypedefro   rp   r_   rq   zexcept?r  rr   r`   ZfusedZgilrs   ra   r   rb   Znogilrt   r   ru   rw   rx   ry   rc   rz   r{   re   rf   z(DEF|IF|ELIF|ELSE)\b)Qr   r   r   r   r  r  r   Zbintr   r  r   r   r   r   r   r  r  r   r   r   r   r   r   r   r   r  r  r  r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   Z
Py_ssize_tr   r  r  r  r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  Zunsignedr   r  r   r   r   z<(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|NULL)\b)0r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   NotImplementedr   r   r   r  r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   z&(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?z0\d+r  r  z\d+r  z@\w+r  r\   z%(public|readonly|extern|api|inline)\bz(struct|enum|union|class)\bz([a-zA-Z_]\w*)(\s*)(?=[(:#=]|$)z([a-zA-Z_]\w*)(\s*)(,)zfrom\br  :z	(?=["\']).r  r  r  z(\s+)(c?import)\br  r  zP%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]r  r*   r  r  r  stringsr  r  r  nlr  )r  r;   rW   rS   r  rZ   r>   r  r@   rD   rB   rP   r  r  rN   rO   rL   rM   N)-rx  rv  rz  rq  rZ   r  r  r  r  r  r   r   r   r  r   r   r   r   r  r   Typer   r  r   r   r	   r   ZPreprocr  r  r   r  r  r  r  r  r  r  Reservedr  r  r   r  r,   r  r/   r/   r/   r0   r   >  s  &
#


 r   c                   @   s  e Zd ZdZdZdgZdgZdgZdZdZ	de
fdejfd	ejfd
ejfdejfdejfdejfdejfdeedddfdeedddfdeedddfdeedddfdefdejfdefeddddejfed dddejfd!ejjfd"ejfd#ejfd$ejfd%efd&ejfd'efd(efd)e fgd*ej!fgd+ej"fd,efd-efd.efd/efgd0ed1fgd2ed1fgd3ed1fgd4ed1fgd5Z#d6S )7r    zr
    Lexer for dg,
    a functional and object-oriented programming language
    running on the CPython 3 VM.
    Zdgz*.dgz	text/x-dgzhttp://pyos.github.io/dgz1.6r]   z#.*?$z(?i)0b[01]+z(?i)0o[0-7]+z(?i)0x[0-9a-f]+z((?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?z(?i)[+-]?[0-9]+e[+-]?\d+j?z(?i)[+-]?[0-9]+j?z(?i)(br|r?b?)'''rP   rM   stringz(?i)(br|r?b?)"""rL   z(?i)(br|r?b?)'rO   z(?i)(br|r?b?)"rN   z`\w+'*`z\b(and|in|is|or|where)\bz[!$%&*+\-./:<-@\\^|~;,]+)r   r   r   r   r   r   zdict'r   r   r   r   zlist'r   r   r   r   r   zset'r   r   r   r   r   ztuple'r   r   z
(?![\'\w])r   )=r   r   r   r   r   bindr   r  r   r   r   r   r   Zdrop	dropwhiler   r   Zexhaustr   Zflipzfoldl1?r   Zfstr   r   r   r   headr   r   initr   r   r   r   Ziteratelastr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   zscanl1?Zsndr   r   tailtake	takewhiler   r   z>(?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])z3(?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])zT(?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|SystemExit)(?!['\w])z_(?<![\w.])(except|finally|for|if|import|not|otherwise|raise|subclass|while|with|yield)(?!['\w])z[A-Z_]+'*(?!['\w])z[A-Z]\w+'*(?!['\w])z\w+'*z[()]r  r  r  r  r*   r  r4   r  r\   r  r  r  )r  rP   r  rN   rO   rL   rM   N)$rx  rv  rz  rq  rZ   r  r  r  r  r  r   r   r  r   r  r  r  r  r  r   r	   r   r  r   r   r  r  r   r   r  r  r   r   r  r,   r  r/   r/   r/   r0   r      s   	
9r    c                   @   sB   e Zd ZdZdZdZdgZdZg Zg Z	h dZ
dd Zd	d
 ZdS )r!   z?
    A Python lexer recognizing Numerical Python builtins.
    ZNumPyzhttps://numpy.org/numpyr(   >  ZlexsortputflattentofilehypotfabsZ
empty_likesource
logical_orZpoly1dZtriuZgetfieldZtrue_divideZmgridZhstackZtrilZfixbyteswapshufflerootsdeletediffsampleZsort_complexZbinomialZissctypeZfastCopyAndTransposetestZflatnonzerozerosZc_ZpoissonZlstsqZarray2stringZallcloseZsometruenanunwrapZright_shiftZix_ZptpZblackmanZ	ones_likerequireZgumbelZsolveZvonmisesZbartlettZclipfromfiler   ZissubsctypeZget_printoptionsZargwhereZbitwise_andZravelZ	newbufferZasscalarZcrosssignZbinary_reprZrintZpinvZ
frombufferZputmaskZbincountisfiniteZcan_castZsetxor1d	getbufferZgeterrZasfortranarrayZmay_share_memoryloadZarray_equivZconcatenateZget_numarray_includeZarcsinZ
setbufsizeZget_numpy_includer  ZisrealexpZaverageZdigitizeappendZsctype2charalenndimcoshZminimumarrayZ
issubdtypeZvdotsplitZcommon_typeZ
nan_to_numZ
array_reprZfloor_divideprodnegativemaximumsinhZhammingZround_Zasarray_chkfiniteZget_includeZndenumerateZrecarrayZ	setdiff1dZrot90Zmeshgridloadslogical_xorr   fmodZflatZisscalarZnanmaxZsetfieldZargsortlog10ZvsplitmultiplyZintersect1dequalZswapaxesZbitwise_xorZarccoshZ	piecewisesubtractsortZint_asbufferZvstackZcovZcompare_chararraysviewZfinfoZnanminZbitwise_notseeduniformuniqueZasfarrayZset_printoptionsZ	base_reprcompressisnanZ	array_strZset_numeric_opsZ
asanyarrayZreshapeZnewbyteorderbetaZsquarevarZarctanhshapeZ
seterrcallZ
reciprocalZdiagZ	geterrobjZarray_equalZpolyderZtileexpm1Zr_selectZgreaterZranfZ	correlateisinfZasarrayitemlog2ZdiagonalZrandom_integersZnewaxissqrtZitemsetr   ZfftfreqresizetypenameZsetmember1dZsavetxtr   iterableZapply_along_axisouterZeyeZ	nanargmaxZnansumZstandard_normalZogridZconjZ	nanargmintanZissubclass_ZifftZmatrixZmintypecodetolistdivideZlinspaceZ	tensordotZpolyint
fromstringZpolyvalZarctan2Z
geterrcallZonesZflipudZfromiterfillr   Zi0Zshow_configZsignbitZarray_splitZpolyZdiagflatZiscomplexobjZ
atleast_3dZ	histogrammatZvanderZsetflagsr   ZasmatrixZamaxabsoluteZ
atleast_2dZpkgloadZarccosZ
frompyfuncZhsplitZcumsumZgenericZintersect1d_nuZget_array_wrapZrollaxisZascontiguousarrayZpolyaddZset_string_functionZgradientZcorrcoef	not_equalidentityZkronZ	vectorizeZdsplitextractZrankZ	deprecateZinterpfrexpmodflogical_andZtriZmedianZ
fromarraysfloorZ
bitwise_orZ
less_equalZbyte_boundsceilZarctanZ	index_expZ
getbufsizeZ
zeros_likeZexpand_dimsZisposinfZseterrZ
arrayrangeproductrealrepeatmodZ	row_stackZsincZsqueezeZplaceZaminZcolumn_stackZpolyfitZ	isfortranZediff1dZ	transposeZpermutationZ
trim_zerosZlogical_notZrandom_sampleZargminZtypeDictZnonzeroZ
obj2sctypeZmsortZargmaxZrollZs_Z
atleast_1dZdispZloadtxtindicesZunique1d
accumulatedumpsrandintZunion1dZastypeZfftZfliplrldexpZpolysubZhistogramddinvZ
restoredotimagZwhoZ
left_shiftZhanningsizeZndindexZalltruesininf	conjugateZarangeZdstackmeandot	remainderinvertZ	seterrobjZunravel_indextostringZaroundZstdZweibullZfftshiftZ
cumproductZpolydivchooseZ	isrealobjaddZreal_if_closetanhinnertracecopyr   ZdtypepowerZ	iscomplexinfoZmaximum_sctyper   coslog1pZangleZgreater_equalZsearchsortedZarcsinhr  ZpolymulZtrapzZlessr   logZapply_over_axes	broadcastdumpZbmatZcumprodZsvdZlogspaceZisneginfwhereZconvolveinsertemptyZhistogram2dZalterdotZfromfunctionZkaiserc                 c   sJ   t | |D ]8\}}}|tu r8|| jv r8|tj|fV  q|||fV  qd S r  )r   get_tokens_unprocessedr   EXTRA_KEYWORDSr   r  )r  r  indextokenvaluer/   r/   r0   rx    s
    
z!NumPyLexer.get_tokens_unprocessedc                 C   s.   | d d }t | dsd|v o,d|v p,d|v S )Nr  r  r  zimport numpyzfrom numpy importr  )r  ltextr/   r/   r0   r    s    
zNumPyLexer.analyse_textN)rx  rv  rz  rq  rZ   r  r  r  r  r  ry  rx  r  r/   r/   r/   r0   r!   T  s   Cr!   )+rq  r  Zpip._vendor.pygments.lexerr   r   r   r   r   r   r   r	   r
   Zpip._vendor.pygments.utilr   r   Zpip._vendor.pygments.tokenr   r   r   r   r   r   r   r   r   r   r   r   Zpip._vendor.pygmentsr   r  __all__r   ZPython3Lexerr   r  r   r   ZPython3TracebackLexerr   r   r    r!   r/   r/   r/   r0   <module>   s,   
,8    `%160 4c