code: def test_CustomActions(self):
      env = deepmind_lab.Lab(
          "tests/custom_actions_test", [], config={"fps": "60"}
      )
      action_spec = env.action_spec()
      action_index = {
          action["name"]: i for i, action in enumerate(action_spec)
      }
      self.assertIn("SWITCH_GADGET", action_index)
      self.assertIn("SELECT_GADGET", action_index)
      self.assertEqual(
          action_spec[action_index["SWITCH_GADGET"]]["min"], -1
      )
      self.assertEqual(
          action_spec[action_index["SWITCH_GADGET"]]["max"], 1
      )
      self.assertEqual(
          action_spec[action_index["SELECT_GADGET"]]["min"], 0
      )
      self.assertEqual(
          action_spec[action_index["SELECT_GADGET"]]["max"], 10
      )
      action = np.zeros([len(action_spec)], dtype=np.intc)
      env.reset()
      events = env.events()
      self.assertEmpty(events)
      env.step(action)
      events = env.events()
      self.assertEmpty(events)
      action[action_index["SWITCH_GADGET"]] = 1
      env.step(action)
      events = env.events()
      self.assertLen(events, 1)
      name, values = events[0]
      self.assertEqual(name, "SWITCH_GADGET")
      self.assertEqual(values[0], "1")
      action[action_index["SWITCH_GADGET"]] = 0
      action[action_index["SELECT_GADGET"]] = 1
      env.step(action)
      events = env.events()
      self.assertLen(events, 1)
      name, values = events[0]
      self.assertEqual(name, "SELECT_GADGET")
      self.assertEqual(values[0], "1")
  
file_path: lab/python/tests/custom_actions_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 deepmind_lab
label_desc: Use image node_id 1 for calling the CustomViewTest obj's underlying member method code with example usage: obj.test_CustomActions() without return types