code: def test_index_to_frame(using_copy_on_write):
      idx = Index([1, 2, 3], name="a")
      expected = idx.copy(deep=True)
      df = idx.to_frame()
      if using_copy_on_write:
          assert np.shares_memory(get_array(df, "a"), idx._values)
          assert not df._mgr._has_no_reference(0)
      else:
          assert not np.shares_memory(get_array(df, "a"), idx._values)
  
      df.iloc[0, 0] = 100
      tm.assert_index_equal(idx, expected)
  
file_path: pandas/pandas/tests/copy_view/index/test_index.py
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, Series
  import pandas._testing
  from pandas.tests.copy_view.util import get_array
label_desc: Use image node_id 12 for calling a global function with example usage: test_index_to_frame(using_copy_on_write) without return types