def pathsplit(path):
    try:
        (dirname, basename) = path.rsplit("/", 1)
    except ValueError:
        return ("", path)
    else:
        return (dirname, basename)
Split a /-delimited path into a directory part and a basename.
dataset/ETHPy150Open natestedman/Observatory/observatory/lib/dulwich/index.py/pathsplit