code: def test_label_imbalance_condition_pass():
      # Arrange
      data = {
          "col": [1, 1, 1, 2, 2, 2] * 100,
          "label": [1, 1, 1, 1, 2, 1] * 100,
      }
      ds = Dataset(pd.DataFrame(data), label="label")
      check = ClassImbalance().add_condition_class_ratio_less_than(0.3)
  
      # Act
      result = check.run(ds)
      condition_result = check.conditions_decision(result)
  
      # Assert
      assert_that(
          condition_result,
          has_items(
              equal_condition_result(
                  is_pass=True,
                  details="The ratio between least to most frequent label is 0.2",
                  name="The ratio between least frequent label to most frequent label "
                  "is less than or equal 0.3",
              )
          ),
      )
  
file_path: deepchecks/tests/tabular/checks/integrity/class_imbalance_test.py
imports: import pandas
  from hamcrest import assert_that, calling, equal_to, has_items, has_length, raises
  from deepchecks.core import ConditionCategory
  from deepchecks.core.errors import DeepchecksValueError, ModelValidationError
  from deepchecks.tabular.checks.data_integrity.class_imbalance import ClassImbalance
  from deepchecks.tabular.dataset import Dataset
  from tests.base.utils import equal_condition_result
label_desc: Use image node_id 2 for calling a global function with example usage: test_label_imbalance_condition_pass() without return types