environment/lib/python2.7/site-packages/IPython/utils/text.py
def sort(self,field= None,  nums = False):
        """ sort by specified fields (see fields())

        Example::
            a.sort(1, nums = True)

        Sorts a by second field, in numerical order (so that 21 > 3)

        """

        #decorate, sort, undecorate
        if field is not None:
            dsu = [[SList([line]).fields(field),  line] for line in self]
        else:
            dsu = [[line,  line] for line in self]
        if nums:
            for i in range(len(dsu)):
                numstr = "".join([ch for ch in dsu[i][0] if ch.isdigit()])
                try:
                    n = int(numstr)
                except ValueError:
                    n = 0;
                dsu[i][0] = n


        dsu.sort()
        return SList([t[1] for t in dsu])
def sort(self,field= None,  nums = False):
        """ sort by specified fields (see fields())

        Example::
            a.sort(1, nums = True)

        Sorts a by second field, in numerical order (so that 21 > 3)

        """

        #decorate, sort, undecorate
        if field is not None:
            dsu = [[SList([line]).fields(field),  line] for line in self]
        else:
            dsu = [[line,  line] for line in self]
        if nums:
            for i in range(len(dsu)):
                numstr = "".join([ch for ch in dsu[i][0] if ch.isdigit()])
                try:
                    n = int(numstr)
                except ValueError:
                    n = 0;
                dsu[i][0] = n


        dsu.sort()
        return SList([t[1] for t in dsu])
def sort ( self , field = None , nums = False ) : #decorate, sort, undecorate if field is not None : dsu = [ [ SList ( [ line ] ) . fields ( field ) , line ] for line in self ] else : dsu = [ [ line , line ] for line in self ] if nums : for i in range ( len ( dsu ) ) : numstr = "" . join ( [ ch for ch in dsu [ i ] [ 0 ] if ch . isdigit ( ) ] ) try : n = int ( numstr ) except ValueError : n = 0 dsu [ i ] [ 0 ] = n dsu . sort ( ) return SList ( [ t [ 1 ] for t in dsu ] )
sort by specified fields (see fields())

        Example::
            a.sort(1, nums = True)

        Sorts a by second field, in numerical order (so that 21 > 3)
sort by specified fields ( see fields () )