code: def test_simple(self, dtype):
      if dtype.lower() == "m":
          dtype += "8[ns]"
  
      # putmask is weird and doesn't care about value length (even shorter)
      vals = np.arange(1001).astype(dtype=dtype)
  
      mask = np.random.randint(2, size=1000).astype(bool)
      # Use vals.dtype in case of flexible dtype (i.e. string)
      arr = np.zeros(1000, dtype=vals.dtype)
      zeros = arr.copy()
  
      np.putmask(arr, mask, vals)
      assert_array_equal(arr[mask], vals[: len(mask)][mask])
      assert_array_equal(arr[~mask], zeros[~mask])
  
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 TestPutMask obj's underlying member method code with example usage: obj.test_simple(dtype) without return types