code: def test_series_from_array(
      using_copy_on_write, idx, dtype, fastpath, arr
  ):
      if idx is None or dtype is not None:
          fastpath = False
      msg = "The 'fastpath' keyword in pd.Series is deprecated"
      with tm.assert_produces_warning(DeprecationWarning, match=msg):
          ser = Series(arr, dtype=dtype, index=idx, fastpath=fastpath)
      ser_orig = ser.copy()
      data = getattr(arr, "_data", arr)
      if using_copy_on_write:
          assert not np.shares_memory(get_array(ser), data)
      else:
          assert np.shares_memory(get_array(ser), data)
  
      arr[0] = 100
      if using_copy_on_write:
          tm.assert_series_equal(ser, ser_orig)
      else:
          expected = Series(
              [100, 2, 3],
              dtype=dtype if dtype is not None else arr.dtype,
          )
          tm.assert_series_equal(ser, 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 3 for calling a global function with example usage: test_series_from_array(using_copy_on_write, idx, dtype, fastpath, arr) without return types