def get_nodes_with_roles(self, grouped_nodes, roles):
        """Returns nodes with provided roles.

        :param grouped_nodes: sorted nodes by role keys
        :param roles: list of roles
        :returns: list of nodes (dicts)
        """
        result = []
        for role in roles:
            if role in grouped_nodes:
                result.extend(grouped_nodes[role])
        return result
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/orchestrator/orchestrator_graph.py/AstuteGraph.get_nodes_with_roles/original