class_docstr: Resize the image observation.
  
  This wrapper works on environments with image observations (or more generally observations of shape AxBxC) and resizes
  the observation to the shape given by the 2-tuple :attr:`shape`. The argument :attr:`shape` may also be an integer.
  In that case, the observation is scaled to a square of side-length :attr:`shape`.
  
  Example:
      >>> import gym
      >>> env = gym.make('CarRacing-v1')
      >>> env.observation_space.shape
      (96, 96, 3)
      >>> env = ResizeObservation(env, 64)
      >>> env.observation_space.shape
      (64, 64, 3)
docstr: Updates the observations by resizing the observation to shape given by :attr:`shape`.
  
  Args:
      observation: The observation to reshape
  
  Returns:
      The reshaped observations
  
  Raises:
      DependencyNotInstalled: opencv-python is not installed
code: def observation(self, observation):
      """Updates the observations by resizing the observation to shape given by :attr:`shape`.
  
      Args:
          observation: The observation to reshape
  
      Returns:
          The reshaped observations
  
      Raises:
          DependencyNotInstalled: opencv-python is not installed
      """
      try:
          import cv2
      except ImportError:
          raise DependencyNotInstalled(
              "opencv is not install, run `pip install gym[other]`"
          )
  
      observation = cv2.resize(
          observation, self.shape[::-1], interpolation=cv2.INTER_AREA
      )
      if observation.ndim == 2:
          observation = np.expand_dims(observation, -1)
      return observation
  
file_path: gym/gym/wrappers/resize_observation.py
imports: from typing import Union
  import numpy
  import gym
  from gym.error import DependencyNotInstalled
  from gym.spaces import Box
label_desc: Use image node_id 2 for calling the ResizeObservation obj's underlying member method code with example usage: obj.observation(observation) and returns: observation