code: def test_values_consistent(
      arr, expected_type, dtype, using_infer_string
  ):
      if using_infer_string and dtype == "object":
          expected_type = ArrowStringArrayNumpySemantics
      l_values = Series(arr)._values
      r_values = pd.Index(arr)._values
      assert type(l_values) is expected_type
      assert type(l_values) is type(r_values)
  
      tm.assert_equal(l_values, r_values)
  
imports: import numpy
  import pytest
  from pandas.core.dtypes.dtypes import DatetimeTZDtype
  import pandas
  from pandas import CategoricalIndex, Series, Timedelta, Timestamp, date_range
  import pandas._testing
  from pandas.core.arrays import DatetimeArray, IntervalArray, NumpyExtensionArray, PeriodArray, SparseArray, TimedeltaArray
  from pandas.core.arrays.string_arrow import ArrowStringArrayNumpySemantics
label_desc: Use image node_id 1 for calling a global function with example usage: test_values_consistent(arr, expected_type, dtype, using_infer_string) without return types