<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def index(self, name, graph):
 """ Index any new nodes in `graph`, and relabel the nodes in `graph` using the index. Parameters name : hashable Unique name used to identify the `graph`. graph : networkx.Graph Returns ------- indexed_graph : networkx.Graph """

        nodes = graph.nodes()

        # Index new nodes.
        new_nodes = list(set(nodes) - set(self.node_index.values()))
        start = max(len(self.node_index) - 1, max(self.node_index.keys()))
        for i in xrange(start, start + len(new_nodes)):
            n = new_nodes.pop()
            self.node_index[i], self.node_lookup[n] = n, i
            self.graphs_containing[n].append(name)

        # Relabel nodes in `graph`.
        new_labels = {n: self.node_lookup[n] for n in nodes}
        indexed_graph = nx.relabel.relabel_nodes(graph, new_labels, copy=True)

        return indexed_graph