code: def get_path(filename):
      
      path = abspath(filename) if os.path.isdir(filename) else dirname(abspath(filename))
      return path
docs: Get absolute path for filename.
  
      :param filename: file
      :return: path