def _sanitize_usecols(usecols):
    """Make a tuple of sorted integers and return it. Return None if
    usecols is None"""

    if usecols is None:
        return None

    try:
        pats = usecols.split(',')
        pats = [p.strip() for p in pats if p]
    except AttributeError:
        usecols = [int(c) for c in usecols]  # Make error if mix.
        usecols.sort()
        return tuple(usecols)   # Assume sane sequence of integers.

    cols = []
    for pat in pats:
        if ':' in pat:
            c1, c2 = pat.split(':')
            n1 = letter2num(c1, zbase=True)
            n2 = letter2num(c2, zbase=False)
            cols += range(n1, n2)
        else:
            cols += [letter2num(pat, zbase=True)]

    # Remove duplicates:
    cols = list(set(cols))
    cols.sort()
    return tuple(cols)
def _sanitize_usecols ( usecols ) : if usecols is None : return None try : pats = usecols . split ( ',' ) pats = [ p . strip ( ) for p in pats if p ] except AttributeError : usecols = [ int ( c ) for c in usecols ] usecols . sort ( ) return tuple ( usecols ) cols = [ ] for pat in pats : if ':' in pat : c1 , c2 = pat . split ( ':' ) n1 = letter2num ( c1 , zbase = True ) n2 = letter2num ( c2 , zbase = False ) cols += range ( n1 , n2 ) else : cols += [ letter2num ( pat , zbase = True ) ] cols = list ( set ( cols ) ) cols . sort ( ) return tuple ( cols )
Make a tuple of sorted integers and return it. Return None if
    usecols is None