code: def ppf(
      q: np.ndarray,
      a: Union[np.ndarray, float],
      b: Union[np.ndarray, float],
  ) -> np.ndarray:
      q, a, b = np.atleast_1d(q, a, b)
      q, a, b = np.broadcast_arrays(q, a, b)
  
      case_left = a < 0
      case_right = ~case_left
  
      def ppf_left(
          q: np.ndarray, a: np.ndarray, b: np.ndarray
      ) -> np.ndarray:
          log_Phi_x = _log_sum(
              _log_ndtr(a), np.log(q) + _log_gauss_mass(a, b)
          )
          return _ndtri_exp(log_Phi_x)
  
      def ppf_right(
          q: np.ndarray, a: np.ndarray, b: np.ndarray
      ) -> np.ndarray:
          log_Phi_x = _log_sum(
              _log_ndtr(-b), np.log1p(-q) + _log_gauss_mass(a, b)
          )
          return -_ndtri_exp(log_Phi_x)
  
      out = np.empty_like(q)
  
      q_left = q[case_left]
      q_right = q[case_right]
  
      if q_left.size:
          out[case_left] = ppf_left(q_left, a[case_left], b[case_left])
      if q_right.size:
          out[case_right] = ppf_right(
              q_right, a[case_right], b[case_right]
          )
  
      out[q == 0] = a[q == 0]
      out[q == 1] = b[q == 1]
      out[a == b] = math.nan
  
      return out
  
imports: import functools
  import math
  import sys
  from typing import Callable
  from typing import Optional
  from typing import Union
  import numpy
  from optuna.samplers._tpe._erf import erf
label_desc: Use image node_id 12 for calling a global function with example usage: ppf(q, a, b) and returns: out, _ndtri_exp, unknown