def searchPFAMmatch(list_pfamId_orga_A:list, list_pfamId_orga_B:list, dict_ddi_sources:dict):
    """
    Combine all the pfam ids and check if they exist in the dictionary of ddi, if yes the tuple was add to an array and returned.
    This method check the id_pfam_A - id_pfam_B AND id_fam_B - id_pfam_A

    :param list_pfamId_orga_A: list of pfam ids in the organism A
    :param list_pfamId_orga_B: list of pfam ids in the organism B
    :param dict_ddi_sources: dictionary that contain all the pairs

    :type list_pfamId_orga_A: list 
    :type list_pfamId_orga_B: list 
    :type dict_ddi_sources: dictionary 

    :return: array with the tuples of id ddi matches
    :rtype: array[(id_domain_a, id_domain_b)]

    """
    array_tuples_match = []
    for id_pfam_orga_a in list_pfamId_orga_A:
        for id_pfam_orga_b in list_pfamId_orga_B:
            if (id_pfam_orga_a, id_pfam_orga_b) in dict_ddi_sources:
                tuple_key = (id_pfam_orga_a, id_pfam_orga_b)
                array_tuples_match.append(tuple_key)
                continue
            elif (id_pfam_orga_b, id_pfam_orga_a) in dict_ddi_sources:
                tuple_key = (id_pfam_orga_b, id_pfam_orga_a)
                array_tuples_match.append(tuple_key)

    return array_tuples_match