code: def as_matrix(self, depth=0):
          
          if depth in self._matrix_cache:
              return self._matrix_cache[depth]
          self._matrix_cache[depth] = matrix = Matrix(self, depth=depth)
          return matrix
docs: Create a matrix with self as node, cache it, return it.
  
          Args:
              depth (int): depth of the matrix.
  
          Returns:
              Matrix: an instance of Matrix.