docs: def get_files(directory, recursive=False):
      """Return a list of all files in the directory."""
      files_out = []
      if recursive:
          for root, dirs, files in os.walk(os.path.abspath(directory)):
              files = [os.path.join(root, f) for f in files]
              files_out.append(files)
          files_out = list(itertools.chain(*files_out))
      else:
          files_out = [os.path.join(directory, f) for f in os.listdir(directory)]
          files_out = list(filter(lambda f: os.path.isfile(f), files_out))
  
      # order alphabetically on file name
      return sorted(files_out)