def allow(<EOL>self,<EOL>foreign,<EOL>weight=None,<EOL>permission="<STR_LIT>",<EOL>account=None,<EOL>threshold=None,<EOL>**kwargs<EOL>):
from copy import deepcopy<EOL>if not account:<EOL><INDENT>if "<STR_LIT>" in self.config:<EOL><INDENT>account = self.config["<STR_LIT>"]<EOL><DEDENT><DEDENT>if not account:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if permission not in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>account = Account(account, blockchain_instance=self)<EOL>if not weight:<EOL><INDENT>weight = account[permission]["<STR_LIT>"]<EOL><DEDENT>authority = deepcopy(account[permission])<EOL>try:<EOL><INDENT>pubkey = PublicKey(foreign, prefix=self.prefix)<EOL>authority["<STR_LIT>"].append([str(pubkey), weight])<EOL><DEDENT>except Exception:<EOL><INDENT>try:<EOL><INDENT>foreign_account = Account(foreign, blockchain_instance=self)<EOL>authority["<STR_LIT>"].append([foreign_account["<STR_LIT:id>"], weight])<EOL><DEDENT>except Exception:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>if threshold:<EOL><INDENT>authority["<STR_LIT>"] = threshold<EOL>self._test_weights_treshold(authority)<EOL><DEDENT>op = operations.Account_update(<EOL>**{<EOL>"<STR_LIT>": {"<STR_LIT>": <NUM_LIT:0>, "<STR_LIT>": "<STR_LIT>"},<EOL>"<STR_LIT>": account["<STR_LIT:id>"],<EOL>permission: authority,<EOL>"<STR_LIT>": {},<EOL>"<STR_LIT>": self.prefix,<EOL>}<EOL>)<EOL>if permission == "<STR_LIT>":<EOL><INDENT>return self.finalizeOp(op, account["<STR_LIT:name>"], "<STR_LIT>", **kwargs)<EOL><DEDENT>else:<EOL><INDENT>return self.finalizeOp(op, account["<STR_LIT:name>"], "<STR_LIT>", **kwargs)<EOL><DEDENT>
Give additional access to an account by some other public
            key or account.

            :param str foreign: The foreign account that will obtain access
            :param int weight: (optional) The weight to use. If not
                define, the threshold will be used. If the weight is
                smaller than the threshold, additional signatures will
                be required. (defaults to threshold)
            :param str permission: (optional) The actual permission to
                modify (defaults to ``active``)
            :param str account: (optional) the account to allow access
                to (defaults to ``default_account``)
            :param int threshold: The threshold that needs to be reached
                by signatures to be able to interact