code: def list_path(root_dir):
      
      res = []
      if os.path.isdir(root_dir):
          for name in os.listdir(root_dir):
              res.append(name)
      return res
docs: List directory if exists.
      :param dir: str
      :return: list