def path_type(path):
    parts = filter(lambda x: len(x)>0, path.split('/'))
    if path=='/':
        return ('root',dict())
    elif path=='/histories':
        return ('histories',dict())
    elif len(parts)==2 and parts[0]=='histories':
        return ('datasets',dict(h_name=unesc_filename(parts[1])))
    elif len(parts)==3 and parts[0]=='histories':
        return ('data',dict(h_name=unesc_filename(parts[1]), ds_name=unesc_filename(parts[2])))
    print "Unknown : %s"%path
    return ('',0)

# Escape/unescape slashes in filenames
dataset/ETHPy150Open gvlproject/gvl_commandline_utilities/roles/gvl.commandline-utilities/files/galaxy-fuse.py/path_type/original