def _translators(attr, kwargs):
<EOL>def decorator(func):<EOL><INDENT>try:<EOL><INDENT>xlators = getattr(func, attr)<EOL><DEDENT>except AttributeError:<EOL><INDENT>xlators = {}<EOL>setattr(func, attr, xlators)<EOL><DEDENT>xlators.update(kwargs)<EOL>return func<EOL><DEDENT>return decorator<EOL>
Decorator which associates a set of translators (serializers or
deserializers) with a given method.  The `attr` parameter
identifies which attribute is being updated.