code: def _trivial_gcd(f, g):
      """
      Compute the GCD of two polynomials in trivial cases, i.e. when one
      or both polynomials are zero.
      """
      ring = f.ring
  
      if not (f or g):
          return ring.zero, ring.zero, ring.zero
      elif not f:
          if g.LC < ring.domain.zero:
              return -g, ring.zero, -ring.one
          else:
              return g, ring.zero, ring.one
      elif not g:
          if f.LC < ring.domain.zero:
              return -f, -ring.one, ring.zero
          else:
              return f, ring.one, ring.zero
      return None
  
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 1 for calling a global function with example usage: _trivial_gcd(f, g) and returns: None, ring,  ring,  ring, unknown,  ring,  unknown, g,  ring,  ring, unknown,  unknown,  ring, f,  ring,  ring