code: def test_drift_with_nulls(drifted_data_with_nulls):
      # Arrange
      train, test = drifted_data_with_nulls
  
      # Cramer's V with ignore_na=True:
  
      # Act
      check = FeatureDrift(numerical_drift_method="EMD")
      result = check.run(train, test)
      # Assert
      assert_that(
          result.value,
          has_entries(
              {
                  "numeric_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.02, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "numeric_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.35, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.02, 0.01),
                          "Method": equal_to("Cramer's V"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.23, 0.01),
                          "Method": equal_to("Cramer's V"),
                          "Importance": equal_to(None),
                      }
                  ),
              }
          ),
      )
      assert_that(result.display, has_length(greater_than(0)))
  
      # PSI with ignore_na=True:
  
      # Act
      check = FeatureDrift(
          categorical_drift_method="PSI",
          numerical_drift_method="EMD",
          max_num_categories=10,
          min_category_size_ratio=0,
      )
      result = check.run(train, test)
      # Assert
      assert_that(
          result.value,
          has_entries(
              {
                  "numeric_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.02, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "numeric_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.35, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_without_drift": has_entries(
                      {
                          "Drift score": close_to(0, 0.01),
                          "Method": equal_to("PSI"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.22, 0.01),
                          "Method": equal_to("PSI"),
                          "Importance": equal_to(None),
                      }
                  ),
              }
          ),
      )
      assert_that(result.display, has_length(greater_than(0)))
  
      # Cramer's V with ignore_na=False:
  
      # Act
      check = FeatureDrift(
          ignore_na=False, numerical_drift_method="EMD"
      )
      result = check.run(train, test)
      # Assert
      assert_that(
          result.value,
          has_entries(
              {
                  "numeric_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.02, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "numeric_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.35, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.09, 0.01),
                          "Method": equal_to("Cramer's V"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.24, 0.01),
                          "Method": equal_to("Cramer's V"),
                          "Importance": equal_to(None),
                      }
                  ),
              }
          ),
      )
      assert_that(result.display, has_length(greater_than(0)))
  
      # PSI with ignore_na=False:
  
      # Act
      check = FeatureDrift(
          categorical_drift_method="PSI",
          numerical_drift_method="EMD",
          max_num_categories=10,
          min_category_size_ratio=0,
          ignore_na=False,
      )
      result = check.run(train, test)
      # Assert
      assert_that(
          result.value,
          has_entries(
              {
                  "numeric_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.02, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "numeric_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.35, 0.01),
                          "Method": equal_to("Earth Mover's Distance"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_without_drift": has_entries(
                      {
                          "Drift score": close_to(0.04, 0.01),
                          "Method": equal_to("PSI"),
                          "Importance": equal_to(None),
                      }
                  ),
                  "categorical_with_drift": has_entries(
                      {
                          "Drift score": close_to(0.24, 0.01),
                          "Method": equal_to("PSI"),
                          "Importance": equal_to(None),
                      }
                  ),
              }
          ),
      )
      assert_that(result.display, has_length(greater_than(0)))
  
imports: import numpy
  import pandas
  from hamcrest import assert_that, calling, close_to, equal_to, greater_than, has_entries, has_item, has_length, is_not, raises
  from deepchecks.core.errors import NotEnoughSamplesError
  from deepchecks.tabular.checks import FeatureDrift
  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_with_nulls(drifted_data_with_nulls) without return types