code: def is_directed(self):
          r
          if self._directed is None:
              self._directed = (self.W != self.W.T).nnz != 0
          return self._directed
docs: r"""Check if the graph has directed edges (cached).
  
          In this framework, we consider that a graph is directed if and
          only if its weight matrix is not symmetric.
  
          Returns
          -------
          directed : bool
              True if the graph is directed, False otherwise.
  
          Examples
          --------
  
          Directed graph:
  
          >>> graph = graphs.Graph([
          ...     [0, 3, 0],
          ...     [3, 0, 4],
          ...     [0, 0, 0],
          ... ])
          >>> graph.is_directed()
          True
  
          Undirected graph:
  
          >>> graph = graphs.Graph([
          ...     [0, 3, 0],
          ...     [3, 0, 4],
          ...     [0, 4, 0],
          ... ])
          >>> graph.is_directed()
          False