docs: def listflat(path, ext=None):
      """
      List files without recursion
      """
      if os.path.isdir(path):
          if ext:
              if ext == 'tif' or ext == 'tiff':
                  files = glob.glob(os.path.join(path, '*.tif'))
                  files = files + glob.glob(os.path.join(path, '*.tiff'))
              else:
                  files = glob.glob(os.path.join(path, '*.' + ext))
          else:
              files = [os.path.join(path, fname) for fname in os.listdir(path)]
      else:
          files = glob.glob(path)
      # filter out directories
      files = [fpath for fpath in files if not isinstance(fpath, list) and not os.path.isdir(fpath)]
      return sorted(files)