def compare_rxn(rxn1, rxn2):
    """
    compare two cobra reaction object and return (same_cpd, same_rev)
    same_cpd: bool, if true means same compounds consumed and produced
    same_reve: bool, if true means same direction of reaction (reversible or not)

    Parameters
    ----------
    rxn1: cobra.model.reaction
        reaction as cobra object
    rxn2: cobra.model.reaction
        reaction as cobra object

    Returns
    -------
    tuple:
        (same_cpd (bool), same_rev (bool))
    """
    same_cpd, same_rev = False, False
    rxn1_dict, rxn2_dict = {}, {}
    for k, v in list(rxn1.metabolites.items()):
        rxn1_dict[k.id] = v
    for k, v in list(rxn2.metabolites.items()):
        rxn2_dict[k.id] = v
    if rxn1_dict == rxn2_dict:
        same_cpd = True
    if rxn1.reversibility == rxn2.reversibility:
        same_rev = True
    return same_cpd, same_rev
