code: def replica_local_creator(next_creator, **kwargs) -> tf.Variable:
      """Variable creator that by default creates replica local variables."""
      if kwargs["synchronization"] == tf.VariableSynchronization.AUTO:
          kwargs["synchronization"] = tf.VariableSynchronization.ON_READ
          if kwargs["aggregation"] == tf.VariableAggregation.NONE:
              kwargs[
                  "aggregation"
              ] = tf.VariableAggregation.ONLY_FIRST_REPLICA
          if kwargs["trainable"] is None:
              kwargs["trainable"] = True
      return next_creator(**kwargs)
  
file_path: sonnet/sonnet/src/distribute/replicator.py
imports: from typing import Callable, TypeVar
  from absl import logging
  import contextlib
  from sonnet.src import initializers
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: replica_local_creator(next_creator) and returns: next_creator