code: def test_labels_buffer():
      print("Testing labels buffer ...")
      game = vzd.DoomGame()
      game.load_config(
          os.path.join(vzd.scenarios_path, "deathmatch.cfg")
      )
  
      game.set_screen_resolution(vzd.ScreenResolution.RES_640X480)
      game.set_labels_buffer_enabled(True)
      game.set_render_hud(False)
      game.set_window_visible(False)
      # game.set_mode(vzd.Mode.SPECTATOR)  # For manual testing
  
      game.init()
  
      actions = [
          [True, False, False, False],
          [False, True, False, False],
          [False, False, True, False],
          [False, False, False, True],
      ]
  
      game.new_episode()
      state_count = 0
      seen_labels = 0
      seen_unique_objects = set()
  
      while not game.is_episode_finished():
          state = game.get_state()
          labels_buffer = state.labels_buffer
          game.make_action(choice(actions))
  
          state_count += 1
          seen_labels += len(state.labels)
          for label in state.labels:
              seen_unique_objects.add(label.object_name)
              check_label(labels_buffer, label)
      game.close()
  
      print(
          f"Seen {seen_labels} labels with {len(seen_unique_objects)} unique objects in {state_count} states."
      )
  
imports: import os
  from random import choice
  import numpy
  import vizdoom
label_desc: Use image node_id 2 for calling a global function with example usage: test_labels_buffer() without return types