def close(self, code=None):
        '''return a `close` :class:`Frame`.
        '''
        code = code or 1000
        body = pack('!H', code)
        body += self._close_codes.get(code, '').encode('utf-8')
        return self.encode(body, opcode=0x8)
return a `close` :class:`Frame`.