class_docstr: Preprocesses each dict value, then flattens it all into a vector.
  
  RLlib models will unpack the flattened output before _build_layers_v2().
code: def write(
      self, observation: TensorType, array: np.ndarray, offset: int
  ) -> None:
      if not isinstance(observation, OrderedDict):
          observation = OrderedDict(sorted(observation.items()))
      assert len(observation) == len(self.preprocessors), (
          len(observation),
          len(self.preprocessors),
      )
      for o, p in zip(observation.values(), self.preprocessors):
          p.write(o, array, offset)
          offset += p.size
  
imports: from collections import OrderedDict
  import logging
  import numpy
  import gymnasium
  from typing import Any, List
  from ray.rllib.utils.annotations import override, PublicAPI, DeveloperAPI
  from ray.rllib.utils.spaces.repeated import Repeated
  from ray.rllib.utils.typing import TensorType
  from ray.rllib.utils.images import resize
  from ray.rllib.utils.spaces.space_utils import convert_element_to_space_type
label_desc: Use image node_id 3 for calling the DictFlatteningPreprocessor obj's underlying member method code with example usage: obj.write(observation, array, offset) without return types