class_docstr: Coordinator of n (possibly remote) Learner workers.
  
  Each Learner worker has a copy of the RLModule, the loss function(s), and
  one or more optimizers.
docstr: Sets the function that determines whether a module should be updated or not.
  
  Args:
      should_module_be_updated_fn: An optional callable that takes in a ModuleID
          and a batch and returns a boolean indicating whether the module should
          be updated on the given batch.
docstr_tok: ["Sets","the","function","that","determines","whether","a","module","should","be","updated","or","not",".","Args",":","should_module_be_updated_fn",":","An","optional","callable","that","takes","in","a","ModuleID","and","a","batch","and","returns","a","boolean","indicating","whether","the","module","should","be","updated","on","the","given","batch","."]
code: def set_should_module_be_updated_fn(
      self,
      should_module_be_updated_fn: Optional[
          ShouldModuleBeUpdatedFn
      ] = None,
  ) -> None:
      """Sets the function that determines whether a module should be updated or not.
  
      Args:
          should_module_be_updated_fn: An optional callable that takes in a ModuleID
              and a batch and returns a boolean indicating whether the module should
              be updated on the given batch.
      """
      # If None, use default implementation (all modules should be updated).
      if should_module_be_updated_fn is None:
          should_module_be_updated_fn = (
              _default_should_module_be_updated_fn
          )
      # If container given, construct a simple callable returning True
      # if the ModuleID is found in the list/set of IDs.
      elif not callable(should_module_be_updated_fn):
          if not isinstance(
              should_module_be_updated_fn, (list, set, tuple)
          ):
              raise ValueError(
                  "`should_module_be_updated_fn` arg must either be a [list|set|"
                  "tuple] or a callable taking a ModuleID and a MultiAgentBatch as "
                  "call args and returning True|False (whether module is to be "
                  "updated or not?)."
              )
          module_ids = set(should_module_be_updated_fn)
  
          def should_module_be_updated_fn(mid, batch=None):
              return mid in module_ids
  
      self._should_module_be_updated_fn = should_module_be_updated_fn
  
imports: from collections import defaultdict, Counter
  from functools import partial
  import pathlib
  from typing import Any, Callable, Dict, List, Optional, Set, Type, Union
  import uuid
  import ray
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.core.learner.learner import Learner
  from ray.rllib.core.learner.reduce_result_dict_fn import _reduce_mean_results
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec, RLMODULE_STATE_DIR_NAME
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.utils.actor_manager import FaultTolerantActorManager
  from ray.rllib.utils.deprecation import Deprecated, deprecation_warning
  from ray.rllib.utils.minibatch_utils import ShardBatchIterator, ShardEpisodesIterator
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.typing import EpisodeType, ModuleID, ResultDict, RLModuleSpec, ShouldModuleBeUpdatedFn
  from ray.train._internal.backend_executor import BackendExecutor
  from ray.tune.utils.file_transfer import sync_dir_between_nodes
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 18 for calling the LearnerGroup obj's underlying member method code with example usage: obj.set_should_module_be_updated_fn(should_module_be_updated_fn) and returns: unknown