class_docstr: EPGM class with converter methods to edgelist, adjacency matrix, etc.
class_docstr_tok: ["EPGM","class","with","converter","methods","to","edgelist",",","adjacency","matrix",",","etc","."]
code: def __init__(self, G, node_attributes=None, node_labels=None):
      if "networkx.classes.graph.Graph" in str(G.__class__):
          G_json = self._nx_to_json(G)
          self.G = self._json_to_epgm(
              G_json, node_attributes, node_labels
          )
      elif "str" in str(
          G.__class__
      ):  # this assumes that G is the path to EPGM graph
          self.G = self.load(G)
      else:
          raise Exception("G has unknown class ", str(G.__class__))
  
      self.G_nx = {}
  
imports: from collections import OrderedDict
  import networkx
  from networkx.readwrite import json_graph
  import os
  import json
  import uuid
  import numpy
  import scipy.sparse
  import multiprocessing
  from multiprocessing import Pool
  from functools import partial
  from time import sleep
label_desc: Use image node_id 10 to create a new EPGM object from inherited base classes: object with example: obj = EPGM(G, node_attributes, node_labels)