code: def __setitem__(self, key, value):
      # na value: need special casing to set directly on numpy arrays
      needs_float_conversion = False
      if is_scalar(value) and isna(value):
          if is_integer_dtype(self.dtype.subtype):
              # can't set NaN on a numpy integer array
              needs_float_conversion = True
          elif is_datetime64_any_dtype(self.dtype.subtype):
              # need proper NaT to set directly on the numpy array
              value = np.datetime64("NaT")
          elif is_timedelta64_dtype(self.dtype.subtype):
              # need proper NaT to set directly on the numpy array
              value = np.timedelta64("NaT")
          value_left, value_right = value, value
  
      # scalar interval
      elif is_interval_dtype(value) or isinstance(value, ABCInterval):
          self._check_closed_matches(value, name="value")
          value_left, value_right = value.left, value.right
  
      else:
          # list-like of intervals
          try:
              array = IntervalArray(value)
              value_left, value_right = array.left, array.right
          except TypeError:
              # wrong type: not interval or NA
              msg = (
                  "'value' should be an interval type, got {} instead."
              )
              raise TypeError(msg.format(type(value)))
  
      # Need to ensure that left and right are updated atomically, so we're
      # forced to copy, update the copy, and swap in the new values.
      left = self.left.copy(deep=True)
      if needs_float_conversion:
          left = left.astype("float")
      left.values[key] = value_left
      self._left = left
  
      right = self.right.copy(deep=True)
      if needs_float_conversion:
          right = right.astype("float")
      right.values[key] = value_right
      self._right = right
  
imports: from operator import le, lt
  import textwrap
  import numpy
  from pandas._libs.interval import Interval, IntervalMixin, intervals_to_interval_bounds
  from pandas.compat import add_metaclass
  from pandas.compat.numpy import function
  from pandas.util._decorators import Appender
  from pandas.util._doctools import _WritableDoc
  from pandas.core.dtypes.cast import maybe_convert_platform
  from pandas.core.dtypes.common import is_categorical_dtype, is_datetime64_any_dtype, is_float_dtype, is_integer_dtype, is_interval, is_interval_dtype, is_scalar, is_string_dtype, is_timedelta64_dtype, pandas_dtype
  from pandas.core.dtypes.dtypes import IntervalDtype
  from pandas.core.dtypes.generic import ABCDatetimeIndex, ABCInterval, ABCIntervalIndex, ABCPeriodIndex, ABCSeries
  from pandas.core.dtypes.missing import isna, notna
  from pandas.core.arrays.base import ExtensionArray, _extension_array_shared_docs
  from pandas.core.arrays.categorical import Categorical
  import pandas.core.common
  from pandas.core.config import get_option
  from pandas.core.indexes.base import Index, ensure_index
label_desc: Use image node_id 12 for calling the IntervalArray obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types