code: def test_condition_class_performance_imbalance_ratio_less_than_fail(
      mnist_visiondata_train, mnist_visiondata_test
  ):
      # Arrange
      check = ClassPerformance().add_condition_class_performance_imbalance_ratio_less_than(
          0.0001, "Precision"
      )
  
      # Act
      result = check.run(mnist_visiondata_train, mnist_visiondata_test)
  
      assert_that(
          result.conditions_results,
          has_items(
              equal_condition_result(
                  is_pass=False,
                  details="Relative ratio difference between highest and lowest in Test dataset classes "
                  "is 4.76%, using Precision metric. Lowest class - 6: 0.95; Highest class - 0: "
                  "1\nRelative ratio difference between highest and lowest in Train dataset "
                  "classes is 6.25%, using Precision metric. Lowest class - 8: 0.94; Highest class"
                  " - 0: 1",
                  name="Relative ratio difference between labels 'Precision' score is less than 0.01%",
              )
          ),
      )
  
imports: import re
  import typing
  from hamcrest import assert_that, calling, close_to, equal_to, greater_than, has_items, has_length, instance_of, raises
  from plotly.basedatatypes import BaseFigure
  from deepchecks.core.errors import DeepchecksNotSupportedError, DeepchecksValueError
  from deepchecks.vision.checks import ClassPerformance
  from deepchecks.vision.metrics_utils import CustomClassificationScorer
  from deepchecks.vision.metrics_utils.confusion_matrix_counts_metrics import AVAILABLE_EVALUATING_FUNCTIONS
  from tests.base.utils import equal_condition_result
label_desc: Use image node_id 11 for calling a global function with example usage: test_condition_class_performance_imbalance_ratio_less_than_fail(mnist_visiondata_train, mnist_visiondata_test) without return types