code: def set_element(self, val, result, idx, *, fill=False):
      try:
          result[idx] = val
      except TypeError as err:
          raise InvalidArgument(
              f"Could not add element={val!r} of {val.dtype!r} to array of "
              f"{result.dtype!r} - possible mismatch of time units in dtypes?"
          ) from err
      try:
          elem_changed = (
              self._check_elements and val != result[idx] and val == val
          )
      except Exception as err:  # pragma: no cover
          # This branch only exists to help debug weird behaviour in Numpy,
          # such as the string problems we had a while back.
          raise HypothesisException(
              "Internal error when checking element=%r of %r to array of %r"
              % (val, val.dtype, result.dtype)
          ) from err
      if elem_changed:
          strategy = self.fill if fill else self.element_strategy
          if self.dtype.kind == "f":  # pragma: no cover
              # This logic doesn't trigger in our coverage tests under Numpy 1.24+,
              # with built-in checks for overflow, but we keep it for good error
              # messages and compatibility with older versions of Numpy.
              try:
                  is_subnormal = (
                      0 < abs(val) < np.finfo(self.dtype).tiny
                  )
              except Exception:
                  # val may be a non-float that does not support the
                  # operations __lt__ and __abs__
                  is_subnormal = False
              if is_subnormal:
                  raise InvalidArgument(
                      f"Generated subnormal float {val} from strategy "
                      f"{strategy} resulted in {result[idx]!r}, probably "
                      "as a result of NumPy being built with flush-to-zero "
                      "compiler options. Consider passing "
                      "allow_subnormal=False."
                  )
          raise InvalidArgument(
              "Generated array element %r from %r cannot be represented as "
              "dtype %r - instead it becomes %r (type %r).  Consider using a more "
              "precise strategy, for example passing the `width` argument to "
              "`floats()`."
              % (
                  val,
                  strategy,
                  self.dtype,
                  result[idx],
                  type(result[idx]),
              )
          )
  
imports: import importlib
  import math
  from typing import TYPE_CHECKING, Any, Literal, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union
  import numpy
  from hypothesis import strategies
  from hypothesis._settings import note_deprecation
  from hypothesis.errors import HypothesisException, InvalidArgument
  from hypothesis.extra._array_helpers import NDIM_MAX, BasicIndex, BasicIndexStrategy, BroadcastableShapes, Shape, array_shapes, broadcastable_shapes, check_argument, check_valid_dims, mutually_broadcastable_shapes, order_check, valid_tuple_axes
  from hypothesis.internal.conjecture import utils
  from hypothesis.internal.coverage import check_function
  from hypothesis.internal.reflection import proxies
  from hypothesis.internal.validation import check_type
  from hypothesis.strategies._internal.numbers import Real
  from hypothesis.strategies._internal.strategies import Ex, T, check_strategy
  from hypothesis.strategies._internal.utils import defines_strategy
label_desc: Use image node_id 2 for calling the ArrayStrategy obj's underlying member method code with example usage: obj.set_element(val, result, idx) without return types