code: def get_observation_stats(
      transitions_iterator: tf.data.Dataset,
  ) -> Tuple[np.float64, np.float64]:
      """Returns scale and shift of the observations in demonstrations."""
      observations = [step.observation for step in transitions_iterator]
      mean = np.mean(observations, axis=0, dtype="float64")
      std = np.std(observations, axis=0, dtype="float64")
  
      shift = -mean
      # The std is set to 1 if the observation values are below a threshold.
      # This prevents normalizing observation values that are constant (which can
      # be problematic with e.g. demonstrations coming from a different version
      # of the environment and where the constant values are slightly different).
      scale = 1 / ((std < 1e-6) + std)
      return shift, scale
  
file_path: acme/examples/baselines/imitation/helpers.py
imports: from typing import Tuple
  from acme import wrappers
  import dm_env
  import gym
  import numpy
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: get_observation_stats(transitions_iterator) and returns: shift,  scale