code: def get_graph(name, format=None):
      # global GRAPH_CACHE
      # if name in GRAPH_CACHE:
      #     return GRAPH_CACHE[name].to(format)
      if isinstance(format, str):
          format = [format]  # didn't specify format
      if format is None:
          format = ["csc", "csr", "coo"]
      g = None
      if name == "cora":
          g = dgl.data.CoraGraphDataset(verbose=False)[0]
      elif name == "pubmed":
          g = dgl.data.PubmedGraphDataset(verbose=False)[0]
      elif name == "livejournal":
          bin_path = (
              "/tmp/dataset/livejournal/livejournal_{}.bin".format(
                  format
              )
          )
          if os.path.exists(bin_path):
              g_list, _ = dgl.load_graphs(bin_path)
              g = g_list[0]
          else:
              g = get_livejournal().formats(format)
              dgl.save_graphs(bin_path, [g])
      elif name == "friendster":
          bin_path = "/tmp/dataset/friendster/friendster_{}.bin".format(
              format
          )
          if os.path.exists(bin_path):
              g_list, _ = dgl.load_graphs(bin_path)
              g = g_list[0]
          else:
              # the original node IDs of friendster are not consecutive, so we compact it
              g = dgl.compact_graphs(get_friendster()).formats(format)
              dgl.save_graphs(bin_path, [g])
      elif name == "reddit":
          bin_path = "/tmp/dataset/reddit/reddit_{}.bin".format(format)
          if os.path.exists(bin_path):
              g_list, _ = dgl.load_graphs(bin_path)
              g = g_list[0]
          else:
              g = dgl.data.RedditDataset(self_loop=True)[0].formats(
                  format
              )
              dgl.save_graphs(bin_path, [g])
      elif name.startswith("ogb"):
          g = get_ogb_graph(name)
      else:
          raise Exception("Unknown dataset")
      # GRAPH_CACHE[name] = g
      g = g.formats(format)
      return g
  
imports: import inspect
  import json
  import os
  import pickle
  import shutil
  import time
  import zipfile
  from functools import partial, reduce, wraps
  from timeit import default_timer
  import dgl
  import numpy
  import pandas
  import requests
  import torch
  from ogb.nodeproppred import DglNodePropPredDataset
  import traceback
  from _thread import start_new_thread
  import torch.multiprocessing
label_desc: Use image node_id 3 for calling a global function with example usage: get_graph(name, format) and returns: g