code: def test_simple(self, dtype, mode):
      if dtype.lower() == "m":
          dtype += "8[ns]"
  
      # put is weird and doesn't care about value length (even shorter)
      vals = np.arange(1001).astype(dtype=dtype)
  
      # Use vals.dtype in case of flexible dtype (i.e. string)
      arr = np.zeros(1000, dtype=vals.dtype)
      zeros = arr.copy()
  
      if mode == "clip":
          # Special because 0 and -1 value are "reserved" for clip test
          indx = np.random.permutation(len(arr) - 2)[:-500] + 1
  
          indx[-1] = 0
          indx[-2] = len(arr) - 1
          indx_put = indx.copy()
          indx_put[-1] = -1389
          indx_put[-2] = 1321
      else:
          # Avoid duplicates (for simplicity) and fill half only
          indx = np.random.permutation(len(arr) - 3)[:-500]
          indx_put = indx
          if mode == "wrap":
              indx_put = indx_put + len(arr)
  
      np.put(arr, indx_put, vals, mode=mode)
      assert_array_equal(arr[indx], vals[: len(indx)])
      untouched = np.ones(len(arr), dtype=bool)
      untouched[indx] = False
      assert_array_equal(arr[untouched], zeros[: untouched.sum()])
  
file_path: catboost/contrib/python/numpy/py3/numpy/core/tests/test_item_selection.py
imports: import sys
  import pytest
  import numpy
  from numpy.testing import assert_, assert_raises, assert_array_equal, HAS_REFCOUNT
label_desc: Use image node_id 1 for calling the TestPut obj's underlying member method code with example usage: obj.test_simple(dtype, mode) without return types