code: def test_tweet_emotion_properties(
      tweet_emotion_train_test_textdata,
      tweet_emotion_train_test_probabilities,
  ):
      # Arrange
      _, test = tweet_emotion_train_test_textdata
      _, test_probas = tweet_emotion_train_test_probabilities
      check = PropertySegmentsPerformance().add_condition_segments_relative_performance_greater_than(
          max_ratio_change=0.3
      )
      # Act
      result = check.run(test, probabilities=test_probas)
      condition_result = check.conditions_decision(result)
  
      # Assert
      assert_that(
          condition_result,
          has_items(
              equal_condition_result(
                  is_pass=True,
                  details="Found a segment with accuracy score of 0.525 in comparison to an average "
                  "score of 0.708 in sampled data.",
                  name="The relative performance of weakest segment is greater than 70% of average "
                  "model performance.",
              )
          ),
      )
  
      assert_that(result.value["avg_score"], close_to(0.708, 0.001))
      assert_that(
          len(result.value["weak_segments_list"]), close_to(6, 1)
      )
      assert_that(
          result.value["weak_segments_list"].iloc[0, 0],
          close_to(0.525, 0.01),
      )
  
file_path: deepchecks/tests/nlp/checks/model_evaluation/weak_segment_performance_test.py
imports: import numpy
  import pandas
  import pytest
  from hamcrest import assert_that, calling, close_to, equal_to, has_items, is_in, matches_regexp, raises
  from deepchecks.core.errors import DeepchecksNotSupportedError, NotEnoughSamplesError
  from deepchecks.nlp.checks import MetadataSegmentsPerformance, PropertySegmentsPerformance
  from tests.base.utils import equal_condition_result
label_desc: Use image node_id 4 for calling a global function with example usage: test_tweet_emotion_properties(tweet_emotion_train_test_textdata, tweet_emotion_train_test_probabilities) without return types