code: def test_meta_nonempty_empty_categories():
      for dtype in ["O", "f8", "M8[ns]"]:
          # Index
          idx = pd.CategoricalIndex(
              [], pd.Index([], dtype=dtype), ordered=True, name="foo"
          )
          res = meta_nonempty(idx)
          assert type(res) is pd.CategoricalIndex
          assert type(res.categories) is type(idx.categories)
          assert res.ordered == idx.ordered
          assert res.name == idx.name
          # Series
          s = idx.to_series()
          res = meta_nonempty(s)
          assert res.dtype == "category"
          assert s.dtype == "category"
          assert type(res.cat.categories) is type(s.cat.categories)
          assert res.cat.ordered == s.cat.ordered
          assert res.name == s.name
  
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 5 for calling a global function with example usage: test_meta_nonempty_empty_categories() without return types