code: def test_token_classification_dataset(
      small_wikiann_train_test_text_data,
  ):
      # Arrange
      data, _ = small_wikiann_train_test_text_data
      data = data.copy()
      data._label = np.asarray(
          list(data._label[:40]) + [None] * 10, dtype=object
      )
      data.calculate_builtin_properties(
          include_long_calculation_properties=False
      )
      check = UnderAnnotatedPropertySegments(
          segment_minimum_size_ratio=0.02
      ).add_condition_segments_relative_performance_greater_than(0.1)
  
      # Act
      result = check.run(data)
      condition_result = check.conditions_decision(result)
  
      # Assert
      assert_that(
          condition_result,
          has_items(
              equal_condition_result(
                  is_pass=False,
                  details="Found a segment with annotation ratio of 0.4 in comparison to an "
                  "average score of 0.8 in sampled data.",
                  name="The relative performance of weakest segment is greater than 90% of average model "
                  "performance.",
              )
          ),
      )
  
      assert_that(result.value["avg_score"], close_to(0.8, 0.001))
      assert_that(len(result.value["weak_segments_list"]), equal_to(5))
      assert_that(
          result.value["weak_segments_list"].iloc[0, 0],
          close_to(0.4, 0.01),
      )
  
file_path: deepchecks/tests/nlp/checks/data_integrity/under_annotated_segments_test.py
imports: import numpy
  from hamcrest import assert_that, calling, close_to, equal_to, has_items, raises
  from deepchecks.core.errors import NotEnoughSamplesError
  from deepchecks.nlp.checks import UnderAnnotatedMetaDataSegments, UnderAnnotatedPropertySegments
  from tests.base.utils import equal_condition_result
label_desc: Use image node_id 5 for calling a global function with example usage: test_token_classification_dataset(small_wikiann_train_test_text_data) without return types