code: def check_label(labels_buffer, label):
      assert label.value > 1
      if (
          label.width > 4 and label.height > 4
      ):  # Sometimes very tiny objects may be obscured by level geometry or not rendered due to sprite size
          # Values decrease with the distance from the player,
          # check for >= since objects with higher values (closer ones) can obscure objects with lower values (further ones).
          detect_color = labels_buffer >= label.value
          detect_color[
              label.y : label.y + label.height,
              label.x : label.x + label.width,
          ] = False  # Set values inside bounding box to False
          value_outside_box = np.any(
              detect_color >= label.value
          )  # Check if there is True outside the bounding box
          value_in_box = np.any(
              labels_buffer[
                  label.y : label.y + label.height,
                  label.x : label.x + label.width,
              ]
              >= label.value
          )  # Check if there is True in the bounding box
          assert not value_outside_box and value_in_box
  
imports: import os
  from random import choice
  import numpy
  import vizdoom
label_desc: Use image node_id 1 for calling a global function with example usage: check_label(labels_buffer, label) without return types