code: def _trunc(f, minpoly, p):
      r"""
      Compute the reduced representation of a polynomial `f` in
      `\mathbb Z_p[z] / (\check m_{\alpha}(z))[x]`
  
      Parameters
      ==========
  
      f : PolyElement
          polynomial in `\mathbb Z[x, z]`
      minpoly : PolyElement
          polynomial `\check m_{\alpha} \in \mathbb Z[z]`, not necessarily
          irreducible
      p : Integer
          prime number, modulus of `\mathbb Z_p`
  
      Returns
      =======
  
      ftrunc : PolyElement
          polynomial in `\mathbb Z[x, z]`, reduced modulo
          `\check m_{\alpha}(z)` and `p`
  
      """
      ring = f.ring
      minpoly = minpoly.set_ring(ring)
      p_ = ring.ground_new(p)
  
      return f.trunc_ground(p).rem([minpoly, p_]).trunc_ground(p)
  
imports: from sympy.core.symbol import Dummy
  from sympy.ntheory import nextprime
  from sympy.ntheory.modular import crt
  from sympy.polys.domains import PolynomialRing
  from sympy.polys.galoistools import gf_gcd, gf_from_dict, gf_gcdex, gf_div, gf_lcm
  from sympy.polys.polyerrors import ModularGCDFailed
  from mpmath import sqrt
  import random
label_desc: Use image node_id 20 for calling a global function with example usage: _trunc(f, minpoly, p) and returns: f