def _intersection(self, keys, rows):
<EOL>if not keys:<EOL><INDENT>return rows<EOL><DEDENT>ret = list()<EOL>for row in rows:<EOL><INDENT>start_date = row[self._key_start_date]<EOL>end_date = row[self._key_end_date]<EOL>for key_start_date, key_end_date in keys:<EOL><INDENT>start_date, end_date = Type2JoinHelper._intersect(start_date,<EOL>end_date,<EOL>row[key_start_date],<EOL>row[key_end_date])<EOL>if not start_date:<EOL><INDENT>break<EOL><DEDENT>if key_start_date not in [self._key_start_date, self._key_end_date]:<EOL><INDENT>del row[key_start_date]<EOL><DEDENT>if key_end_date not in [self._key_start_date, self._key_end_date]:<EOL><INDENT>del row[key_end_date]<EOL><DEDENT><DEDENT>if start_date:<EOL><INDENT>row[self._key_start_date] = start_date<EOL>row[self._key_end_date] = end_date<EOL>ret.append(row)<EOL><DEDENT><DEDENT>return ret<EOL>
Computes the intersection of the date intervals of two or more reference data sets. If the intersection is empty
the row is removed from the group.

:param list[tuple[str,str]] keys: The other keys with start and end date.
:param list[dict[str,T]] rows: The list of rows.

:rtype: list[dict[str,T]]