code: def append_observation_to_statistics(
      observation: Iterable, statistics: dict
  ):
      """
      Stores observation.
      :param: Observation to append
      :param: Statistics dict in which to store the observation.
      :return: Updated statistics.
      """
  
      def process_key(_key: Any):
          """
          Processes observation for current observation.
          :param _key:
          """
          if _key in statistics:
              if type(observation[_key]) in (np.ndarray, list):
                  if "values" not in statistics[_key]:
                      statistics[_key]["values"] = []
                  statistics[_key]["values"].append(observation[_key])
              else:
                  append_observation_to_statistics(
                      observation[_key], statistics[_key]
                  )
  
      if isinstance(observation, dict):
          for key in observation:
              process_key(key)
      elif isinstance(observation, tuple):
          for i, _ in enumerate(observation):
              process_key(i)
  
imports: from typing import Any, Callable, Iterable
  import gym
  import numpy
  from maze.core.wrappers.observation_normalization.observation_normalization_wrapper import ObservationNormalizationWrapper
label_desc: Use image node_id 1 for calling a global function with example usage: append_observation_to_statistics(observation, statistics) without return types