code: def calculate_gains(dtypes, parallel, fastmath, cache):
      @njit(dtypes, parallel=parallel, fastmath=fastmath, cache=cache)
      def calculate_gains_(X, gains, current_values, threshold, idxs):
          for i in prange(idxs.shape[0]):
              idx = idxs[i]
              gains[i] = numpy.fmin(
                  current_values + X[idx], threshold
              ).sum()
  
      return calculate_gains_
  
file_path: apricot/apricot/functions/maxCoverage.py
imports: import numpy
  from .base import BaseSelection
  from ..optimizers import LazyGreedy
  from ..optimizers import ApproximateLazyGreedy
  from ..optimizers import SieveGreedy
  from numba import njit
  from numba import prange
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_gains(dtypes, parallel, fastmath, cache) and returns: calculate_gains_