code: def grid_graph(grid_side, number_edges, metric):
      """Generate graph of a grid"""
      z = grid(grid_side)
      dist, idx = distance_sklearn_metrics(
          z, k=number_edges, metric=metric
      )
      A = adjacency(dist, idx)
      print("nb edges: ", A.nnz)
      return A
  
file_path: dgl/examples/pytorch/model_zoo/geometric/grid_graph.py
imports: import numpy
  import scipy.sparse
  import scipy.sparse.linalg
  import sklearn
  import sklearn.metrics
label_desc: Use image node_id 1 for calling a global function with example usage: grid_graph(grid_side, number_edges, metric) and returns: A