
NWc           @@  s  d  d l  m Z d d l m Z m Z d d l m Z d d l m Z m Z m	 Z	 d d l m
 Z
 d d l m Z m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d   Z d Z d Z d Z d Z d Z  d Z! d Z" d Z# d Z$ d Z% d  Z& d! Z' i e" d" 6e# d# 6e$ d$ 6e% d% 6e& d& 6e' d' 6Z( i d( d" 6d) d# 6d* d$ 6d+ d% 6d, d& 6d- d' 6Z) d. Z* d/ Z+ d0 Z, d1 Z- d2 Z. d3   Z/ e0 e1 d4  Z2 e0 e0 d5  Z3 d6   Z4 d7   Z5 d8   Z6 d  d9  Z7 d: e j8 f d;     YZ9 d<   Z: d=   Z; d>   Z< d?   Z= d@   Z> dA   Z? dB e@ f dC     YZA dD eA f dE     YZB dF eA f dG     YZC dH   ZD dI   ZE dJ   ZF dK   ZG dL   ZH dM   ZI i dp dN 6dq d& 6dr dO 6ds dP 6dt dQ 6du dR 6ZJ dS   ZK dT   ZL dU   ZM dV   ZN do dW  ZP do dX  ZQ dY   ZR i e- dZ 6e
 jS d[ 6e. d\ 6e* d] 6ZT eQ d^ d_ d` da eT db g  ZU eQ dc eT d_ d` ZV eQ dd da eW eT de e
 jS db eU e jX eV g ZY eQ df  ZZ eP dg db e j[ g Z\ eQ dh eT  Z] eQ di eT  Z^ eQ dj eT db g  Z_ eP dk da eT db e j`   e ja e jb eY e] e^ e_ e jc g Zd dv Ze eU jf jg ed  e_ jf jg ed  do S(w   i    (   t   absolute_importi   (   t   CompileErrort   error(   t	   ExprNodes(   t   IntNodet   NameNodet   AttributeNode(   t   Options(   t   UtilityCodet   TempitaUtilityCode(   t   CythonUtilityCode(   t   Buffer(   t
   PyrexTypes(   t
   ModuleNodes   Start must not be given.s3   Axis specification only allowed in the 'step' slot.s.   Step must be omitted, 1, or a valid specifier.s>   Cannot specify an array that is both C and Fortran contiguous.s   Invalid axis specification.s+   Variable was not cimported from cython.views=   no expressions allowed in axis spec, only names and literals.s<   Invalid axis specification for a C/Fortran contiguous array.sd   Cannot check if memoryview %s is initialized without the GIL, consider using initializedcheck(False)c          G@  s   d d j  |   S(   Ns   (%s)t   |(   t   join(   t   flags(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   concat_flags   s    t   PyBUF_FORMATs4   (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE)s4   (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE)s6   (PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE)t
   PyBUF_FULLt   PyBUF_RECORDSt   __Pyx_MEMVIEW_DIRECTt   __Pyx_MEMVIEW_PTRt   __Pyx_MEMVIEW_FULLt   __Pyx_MEMVIEW_CONTIGt   __Pyx_MEMVIEW_STRIDEDt   __Pyx_MEMVIEW_FOLLOWt   directt   ptrt   fullt   contigt   stridedt   followt   dt   pt   ft   ct   st   _s   { 0, 0, { 0 }, { 0 }, { 0 } }u
   memoryviewt   __pyx_memoryview_typet   __pyx_memoryview_obju   __Pyx_memviewslicec         C@  s&   | j  d |   | j  d |   d  S(   Ns   %s.data = NULL;s   %s.memview = NULL;(   t   putln(   t   mv_cnamet   code(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   put_init_entryG   s    c   	   
   C@  s   | j  j s t  | j   p' | j   } | r? | j   } n8 | j j | d t } | j	 d | | j
 |  f  t |  | | | | d | d | | s | j j |  n  d S(   sE   We can avoid decreffing the lhs if we know it is the first assignmentt
   manage_refs   %s = %s;t   have_gilt   first_assignmentN(   t   typet   is_memoryviewslicet   AssertionErrort   result_in_tempt	   is_simplet   resultt	   funcstatet   allocate_tempt   FalseR)   t	   result_ast   put_assign_to_memviewslicet   release_temp(	   t	   lhs_cnamet   lhs_typet   lhs_post   rhsR+   R.   R/   t
   pretty_rhst   rhstmp(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   put_acquire_memoryviewsliceP   s     c         C@  sS   | s | j  |  d | n  | j   s8 | j |  n  | j d |  | f  d  S(   NR.   s   %s = %s;(   t   put_xdecref_memoryviewsliceR3   t   make_owned_memoryviewsliceR)   (   R<   R?   t	   rhs_cnamet   memviewslicetypeR+   R.   R/   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR:   e   s
    c         C@  s\   t  |   \ } } | r t S| r& t St |    \ } } d | k sP d | k rT t St Sd  S(   NR   R   (   t   is_cf_contigt   memview_c_contiguoust   memview_f_contiguoust   zipt   memview_full_accesst   memview_strided_access(   t   specst   is_c_contigt   is_f_contigt   accesst   packing(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_buf_flagsp   s    c         C@  s0   d g | } | j  |  j  t j |  j |  S(   NR   R   (   s   directs   strided(   t   extendt   axesR   t   MemoryViewSliceTypet   dtype(   t   memoryviewtypet   nRT   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   insert_newaxes   s    c         C@  sR   t  |  j | j  } |  j | j k  r; t |  |  | f S|  t | |  f Sd  S(   N(   t   abst   ndimRY   (   t   srct   dstRX   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   broadcast_types   s    c         C@  s   |  j  r |  j j r t S|  t j k r, t S|  j rr |  j d k rr x' |  j j	 D] } t
 | j  sQ t SqQ Wt S|  j p |  j r | d k  r t
 |  j | d  p |  j p |  j p |  j p |  j o t
 |  j  S(   s   
    Return whether type dtype can be used as the base type of a
    memoryview slice.

    We support structs, numeric types and objects
    t   structi   i   (   t
   is_complext	   real_typet   is_intR8   R   t   c_bint_typet	   is_structt   kindt   scopet   var_entriest   valid_memslice_dtypeR0   t   Truet   is_errort   is_arrayt	   base_typet
   is_numerict   is_pyobjectt   is_fusedt
   is_typedeft   typedef_base_type(   RV   t   it   member(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyRh      s     				t   MemoryViewSliceBufferEntryc           B@  sP   e  Z d  Z d   Z d   Z d   Z d   Z d   Z e d  Z	 d   Z
 RS(   s   
    May be used during code generation time to be queried for
    shape/strides/suboffsets attributes, or to perform indexing or slicing.
    c         C@  s`   | |  _  | j |  _ | j |  _ d |  j |  _ |  j  j j } t j |  |  _ |  j   d  S(   Ns   %s.data(	   t   entryR0   t   cnamet   buf_ptrRV   R   t   CPtrTypet   buf_ptr_typet   init_attributes(   t   selfRu   RV   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   __init__   s    	c         C@  s   |  j  d  S(   Ns   %s.suboffsets[%d](   t   _for_all_ndim(   R{   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_buf_suboffsetvars   s    c         C@  s   |  j  d  S(   Ns   %s.strides[%d](   R}   (   R{   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_buf_stridevars   s    c         C@  s   |  j  d  S(   Ns   %s.shape[%d](   R}   (   R{   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_buf_shapevars   s    c         C@  sQ   g  t  |  j j  D]( \ } \ } } | | | | | f ^ q } |  j | |  S(   N(   t	   enumerateR0   RT   t   _generate_buffer_lookup_code(   R{   R+   t   index_cnamest   dimRP   RQ   RT   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   generate_buffer_lookup_code   s    >c         C@  s~  |  j  } |  j j j   } xH| D]@\ } } } }	 d |  j | f }
 d |  j | f } d |  j | f } t | |	  } | d k r | j j t  d | | | | f } n | d k r d | | | f } d	 | | f } no | d
 k rd | | | f } nM | d k r'd | | | f } n+ | d k s?t	 |   d | | | f } d | | f } q" W| rzd | | f S| S(   sl   
        Generate a single expression that indexes the memory view slice
        in each dimension.
        s   %s.shape[%d]s   %s.strides[%d]s   %s.suboffsets[%d]t   generict   generic_contiguouss-   __pyx_memviewslice_index_full(%s, %s, %s, %s)t   indirects   (%s + %s * %s)s   (*((char **) %s) + %s)t   indirect_contiguouss   (*((char **) %s + %s) + %s)R   t
   contiguouss   ((char *) (((%s *) %s) + %s))s   ( /* dim=%d */ %s )s   ((%s *) %s)(   s   genericR   (
   Rw   R0   RV   t   empty_declaration_codeRv   t   get_memoryview_flagt   globalstatet   use_utility_codet   memviewslice_index_helpersR2   (   R{   R+   RT   t   cast_resultt   bufpt	   type_declR   t   indexRP   RQ   t   shapet   stridet	   suboffsett   flag(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR      s0    	c      	   @  s  |  j  }   j d t      j d t      j |  t d   |  j j D  } g      f d   }	 d }
 d } x| D]} | j r x: d d d  g D]) \ } }   j d | | | | f  q W| d 7} q n  |
 d 7}
 |  j j |
 \ } }   j | j	  } t
 | t j  rt t    } xU d j   D]G } t | |  } | j } | d | <| r~| j   n d | | <qAW| d p| d p| d s| | d <d } n d } | d 7} n~ | j   } | d k } | r| d k } | d k rt | j	 d  Sn  t t   d t | d  d t | d  } d } t j | d d | \ } }   j |  q W r  j j  d  n  d S(!   s  
        Slice a memoryviewslice.

        indices     - list of index nodes. If not a SliceNode, or NoneNode,
                      then it must be coercible to Py_ssize_t

        Simply call __pyx_memoryview_slice_memviewslice with the right
        arguments, unless the dimension is omitted or a bare ':', in which
        case we copy over the shape/strides/suboffsets attributes directly
        for that dimension.
        s   %(dst)s.data = %(src)s.data;s"   %(dst)s.memview = %(src)s.memview;c         s@  s!   |  ] \ } } | d  k Vq d S(   R   N(    (   t   .0RP   RQ   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pys	   <genexpr>  s    c          @  sJ    sB   j  j t j d t }    j d |    j |   n   d S(   NR-   s   %s = -1;i    (   R6   R7   R   t
   c_int_typeR8   R)   t   append(   t   suboffset_dim(   R+   t   suboffset_dim_temp(    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_suboffset_dim  s
    ii    R   i   t   stridest
   suboffsetss   %s.%s[%d] = %d;s   start stop stept   have_t   0t
   have_startt	   have_stopt	   have_stepRP   t   SimpleSlicet
   ToughSliceR   R   s7   All preceding dimensions must be indexed and not slicedt
   wraparoundt   boundscheckt
   SliceIndexs   MemoryView_C.ct   contextN(   s   shapei   (   s   stridesi    (   s
   suboffsetsi(   Rv   R)   t   localst   put_incref_memoryviewslicet   allR0   RT   t   is_nonet
   error_gotot   post
   isinstanceR   t	   SliceNodet   dictt   splitt   getattrR5   R   t   intR	   t   load_as_stringt   putR6   R;   (   R{   R+   t   indicesR]   R.   t   have_slicest
   directivesR\   t   all_dimensions_directR   R   t   new_ndimR   t   attribt   valueRP   RQ   R   R!   R%   t   idxt   have_idxt	   util_nameR   R   R&   t   impl(    (   R+   R   s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   generate_buffer_slice_code   sZ    		!

 
		
	(   t   __name__t
   __module__t   __doc__R|   R~   R   R   R   Ri   R   R   (    (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyRt      s   					.c         C@  s.   t  j |   } t  j |  d | d | d | S(   Nt   startt   stopt   step(   R   t   NoneNodeR   (   R   t   none(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   empty_sliceS  s    c         C@  sK  g  } t  } t  } g  |  D] } | j r | ^ q } t |   t |  } x |  D] } t | t j  r t } t | j  }	 | r | j	 |	  q | | d }
 | j
 |	 g |
  t } qQ | p | j p | j } | j	 |  qQ Wt |  t |  } | | k  r>t } | | }
 | j
 t |  d j  g |
  n  | | | f S(   Ni   i(   R8   R   t   lenR   R   t   EllipsisNodeRi   R   R   R   RS   t   is_slice(   R   R[   R5   t   seen_ellipsisR   t   newaxist   newaxest	   n_indicesR   t
   full_slicet   nslicest   result_length(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   unellipsifyY  s,    "	
$c         C@  s   |  d k r | d k r d S|  d k r8 | d k r8 d S|  d k rT | d k rT d S|  d k rp | d k rp d	 S|  d
 k r | d k r d S|  | f d k s t  |  | f   d Sd  S(   NR   R   R    R   R   R   R   R   R   R   R   (   s   strideds   follow(   s   strideds   follow(   s   strideds   follow(   s   directs   contig(   R2   (   RP   RQ   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR   y  s    $c         C@  s   d |  | f S(   Ns!   __pyx_memviewslice_is_%s_contig%d(    (   t   c_or_fR[   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_is_contig_func_name  s    c         C@  sO   t  t d | } |  r3 t d | d t g } n t d | d t g } | S(   NR[   t   MemviewSliceIsCContigt   requirest   MemviewSliceIsFContig(   R   R   t   load_memview_c_utilityt   is_contig_utility(   t   c_contigR[   t   Ct   utility(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_is_contig_utility  s    c         C@  s<   |  j  s |  j r% t |  | | |  St |  | | |  Sd  S(   N(   RN   RO   t   ContigSliceItert   StridedSliceIter(   t
   slice_typet   slice_resultR[   R+   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt
   slice_iter  s    t	   SliceIterc           B@  s   e  Z d    Z RS(   c         C@  s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   R   R   R+   R[   (   R{   R   R   R[   R+   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR|     s    			(   R   R   R|   (    (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR     s   R   c           B@  s   e  Z d    Z d   Z RS(   c         @  s     j  } | j     j j j   } d j   f d   t   j  D  } | j d |  | j d  | j d | |   j	 f  | j d  d S(   Ns    * c         3@  s"   |  ] } d    j  | f Vq d S(   s   %s.shape[%d]N(   R   (   R   Rr   (   R{   (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pys	   <genexpr>  s   s"   Py_ssize_t __pyx_temp_extent = %s;s   Py_ssize_t __pyx_temp_idx;s(   %s *__pyx_temp_pointer = (%s *) %s.data;sP   for (__pyx_temp_idx = 0; __pyx_temp_idx < __pyx_temp_extent; __pyx_temp_idx++) {t   __pyx_temp_pointer(
   R+   t   begin_blockR   RV   R   R   t   rangeR[   R)   R   (   R{   R+   R   t
   total_size(    (   R{   s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   start_loops  s    	
	c         C@  s1   |  j  j d  |  j  j d  |  j  j   d  S(   Ns   __pyx_temp_pointer += 1;t   }(   R+   R)   t	   end_block(   R{   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt	   end_loops  s    (   R   R   R   R   (    (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR     s   	R   c           B@  s   e  Z d    Z d   Z RS(   c         C@  s  |  j  } | j   xm t |  j  D]\ } | |  j | f } | j d |  | j d |  | j d |  | j d |  q# W| j d |  j  x^ t |  j  D]M } | d k r | j d | | d f  n  | j d	 | | | | f  q Wd
 |  j d S(   Ns/   Py_ssize_t __pyx_temp_extent_%d = %s.shape[%d];s1   Py_ssize_t __pyx_temp_stride_%d = %s.strides[%d];s   char *__pyx_temp_pointer_%d;s   Py_ssize_t __pyx_temp_idx_%d;s   __pyx_temp_pointer_0 = %s.data;i    s.   __pyx_temp_pointer_%d = __pyx_temp_pointer_%d;i   s\   for (__pyx_temp_idx_%d = 0; __pyx_temp_idx_%d < __pyx_temp_extent_%d; __pyx_temp_idx_%d++) {s   __pyx_temp_pointer_%d(   R+   R   R   R[   R   R)   (   R{   R+   Rr   t   t(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR     s    	
	c         C@  s_   |  j  } xE t |  j d d d  D]* } | j d | | f  | j d  q# W| j   d  S(   Ni   is.   __pyx_temp_pointer_%d += __pyx_temp_stride_%d;R   (   R+   R   R[   R)   R   (   R{   R+   Rr   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR     s
    	 (   R   R   R   R   (    (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR     s   	c         C@  s,   |  j  r d } n d } d |  j   | f S(   NR$   R#   s!   __pyx_memoryview_copy_slice_%s_%s(   RN   t   specialization_suffix(   t   memviewR   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   copy_c_or_fortran_cname  s
    		c         C@  s-  | j  | j  k r t |  d  St | j  t | j  k rJ t |  d  S| j pY | j si t |  d  Sx0 | j D]% \ } } | d k rs t |  d  Sqs W| j r d } t } n | j r d } t } n  t d d	 t	 t
 d
 | d | j  j   d | d | j d t |  d t | j  j  d t g S(   Ns   dtypes must be the same!s!   number of dimensions must be sames%   to_memview must be c or f contiguous.R   s2   cannot handle 'full' or 'ptr' access at this time.R$   t   fortrant   CopyContentsUtilityR   t   modet
   dtype_declt   contig_flagR[   t
   func_cnamet   dtype_is_objectR   (   RV   R   R   RT   RN   RO   RH   RI   R   R   R   R   R[   R   R   Rn   t   copy_contents_new_utility(   R   t   from_memviewt
   to_memviewRP   RQ   R   R   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_copy_new_utility  s6    					c         C@  s:  |  j    j j } | j   | j } t g  d D] } | j |  ^ q/  } t g  d D] } | j |  ^ qW  } t t } } d \ }	 }
 |	 d } } g  } xYt |  D]K\ } } | j	 j
 s t | j	 j t   n  | j j
 st | j j t   n  | j j
 r$| j |	 |
 f  q t | j t  r|| j j |   d k rft | j j t   n  | j | d f  q t | j t t f  rt |  | j  } | j t k r| j t | j  qt | j j t   q t | j j t   q Wd	 } t } xi t |  D][ \ } \ } } | d k r| rRt | j j t   n  | } | d f | | <t } qqW| r
| t |  d k rt } n= t } | r| | d d	 d k rt | | j d
   n  | r2d } xL t t |   D]5 \ } \ } } | d k rt |  | d } qqWn  | d } t |  | } x t | | | ! D]z \ } \ } } | d | } | d k rt | | j d   n  | d k rt | | j d   n  | | f | | <q`W| r
| d \ } } | d f | d <q
n  t  g  | D] } | j	 j ^ q| | |  | S(   s   
    get_axes_specs(env, axes) -> list of (access, packing) specs for each axis.
    access is one of 'full', 'ptr' or 'direct'
    packing is one of 'contig', 'strided' or 'follow'
    R   R   R   R   R   R    i   t   cfcontigi    s>   Fortran contiguous specifier must follow an indirect dimensionis>   Indirect dimension may not follow Fortran contiguous dimensions   Dimension may not be contiguous(   s   fulls   directs   ptr(   s   contigs   strideds   follow(   s   directs   strided(   s   fulls   ptr(   s   ptrs   full(!   t   global_scopeR   t   cython_scopet   load_cythonscopet	   viewscopet   tuplet   lookupR8   R   R   R   R   R   t	   START_ERRR   t   STOP_ERRR   R   R   R   t   compile_time_valuet   STEP_ERRR   R   t   _get_resolved_spect   namet   view_constant_to_access_packingt   INVALID_ERRt   BOTH_CF_ERRRi   R   t   reversedt   validate_axes_specs(   t   envRT   t   cythonscopeR  R  t   access_specst   packing_specsRO   RN   t   default_accesst   default_packingt	   cf_accesst
   cf_packingt
   axes_specsR   t   axisRu   t
   contig_dimt	   is_contigRP   RQ   R   R   t   aR"   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_axes_specs  s    
	""	%	
&c         C@  s*   t  |  t j k r& t |  d  t St S(   NsG   More dimensions than the maximum number of buffer dimensions were used.(   R   R   t   buffer_max_dimsR   R8   Ri   (   R   RT   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   validate_axes}  s    c         C@  s   t  } } t |   d k r4 |  d g k r4 t } nx |  d d	 k rg t d   |  d  D  rg t } nE t |   d k r |  d d
 k r t d   |  d D  r t } n  | | f S(   Ni   R   R   ic         s@  s   |  ] } | d k Vq d S(   R   R    N(   s   directs   follow(    (   R   R  (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pys	   <genexpr>  s    i    c         s@  s   |  ] } | d k Vq d S(   R   R    N(   s   directs   follow(    (   R   R  (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pys	   <genexpr>  s    (   s   directs   contig(   s   directs   contig(   s   directs   contig(   R8   R   Ri   R   (   RM   RN   RO   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyRG     s    
!			c         C@  sQ   t  |   \ } } | r d S| r& d Sx$ |  D] \ } } | d k r- d Sq- Wd S(   NR$   R   R   R   R   (   s   ptrs   full(   RG   (   RM   RN   RO   RP   RQ   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   get_mode  s    R   R   R   R   R   c         C@  s  d } d } t  } } } }	 d }
 x5 t |  D]' \ } \ } } | d k r1 | }
 q1 q1 Wxxt t |  |   D]a\ } \ } \ } } | | k o | | k s t | d   n  | d k r t } n | d k ry| r t | d	   n  |
 d
 t |  d
 f } | | k rj| d k rj|
 d
 t |  d
 k rFd | } n d | d } t | d |   n  | d k } nE | d k r| rt | d   n  | p| st | d   qn  | d k rr t  } qr qr Wd  S(   NR   R   R    R   R   R   is   Invalid axes specification.s1   Only one direct contiguous axis may be specified.i   s   dimensions %d and %ds   dimension %di    s$   Only %s may be contiguous and directsA   A memoryview cannot have both follow and strided axis specifiers.s$   Invalid use of the follow specifier.(   s   contigs   strideds   follow(   s   directs   ptrs   full(   s   ptrs   full(   R8   R   RJ   R   Ri   R   (   t	   positionsRM   RN   RO   R  R  t
   has_contigt
   has_followt   has_stridedt   has_generic_contigt   last_indirect_dimensionR   RP   RQ   R   t   valid_contig_dimst   dims(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR    s<    .	c         C@  sN   t  | t  r t |  |  St  | t  r8 t |  |  St | j t   d  S(   N(   R   R   t   _resolve_NameNodeR   t   _resolve_AttributeNodeR   R   R  (   R  t   spec(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR    s
    c         C@  s   y |  j  | j  j } Wn# t k
 r> t | j t   n X|  j   j j j	 } | j  |  } | d  k r t | j t   n  | S(   N(   R  R  t   AttributeErrorR   R   R  R  R   R  R  t   Nonet   NOT_CIMPORTED_ERR(   R  t   nodet   resolved_nameR  Ru   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR,    s    c         C@  s  g  } x/ t  | t  r7 | j d | j  | j } q	 Wt  | t  r] | j d | j  n t | j t	   | d  } | s t
  |  } xP | D]H } | j |  } | s | j r t | j d |   n  | j } q W| j | d  } | st | j d | d   n  | S(   Ni    is   undeclared name not builtin: %ss   No such attribute '%s'(   R   R   t   insertt	   attributet   objR   R  R   R   t   EXPR_ERRR2   R  t	   as_module(   R  R2  t   patht   modnamesRf   t   modnamet   modRu   (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR-    s(    
c         K@  s   t  j |  d d | | S(   Ns   MemoryView.pyxR   (   R
   t   load(   t   util_code_nameR   t   kwargs(    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   load_memview_cy_utility  s    c         K@  s<   | d  k r t j |  d |  St j |  d d | | Sd  S(   Ns   MemoryView_C.cR   (   R0  R   R=  R	   (   R>  R   R?  (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyR     s    c         C@  s5   |  j    j j } | j   t | j j d  _ d  S(   Nt   array_cwrapper(   R  R   R  R  Ri   R  R  t   used(   R  R  (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   use_cython_array_utility_code  s    
t   memview_struct_namet   max_dimst   memviewslice_namet   memslice_initt   MemviewSliceStructt   proto_blockt   utility_code_proto_before_typesR   R   t   Atomicst   MemviewSliceInitt   BUF_MAX_NDIMSt   MemviewSliceIndext   BufferFormatFromTypeInfot   MemviewSliceIsContigt   OverlappingSlicest   MemviewSliceCopyTemplates   View.MemoryViewt   arrayt
   memoryviewRA  N(   s   fulls   strided(   s   directs   strided(   s   ptrs   strided(   s   fulls   contig(   s   directs   contig(   s   ptrs   contig(   s   arrays
   memoryviews   array_cwrappers   generics   strideds   indirects
   contiguouss   indirect_contiguous(h   t
   __future__R    t   ErrorsR   R   t    R   R   R   R   R   t   CodeR   R	   R
   R   R   R   R  R	  R  R  R  R1  R7  t   CF_ERRt   ERR_UNINITIALIZEDR   t   format_flagRH   RI   t   memview_any_contiguousRK   RL   t   MEMVIEW_DIRECTt   MEMVIEW_PTRt   MEMVIEW_FULLt   MEMVIEW_CONTIGt   MEMVIEW_STRIDEDt   MEMVIEW_FOLLOWt   _spec_to_constt   _spec_to_abbrevt   memslice_entry_initt   memview_namet   memview_typeptr_cnamet   memview_objstruct_cnamet   memviewslice_cnameR,   R8   Ri   RB   R:   RR   RY   R^   Rh   t   BufferEntryRt   R   R   R   R   R   R   t   objectR   R   R   R   R   R   R"  RG   R#  R  R  R  R,  R-  R0  R@  R   RC  R!  R   t   memviewslice_declare_codet   atomic_utilityR   t   acquire_utility_codet   memviewslice_init_codeR   t   _typeinfo_to_format_codet   typeinfo_to_format_codeR   t   overlapping_utilityR   t   GetAndReleaseBufferUtilityCodet   buffer_struct_declare_codet   empty_bufstruct_utilityt   capsule_utility_codet   view_utility_codet   view_utility_whitelistR   R   (    (    (    s=   /bar/jli/Chip-seq/script/cython/Cython/Compiler/MemoryView.pyt   <module>   s  	

	

			!		 				!			 	r				
	.					

				  