class_docstr: Keeps track of a running mean for seen states
code: def __init__(self, shape, demean=True, destd=True, clip=10.0):
      self.shape = shape
      # We don't have a preprocessor, if shape is None (Discrete) or
      # flat_shape is Tuple[np.ndarray] or Dict[str, np.ndarray]
      # (complex inputs).
      flat_shape = tree.flatten(self.shape)
      self.no_preprocessor = shape is None or (
          isinstance(self.shape, (dict, tuple))
          and len(flat_shape) > 0
          and isinstance(flat_shape[0], np.ndarray)
      )
      # If preprocessing (flattening dicts/tuples), make sure shape
      # is an np.ndarray, so we don't confuse it with a complex Tuple
      # space's shape structure (which is a Tuple[np.ndarray]).
      if not self.no_preprocessor:
          self.shape = np.array(self.shape)
      self.demean = demean
      self.destd = destd
      self.clip = clip
      # Running stats.
      self.running_stats = tree.map_structure(
          lambda s: RunningStat(s), self.shape
      )
  
      # In distributed rollouts, each worker sees different states.
      # The buffer is used to keep track of deltas amongst all the
      # observation filters.
      self.buffer = None
      self.reset_buffer()
  
imports: import logging
  import threading
  import numpy
  import tree
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.utils.deprecation import Deprecated
  from ray.rllib.utils.numpy import SMALL_NUMBER
  from ray.rllib.utils.typing import TensorStructType
  from ray.rllib.utils.serialization import _serialize_ndarray, _deserialize_ndarray
  from ray.rllib.utils.deprecation import deprecation_warning
label_desc: Use image node_id 1 to create a new MeanStdFilter object from inherited base classes: Filter with example: obj = MeanStdFilter(shape, demean, destd, clip)