code: def test_to_ZZ_ANP_poly():
      A = AlgebraicField(QQ, sqrt(2))
      R, x = ring("x", A)
      f = x * (sqrt(2) + 1)
  
      T, x_, z_ = ring("x_, z_", ZZ)
      f_ = x_ * z_ + x_
  
      assert _to_ZZ_poly(f, T) == f_
      assert _to_ANP_poly(f_, R) == f
  
      R, x, t, s = ring("x, t, s", A)
      f = x * t**2 + x * s + sqrt(2)
  
      D, t_, s_ = ring("t_, s_", ZZ)
      T, x_, z_ = ring("x_, z_", D)
      f_ = (t_**2 + s_) * x_ + z_
  
      assert _to_ZZ_poly(f, T) == f_
      assert _to_ANP_poly(f_, R) == f
  
file_path: sympy/sympy/polys/tests/test_modulargcd.py
imports: from sympy.polys.rings import ring
  from sympy.polys.domains import ZZ, QQ, AlgebraicField
  from sympy.polys.modulargcd import modgcd_univariate, modgcd_bivariate, _chinese_remainder_reconstruction_multivariate, modgcd_multivariate, _to_ZZ_poly, _to_ANP_poly, func_field_modgcd, _func_field_modgcd_m
  from sympy.functions.elementary.miscellaneous import sqrt
label_desc: Use image node_id 5 for calling a global function with example usage: test_to_ZZ_ANP_poly() without return types