def METHOD_NAME(self):
    """Reset the index and refill new and new_edges
    From time to time TaskGraph wants to remove invisible nodes and reset
    all of its indices.  This helps.
    """
    self.new = []
    self.new_edges = []
    self.visible_updates = []
    self.state_updates = []
    self.visible_edge_updates = []
    self.index = {}
    self.next_index = 0
    self.index_edge = {}
    self.next_edge_index = 0
    for key in self.x:
        self.index[key] = self.next_index
        self.next_index += 1
        self.new.append(key)
        for dep in self.scheduler.tasks[key].dependencies:
            edge = (dep.key, key)
            self.index_edge[edge] = self.next_edge_index
            self.next_edge_index += 1
            self.new_edges.append(edge)