code: def test_concat_unions_categoricals():
      # Categorical DataFrame, regular index
      tm.assert_frame_equal(_concat(frames), pd.concat(frames2))
  
      # Categorical Series, regular index
      tm.assert_series_equal(
          _concat([i.y for i in frames]),
          pd.concat([i.y for i in frames2]),
      )
  
      # Categorical Index
      tm.assert_index_equal(
          _concat([i.index for i in frames3]),
          pd.concat([i for i in frames4]).index,
      )
  
      # Categorical DataFrame, Categorical Index
      tm.assert_frame_equal(_concat(frames3), pd.concat(frames4))
  
      # Non-categorical DataFrame, Categorical Index
      tm.assert_frame_equal(
          _concat([i[["x", "z"]] for i in frames3]),
          pd.concat([i[["x", "z"]] for i in frames4]),
      )
  
      # Categorical Series, Categorical Index
      tm.assert_series_equal(
          _concat([i.z for i in frames3]),
          pd.concat([i.z for i in frames4]),
      )
  
      # Non-categorical Series, Categorical Index
      tm.assert_series_equal(
          _concat([i.x for i in frames3]),
          pd.concat([i.x for i in frames4]),
      )
  
      # MultiIndex with Categorical Index
      tm.assert_index_equal(
          _concat([i.index for i in frames5]),
          pd.concat([i for i in frames6]).index,
      )
  
      # DataFrame, MultiIndex with CategoricalIndex
      tm.assert_frame_equal(_concat(frames5), pd.concat(frames6))
  
imports: from __future__ import annotations
  import contextlib
  import operator
  import warnings
  import numpy
  import pandas
  import pytest
  import dask
  import dask.dataframe
  from dask.dataframe import _compat
  from dask.dataframe._compat import PANDAS_GE_150, PANDAS_GE_200, PANDAS_GE_210, tm
  from dask.dataframe._pyarrow import to_pyarrow_string
  from dask.dataframe.core import _concat
  from dask.dataframe.utils import assert_eq, clear_known_categories, get_string_dtype, make_meta, pyarrow_strings_enabled
label_desc: Use image node_id 1 for calling a global function with example usage: test_concat_unions_categoricals() without return types