code: def local_getter(getter, name, *args, **kwargs):
      """
      This is a wrapper around the tf.get_variable function which puts the variables in the local variables collection
      instead of the global variables collection. The local variables collection will hold variables which are not shared
      between workers. these variables are also assumed to be non-trainable (the optimizer does not apply gradients to
      these variables), but we can calculate the gradients wrt these variables, and we can update their content.
      """
      kwargs["collections"] = [tf.GraphKeys.LOCAL_VARIABLES]
      return getter(name, *args, **kwargs)
  
imports: import os
  import time
  from typing import Any, List, Tuple, Dict
  import numpy
  import tensorflow
  from rl_coach.architectures.architecture import Architecture
  from rl_coach.architectures.tensorflow_components.savers import GlobalVariableSaver
  from rl_coach.base_parameters import AgentParameters, DistributedTaskParameters
  from rl_coach.core_types import GradientClippingMethod
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition
  from rl_coach.utils import force_list, squeeze_list, start_shell_command_and_wait
label_desc: Use image node_id 2 for calling a global function with example usage: local_getter(getter, name) and returns: getter