docstr: Test if __compute_neighbors() gives the expected shape and symmetry
docstr_tok: ["Test","if","__compute_neighbors","(",")","gives","the","expected","shape","and","symmetry"]
code: def test_compute_neighbors_return_values(
      self, swarm, topology, k, static
  ):
      """Test if __compute_neighbors() gives the expected shape and symmetry"""
      topo = topology(static=static)
      adj_matrix = topo._Random__compute_neighbors(swarm, k=k)
      assert adj_matrix.shape == (swarm.n_particles, swarm.n_particles)
      assert np.allclose(adj_matrix, adj_matrix.T, atol=1e-8)
  
file_path: pyswarms/tests/backend/topology/test_random.py
imports: import numpy
  import pytest
  from pyswarms.backend.topology import Random
  from .abc_test_topology import ABCTestTopology
label_desc: Use image node_id 4 for calling the TestRandomTopology obj's underlying member method code with example usage: obj.test_compute_neighbors_return_values(swarm, topology, k, static) without return types