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: Return adjacency matrix of a graph specified by its graph_id
docstr_tok: ["Return","adjacency","matrix","of","a","graph","specified","by","its","graph_id"]
code: def adjacency(self, graph_id, directed=False):
      """Return adjacency matrix of a graph specified by its graph_id"""
  
      if not any([graph_id in g["id"] for g in self.G["graphs"]]):
          raise Exception(
              "Graph with id {} does not exist".format(graph_id)
          )
  
      print("...building the adjacency matrix...")
      nodes = [
          v["id"]
          for v in self.G["vertices"]
          if graph_id in v["meta"]["graphs"]
      ]
      adj = nx.adjacency_matrix(
          self.to_nx(graph_id, directed), nodelist=nodes
      )  # ensure the nodes in adj are ordered the same as in the epgm graph
  
      return adj
  
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 14 for calling the EPGM obj's underlying member method code with example usage: obj.adjacency(graph_id, directed) and returns: adj