code: def create_adj_from_edge_index(
      cls,
      edge_index: Tensor,
      num_nodes: int,
      normalization: str,
  ):
      assert normalization in ["sym", "rw"]
      adj = SparseTensor.from_edge_index(
          edge_index,
          sparse_sizes=(num_nodes, num_nodes),
      )
      adj = adj.fill_value(1.0)
      degree = adj.sum(0)
  
      degree[degree == 0.0] = 1e-12
      deg_inv = 1 / degree
  
      if normalization == "sym":
          deg_inv_sqrt = deg_inv**0.5
          adj = adj * deg_inv_sqrt.reshape(1, -1)
          adj = adj * deg_inv_sqrt.reshape(-1, 1)
      elif normalization == "rw":
          adj = adj * deg_inv.reshape(-1, 1)
  
      return adj
  
imports: import logging
  import math
  from typing import Callable, Iterator, List, NamedTuple, Optional, Tuple, Union
  import numpy
  import scipy.sparse
  import torch
  from torch import Tensor
  from tqdm import tqdm
  from torch_geometric.data import Data
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import get_ppr, is_undirected, subgraph
label_desc: Use image node_id 4 for calling the IBMBBaseLoader obj's underlying member method code with example usage: obj.create_adj_from_edge_index(cls, edge_index, num_nodes, normalization) and returns: adj