a
    lcP                     @   s2  d Z ddl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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 ddlmZ g dZ e!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'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-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
Lexer
RegexLexerincludebygroupsusingdefaultwordscombineddo_insertionsthis)get_bool_optshebang_matches)TextCommentOperatorKeywordNameStringNumberPunctuationGenericOtherError)	unistring)PythonLexerPythonConsoleLexerPythonTracebackLexerPython2LexerPython2TracebackLexerCythonLexerDgLexer
NumPyLexerz.*?
c                $   @   s  e Zd ZdZdZdZg dZg dZg dZde	j
e	jf 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d-fd.eejejd/fd0eejejd1fd2eejejd3fd4eejejed5d-fd6eejejed5d/fd7eejejed5d1fd8eejejed5d3fd9e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:d1fd=eejejed:d3fd>efed?d@efdAefdBejfedCedDedEedFedGgdHedIfdJejdKfdLejdKfdMefedgdHedIfdNedKfdMefedge dOdPdQefe dRdPdQej!fge dSdPdQefe dRdPdQej!fgdTdU"e#j$ dV eeedWfgdXeee%e&efe'dKge dYdZdPd[e(j)fd\e(j)j*fe d]dZdPd[e(j+fge d^dPdQe(j,j-fge d_dPdQe(j.j-fgd`e/j0fdae/j0fdbe/j1fdce/j2fdde/j3fdee/j4fgdfe e(j5fdfefee(fgedEee(j,dKfe'dKgee(j6dKfgdgeeeefdhe(jfee(jfdieeeefe'dKgdjeeejdKfdhe(jfdke(j)j*dKfee(jfe'dKgdlej7fdmej7fgeded5gdnej7fgdoej7fed:geejeejeejeejdpejdKfdqej7fedrgdsejdKfdtej7fedugdpejdKfdqej7fedvgdsejdKfdtej7fedwgdxejdKfedrdejfgdyejdKfedudejfgdxejdKfedvdejfgdyejdKfedwdejfgdz!Z8d{d| Z9d}S )~r   z
    For Python source code (version 3.x).

    .. versionadded:: 0.10

    .. versionchanged:: 2.5
       This is now the default ``PythonLexer``.  It is still available as the
       alias ``Python3Lexer``.
    Pythonhttp://www.python.org)pythonpysagepython3py3)z*.pyz*.pywz*.jyz*.sagez*.sc
SConstruct
SConscriptz*.bzlBUCKBUILDzBUILD.bazel	WORKSPACEz*.tac)ztext/x-pythonzapplication/x-pythonztext/x-python3zapplication/x-python3z	[%s][%s]*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 r3   R/var/www/html/django/DPS/env/lib/python3.9/site-packages/pygments/lexers/python.pyinnerstring_rulesC   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/   r1   r3   r3   r4   fstring_rulesW   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asyncrb   breakcontinuedelelifrc   exceptfinallyrd   globalre   rf   passraisenonlocalreturntrywhilerg   rh   aswithz6(^[ \t]*)(match|case)\b(?![ \t]*(?:[:,;=^&|@~)\]}]|(?:|z)\b))soft-keywords-innerz(\s+)([^\n_]*)(_\b))A
__import__absallanybinbool	bytearray
breakpointbytes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(?<!\.)prefixrk   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"""''')!rootrI   r6   r_   rZ   r?   r@   r   r[   r\   r]   rW   r^   rB   rD   rH   rF   rJ   rO   rU   rT   r  r  r  r  rM   rN   rR   rS   rK   rL   rP   rQ   c                 C   s   t | dpd| d d v S )Npythonw?(3(\.\d)?)?import   r   textr3   r3   r4   analyse_text  s    
zPythonLexer.analyse_textN):rv  rt  rx  ro  r^   urlaliases	filenames	mimetypesuniZ	xid_startZxid_continueZuni_namer5   r7   r   r   r   AffixDocr   HashbangSingler   r   	NamespaceDoubler	   r   r   Wordr0   r   Constantjoinkeywordkwlistr   r   r   r   BuiltinPseudor   FunctionMagicVariabler   FloatOctBinHexInteger	DecoratorClassEscapetokensr  r3   r3   r3   r4   r      s  
?	



*












    6r   c                    @   sf  e Zd ZdZdZdZddgZg Zddg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d/ed0ged1d2d3efged4d5d2d6ejfd7ejjfed8d5d2d6ejfged9d2d3ejj fged:d2d3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d@e"j'j(fdAe"j'fgdBej)fgdCej*fdDefgeddDejdEfe+dEgdDej,dEfgdFe
fdGejfdHefdIejfe+dEgdFe
fdJejdEfdKejjdEfdLejfe+dEgdMej-fge	eje	ejdNejdEfdOej-fedPgdQejdEfdRej-fedSgdTejdEfedPd
ejfgdUejdEfedSd
ejfgdVZ.dWdX Z/dYS )Zr   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#   python2py2ztext/x-python2zapplication/x-python2c                 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/   r1   r3   r3   r4   r5     s    zPython2Lexer.innerstring_rulesr8   r9   r:   rV   r;   r<   rX   r=   r>   rY   z!=|==|<<|>>|[-~+/*%=<>&^|.]r?   rA   rB   rC   rD   rE   rF   rG   rH   r[   r\   r]   backtickz!([rR]|[uUbB][rR]|[rR][uUbB])(""")rP   z!([rR]|[uUbB][rR]|[rR][uUbB])(''')rQ   z([rR]|[uUbB][rR]|[rR][uUbB])(")rR   z([rR]|[uUbB][rR]|[rR][uUbB])(')rS   z([uUbB]?)(""")rT   z([uUbB]?)(''')z([uUbB]?)(")z([uUbB]?)(')r^   rW   )ro   rq   rr   rs   rt   rc   ru   execrv   rd   rw   re   rf   rx   r   ry   r{   r|   r}   rg   rh   r~   r   ri   rj   )Nr   r   r   r   apply
basestringr   r   bufferr   r   callabler   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-  r/  r0  r1  r2  r3  r4  r5  Z__iop__r6  r7  r8  r9  r:  r;  r<  r=  r>  Z__long__r@  rA  rC  rD  rE  rF  rG  rH  __nonzero__Z__oct__Z__op__rJ  rK  rL  rN  rO  Z__rcmp__Z__rdiv__rP  rQ  rR  rS  rT  rV  rW  Z__rop__rX  rZ  r[  r\  r]  r^  r_  r`  ra  rb  Z__setslice__rc  rd  re  rf  __unicode__rg  )ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  __metaclass__rt  ru  rv  ry  rz  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?   r[   r\   r]   rW   r  r^   rB   rD   rH   rF   rT   r  r  rR   rS   rP   rQ   c                 C   s
   t | dS )Nzpythonw?2(\.\d)?r  r  r3   r3   r4   r  {  s    zPython2Lexer.analyse_textN)0rv  rt  rx  ro  r^   r  r  r  r  r5   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  r3   r3   r3   r4   r     s.  	-	#









  >r   c                   @   s0   e Zd ZdZdZdgZdgZdd Zdd Zd	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``.
    zPython console sessionpyconztext/x-python-doctestc                 K   s$   t |dd| _tj| fi | d S )Nr'   T)r   r'   r   r2  )selfoptionsr3   r3   r4   r2    s    zPythonConsoleLexer.__init__c              	   c   s.  | j r(tf i | j}tf i | j}n tf i | j}tf i | j}d}g }d}d}d}t|D ]v}	|	 }
|
	ds|
	drd}|
t|dtj|
d d fgf ||
dd  7 }qf|
 dkr|s|
t|dtjdfgf ||
dd  7 }qf|r(t|||E d H  d}g }|
	dsBtd	|
rTd
}|
}|	 }qf|
dkrr|	 tj|
fV  qf|r||
7 }|
	ds|
 dksd}||D ]\}}}|| ||fV  qd}qf|	 tj|
fV  qf|rt|||E d H  |r*||D ]\}}}|| ||fV  qd S )N r   z>>> z...    z...   z"Traceback (most recent call last):z  File "[^"]+", line \d+\n$   zKeyboardInterrupt
 )r'   r   r  r   r   r   line_refinditergroup
startswithappendr   r   Promptrstripr
   get_tokens_unprocessedrematchstartr   r  stripOutput)r  r  ZpylexerZtblexerZcurcode
insertionsZcurtbZtbindextbr  lineitvr3   r3   r4   r    sh    







z)PythonConsoleLexer.get_tokens_unprocessedN)	rv  rt  rx  ro  r^   r  r  r2  r  r3   r3   r3   r4   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	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gdeeejedfedgdZdS )r   a   
    For Python 3.x tracebacks, with support for chained exceptions.

    .. versionadded:: 1.0

    .. versionchanged:: 2.5
       This is now the default ``PythonTracebackLexer``.  It is still available
       as the alias ``Python3TracebackLexer``.
    zPython Tracebackpytbpy3tbz*.pytbz*.py3tbztext/x-python-tracebackztext/x-python3-tracebackr8   z'^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)rv  rt  rx  ro  r^   r  r  r  r   r   	Tracebackr   r   r   r  r   r   r   r   r   r   Markerr   r  r3   r3   r3   r4   r     sT   



r   c                   @   s   e Zd ZdZdZdgZdgZdg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.

    .. versionadded:: 0.7

    .. versionchanged:: 2.5
       This class has been renamed from ``PythonTracebackLexer``.
       ``PythonTracebackLexer`` now refers to the Python 3 variant.
    zPython 2.x Tracebackpy2tbz*.py2tbztext/x-python2-tracebackz^(\^C)?(Traceback.*\n)r  r  r  r  r  r  markerr  r  r`   z^([a-zA-Z_]\w*)(:?\n)z( {4,})(\^))r  r  r  N)rv  rt  rx  ro  r^   r  r  r  r   r   r   r  r   r   r  r   r   r   r   r   r   r  r   r  r3   r3   r3   r4   r     sD   



r   c                !   @   sL  e Zd ZdZdZdZg dZg dZddg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d/ed0ged1d2d3efd4ejfged5d6d2d7ejfd8ejjfed9d6d2d7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d@ej"fdAefgdAej#dBfgdCej$fdDefdEe
ej#e	dBfdFe
ej#e	efdGedBfdHefdIedBfdJe	dBfdAejfdKe	fg
dAej%dBfgdLe
e	ee	fdMej&fdNe
e	ee	fe'dBgdOe
e	edBfdPej&fe'dBgdQej(fgdRej)fdSefdTefdUefgdefgdVedBfdWej(fedXgdYedBfdZej(fedXgd[edBfedXed\gd]edBfedXed\gd^Z*d_S )`r   zF
    For Pyrex and Cython source code.

    .. versionadded:: 1.1
    Cythonzhttp://cython.org)cythonpyxpyrex)z*.pyxz*.pxdz*.pxiztext/x-cythonzapplication/x-cythonr8   z^(\s*)("""(?:.|\n)*?""")z^(\s*)('''(?:.|\n)*?''')rV   r<   rX   r=   r>   rY   z(<)([a-zA-Z0-9.?]+)(>)z!=|==|<<|>>|[-~+/*%=<>&^|.?]z(from)(\d+)(<=)(\s+)(<)(\d+)(:)r?   z(def|property)(\s+)rB   z(cp?def)(\s+)cdefz	(cdef)(:)z(class|struct)(\s+)rD   z(from)(\s+)rF   z(c?import)(\s+)rH   r[   r  z(?:[rR]|[uU][rR]|[rR][uU])"""rP   z(?:[rR]|[uU][rR]|[rR][uU])'''rQ   z(?:[rR]|[uU][rR]|[rR][uU])"rR   z(?:[rR]|[uU][rR]|[rR][uU])'rS   z[uU]?"""rT   z[uU]?'''z[uU]?"z[uU]?'r^   rW   )ro   rp   rb   rq   Zbyrr   Zctypedefrs   rt   rc   ru   zexcept?r  rv   rd   ZfusedZgilrw   re   r   rf   Znogilrx   r   ry   r{   r|   r}   rg   r~   r   ri   rj   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?   r[   rW   r  r^   rB   r  rD   rH   rF   rT   r
  r  rR   rS   rP   rQ   N)+rv  rt  rx  ro  r^   r  r  r  r  r   r   r   r  r   r   r   r  r   Typer   r  r   r   r	   r   Preprocr  r  r   r  r  r  r  r  r  r  Reservedr  r  r   r  r0   r  r3   r3   r3   r4   r   ?  s  &
#


 r   c                   @   sz  e Zd ZdZdZdgZdgZdg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d.ed/fgd0ed/fgd1ed/fgd2ed/fgd3Z!d4S )5r    z
    Lexer for dg,
    a functional and object-oriented programming language
    running on the CPython 3 VM.

    .. versionadded:: 1.6
    dgz*.dgz	text/x-dgra   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?)'''rT   rQ   stringz(?i)(br|r?b?)"""rP   z(?i)(br|r?b?)'rS   z(?i)(br|r?b?)"rR   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   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  r8   r  r`   r  r  r  )r  rT   r  rR   rS   rP   rQ   N)"rv  rt  rx  ro  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  r3   r3   r3   r4   r      s   	
9r    c                   @   s>   e Zd ZdZdZdZdg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.

    .. versionadded:: 0.10
    NumPyzhttps://numpy.org/numpy>  ZhsplitZravelZix_taninfoZsignbitdivideZbinomialZ
geterrcallZswapaxesZkronZ
fromstringZ	nanargmaxZflatnonzerofrexpZtrapzZgradientZvsplitZasarray_chkfiniteproductZround_lessZissubsctypeZissubclass_ZsometrueZmintypecodeZ	ones_likematrixZrandom_integersZarray_splitZarray_equivZdstackZediff1d	remainderZsvdZcommon_typeZpolyderZbitwise_xorZtriimagZaminuniformZpkgloadrealndimZalltruesinhZclipZdiagZgeterridentitydottypenameZapply_along_axisZ
atleast_2dfmod	getbufferZarctanharraycompressZarccosZget_array_wrapZinterprequireshufflelog10isfiniteZmedianZintersect1dZangleZget_numpy_includeinvZgreater_equalZasfarrayZpolysubZonesZallcloseinsertZget_numarray_includeZisposinfZsolveZasfortranarrayZpolyfitZtostringZbitwise_andZlogspaceceilbetaZget_printoptionsZpolyintZ
frombuffernegativeZrandom_sampleZ
setbufsizeZright_shift
accumulatesplitZflatrepeatZtileZarcsinZifftZ	nanargminZsort_complexZ	row_stackZlexsortisnanZ
cumproductZpolyaddisinffabsZargsortZexpand_dimsZ
zeros_likeZ	geterrobjZflipudresizeZdispZplaceZc_Zcompare_chararraysZrollZsetmember1d	conjugateZ	isfortranZranfZ	seterrobjZ	isrealobjalenZvdotZiscomplexobjsortr  ZasarrayselectZogridZisscalarindicesmaximumZbitwise_notZissctypeitemZfromiterr   ZgumbelinvertZ
array_reprZconjZ	tensordotuniquesqrtZcorrcoefZfftshiftrandintr  ZgreaterfloorZisneginfsourceZfromfunctiondiffmatr   hypotZbyte_boundsZintersect1d_nuZrintZcumsumZhistogram2dZ
left_shiftZ
issubdtypeZmgridr   Zndenumeratelogical_andZbinary_reprZseterrZdsplitZset_printoptionsZfinfoZi0ZvstackZpolyvalZarccoshZpolydivZbincountZbartlettZget_includeZ	histogramZ
less_equalZastypeZ
getbufsizeZ	base_reprZlstsqZarangesignZ	transposeemptyZ
trim_zerosZpermutationr   Zargminr  Z
asanyarrayZreal_if_closeZarray_equalshaper   ZsquarefillsubtractminimumZnanmaxZ
fromarraysZfixequalZhistogramddZarctan2ZamaxdumpbyteswapexpflattenZsearchsortedZsincviewZvanderZarctanldexptolistZasmatrixwhereZsetxor1dr   expm1Z
arrayrangecrossZunravel_indexinnerZaroundZnewbyteordermodZ	setdiff1dZsetflagsZndindexZ
reciprocalZhstackadddeleteZtrilr   iterabler   ZsetfieldZsavetxtZwhofromfileZtrue_divideZisrealZalterdotZdiagflatZitemsetseedZlinspacetofileZ	index_expZrankrootsZ	deprecateZdtypeZ
bitwise_orZargwhereouterZ	vectorizeZunique1d	not_equalmeanvarZ
restoredotZputmaskZmeshgridZbmatZnanminZ	correlateZgenericZpinvsampleZrecarrayZtypeDictunwrapputZhammingZ	newbuffersinZfastCopyAndTransposeinfZnewaxisZcovZ	iscomplexZnansumr   Z	array_strZconcatenatechoosecoshZarcsinhZlogical_notZs_extractZr_loadZloadtxtZargmaxtanhZkaiserlogical_xorZ
empty_likeZpolymulZsctype2charZrot90ZreshapeZ
atleast_3dZpoly1dZmay_share_memoryZconvolveZdiagonalZtriuZrollaxisZnonzerocopyZset_numeric_ops
logical_orZhanningZint_asbufferloadslog1pZweibullZfloor_divideZ
nan_to_numZfftZcolumn_stackZpoissonZaveragenanZ	piecewiseZpolyZascontiguousarrayZblackmantestZdigitizeZzerosZfliplrpowerZcumprodZset_string_functionsizeZmaximum_sctypeZunion1dZvonmisesZapply_over_axesZ
atleast_1dZsqueezeZasscalar	broadcastZ
frompyfuncZmsorteyecostraceZfftfreqZgetfieldZptplogZstdZcan_castdumpsZ
seterrcalllog2Zarray2stringprodmodfZstandard_normalmultiplyZ
obj2sctypeabsoluteZshow_configc                 c   sJ   t | |D ]8\}}}|tu r8|| jv r8|tj|fV  q|||fV  qd S )N)r   r  r   EXTRA_KEYWORDSr   r  )r  r  indextokenvaluer3   r3   r4   r    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  ltextr3   r3   r4   r    s    
zNumPyLexer.analyse_textN)rv  rt  rx  ro  r^   r  r  r  r  r  r  r  r3   r3   r3   r4   r!   V  s   Cr!   )-ro  r  r  Zpygments.lexerr   r   r   r   r   r   r   r	   r
   r   Zpygments.utilr   r   Zpygments.tokenr   r   r   r   r   r   r   r   r   r   r   pygmentsr   r  __all__r   r  r   Python3Lexerr   r   r   Python3TracebackLexerr   r   r    r!   r3   r3   r3   r4   <module>   s.   
04
    _X50 5c