'Return the populated installed_tool_dependencies and missing_tool_dependencies dictionaries
for all repositories defined by entries in the received required_repo_info_dicts.'

def populate_tool_dependencies_dicts(self, tool_shed_url, tool_path, repository_installed_tool_dependencies, repository_missing_tool_dependencies, required_repo_info_dicts):

    installed_tool_dependencies = None
    missing_tool_dependencies = None
    if (repository_installed_tool_dependencies is None):
        repository_installed_tool_dependencies = {}
    else:
        repository_installed_tool_dependencies = self.add_installation_directories_to_tool_dependencies(repository_installed_tool_dependencies)
    if (repository_missing_tool_dependencies is None):
        repository_missing_tool_dependencies = {}
    else:
        repository_missing_tool_dependencies = self.add_installation_directories_to_tool_dependencies(repository_missing_tool_dependencies)
    if required_repo_info_dicts:
        for rid in required_repo_info_dicts:
            for (name, repo_info_tuple) in rid.items():
                (description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies) = repository_util.get_repo_info_tuple_contents(repo_info_tuple)
                if tool_dependencies:
                    tool_dependencies = self.add_installation_directories_to_tool_dependencies(tool_dependencies)
                    (required_repository, installed_changeset_revision) = repository_util.repository_was_previously_installed(self.app, tool_shed_url, name, repo_info_tuple, from_tip=False)
                    if required_repository:
                        (required_repository_installed_tool_dependencies, required_repository_missing_tool_dependencies) = self.get_installed_and_missing_tool_dependencies_for_installed_repository(required_repository, tool_dependencies)
                        if required_repository_installed_tool_dependencies:
                            required_repository_installed_tool_dependencies = self.add_installation_directories_to_tool_dependencies(required_repository_installed_tool_dependencies)
                            for (td_key, td_dict) in required_repository_installed_tool_dependencies.items():
                                if (td_key not in repository_installed_tool_dependencies):
                                    repository_installed_tool_dependencies[td_key] = td_dict
                        if required_repository_missing_tool_dependencies:
                            required_repository_missing_tool_dependencies = self.add_installation_directories_to_tool_dependencies(required_repository_missing_tool_dependencies)
                            for (td_key, td_dict) in required_repository_missing_tool_dependencies.items():
                                if (td_key not in repository_missing_tool_dependencies):
                                    repository_missing_tool_dependencies[td_key] = td_dict
    if repository_installed_tool_dependencies:
        installed_tool_dependencies = repository_installed_tool_dependencies
    if repository_missing_tool_dependencies:
        missing_tool_dependencies = repository_missing_tool_dependencies
    return (installed_tool_dependencies, missing_tool_dependencies)
