def METHOD_NAME(key, count, combine):
    """Create a rule to conglomerate identical args.
    >>> def key(x):
    ...     return x.as_coeff_Mul()[1]
    >>> def count(x):
    ...     return x.as_coeff_Mul()[0]
    >>> def combine(cnt, arg):
    ...     return cnt * arg
    >>> rl = glom(key, count, combine)
    >>> rl(Add(x, -x, 3*x, 2, 3, evaluate=False))
    3*x + 5
    Wait, how are key, count and combine supposed to work?
    >>> key(2*x)
    x
    >>> count(2*x)
    2
    >>> combine(2, x)
    2*x
    """
    def conglomerate(expr):
        """Conglomerate together identical args x + x -> 2x."""
        groups = sift(arguments(expr), key)
        counts = {k: sum(map(count, args)) for k, args in groups.items()}
        newargs = [combine(cnt, mat) for mat, cnt in counts.items()]
        if set(newargs) != set(arguments(expr)):
            return term(operator(expr), newargs)
        return expr
    return conglomerate