def mixture_generator():
      """Generate set intersections.

      Yields:
        a tuple with one data for each task
      """
      data_per_epoch = DATA_PER_EPOCH if n_take == -1 else n_take
      for _ in range(data_per_epoch * epochs):
        # Get model results for the task of membership.
        m_objs = set_members[np.random.randint(len(set_members))]
        m_padded_ent_ids, m_labels = self.gen_one_membership_data(m_objs)

        # Get model results for the task of intersection and union.
        p_set1, p_set2 = set_pairs[np.random.randint(len(set_pairs))]
        p_candidate_set1, p_candidate_set2, p_union_labels = \
            self.gen_one_pair_data('union', p_set1, p_set2)
        p_intersection_labels = np.minimum(p_candidate_set1, p_candidate_set2)

        # Get model results for the task of set_follows.
        f_subj_factids, f_rel_factids = set_follows[np.random.randint(
            len(set_follows))]
        f_candidate_set1, f_candidate_set2, f_labels = self.gen_one_follow_data(
            f_subj_factids, f_rel_factids)

        yield (m_padded_ent_ids, m_labels, p_candidate_set1, p_candidate_set2,
               p_union_labels, p_intersection_labels, f_candidate_set1,
               f_candidate_set2, f_labels), 0.0
Generate set intersections.

      Yields:
        a tuple with one data for each task
      
language/emql/data_loader.py