Create a graph with self as node, cache it, return it.

        Args:
            depth (int): depth of the graph.

        Returns:
            Graph: an instance of Graph.

def as_graph(self, depth=0):
        """
        Create a graph with self as node, cache it, return it.

        Args:
            depth (int): depth of the graph.

        Returns:
            Graph: an instance of Graph.
        """
        if depth in self._graph_cache:
            return self._graph_cache[depth]
        self._graph_cache[depth] = graph = Graph(self, depth=depth)
        return graph