code: def test_translate(index_or_series, any_string_dtype, infer_string):
      obj = index_or_series(
          ["abcdefg", "abcc", "cdddfg", "cdefggg"],
          dtype=any_string_dtype,
      )
      table = str.maketrans("abc", "cde")
      result = obj.str.translate(table)
      expected = index_or_series(
          ["cdedefg", "cdee", "edddfg", "edefggg"],
          dtype=any_string_dtype,
      )
      tm.assert_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 45 for calling a global function with example usage: test_translate(index_or_series, any_string_dtype, infer_string) without return types