code: def test_category_encoder_outputs_correct_dtype():
      df_str = pd.DataFrame({"col1": ["a", "b", "c"]})
      res_str = MatchCategories().fit(df_str).transform(df_str)
      assert res_str.dtypes["col1"] == "category"
  
      df_float = pd.DataFrame({"col1": [1.0, 2.0, 3.0]})
      tr = MatchCategories(variables=["col1"], ignore_format=True)
      res_float = tr.fit(df_float).transform(df_float)
      assert res_float.dtypes["col1"] == "category"
  
      df_obj = pd.DataFrame({"col1": ["a", None, -1.0]})
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          res_obj = (
              MatchCategories(missing_values="ignore")
              .fit(df_obj)
              .transform(df_obj)
          )
      assert res_obj.dtypes["col1"] == "category"
  
      df_categ = pd.DataFrame(
          {"col1": pd.Categorical(pd.Series(["a", "b", "c"]))}
      )
      res_categ = MatchCategories().fit(df_categ).transform(df_categ)
      assert res_categ.dtypes["col1"] == "category"
  
imports: import warnings
  import numpy
  import pandas
  import pytest
  from feature_engine.preprocessing import MatchCategories
label_desc: Use image node_id 1 for calling a global function with example usage: test_category_encoder_outputs_correct_dtype() without return types