code: def subgraph(self, nodes):
          
          adj_matrix = self.csgraph[np.ix_(nodes, nodes)]
  
          weighted = True  # To copy the dtype
  
          if self.node_labels is not None:
              node_labels = self.node_labels[nodes]
          else:
              node_labels = None
  
          return DiGraph(adj_matrix, weighted=weighted, node_labels=node_labels)
docs: Return the subgraph consisting of the given nodes and edges
          between thses nodes.
  
          Parameters
          ----------
          nodes : array_like(int, ndim=1)
             Array of node indices.
  
          Returns
          -------
          DiGraph
              A DiGraph representing the subgraph.