code: def test_all_cat_not_None(df):
      """
      Test output where categories is provided.
      """
      result = df.encode_categorical(numbers=np.array([3, 1, 2]))
      categories = pd.CategoricalDtype(
          categories=[3, 1, 2], ordered=True
      )
      expected = df.astype({"numbers": categories})
      assert expected["numbers"].equals(result["numbers"])
  
imports: import datetime
  import numpy
  import pandas
  import pytest
  from hypothesis import given, settings
  from pandas.testing import assert_frame_equal
  from janitor.testing_utils.strategies import categoricaldf_strategy, df_strategy
label_desc: Use image node_id 23 for calling a global function with example usage: test_all_cat_not_None(df) without return types