def get_matching_tuple(run, matches):
    """Checks which combination of attribute and values matches with the run.

    """
    for m in matches:
        match = True
        for k, v in m.iteritems():
            if v != run[k]:
                match = False
                break
        if match:
            return True, m
    return False, None