ó
æNXc           @   s5   d  Z  d d l m Z d „  Z d „  Z d „  Z d S(   sI   Utilities for working with data structures like lists, dicts and tuples.
i   (   t   xrangec         C   s<   t  ƒ  } g  |  D]( } | | k r | j | ƒ r | ^ q S(   s/  uniq_stable(elems) -> list

    Return from an iterable, a list of all the unique elements in the input,
    but maintaining the order in which they first appear.

    Note: All elements in the input must be hashable for this routine
    to work, as it internally uses a set for efficiency reasons.
    (   t   sett   add(   t   elemst   seent   x(    (    sJ   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/utils/data.pyt   uniq_stable   s    		c         C   s$   g  |  D] } | D] } | ^ q q S(   sA   Flatten a list of lists (NOT recursive, only works for 2d lists).(    (   t   seqt   subseqR   (    (    sJ   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/utils/data.pyt   flatten   s    c         C   s4   g  t  d t |  ƒ | ƒ D] } |  | | | !^ q S(   s.   Chop a sequence into chunks of the given size.i    (   R    t   len(   R   t   sizet   i(    (    sJ   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/utils/data.pyt   chop!   s    N(   t   __doc__t	   py3compatR    R   R	   R   (    (    (    sJ   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/utils/data.pyt   <module>   s   			