class_docstr: An env that spawns a subprocess.
class_docstr_tok: ["An","env","that","spawns","a","subprocess","."]
code: def __init__(self, config):
      self.UNIQUE_FILE_0 = config["tmp_file1"]
      self.UNIQUE_FILE_1 = config["tmp_file2"]
      self.UNIQUE_FILE_2 = config["tmp_file3"]
      self.UNIQUE_FILE_3 = config["tmp_file4"]
  
      self.action_space = Discrete(2)
      self.observation_space = Discrete(2)
      # Subprocess that should be cleaned up.
      self.subproc = subprocess.Popen(
          self.UNIQUE_CMD.split(" "), shell=False
      )
      self.config = config
      # Exit handler should be called.
      atexit.register(lambda: self.subproc.kill())
      if config.worker_index == 0:
          atexit.register(lambda: os.unlink(self.UNIQUE_FILE_0))
      else:
          atexit.register(lambda: os.unlink(self.UNIQUE_FILE_1))
  
file_path: ray/rllib/examples/env/env_with_subprocess.py
imports: import atexit
  import gymnasium
  from gymnasium.spaces import Discrete
  import os
  import subprocess
label_desc: Use image node_id 1 to create a new EnvWithSubprocess object from inherited base classes: gym with example: obj = EnvWithSubprocess(config)