def take(self, indices, allow_fill=False, fill_value=None, axis=None,<EOL>**kwargs):
from pandas.core.algorithms import take<EOL>nv.validate_take(tuple(), kwargs)<EOL>fill_left = fill_right = fill_value<EOL>if allow_fill:<EOL><INDENT>if fill_value is None:<EOL><INDENT>fill_left = fill_right = self.left._na_value<EOL><DEDENT>elif is_interval(fill_value):<EOL><INDENT>self._check_closed_matches(fill_value, name='<STR_LIT>')<EOL>fill_left, fill_right = fill_value.left, fill_value.right<EOL><DEDENT>elif not is_scalar(fill_value) and notna(fill_value):<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(type(fill_value).__name__))<EOL>raise ValueError(msg)<EOL><DEDENT><DEDENT>left_take = take(self.left, indices,<EOL>allow_fill=allow_fill, fill_value=fill_left)<EOL>right_take = take(self.right, indices,<EOL>allow_fill=allow_fill, fill_value=fill_right)<EOL>return self._shallow_copy(left_take, right_take)<EOL>
Take elements from the IntervalArray.

Parameters
----------
indices : sequence of integers
    Indices to be taken.

allow_fill : bool, default False
    How to handle negative values in `indices`.

    * False: negative values in `indices` indicate positional indices
      from the right (the default). This is similar to
      :func:`numpy.take`.

    * True: negative values in `indices` indicate
      missing values. These values are set to `fill_value`. Any other
      other negative values raise a ``ValueError``.

fill_value : Interval or NA, optional
    Fill value to use for NA-indices when `allow_fill` is True.
    This may be ``None``, in which case the default NA value for
    the type, ``self.dtype.na_value``, is used.

    For many ExtensionArrays, there will be two representations of
    `fill_value`: a user-facing "boxed" scalar, and a low-level
    physical NA value. `fill_value` should be the user-facing version,
    and the implementation should handle translating that to the
    physical version for processing the take if necessary.

axis : any, default None
    Present for compat with IntervalIndex; does nothing.

Returns
-------
IntervalArray

Raises
------
IndexError
    When the indices are out of bounds for the array.
ValueError
    When `indices` contains negative values other than ``-1``
    and `allow_fill` is True.