class_docstr: Standard "Nature Atari" wrapper for Python environments.
  
  Before being fed to a neural network, Atari frames go through a prepocessing,
  implemented in this wrapper. For historical reasons, there were different
  choices in the method to apply there between what was done in the Dopamine
  library and what is done in Acme. During the processing of
  Atari frames, three operations need to happen. Images are
  transformed from RGB to grayscale, we perform a max-pooling on the time scale,
  and images are resized to 84x84.
  
  1. The `standard` style (this one, matches previous acme versions):
     - does max pooling, then rgb -> grayscale
     - uses Pillow inter area interpolation for resizing
  2. The `dopamine` style:
     - does rgb -> grayscale, then max pooling
     - uses opencv bilinear interpolation for resizing.
  
  This can change the behavior of RL agents on some games. The recommended
  setting is to use the standard style with this class. The Dopamine setting is
  available in `atari_wrapper_dopamine.py` for the
  user that wishes to compare agents between librairies.
docstr: Preprocess Atari frames.
docstr_tok: ["Preprocess","Atari","frames","."]
code: def _preprocess_pixels(self, timestep_stack: List[dm_env.TimeStep]):
      """Preprocess Atari frames."""
      # 1. Max pooling
      processed_pixels = np.max(
          np.stack(
              [
                  s.observation[RGB_INDEX]
                  for s in timestep_stack[-self._pooled_frames :]
              ]
          ),
          axis=0,
      )
  
      # 2. RGB to grayscale
      if self._grayscaling:
          processed_pixels = np.tensordot(
              processed_pixels,
              [0.299, 0.587, 1 - (0.299 + 0.587)],
              (-1, 0),
          )
  
      # 3. Resize
      processed_pixels = processed_pixels.astype(np.uint8, copy=False)
      if self._scale_dims != processed_pixels.shape[:2]:
          processed_pixels = Image.fromarray(processed_pixels).resize(
              (self._width, self._height), Image.Resampling.BILINEAR
          )
          processed_pixels = np.array(processed_pixels, dtype=np.uint8)
  
      return processed_pixels
  
imports: import abc
  from typing import Tuple, List, Optional, Sequence, Union
  from acme.wrappers import base
  from acme.wrappers import frame_stacking
  import dm_env
  from dm_env import specs
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 for calling the AtariWrapper obj's underlying member method code with example usage: obj._preprocess_pixels(timestep_stack) and returns: processed_pixels