code: def test_assert_eq_scheduler():
      using_custom_scheduler = False
  
      def custom_scheduler(*args, **kwargs):
          nonlocal using_custom_scheduler
          try:
              using_custom_scheduler = True
              return get_sync(*args, **kwargs)
          finally:
              using_custom_scheduler = False
  
      def check_custom_scheduler(part: pd.DataFrame) -> pd.DataFrame:
          assert using_custom_scheduler, "not using custom scheduler"
          return part + 1
  
      df = pd.DataFrame({"x": [1, 2, 3, 4]})
      ddf = dd.from_pandas(df, npartitions=2)
      ddf2 = ddf.map_partitions(check_custom_scheduler, meta=ddf)
  
      with pytest.raises(
          AssertionError, match="not using custom scheduler"
      ):
          # NOTE: we compare `ddf2` to itself in order to test both sides of the `assert_eq` logic.
          assert_eq(ddf2, ddf2)
  
      assert_eq(ddf2, ddf2, scheduler=custom_scheduler)
      with dask.config.set(scheduler=custom_scheduler):
          assert_eq(ddf2, ddf2, scheduler=None)
  
imports: from __future__ import annotations
  import re
  import warnings
  from collections.abc import Iterable
  import numpy
  import pandas
  import pytest
  from packaging.version import Version
  import dask
  import dask.dataframe
  from dask.dataframe._compat import PANDAS_GE_200, tm
  from dask.dataframe.core import apply_and_enforce
  from dask.dataframe.utils import UNKNOWN_CATEGORIES, assert_eq, check_matching_columns, check_meta, is_dataframe_like, is_index_like, is_series_like, make_meta, meta_frame_constructor, meta_nonempty, meta_series_constructor, pyarrow_strings_enabled, raise_on_meta_error, shard_df_on_index, valid_divisions
  from dask.local import get_sync
label_desc: Use image node_id 18 for calling a global function with example usage: test_assert_eq_scheduler() and returns: unknown, get_sync