code: def test_index_str_accessor_visibility(
      values, inferred_type, index_or_series
  ):
      obj = index_or_series(values)
      if index_or_series is Index:
          assert obj.inferred_type == inferred_type
  
      assert isinstance(obj.str, StringMethods)
  
imports: from datetime import datetime, timedelta
  import numpy
  import pytest
  from pandas import DataFrame, Index, MultiIndex, Series
  import pandas._testing
  from pandas.core.strings.accessor import StringMethods
  from pandas.tests.strings import object_pyarrow_numpy
label_desc: Use image node_id 38 for calling a global function with example usage: test_index_str_accessor_visibility(values, inferred_type, index_or_series) without return types