def get_matched_dyads(
    dyads,
    d0_key="doctype",
    d1_key="doctype",
    d0_values=["foxnews"],
    d1_values=["foxnews"],
):
    """Filter which returns dyads which match the specified conditions.

    Args:
        dyads (list): list of 2-item tuples. Each item is a dictionary (document).
        d0_key (str)
        d1_key (str)
        d0_values (list): any values to match
        d1_values (list): any values to match

    Returns:
        matched_dyads (list): filtered version of dyads

    """

    matched_dyads = []
    for dyad in dyads:
        d0 = dyad[0]
        d1 = dyad[1]
        if d0[d0_key] in d0_values and d1[d1_key] in d1_values:
            matched_dyads.append(dyad)

    return matched_dyads