code: def _execute_map(cls, ctx, op):
      allow_nan = op.allow_nan
      msg_dtype = op.msg_dtype
      raw = x = ctx[op.x.key]
      xp = get_array_module(x, nosparse=True)
  
      if issparse(x):
          x = x.data
      # First try an O(n) time, O(1) space solution for the common case that
      # everything is finite; fall back to O(n) space np.isfinite to prevent
      # false positives from overflow in sum method. The sum is also calculated
      # safely to reduce dtype induced overflows.
      is_float = x.dtype.kind in "fc"
      if is_float and ctx[op.is_finite.key]:
          pass
      elif is_float:
          msg_err = "Input contains {} or a value too large for {!r}."
          if (
              allow_nan
              and xp.isinf(x).any()
              or not allow_nan
              and not xp.isfinite(x).all()
          ):
              type_err = "infinity" if allow_nan else "NaN, infinity"
              raise ValueError(
                  msg_err.format(
                      type_err,
                      msg_dtype if msg_dtype is not None else x.dtype,
                  )
              )
      # for object dtype data, we only check for NaNs
      elif x.dtype == np.dtype(object) and not allow_nan:
          if ctx[op.check_nan.key]:
              raise ValueError("Input contains NaN")
  
      if op.check_only:
          result = np.array(True)
      else:
          result = raw
      ctx[op.outputs[0].key] = result
  
imports: import numpy
  from ...None import opcodes
  from ...None import tensor
  from ...core import ENTITY_TYPE, get_output_types, recursive_tile
  from ...core.operand import OperandStage
  from ...config import options
  from ...serialization.serializables import KeyField, StringField, BoolField, DataTypeField
  from ...tensor.core import TensorOrder, TENSOR_CHUNK_TYPE
  from ...tensor.array_utils import as_same_device, device, issparse, get_array_module
  from ...utils import ceildiv
  from ..operands import LearnOperand, LearnOperandMixin, OutputType
label_desc: Use image node_id 12 for calling the AssertAllFinite obj's underlying member method code with example usage: obj._execute_map(cls, ctx, op) without return types