code: def jacobi_symbol(m, n):
      r"""
      Returns the Jacobi symbol `(m / n)`.
  
      For any integer ``m`` and any positive odd integer ``n`` the Jacobi symbol
      is defined as the product of the Legendre symbols corresponding to the
      prime factors of ``n``:
  
      .. math ::
          \genfrac(){}{}{m}{n} =
              \genfrac(){}{}{m}{p^{1}}^{\alpha_1}
              \genfrac(){}{}{m}{p^{2}}^{\alpha_2}
              ...
              \genfrac(){}{}{m}{p^{k}}^{\alpha_k}
              \text{ where } n =
                  p_1^{\alpha_1}
                  p_2^{\alpha_2}
                  ...
                  p_k^{\alpha_k}
  
      Like the Legendre symbol, if the Jacobi symbol `\genfrac(){}{}{m}{n} = -1`
      then ``m`` is a quadratic nonresidue modulo ``n``.
  
      But, unlike the Legendre symbol, if the Jacobi symbol
      `\genfrac(){}{}{m}{n} = 1` then ``m`` may or may not be a quadratic residue
      modulo ``n``.
  
      Parameters
      ==========
  
      m : integer
      n : odd positive integer
  
      Examples
      ========
  
      >>> from sympy.ntheory import jacobi_symbol, legendre_symbol
      >>> from sympy import S
      >>> jacobi_symbol(45, 77)
      -1
      >>> jacobi_symbol(60, 121)
      1
  
      The relationship between the ``jacobi_symbol`` and ``legendre_symbol`` can
      be demonstrated as follows:
  
      >>> L = legendre_symbol
      >>> S(45).factors()
      {3: 2, 5: 1}
      >>> jacobi_symbol(7, 45) == L(7, 3)**2 * L(7, 5)**1
      True
  
      See Also
      ========
  
      is_quad_residue, legendre_symbol
      """
      m, n = as_int(m), as_int(n)
      return int(jacobi(m, n))
  
imports: from __future__ import annotations
  from sympy.external.gmpy import gcd, lcm, invert, sqrt, legendre, jacobi, kronecker, bit_scan1, remove
  from sympy.polys import Poly
  from sympy.polys.domains import ZZ
  from sympy.polys.galoistools import gf_crt1, gf_crt2, linear_congruence, gf_csolve
  from .primetest import isprime
  from .factor_ import factorint, _perfect_power
  from .modular import crt
  from sympy.utilities.decorator import deprecated
  from sympy.utilities.memoization import recurrence_memo
  from sympy.utilities.misc import as_int
  from sympy.utilities.iterables import iproduct
  from sympy.core.random import _randint, randint
  from itertools import product
label_desc: Use image node_id 20 for calling a global function with example usage: jacobi_symbol(m, n) and returns: int