code: def test_get_namespace_array_api_isdtype(wrapper):
      """Test isdtype implementation from _ArrayAPIWrapper and _NumPyAPIWrapper."""
  
      if wrapper == _ArrayAPIWrapper:
          xp_ = pytest.importorskip("numpy.array_api")
          xp = _ArrayAPIWrapper(xp_)
      else:
          xp = _NumPyAPIWrapper()
  
      assert xp.isdtype(xp.float32, xp.float32)
      assert xp.isdtype(xp.float32, "real floating")
      assert xp.isdtype(xp.float64, "real floating")
      assert not xp.isdtype(xp.int32, "real floating")
  
      for dtype in supported_float_dtypes(xp):
          assert xp.isdtype(dtype, "real floating")
  
      assert xp.isdtype(xp.bool, "bool")
      assert not xp.isdtype(xp.float32, "bool")
  
      assert xp.isdtype(xp.int16, "signed integer")
      assert not xp.isdtype(xp.uint32, "signed integer")
  
      assert xp.isdtype(xp.uint16, "unsigned integer")
      assert not xp.isdtype(xp.int64, "unsigned integer")
  
      assert xp.isdtype(xp.int64, "numeric")
      assert xp.isdtype(xp.float32, "numeric")
      assert xp.isdtype(xp.uint32, "numeric")
  
      assert not xp.isdtype(xp.float32, "complex floating")
  
      if wrapper == _NumPyAPIWrapper:
          assert not xp.isdtype(xp.int8, "complex floating")
          assert xp.isdtype(xp.complex64, "complex floating")
          assert xp.isdtype(xp.complex128, "complex floating")
  
      with pytest.raises(ValueError, match="Unrecognized data type"):
          assert xp.isdtype(xp.int16, "unknown")
  
imports: from functools import partial
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from sklearn._config import config_context
  from sklearn.base import BaseEstimator
  from sklearn.utils._array_api import _ArrayAPIWrapper, _asarray_with_order, _atol_for_type, _convert_to_numpy, _estimator_with_converted_arrays, _nanmax, _nanmin, _NumPyAPIWrapper, _weighted_sum, get_namespace, supported_float_dtypes, yield_namespace_device_dtype_combinations
  from sklearn.utils._testing import _array_api_for_tests, skip_if_array_api_compat_not_configured
label_desc: Use image node_id 15 for calling a global function with example usage: test_get_namespace_array_api_isdtype(wrapper) without return types