docstr: Assert that x and y contain permutations of the same approximate set of values.
  
  For non-complex inputs, this is accomplished by comparing the sorted inputs.
  For complex, such an approach can be confounded by numerical errors. In this case,
  we compute the structural rank of the pairwise comparison matrix: if the structural
  rank is full, it implies that the matrix can be permuted so that the diagonal is
  non-zero, which implies a one-to-one approximate match between the permuted sets.
docstr_tok: ["Assert","that","x","and","y","contain","permutations","of","the","same","approximate","set","of","values",".","For","non-complex","inputs",",","this","is","accomplished","by","comparing","the","sorted","inputs",".","For","complex",",","such","an","approach","can","be","confounded","by","numerical","errors",".","In","this","case",",","we","compute","the","structural","rank","of","the","pairwise","comparison","matrix",":","if","the","structural","rank","is","full",",","it","implies","that","the","matrix","can","be","permuted","so","that","the","diagonal","is","non-zero",",","which","implies","a","one-to-one","approximate","match","between","the","permuted","sets","."]
code: def assertSetsAllClose(
      self, x, y, rtol=None, atol=None, check_dtypes=True
  ):
      """Assert that x and y contain permutations of the same approximate set of values.
  
      For non-complex inputs, this is accomplished by comparing the sorted inputs.
      For complex, such an approach can be confounded by numerical errors. In this case,
      we compute the structural rank of the pairwise comparison matrix: if the structural
      rank is full, it implies that the matrix can be permuted so that the diagonal is
      non-zero, which implies a one-to-one approximate match between the permuted sets.
      """
      x = np.asarray(x).ravel()
      y = np.asarray(y).ravel()
  
      atol = max(
          jtu.tolerance(x.dtype, atol), jtu.tolerance(y.dtype, atol)
      )
      rtol = max(
          jtu.tolerance(x.dtype, rtol), jtu.tolerance(y.dtype, rtol)
      )
  
      if not (
          np.issubdtype(x.dtype, np.complexfloating)
          or np.issubdtype(y.dtype, np.complexfloating)
      ):
          return self.assertAllClose(
              np.sort(x),
              np.sort(y),
              atol=atol,
              rtol=rtol,
              check_dtypes=check_dtypes,
          )
  
      if check_dtypes:
          self.assertEqual(x.dtype, y.dtype)
      self.assertEqual(x.size, y.size)
  
      pairwise = np.isclose(
          x[:, None], x[None, :], atol=atol, rtol=rtol, equal_nan=True
      )
      rank = csgraph.structural_rank(csr_matrix(pairwise))
      self.assertEqual(rank, x.size)
  
file_path: jax/tests/polynomial_test.py
imports: from functools import partial
  import numpy
  from scipy.sparse import csgraph, csr_matrix
  from absl.testing import absltest
  from jax._src import dtypes
  from jax import numpy
  from jax._src import test_util
  from jax import config
label_desc: Use image node_id 1 for calling the TestPolynomial obj's underlying member method code with example usage: obj.assertSetsAllClose(x, y, rtol, atol, check_dtypes) and returns: self