def sign(self, account=None, **kwargs):
if not account:<EOL><INDENT>if "<STR_LIT>" in self.blockchain.config:<EOL><INDENT>account = self.blockchain.config["<STR_LIT>"]<EOL><DEDENT><DEDENT>if not account:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>account = self.account_class(account, blockchain_instance=self.blockchain)<EOL>info = self.blockchain.info()<EOL>meta = dict(<EOL>timestamp=info["<STR_LIT:time>"],<EOL>block=info["<STR_LIT>"],<EOL>memokey=account["<STR_LIT>"]["<STR_LIT>"],<EOL>account=account["<STR_LIT:name>"],<EOL>)<EOL>wif = self.blockchain.wallet.getPrivateKeyForPublicKey(<EOL>account["<STR_LIT>"]["<STR_LIT>"]<EOL>)<EOL>message = self.message.strip()<EOL>enc_message = self.SIGNED_MESSAGE_META.format(**locals())<EOL>signature = hexlify(sign_message(enc_message, wif)).decode("<STR_LIT:ascii>")<EOL>self.signed_by_account = account<EOL>self.signed_by_name = account["<STR_LIT:name>"]<EOL>self.meta = meta<EOL>self.plain_message = message<EOL>return self.SIGNED_MESSAGE_ENCAPSULATED.format(<EOL>MESSAGE_SPLIT=self.MESSAGE_SPLIT, **locals()<EOL>)<EOL>
Sign a message with an account's memo key

            :param str account: (optional) the account that owns the bet
                (defaults to ``default_account``)
            :raises ValueError: If not account for signing is provided

            :returns: the signed message encapsulated in a known format