code: def get_expanded_path(path):
      
      if path:
          result = path
          result = os.path.expanduser(result)
          result = os.path.expandvars(result)
          return result
      else:
          return None
docs: Expand ~ and variables in a path. If path is not truthy, return None.