code: def normalize_adj(adj, symmetric=True, add_self_loops=False):
      """
      Normalize adjacency matrix.
  
      Args:
          adj: adjacency matrix
          symmetric: True if symmetric normalization or False if left-only normalization
          add_self_loops: True if self loops are to be added before normalization, i.e., use A+I where A is the adjacency
              matrix and I is a square identity matrix of the same size as A.
      Returns:
          Return a sparse normalized adjacency matrix.
      """
  
      if add_self_loops:
          adj = adj + sp.diags(np.ones(adj.shape[0]) - adj.diagonal())
  
      if symmetric:
          d = sp.diags(
              np.power(np.array(adj.sum(1)), -0.5).flatten(), 0
          )
          a_norm = adj.dot(d).transpose().dot(d).tocsr()
      else:
          d = sp.diags(
              np.float_power(np.array(adj.sum(1)), -1).flatten(), 0
          )
          a_norm = d.dot(adj).tocsr()
      return a_norm
  
file_path: stellargraph/stellargraph/core/utils.py
imports: import collections
  import scipy.sparse
  from scipy.sparse.linalg import ArpackNoConvergence, eigsh
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: normalize_adj(adj, symmetric, add__loops) and returns: a_norm