code: def test_get_namespace_array_api():
      """Test get_namespace for ArrayAPI arrays."""
      xp = pytest.importorskip("numpy.array_api")
  
      X_np = numpy.asarray([[1, 2, 3]])
      X_xp = xp.asarray(X_np)
      with config_context(array_api_dispatch=True):
          xp_out, is_array_api_compliant = get_namespace(X_xp)
          assert is_array_api_compliant
          assert isinstance(xp_out, _ArrayAPIWrapper)
  
          with pytest.raises(TypeError):
              xp_out, is_array_api_compliant = get_namespace(X_xp, X_np)
  
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 4 for calling a global function with example usage: test_get_namespace_array_api() without return types