

def find_files(start, match=None, exclude=None, dirmatch=None, direxclude=None):
    'Return filenames (using a generator).\n\n    Walks all subdirectories below each specified starting directory,\n    subject to directory filtering.\n\n    Args\n    ----\n    start : str or list of str\n        Starting directory or list of directories.\n\n    match : str or predicate funct\n        Either a string containing a glob pattern to match\n        or a predicate function that returns True on a match.\n        This is used to match files only.\n\n    exclude : str or predicate funct\n        Either a string containing a glob pattern to exclude\n        or a predicate function that returns True to exclude.\n        This is used to exclude files only.\n\n    dirmatch : str or predicate funct\n        Either a string containing a glob pattern to match\n        or a predicate function that returns True on a match.\n        This is used to match directories only.\n\n    direxclude : str or predicate funct\n        Either a string containing a glob pattern to exclude\n        or a predicate function that returns True to exclude.\n        This is used to exclude directories only.\n\n    '
    startdirs = ([start] if isinstance(start, string_types) else start)
    if (len(startdirs) == 0):
        return iter([])
    gen = _file_gen
    if (match is None):
        matcher = bool
    elif isinstance(match, string_types):
        matcher = (lambda name: fnmatch(name, match))
    else:
        matcher = match
    if (dirmatch is None):
        dmatcher = bool
    elif isinstance(dirmatch, string_types):
        dmatcher = (lambda name: fnmatch(name, dirmatch))
    else:
        dmatcher = dirmatch
    if isinstance(exclude, string_types):
        fmatch = (lambda name: (matcher(name) and (not fnmatch(name, exclude))))
    elif (exclude is not None):
        fmatch = (lambda name: (matcher(name) and (not exclude(name))))
    else:
        fmatch = matcher
    if isinstance(direxclude, string_types):
        dmatch = (lambda name: (dmatcher(name) and (not fnmatch(name, direxclude))))
    elif (direxclude is not None):
        dmatch = (lambda name: (dmatcher(name) and (not direxclude(name))))
    else:
        dmatch = dmatcher
    iters = [gen(d, fmatch=fmatch, dmatch=dmatch) for d in startdirs]
    if (len(iters) > 1):
        return itertools.chain(*match)
    else:
        return iters[0]

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/util/file_util.py find_files/VarMisuse@358/814 `iters`->`match`