code: def _true_positive_fraction(z_vals, hommel_value, alpha):
      """Given a bunch of z-avalues, return the true positive fraction.
  
      Parameters
      ----------
      z_vals : array,
          A set of z-variates from which the FDR is computed.
  
      hommel_value: int
          The Hommel value, used in the computations.
  
      alpha : float
          The desired FDR control.
  
      Returns
      -------
      threshold : float
          Estimated true positive fraction in the set of values.
  
      """
      z_vals_ = -np.sort(-z_vals)
      p_vals = norm.sf(z_vals_)
      n_samples = len(p_vals)
      c = np.ceil((hommel_value * p_vals) / alpha)
      unique_c, counts = np.unique(c, return_counts=True)
      criterion = 1 - unique_c + np.cumsum(counts)
      proportion_true_discoveries = np.maximum(
          0, criterion.max() / n_samples
      )
      return proportion_true_discoveries
  
file_path: nilearn/nilearn/glm/thresholding.py
imports: import warnings
  import numpy
  from scipy.ndimage import label
  from scipy.stats import norm
  from nilearn.image import get_data, math_img, threshold_img
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 2 for calling a global function with example usage: _true_positive_fraction(z_vals, hommel_value, alpha) and returns: proportion_true_discoveries