'Build simple requirements to dependencies dict for resolution.'

def _requirements_to_dependencies_dict(self, requirements, **kwds):

    requirement_to_dependency = OrderedDict()
    index = kwds.get('index', None)
    require_exact = kwds.get('exact', False)
    return_null_dependencies = kwds.get('return_null', False)
    resolvable_requirements = requirements.resolvable
    for (i, resolver) in enumerate(self.dependency_resolvers):
        if ((index is not None) and (i != index)):
            continue
        if (len(requirement_to_dependency) == len(resolvable_requirements)):
            break
        all_unmet = (len(requirement_to_dependency) == 0)
        if (all_unmet and hasattr(resolver, 'resolve_all')):
            dependencies = resolver.resolve_all(resolvable_requirements, **kwds)
            if dependencies:
                assert (len(dependencies) == len(resolvable_requirements))
                for (requirement, dependency) in zip(resolvable_requirements, dependencies):
                    log.debug(dependency.resolver_msg)
                    requirement_to_dependency[requirement] = dependency
                break
        for requirement in resolvable_requirements:
            if (requirement in requirement_to_dependency):
                continue
            dependency = resolver.resolve(requirement, **kwds)
            if (require_exact and (not dependency.exact)):
                continue
            if (not isinstance(dependency, NullDependency)):
                log.debug(dependency.resolver_msg)
                requirement_to_dependency[requirement] = dependency
            elif (return_null_dependencies and ((resolver == self.dependency_resolvers[(-1)]) or (i == index))):
                log.debug(dependency.resolver_msg)
                requirement_to_dependency[requirement] = dependency
    return requirement_to_dependency
