code: def test_array_api_entry_point():
      """
      Entry point for Array API implementation can be found with importlib and
      returns the numpy.array_api namespace.
      """
      # For a development install that did not go through meson-python,
      # the entrypoint will not have been installed. So ensure this test fails
      # only if numpy is inside site-packages.
      numpy_in_sitepackages = (
          sysconfig.get_path("platlib") in np.__file__
      )
  
      eps = importlib.metadata.entry_points()
      try:
          xp_eps = eps.select(group="array_api")
      except AttributeError:
          # The select interface for entry_points was introduced in py3.10,
          # deprecating its dict interface. We fallback to dict keys for finding
          # Array API entry points so that running this test in <=3.9 will
          # still work - see https://github.com/numpy/numpy/pull/19800.
          xp_eps = eps.get("array_api", [])
      if len(xp_eps) == 0:
          if numpy_in_sitepackages:
              msg = "No entry points for 'array_api' found"
              raise AssertionError(msg) from None
          return
  
      try:
          ep = next(ep for ep in xp_eps if ep.name == "numpy")
      except StopIteration:
          if numpy_in_sitepackages:
              msg = "'numpy' not in array_api entry points"
              raise AssertionError(msg) from None
          return
  
      xp = ep.load()
      msg = (
          f"numpy entry point value '{ep.value}' "
          "does not point to our Array API implementation"
      )
      assert xp is numpy.array_api, msg
  
imports: import sys
  import sysconfig
  import subprocess
  import pkgutil
  import types
  import importlib
  import inspect
  import warnings
  import numpy
  import numpy
  from numpy.testing import IS_WASM
  import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_array_api_entry_point() without return types