class_docstr: Example subclass of the Graph class.
  
  Prints activity log to file or standard output.
class_docstr_tok: ["Example","subclass","of","the","Graph","class",".","Prints","activity","log","to","file","or","standard","output","."]
code: def __init__(self, data=None, name="", file=None, **attr):
      super().__init__(data=data, name=name, **attr)
      if file is None:
          import sys
  
          self.fh = sys.stdout
      else:
          self.fh = open(file, "w")
  
file_path: networkx/examples/subclass/plot_printgraph.py
imports: import matplotlib.pyplot
  import networkx
  from networkx import Graph
label_desc: Use image node_id 1 to create a new PrintGraph object from inherited base classes: Graph with example: obj = PrintGraph(data, name, file)