def set_column(X, ref_ppis, label):
    """Add column to X with values {0, 1} when the interaction appears in the reference ppis

    :param X: pandas dataframe with the first two columns the pair of interacting proteins
    :param ref_ppis: dictionary one --> set of protein interactions
    :param label: name of the new column
    :return: same pandas dataframe with the added new column
    """

    result = []
    for index, row in X.iterrows():
        if row[0] in ref_ppis.keys() and row[1] in ref_ppis[row[0]]:
            result.append(1)
        else:
            result.append(0)

    X[label] = result
    return X