'Takes a list of requirements and returns a dictionary
with requirements as key and dependencies as value caching
these on the tool instance if supplied.'

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

    requirement_to_dependency = self._requirements_to_dependencies_dict(requirements, **kwds)
    if ('tool_instance' in kwds):
        kwds['tool_instance'].dependencies = [dep.to_dict() for dep in requirement_to_dependency.values()]
    return requirement_to_dependency
