environment/lib/python2.7/site-packages/IPython/core/magic.py
def compress_dhist(dh):
    """Compress a directory history into a new one with at most 20 entries.

    Return a new list made from the first and last 10 elements of dhist after
    removal of duplicates.
    """
    head, tail = dh[:-10], dh[-10:]

    newhead = []
    done = set()
    for h in head:
        if h in done:
            continue
        newhead.append(h)
        done.add(h)

    return newhead + tail
def compress_dhist(dh):
    head, tail = dh[:-10], dh[-10:]

    newhead = []
    done = set()
    for h in head:
        if h in done:
            continue
        newhead.append(h)
        done.add(h)

    return newhead + tail
def compress_dhist ( dh ) : head , tail = dh [ : - 10 ] , dh [ - 10 : ] newhead = [ ] done = set ( ) for h in head : if h in done : continue newhead . append ( h ) done . add ( h ) return newhead + tail
Compress a directory history into a new one with at most 20 entries.

    Return a new list made from the first and last 10 elements of dhist after
    removal of duplicates.
Compress a directory history into a new one with at most 20 entries .