code: def numpy_matmul(a, b):  # type: ignore
      """Implements a matmul product. See :func:`np.matmul`.
      Handles sparse matrices.
      """
      try:
          if len(a.shape) <= 2 and len(b.shape) <= 2:
              return np.dot(a, b)
          return np.matmul(a, b)
      except ValueError as e:
          raise ValueError(
              f"Unable to multiply shapes {a.shape!r}, {b.shape!r}."
          ) from e
  
imports: import numpy
  from onnx.reference.ops._op import OpRunBinaryNum
label_desc: Use image node_id 1 for calling a global function with example usage: numpy_matmul(a, b) and returns: np, np