from typing import Sequence
from typing import Tuple


def get_boundaries(bin_index: int,
                   boundaries: Sequence[float]) -> Tuple[float, float]:
  """Returns a the bucket [min, max) corresponding to the provided bin_index.

  Args:
    bin_index: A bin index returned by bin_array.
    boundaries: The same boundaries passed to bin_array.

  Returns:
    The low and high boundaries of the bin corresponding to bin_index.
  """
  inf = float('inf')
  low_value = -inf if bin_index == 0 else boundaries[bin_index - 1]
  high_value = inf if bin_index == len(boundaries) else boundaries[bin_index]
  return low_value, high_value