code: def load_nx(name, dataset_dir):
      """
      load networkx format dataset
      :param name: dataset name
      :param dataset_dir: data directory
      :return: a list of networkx/deepsnap graphs
      """
      try:
          with open(
              "{}/{}.pkl".format(dataset_dir, name), "rb"
          ) as file:
              graphs = pickle.load(file)
      except Exception:
          graphs = nx.read_gpickle(
              "{}/{}.gpickle".format(dataset_dir, name)
          )
          if not isinstance(graphs, list):
              graphs = [graphs]
      return graphs
  
imports: import logging
  import pickle
  import time
  import networkx
  import torch
  import torch_geometric.transforms
  from deepsnap.batch import Batch
  from deepsnap.dataset import GraphDataset
  from ogb.graphproppred import PygGraphPropPredDataset
  from torch.utils.data import DataLoader
  from torch_geometric.datasets import PPI, Amazon, Coauthor, KarateClub, MNISTSuperpixels, Planetoid, QM7b, TUDataset
  import graphgym.models.feature_augment
  import graphgym.register
  from graphgym.config import cfg
  from graphgym.models.transform import edge_nets, ego_nets, path_len, remove_node_feature
label_desc: Use image node_id 2 for calling a global function with example usage: load_nx(name, dataset_dir) and returns: graphs