human
Complete this python program:
def connection_memoize(key):
assistant
#Here is the Python program you requested.

    """Decorator, memoize a function in a connection.info stash.
    Only applicable to functions which take no arguments other than a
    connection.  The memo will be stored in ``connection.info[key]``.
    """
    @util.decorator
    def decorated(fn, self, connection):
        connection = connection.connect()
        try:
            return connection.info[key]
        except KeyError:
            connection.info[key] = val = fn(self, connection)
            return val
    return decorated