ó
,ŗ]c        
   @  sĄ  d  d l  m Z d  d l Z d  d l m Z m Z m Z e rQ d  d l m Z n d  d l	 m Z e rņ d  d l
 Z
 d  d l	 m Z d   Z d  d l m Z d   Z d   Z d  d	 l m Z d
   Z e Z d  d l m Z e Z e Z e Z n d  d l Z d  d l m Z e j Z e j Z e j Z e j Z e j Z e j Z e j Z e j Z e j Z e j Z e j Z e rd d d  Z n  e r¶d d d d d d d d d d g
 Z n g  Z d S(   i’’’’(   t   unicode_literalsN(   t   PY2t   PY3t   exec_(   t   Mappingc         O  s   |  | |   S(   N(    (   t   ft   argst   kw(    (    s6   /usr/lib/python2.7/site-packages/past/builtins/misc.pyt   apply   s    (   t   strc         C  s   t  t |  f   S(   uU   
        Return a byte-string of one character with ordinal i; 0 <= i <= 256
        (   t   oldstrt   bytes(   t   i(    (    s6   /usr/lib/python2.7/site-packages/past/builtins/misc.pyt   chr   s    c         C  s   |  | k |  | k  S(   uf   
        cmp(x, y) -> integer

        Return negative if x<y, zero if x==y, positive if x>y.
        (    (   t   xt   y(    (    s6   /usr/lib/python2.7/site-packages/past/builtins/misc.pyt   cmp   s    (   t   internc         C  s   d t  j |   d S(   uU   oct(number) -> string

        Return the octal representation of an integer
        u   0i   (   t   builtinst   oct(   t   number(    (    s6   /usr/lib/python2.7/site-packages/past/builtins/misc.pyR   %   s    (   t   reloadc         C  sŌ   | d k r9 t j   d } | d j } | d j } n | d k rN | } n  t | t  sl t d   n  t | t  s t d   n  t |  d   } | j	   } Wd QXt
 | |  d  } t | | |  d S(   uļ   
        Read and execute a Python script from a file in the given namespaces.
        The globals and locals are dictionaries, defaulting to the current
        globals and locals. If only globals is given, locals defaults to it.
        i   i    u   globals must be a mappingu   locals must be a mappingu   rbNu   exec(   t   Nonet   inspectt   stackt	   f_globalst   f_localst
   isinstanceR   t	   TypeErrort   opent   readt   compileR   (   t   filenamet	   myglobalst   mylocalst   caller_framet   fint   sourcet   code(    (    s6   /usr/lib/python2.7/site-packages/past/builtins/misc.pyt   execfileB   s    	u   applyu   chru   cmpu   execfileu   internu	   raw_inputu   reloadu   unichru   unicodeu   xrange(    t
   __future__R    R   t   future.utilsR   R   R   t   collectionsR   t   collections.abcR   R   t   past.builtinsR	   R
   R   R   t   sysR   R   t   inputt	   raw_inputt   impR   t   unicodet   unichrt   ranget   xranget   __builtin__R'   R   t   __all__(    (    (    s6   /usr/lib/python2.7/site-packages/past/builtins/misc.pyt   <module>   sL   																