code: def test_categories_type_in_kwargs(df_checks):
      """
      Raise TypeError if the value provided is not array-like or a string.
      """
      with pytest.raises(TypeError):
          df_checks.encode_categorical(
              region=datetime.datetime(2017, 1, 1)
          )
  
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 8 for calling a global function with example usage: test_categories_type_in_kwargs(df_checks) without return types