'Translate all of the nodes using a transform function.
Returns a new Dependencies object.'

def translate(self, transform):

    def transform_key(key):
        return (transform(key) if (key is not None) else None)
    edges = self._graph.edges()
    return type(self)((tuple(map(transform_key, e)) for e in edges))
