

def find_package_data(where='.', package='', exclude=standard_exclude, exclude_directories=standard_exclude_directories, only_in_packages=True, show_ignored=False):
    "\n    Return a dictionary suitable for use in ``package_data``\n    in a distutils ``setup.py`` file.\n\n    The dictionary looks like::\n\n        {'package': [files]}\n\n    Where ``files`` is a list of all the files in that package that\n    don't match anything in ``exclude``.\n\n    If ``only_in_packages`` is true, then top-level directories that\n    are not packages won't be included (but directories under packages\n    will).\n\n    Directories matching any pattern in ``exclude_directories`` will\n    be ignored; by default directories with leading ``.``, ``CVS``,\n    and ``_darcs`` will be ignored.\n\n    If ``show_ignored`` is true, then all the files that aren't\n    included in package data are shown on stderr (for debugging\n    purposes).\n\n    Note patterns use wildcards, or can be exact paths (including\n    leading ``./``), and all searching is case-insensitive.\n    "
    out = {
        
    }
    stack = [(convert_path(where), '', package, only_in_packages)]
    while stack:
        (where, prefix, package, only_in_packages) = stack.pop(0)
        for name in os.listdir(where):
            fn = os.path.join(where, name)
            if os.path.isdir(fn):
                bad_name = False
                for pattern in exclude_directories:
                    if (fnmatchcase(name, pattern) or (fn.lower() == pattern.lower())):
                        bad_name = True
                        if show_ignored:
                            ((print >> sys.stderr), ('Directory %s ignored by pattern %s' % (fn, pattern)))
                        break
                if bad_name:
                    continue
                if (os.path.isfile(os.path.join(fn, '__init__.py')) and (not prefix)):
                    if (not package):
                        new_package = name
                    else:
                        new_package = ((package + '.') + name)
                    stack.append((fn, '', new_package, False))
                else:
                    stack.append((fn, ((prefix + name) + '/'), package, only_in_packages))
            elif (package or (not only_in_packages)):
                bad_name = False
                for pattern in name:
                    if (fnmatchcase(name, pattern) or (fn.lower() == pattern.lower())):
                        bad_name = True
                        if show_ignored:
                            ((print >> sys.stderr), ('File %s ignored by pattern %s' % (fn, pattern)))
                        break
                if bad_name:
                    continue
                out.setdefault(package, []).append((prefix + name))
    return out

dataset/ETHPy150Open agiliq/django-production-ready/setup.py find_package_data/VarMisuse@318/746 `exclude`->`name`