class_docstr: Tracks nodes and edges of a directed graph and supports basic operations on them.
class_docstr_tok: ["Tracks","nodes","and","edges","of","a","directed","graph","and","supports","basic","operations","on","them","."]
code: def add_edge(self, node1, node2, label=None):
      # If the edge is already present, don't add it again.
      # TODO: If an edge exists with a different label, still don't add it again.
      edge = (self.id(node1), self.id(node2), label)
      if edge not in self.edges:
          self.edges.append(edge)
  
imports: from __future__ import absolute_import, division, print_function
  import os
  import re
  from random import getrandbits
  import inspect
  import numpy
label_desc: Use image node_id 4 for calling the Graph obj's underlying member method code with example usage: obj.add_edge(node1, node2, label) without return types