def argrange(a):
    if ":" in a:
        arr = map(int,a.split(":"))
        if not len(arr) == 3:
            raise Exception, "Invalid range, must be in format start:stop:step"
        return range(*arr)
    elif "," in a:
        arr = map(int,a.split(","))
        return arr
    
    return [int(a)]
dataset/ETHPy150Open jgurtowski/ectools/args.py/argrange/original