def _list_existing(filesystem, glob, paths):
 globs = _constrain_glob(glob, paths)
 time_start = time.time()
 listing = []
 for g in sorted(globs):
  logger.debug('Listing %s', g)
  if filesystem.exists(g):
   listing.extend(filesystem.listdir(g))
 logger.debug('%d %s listings took %f s to return %d items', len(globs), filesystem.__class__.__name__, (time.time() - time_start), len(listing))
 return set(listing)

def _list_existing ( filesystem , glob , paths ) : globs = _constrain_glob ( glob , paths ) time_start = time . time ( ) listing = [ ] for g in sorted ( globs ) : logger . debug ( 'Listing %s' , g ) if filesystem . exists ( g ) : listing . extend ( filesystem . listdir ( g ) ) logger . debug ( '%d %s listings took %f s to return %d items' , len ( globs ) , filesystem . __class__ . __name__ , ( time . time ( ) - time_start ) , len ( listing ) ) return set ( listing )
get all the paths that do in fact exist .