code: def check_pandas_issue_45618_warning(test_func):
      # Check for FutureWarning raised in `pandas=1.4.0`-only.
      # This can be removed when `pandas=1.4.0` is no longer supported (PANDAS_GE_140).
      # See https://github.com/pandas-dev/pandas/issues/45618 for more details.
  
      def decorator():
          with warnings.catch_warnings(record=True) as record:
              test_func()
          if PANDAS_VERSION == parse_version("1.4.0"):
              assert all(
                  "In a future version, passing a SparseArray"
                  in str(r.message)
                  for r in record
              )
          else:
              assert not record
  
      return decorator
  
imports: from __future__ import annotations
  import contextlib
  import warnings
  import numpy
  import pandas
  import pytest
  from packaging.version import parse
  import dask.dataframe
  from dask.dataframe._compat import PANDAS_VERSION, tm
  from dask.dataframe.reshape import _get_dummies_dtype_default
  from dask.dataframe.utils import assert_eq, make_meta
label_desc: Use image node_id 5 for calling a global function with example usage: check_pandas_issue_45618_warning(test_func) and returns: decorator