code: def z_score(pvalue, one_minus_pvalue=None):
      """Return the z-score(s) corresponding to certain p-value(s) and, \
      optionally, one_minus_pvalue(s) provided as inputs.
  
      Parameters
      ----------
      pvalue : float or 1-d array shape=(n_pvalues,)
          P-values computed using the survival function.
  
      one_minus_pvalue : float or 1-d array shape=(n_one_minus_pvalues,), \
          optional
          It shall take the value returned
          by /nilearn/glm/contrasts.py::one_minus_pvalue
          which computes the p_value using the cumulative distribution function,
          with n_one_minus_pvalues = n_pvalues.
  
      Returns
      -------
      z_scores : 1-d array shape=(n_z_scores,), with n_z_scores = n_pvalues
  
      """
      pvalue = np.clip(pvalue, 1.0e-300, 1.0 - 1.0e-16)
      z_scores_sf = norm.isf(pvalue)
  
      if one_minus_pvalue is not None:
          one_minus_pvalue = np.clip(
              one_minus_pvalue, 1.0e-300, 1.0 - 1.0e-16
          )
          z_scores_cdf = norm.ppf(one_minus_pvalue)
          z_scores = np.empty(pvalue.size)
          use_cdf = z_scores_sf < 0
          use_sf = np.logical_not(use_cdf)
          z_scores[np.atleast_1d(use_cdf)] = z_scores_cdf[use_cdf]
          z_scores[np.atleast_1d(use_sf)] = z_scores_sf[use_sf]
      else:
          z_scores = z_scores_sf
      return z_scores
  
file_path: nilearn/nilearn/glm/_utils.py
imports: from warnings import warn
  import numpy
  import scipy.linalg
  from scipy.stats import norm
label_desc: Use image node_id 1 for calling a global function with example usage: z_score(pvalue, one_minus_pvalue) and returns: z_scores