code: def test_hide_cloaked(self):
      self.assertFalse(self._info.options.show_cloaked)
  
      self.god()
      self.move_camera(32, 32)
  
      # Create some units. One cloaked, one to see it without detection.
      self.create_unit(
          unit_type=units.Protoss.DarkTemplar, owner=1, pos=(30, 30)
      )
      self.create_unit(
          unit_type=units.Protoss.Sentry, owner=2, pos=(28, 30)
      )
  
      self.step(16)
      obs = self.observe()
  
      # Verify both can see it, but that only the owner knows details.
      p1 = utils.get_unit(obs[0], unit_type=units.Protoss.DarkTemplar)
      p2 = utils.get_unit(obs[1], unit_type=units.Protoss.DarkTemplar)
  
      self.assert_unit(
          p1,
          display_type=sc_raw.Visible,
          health=40,
          shield=80,
          cloak=sc_raw.CloakedAllied,
      )
      self.assertIsNone(p2)
  
      screen1 = self._features.transform_obs(obs[0])["feature_screen"]
      screen2 = self._features.transform_obs(obs[1])["feature_screen"]
      dt = utils.xy_locs(
          screen1.unit_type == units.Protoss.DarkTemplar
      )[0]
      self.assert_layers(
          screen1,
          dt,
          unit_type=units.Protoss.DarkTemplar,
          unit_hit_points=40,
          unit_shields=80,
          cloaked=1,
      )
      self.assert_layers(
          screen2,
          dt,
          unit_type=0,
          unit_hit_points=0,
          unit_shields=0,
          cloaked=0,
      )
  
      # Create an observer so the opponent has detection.
      self.create_unit(
          unit_type=units.Protoss.Observer, owner=2, pos=(28, 28)
      )
  
      self.step(16)  # It takes a few frames for the observer to detect.
      obs = self.observe()
  
      # Verify both can see it, with the same details
      p1 = utils.get_unit(obs[0], unit_type=units.Protoss.DarkTemplar)
      p2 = utils.get_unit(obs[1], unit_type=units.Protoss.DarkTemplar)
      self.assert_unit(
          p1,
          display_type=sc_raw.Visible,
          health=40,
          shield=80,
          cloak=sc_raw.CloakedAllied,
      )
      self.assert_unit(
          p2,
          display_type=sc_raw.Visible,
          health=40,
          shield=80,
          cloak=sc_raw.CloakedDetected,
      )
  
      screen1 = self._features.transform_obs(obs[0])["feature_screen"]
      screen2 = self._features.transform_obs(obs[1])["feature_screen"]
      dt = utils.xy_locs(
          screen1.unit_type == units.Protoss.DarkTemplar
      )[0]
      self.assert_layers(
          screen1,
          dt,
          unit_type=units.Protoss.DarkTemplar,
          unit_hit_points=40,
          unit_shields=80,
          cloaked=1,
      )
      self.assert_layers(
          screen2,
          dt,
          unit_type=units.Protoss.DarkTemplar,
          unit_hit_points=40,
          unit_shields=80,
          cloaked=1,
      )
  
file_path: pysc2/pysc2/tests/obs_test.py
imports: from absl.testing import absltest
  from pysc2.lib import actions
  from pysc2.lib import buffs
  from pysc2.lib import features
  from pysc2.lib import units
  from pysc2.tests import utils
  from s2clientprotocol import debug_pb2
  from s2clientprotocol import raw_pb2
label_desc: Use image node_id 2 for calling the ObsTest obj's underlying member method code with example usage: obj.test_hide_cloaked() without return types