def create_account(<EOL>self,<EOL>account_name,<EOL>registrar=None,<EOL>referrer="<STR_LIT>",<EOL>referrer_percent=<NUM_LIT:50>,<EOL>owner_key=None,<EOL>active_key=None,<EOL>memo_key=None,<EOL>password=None,<EOL>additional_owner_keys=[],<EOL>additional_active_keys=[],<EOL>additional_owner_accounts=[],<EOL>additional_active_accounts=[],<EOL>proxy_account="<STR_LIT>",<EOL>storekeys=True,<EOL>**kwargs<EOL>):
if not registrar and self.config["<STR_LIT>"]:<EOL><INDENT>registrar = self.config["<STR_LIT>"]<EOL><DEDENT>if not registrar:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if password and (owner_key or active_key or memo_key):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>Account(account_name, blockchain_instance=self)<EOL>raise AccountExistsException<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>referrer = Account(referrer, blockchain_instance=self)<EOL>registrar = Account(registrar, blockchain_instance=self)<EOL>"<STR_LIT>"<EOL>from peerplaysbase.account import PasswordKey, PublicKey<EOL>if password:<EOL><INDENT>active_key = PasswordKey(account_name, password, role="<STR_LIT>")<EOL>owner_key = PasswordKey(account_name, password, role="<STR_LIT>")<EOL>memo_key = PasswordKey(account_name, password, role="<STR_LIT>")<EOL>active_pubkey = active_key.get_public_key()<EOL>owner_pubkey = owner_key.get_public_key()<EOL>memo_pubkey = memo_key.get_public_key()<EOL>active_privkey = active_key.get_private_key()<EOL>memo_privkey = memo_key.get_private_key()<EOL>if storekeys:<EOL><INDENT>self.wallet.addPrivateKey(str(active_privkey))<EOL>self.wallet.addPrivateKey(str(memo_privkey))<EOL><DEDENT><DEDENT>elif owner_key and active_key and memo_key:<EOL><INDENT>active_pubkey = PublicKey(active_key, prefix=self.prefix)<EOL>owner_pubkey = PublicKey(owner_key, prefix=self.prefix)<EOL>memo_pubkey = PublicKey(memo_key, prefix=self.prefix)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>owner = format(owner_pubkey, self.prefix)<EOL>active = format(active_pubkey, self.prefix)<EOL>memo = format(memo_pubkey, self.prefix)<EOL>owner_key_authority = [[owner, <NUM_LIT:1>]]<EOL>active_key_authority = [[active, <NUM_LIT:1>]]<EOL>owner_accounts_authority = []<EOL>active_accounts_authority = []<EOL>for k in additional_owner_keys:<EOL><INDENT>owner_key_authority.append([k, <NUM_LIT:1>])<EOL><DEDENT>for k in additional_active_keys:<EOL><INDENT>active_key_authority.append([k, <NUM_LIT:1>])<EOL><DEDENT>for k in additional_owner_accounts:<EOL><INDENT>addaccount = Account(k, blockchain_instance=self)<EOL>owner_accounts_authority.append([addaccount["<STR_LIT:id>"], <NUM_LIT:1>])<EOL><DEDENT>for k in additional_active_accounts:<EOL><INDENT>addaccount = Account(k, blockchain_instance=self)<EOL>active_accounts_authority.append([addaccount["<STR_LIT:id>"], <NUM_LIT:1>])<EOL><DEDENT>voting_account = Account(<EOL>proxy_account or "<STR_LIT>", blockchain_instance=self<EOL>)<EOL>op = {<EOL>"<STR_LIT>": {"<STR_LIT>": <NUM_LIT:0>, "<STR_LIT>": "<STR_LIT>"},<EOL>"<STR_LIT>": registrar["<STR_LIT:id>"],<EOL>"<STR_LIT>": referrer["<STR_LIT:id>"],<EOL>"<STR_LIT>": int(referrer_percent * <NUM_LIT:100>),<EOL>"<STR_LIT:name>": account_name,<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": owner_accounts_authority,<EOL>"<STR_LIT>": owner_key_authority,<EOL>"<STR_LIT>": [],<EOL>"<STR_LIT>": <NUM_LIT:1>,<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": active_accounts_authority,<EOL>"<STR_LIT>": active_key_authority,<EOL>"<STR_LIT>": [],<EOL>"<STR_LIT>": <NUM_LIT:1>,<EOL>},<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": memo,<EOL>"<STR_LIT>": voting_account["<STR_LIT:id>"],<EOL>"<STR_LIT>": <NUM_LIT:0>,<EOL>"<STR_LIT>": <NUM_LIT:0>,<EOL>"<STR_LIT>": [],<EOL>"<STR_LIT>": [],<EOL>},<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": self.prefix,<EOL>}<EOL>op = operations.Account_create(**op)<EOL>return self.finalizeOp(op, registrar, "<STR_LIT>", **kwargs)<EOL>
Create new account on PeerPlays

            The brainkey/password can be used to recover all generated keys
            (see `peerplaysbase.account` for more details.

            By default, this call will use ``default_account`` to
            register a new name ``account_name`` with all keys being
            derived from a new brain key that will be returned. The
            corresponding keys will automatically be installed in the
            wallet.

            .. warning:: Don't call this method unless you know what
                          you are doing! Be sure to understand what this
                          method does and where to find the private keys
                          for your account.

            .. note:: Please note that this imports private keys
                      (if password is present) into the wallet by
                      default. However, it **does not import the owner
                      key** for security reasons. Do NOT expect to be
                      able to recover it from the wallet if you lose
                      your password!

            :param str account_name: (**required**) new account name
            :param str registrar: which account should pay the registration fee
                                (defaults to ``default_account``)
            :param str owner_key: Main owner key
            :param str active_key: Main active key
            :param str memo_key: Main memo_key
            :param str password: Alternatively to providing keys, one
                                 can provide a password from which the
                                 keys will be derived
            :param array additional_owner_keys:  Additional owner public keys
            :param array additional_active_keys: Additional active public keys
            :param array additional_owner_accounts: Additional owner account
                names
            :param array additional_active_accounts: Additional acctive account
                names
            :param bool storekeys: Store new keys in the wallet (default:
                ``True``)
            :raises AccountExistsException: if the account already exists on
                the blockchain