def _in_matched_range(start_idx, end_idx, matched_ranges):
  """Return True if provided indices overlap any spans in matched_ranges."""
  for range_start_idx, range_end_idx in matched_ranges:
    if not (end_idx <= range_start_idx or start_idx >= range_end_idx):
      return True
  return False
Return True if provided indices overlap any spans in matched_ranges.
language/compgen/nqg/model/induction/exact_match_utils.py