code: def getitem(self, index, context=None):
          
          if isinstance(index, Const):
              index_value = index.value
          elif isinstance(index, Slice):
              index_value = _infer_slice(index, context=context)
  
          else:
              raise exceptions.AstroidTypeError(
                  "Could not use type {} as subscript index".format(type(index))
              )
  
          try:
              if isinstance(self.value, (str, bytes)):
                  return Const(self.value[index_value])
          except IndexError as exc:
              raise exceptions.AstroidIndexError(
                  message="Index {index!r} out of range",
                  node=self,
                  index=index,
                  context=context,
              ) from exc
          except TypeError as exc:
              raise exceptions.AstroidTypeError(
                  message="Type error {error!r}", node=self, index=index, context=context
              ) from exc
  
          raise exceptions.AstroidTypeError("%r (value=%s)" % (self, self.value))
docs: Get an item from this node if subscriptable.
  
          :param index: The node to use as a subscript index.
          :type index: Const or Slice
  
          :raises AstroidTypeError: When the given index cannot be used as a
              subscript index, or if this node is not subscriptable.