;ò
 ¹<@c           @   sÙ  d  Z  d k l Z d k Z d k Z d k Z d k Z d k Z	 d k
 Z
 d k Z d k Z d k Z d k Z d k Z e e f \ Z Z d f  d „  ƒ  YZ h  Z d „  Z d e i f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 „  Z d „  Z d „  Z e e d „ Z d d „ Z e e d e d „ Z  d „  Z! e e e d „ Z" e e e d „ Z# e e e d e e d „ Z$ e e e d e e d „ Z% e% Z& d e e d „ Z' d d „ Z( d „  Z) d „  Z* e+ d j o e* ƒ  n d S(   s   
Large chararray test
>>> xx=array(None,itemsize=3,shape=220000)

>>> import cPickle
>>> c=cPickle.loads(cPickle.dumps(fromlist(["this","that","something else"])))
>>> c
CharArray(['this', 'that', 'something else'])
>>> c._type
CharArrayType(14)

>>> a=fromlist(["this"]*25); a.shape=(5,5); a[ range(2,4) ]
CharArray([['this', 'this', 'this', 'this', 'this'],
           ['this', 'this', 'this', 'this', 'this']])
>>> a[ range(2,4) ] = fromlist(["that"]); a
CharArray([['this', 'this', 'this', 'this', 'this'],
           ['this', 'this', 'this', 'this', 'this'],
           ['that', 'that', 'that', 'that', 'that'],
           ['that', 'that', 'that', 'that', 'that'],
           ['this', 'this', 'this', 'this', 'this']])

>>> array([], shape=(0,1,2))
CharArray([])
(   s   _EmptyClassNs   CharArrayTypec           B   s   t  Z d „  Z d „  Z RS(   Nc         C   s    | |  _  d |  i  f |  _ d  S(   Ns   CharArrayType(%d)(   s   itemsizes   selfs   name(   s   selfs   itemsize(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __init__,   s    	c         C   s   |  i Sd  S(   N(   s   selfs   name(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __repr__0   s    (   s   __name__s
   __module__s   __init__s   __repr__(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   CharArrayType+   s   	c         C   s3   |  t i ƒ  j o t |  ƒ t |  <n t |  Sd S(   sµ   NewCharArrayType creates CharArrayTypes on demand, but checks to see
    if they already exist in the cache first.  This makes type equivalence
    the same as object identity.
    N(   s   itemsizes   CharArrayTypeCaches   keyss   CharArrayType(   s   itemsize(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   NewCharArrayType5   s     s   RawCharArrayc           B   s  t  Z d  Z e e e d e d e 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 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' e( i) d' d d f j o d( „  Z* n d) „  Z+ d* „  Z, d+ „  Z- d, „  Z. d d- „ Z/ d d. „ Z0 d d/ „ Z1 d d d0 „ Z2 d1 „  Z3 e e e4 i5 d2 „ Z6 RS(3   s  RawCharArray(buffer=None, shape=None, byteoffset=0, bytestride=None)

      RawCharArray is a fixed length array of characters based on
      ndarray.NDArray with no automatic stripping or padding.

      itemsize specifies the length of all strings in the array.
    i    i   c   	      C   sÖ  t  | t i ƒ o | f } n | t j	 o* | t j	 o t d ƒ ‚ n | i } n | t j o. | t j p
 | t j o t d ƒ ‚ qZnÉ | t j o
 | t j o t d ƒ ‚ n t	 | | | | ƒ } | o
 | t j o | t i | ƒ } n | o
 | t j o | f } n | d j o
 d } n' t i | ƒ | j o t d ƒ ‚ n t i i |  d | d | d | d	 | d
 | d | ƒ| t j o t | ƒ } n | |  _ | t j o |  i d ƒ n d  S(   Ns%   Specify type *or* itemsize, not both.s3   Must define both shape & itemsize if buffer is Nones&   Must specify shape, itemsize, or both.i    s)   Inconsistent string and array parameters.s   shapes   itemsizes   buffers
   byteoffsets
   bytestrides   aligneds    (   s
   isinstances   shapes   typess   IntTypes   types   Nones   itemsizes
   ValueErrors   buffers   _bufferItemss
   byteoffsets
   bytestrides   nis   nums   products   NDArrays   __init__s   selfs   aligneds   NewCharArrayTypes   _types   fill(	   s   selfs   buffers   itemsizes   shapes
   byteoffsets
   bytestrides   aligneds   types   ni(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __init__G   s8    
	c         C   sn   t  |  i ƒ d j o) g  i } |  D] } | | ƒ q$ ~ Sn, g  i } |  D] } | | i ƒ  ƒ qM ~ Sd S(   s,   returns array as a (nested) list of strings.i   N(   s   lens   selfs   _shapes   appends   _[1]s   xs   nis   tolist(   s   selfs   _[1]s   xs   ni(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   tolistm   s     )c         C   s*   t  i i |  ƒ } |  i i | d <| Sd S(   s2   returns RawCharArray state dictionary for picklings   _typeN(   s   nums   NDArrays   __getstate__s   selfs   states   _types   itemsize(   s   selfs   state(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __getstate__t   s     c         C   s*   t  i i |  | ƒ t | d ƒ |  _ d S(   s/   sets RawCharArray dictionary from pickled states   _typeN(   s   nums   NDArrays   __setstate__s   selfs   states   NewCharArrayTypes   _type(   s   selfs   state(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __setstate__z   s     c         C   s   d Sd S(   s0   CharArray's are *never* byteswapped.  returns 0.i    N(    (   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   isbyteswapped   s     c         C   s   d Sd S(   s-   CharArray's are *always* aligned.  returns 1.i   N(    (   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys	   isalignedƒ   s     c         C   s    t  i i |  ƒ d G|  i GHd  S(   Ns   type:(   s   nums   NDArrays   infos   selfs   _type(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   info‡   s    c         C   sl   t  |  i t i ƒ o. t |  i ƒ | | |  i !} |  i	 | ƒ Sn% |  i	 t
 |  i | | |  i !ƒ ƒ Sd S(   sl   _getitem(self, offset) returns  the "stripped" fixed length
        string from 'self' at 'offset'.
        N(   s
   isinstances   selfs   _datas   memorys
   MemoryTypes   buffers   offsets	   _itemsizes   ss   strips   str(   s   selfs   offsets   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _getitem‹   s
     c         C   sC   | } t i |  i ƒ } |  i | ƒ d |  i	 !| | | |  i	 +d S(   sù  _setitem(self, offset) sets 'offset' to result of "padding" 'value'.

        _setitem silently truncates inputs which are too long.

        >>> s=array([""])
        >>> s[0] = "this"
        >>> s
        CharArray([''])
        >>> s=array(["this","that"])
        >>> s[0] = "othe"
        >>> s
        CharArray(['othe', 'that'])
        >>> s[1] = "v"
        >>> s
        CharArray(['othe', 'v'])
        >>> s = array("")
        >>> s[0] = "this"
        >>> s
        CharArray([''])
        i    N(
   s   offsets   bos   memorys   writeable_buffers   selfs   _datas   wheres   pads   values	   _itemsize(   s   selfs   offsets   values   bos   where(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _setitem•   s     c         C   s~   |  i d j o t d ƒ ‚ n t i d |  i d |  i |  i f d t i d |  i d |  i	 ƒ } |  i d f | _ | Sd	 S(
   sŒ   _byteView(self) returns a view of self as an array of bytes.
        A _byteView cannot be taken from a chararray with itemsize==0.
        i    s-   _byteView doesn't work for zero length items.s   buffers   shapes   types
   byteoffsets
   bytestridei   N(   s   selfs	   _itemsizes
   ValueErrors   nums   NumArrays   _datas   _shapes   UInt8s   _byteoffsets   _bytestrides   bs   _strides(   s   selfs   b(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys	   _byteView®   s     		c         C   sä   |  i d j o d Sn t | d |  i d |  i ƒ} |  i | ƒ } | i d j o d Sn | i ƒ  } |  i ƒ  } |  i | i j o | d d |  i … f | (n; | | d d | i	 d … f <d | d | i	 d d … f <d S(   s›  
        >>> c = array([""])
        >>> c[:] = array(["this"])
        >>> c
        CharArray([''])
        >>> c = array(["this","that"])
        >>> c[:] = array(["a really long line","a"])
        >>> c
        CharArray(['a re', 'a'])
        >>> c[:] = ["more","money"]
        >>> c
        CharArray(['more', 'mone'])
        >>> c[:] = array(["x"])
        >>> c
        CharArray(['x', 'x'])
        i    Ns   itemsizes   kind.iÿÿÿÿ(
   s   selfs	   _itemsizes   asarrays   arrs	   __class__s
   _broadcasts	   _byteViews   its   mes   _shape(   s   selfs   arrs   mes   it(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys	   _copyFrom¼   s      c      	   C   s»   |  i ƒ  } t i | i | i ƒ  ƒ | _ d | _ | i | _	 | i
 ƒ  | _ |  i | _ t i |  i ƒ oE t i d } | | i |  i |  i |  i | i d | i | i ƒ n | Sd S(   s  Return a new array with the same shape and type, but a copy
        of the data

        >>> c = fromlist(["this","that", "another"])
        >>> d = c.copy()
        >>> d
        CharArray(['this', 'that', 'another'])
        >>> int(c._data is d._data)
        0
        i    s
   copyNbytesN(   s   selfs   views   arrs   memorys
   new_memorys	   _itemsizes	   nelementss   _datas   _byteoffsets   _bytestrides   _stridesFromShapes   _stridess   nums   products   _shapes   _bytess   functionDicts   copyfunction(   s   selfs   arrs   copyfunction(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   copyá   s    
 	c         C   s)   t  i |  i ƒ o |  Sn |  i ƒ  Sd  S(   N(   s   nums   products   selfs   _stridess
   contiguous(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _fixbroadcastú   s    c         C   s   t  i i |  | ƒ Sd  S(   N(   s   nums   NDArrays
   _broadcasts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys
   _broadcast   s    c         C   s5   t  i i |  | ƒ \ } } | i ƒ  | i ƒ  f Sd  S(   N(   s   nums   NDArrays   _dualbroadcasts   selfs   others   ss   os   _fixbroadcast(   s   selfs   others   ss   o(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _dualbroadcast  s    c      	   C   s«   t  | d |  i ƒ} |  i | ƒ \ }  } t d t d |  i d |  i	 | i	 d |  i ƒ } | | j o | i ƒ  } n t i |  i t j |  | i ƒ  | ƒ | i ƒ  Sd S(   sü   concatenate(self, other) concatenates two numarray element by element
        >>> array(["this", "that", "another"]).stripAll() + "."
        CharArray(['this.', 'that.', 'another.'])
        >>> array([""])+array([""])
        CharArray([''])
        s   kinds   buffers   shapes   itemsizeN(   s   asarrays   others   selfs	   __class__s   as   _dualbroadcasts   arrays   Nones   _shapes	   _itemsizes   results   copys
   _chararrays   Concats   RawCharArrays   stripAlls   padAll(   s   selfs   others   as   result(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   concatenate  s     c         C   s   |  i | ƒ Sd S(   s"  
        >>> map(str, range(3)) + array(["this","that","another one"])
        CharArray(['0this', '1that', '2another one'])
        >>> "" + array(["this", "that"])
        CharArray(['this', 'that'])
        >>> "prefix with trailing whitespace   " + array(["."])
        CharArray(['prefix with trailing whitespace   .'])
        >>> "" + array("")
        CharArray([''])
        >>> array(["this", "that", "another one"], kind=RawCharArray) + map(str, range(3))
        RawCharArray(['this       0', 'that       1', 'another one2'])
        N(   s   selfs   concatenates   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __add__  s     c         C   s    t  | d |  i ƒi |  ƒ Sd  S(   Ns   kind(   s   asarrays   others   selfs	   __class__s   concatenate(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __radd__(  s    c         C   s   |  i | ƒ |  (|  Sd  S(   N(   s   selfs   concatenates   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __iadd__+  s    c         C   s   | Sd  S(   N(   s   value(   s   selfs   value(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   strip/  s    c         C   s   | Sd  S(   N(   s   value(   s   selfs   value(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   pad2  s    c         C   s   |  Sd  S(   N(   s   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   stripAll5  s    c         C   s   |  Sd  S(   N(   s   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   padAll8  s    c         C   s   t  |  i | ƒ ƒ Sd S(   s<   _format() formats a single array element for str() or repr()N(   s   reprs   selfs   strips   x(   s   selfs   x(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _format;  s     c         C   s/   t  |  ƒ t  | ƒ f \ } } t | | ƒ Sd  S(   N(   s   strs   selfs   others   ss   ts   cmp(   s   selfs   others   ss   t(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __cmp__?  s    c         C   s-   |  i o
 |  i ƒ  o | |  i |  (n d S(   sú   fill(self, char)   fills the array entirely with 'char'.

        >>> x=array([""])
        >>> x.fill(' ')
        >>> x
        CharArray([''])
        >>> x=array(["this"])
        >>> x.fill("x")
        >>> x
        CharArray(['xxxx'])
        N(   s   selfs	   _itemsizes	   nelementss   char(   s   selfs   char(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   fillC  s     c         C   s   |  i ƒ  } t | _ | Sd S(   s¬   raw(self) returns a raw view of self.
        >>> c=fromlist(["this","that","another"])
        >>> c.raw()
        RawCharArray(['this   ', 'that   ', 'another'])
        N(   s   selfs   views   arrs   RawCharArrays	   __class__(   s   selfs   arr(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   rawR  s     	c         C   s#   |  i ƒ  o |  Sn |  i ƒ  Sd S(   sÀ   contiguous(self) returns a version of self which is guaranteed to
        be contiguous.  If self is contiguous already, it returns self.
        Otherwise, it returns a copy of self.
        N(   s   selfs   iscontiguouss   copy(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys
   contiguous\  s     c         C   sU   |  i | j o= |  i d |  i d | ƒ } | i t d ƒ ƒ |  | (| Sn |  Sd S(   s–  resized(self, n) returns a copy of self, resized so that each
        item is of length n characters.  Extra characters are zero filled.
        If self._itemsize == n, self is returned.

        >>> c = fromlist(["this","that","another"])
        >>> c._itemsize
        7
        >>> d=c.resized(20)
        >>> d
        CharArray(['this', 'that', 'another'])
        >>> d._itemsize
        20
        s   shapes   itemsizei    N(   s   selfs	   _itemsizes   ns	   __class__s   _shapes   exts   fills   chr(   s   selfs   ns   ext(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   resizedf  s     c         C   sö   t  | d |  i ƒ} |  i | ƒ \ }  } |  i | i j  o |  i | i ƒ }  n* | i |  i j  o | i |  i ƒ } n |  t j o t	 d ƒ ‚ n t
 i d |  i d t
 i ƒ } t i |  i t j |  i ƒ  i ƒ  | i ƒ  i ƒ  | ƒ | Sd S(   sh   StrCmp(self, b0)  calls strncmp on corresponding items of the
        two numarray, self and b.
        s   kinds   Incompatible array dimensionss   shapes   typeN(   s   asarrays   b0s   selfs	   __class__s   bs   _dualbroadcasts	   _itemsizes   resizeds   Nones
   ValueErrors   nums   NumArrays   _shapes   Int8s   results
   _chararrays   StrCmps   RawCharArrays   copys   stripAll(   s   selfs   b0s   bs   result(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   StrCmp}  s      c         C   s   |  i | ƒ i d ƒ Sd S(   sf  
        >>> array(["this ", "thar", "other"]).__eq__(array(["this", "that", "another"]))
        array([1, 0, 0], type=Bool)
        >>> array([""]).__eq__(array([""]))
        array([1], type=Bool)
        >>> array([""]).__eq__(array(["x"]))
        array([0], type=Bool)
        >>> array(["x"]).__eq__(array([""]))
        array([0], type=Bool)
        i    N(   s   selfs   StrCmps   others   __eq__(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __eq__’  s    
 c         C   s   |  i | ƒ i d ƒ Sd S(   s¦   
        >>> s=array(["this ", "thar", "other"])
        >>> t=array(["this", "that", "another"])
        >>> s.__lt__(t)
        array([0, 1, 0], type=Bool)
        i    N(   s   selfs   StrCmps   others   __lt__(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __lt__Ÿ  s     c         C   s   |  i | ƒ i d ƒ Sd S(   s¦   
        >>> s=array(["this ", "thar", "other"])
        >>> t=array(["this", "that", "another"])
        >>> s.__ne__(t)
        array([0, 1, 1], type=Bool)
        i    N(   s   selfs   StrCmps   others   __ne__(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __ne__¨  s     c         C   s   |  i | ƒ i d ƒ Sd S(   s¦   
        >>> s=array(["this ", "thar", "other"])
        >>> t=array(["this", "that", "another"])
        >>> s.__le__(t)
        array([1, 1, 0], type=Bool)
        i    N(   s   selfs   StrCmps   others   __le__(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __le__±  s     c         C   s   |  i | ƒ i d ƒ Sd S(   s¦   
        >>> s=array(["this ", "thar", "other"])
        >>> t=array(["this", "that", "another"])
        >>> s.__ge__(t)
        array([1, 0, 1], type=Bool)
        i    N(   s   selfs   StrCmps   others   __ge__(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __ge__º  s     c         C   s   |  i | ƒ i d ƒ Sd S(   s¦   
        >>> s=array(["this ", "thar", "other"])
        >>> t=array(["this", "that", "another"])
        >>> s.__gt__(t)
        array([0, 0, 1], type=Bool)
        i    N(   s   selfs   StrCmps   others   __gt__(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __gt__Ã  s     i   c           C   s   d S(   s¯  
            >>> s=array(["this ", "thar", "other"])
            >>> t=array(["this", "that", "another"])
            >>> s == t
            array([1, 0, 0], type=Bool)
            >>> s < t
            array([0, 1, 0], type=Bool)
            >>> s >= t
            array([1, 0, 1], type=Bool)
            >>> s <= t
            array([1, 1, 0], type=Bool)
            >>> s > t
            array([0, 0, 1], type=Bool)
            N(    (    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _test_rich_comparisonsÍ  s     c         C   s&   t  i i t  i |  i | ƒ ƒ ƒ Sd S(   s.  
        Returns 1 if-and-only-if 'self' has an element == to 'str'

        >>> s=array(["this ", "thar", "other"])
        >>> int("this" in s)
        1
        >>> int("tjt" in s)
        0
        >>> x=array([""])
        >>> int("this" in x)
        0
        >>> int("" in x)
        1
        N(   s   nums
   logical_ors   reduces   ravels   selfs   __eq__s   str(   s   selfs   str(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   __contains__Þ  s     c         C   s'   |  i ƒ  } | i ƒ  t | ƒ |  (d S(   sž   
        >>> a=fromlist(["other","this","that","another"])
        >>> a.sort()
        >>> a
        CharArray(['another', 'other', 'that', 'this'])
        N(   s   selfs   tolists   ls   sorts   fromlist(   s   selfs   l(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   sortï  s     
c         C   s6   t  t |  ƒ ƒ } | i |  d „ ƒ t i | ƒ Sd S(   sw   
        >>> a=fromlist(["other","that","this","another"])
        >>> a.argsort()
        array([3, 0, 1, 2])
        c         C   s   t  | |  | | ƒ S(   N(   s   cmps   zs   xs   y(   s   xs   ys   z(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   <lambda>  s    N(   s   ranges   lens   selfs   axs   sorts   nums   array(   s   selfs   ax(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   argsortú  s     c         C   sz   t  |  i ƒ d j o/ g  i } |  D] } | | | ƒ ƒ q$ ~ Sn2 g  } x$ |  D] } | i | i | ƒ ƒ qR W| Sd S(   ss   amap() returns the nested list which results from applying
        function 'f' to each element of 'self'.
        i   N(	   s   lens   selfs   _shapes   appends   _[1]s   is   fs   anss   amap(   s   selfs   fs   is   _[1]s   ans(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   amap  s     / c         C   sh   t  i | | ƒ i } | d „ } t i |  i
 | ƒ d t i ƒ} t | ƒ o t i | ƒ Sn f  Sd S(   s6  
        >>> a=fromlist([["wo","what"],["wen","erewh"]])
        >>> a.match("wh[aebd]")
        (array([0]), array([1]))
        >>> a.match("none")
        (array([]), array([]))
        >>> b=array([""])
        >>> b.match("this")
        (array([]),)
        >>> b.match("")
        (array([0]),)
        c         C   s   t  | |  ƒ t j	 ƒ S(   N(   s   ints   fs   xs   None(   s   xs   f(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   <lambda>  s    s   typeN(   s   res   compiles   patterns   flagss   matchs   matchers   ls   nums   arrays   selfs   amaps   Bools   matchess   lens   nonzero(   s   selfs   patterns   flagss   matchess   ls   matcher(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   match  s     !c         C   sh   t  i | | ƒ i } | d „ } t i |  i
 | ƒ d t i ƒ} t | ƒ o t i | ƒ Sn f  Sd S(   s:  
        >>> a=fromlist([["wo","what"],["wen","erewh"]])
        >>> a.search("wh")
        (array([0, 1]), array([1, 1]))
        >>> a.search("1")
        (array([]), array([]))
        >>> b=array(["",""])
        >>> b.search("1")
        (array([]),)
        >>> b.search("")
        (array([0, 1]),)
        c         C   s   t  | |  ƒ t j	 ƒ S(   N(   s   ints   fs   xs   None(   s   xs   f(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   <lambda>3  s    s   typeN(   s   res   compiles   patterns   flagss   searchs   searchers   ls   nums   arrays   selfs   amaps   Bools   matchess   lens   nonzero(   s   selfs   patterns   flagss   searchers   matchess   l(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   search%  s     !c         C   s)   t  i |  |  i | | ƒ d d f ƒSd S(   s‚   
        >>> a=fromlist([["who","what"],["when","where"]])
        >>> a.grep("whe")
        CharArray(['when', 'where'])
        s   axisi    N(   s   _gens   takes   selfs   matchs   patterns   flags(   s   selfs   patterns   flags(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   grep:  s     c         C   s>   t  i | | ƒ } | | | d „ } t |  i
 | ƒ ƒ |  (d S(   sº   
        >>> a=fromlist([["who","what"],["when","where"]])
        >>> a.sub("wh", "ph")
        >>> a
        CharArray([['pho', 'phat'],
                   ['phen', 'phere']])
        c         C   s   t  i | | |  | ƒ S(   N(   s   res   subs   ps   rs   xs   c(   s   xs   ps   rs   c(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   <lambda>K  s    N(   s   res   compiles   patterns   flagss   cpats   replacements   counts   ls   fromlists   selfs   amap(   s   selfs   patterns   replacements   flagss   counts   ls   cpat(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   subB  s     c         C   s]   t  i g  i } t  i |  ƒ D] } | t | h  h  ƒ ƒ q ~ ƒ } | i	 |  i
 ƒ | Sd S(   s  eval(self) converts CharArray 'self' into a NumArray.

        >>> array([["1","2"],["3","4"]]).eval()
        array([[1, 2],
               [3, 4]])
        >>> try:
        ...    array([["1","2"],["3","other"]]).eval()
        ... except NameError:
        ...    pass
        N(   s   nums   arrays   appends   _[1]s   ravels   selfs   xs   evals   ns   setshapes   _shape(   s   selfs   ns   _[1]s   x(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   evalN  s    
 Ec         C   st   t  i d |  i d t  i ƒ } t i t | p t
 ƒ  | p t f |  | ƒ | t  i j o | i | ƒ Sn | Sd S(   s8  fasteval(self) converts CharArray 'self' into a NumArray.

        >>> array([["1","2"],["3","4"]]).fasteval(type=num.Long)
        array([[1, 2],
               [3, 4]])
        >>> try:
        ...    array([["1","2"],["3","other"]]).fasteval()
        ... except _chararray.error:
        ...    pass
        s   shapes   typeN(   s   nums   arrays   selfs   _shapes   Float64s   ns
   _chararrays   Evals   evals   globalss   _globalss   localss   _localss   types   astype(   s   selfs   globalss   localss   types   n(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   fasteval]  s    
 #
(7   s   __name__s
   __module__s   __doc__s   Nones   __init__s   tolists   __getstate__s   __setstate__s   isbyteswappeds	   isaligneds   infos   _getitems   _setitems	   _byteViews	   _copyFroms   copys   _fixbroadcasts
   _broadcasts   _dualbroadcasts   concatenates   __add__s   __radd__s   __iadd__s   strips   pads   stripAlls   padAlls   _formats   __cmp__s   fills   raws
   contiguouss   resizeds   StrCmps   __eq__s   __lt__s   __ne__s   __le__s   __ge__s   __gt__s   syss   version_infos   _test_rich_comparisonss   __contains__s   sorts   argsorts   amaps   matchs   searchs   greps   subs   evals   nums   Float64s   fasteval(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   RawCharArray?   sb    &							
			%																
	
																
		s	   CharArrayc           B   sV   t  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   s‘  
    >>> array("thisthatthe othe",shape=(4,),itemsize=4)
    CharArray(['this', 'that', 'the', 'othe'])
    >>> array("thisthatthe othe",shape=(4,),itemsize=4)._shape
    (4,)
    >>> array("thisthatthe othe",shape=(4,),itemsize=4)._itemsize
    4
    >>> array([["this","that"],["x","y"]])
    CharArray([['this', 'that'],
               ['x', 'y']])
    >>> array([["this","that"],["x","y"]])._shape
    (2, 2)
    >>> array([["this","that"],["x","y"]])._itemsize
    4
    >>> s=array([["this","that"],["x","y"]], itemsize=10)
    >>> s
    CharArray([['this', 'that'],
               ['x', 'y']])
    >>> s._itemsize
    10
    >>> s[0][0]
    'this'
    >>> # s[1,1][0] = 'z' # Char assigment doesn't work!
    >>> s[1,1] = 'z'      # But padding may do what you want.
    >>> s                 # Otherwise, specify all of s[1,1] or subclass.
    CharArray([['this', 'that'],
               ['x', 'z']])
    c         C   s   t  i | |  i ƒ Sd S(   sà   
        pad(self, value)   implements CharArray's string-filling policy
        which is used when strings are assigned to elements of a CharArray.
        Pad extends 'value' to length self._itemsize using spaces.
        N(   s
   _chararrays   Pads   values   selfs	   _itemsize(   s   selfs   value(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   pad�  s     c         C   s   t  i | ƒ Sd S(   s©  
        strip(self, value) implements CharArray's string fetching
        "cleanup" policy. strip truncates 'value' at the first NULL
        and removes all trailing whitespace from the remainder.  For
        compatability with FITS, leading whitespace is never
        completely stripped: a string beginning with a space always
        returns at least one space to distinguish it from the empty
        string.
        N(   s
   _chararrays   Strips   value(   s   selfs   value(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   strip•  s    	 c         C   s   t  i t |  ƒ |  Sd S(   s�   
        stripAll(self) applies the chararray strip function to each element
        of self and returns the result.  The result may be a new array.
        N(   s
   _chararrays   StripAlls   Nones   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   stripAll¡  s     c         C   s   t  i t |  ƒ |  Sd S(   s™   
        padAll(self) applies the chararray pad function to each element
        of self and returns the result.  The result may be a new array.
        N(   s
   _chararrays   PadAlls   Nones   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   padAll©  s     c         C   s   t  i |  ƒ Sd S(   sñ   
        maxLen(self) computes the length of the longest string in
        self.  Maxlen will applies the strip function to each element
        prior to computing its length.

        >>> array(["this  ","that"]).maxLen()
        4
        N(   s
   _chararrays   MaxLens   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   maxLen±  s     c         C   s   |  i |  i ƒ  ƒ Sd S(   s  
        truncate(self) returns a new array with the smallest possible itemsize
        which will hold the stripped contents of self.

        >>> array(["this  ","that"])._itemsize
        6
        >>> array(["this  ","that"]).truncated()._itemsize
        4
        N(   s   selfs   resizeds   maxLen(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys	   truncated¼  s    	 c         C   s&   t  i i t  i |  i | ƒ ƒ ƒ Sd S(   s’   count(self, s) counts the number of occurences of string 's'.
        >>> array(["this","that","another","this"]).count("this")
        2
        N(   s   nums   adds   reduces   ravels   selfs   __eq__s   s(   s   selfs   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   countÈ  s     c         C   sb   t  i |  i | ƒ ƒ } t | d ƒ o  t d „  | ƒ } t	 | ƒ Sn t
 d | d ƒ ‚ d S(   s§  index(self, s) returns the index of the first occurenced of
        's' in 'self'.

        >>> array([["this","that","another"],
        ...        ["another","this","that"]]).index("another")
        (0, 2)
        >>> array([["this","that","another"],
        ...        ["another","this","that"]]).index("not here")
        Traceback (most recent call last):
        ValueError: string 'not here' not in array

        i    c         C   s   |  d S(   Ni    (   s   x(   s   x(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   <lambda>Þ  s    s   string s    not in arrayN(   s   nums   nonzeros   selfs   __eq__s   ss   indicess   lens   maps   firsts   tuples
   ValueError(   s   selfs   ss   indicess   first(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   indexÏ  s     (   s   __name__s
   __module__s   __doc__s   pads   strips   stripAlls   padAlls   maxLens	   truncateds   counts   index(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys	   CharArrayp  s    							c         C   s   t  |  t i ƒ Sd  S(   N(   s
   isinstances   ss   typess
   StringType(   s   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   isStringã  s    c         C   s'   t  |  t i ƒ p t  |  t i ƒ Sd  S(   N(   s
   isinstances   ss   typess   ListTypes	   TupleType(   s   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   isPySequenceæ  s    c         C   s  t  |  t i ƒ o f  t |  ƒ f Snõ t |  ƒ d j o d f d f SnÑ t |  d ƒ } h  } xo |  D]g } t  | t i ƒ o) t	 | f  t | ƒ f ƒ } d | d <qh t	 | t | ƒ ƒ } d | t | ƒ <qh Wt | i
 ƒ  ƒ d j o t d ƒ ‚ n t |  ƒ f | d | d f Sd S(   s²  _slistShape0(slist) computes the (shape+(itemsize,)) tuple
    of string list 'slist'.

    itemsize is set to the maximum of all string lengths in slist.

    >>> s=["this","that","the other"]
    >>> _slistShape(s)
    ((3,), 9)
    >>> _slistShape((s,s,s,s))
    ((4, 3), 9)
    >>> _slistShape(["this", ["that","other"]])
    Traceback (most recent call last):
    ...
    ValueError: Nested sequences with different lengths.
    i    i   s(   Nested sequences with different lengths.N(   s
   isinstances   slists   typess
   StringTypes   lens   _slistShape0s   maxss   sizess   ss   maxs   keyss
   ValueError(   s   slists   sizess   maxss   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _slistShape0é  s"      c         C   sƒ   t  |  ƒ } | t j o | d } n4 t i | ƒ t i | d ƒ j o t d ƒ ‚ n | t j o | d } n | | f Sd S(   s°  _slistShape(slist, itemsize=None, shape=None)  computes the "natural"
    shape and itemsize of slist, and combines this with the specified
    itemsize and shape,  checking for consistency.

    Specifying an itemsize overrides the slist's natural itemsize.

    >>> _slistShape(["this","that"], itemsize=10)
    ((2,), 10)
    >>> _slistShape(["this","that"], itemsize=3)
    ((2,), 3)

    Specifying a shape checks for consistency against the slist's shape.

    >>> _slistShape(["this","that"], shape=(2,1,1))
    ((2, 1, 1), 4)
    >>> _slistShape(["this","that"], shape=(3,2))
    Traceback (most recent call last):
    ...    
    ValueError: Inconsistent list and shape
    
    i    s   Inconsistent list and shapeiÿÿÿÿN(	   s   _slistShape0s   slists   shape_itemss   shapes   Nones   _gens   products
   ValueErrors   itemsize(   s   slists   itemsizes   shapes   shape_items(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _slistShape  s     # s    c         C   sã   t  |  t i ƒ o9 | t |  ƒ j o |  | | t |  ƒ Sqß |  |  Sn” g  } x} |  D]u } t  | t i ƒ o= | t | ƒ j o | | | t | ƒ } qÁ | |  } n t
 | | | ƒ } | i | ƒ qY Wd i | ƒ Sd S(   s3  _pad(slist, n, c=' ') pads each member of string list 'slist' with
    fill character 'c' to a total length of 'n' characters and returns
    the concatenated results.

    strings longer than n are *truncated*.

    >>>
    >>> _pad(["this","that","the other"],9," ")
    'this     that     the other'
    s    N(   s
   isinstances   slists   typess
   StringTypes   ns   lens   cs   results   ss   ts   _pads   appends   join(   s   slists   ns   cs   ss   results   t(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _pad-  s    
  c         C   s\   t  |  ƒ }  t |  d | d | ƒ\ } } t |  | | ƒ } t | d | d | d | ƒSd S(   s`  fromlist(slist, padc=" ") creates a CharArray from a multi-dimensional
    list of strings, 'slist', padding each string to the length of the
    longest string with character 'padc'.

    >>> s=fromlist([["this","that"],["x","y"]])
    >>> s
    CharArray([['this', 'that'],
               ['x', 'y']])
    >>> s[0][0]
    'this'
    >>> s[1][1]
    'y'
    >>> s[1][1] = "whom"
    >>> s[1][1]
    'whom'
    >>> fromlist(['this', 'that'], itemsize=2)
    CharArray(['th', 'th'])
    >>> fromlist(['t','u'], itemsize=3)
    CharArray(['t', 'u'])
    >>> fromlist(['t','u'], itemsize=3)._itemsize
    3
    s   itemsizes   shapes   kindN(
   s   lists   slists   _slistShapes   itemsizes   shapes   _pads   padcs   ss
   fromstrings   kind(   s   slists   itemsizes   shapes   padcs   kinds   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   fromlistJ  s
     c         C   s-   t  i t |  ƒ ƒ } |  t  i | ƒ (| Sd S(   sl   _stringToBuffer(datastring)  allocates a buffer, copies datastring into
    it, and returns the buffer.
    N(   s   memorys
   new_memorys   lens
   datastrings   abuffs   writeable_buffer(   s
   datastrings   abuff(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _stringToBufferf  s     c         C   sº   t  | t i ƒ o | f } n | t d f g j o | t j	 o | t |  ƒ j o t |  | d ƒ }  n | t j o | o d f } t |  ƒ } n | t
 |  ƒ d | d | ƒSd S(   s.  Create an array from binary data contained in a string (by copying)
    >>> fromstring('thisthat', itemsize=4)
    CharArray(['this', 'that'])
    >>> fromstring('thisthat', shape=2)
    CharArray(['this', 'that'])
    >>> fromstring('this is a test', shape=(1,))
    CharArray(['this is a test'])
    i   s    s   shapes   itemsizeN(   s
   isinstances   shapes   typess   IntTypes   Nones   itemsizes   lens   ss   _pads   kinds   _stringToBuffer(   s   ss   itemsizes   shapes   kind(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys
   fromstringn  s     6	c   
      C   sø  t  | t i ƒ o | f } n d } t |  ƒ o d } t |  d ƒ }  n t t	 i
 i |  i ƒ |  i ƒ  ƒ } | o | o d f } | } nÑ | t j	 oŸ | t j	 oX t i | ƒ | }	 |	 d j  o4 t | ƒ } | |	 | | i d ƒ <t | ƒ } q<qdt i | ƒ }	 |	 d j  o t d ƒ ‚ n | |	 } n% | o | | f } n t d ƒ ‚ t i | ƒ | } | | j o t d ƒ ‚ n | t d | d	 | ƒ} |  i | i ƒ } | | j o t d
 ƒ ‚ n | o |  i ƒ  n | Sd S(   sÜ  Create an array from binary file data

    If file is a string then that file is opened, else it is assumed
    to be a file object. No options at the moment, all file positioning
    must be done prior to this function call with a file object

    >>> import testdata
    >>> s=fromfile(testdata.filename, shape=-1, itemsize=80)
    >>> s[0]
    'SIMPLE  =                    T / file does conform to FITS standard'
    >>> s._shape
    (108,)
    >>> s._itemsize
    80
    i    i   s   rbiÿÿÿÿs(   Shape dimension of -1 requires itemsize.s   Must define shape or itemsize.s:   Not enough bytes left in file for specified shape and types   shapes   itemsizes%   Didn't read as many bytes as expectedN(   s
   isinstances   shapes   typess   IntTypes   names   isStrings   files   opens   ints   oss   paths   getsizes   tells   sizes   itemsizes   Nones   nums   products	   shapesizes   lists   indexs   tuples
   ValueErrors   nbytess   kinds   arrs   readintos   _datas
   nbytesreads   IOErrors   close(
   s   files   itemsizes   shapes   kinds   arrs   sizes
   nbytesreads   names   nbytess	   shapesize(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   fromfile‚  sF     %	
i    c      
   C   s–  t  | t i ƒ o | f } n |  t j p t i |  ƒ o& | |  d | d | d | d | ƒSn | p
 | t j	 o t d ƒ ‚ n t |  ƒ o  t |  d | d | d | ƒSnß t |  ƒ o  t |  d | d | d | ƒSn² t  |  | ƒ o |  i | j o |  i ƒ  Sn„ t  |  t ƒ o4 | d |  i d | p |  i d | p |  i ƒ Sn@ t  |  t i ƒ o  t |  d | d | d | ƒSn t d ƒ ‚ d	 S(
   sx  array(buffer=None, itemsize=None, shape=None) creates a new instance
    of a CharArray.

    buffer      specifies the source of the array's initialization data.
                type(buffer) is in [ None, CharArray, StringType,
                                     ListType, FileType, BufferType].

    itemsize    specifies the fixed maximum length of the array's strings.

    shape       specifies the array dimensions.


    >>> array(None,itemsize=3,shape=(1,))
    CharArray([' '])
    >>> array(buffer("abcdsedxxxxxncxn"), itemsize=2, byteoffset=4, bytestride=8)
    CharArray(['se', 'nc'])
    >>> array("abcd", itemsize=2)
    CharArray(['ab', 'cd'])
    >>> array(['this', 'that'], itemsize=10)
    CharArray(['this', 'that'])
    >>> array(['this', 'that'], itemsize=10)._itemsize
    10
    >>> array(array(['this', 'that'], itemsize=10))
    CharArray(['this', 'that'])
    >>> import testdata
    >>> array(open(testdata.filename,"r"),itemsize=80, shape=2)
    CharArray(['SIMPLE  =                    T / file does conform to FITS standard',
               'BITPIX  =                   16 / number of bits per data pixel'])
    s   itemsizes   shapes
   byteoffsets
   bytestridesG   Offset and stride can only be specified if "buffer" is a buffer or Nones   kinds   buffers,   Don't know how to handle that kind of bufferN(   s
   isinstances   shapes   typess   IntTypes   buffers   Nones   nums   SuitableBuffers   kinds   itemsizes
   byteoffsets
   bytestrides
   ValueErrors   isStrings
   fromstrings   isPySequences   fromlists	   __class__s   copys   RawCharArrays   _datas	   _itemsizes   _shapes   FileTypes   fromfiles	   TypeError(   s   buffers   itemsizes   shapes
   byteoffsets
   bytestrides   kind(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   array¾  s*         c         C   sE   t  |  | ƒ o |  i | j o |  Sn t |  | | | | | ƒ Sd S(   s‰   massages a sequence into a chararray.

    If buffer is *already* a chararray of the appropriate kind, it is
    returned unaltered.
    N(	   s
   isinstances   buffers   kinds	   __class__s   arrays   itemsizes   shapes
   byteoffsets
   bytestride(   s   buffers   itemsizes   shapes
   byteoffsets
   bytestrides   kind(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   asarrayö  s      c         C   s¼   | t j oD | t j o t |  ƒ | Sq¸ | o t |  ƒ | | Sq¸ d Snh | t j o t d ƒ ‚ n t |  ƒ | d | } t | ƒ } t | | | d ƒ } | | | j Sd S(   sf  
    >>> _bufferItems(buffer("0123456789"), offset=2, bytestride=4, itemsize=1)
    2
    >>> _bufferItems(buffer("0123456789"), offset=1, bytestride=2, itemsize=1)
    5
    >>> _bufferItems(buffer("0123456789"), bytestride=5, itemsize=2)
    2
    >>> _bufferItems(buffer("0123456789"), bytestride=None, itemsize=2)
    5
    >>> _bufferItems(buffer("0123456789"), offset=3)
    7
    >>> _bufferItems(buffer("abcdsedxxxxxncxn"),itemsize=2,offset=4,bytestride=8)
    2
    >>> cc=CharArray(buffer('abcdef'*5),shape=(2,),itemsize=2,byteoffset=8,bytestride=20,aligned=0)
    >>> cc
    CharArray(['cd', 'ef'])
    i   s1   Must specify itemsize if bytestride is specified.f1.0f0.5N(   s
   bytestrides   Nones   itemsizes   lens   buffers   offsets
   ValueErrors   stridess   ints   istridess   fstrides(   s   buffers   offsets
   bytestrides   itemsizes   istridess   stridess   fstrides(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   _bufferItems  s     i    c         C   sw   t  i |  ƒ }  |  i ƒ  t  i j o
 |  } n |  i t  i ƒ } t d |  i ƒ  d | ƒ } t i | | | ƒ | Sd S(   sS  num2char formats NumArray 'num' into a CharArray using 'format'

    >>> num2char(num.arange(0.0,5), '%2.2f')
    CharArray(['0.00', '1.00', '2.00', '3.00', '4.00'])
    >>> num2char(num.arange(0.0,5), '%d')
    CharArray(['0', '1', '2', '3', '4'])
    >>> num2char(num.arange(5), "%02d")
    CharArray(['00', '01', '02', '03', '04'])
    s   shapes   itemsizeN(   s   nums   asarrays   ns   types   Float64s   wnums   astypes	   CharArrays   getshapes   itemsizes   chars
   _chararrays   Formats   format(   s   ns   formats   itemsizes   chars   wnum(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   num2char&  s    	 
c         C   s   d Sd  S(   Ni    (    (   s   prefixs   base(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   isntprivate9  s    c          C   s)   d  k  }  d  k } |  i | d t ƒSd  S(   Ns	   isprivate(   s   doctests   stringss   testmods   isntprivate(   s   doctests   strings(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   test<  s    s   __main__(,   s   __doc__s   copys   _EmptyClasss   memorys   _bytess
   _chararrays   numarrayalls   nums   generics   _gens   syss   strings   typess   oss   res
   arrayprints   globalss   localss   _globalss   _localss   CharArrayTypes   CharArrayTypeCaches   NewCharArrayTypes   NDArrays   RawCharArrays	   CharArrays   isStrings   isPySequences   _slistShape0s   Nones   _slistShapes   _pads   fromlists   _stringToBuffers
   fromstrings   fromfiles   arrays   asarrays
   inputarrays   _bufferItemss   num2chars   isntprivates   tests   __name__(#   s   fromlists   isntprivates	   CharArrays
   _chararrays   arrays   isPySequences   _slistShape0s   res   asarrays   _slistShapes   _bufferItemss   CharArrayTypeCaches   typess   memorys   tests   NewCharArrayTypes   fromfiles   strings   _gens   _globalss   syss   _EmptyClasss
   arrayprints   CharArrayTypes   _pads   isStrings   RawCharArrays   num2chars
   fromstrings   _bytess   nums   _localss
   inputarrays   oss   _stringToBuffer(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/strings.pys   ?   sL   												
ÿ ÿ 3s			""	<8"		