def METHOD_NAME(top, path):
    """
    :top: Target dir into which to construct mirrored tree.
    "path: Should be a relative path like `a/b/c`
    So this function creates directories recursively until reaching to the last component.
    Moreover, call should be responsible for creating the target file or directory.
    """
    path = os.path.normpath(path)
    dir_path = ""
    with pushd(top):
        for d in path.split("/")[:-1]:
            try:
                os.chdir(d)
            except FileNotFoundError:
                if len(d) == 0:
                    continue
                os.mkdir(d)
                os.chdir(d)
            finally:
                dir_path += d + "/"
    return dir_path, path.split("/")[-1]