docstr: Stack k last frames.
code: def __init__(self, env, k):
      """Stack k last frames."""
      gym.Wrapper.__init__(self, env)
      self.k = k
      self.frames = deque([], maxlen=k)
      shp = env.observation_space.shape
      self.observation_space = spaces.Box(
          low=np.repeat(env.observation_space.low, repeats=k, axis=-1),
          high=np.repeat(
              env.observation_space.high, repeats=k, axis=-1
          ),
          shape=(shp[0], shp[1], shp[2] * k),
          dtype=env.observation_space.dtype,
      )
  
imports: from collections import deque
  import gymnasium
  from gymnasium import spaces
  import numpy
  from typing import Union
  from ray.rllib.utils.annotations import PublicAPI
  from ray.rllib.utils.images import rgb2gray, resize
label_desc: Use image node_id 1 to create a new FrameStack object from inherited base classes: gym with example: obj = FrameStack(env, k)