code: def geninvgauss_mode(p, b):
      if (
          p > 1
      ):  # equivalent mode formulas numerical more stable versions
          return (math.sqrt((1 - p) ** 2 + b**2) - (1 - p)) / b
      return b / (math.sqrt((1 - p) ** 2 + b**2) + (1 - p))
  
imports: import math
  import numbers
  import numpy
  from scipy import stats
  from scipy import special
  from ._qmc import check_random_state, Halton, QMCEngine
  from ._unuran.unuran_wrapper import NumericalInversePolynomial
  from scipy._lib._util import check_random_state
label_desc: Use image node_id 19 for calling a global function with example usage: geninvgauss_mode(p, b) and returns: unknown, unknown