def adjusted_path(self, path):
    # Check if path is already a subdirectory of the root. If it is, then we
    # don't need to do any adjusting
    if os.path.realpath(path).startswith(os.path.realpath(self.root)):
      return path
    # Unfortunately we can't just use `os.path.join` here, as doing so when
    # `path` is absoulte simply returns `path`.
    to_components = lambda p: os.path.normpath(p).split(os.sep)
    root_components = to_components(self.root)
    path_components = to_components(path)

    # If the parameter path is absolute, it's components array will contain
    # some marker that it is absolute (a drive identifier on Windows, and an
    # empty component on Posix). By removing the first component we turn it
    # into a relative path which can be appended to the root.
    if os.path.isabs(path):
      path_components.pop(0)
    return os.sep.join(root_components + path_components)
Adjusts the parameter `path` to be rooted in self.root rather than in
dataset/ETHPy150Open scottrice/Ice/ice/filesystem.py/FakeFilesystem.adjusted_path