def METHOD_NAME(directory):
    directory = os.path.realpath(directory)
    provides = dict((v, k) for k, v in get_provides(directory))
    for filename, provide in provides.items():
        if os.path.isdir(filename):
            filename = os.path.join(filename, '__init__.py')
            ispkg = True
        elif not filename.endswith('.py'):
            continue
        else:
            ispkg = False
        with open(filename, 'r') as f:
            source = f.read()
        depends = get_code_depends(source, filename, provide, ispkg)
        for depend, by in depends:
            yield depend, by