code: def test_series_from_index(using_copy_on_write, idx):
      ser = Series(idx)
      expected = idx.copy(deep=True)
      if using_copy_on_write:
          assert np.shares_memory(get_array(ser), get_array(idx))
          assert not ser._mgr._has_no_reference(0)
      else:
          assert not np.shares_memory(get_array(ser), get_array(idx))
      ser.iloc[0] = ser.iloc[1]
      tm.assert_index_equal(idx, expected)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, DatetimeIndex, Index, Period, PeriodIndex, Series, Timedelta, TimedeltaIndex, Timestamp
  import pandas._testing
  from pandas.tests.copy_view.util import get_array
label_desc: Use image node_id 5 for calling a global function with example usage: test_series_from_index(using_copy_on_write, idx) without return types