code: def test_amount(self):
      fps = 60
      player_name = "PlayerInfoTest"
      env = deepmind_lab.Lab(
          "tests/debug_observation_test",
          PLAYER_DEBUG_OBSERVATIONS,
          config={
              "fps": str(fps),
              "width": "80",
              "height": "80",
              "playerName": player_name,
          },
      )
  
      action_spec = env.action_spec()
      action_index = {
          action["name"]: i for i, action in enumerate(action_spec)
      }
  
      action = np.zeros([len(action_spec)], dtype=np.intc)
      env.reset()
      obs = env.observations()
      self.assertEqual(
          obs["DEBUG.PLAYER_ID"], obs["DEBUG.PLAYERS.ID"][0]
      )
  
      names = obs["DEBUG.PLAYERS.NAME"].split("\n")
      self.assertEqual(player_name, names[0])
  
      self.assertEqual(100, obs["DEBUG.PLAYERS.GADGET_AMOUNT"][0])
      self.assertEqual(100, obs["DEBUG.PLAYERS.GADGET_AMOUNT"][1])
  
      ## Empty player's gadget ammo.
      action[action_index["FIRE"]] = 1
      for _ in six.moves.range(1000):
          env.step(action)
          obs = env.observations()
          if obs["DEBUG.PLAYERS.GADGET_AMOUNT"][0] == 0:
              break
      else:
          self.fail("Failed to empty gadget.")
  
      self.assertEqual(100, obs["DEBUG.PLAYERS.GADGET_AMOUNT"][1])
  
      action[action_index["FIRE"]] = 0
      action[action_index["MOVE_BACK_FORWARD"]] = 1
  
      for _ in six.moves.range(1000):
          env.step(action)
          obs = env.observations()
          if obs["DEBUG.PLAYERS.HEALTH"][0] <= 0:
              break
      else:
          self.fail(
              "Failed to be tagged by agent., health still"
              + str(obs["DEBUG.PLAYERS.HEALTH"][0])
          )
  
      self.assertEqual(obs["DEBUG.PLAYERS.SCORE"][0], 0.0)
      self.assertEqual(obs["DEBUG.PLAYERS.SCORE"][1], 1.0)
      self.assertEqual(obs["DEBUG.PLAYERS.IS_BOT"][0], 0)
      self.assertEqual(obs["DEBUG.PLAYERS.IS_BOT"][1], 1)
  
      self.assertGreater(100, obs["DEBUG.PLAYERS.GADGET_AMOUNT"][1])
  
file_path: lab/python/tests/debug_observation_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl.testing import absltest
  import numpy
  import six
  import deepmind_lab
label_desc: Use image node_id 1 for calling the DebugObservationTest obj's underlying member method code with example usage: obj.test_amount() without return types