code: def _bootstrap_means(samples, mean_size, fuel):
      """Compute bootstrapped means."""
      num_bootstraps = _choose_num_bootstraps(
          len(samples), mean_size, fuel
      )
      if num_bootstraps * mean_size <= len(samples):
          # Inputs are huge relative to fuel; fake a bootstrap by just slicing
          # the input array
          return np.mean(
              np.reshape(samples, newshape=(-1, mean_size)), axis=-1
          )
      # Compute this in batches to never materialize an over-large
      # intermediate array.
      n_batches = 10
      if n_batches > num_bootstraps:
          n_batches = num_bootstraps
      batches = []
      for _ in range(n_batches):
          batch_size = int(num_bootstraps / n_batches)
          batch = np.mean(
              np.random.choice(
                  samples, size=(batch_size, mean_size), replace=True
              ),
              axis=-1,
          )
          batches.append(batch)
      return np.concatenate(batches, axis=0)
  
imports: import collections
  import numpy
  import scipy.optimize
  import scipy.stats
label_desc: Use image node_id 3 for calling a global function with example usage: _bootstrap_means(samples, mean_size, fuel) and returns: np, np