code: def test_approx_knn():
      warnings.filterwarnings("ignore", ".*find n_neighbors.*")
  
      x = torch.tensor(
          [
              [-1.0, -1.0],
              [-1.0, +1.0],
              [+1.0, +1.0],
              [+1.0, -1.0],
              [-1.0, -1.0],
              [-1.0, +1.0],
              [+1.0, +1.0],
              [+1.0, -1.0],
          ]
      )
      y = torch.tensor(
          [
              [+1.0, 0.0],
              [-1.0, 0.0],
          ]
      )
  
      batch_x = torch.tensor([0, 0, 0, 0, 1, 1, 1, 1])
      batch_y = torch.tensor([0, 1])
  
      edge_index = approx_knn(x, y, 2)
      assert to_set(edge_index) == set([(0, 2), (0, 3), (1, 0), (1, 1)])
  
      edge_index = approx_knn(x, y, 2, batch_x, batch_y)
      assert to_set(edge_index) == set([(0, 2), (0, 3), (1, 4), (1, 5)])
  
imports: import warnings
  import torch
  from torch_geometric.nn import approx_knn, approx_knn_graph
  from torch_geometric.testing import onlyFullTest, withPackage
label_desc: Use image node_id 2 for calling a global function with example usage: test_approx_knn() without return types