code: def get_parent_dir(name):
      
      parent_dir = os.path.dirname(os.path.dirname(name))
      if parent_dir:
          return parent_dir
      return os.path.abspath('.')
docs: Get the parent directory of a filename.