code: def test_map(self):
      c = Categorical(
          list("ABABC"), categories=list("CBA"), ordered=True
      )
      result = c.map(lambda x: x.lower(), na_action=None)
      exp = Categorical(
          list("ababc"), categories=list("cba"), ordered=True
      )
      tm.assert_categorical_equal(result, exp)
  
      c = Categorical(
          list("ABABC"), categories=list("ABC"), ordered=False
      )
      result = c.map(lambda x: x.lower(), na_action=None)
      exp = Categorical(
          list("ababc"), categories=list("abc"), ordered=False
      )
      tm.assert_categorical_equal(result, exp)
  
      result = c.map(lambda x: 1, na_action=None)
      # GH 12766: Return an index not an array
      tm.assert_index_equal(
          result, Index(np.array([1] * 5, dtype=np.int64))
      )
  
imports: import re
  import sys
  import numpy
  import pytest
  from pandas.compat import PYPY
  from pandas import Categorical, CategoricalDtype, DataFrame, Index, NaT, Series, date_range
  import pandas._testing
  from pandas.api.types import is_scalar
label_desc: Use image node_id 18 for calling the TestCategoricalAnalytics obj's underlying member method code with example usage: obj.test_map() without return types