code: def wgraph_from_adjacency(x):
      """Instantiates a weighted graph from a square 2D array
  
      Parameters
      ----------
      x: 2D array instance, the input array
  
      Returns
      -------
      wg: WeightedGraph instance
      """
      a = coo_matrix(x)
      return wgraph_from_coo_matrix(a)
  
imports: import numpy
  from scipy.sparse import coo_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: wgraph_from_adjacency(x) and returns: wgraph_from_coo_matrix