code: def test_set_gaussian_2():
      G, x = basic_graph_2()
      d = G.weights
      G.set_gaussian(x)
      D = G.weights
      sigma = np.sum(d * d) / len(d)
      assert np.allclose(D, np.exp(-d * d / (2 * sigma)), 1e-7)
  
imports: import numpy
  import numpy.random
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from ..graph import WeightedGraph, complete_graph, concatenate_graphs, eps_nn, knn, mst, wgraph_from_3d_grid, wgraph_from_adjacency, wgraph_from_coo_matrix
label_desc: Use image node_id 8 for calling a global function with example usage: test_set_gaussian_2() without return types