class_docstr: Ensures common frames are only stored once to optimize memory use.
  
  To further reduce the memory use, it is optionally to turn on lz4 to compress the observations.
  
  Note:
      This object should only be converted to numpy array just before forward pass.
class_docstr_tok: ["Ensures","common","frames","are","only","stored","once","to","optimize","memory","use",".","To","further","reduce","the","memory","use",",","it","is","optionally","to","turn","on","lz4","to","compress","the","observations",".","Note",":","This","object","should","only","be","converted","to","numpy","array","just","before","forward","pass","."]
docstr: Gets the stacked frames for a particular index or slice.
  
  Args:
      int_or_slice: Index or slice to get items for
  
  Returns:
      np.stacked frames for the int or slice
docstr_tok: ["Gets","the","stacked","frames","for","a","particular","index","or","slice",".","Args",":","int_or_slice",":","Index","or","slice","to","get","items","for","Returns",":","np.stacked","frames","for","the","int","or","slice"]
code: def __getitem__(self, int_or_slice: Union[int, slice]):
      """Gets the stacked frames for a particular index or slice.
  
      Args:
          int_or_slice: Index or slice to get items for
  
      Returns:
          np.stacked frames for the int or slice
  
      """
      if isinstance(int_or_slice, int):
          return self._check_decompress(
              self._frames[int_or_slice]
          )  # single frame
      return np.stack(
          [
              self._check_decompress(f)
              for f in self._frames[int_or_slice]
          ],
          axis=0,
      )
  
file_path: gym/gym/wrappers/frame_stack.py
imports: from collections import deque
  from typing import Union
  import numpy
  import gym
  from gym.error import DependencyNotInstalled
  from gym.spaces import Box
label_desc: Use image node_id 4 for calling the LazyFrames obj's underlying member method code with example usage: obj.__getitem__(int_or_slice) and returns: np, self