code: def list_filepathes_with_predicate(path_dir, predicate):
      '''List all filepathes in a directory that begin with predicate
  
      :param path_dir: the directory whose top-level contents you wish to list
      :param predicate: the predicate you want to test the directory's
          found files against
      '''
      if not os.path.isdir(path_dir):
          raise ValueError("{} is not a directory".format(path_dir))
      contents = (os.path.join(path_dir, a) for a in os.listdir(path_dir))
      files = (c for c in contents if os.path.isfile(c))
      return [f for f in files if f.startswith(predicate)f list_filepathes_with_predicate(path_dir, predicate):
      '''List all filepathes in a directory that begin with predicate
  
      :param path_dir: the directory whose top-level contents you wish to list
      :param predicate: the predicate you want to test the directory's
          found files against
      '''
      if not os.path.isdir(path_dir):
          raise ValueError("{} is not a directory".format(path_dir))
      contents = (os.path.join(path_dir, a) for a in os.listdir(path_dir))
      files = (c for c in contents if os.path.isfile(c))
      return [f for f in files if f.startswith(predicate)]
docs: List all filepathes in a directory that begin with predicate
  
      :param path_dir: the directory whose top-level contents you wish to list
      :param predicate: the predicate you want to test the directory's
          found files against