code: def _setitem(a, item, value):
      index = process_index(a.ndim, item, convert_bool_to_fancy=False)
      if not (
          np.isscalar(value)
          or (isinstance(value, tuple) and a.dtype.fields)
      ):
          # do not convert for tuple when dtype is record type.
          value = astensor(value)
  
      is_fancy_index = _check_support(index)
      if is_fancy_index:
          index = [
              astensor(ind) if isinstance(ind, np.ndarray) else ind
              for ind in index
          ]
  
      # __setitem__ on a view should be still a view, see GH #732.
      op = TensorIndexSetValue(
          dtype=a.dtype,
          sparse=a.issparse(),
          is_fancy_index=is_fancy_index,
          indexes=tuple(index),
          value=value,
          create_view=a.op.create_view,
      )
      ret = op(a, index, value)
      a.data = ret.data
  
imports: import functools
  import itertools
  import operator
  from numbers import Integral
  from typing import Union
  import numpy
  from ...None import opcodes
  from ...core import ENTITY_TYPE, recursive_tile
  from ...core.context import Context
  from ...core.operand import OperandStage
  from ...serialization.serializables import KeyField, TupleField, AnyField, BoolField
  from ...tensor import tensor
  from ...utils import has_unknown_shape
  from ..base import broadcast_to
  from ..core import TENSOR_TYPE, TensorOrder
  from ..operands import TensorMapReduceOperand, TensorOperandMixin, TensorShuffleProxy
  from ..utils import broadcast_shape, filter_inputs
  from .core import process_index
label_desc: Use image node_id 2 for calling a global function with example usage: _setitem(a, item, value) without return types