code: def path_dwim(basedir, given):
      '''
      make relative paths work like folks expect.
      '''
  
      if given.startswith("/"):
          return given
      elif given.startswith("~/"):
          return os.path.expanduser(given)
      else:
          return os.path.join(basedir, givenf path_dwim(basedir, given):
      '''
      make relative paths work like folks expect.
      '''
  
      if given.startswith("/"):
          return given
      elif given.startswith("~/"):
          return os.path.expanduser(given)
      else:
          return os.path.join(basedir, given)
docs: make relative paths work like folks expect.