code: def _LC(f):
      r"""
      Compute the leading coefficient 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
      =======
  
      lcf : PolyElement
          polynomial in `K[y]`, leading coefficient of `f`
  
      Examples
      ========
  
      >>> from sympy.polys.modulargcd import _LC
      >>> from sympy.polys import ring, ZZ
  
      >>> R, x, y = ring("x, y", ZZ)
  
      >>> f = x**2*y**2 + x**2*y - 1
      >>> _LC(f)
      y**2 + y
  
      >>> R, x, y, z = ring("x, y, z", ZZ)
  
      >>> f = x**2*y**2 + x**2*y - 1
      >>> _LC(f)
      1
  
      >>> f = x*y*z - y**2*z**2
      >>> _LC(f)
      z
  
      """
      ring = f.ring
      k = ring.ngens
      yring = ring.clone(symbols=ring.symbols[k - 1])
      y = yring.gens[0]
      degf = _deg(f)
  
      lcf = yring.zero
      for monom, coeff in f.iterterms():
          if monom[:-1] == degf:
              lcf += coeff * y ** monom[-1]
      return lcf
  
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 8 for calling a global function with example usage: _LC(f) and returns: lcf