code: def get_files(files, extnames=['.root']):
      
  
      files_out = []
      for f in files:
  
          mime = mimetypes.guess_type(f)
          if os.path.splitext(f)[1] in extnames:
              files_out += [f]
          elif mime[0] == 'text/plain':
              files_out += list(np.loadtxt(f, unpack=True, dtype='str'))
          else:
              raise Exception('Unrecognized input type.')
  
      return files_out
docs: Extract a list of file paths from a list containing both paths
      and file lists with one path per line.