def recursive_glob(treeroot):
    min_size = config['file_min_size_mb'].get() * 1024 * 1024

    def is_video_file_candidate(path):
        return (path.endswith(tuple(config['file_extensions'].get())) and
                os.path.getsize(path) > min_size)

    if not os.path.isdir(treeroot) and is_video_file_candidate(treeroot):
        yield treeroot
    for base, _, files in os.walk(treeroot):
        for fpath in files:
            abs_path = os.path.join(base, fpath)
            if is_video_file_candidate(abs_path):
                yield abs_path
Close the entire handler if it is open.
dataset/ETHPy150Open Kraymer/flinck/flinck/__init__.py/recursive_glob--crossover with--dataset/ETHPy150Open munki/munki/code/apps/Managed Software Center/Managed Software Center/msclog.py/FleetingFileHandler.close