U
    G
\1                     @   s*  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 ddlmZ ddd	d
ddddgZed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$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-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)	Lexer
RegexLexerincludebygroupsusingdefaultwordscombineddo_insertions)get_bool_optshebang_matches)TextCommentOperatorKeywordNameStringNumberPunctuationGenericOtherError)	unistringPythonLexerPythonConsoleLexerPythonTracebackLexerPython3LexerPython3TracebackLexerCythonLexerDgLexer
NumPyLexerz.*?
c                    @   sr  e Zd ZdZdZdddgZdddd	d
dd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d0fd1e
ejejed2d*fd3e
ejejed2d,fd4e
ejejed2d.fd5e
ejejed2d0fed6ed7ged8d9d:efged;d<d9d=ejfd>ejjfed?d<d9d=ejfged@d9d:ejjfgedAd9d:ej jfgdBe!j"fdCe!j"fdDe!j#fdEe!j$fdFe!j%fdGe!j&j'fdHe!j&fgdIej(fgdJej)fdKefged&dKejdLfe*dLgdKej+dLfgdMe	fdNejfdOefdPejfe*dLgdMe	fdQejdLfdRejjdLfdSejfe*dLgdTej,fgeejeejdUejdLfdVej,fedWgdXejdLfdYej,fedZgd[ejdLfedWdejfgd\ejdLfedZdejfgd]Z-d^d_ Z.d`S )ar   z<
    For `Python <http://www.python.org>`_ source code.
    PythonpythonpyZsagez*.pyz*.pywz*.scZ
SConstructZ
SConscriptz*.tacz*.sageztext/x-pythonzapplication/x-pythonc                 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   InterpolZttype r+   8/usr/lib/python3/dist-packages/pygments/lexers/python.pyinnerstring_rules&   s    zPythonLexer.innerstring_rules\nz&^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")z&^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')[^\S\n]+z\A#!.+$#.*$[]{}:(),;[]\\\n\\(in|is|and|or|not)\bz!=|==|<<|>>|[-~+/*%=<>&^|.]keywordsz(def)((?:\s|\\\s)+)funcnamez(class)((?:\s|\\\s)+)	classnamez(from)((?:\s|\\\s)+)
fromimportz(import)((?:\s|\\\s)+)importbuiltins
magicfuncs	magicvarsbacktickz!([rR]|[uUbB][rR]|[rR][uUbB])(""")tdqsz!([rR]|[uUbB][rR]|[rR][uUbB])(''')tsqsz([rR]|[uUbB][rR]|[rR][uUbB])(")dqsz([rR]|[uUbB][rR]|[rR][uUbB])(')sqsz([uUbB]?)(""")stringescapez([uUbB]?)(''')z([uUbB]?)(")z([uUbB]?)(')namenumbers)assertbreakcontinuedelelifelseexceptexecfinallyforglobaliflambdapassprintraisereturntrywhileyield
yield fromaswith\bsuffix)N
__import__absallanyapply
basestringbinboolbuffer	bytearraybytescallablechrclassmethodcmpcoercecompilecomplexdelattrdictdirdivmod	enumerateevalexecfileexitfilefilterfloat	frozensetgetattrglobalshasattrhashhexidinputintintern
isinstance
issubclassiterlenlistlocalslongmapmaxminnextobjectoctopenordpowpropertyrange	raw_inputreducereloadreprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypeunichrunicodevarsxrangezip(?<!\.)prefixr^   z;(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls)\b)5ArithmeticErrorAssertionErrorAttributeErrorBaseExceptionDeprecationWarningEOFErrorEnvironmentError	ExceptionFloatingPointErrorFutureWarningGeneratorExitIOErrorImportErrorImportWarningIndentationError
IndexErrorKeyErrorKeyboardInterruptLookupErrorMemoryErrorModuleNotFoundError	NameErrorNotImplementedNotImplementedErrorOSErrorOverflowErrorOverflowWarningPendingDeprecationWarningRecursionErrorReferenceErrorRuntimeErrorRuntimeWarningStandardErrorStopIterationStopAsyncIterationSyntaxErrorSyntaxWarningSystemError
SystemExitTabError	TypeErrorUnboundLocalErrorUnicodeDecodeErrorUnicodeEncodeErrorUnicodeErrorUnicodeTranslateErrorUnicodeWarningUserWarning
ValueErrorVMSErrorWarningWindowsErrorZeroDivisionError)___abs____add____and____call__Z__cmp__Z
__coerce____complex____contains____del____delattr__
__delete____delitem__Z__delslice__Z__div__
__divmod__	__enter____eq____exit__	__float____floordiv____ge____get____getattr____getattribute____getitem__Z__getslice____gt____hash__Z__hex____iadd____iand__Z__idiv____ifloordiv____ilshift____imod____imul__	__index____init____instancecheck____int__
__invert__Z__iop____ior____ipow____irshift____isub____iter____itruediv____ixor____le____len__Z__long__
__lshift____lt____missing____mod____mul____ne____neg____new__Z__nonzero__Z__oct__Z__op____or____pos____pow____radd____rand__Z__rcmp__Z__rdiv____rdivmod____repr____reversed____rfloordiv____rlshift____rmod____rmul__Z__rop____ror____rpow____rrshift__
__rshift____rsub____rtruediv____rxor____set____setattr____setitem__Z__setslice____str____sub____subclasscheck____truediv__Z__unicode____xor__)	__bases__	__class____closure____code____defaults____dict____doc____file____func____globals__Z__metaclass__
__module____mro____name____self__	__slots____weakref__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*#popz(?:[ \t]|\\\n)+as\b,[a-zA-Z_][\w.]*zimport\bzNone\b[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})"\\\\|\\"|\\\nstrings-double'\\\\|\\'|\\\nstrings-single"""''')rootr5   r:   r;   r<   rD   r=   rC   r6   r7   r9   r8   rB   rR  rO  r@   rA   r>   r?   c                 C   s   t | dpd| d d kS )Npythonw?(2(\.\d)?)?import   r   textr+   r+   r,   analyse_text   s    
zPythonLexer.analyse_textN)/r?  r=  __qualname__r9  rC   aliases	filenames	mimetypesr-   r   r   r   ZAffixDocr   ZHashbangSingler   r   Wordr   r   	NamespaceDoubler	   r   r   BuiltinPseudor   FunctionMagicVariabler   FloatOctBinHexIntegerLongBacktick	Decoratorr   ClassEscapetokensr\  r+   r+   r+   r,   r      s8  
    -	  #









  >c                   @   s  e Zd ZdZdZddgZg ZddgZej	ej
B Zdejejf Zdd	 Zej Zed
ddefedddejfged< eddddejfdejjfeddddejfged< edddejjfged< edddejjfged< dejfdejfdej fdej!fdej"fdej#fged< g ed < d!ej$fd"e%feefged#< eejd$fged%< eej&d$fged&< d'e'e(ee(fd(ej)feej)fd)e'e(e%e(fe*d$ged*< d+e'e(ed$fd(ej)feej)fe*d$ged,< ee+j,ed-< ee+j-ed.< d/d0 Z.d1S )2r   zf
    For `Python <http://www.python.org>`_ source code (version 3.0).

    .. versionadded:: 0.10
    zPython 3python3Zpy3z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]+r&   z%|(\{{1,2})r(   r*   r+   r+   r,   r-     s    zPython3Lexer.innerstring_rules)rE   asyncawaitrF   rG   rH   rI   rJ   rK   rM   rN   rO   rP   rQ   rR   rT   nonlocalrU   rV   rW   rX   rY   rZ   r[   r\   r]   )TrueFalseNoner5   )Ar_   r`   ra   rb   re   rf   rh   ri   rk   rl   rm   ro   rp   rq   rr   rs   rt   ru   rv   rz   r{   formatr|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
memoryviewr   r   r   r   r   r   r   rS   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   z+(?<!\.)(self|Ellipsis|NotImplemented|cls)\b)Ar   r   r   r   BufferErrorBytesWarningr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ResourceWarningr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   BlockingIOErrorChildProcessErrorConnectionErrorBrokenPipeErrorConnectionAbortedErrorConnectionRefusedErrorConnectionResetErrorFileExistsErrorFileNotFoundErrorInterruptedErrorIsADirectoryErrorNotADirectoryErrorPermissionErrorProcessLookupErrorTimeoutErrorr:   )_r   r   
__aenter__	__aexit__	__aiter__r   	__anext__	__await____bool__	__bytes__r   r   r   r   r   r   r   __dir__r   r   r   r   r   r   
__format__r   r   r   r   r   r   r   r   r   r   r   __imatmul__r   r_   r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  __length_hint__r  r  
__matmul__r  r  r  r  r  r  __next__r  r  r  __prepare__r  r  r  r  r  r   r!  __rmatmul__r"  r#  r$  	__round__r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r;   )__annotations__r3  r4  r5  r6  r7  r8  r9  r:  r;  r<  __kwdefaults__r=  r>  r?  __objclass__r]  r@  rA  rB  r<   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)*rD   r=   @\w+@rC   rG  r6   r7   (\s+)(as)(\s+)z\.(\s*)(,)(\s*)r9   z(\s+)(import)\br8   rR  rO  c                 C   s
   t | dS )Nzpythonw?3(\.\d)?rY  rZ  r+   r+   r,   r\    s    zPython3Lexer.analyse_textN)/r?  r=  r]  r9  rC   r^  r_  r`  re	MULTILINEUNICODEflagsuniZ	xid_startZxid_continueZuni_namer-   r   ru  copyr   r   ZConstantr   rf  rg  r   rh  ri  rj  r   rk  rl  rm  rn  ro  rr  r   rs  r   r   rd  r   r   rb  re  r\  r+   r+   r+   r,   r      s   
	
 '


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 ``False``.

        .. versionadded:: 1.0
    zPython console sessionZpyconztext/x-python-doctestc                 K   s    t |dd| _tj| f| d S )Nrv  F)r   rv  r   r  )selfoptionsr+   r+   r,   r    s    zPythonConsoleLexer.__init__c              	   c   s*  | j r tf | j}tf | j}ntf | j}tf | j}d}g }d}d}d}t|D ]z}	|	 }
|
	dsx|
	drd}|
t|dtj|
d d fgf ||
dd  7 }qV|
 dkr|s|
t|dtjdfgf ||
dd  7 }qV|rt|||D ]}|V  qd}g }|
	ds6td	|
rHd
}|
}|	 }qV|
dkrf|	 tj|
fV  qV|r||
7 }|
	ds|
 dksd}||D ]\}}}|| ||fV  qd}qV|	 tj|
fV  qV|rt|||D ]}|V  q|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
 )rv  r   r  r   r   r   line_refinditergroup
startswithappendr   r   ZPromptrstripr
   get_tokens_unprocessedr  matchstartr   rs  stripZOutput)r  r[  ZpylexerZtblexerZcurcodeZ
insertionsZcurtbZtbindextbr  lineitemitvr+   r+   r,   r    sn    

 




z)PythonConsoleLexer.get_tokens_unprocessedN)	r?  r=  r]  r9  rC   r^  r`  r  r  r+   r+   r+   r,   r     s   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	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ZdS )r   z;
    For Python tracebacks.

    .. versionadded:: 0.7
    zPython TracebackZpytbz*.pytbztext/x-python-tracebackz^(\^C)?(Traceback.*\n)intb^(?=  File "[^"]+", line \d+)z^.*\n0^(  File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)%^(  File )("[^"]+")(, line )(\d+)(\n)^(    )(.+)(\n)^([ \t]*)(\.\.\.)(\n)^([^:]+)(: )(.+)(\n)rG  ^([a-zA-Z_]\w*)(:?\n)rU  r  N)r?  r=  r]  r9  rC   r^  r_  r`  r   r   r   	Tracebackr   r   rf  r   r   r   r   r   ru  r+   r+   r+   r,   r     sD   
 


 
 c                   @   s   e Zd ZdZdZdgZdgZdgZdefde	j
dfd	e	j
fd
e	j
fde	j
d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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ZdS )r   zd
    For Python 3.0 tracebacks, with support for chained exceptions.

    .. versionadded:: 1.0
    zPython 3.0 TracebackZpy3tbz*.py3tbztext/x-python3-tracebackr.   z'^Traceback \(most recent call last\):\nr  zH^During handling of the above exception, another exception occurred:\n\nzI^The above exception was the direct cause of the following exception:\n\nr  r  r  r  r  r  rG  r  r  N)r?  r=  r]  r9  rC   r^  r_  r`  r   r   r  r   r   rf  r   r   r   r   r   ru  r+   r+   r+   r,   r     sJ   



 
 c                !   @   sL  e Zd ZdZdZdddgZdddg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d0e
ed.d*fd1e
ed.d,fed2ed3ged4d5d6efd7ejfged8d9d5d:ejfd;ejjfed<d9d5d:ejfg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dDej"dEfgdFej#fdGefdHe	ej"edEfdIe	ej"eefdJedEfdKefdLedEfdMedEfdDejfdNefg
dDej$dEfgdOe	eeefdPej%fdQe	eeefe&dEgdRe	eedEfdSej%fe&dEgdTe
j'fgdUe
j(fdVe
fdWe
fdXe
fgde
fgdYe
dEfdZe
j'fed[gd\e
dEfd]e
j'fed[gd^e
dEfed[ed_gd`e
dEfed[ed_gdaZ)dbS )cr   z]
    For Pyrex and `Cython <http://cython.org>`_ source code.

    .. versionadded:: 1.1
    ZCythonZcythonZpyxZpyrexz*.pyxz*.pxdz*.pxiztext/x-cythonzapplication/x-cythonr.   z^(\s*)("""(?:.|\n)*?""")z^(\s*)('''(?:.|\n)*?''')r/   r0   r1   r2   r3   r4   z(<)([a-zA-Z0-9.?]+)(>)z!=|==|<<|>>|[-~+/*%=<>&^|.?]z(from)(\d+)(<=)(\s+)(<)(\d+)(:)r5   z(def|property)(\s+)r6   z(cp?def)(\s+)cdefz	(cdef)(:)z(class|struct)(\s+)r7   z(from)(\s+)r8   z(c?import)(\s+)r9   r:   r=   z(?:[rR]|[uU][rR]|[rR][uU])"""r>   z(?:[rR]|[uU][rR]|[rR][uU])'''r?   z(?:[rR]|[uU][rR]|[rR][uU])"r@   z(?:[rR]|[uU][rR]|[rR][uU])'rA   z[uU]?"""rB   z[uU]?'''z[uU]?"z[uU]?'rC   rD   )rE   rF   ZbyrG   ZctypedefrH   rI   rJ   rK   zexcept?rL   rM   rN   ZfusedZgilrO   rP   r   rQ   ZnogilrR   rS   rT   rU   rV   rW   rX   rZ   r[   r\   r]   z(DEF|IF|ELIF|ELSE)\b)Or_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   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   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   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&(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?z0\d+rC  rD  z\d+rE  r  rF  rG  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\brH  :z	(?=["\']).r  rJ  r  z(\s+)(c?import)\brK  rL  zP%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]r%   r&   r'   rM  rN  stringsrP  rQ  rS  nlrT  )rU  r5   r:   rD   r=   rC   r6   r  r7   r9   r8   rB   r  r  r@   rA   r>   r?   N)*r?  r=  r]  r9  rC   r^  r_  r`  r   r   r   ra  r   r   r   rc  r   Typer   ro  r   r   r	   r   ZPreprocrf  rg  r   rk  rl  rn  rp  rq  rr  rh  Reservedrs  rd  r   rt  r)   ru  r+   r+   r+   r,   r   :  s  

 &
  #


 
 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 <http://pyos.github.com/dg>`_,
    a functional and object-oriented programming language
    running on the CPython 3 VM.

    .. versionadded:: 1.6
    Zdgz*.dgz	text/x-dgz\s+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?)'''rB   r?   stringz(?i)(br|r?b?)"""r>   z(?i)(br|r?b?)'rA   z(?i)(br|r?b?)"r@   z`\w+'*`z\b(and|in|is|or|where)\bz[!$%&*+\-./:<-@\\^|~;,]+)rf   rh   ri   rl   rp   rr   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`   ra   rb   re   Zbindrk   rm   ro   rp   rq   rs   rt   Zdrop	dropwhileru   rv   Zexhaustrz   Zflipzfoldl1?r}  Zfstr}   r~   r   r   headr   r   Zinitr   r   r   r   ZiterateZlastr   r   r   r   r   r   r   r   r   r   rS   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  rL  r$   r%   r&   r'   r.   rM  rG  rP  rS  rT  )rU  rB   r  r@   rA   r>   r?   N)"r?  r=  r]  r9  rC   r^  r_  r`  r   r   rb  r   rm  rl  rn  rk  ro  r   r	   r   rc  r   r   rf  rg  r   r   r  r  r   r   rt  r)   ru  r+   r+   r+   r,   r     s    	 
9c                   @   s:   e Zd ZdZdZdgZg Zg ZedZ	dd Z
dd Zd	S )
r    z[
    A Python lexer recognizing Numerical Python builtins.

    .. versionadded:: 0.10
    ZNumPyZnumpy(  r`   Zabsolute
accumulateaddZalenra   ZallcloseZalltrueZalterdotZamaxZaminZanglerb   r  Zapply_along_axisZapply_over_axesZarangeZarccosZarccoshZarcsinZarcsinhZarctanZarctan2ZarctanhZargmaxZargminZargsortZargwhereZaroundZarrayZarray2stringZarray_equalZarray_equivZ
array_reprZarray_splitZ	array_strZ
arrayrangeZ
asanyarrayZasarrayZasarray_chkfiniteZascontiguousarrayZasfarrayZasfortranarrayZasmatrixZasscalarZastypeZ
atleast_1dZ
atleast_2dZ
atleast_3dZaverageZbartlettZ	base_reprZbetaZbinary_reprZbincountZbinomialZbitwise_andZbitwise_notZ
bitwise_orZbitwise_xorZblackmanZbmatZ	broadcastZbyte_boundsri   ZbyteswapZc_Zcan_castZceilZchooseZclipZcolumn_stackZcommon_typeZcompare_chararrayscompressZconcatenateZconj	conjugateZconvolver  ZcorrcoefZ	correlateZcosZcoshZcovZcrossZcumprodZ
cumproductZcumsumdeleteZ	deprecateZdiagZdiagflatZdiagonalZdiffZdigitizeZdispZdividedotZdsplitZdstackZdtypedumpdumpsZediff1demptyZ
empty_likeZequalZexpZexpand_dimsZexpm1extractZeyeZfabsZfastCopyAndTransposeZfftZfftfreqZfftshiftZfillZfinfoZfixZflatZflatnonzeroZflattenZfliplrZflipudZfloorZfloor_divideZfmodZfrexpZ
fromarraysZ
frombufferZfromfileZfromfunctionZfromiterZ
frompyfuncZ
fromstringZgenericZget_array_wrapZget_includeZget_numarray_includeZget_numpy_includeZget_printoptions	getbufferZ
getbufsizeZgeterrZ
geterrcallZ	geterrobjZgetfieldZgradientZgreaterZgreater_equalZgumbelZhammingZhanningZ	histogramZhistogram2dZhistogramddZhsplitZhstackZhypotZi0ZidentityZifftimagZ	index_expindicesinfinfoinnerinsertZint_asbufferZinterpZintersect1dZintersect1d_nuinvinvertZ	iscomplexZiscomplexobjZisfiniteZ	isfortranZisinfZisnanZisneginfZisposinfZisrealZ	isrealobjZisscalarZissctypeZissubclass_Z
issubdtypeZissubsctyper  ZitemsetiterableZix_ZkaiserZkronZldexpZ
left_shiftZlessZ
less_equalZlexsortZlinspaceloadloadsZloadtxtlogZlog10Zlog1pZlog2Zlogical_andZlogical_notZ
logical_orZlogical_xorZlogspaceZlstsqZmatZmatrixr   ZmaximumZmaximum_sctypeZmay_share_memoryZmeanZmedianZmeshgridZmgridr   ZminimumZmintypecodemodZmodfZmsortZmultiplynanZ
nan_to_numZ	nanargmaxZ	nanargminZnanmaxZnanminZnansumZndenumeratendimZndindexnegativeZnewaxisZ	newbufferZnewbyteorderZnonzeroZ	not_equalZ
obj2sctypeZogridZonesZ	ones_likeZouterZpermutationZ	piecewiseZpinvZpkgloadZplaceZpoissonZpolyZpoly1dZpolyaddZpolyderZpolydivZpolyfitZpolyintZpolymulZpolysubZpolyvalZpowerZprodproductZptpZputZputmaskZr_ZrandintZrandom_integersZrandom_sampleZranfZrankZravelrealZreal_if_closeZrecarrayZ
reciprocalr   Z	remainderrepeatZrequireZreshapeZresizeZ
restoredotZright_shiftZrintZrollZrollaxisrootsZrot90r   Zround_Z	row_stackZs_ZsampleZsavetxtZsctype2charZsearchsortedZseedZselectZset_numeric_opsZset_printoptionsZset_string_functionZ
setbufsizeZ	setdiff1dZseterrZ
seterrcallZ	seterrobjZsetfieldZsetflagsZsetmember1dZsetxor1dshapeZshow_configZshuffleZsignZsignbitZsinZsincZsinhsizer   ZsolveZsometruesortZsort_complexsourcesplitZsqrtZsquareZsqueezeZstandard_normalZstdsubtractr   ZsvdZswapaxesr  ZtanZtanhZ	tensordotZtestZtileZtofiletolistZtostringZtraceZ	transposeZtrapzZtriZtrilZ
trim_zerosZtriuZtrue_divideZtypeDicttypenameZuniformZunion1duniqueZunique1dZunravel_indexZunwrapZvandervarZvdotZ	vectorizeZviewZvonmisesZvsplitZvstackZweibullwhereZwhoZzerosZ
zeros_likec                 c   sJ   t | |D ]8\}}}|tkr8|| jkr8|tj|fV  q|||fV  qd S )N)r   r  r   EXTRA_KEYWORDSr   rg  )r  r[  indextokenvaluer+   r+   r,   r    s
    
z!NumPyLexer.get_tokens_unprocessedc                 C   s*   t | dsd| d d ko(d| kp(d| kS )NrV  rW  rX  zimport numpyzfrom numpy importrY  rZ  r+   r+   r,   r\    s
    
zNumPyLexer.analyse_textN)r?  r=  r]  r9  rC   r^  r`  r_  r   r  r  r\  r+   r+   r+   r,   r    P  s   C))r9  r  Zpygments.lexerr   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   Zpygmentsr   r  __all__ro   r  r   r   r   r   r   r   r   r    r+   r+   r+   r,   <module>   s0   
,4   
 Z  X'' 4c