code: def test__nsort():
      # issue 6137
      r = S(
          """[3/2 + sqrt(-14/3 - 2*(-415/216 + 13*I/12)**(1/3) - 4/sqrt(-7/3 +
      61/(18*(-415/216 + 13*I/12)**(1/3)) + 2*(-415/216 + 13*I/12)**(1/3)) -
      61/(18*(-415/216 + 13*I/12)**(1/3)))/2 - sqrt(-7/3 + 61/(18*(-415/216
      + 13*I/12)**(1/3)) + 2*(-415/216 + 13*I/12)**(1/3))/2, 3/2 - sqrt(-7/3
      + 61/(18*(-415/216 + 13*I/12)**(1/3)) + 2*(-415/216 +
      13*I/12)**(1/3))/2 - sqrt(-14/3 - 2*(-415/216 + 13*I/12)**(1/3) -
      4/sqrt(-7/3 + 61/(18*(-415/216 + 13*I/12)**(1/3)) + 2*(-415/216 +
      13*I/12)**(1/3)) - 61/(18*(-415/216 + 13*I/12)**(1/3)))/2, 3/2 +
      sqrt(-14/3 - 2*(-415/216 + 13*I/12)**(1/3) + 4/sqrt(-7/3 +
      61/(18*(-415/216 + 13*I/12)**(1/3)) + 2*(-415/216 + 13*I/12)**(1/3)) -
      61/(18*(-415/216 + 13*I/12)**(1/3)))/2 + sqrt(-7/3 + 61/(18*(-415/216
      + 13*I/12)**(1/3)) + 2*(-415/216 + 13*I/12)**(1/3))/2, 3/2 + sqrt(-7/3
      + 61/(18*(-415/216 + 13*I/12)**(1/3)) + 2*(-415/216 +
      13*I/12)**(1/3))/2 - sqrt(-14/3 - 2*(-415/216 + 13*I/12)**(1/3) +
      4/sqrt(-7/3 + 61/(18*(-415/216 + 13*I/12)**(1/3)) + 2*(-415/216 +
      13*I/12)**(1/3)) - 61/(18*(-415/216 + 13*I/12)**(1/3)))/2]"""
      )
      ans = [r[1], r[0], r[-1], r[-2]]
      assert _nsort(r) == ans
      assert len(_nsort(r, separated=True)[0]) == 0
      b, c, a = exp(-1000), exp(-999), exp(-1001)
      assert _nsort((b, c, a)) == [a, b, c]
      # issue 12560
      a = cos(1) ** 2 + sin(1) ** 2 - 1
      assert _nsort([a]) == [a]
  
imports: from sympy.core.mul import Mul
  from sympy.core.numbers import Integer, pi
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.exponential import exp
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.integrals.integrals import Integral
  from sympy.testing.pytest import raises
  from sympy.polys.polyutils import _nsort, _sort_gens, _unify_gens, _analyze_gens, _sort_factors, parallel_dict_from_expr, dict_from_expr
  from sympy.polys.polyerrors import PolynomialError
  from sympy.polys.domains import ZZ
label_desc: Use image node_id 1 for calling a global function with example usage: test__nsort() without return types