code: def extract_fundamental_discriminant(a):
      r"""
      Extract a fundamental discriminant from an integer *a*.
  
      Explanation
      ===========
  
      Given any rational integer *a* that is 0 or 1 mod 4, write $a = d f^2$,
      where $d$ is either 1 or a fundamental discriminant, and return a pair
      of dictionaries ``(D, F)`` giving the prime factorizations of $d$ and $f$
      respectively, in the same format returned by :py:func:`~.factorint`.
  
      A fundamental discriminant $d$ is different from unity, and is either
      1 mod 4 and squarefree, or is 0 mod 4 and such that $d/4$ is squarefree
      and 2 or 3 mod 4. This is the same as being the discriminant of some
      quadratic field.
  
      Examples
      ========
  
      >>> from sympy.polys.numberfields.utilities import extract_fundamental_discriminant
      >>> print(extract_fundamental_discriminant(-432))
      ({3: 1, -1: 1}, {2: 2, 3: 1})
  
      For comparison:
  
      >>> from sympy import factorint
      >>> print(factorint(-432))
      {2: 4, 3: 3, -1: 1}
  
      Parameters
      ==========
  
      a: int, must be 0 or 1 mod 4
  
      Returns
      =======
  
      Pair ``(D, F)``  of dictionaries.
  
      Raises
      ======
  
      ValueError
          If *a* is not 0 or 1 mod 4.
  
      References
      ==========
  
      .. [1] Cohen, H. *A Course in Computational Algebraic Number Theory.*
         (See Prop. 5.1.3)
  
      """
      if a % 4 not in [0, 1]:
          raise ValueError(
              "To extract fundamental discriminant, number must be 0 or 1 mod 4."
          )
      if a == 0:
          return {}, {0: 1}
      if a == 1:
          return {}, {}
      a_factors = factorint(a)
      D = {}
      F = {}
      # First pass: just make d squarefree, and a/d a perfect square.
      # We'll count primes (and units! i.e. -1) that are 3 mod 4 and present in d.
      num_3_mod_4 = 0
      for p, e in a_factors.items():
          if e % 2 == 1:
              D[p] = 1
              if p % 4 == 3:
                  num_3_mod_4 += 1
              if e >= 3:
                  F[p] = (e - 1) // 2
          else:
              F[p] = e // 2
      # Second pass: if d is cong. to 2 or 3 mod 4, then we must steal away
      # another factor of 4 from f**2 and give it to d.
      even = 2 in D
      if even or num_3_mod_4 % 2 == 1:
          e2 = F[2]
          assert e2 > 0
          if e2 == 1:
              del F[2]
          else:
              F[2] = e2 - 1
          D[2] = 3 if even else 2
      return D, F
  
imports: from sympy.core.sympify import sympify
  from sympy.ntheory.factor_ import factorint
  from sympy.polys.domains.rationalfield import QQ
  from sympy.polys.domains.integerring import ZZ
  from sympy.polys.matrices.exceptions import DMRankError
  from sympy.polys.numberfields.minpoly import minpoly
  from sympy.printing.lambdarepr import IntervalPrinter
  from sympy.utilities.decorator import public
  from sympy.utilities.lambdify import lambdify
  from mpmath import mp
label_desc: Use image node_id 4 for calling a global function with example usage: extract_fundamental_discriminant(a) and returns: D,  F, dict,  dict, dict,  dict