code: def test_multiple_series_cow():
      with cudf.option_context("copy_on_write", True):
          # Verify constructing, modifying, deleting
          # multiple copies of a series preserves
          # the data appropriately when COW is enabled.
          s = cudf.Series([10, 20, 30, 40, 50])
          s1 = s.copy(deep=False)
          s2 = s.copy(deep=False)
          s3 = s.copy(deep=False)
          s4 = s2.copy(deep=False)
          s5 = s4.copy(deep=False)
          s6 = s3.copy(deep=False)
  
          s1[0:3] = 10000
          # s1 will be unlinked from actual data in s,
          # and then modified. Rest all should
          # contain the original data.
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          for ser in [s, s2, s3, s4, s5, s6]:
              assert_eq(ser, cudf.Series([10, 20, 30, 40, 50]))
  
          s6[0:3] = 3000
          # s6 will be unlinked from actual data in s,
          # and then modified. Rest all should
          # contain the original data.
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          for ser in [s2, s3, s4, s5]:
              assert_eq(ser, cudf.Series([10, 20, 30, 40, 50]))
  
          s2[1:4] = 4000
          # s2 will be unlinked from actual data in s,
          # and then modified. Rest all should
          # contain the original data.
          assert_eq(s2, cudf.Series([10, 4000, 4000, 4000, 50]))
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          for ser in [s3, s4, s5]:
              assert_eq(ser, cudf.Series([10, 20, 30, 40, 50]))
  
          s4[2:4] = 5000
          # s4 will be unlinked from actual data in s,
          # and then modified. Rest all should
          # contain the original data.
          assert_eq(s4, cudf.Series([10, 20, 5000, 5000, 50]))
          assert_eq(s2, cudf.Series([10, 4000, 4000, 4000, 50]))
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          for ser in [s3, s5]:
              assert_eq(ser, cudf.Series([10, 20, 30, 40, 50]))
  
          s5[2:4] = 6000
          # s5 will be unlinked from actual data in s,
          # and then modified. Rest all should
          # contain the original data.
          assert_eq(s5, cudf.Series([10, 20, 6000, 6000, 50]))
          assert_eq(s4, cudf.Series([10, 20, 5000, 5000, 50]))
          assert_eq(s2, cudf.Series([10, 4000, 4000, 4000, 50]))
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          for ser in [s3]:
              assert_eq(ser, cudf.Series([10, 20, 30, 40, 50]))
  
          s7 = s5.copy(deep=False)
          assert_eq(s7, cudf.Series([10, 20, 6000, 6000, 50]))
          s7[1:3] = 55
          # Making a copy of s5, i.e., s7 and modifying shouldn't
          # be touching/modifying data in other series.
          assert_eq(s7, cudf.Series([10, 55, 55, 6000, 50]))
  
          assert_eq(s4, cudf.Series([10, 20, 5000, 5000, 50]))
          assert_eq(s2, cudf.Series([10, 4000, 4000, 4000, 50]))
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          for ser in [s3]:
              assert_eq(ser, cudf.Series([10, 20, 30, 40, 50]))
  
          # Deleting any of the following series objects
          # shouldn't delete rest of the weekly referenced data
          # elsewhere.
  
          del s2
  
          assert_eq(s1, cudf.Series([10000, 10000, 10000, 40, 50]))
          assert_eq(s3, cudf.Series([10, 20, 30, 40, 50]))
          assert_eq(s4, cudf.Series([10, 20, 5000, 5000, 50]))
          assert_eq(s5, cudf.Series([10, 20, 6000, 6000, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          assert_eq(s7, cudf.Series([10, 55, 55, 6000, 50]))
  
          del s4
          del s1
  
          assert_eq(s3, cudf.Series([10, 20, 30, 40, 50]))
          assert_eq(s5, cudf.Series([10, 20, 6000, 6000, 50]))
          assert_eq(s6, cudf.Series([3000, 3000, 3000, 40, 50]))
          assert_eq(s7, cudf.Series([10, 55, 55, 6000, 50]))
  
          del s
          del s6
  
          assert_eq(s3, cudf.Series([10, 20, 30, 40, 50]))
          assert_eq(s5, cudf.Series([10, 20, 6000, 6000, 50]))
          assert_eq(s7, cudf.Series([10, 55, 55, 6000, 50]))
  
          del s5
  
          assert_eq(s3, cudf.Series([10, 20, 30, 40, 50]))
          assert_eq(s7, cudf.Series([10, 55, 55, 6000, 50]))
  
          del s3
          assert_eq(s7, cudf.Series([10, 55, 55, 6000, 50]))
  
imports: import cupy
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf import Series
  from cudf.testing._utils import NUMERIC_TYPES, OTHER_TYPES, assert_eq
label_desc: Use image node_id 12 for calling a global function with example usage: test_multiple_series_cow() without return types