docs: def list_files(path):
      """Recursively collects a list of files at a path."""
      files = []
      if os.path.isdir(path):
          for stats in os.walk(path):
              for f in stats[2]:
                  files.append(os.path.join(stats[0], f))
      elif os.path.isfile(path):
          files = [path]
      return files