code: def test_null_transformer_error(data):
      """Checks warnings and exceptions"""
      with pytest.warns(RuntimeWarning) as record:
          null_transform = NullTransformer(max_frac=0.10)
          null_transform.fit_transform(data)
          assert (
              "Input data has many null values"
              in record[0].message.args[0]
          )
  
      null_transform = NullTransformer(max_frac=0.70)
      with LogCapture(LOGGER_NAME) as log_capture:
          null_transform.fit_transform(data)
          log_capture.check(
              (
                  LOGGER_NAME,
                  "INFO",
                  "Missing data detected: 37.50% of all input values are null. "
                  "(If future external regressor(s) are used, some missing values in "
                  "`value_col` are expected.)",
              )
          )
  
      null_transform = NullTransformer()
      with pytest.raises(
          NotFittedError, match="This instance is not fitted yet"
      ):
          null_transform.transform(data)
  
      null_transform = NullTransformer(impute_algorithm="unknown")
      with pytest.raises(
          ValueError,
          match="`impute_algorithm` 'unknown' is not recognized",
      ):
          null_transform.fit_transform(data)
  
file_path: greykite/greykite/tests/sklearn/transform/test_null_transformer.py
imports: import numpy
  import pandas
  import pytest
  from sklearn.exceptions import NotFittedError
  from testfixtures import LogCapture
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.python_utils import assert_equal
  from greykite.sklearn.transform.null_transformer import NullTransformer
label_desc: Use image node_id 5 for calling a global function with example usage: test_null_transformer_error(data) without return types