code: def test_contains_na_kwarg_for_object_category():
      # gh 22158
  
      # na for category
      values = Series(["a", "b", "c", "a", np.nan], dtype="category")
      result = values.str.contains("a", na=True)
      expected = Series([True, False, False, True, True])
      tm.assert_series_equal(result, expected)
  
      result = values.str.contains("a", na=False)
      expected = Series([True, False, False, True, False])
      tm.assert_series_equal(result, expected)
  
      # na for objects
      values = Series(["a", "b", "c", "a", np.nan])
      result = values.str.contains("a", na=True)
      expected = Series([True, False, False, True, True])
      tm.assert_series_equal(result, expected)
  
      result = values.str.contains("a", na=False)
      expected = Series([True, False, False, True, False])
      tm.assert_series_equal(result, expected)
  
imports: from datetime import datetime
  import re
  import numpy
  import pytest
  from pandas.errors import PerformanceWarning
  import pandas.util._test_decorators
  import pandas
  from pandas import Series, _testing
  from pandas.tests.strings import _convert_na_value, object_pyarrow_numpy
label_desc: Use image node_id 4 for calling a global function with example usage: test_contains_na_kwarg_for_object_category() without return types