code: def _deg(f):
      r"""
      Compute the degree of a multivariate polynomial
      `f \in K[x_0, \ldots, x_{k-2}, y] \cong K[y][x_0, \ldots, x_{k-2}]`.
  
      Parameters
      ==========
  
      f : PolyElement
          polynomial in `K[x_0, \ldots, x_{k-2}, y]`
  
      Returns
      =======
  
      degf : Integer tuple
          degree of `f` in `x_0, \ldots, x_{k-2}`
  
      Examples
      ========
  
      >>> from sympy.polys.modulargcd import _deg
      >>> from sympy.polys import ring, ZZ
  
      >>> R, x, y = ring("x, y", ZZ)
  
      >>> f = x**2*y**2 + x**2*y - 1
      >>> _deg(f)
      (2,)
  
      >>> R, x, y, z = ring("x, y, z", ZZ)
  
      >>> f = x**2*y**2 + x**2*y - 1
      >>> _deg(f)
      (2, 2)
  
      >>> f = x*y*z - y**2*z**2
      >>> _deg(f)
      (1, 1)
  
      """
      k = f.ring.ngens
      degf = (0,) * (k - 1)
      for monom in f.itermonoms():
          if monom[:-1] > degf:
              degf = monom[:-1]
      return degf
  
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 7 for calling a global function with example usage: _deg(f) and returns: degf