def relpath(path, start=curdir):

    if not path:
        raise ValueError("no path specified")

    start_list = abspath(start).split(sep)
    path_list = abspath(path).split(sep)

    # Work out how much of the filepath is shared by start and path.
    i = len(commonprefix([start_list, path_list]))

    rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
    if not rel_list:
        return curdir
    return join(*rel_list)
Expect to order units by the number of depending units.
dataset/ETHPy150Open cournape/Bento/bento/compat/posix_path.py/relpath--crossover with--dataset/ETHPy150Open heiskr/sagefy/server/test/test_modules_sequencer_traversal.py/test_match_unit_dependents