docstr: Used when the IntervalIndex does have some common endpoints,
  on either sides.
  Return the intersection with another IntervalIndex.
  
  Parameters
  ----------
  other : IntervalIndex
  
  Returns
  -------
  IntervalIndex
docstr_tok: ["Used","when","the","IntervalIndex","does","have","some","common","endpoints",",","on","either","sides",".","Return","the","intersection","with","another","IntervalIndex",".","Parameters","--","--","--","--","--","other",":","IntervalIndex","Returns","--","--","--","-","IntervalIndex"]
code: def _intersection_non_unique(
      self, other: IntervalIndex
  ) -> IntervalIndex:
      """
      Used when the IntervalIndex does have some common endpoints,
      on either sides.
      Return the intersection with another IntervalIndex.
  
      Parameters
      ----------
      other : IntervalIndex
  
      Returns
      -------
      IntervalIndex
      """
      # Note: this is about 3.25x faster than super()._intersection(other)
      #  in IntervalIndexMethod.time_intersection_both_duplicate(1000)
      mask = np.zeros(len(self), dtype=bool)
  
      if self.hasnans and other.hasnans:
          first_nan_loc = np.arange(len(self))[self.isna()][0]
          mask[first_nan_loc] = True
  
      other_tups = set(zip(other.left, other.right))
      for i, tup in enumerate(zip(self.left, self.right)):
          if tup in other_tups:
              mask[i] = True
  
      return self[mask]
  
imports: from __future__ import annotations
  from operator import le, lt
  import textwrap
  from typing import TYPE_CHECKING, Any, Literal
  import numpy
  from pandas._libs import lib
  from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
  from pandas._libs.tslibs import BaseOffset, Period, Timedelta, Timestamp, to_offset
  from pandas.errors import InvalidIndexError
  from pandas.util._decorators import Appender, cache_readonly
  from pandas.util._exceptions import rewrite_exception
  from pandas.core.dtypes.cast import find_common_type, infer_dtype_from_scalar, maybe_box_datetimelike, maybe_downcast_numeric, maybe_upcast_numeric_to_64bit
  from pandas.core.dtypes.common import ensure_platform_int, is_float_dtype, is_integer, is_integer_dtype, is_list_like, is_number, is_object_dtype, is_scalar, pandas_dtype
  from pandas.core.dtypes.dtypes import DatetimeTZDtype, IntervalDtype
  from pandas.core.dtypes.missing import is_valid_na_for_dtype
  from pandas.core.algorithms import unique
  from pandas.core.arrays.datetimelike import validate_periods
  from pandas.core.arrays.interval import IntervalArray, _interval_shared_docs
  import pandas.core.common
  from pandas.core.indexers import is_valid_positional_slice
  import pandas.core.indexes.base
  from pandas.core.indexes.base import Index, _index_shared_docs, ensure_index, maybe_extract_name
  from pandas.core.indexes.datetimes import DatetimeIndex, date_range
  from pandas.core.indexes.extension import ExtensionIndex, inherit_names
  from pandas.core.indexes.multi import MultiIndex
  from pandas.core.indexes.timedeltas import TimedeltaIndex, timedelta_range
label_desc: Use image node_id 34 for calling the IntervalIndex obj's underlying member method code with example usage: obj._intersection_non_unique(other) and returns: self