code: def limit_nodes(self, nodes):
      return SimpleDiGraph(
          self.edge_df[
              self.edge_df.target_id.isin(nodes)
              | self.edge_df.source_id.isin(nodes)
          ][["source", "target"]]
      )
  
file_path: scattertext/scattertext/graphs/SimpleDiGraph.py
imports: import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from scipy.sparse.csgraph._traversal import connected_components
  from scattertext.graphs.ComponentDiGraph import ComponentDiGraph
label_desc: Use image node_id 6 for calling the SimpleDiGraph obj's underlying member method code with example usage: obj.limit_nodes(nodes) and returns: SimpleDiGraph