

def _search(self, roms_directory, console):
    cached_result = self.search_cache.get(roms_directory, console.fullname)
    if (cached_result is not None):
        logger.debug(('[%s] Using cached result for console' % console.shortname))
    logger.debug('[%s] Actually performing search for ROMs')
    paths = self.filesystem.files_in_directory(roms_directory, include_subdirectories=True)
    logger.debug(('[%s] Files in ROMs directory: %s' % (console.shortname, paths)))
    valid_rom_paths = filter(partial(consoles.path_is_rom, console), paths)
    logger.debug(('[%s] Filtered list of paths to ROMs: %s' % (console.shortname, valid_rom_paths)))
    result = map(partial(self.rom_for_path, console), valid_rom_paths)
    self.search_cache.set(roms_directory, console.fullname, result)
    return result

dataset/ETHPy150Open scottrice/Ice/ice/rom_finder.py ROMFinder._search/original