'Run cleanup code. (Core)'

def close(self):

    if (not self.closed):
        self.closed = True
        self.stage = 'on_end_request'
        self.hooks.run('on_end_request')
        self.stage = 'close'
