def _count_dependency_matches(deps1, deps2):
    """
    Checks how many of the deps1 have a matching dependency in deps2

    :param deps1: list or set of Dependency objects
    :param deps2: list or set of Dependency objects
    :return: integer
    """
    matches = 0
    for dep1 in deps1:
        for dep2 in deps2:
            if dep1.is_equivalent(dep2):
                matches += 1
                break

    return matches