code: def test_put(self, xp, dtype):
      a = testing.shaped_arange(self.shape, xp, dtype)
      # Take care so that actual indices don't overlap.
      if self.mode == "raise":
          inds = xp.array([2, -1, 3, 0])
      else:
          inds = xp.array([2, -8, 3, 7])
      vals = testing.shaped_random((self.n_vals,), xp, dtype)
      xp.put(a, inds, vals, self.mode)
      return a
  
imports: import unittest
  import numpy
  import pytest
  import cupy
  from cupy import testing
label_desc: Use image node_id 1 for calling the TestPut obj's underlying member method code with example usage: obj.test_put(xp, dtype) and returns: a