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","."]
docstr: Load graphs from EPGM path
docstr_tok: ["Load","graphs","from","EPGM","path"]
code: def load(self, path):
      """Load graphs from EPGM path"""
      if not os.path.isdir(path):
          raise Exception("Path {} does not exist!".format(path))
  
      G_epgm = {"graphs": list(), "vertices": list(), "edges": list()}
  
      for k in G_epgm.keys():
          # detect the codec:
          fname = os.path.join(path, str(k) + ".json")
          # with open(fname, 'rb') as fb:  # open the file for reading in binary format
          #     line = fb.readline()   # read the 1st line and evalulate its length
          #     fb.seek(0)   # return to the start of the file
          #     enc = chardet.detect(fb.read(1000*len(line)))['encoding']
          # detect the encoding from up to 1000 first lines in the file
  
          enc = "utf-8"  # just use 'utf-8' for all files
          with open(fname, "r", encoding=enc) as fp:
              print(
                  "...reading {} using {} encoding...".format(
                      fp.name, enc
                  )
              )
              lines = fp.readlines()
  
          if isinstance(G_epgm[k], list):
              for l in lines:
                  G_epgm[k].append(json.loads(l))
          else:
              raise Exception(
                  "type(G[",
                  k,
                  "]): unexpected type",
                  type(G_epgm[k]).__name__,
                  ", stopping.",
              )
  
      G_epgm = self._reorder_keys(G=G_epgm)
      return G_epgm
  
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 6 for calling the EPGM obj's underlying member method code with example usage: obj.load(path) and returns: G_epgm