
T[Tc           @   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 j d  Z  d e f d     YZ! d
 e f d     YZ" d e f d     YZ# d	 e f d     YZ$ d e f d     YZ% d e f d     YZ& d e f d     YZ' d e! f d     YZ( d S(   s   
    pygments.lexers.python
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Python and related languages.

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iN(	   t   Lexert
   RegexLexert   includet   bygroupst   usingt   defaultt   wordst   combinedt   do_insertions(   t   get_bool_optt   shebang_matches(   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Numbert   Punctuationt   Generict   Othert   Error(   t	   unistringt   PythonLexert   PythonConsoleLexert   PythonTracebackLexert   Python3Lexert   Python3TracebackLexert   CythonLexert   DgLexert
   NumPyLexers   .*?
c        P   B   sr  e  Z d  Z d Z d d d g Z d d d d d	 d
 d g Z d d g Z i 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 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"  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 d2 6e d dJ dK e f g d 6e d d d dJ dK e j f d e j j f e d d d dJ dK e j f g d! 6d e j f d e j f d e j f d e j f d e j f d e j j f d e j f g d1 6d e	 j f g d" 6d e j  f d e f g d0 6d e j! d f g d 6d e j" d f g d 6d e f d e j f d e f d e j f e# d  g d  6d e f d e j d f d e j j d f d e j f e# d  g d 6d e	 j$ f g d, 6d e	 j% f d e	 f d e	 f d e	 f g d 6d e	 f g d 6d e	 d f d e	 j$ f e d  g d( 6d e	 d f d e	 j$ f e d  g d* 6d e	 d f e d  e d  g d$ 6d e	 d f e d  e d  g d& 6Z& d   Z' RS(   s<   
    For `Python <http://www.python.org>`_ source code.
    t   Pythont   pythont   pyt   sages   *.pys   *.pyws   *.sct
   SConstructt
   SConscripts   *.tacs   *.sages   text/x-pythons   application/x-pythons   \ns"   ^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")s"   ^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')s   [^\S\n]+s   #.*$s   []{}:(),;[]s   \\\ns   \\s   (in|is|and|or|not)\bs   !=|==|<<|>>|[-~+/*%=<>&^|.]t   keywordss   (def)((?:\s|\\\s)+)t   funcnames   (class)((?:\s|\\\s)+)t	   classnames   (from)((?:\s|\\\s)+)t
   fromimports   (import)((?:\s|\\\s)+)t   importt   builtinst   backticks   (?:[rR]|[uU][rR]|[rR][uU])"""t   tdqss   (?:[rR]|[uU][rR]|[rR][uU])'''t   tsqss   (?:[rR]|[uU][rR]|[rR][uU])"t   dqss   (?:[rR]|[uU][rR]|[rR][uU])'t   sqss   [uU]?"""t   stringescapes   [uU]?'''s   [uU]?"s   [uU]?'t   namet   numberst   roott   assertt   breakt   continuet   delt   elift   elset   exceptt   exect   finallyt   fort   globalt   ift   lambdat   passt   printt   raiset   returnt   tryt   whilet   yields
   yield fromt   ast   witht   suffixs   \bt
   __import__t   abst   allt   anyt   applyt
   basestringt   bint   boolt   buffert	   bytearrayt   bytest   callablet   chrt   classmethodt   cmpt   coercet   compilet   complext   delattrt   dictt   dirt   divmodt	   enumeratet   evalt   execfilet   exitt   filet   filtert   floatt	   frozensett   getattrt   globalst   hasattrt   hasht   hext   idt   inputt   intt   internt
   isinstancet
   issubclasst   itert   lent   listt   localst   longt   mapt   maxt   mint   nextt   objectt   octt   opent   ordt   powt   propertyt   ranget	   raw_inputt   reducet   reloadt   reprt   reversedt   roundt   sett   setattrt   slicet   sortedt   staticmethodt   strt   sumt   supert   tuplet   typet   unichrt   unicodet   varst   xranget   zipt   prefixs   (?<!\.)s7   (?<!\.)(self|None|Ellipsis|NotImplemented|False|True)\bt   ArithmeticErrort   AssertionErrort   AttributeErrort   BaseExceptiont   DeprecationWarningt   EOFErrort   EnvironmentErrort	   Exceptiont   FloatingPointErrort   FutureWarningt   GeneratorExitt   IOErrort   ImportErrort   ImportWarningt   IndentationErrort
   IndexErrort   KeyErrort   KeyboardInterruptt   LookupErrort   MemoryErrort	   NameErrort   NotImplementedt   NotImplementedErrort   OSErrort   OverflowErrort   OverflowWarningt   PendingDeprecationWarningt   ReferenceErrort   RuntimeErrort   RuntimeWarningt   StandardErrort   StopIterationt   SyntaxErrort   SyntaxWarningt   SystemErrort
   SystemExitt   TabErrort	   TypeErrort   UnboundLocalErrort   UnicodeDecodeErrort   UnicodeEncodeErrort   UnicodeErrort   UnicodeTranslateErrort   UnicodeWarningt   UserWarningt
   ValueErrort   VMSErrort   Warningt   WindowsErrort   ZeroDivisionErrors'   (\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?s   \d+[eE][+-]?[0-9]+j?s	   0[0-7]+j?s
   0[bB][01]+s   0[xX][a-fA-F0-9]+s   \d+Ls   \d+j?s   `.*?`s   @[\w.]+s   [a-zA-Z_]\w*s   #pops   (?:[ \t]|\\\n)+s   as\bt   ,s   [a-zA-Z_][\w.]*s   import\bs   None\bs   [a-zA-Z_.][\w.]*sY   \\([\\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})sI   %(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]s   [^\\\'"%\n]+s   [\'"\\]t   %t   stringst   nlt   "s   \\\\|\\"|\\\nt   's   \\\\|\\'|\\\ns   """s   '''c         C   s   t  |  d  p d |  d  k S(   Ns   pythonw?(2(\.\d)?)?s   import i  (   R
   (   t   text(    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyt   analyse_text   s    (   s   assertR5   R6   R7   R8   s   elseR:   s   execR<   R=   R>   R?   s   lambdaRA   s   printRC   RD   RE   RF   RG   s
   yield fromRH   RI   (N   s
   __import__s   abss   alls   anys   applys
   basestrings   bins   bools   buffers	   bytearrays   bytess   callables   chrs   classmethods   cmps   coerces   compiles   complexs   delattrs   dicts   dirs   divmods	   enumerates   evals   execfiles   exits   files   filters   floats	   frozensets   getattrs   globalss   hasattrs   hashs   hexs   ids   inputs   ints   interns
   isinstances
   issubclasss   iters   lens   lists   localss   longs   maps   maxs   mins   nexts   objects   octs   opens   ords   pows   propertys   ranges	   raw_inputs   reduces   reloads   reprs   reverseds   rounds   sets   setattrs   slices   sorteds   staticmethods   strs   sums   supers   tuples   types   unichrs   unicodes   varss   xranges   zip(2   s   ArithmeticErrors   AssertionErrors   AttributeErrors   BaseExceptions   DeprecationWarnings   EOFErrors   EnvironmentErrors	   Exceptions   FloatingPointErrors   FutureWarnings   GeneratorExits   IOErrors   ImportErrors   ImportWarnings   IndentationErrors
   IndexErrors   KeyErrors   KeyboardInterrupts   LookupErrors   MemoryErrors	   NameErrors   NotImplementeds   NotImplementedErrors   OSErrors   OverflowErrorR   s   PendingDeprecationWarnings   ReferenceErrors   RuntimeErrors   RuntimeWarnings   StandardErrors   StopIterations   SyntaxErrors   SyntaxWarnings   SystemErrors
   SystemExits   TabErrors	   TypeErrors   UnboundLocalErrors   UnicodeDecodeErrors   UnicodeEncodeErrors   UnicodeErrors   UnicodeTranslateErrors   UnicodeWarnings   UserWarnings
   ValueErrorR   s   WarningR   s   ZeroDivisionError((   t   __name__t
   __module__t   __doc__R1   t   aliasest	   filenamest	   mimetypesR   R   R   t   DocR   R   R   t   WordR   R   t	   NamespaceR   R   R   t   Builtint   PseudoR   R   t   Floatt   Octt   Bint   Hext   Integert   Longt   Backtickt	   Decoratort   Functiont   ClassR   t   Escapet   Interpolt   tokensR   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR      s   											             	             								c        C   B   s?  e  Z d  Z d Z d d g Z g  Z d d g Z e j e j	 BZ
 d e j e j f Z e j j   Z e d d  d! e f g e d" <e d dd de d  d! e j f df e j j f e d dd de d  d! e 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 g e d <g  e d <d e j 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 <d e& f d e& f d e& f g e d <d   Z' RS(   sf   
    For `Python <http://www.python.org>`_ source code (version 3.0).

    .. versionadded:: 0.10
    s   Python 3t   python3t   py3s   text/x-python3s   application/x-python3s	   [%s][%s]*R4   R5   R6   R7   R8   R9   R:   R<   R=   R>   R?   R@   RA   RC   t   nonlocalRD   RE   RF   RG   s
   yield fromRH   RI   t   Truet   Falset   NoneRJ   s   \bR%   RK   RL   RM   RN   RQ   RR   RT   RU   RW   RX   RY   R[   R\   R]   R^   R_   R`   Ra   Rb   Rf   Rg   t   formatRh   Ri   Rj   Rk   Rl   Rm   Rn   Ro   Rp   Rr   Rs   Rt   Ru   Rv   Rw   Ry   Rz   t
   memoryviewR{   R|   R}   R~   R   R   R   RB   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   s   (?<!\.)s'   (?<!\.)(self|Ellipsis|NotImplemented)\bR   R   R   R   t   BufferErrort   BytesWarningR   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   t   BlockingIOErrort   ChildProcessErrort   ConnectionErrort   BrokenPipeErrort   ConnectionAbortedErrort   ConnectionRefusedErrort   ConnectionResetErrort   FileExistsErrort   FileNotFoundErrort   InterruptedErrort   IsADirectoryErrort   NotADirectoryErrort   PermissionErrort   ProcessLookupErrort   TimeoutErrorR*   s%   (\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?s   0[oO][0-7]+s
   0[bB][01]+s   0[xX][a-fA-F0-9]+s   \d+R2   R+   s   @\w+R1   s   #popR&   R'   s   (\s+)(as)(\s+)s   \.s   (\s*)(,)(\s*)R)   s   (\s+)(import)\bR(   s   [^\\\'"%\n]+s   [\'"\\]R   R   c         C   s   t  |  d  S(   Ns   pythonw?3(\.\d)?(   R
   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR   -  s    (   s   asserts   breaks   continues   dels   elifs   elses   excepts   finallys   fors   globals   ifs   lambdas   passs   raiseR   s   returns   trys   whiles   yields
   yield froms   ass   withs   Trues   Falses   None(A   s
   __import__s   abss   alls   anys   bins   bools	   bytearrays   bytess   chrs   classmethods   cmps   compiles   complexs   delattrs   dicts   dirs   divmods	   enumerates   evals   filters   floats   formats	   frozensets   getattrs   globalss   hasattrs   hashs   hexs   ids   inputs   ints
   isinstances
   issubclasss   iters   lens   lists   localss   maps   maxs
   memoryviews   mins   nexts   objects   octs   opens   ords   pows   prints   propertys   ranges   reprs   reverseds   rounds   sets   setattrs   slices   sorteds   staticmethods   strs   sums   supers   tuples   types   varss   zip(@   s   ArithmeticErrors   AssertionErrors   AttributeErrors   BaseExceptions   BufferErrors   BytesWarnings   DeprecationWarnings   EOFErrors   EnvironmentErrors	   Exceptions   FloatingPointErrors   FutureWarnings   GeneratorExits   IOErrors   ImportErrors   ImportWarnings   IndentationErrors
   IndexErrors   KeyErrors   KeyboardInterrupts   LookupErrors   MemoryErrors	   NameErrors   NotImplementedErrors   OSErrors   OverflowErrors   PendingDeprecationWarnings   ReferenceErrors   RuntimeErrors   RuntimeWarnings   StopIterations   SyntaxErrors   SyntaxWarnings   SystemErrors
   SystemExits   TabErrors	   TypeErrors   UnboundLocalErrors   UnicodeDecodeErrors   UnicodeEncodeErrors   UnicodeErrors   UnicodeTranslateErrors   UnicodeWarnings   UserWarnings
   ValueErrors   VMSErrors   Warnings   WindowsErrors   ZeroDivisionErrorR   R   R   R   R   R   R   R   R   R   R   R  R  R  R  ((   R   R   R   R1   R   R   R   t   ret	   MULTILINEt   UNICODEt   flagst   unit	   xid_startt   xid_continuet   uni_nameR   R   t   copyR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR      s              	                  
		c           B   s8   e  Z d  Z d Z d g Z d g Z d   Z d   Z RS(   s  
    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
    s   Python console sessiont   pycons   text/x-python-doctestc         K   s)   t  | d t  |  _ t j |  |  d  S(   NR   (   R	   R   R   R    t   __init__(   t   selft   options(    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR  J  s    c         c   s  |  j  r* t |  j   } t |  j   } n t |  j   } t |  j   } d } g  } d } d } d } xt j |  D]}	 |	 j   }
 |
 j	 d  s |
 j	 d  r d } | j
 t |  d t j |
 d  f g f  | |
 d 7} qv |
 j   d k r;| r;| j
 t |  d t j d f g f  | |
 d 7} qv | rxx% t | | j |   D] } | VqZWd } g  } n  |
 j	 d  st j d	 |
  rd
 } |
 } |	 j   } qv |
 d k r|	 j   t j |
 f Vqv | rL| |
 7} |
 j	 d  p|
 j   d k scd } x5 | j |  D]! \ } } } | | | | f Vq!Wqcqv |	 j   t j |
 f Vqv W| rx( t | | j |   D] } | VqWn  | rx5 | j |  D]! \ } } } | | | | f VqWn  d  S(   Nt    i    u   >>> u   ... i   u   ...i   u"   Traceback (most recent call last):u     File "[^"]+", line \d+\n$i   s   KeyboardInterrupt
t    (   R   R   R  R   R   R   t   line_ret   finditert   groupt
   startswitht   appendRu   R   t   Promptt   rstripR   t   get_tokens_unprocessedR  t   matcht   startR   R   t   stript   Output(   R  R   t   pylexert   tblexert   curcodet
   insertionst   curtbt   tbindext   tbR  t   linet   itemt   it   tt   v(    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR  N  s`    			
!	(   R   R   R   R1   R   R   R  R  (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR   1  s   			c           B   s  e  Z d  Z d Z d g Z d g Z d g Z i d e j d f d e j d f d e	 f g d	 6d
 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 6Z RS(   s;   
    For Python tracebacks.

    .. versionadded:: 0.7
    s   Python Tracebackt   pytbs   *.pytbs   text/x-python-tracebacks'   ^Traceback \(most recent call last\):\nt   intbs   ^(?=  File "[^"]+", line \d+)s   ^.*\nR3   s0   ^(  File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)s%   ^(  File )("[^"]+")(, line )(\d+)(\n)s   ^(    )(.+)(\n)s   ^([ \t]*)(\.\.\.)(\n)s   ^([^:]+)(: )(.+)(\n)s   #pops   ^([a-zA-Z_]\w*)(:?\n)(   R   R   R   R1   R   R   R   R   t	   TracebackR   R   R   R   R   R   R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR     s,   			!c           B   s*  e  Z d  Z d Z d g Z d g Z d g Z i d e f d e j	 d f d e j	 f d	 e j	 f d
 e j	 d f g d 6d 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 6Z RS(   sd   
    For Python 3.0 tracebacks, with support for chained exceptions.

    .. versionadded:: 1.0
    s   Python 3.0 Tracebackt   py3tbs   *.py3tbs   text/x-python3-tracebacks   \ns'   ^Traceback \(most recent call last\):\nR-  sH   ^During handling of the above exception, another exception occurred:\n\nsI   ^The above exception was the direct cause of the following exception:\n\ns   ^(?=  File "[^"]+", line \d+)R3   s0   ^(  File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)s%   ^(  File )("[^"]+")(, line )(\d+)(\n)s   ^(    )(.+)(\n)s   ^([ \t]*)(\.\.\.)(\n)s   ^([^:]+)(: )(.+)(\n)s   #pops   ^([a-zA-Z_]\w*)(:?\n)(   R   R   R   R1   R   R   R   R   R   R.  R   R   R   R   R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR     s2   						!c        P   B   s!  e  Z d  Z d Z d d d g Z d d d g Z d d	 g Z i 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  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 d2 6e d dO dP e f dQ e j f g d 6e d d d dO dP e j f d e j j f e d d d dO dP e j f g d! 6d e j f d e j f d e j f d e j j f d e j f g d1 6d e	 j f g d" 6d e j  f d e f g d0 6d e j! d f g d 6d e j" f d e f d e e j! e  d f d e e j! e e  f d e d f d e f d e d f d e d f d e j f d e f g
 d 6d e j# d f g d 6d e e e e  f d e j$ f d e e e e  f e% d  g d  6d e e e  d f d e j$ f e% d  g d 6d e	 j& f g d, 6d e	 j' f d e	 f d e	 f d e	 f g d 6d
 e	 f g d 6d e	 d f d e	 j& f e d  g d( 6d e	 d f d e	 j& f e d  g d* 6d e	 d f e d  e d  g d$ 6d e	 d f e d  e d  g d& 6Z( RS(   s]   
    For Pyrex and `Cython <http://cython.org>`_ source code.

    .. versionadded:: 1.1
    t   Cythont   cythont   pyxt   pyrexs   *.pyxs   *.pxds   *.pxis   text/x-cythons   application/x-cythons   \ns   ^(\s*)("""(?:.|\n)*?""")s   ^(\s*)('''(?:.|\n)*?''')s   [^\S\n]+s   #.*$s   []{}:(),;[]s   \\\ns   \\s   (in|is|and|or|not)\bs   (<)([a-zA-Z0-9.?]+)(>)s   !=|==|<<|>>|[-~+/*%=<>&^|.?]s   (from)(\d+)(<=)(\s+)(<)(\d+)(:)R%   s   (def|property)(\s+)R&   s   (cp?def)(\s+)t   cdefs   (class|struct)(\s+)R'   s   (from)(\s+)R(   s   (c?import)(\s+)R)   R*   R+   s   (?:[rR]|[uU][rR]|[rR][uU])"""R,   s   (?:[rR]|[uU][rR]|[rR][uU])'''R-   s   (?:[rR]|[uU][rR]|[rR][uU])"R.   s   (?:[rR]|[uU][rR]|[rR][uU])'R/   s   [uU]?"""R0   s   [uU]?'''s   [uU]?"s   [uU]?'R1   R2   R3   R4   R5   t   byR6   t   ctypedefR7   R8   R9   R:   s   except?R;   R<   R=   t   gilR>   R?   R   R@   t   nogilRA   RB   RC   RD   RE   RF   RG   RH   RI   RJ   s   \bs   (DEF|IF|ELIF|ELSE)\bRK   RL   RM   RN   RO   RP   RQ   RR   RS   RT   RU   RV   RW   RX   RY   RZ   R[   R\   R]   R^   R_   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   s   (?<!\.)s<   (?<!\.)(self|None|Ellipsis|NotImplemented|False|True|NULL)\bR   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   s&   (\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?s   0\d+s   0[xX][a-fA-F0-9]+s   \d+Ls   \d+s   `.*?`s   @\w+s   [a-zA-Z_]\w*s   #pops%   (public|readonly|extern|api|inline)\bs   (struct|enum|union|class)\bs   ([a-zA-Z_]\w*)(\s*)(?=[(:#=]|$)s   ([a-zA-Z_]\w*)(\s*)(,)s   from\bs   as\bt   :s	   (?=["\'])t   .s   (\s+)(as)(\s+)s   [a-zA-Z_][\w.]*s   (\s*)(,)(\s*)s   (\s+)(c?import)\bs   [a-zA-Z_.][\w.]*sY   \\([\\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})sR   %(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]s   [^\\\'"%\n]+s   [\'"\\]R   R   R   R   s   \\\\|\\"|\\\nR   s   \\\\|\\'|\\\ns   """s   '''(   s   asserts   breakR5  s   continueR6  s   dels   elifs   elses   excepts   except?s   execs   finallys   forR7  s   globals   ifs   includes   lambdaR8  s   passs   prints   raises   returns   trys   whiles   yields   ass   with(N   s
   __import__s   abss   alls   anys   applys
   basestrings   bins   bools   buffers	   bytearrays   bytess   callables   chrs   classmethods   cmps   coerces   compiles   complexs   delattrs   dicts   dirs   divmods	   enumerates   evals   execfiles   exits   files   filters   floats	   frozensets   getattrs   globalss   hasattrs   hashs   hexs   ids   inputs   ints   interns
   isinstances
   issubclasss   iters   lens   lists   localss   longs   maps   maxs   mins   nexts   objects   octs   opens   ords   pows   propertys   ranges	   raw_inputs   reduces   reloads   reprs   reverseds   rounds   sets   setattrs   slices   sorteds   staticmethods   strs   sums   supers   tuples   types   unichrs   unicodes   varss   xranges   zip(0   s   ArithmeticErrors   AssertionErrors   AttributeErrors   BaseExceptions   DeprecationWarnings   EOFErrors   EnvironmentErrors	   Exceptions   FloatingPointErrors   FutureWarnings   GeneratorExits   IOErrors   ImportErrors   ImportWarnings   IndentationErrors
   IndexErrors   KeyErrors   KeyboardInterrupts   LookupErrors   MemoryErrors	   NameErrors   NotImplementeds   NotImplementedErrors   OSErrors   OverflowErrors   OverflowWarnings   PendingDeprecationWarnings   ReferenceErrors   RuntimeErrors   RuntimeWarnings   StandardErrors   StopIterations   SyntaxErrors   SyntaxWarnings   SystemErrors
   SystemExits   TabErrors	   TypeErrors   UnboundLocalErrors   UnicodeDecodeErrors   UnicodeEncodeErrors   UnicodeErrors   UnicodeTranslateErrors   UnicodeWarnings   UserWarnings
   ValueErrors   Warnings   ZeroDivisionError()   R   R   R   R1   R   R   R   R   R   R   R   R   R   R   R   R   t   TypeR   R   R   R   R   R   t   PreprocR   R   R   R   R   R   R   R   R   R   t   ReservedR   R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR     s   											              	            							c        O   B   sL  e  Z d  Z d Z d g Z d g Z d g Z i 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 d2 d3 d4 d5 e j f e d d2 d3 d4 d5 e j f dr e j j f ds e j f dt e j f du e j f dv e f dw e j f dx e f dy e f dz e f g d{ 6d| e j f g d 6d} e j f d~ e f d e f d e f d e f g d 6d e d f g d 6d e d f g d 6d e d f g d 6d e d f g d 6Z  RS(   s   
    Lexer for `dg <http://pyos.github.com/dg>`_,
    a functional and object-oriented programming language
    running on the CPython 3 VM.

    .. versionadded:: 1.6
    t   dgs   *.dgs	   text/x-dgs   \s+s   #.*?$s   (?i)0b[01]+s   (?i)0o[0-7]+s   (?i)0x[0-9a-f]+s(   (?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?s   (?i)[+-]?[0-9]+e[+-]?\d+j?s   (?i)[+-]?[0-9]+j?s   (?i)(br|r?b?)'''R0   R-   t   strings   (?i)(br|r?b?)"""R,   s   (?i)(br|r?b?)'R/   s   (?i)(br|r?b?)"R.   s   `\w+'*`s   \b(and|in|is|or|where)\bs   [!$%&*+\-./:<-@\\^|~;,]+RR   RT   RU   RX   R\   R^   s   dict'Rg   Rh   Rp   Rv   s   list'R   R}   R   R   R   s   set'R   R   R   R   R   s   tuple'R   R   s   (?<!\.)RJ   s
   (?![\'\w])RK   RL   RM   RN   RQ   t   bindRW   RY   R[   R]   R_   R`   t   dropt	   dropwhileRa   Rb   t   exhaustRf   t   flips   foldl1?R   t   fstRi   Rj   Rk   Rl   t   headRm   Rn   t   initRo   Rr   Rs   Rt   t   iteratet   lastRu   Rw   Ry   Rz   R{   R|   R~   R   R   R   RB   R   R   R   R   s   scanl1?t   sndR   R   t   tailt   taket	   takewhileR   R   s>   (?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])s3   (?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])sT   (?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|SystemExit)(?!['\w])s_   (?<![\w.])(except|finally|for|if|import|not|otherwise|raise|subclass|while|with|yield)(?!['\w])s   [A-Z_]+'*(?!['\w])s   [A-Z]\w+'*(?!['\w])s   \w+'*s   [()]R:  R3   sY   \\([\\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})sI   %(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[diouxXeEfFgGcrs%]s   [^\\\'"%\n]+s   [\'"\\]R   s   \nR   s   #popR   s   """s   '''(   s   bools	   bytearrays   bytess   classmethods   complexs   dicts   dict's   floats	   frozensets   ints   lists   list's
   memoryviews   objects   propertys   ranges   sets   set's   slices   staticmethods   strs   supers   tuples   tuple's   type(=   s
   __import__s   abss   alls   anys   binR@  s   chrs   cmps   compiles   complexs   delattrs   dirs   divmodRA  RB  s	   enumerates   evalRC  s   filterRD  s   foldl1?s   formatRE  s   getattrs   globalss   hasattrs   hashs   heads   hexs   idRG  s   inputs
   isinstances
   issubclasss   iterRH  RI  s   lens   localss   maps   maxs   mins   nexts   octs   opens   ords   pows   prints   reprs   reverseds   rounds   setattrs   scanl1?RJ  s   sorteds   sums   tailRL  RM  s   varss   zip(!   R   R   R   R1   R   R   R   R   R   t   SingleR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R=  R;  R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR     s|   						   	       											c          B   sG   e  Z d  Z d Z d g Z g  Z g  Z e d Z d  Z	 d  Z
 RS(  s[   
    A Python lexer recognizing Numerical Python builtins.

    .. versionadded:: 0.10
    t   NumPyt   numpyRL   t   absolutet
   accumulatet   addt   alenRM   t   allcloset   alltruet   alterdott   amaxt   amint   angleRN   R  t   apply_along_axist   apply_over_axest   aranget   arccost   arccosht   arcsint   arcsinht   arctant   arctan2t   arctanht   argmaxt   argmint   argsortt   argwheret   aroundt   arrayt   array2stringt   array_equalt   array_equivt
   array_reprt   array_splitt	   array_strt
   arrayranget
   asanyarrayt   asarrayt   asarray_chkfinitet   ascontiguousarrayt   asfarrayt   asfortranarrayt   asmatrixt   asscalart   astypet
   atleast_1dt
   atleast_2dt
   atleast_3dt   averaget   bartlettt	   base_reprt   betat   binary_reprt   bincountt   binomialt   bitwise_andt   bitwise_nott
   bitwise_ort   bitwise_xort   blackmant   bmatt	   broadcastt   byte_boundsRU   t   byteswapt   c_t   can_castt   ceilt   chooset   clipt   column_stackt   common_typet   compare_chararrayst   compresst   concatenatet   conjt	   conjugatet   convolveR  t   corrcoeft	   correlatet   cost   cosht   covt   crosst   cumprodt
   cumproductt   cumsumt   deletet	   deprecatet   diagt   diagflatt   diagonalt   difft   digitizet   dispt   dividet   dott   dsplitt   dstackt   dtypet   dumpt   dumpst   ediff1dt   emptyt
   empty_liket   equalt   expt   expand_dimst   expm1t   extractt   eyet   fabst   fastCopyAndTransposet   fftt   fftfreqt   fftshiftt   fillt   finfot   fixt   flatt   flatnonzerot   flattent   fliplrt   flipudt   floort   floor_dividet   fmodt   frexpt
   fromarrayst
   frombuffert   fromfilet   fromfunctiont   fromitert
   frompyfunct
   fromstringt   generict   get_array_wrapt   get_includet   get_numarray_includet   get_numpy_includet   get_printoptionst	   getbuffert
   getbufsizet   geterrt
   geterrcallt	   geterrobjt   getfieldt   gradientt   greatert   greater_equalt   gumbelt   hammingt   hanningt	   histogramt   histogram2dt   histogramddt   hsplitt   hstackt   hypott   i0t   identityt   ifftt   imagt	   index_expt   indicest   inft   infot   innert   insertt   int_asbuffert   interpt   intersect1dt   intersect1d_nut   invt   invertt	   iscomplext   iscomplexobjt   isfinitet	   isfortrant   isinft   isnant   isneginft   isposinft   isrealt	   isrealobjt   isscalart   issctypet   issubclass_t
   issubdtypet   issubsctypeR(  t   itemsett   iterablet   ix_t   kaisert   kront   ldexpt
   left_shiftt   lesst
   less_equalt   lexsortt   linspacet   loadt   loadst   loadtxtt   logt   log10t   log1pt   log2t   logical_andt   logical_nott
   logical_ort   logical_xort   logspacet   lstsqt   matt   matrixRz   t   maximumt   maximum_sctypet   may_share_memoryt   meant   mediant   meshgridt   mgridR{   t   minimumt   mintypecodet   modt   modft   msortt   multiplyt   nant
   nan_to_numt	   nanargmaxt	   nanargmint   nanmaxt   nanmint   nansumt   ndenumeratet   ndimt   ndindext   negativet   newaxist	   newbuffert   newbyteordert   nonzerot	   not_equalt
   obj2sctypet   ogridt   onest	   ones_liket   outert   permutationt	   piecewiset   pinvt   pkgloadt   placet   poissont   polyt   poly1dt   polyaddt   polydert   polydivt   polyfitt   polyintt   polymult   polysubt   polyvalt   powert   prodt   productt   ptpt   putt   putmaskt   r_t   randintt   random_integerst   random_samplet   ranft   rankt   ravelt   realt   real_if_closet   recarrayt
   reciprocalR   t	   remaindert   repeatt   requiret   reshapet   resizet
   restoredott   right_shiftt   rintt   rollt   rollaxist   rootst   rot90R   t   round_t	   row_stackt   s_t   samplet   savetxtt   sctype2chart   searchsortedt   seedt   selectt   set_numeric_opst   set_printoptionst   set_string_functiont
   setbufsizet	   setdiff1dt   seterrt
   seterrcallt	   seterrobjt   setfieldt   setflagst   setmember1dt   setxor1dt   shapet   show_configt   shufflet   signt   signbitt   sint   sinct   sinht   sizeR   t   solvet   sometruet   sortt   sort_complext   sourcet   splitt   sqrtt   squaret   squeezet   standard_normalt   stdt   subtractR   t   svdt   swapaxesRL  t   tant   tanht	   tensordott   testt   tilet   tofilet   tolistt   tostringt   tracet	   transposet   trapzt   trit   trilt
   trim_zerost   triut   true_dividet   typeDictt   typenamet   uniformt   union1dt   uniquet   unique1dt   unravel_indext   unwrapt   vandert   vart   vdott	   vectorizet   viewt   vonmisest   vsplitt   vstackt   weibullt   wheret   whot   zerost
   zeros_likec         c   sg   x` t  j |  |  D]L \ } } } | t k rQ | |  j k rQ | t j | f Vq | | | f Vq Wd  S(   N(   R   R  R   t   EXTRA_KEYWORDSR   R   (   R  R   t   indext   tokent   value(    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR  6  s
    c         C   s5   t  |  d  s d |  d  k o4 d |  k p4 d |  k S(   Ns   pythonw?(2(\.\d)?)?s   import i  s   import numpys   from numpy import(   R
   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR   >  s    (  s   absRQ  RR  s   addRT  s   allRU  RV  RW  RX  RY  RZ  s   anys   appendR[  R\  R]  R^  R_  R`  Ra  Rb  Rc  Rd  Re  Rf  Rg  Rh  Ri  s   arrayRk  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  s   bytesR  R  R  R  R  R  R  R  R  R  R  R  s	   conjugateR  s   copyR  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  s   dotR  R  R  s   dumps   dumpsR  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  R  R  R  R  R  R  R  R  R  R  R  s   imagR  s   indicesR  s   infoR  s   insertR  R  R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  R  R  R	  R
  s   itemR  s   iterableR  R  R  R  R  R  R  R  R  s   loads   loadsR  s   logR  R  R  R  R  R  R   R!  R"  R#  R$  s   maxR%  R&  R'  R(  R)  R*  R+  s   minR,  R-  s   modR/  R0  R1  R2  R3  R4  R5  R6  R7  R8  R9  s   ndimR;  R<  R=  R>  R?  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`  Ra  Rb  Rc  s   realRe  Rf  Rg  s   reduceRh  s   repeatRj  Rk  Rl  Rm  Rn  Ro  Rp  Rq  Rr  Rs  s   roundRt  Ru  Rv  Rw  Rx  Ry  Rz  R{  R|  R}  R~  R  R  R  R  R  R  R  R  R  R  s   shapeR  R  R  R  R  R  R  s   sizes   sliceR  R  s   sortR  s   sources   splitR  R  R  R  R  R  s   sumR  R  s   takeR  R  R  R  R  R  s   tolistR  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  s   varR  R  R  R  R  R  R  R  R  R  R  (   R   R   R   R1   R   R   R   R   R  R  R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyR     s   	                                                               		()   R   R  t   pygments.lexerR    R   R   R   R   R   R   R   R   t   pygments.utilR	   R
   t   pygments.tokenR   R   R   R   R   R   R   R   R   R   R   t   pygmentsR   R	  t   __all__R[   R  R   R   R   R   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/pygments/lexers/python.pyt   <module>
   s"   @L		lW%'a