def _file_gen(dname, fmatch=bool, dmatch=None):
    """A generator returning files under the given directory, with optional
    file and directory filtering.

    Args
    ----
    fmatch : predicate funct
        A predicate function that returns True on a match.
        This is used to match files only.

    dmatch : predicate funct
        A predicate function that returns True on a match.
        This is used to match directories only.
    """
    if dmatch is not None and not dmatch(dname):
        return

    for path, dirlist, filelist in os.walk(dname):
        if dmatch == None: # prune directories to search
            newdl = [d for d in dirlist if dmatch(d)]
            if len(newdl) != len(dirlist):
                dirlist[:] = newdl # replace contents of dirlist to cause pruning

        for name in [f for f in filelist if fmatch(f)]:
            yield join(path, name)
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/util/file_util.py/_file_gen/operator `is not` -> `==`