³ò
Je|Mc        
   @   sZ  d  Z  d d k Z d d k l Z y d d k l Z Wn) e j
 o d e f d „  ƒ  YZ n Xd e f d „  ƒ  YZ	 d	 e f d
 „  ƒ  YZ
 d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d „  Z d „  Z d „  Z e e d „ Z d d d d „ Z d „  Z d „  Z d „  Z d d „ Z d „  Z e d j o d d k Z e i ƒ  n d S(   sÒ   Container objects, and helpers for lists and dicts.

This would have been called this "collections" except that Python 2 can't
import a top-level module that's the same name as a module in the current
package.
iÿÿÿÿN(   t   NotGiven(   t   defaultdictR   c           B   sY   e  Z d  Z d	 d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z RS(
   s¹   Backport of Python 2.5's ``defaultdict``.

        From the Python Cookbook.  Written by Jason Kirtland.
        http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/523034

        c         O   sN   | d  j	 o! t | d ƒ o t d ƒ ‚ n t i |  | | Ž | |  _ d  S(   Nt   __call__s   first argument must be callable(   t   Nonet   hasattrt	   TypeErrort   dictt   __init__t   default_factory(   t   selfR   t   at   kw(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR      s
    c         C   s;   y t  i |  | ƒ SWn  t j
 o |  i | ƒ Sn Xd  S(   N(   R   t   __getitem__t   KeyErrort   __missing__(   R	   t   key(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR      s    c         C   s8   |  i  d  j o t | ƒ ‚ n |  i  ƒ  |  | <} | S(   N(   R   R   R   (   R	   R   t   value(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   !   s    c         C   sH   |  i  d  j o t ƒ  } n |  i  f } t |  ƒ | d  d  |  i ƒ  f S(   N(   R   R   t   tuplet   typet   items(   R	   t   args(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt
   __reduce__&   s    c         C   s
   |  i  ƒ  S(   N(   t   __copy__(   R	   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   copy,   s    c         C   s   t  |  ƒ |  i |  ƒ S(   N(   R   R   (   R	   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   .   s    c         C   s1   d d  k  } t |  ƒ |  i | i |  i ƒ  ƒ ƒ S(   Niÿÿÿÿ(   R   R   R   t   deepcopyR   (   R	   t   memoR   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   __deepcopy__0   s    c         C   s   d |  i  t i |  ƒ f S(   Ns   defaultdict(%s, %s)(   R   R   t   __repr__(   R	   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   4   s    	N(   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   R   R   R   (    (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR      s   						t
   DumbObjectc           B   s   e  Z d  Z d „  Z RS(   s  A container for arbitrary attributes.

    Usage::
    
        >>> do = DumbObject(a=1, b=2)
        >>> do.b
        2
    
    Alternatives to this class include ``collections.namedtuple`` in Python
    2.6, and ``formencode.declarative.Declarative`` in Ian Bicking's FormEncode
    package.  Both alternatives offer more featues, but ``DumbObject``
    shines in its simplicity and lack of dependencies.

    c         K   s   |  i  i | ƒ d  S(   N(   t   __dict__t   update(   R	   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   G   s    (   R   R   R   R   (    (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   8   s   t   Counterc           B   sJ   e  Z d  Z d „  Z d „  Z d d „ Z d „  Z d „  Z e	 e ƒ Z RS(   sâ  I count the number of occurrences of each value registered with me.
    
    Call the instance to register a value. The result is available as the
    ``.result`` attribute.  Example::

        >>> counter = Counter()
        >>> counter("foo")
        >>> counter("bar")
        >>> counter("foo")
        >>> sorted(counter.result.items())
        [('bar', 1), ('foo', 2)]

        >> counter.result
        {'foo': 2, 'bar': 1}

    To see the most frequently-occurring items in order::

        >>> counter.get_popular(1)
        [(2, 'foo')]
        >>> counter.get_popular()
        [(2, 'foo'), (1, 'bar')]

    Or if you prefer the list in item order::

        >>> counter.get_sorted_items()
        [('bar', 1), ('foo', 2)]
    c         C   s   t  t ƒ |  _ d |  _ d  S(   Ni    (   R   t   intt   resultt   total(   R	   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   h   s    c         C   s&   |  i  | c d 7<|  i d 7_ d S(   s"   Register an item with the counter.i   N(   R$   R%   (   R	   t   item(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   l   s    c         C   sf   g  } |  i  i ƒ  D] } | | d | d f q ~ } | i d d „  ƒ | o | |  Sn | Sd S(   sÈ   Return the results as as a list of ``(count, item)`` pairs, with the
        most frequently occurring items first.

        If ``max_items`` is provided, return no more than that many items.
        i   i    R   c         S   s   t  i |  d  |  d f S(   i    i   (   t   syst   maxint(   t   x(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   <lambda>x   s    N(   R$   t	   iteritemst   sort(   R	   t	   max_itemst   _[1]R)   t   data(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   get_popularq   s
    8c         C   s   |  i  i ƒ  } | i ƒ  | S(   sO   Return the result as a list of ``(item, count)`` pairs sorted by item.
        (   R$   R   R,   (   R	   R/   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   get_sorted_items~   s    
c         C   s(   |  ƒ  } x | D] } | | ƒ q W| S(   s   Build a Counter from an iterable in one step.

        This is the same as adding each item individually.

        ::

            >>> counter = Counter.correlate(["A", "B", "A"])
            >>> counter.result["A"]
            2
            >>> counter.result["B"]
            1
        (    (   t   class_t   iterablet   countert   elm(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt	   correlate…   s
    	 N(
   R   R   R   R   R   R   R0   R1   R6   t   classmethod(    (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR"   K   s   				t   Accumulatorc           B   s5   e  Z d  Z d „  Z d „  Z d „  Z e e ƒ Z RS(   sÈ  Accumulate a dict of all values for each key.

    Call the instance to register a value. The result is available as the
    ``.result`` attribute.  Example::

        >>> bowling_scores = Accumulator()
        >>> bowling_scores("Fred", 0)
        >>> bowling_scores("Barney", 10)
        >>> bowling_scores("Fred", 1)
        >>> bowling_scores("Barney", 9)
        >>> sorted(bowling_scores.result.items())
        [('Barney', [10, 9]), ('Fred', [0, 1])]

        >> bowling_scores.result
        {'Fred': [0, 1], 'Barney': [10, 9]}

    The values are stored in the order they're registered.

    Alternatives to this class include ``paste.util. multidict.MultiDict``
    in Ian Bicking's Paste package.
    c         C   s   t  t ƒ |  _ d  S(   N(   R   t   listR$   (   R	   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   °   s    c         C   s   |  i  | i | ƒ d S(   s   Register a key-value pair.N(   R$   t   append(   R	   R   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   ³   s    c         C   s7   |  ƒ  } x' | D] } | | ƒ } | | | ƒ q W| S(   sã   Create an Accumulator based on several related values.

        ``key`` is a function to calculate the key for each item, akin to
        ``list.sort(key=)``.

        This is the same as adding each item individually.
        (    (   R2   R3   R   t   accumulatort   vt   k(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR6   ·   s    	 (   R   R   R   R   R   R6   R7   (    (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR8   ™   s
   			t   UniqueAccumulatorc           B   s    e  Z d  Z d „  Z d „  Z RS(   sË   Accumulate a dict of unique values for each key.

    The values are stored in an unordered set.

    Call the instance to register a value. The result is available as the
    ``.result`` attribute.
    c         C   s   t  t ƒ |  _ d  S(   N(   R   t   setR$   (   R	   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   Ï   s    c         C   s   |  i  | i | ƒ d S(   s   Register a key-value pair.N(   R$   t   add(   R	   R   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR   Ò   s    (   R   R   R   R   R   (    (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyR>   Æ   s   	c         C   sO   t  ƒ  } g  } x9 |  D]1 } | | j o | i | ƒ | i | ƒ q q W| S(   sÔ   Return a list of unique elements in the iterable, preserving the order.

    Usage::

        >>> unique([None, "spam", 2, "spam", "A", "spam", "spam", "eggs", "spam"])
        [None, 'spam', 2, 'A', 'eggs']
    (   R?   R:   R@   (   t   itt   seent   retR5   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   unique×   s    	 c         C   s)   h  } x | D] } |  | | | <q W| S(   sL  Return a copy of the dict with only the specified keys present.  
    
    ``dic`` may be any mapping. The return value is always a Python dict.

    ::

        >> only_some_keys({"A": 1, "B": 2, "C": 3}, ["A", "C"])
        >>> sorted(only_some_keys({"A": 1, "B": 2, "C": 3}, ["A", "C"]).items())
        [('A', 1), ('C', 3)]
    (    (   t   dict   keysRC   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   only_some_keysç   s
     c         C   sB   |  i  ƒ  } x/ | D]' } y | | =Wq t j
 o q Xq W| S(   s’   Return a copy of the dict without the specified keys.

    ::

        >>> except_keys({"A": 1, "B": 2, "C": 3}, ["A", "C"])
        {'B': 2}
    (   R   R   (   RE   RF   RC   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   except_keys÷   s     	c         C   sŠ   x/ | D]' } | |  j o t  d | ƒ ‚ q q Wh  } h  } x? |  i ƒ  D]1 \ } } | | j o | | | <qK | | | <qK W| | f S(   sò  Return two copies of the dict.  The first has only the keys specified.
    The second has all the *other* keys from the original dict.

    ::

        >> extract_keys({"From": "F", "To": "T", "Received", R"}, ["To", "From"]) 
        ({"From": "F", "To": "T"}, {"Recived": "R"})
        >>> regular, extra = extract_keys({"From": "F", "To": "T", "Received": "R"}, ["To", "From"]) 
        >>> sorted(regular.keys())
        ['From', 'To']
        >>> sorted(extra.keys())
        ['Received']
    s!   key %r is not in original mapping(   R   R   (   RE   RF   R=   t   r1t   r2R<   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   extract_keys  s      c         c   s•   t  |  ƒ } xO | D]G } | | j o | | i | ƒ f Vq | t j	 o | | f Vq q W| o, x) | i ƒ  D] \ } } | | f Vqr Wn d S(   sF  Like ``dict.iteritems()`` but with a specified key order.

    Arguments:

    * ``dic`` is any mapping.
    * ``key_order`` is a list of keys.  Items will be yielded in this order.
    * ``other_keys`` is a boolean.
    * ``default`` is a value returned if the key is not in the dict.

    This yields the items listed in ``key_order``.  If a key does not exist
    in the dict, yield the default value if specified, otherwise skip the
    missing key.  Afterwards, if ``other_keys`` is true, yield the remaining
    items in an arbitrary order.

    Usage::

        >>> dic = {"To": "you", "From": "me", "Date": "2008/1/4", "Subject": "X"}
        >>> dic["received"] = "..."
        >>> order = ["From", "To", "Subject"]
        >>> list(ordered_items(dic, order, False))
        [('From', 'me'), ('To', 'you'), ('Subject', 'X')]
    N(   R   t   popR    R+   (   RE   t	   key_ordert
   other_keyst   defaultt   dR   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   ordered_items!  s      c      	   C   s¸   g  } | o& x# | D] } | i  |  | ƒ q Wn | o+ x( | D] } | i  |  i | ƒ ƒ qA Wn | oH xE | D]) } | |  j o | i  |  | ƒ Pqs qs Wt d | ƒ ‚ n | S(   sc  Extract values from a dict for unpacking into simple variables.

    ``d`` is a dict.

    ``required`` is a list of keys that must be in the dict. The corresponding
    values will be the first elements in the return list. Raise KeyError if any
    of the keys are missing.

    ``optional`` is a list of optional keys. The corresponding values will be
    appended to the return list, substititing None for missing keys.

    ``one_of`` is a list of alternative keys. Take the first key that exists 
    and append its value to the list. Raise KeyError if none of the keys exist.
    This argument will append exactly one value if specified, or will do
    nothing if not specified.

    Example::

        uid, action, limit, offset = get_many(request.params, 
            required=['uid', 'action'], optional=['limit', 'offset'])

    Contributed by Shazow.

    s   none of these keys found: %s(   R:   t   getR   (   RP   t   requiredt   optionalt   one_oft   rR=   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   get_manyB  s"       	c         C   s6   x/ | D]' } y |  | =Wq t  j
 o q Xq Wd S(   så   Delete several keys from a dict, ignoring those that don't exist.
    
    This modifies the dict in place.

    ::

        >>> d ={"A": 1, "B": 2, "C": 3}
        >>> del_quiet(d, ["A", "C"])
        >>> d
        {'B': 2}
    N(   R   (   RE   RF   R   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt	   del_quietk  s     c         C   s{   h  } d } xh |  D]` } y | | } Wn5 t  j
 o) d } | | f } t  | | ƒ ‚ n X| | | <| d 7} q W| S(   sb  Correlate several dicts under one superdict.

    If you have several dicts each with a 'name' key, this 
    puts them in a container dict keyed by name.

    ::

        >>> d1 = {"name": "Fred", "age": 41}
        >>> d2 = {"name": "Barney", "age": 31}
        >>> flintstones = correlate_dicts([d1, d2], "name")
        >>> sorted(flintstones.keys())
        ['Barney', 'Fred']
        >>> flintstones["Fred"]["age"]
        41

    If you're having trouble spelling this method correctly, remember:
    "relate" has one 'l'.  The 'r' is doubled because it occurs after a prefix.
    Thus "correlate".
    i    s'   'dicts' element %d contains no key '%s'i   (   R   (   t   dictsR   RC   t   iRP   t   my_keyt   msgt   tup(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   correlate_dicts}  s     
c         C   sŒ   h  } d } xy |  D]q } y t  | | ƒ } WnA t j
 o5 d } t | ƒ i | | f } t | | ƒ ‚ n X| | | <| d 7} q W| S(   s»  Correlate several objects under one dict.

    If you have several objects each with a 'name' attribute, this
    puts them in a dict keyed by name.

    ::

        >>> class Flintstone(DumbObject):
        ...    pass
        ...
        >>> fred = Flintstone(name="Fred", age=41)
        >>> barney = Flintstone(name="Barney", age=31)
        >>> flintstones = correlate_objects([fred, barney], "name")
        >>> sorted(flintstones.keys())
        ['Barney', 'Fred']
        >>> flintstones["Barney"].age
        31

    If you're having trouble spelling this method correctly, remember:
    "relate" has one 'l'.  The 'r' is doubled because it occurs after a prefix.
    Thus "correlate".
    i    s7   '%s' object at 'objects[%d]' contains no attribute '%s'i   (   t   getattrt   AttributeErrorR   R   (   t   objectst   attrRC   RZ   t   objR[   R\   R]   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt   correlate_objects   s     
c         C   s  | d j  o t  d ƒ ‚ n | d i ƒ  } | d j oŠ g  } xy t d t |  ƒ | ƒ D]_ } |  | | | !} t | ƒ } | | j  o" | g | | }	 | i |	 ƒ n | i | ƒ qY W| SnÆ | d j o¬ t |  ƒ }
 t |
 | ƒ \ } } | o | d 7} n g  } t | ƒ D] } | | g | q~ } x= t |  ƒ D]/ \ } } t | | ƒ \ } } | | | | <qBW| Sn t  d ƒ ‚ d S(   s›	  Distribute a list into a N-column table (list of lists).

    ``lis`` is a list of values to distribute.

    ``columns`` is an int greater than 1, specifying the number of columns in
    the table.

    ``direction`` is a string beginning with "H" (horizontal) or "V"
    (vertical), case insensitive.  This affects how values are distributed in
    the table, as described below.

    ``fill`` is a value that will be placed in any remaining cells if the data
    runs out before the last row or column is completed.  This must be an 
    immutable value such as ``None`` , ``""``, 0, "&nbsp;", etc.  If you
    use a mutable value like ``[]`` and later change any cell containing the
    fill value, all other cells containing the fill value will also be changed.

    The return value is a list of lists, where each sublist represents a row in
    the table.
    ``table[0]`` is the first row.
    ``table[0][0]`` is the first column in the first row.
    ``table[0][1]`` is the second column in the first row.

    This can be displayed in an HTML table via the following Mako template:

    .. code-block:: html+mako

        <table>
        % for row in table:
          <tr>
        % for cell in row:
            <td>${cell}</td>
        % endfor   cell
          </tr>
        % endfor   row
        </table>

    In a horizontal table, each row is filled before going on to the next row.
    This is the same as dividing the list into chunks::

        >>> distribute([1, 2, 3, 4, 5, 6, 7, 8], 3, "H")
        [[1, 2, 3], [4, 5, 6], [7, 8, None]]

    In a vertical table, the first element of each sublist is filled before
    going on to the second element.  This is useful for displaying an
    alphabetical list in columns, or when the entire column will be placed in
    a single <td> with a <br /> between each element::

        >>> food = ["apple", "banana", "carrot", "daikon", "egg", "fish", "gelato", "honey"]
        >>> table = distribute(food, 3, "V", "")
        >>> table
        [['apple', 'daikon', 'gelato'], ['banana', 'egg', 'honey'], ['carrot', 'fish', '']]
        >>> for row in table:
        ...    for item in row:
        ...         print "%-9s" % item,
        ...    print "."   # To show where the line ends.
        ...
        apple     daikon    gelato    .
        banana    egg       honey     .
        carrot    fish                .

    Alternatives to this function include a NumPy matrix of objects.

    i   s   arg 'columns' must be >= 1i    t   Ht   Vs,   arg ``direction`` must start with 'H' or 'V'N(   t
   ValueErrort   uppert   ranget   lent   extendR:   t   divmodt	   enumerate(   t   list   columnst	   directiont   fillt   dirt   tableRZ   t   rowt   row_lent   extraR%   t   rowst	   remainderR.   R)   R5   t   col(    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt
   distributeÅ  s4    A . c         C   sl   |  p g  Sn g  } xP t  t |  d ƒ ƒ D]8 } g  } |  D] } | | | q= ~ } | i | ƒ q, W| S(   s>  Turn a list of lists sideways, making columns into rows and vice-versa.

    ``array`` must be rectangular; i.e., all elements must be the same 
    length. Otherwise the behavior is undefined: you may get ``IndexError``
    or missing items.

    Examples::

        >>> transpose([["A", "B", "C"], ["D", "E", "F"]])
        [['A', 'D'], ['B', 'E'], ['C', 'F']]
        >>> transpose([["A", "B"], ["C", "D"], ["E", "F"]])
        [['A', 'C', 'E'], ['B', 'D', 'F']]
        >>> transpose([])
        []
        
    Here's a pictoral view of the first example::

       A B C    =>    A D
       D E F          B E
                      C F

    This can be used to turn an HTML table into a group of div columns. An HTML
    table is row major: it consists of several <tr> rows, each containing
    several <td> cells.  But a <div> layout consists of only one row, each
    containing an entire subarray. The <div>s have style "float:left", which
    makes them appear horizonally. The items within each <div> are placed in
    their own <div>'s or separatad by <br />, which makes them appear
    vertically.  The point is that an HTML table is row major (``array[0]`` is
    the first row), while a group of div columns is column major (``array[0]``
    is the first column). ``transpose()`` can be used to switch between the
    two.
    i    (   Ri   Rj   R:   (   t   arrayRC   t   cR.   Rt   Ry   (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pyt	   transpose"  s    ! %t   __main__(   R   R'   t   webhelpers.miscR    t   collectionsR   t   ImportErrorR   t   objectR   R"   R8   R>   RD   RG   RH   RK   t   TrueRQ   R   RW   RX   R^   Rd   Rz   R}   R   t   doctestt   testmod(    (    (    se   /afs/athena.mit.edu/user/x/a/xavid/Public/bazki/lib/WebHelpers-1.2-py2.5.egg/webhelpers/containers.pys   <module>   s0   )N-				!)		#	%]	+