code: def mol_to_adj(mol):
      row, col, edge_features = [], [], []
      for bond in mol["bonds"]:
          start, end = bond["start_atom"], bond["end_atom"]
          row += [start, end]
          col += [end, start]
          edge_features += [bond["type"]] * 2
  
      a, e = sparse.edge_index_to_matrix(
          edge_index=np.array((row, col)).T,
          edge_weight=np.ones_like(row),
          edge_features=label_to_one_hot(edge_features, BOND_TYPES),
      )
  
      return a, e
  
file_path: spektral/spektral/datasets/qm9.py
imports: import os
  import os.path
  import numpy
  from joblib import Parallel, delayed
  from tensorflow.keras.utils import get_file
  from tqdm import tqdm
  from spektral.data import Dataset, Graph
  from spektral.utils import label_to_one_hot, sparse
  from spektral.utils.io import load_csv, load_sdf
label_desc: Use image node_id 2 for calling a global function with example usage: mol_to_adj(mol) and returns: a,  e