def _translators(attr, kwargs):
    """
    Decorator which associates a set of translators (serializers or
    deserializers) with a given method.  The `attr` parameter
    identifies which attribute is being updated.
    """

    # Add translators to a function or class
    def decorator(func):
        # Make sure we have the attribute
        try:
            xlators = getattr(func, attr)
        except AttributeError:
            xlators = {}
            setattr(func, attr, xlators)

        xlators.update(kwargs)
        return func
    return decorator