code: def test_two_elt_rep():
      ell = 7
      T = Poly(cyclotomic_poly(ell))
      ZK, dK = round_two(T)
      for p in [29, 13, 11, 5]:
          P = prime_decomp(p, T)
          for Pi in P:
              # We have Pi in two-element representation, and, because we are
              # looking at a cyclotomic field, this was computed by the "easy"
              # method that just factors T mod p. We will now convert this to
              # a set of Z-generators, then convert that back into a two-element
              # rep. The latter need not be identical to the two-elt rep we
              # already have, but it must have the same HNF.
              H = p * ZK + Pi.alpha * ZK
              gens = H.basis_element_pullbacks()
              # Note: we could supply f = Pi.f, but prefer to test behavior without it.
              b = _two_elt_rep(gens, ZK, p)
              if b != Pi.alpha:
                  H2 = p * ZK + b * ZK
                  assert H2 == H
  
imports: from math import prod
  from sympy import QQ, ZZ
  from sympy.abc import x, theta
  from sympy.ntheory import factorint
  from sympy.ntheory.residue_ntheory import n_order
  from sympy.polys import Poly, cyclotomic_poly
  from sympy.polys.matrices import DomainMatrix
  from sympy.polys.numberfields.basis import round_two
  from sympy.polys.numberfields.exceptions import StructureError
  from sympy.polys.numberfields.modules import PowerBasis, to_col
  from sympy.polys.numberfields.primes import prime_decomp, _two_elt_rep, _check_formal_conditions_for_maximal_order
  from sympy.testing.pytest import raises
label_desc: Use image node_id 2 for calling a global function with example usage: test_two_elt_rep() without return types