def decorate(function):
        '''Update the conversions table and return the original'''
        try:
            previous = conversions[source][dest]
        except KeyError:
            conversions.setdefault(source, {})[dest] = function
            return function
        raise ValueError, 'Two conversions from %r to %r: %r and %r' % (
              source, dest, getattr(previous, '__name__', previous),
              getattr(function, '__name__', function))
Update the conversions table and return the original
recipes/Python/393010_Using_decorators_load/recipe-393010.py