code: def test_union_categorical_ordered_appearance(self):
      # new categories ordered by appearance
      s = Categorical(["x", "y", "z"])
      s2 = Categorical(["a", "b", "c"])
      result = union_categoricals([s, s2])
      expected = Categorical(
          ["x", "y", "z", "a", "b", "c"],
          categories=["x", "y", "z", "a", "b", "c"],
      )
      tm.assert_categorical_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas.core.dtypes.concat import union_categoricals
  import pandas
  from pandas import Categorical, CategoricalIndex, Series
  import pandas._testing
label_desc: Use image node_id 2 for calling the TestUnionCategoricals obj's underlying member method code with example usage: obj.test_union_categorical_ordered_appearance() without return types