code: def adjacency_matrix_to_adjacency_list(adjacency_matrix, labels=None):
      """
      Convert the adjacency matrix of a graph to an adjacency list.
  
      :param adjacency_matrix: A numpy array representing the graph adjacency matrix.
      :param labels: List of labels.
      :returns: Adjacency list as a dictionary.
      """
  
      adjlist = dict()
      if labels is None:
          labels = [
              str(i + 1) for i in range(adjacency_matrix.shape[0])
          ]
      for i in range(adjacency_matrix.shape[0]):
          adjlist[labels[i]] = list()
          for j in range(adjacency_matrix.shape[1]):
              if adjacency_matrix[i, j] != 0:
                  adjlist[labels[i]].append(labels[j])
      return adjlist
  
imports: import re
  from queue import LifoQueue
  import networkx
  import numpy
  from networkx.algorithms.dag import is_directed_acyclic_graph
  from networkx.algorithms.shortest_paths.generic import shortest_path
  from dowhy.utils.ordered_set import OrderedSet
label_desc: Use image node_id 1 for calling a global function with example usage: adjacency_matrix_to_adjacency_list(adjacency_matrix, labels) and returns: adjlist