code: def _get_adj_from_data(X, k, **kwargs):
      A = kneighbors_graph(X, k, **kwargs).toarray()
      A = sp.csr_matrix(np.maximum(A, A.T))
  
      return A
  
file_path: spektral/spektral/datasets/mnist.py
imports: import numpy
  import scipy.sparse
  from sklearn.neighbors import kneighbors_graph
  from tensorflow.keras.datasets import mnist
  from spektral.data import Dataset, Graph
label_desc: Use image node_id 2 for calling a global function with example usage: _get_adj_from_data(X, k) and returns: A