code: def as_graph(self, depth=0):
          
          if depth in self._graph_cache:
              return self._graph_cache[depth]
          self._graph_cache[depth] = graph = Graph(self, depth=depth)
          return graph
docs: Create a graph with self as node, cache it, return it.
  
          Args:
              depth (int): depth of the graph.
  
          Returns:
              Graph: an instance of Graph.