code: def test_pool_collection_init(
      expln_args, expln_kwargs, distributed_opts, concatenate_results
  ):
      ncpus = distributed_opts["n_cpus"]
      batch_size = distributed_opts["batch_size"]
      cpu_frac = distributed_opts["actor_cpu_fraction"]
      n_explainers = len(expln_args)
  
      if n_explainers != len(expln_kwargs):
          if ncpus > 1:
              with pytest.raises(ValueError):
                  PoolCollection(
                      distributed_opts,
                      MockExplainer,
                      expln_args,
                      expln_kwargs,
                  )
      elif ncpus == 1:
          if n_explainers == len(expln_kwargs):
              with pytest.raises(ResourceError):
                  PoolCollection(
                      distributed_opts,
                      MockExplainer,
                      expln_args,
                      expln_kwargs,
                  )
      else:
          explainer_collection = PoolCollection(
              distributed_opts,
              MockExplainer,
              expln_args,
              expln_kwargs,
              concatenate_results=concatenate_results,
          )
  
          assert ray.is_initialized()
          assert (
              len(explainer_collection.distributed_explainers)
              == n_explainers
          )
          for idx in range(n_explainers):
              explainer_collection.remote_explainer_index = idx
              assert explainer_collection.batch_size == batch_size
              assert (
                  explainer_collection.concatenate_results
                  == concatenate_results
              )
              if cpu_frac:
                  assert (
                      explainer_collection.n_processes
                      == (ncpus // n_explainers) // cpu_frac
                  )
  
      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 9 for calling a global function with example usage: test_pool_collection_init(expln_args, expln_kwargs, distributed_opts, concatenate_results) without return types