code: def test_pool_collection_get_explanation(
      data_generator, expln_args, expln_kwargs, distributed_opts
  ):
      atol = 1e-5  # absolute tolerance for floating point comparisons
  
      ncpus = distributed_opts["n_cpus"]
      pool_collection = PoolCollection(
          distributed_opts,
          MockExplainer,
          expln_args,
          expln_kwargs,
          return_generator=False,  # just emphasizing this should always be the case, can't pickle generators
          concatenate_results=False,  # tested if concatenate_results works correctly already
      )
  
      X = data_generator
  
      explanations = pool_collection.get_explanation(X)
      for this_expln_result, this_expln_args, this_expln_kwargs in zip(
          explanations, expln_args, expln_kwargs
      ):
          batched_result = np.concatenate(
              this_expln_result, axis=0
          ).squeeze()
          assert np.isclose(
              np.unique(batched_result / X),
              this_expln_kwargs["multiplier"],
              atol=atol,
          )
  
      proc_ids = []
      for idx in range(ncpus):
          pool_collection.remote_explainer_index = idx  # this is necessary to retrieve state from different processes
          for explainer_actor_idx in range(pool_collection.n_processes):
              pool_collection[idx].set_actor_index.remote(
                  explainer_actor_idx
              )
              proc_ids.append(pool_collection.proc_id)
      assert len(set(proc_ids)) == ncpus
  
      ray.shutdown()
  
imports: import inspect
  import os
  import pytest
  import time
  from itertools import product
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from alibi.utils.distributed import DistributedExplainer, PoolCollection, ResourceError, invert_permutation, concatenate_minibatches
label_desc: Use image node_id 10 for calling a global function with example usage: test_pool_collection_get_explanation(data_generator, expln_args, expln_kwargs, distributed_opts) without return types