code: def _create_A_L(graph, node2idx):
      node_size = graph.number_of_nodes()
      A_data = []
      A_row_index = []
      A_col_index = []
  
      for edge in graph.edges():
          v1, v2 = edge
          edge_weight = graph[v1][v2].get("weight", 1)
  
          A_data.append(edge_weight)
          A_row_index.append(node2idx[v1])
          A_col_index.append(node2idx[v2])
  
      A = sp.csr_matrix(
          (A_data, (A_row_index, A_col_index)),
          shape=(node_size, node_size),
      )
      A_ = sp.csr_matrix(
          (
              A_data + A_data,
              (A_row_index + A_col_index, A_col_index + A_row_index),
          ),
          shape=(node_size, node_size),
      )
  
      D = sp.diags(A_.sum(axis=1).flatten().tolist()[0])
      L = D - A_
      return A, L
  
imports: import time
  import numpy
  import scipy.sparse
  import tensorflow
  from tensorflow.python.keras import backend
  from tensorflow.python.keras.callbacks import History
  from tensorflow.python.keras.layers import Dense, Input
  from tensorflow.python.keras.models import Model
  from tensorflow.python.keras.regularizers import l1_l2
  from ..utils import preprocess_nxgraph
label_desc: Use image node_id 4 for calling a global function with example usage: _create_A_L(graph, node2idx) and returns: A,  L