code: def get_undirected_adj_mat_from_directed(directed_adj_mat):
      """Given a directed adjacency matrix, returns the undirected matrix."""
      num_nodes = directed_adj_mat.shape[0]
      ret = directed_adj_mat + directed_adj_mat.T
      ret[np.diag_indices(num_nodes)] = directed_adj_mat[
          np.diag_indices(num_nodes)
      ]
      return ret
  
file_path: dragonfly/dragonfly/utils/graph_utils.py
imports: from copy import deepcopy
  import numpy
  from scipy.linalg import eigh
  from .general_utils import get_nonzero_indices_in_vector
label_desc: Use image node_id 2 for calling a global function with example usage: get_undirected_adj_mat_from_directed(directed_adj_mat) and returns: ret