code: def is_atari(env: Union[gym.Env, str]) -> bool:
      """Returns, whether a given env object or env descriptor (str) is an Atari env.
  
      Args:
          env: The gym.Env object or a string descriptor of the env (e.g. "ALE/Pong-v5").
  
      Returns:
          Whether `env` is an Atari environment.
      """
      # If a gym.Env, check proper spaces as well as occurrence of the "Atari<ALE" string
      # in the class name.
      if not isinstance(env, str):
          if (
              hasattr(env.observation_space, "shape")
              and env.observation_space.shape is not None
              and len(env.observation_space.shape) <= 2
          ):
              return False
          return "AtariEnv<ALE" in str(env)
      # If string, check for "ALE/" prefix.
      else:
          return env.startswith("ALE/")
  
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 for calling a global function with example usage: is_atari(env) and returns: unknown, env, False