def generic(rank, fetch, values, argument):
    """
    Yield (value, score) pairs from values' attributes against the argument,
    according to rank.
    """
    for value in values:
        generate = fetch(value)
        attributes = tuple(generate)
        if not attributes:
            continue
        score = rank(attributes, argument)
        yield value, score
