(id_map1, id_map2, need_label)
:param id_map1: (a, b)
        :param id_map2: (a, c)
        :return: (c, b)
def _merge_instance(id_map1, id_map2, need_label):
        """

        :param id_map1: (a, b)
        :param id_map2: (a, c)
        :return: (c, b)
        """
        merge_table = id_map1.join(id_map2, lambda v, u: (u, v))
        if need_label:
            return merge_table.map(lambda k, v: (v[0], Instance(label=v[1], features=[])))
        else:
            return merge_table.map(lambda k, v: (v[0], Instance(features=v[1])))
def _merge_instance ( id_map1 , id_map2 , need_label ) : merge_table = id_map1 . join ( id_map2 , lambda v , u : ( u , v ) ) if need_label : return merge_table . map ( lambda k , v : ( v [ 0 ] , Instance ( label = v [ 1 ] , features = [ ] ) ) ) else : return merge_table . map ( lambda k , v : ( v [ 0 ] , Instance ( features = v [ 1 ] ) ) )