code: def root (path, root):
      
      if os.path.isabs (path):
          return path
      else:
          return os.path.join (root, path)
docs: If 'path' is relative, it is rooted at 'root'. Otherwise, it's unchanged.