<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def intersection(self, catalogue, output_fh):
 """Returns `output_fh` populated with CSV results giving the intersection in n-grams of the witnesses of labelled sets of works in `catalogue`. :param catalogue: catalogue matching filenames to labels :type catalogue: `Catalogue` :param output_fh: object to output results to :type output_fh: file-like object :rtype: file-like object """

        labels = self._sort_labels(self._set_labels(catalogue))
        if len(labels) < 2:
            raise MalformedQueryError(
                constants.INSUFFICIENT_LABELS_QUERY_ERROR)
        label_placeholders = self._get_placeholders(labels)
        subquery = self._get_intersection_subquery(labels)
        query = constants.SELECT_INTERSECT_SQL.format(label_placeholders,
                                                      subquery)
        parameters = labels + labels
        self._logger.info('Running intersection query')
        self._logger.debug('Query: {}\nLabels: {}'.format(query, labels))
        self._log_query_plan(query, parameters)
        cursor = self._conn.execute(query, parameters)
        return self._csv(cursor, constants.QUERY_FIELDNAMES, output_fh)