code: def test_drift_classification_label_imbalanced():
      # Arrange
      train = Dataset(
          pd.DataFrame({"d": np.ones(10000)}),
          label=np.array([0] * 9900 + [1] * 100),
      )
      test = Dataset(
          pd.DataFrame({"d": np.ones(10000)}),
          label=np.array([0] * 9800 + [1] * 200),
      )
      check = LabelDrift(
          categorical_drift_method="cramers_v", balance_classes=True
      )
  
      # Act
      result = check.run(train, test)
  
      # Assert
      assert_that(
          result.value,
          has_entries(
              {
                  "Drift score": close_to(0.17, 0.01),
                  "Method": equal_to("Cramer's V"),
              }
          ),
      )
      assert_that(result.display, has_length(greater_than(0)))
  
file_path: deepchecks/tests/tabular/checks/train_test_validation/label_drift_test.py
imports: import numpy
  import pandas
  from hamcrest import assert_that, calling, close_to, equal_to, greater_than, has_entries, has_length, raises
  from deepchecks.core.condition import ConditionCategory
  from deepchecks.core.errors import NotEnoughSamplesError
  from deepchecks.tabular import Dataset
  from deepchecks.tabular.checks import LabelDrift
  from tests.base.utils import equal_condition_result
label_desc: Use image node_id 4 for calling a global function with example usage: test_drift_classification_label_imbalanced() without return types