code: def edge_index_to_matrix(
      edge_index, edge_weight, edge_features=None, shape=None
  ):
      reordered = reorder(edge_index, edge_weight, edge_features)
      a = sp.csr_matrix((reordered[1], reordered[0].T), shape=shape)
  
      if edge_features is not None:
          return a, reordered[2]
      else:
          return a
  
imports: import numpy
  import tensorflow
  from scipy import sparse
label_desc: Use image node_id 2 for calling a global function with example usage: edge_index_to_matrix(edge_index, edge_weight, edge_features, shape) and returns: a,  reordered, a