code: def calculate_gains(dtypes, parallel, fastmath, cache):
      @njit(dtypes, parallel=parallel, fastmath=fastmath, cache=cache)
      def calculate_gains_(X, gains, current_values, idxs):
          for i in prange(idxs.shape[0]):
              idx = idxs[i]
              gains[i] = numpy.maximum(X[idx], current_values).sum()
  
      return calculate_gains_
  
file_path: apricot/apricot/functions/facilityLocation.py
imports: import numpy
  from .base import BaseGraphSelection
  from ..optimizers import LazyGreedy
  from ..optimizers import ApproximateLazyGreedy
  from ..optimizers import SieveGreedy
  from tqdm import tqdm
  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_