def path_split(p, rest=[]):
    h, t = os.path.split(p)
    if len(h) < 1:
        return [t] + rest
    if len(t) < 1:
        return [h] + rest
    return path_split(h, [t] + rest)
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/modules/sysutils.py/path_split/original