docs: def disallow(
          self, foreign, permission="active", account=None, threshold=None, **kwargs
      ):
          """ Remove additional access to an account by some other public
              key or account.
  
              :param str foreign: The foreign account that will obtain access
              :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
          """
          if not account:
              if "default_account" in self.config:
                  account = self.config["default_account"]
          if not account:
              raise ValueError("You need to provide an account")
  
          if permission not in ["owner", "active"]:
              raise ValueError("Permission needs to be either 'owner', or 'active")
          account = Account(account, blockchain_instance=self)
          authority = account[permission]
  
          try:
              pubkey = PublicKey(foreign, prefix=self.prefix)
              affected_items = list(
                  filter(lambda x: x[0] == str(pubkey), authority["key_auths"])
              )
              authority["key_auths"] = list(
                  filter(lambda x: x[0] != str(pubkey), authority["key_auths"])
              )
          except:
              try:
                  foreign_account = Account(foreign, blockchain_instance=self)
                  affected_items = list(
                      filter(
                          lambda x: x[0] == foreign_account["id"],
                          authority["account_auths"],
                      )
                  )
                  authority["account_auths"] = list(
                      filter(
                          lambda x: x[0] != foreign_account["id"],
                          authority["account_auths"],
                      )
                  )
              except:
                  raise ValueError("Unknown foreign account or unvalid public key")
  
          if not affected_items:
              raise ValueError("Changes nothing!")
          removed_weight = affected_items[0][1]
  
          # Define threshold
          if threshold:
              authority["weight_threshold"] = threshold
  
          # Correct threshold (at most by the amount removed from the
          # authority)
          try:
              self._test_weights_treshold(authority)
          except:
              log.critical(
                  "The account's threshold will be reduced by %d" % (removed_weight)
              )
              authority["weight_threshold"] -= removed_weight
              self._test_weights_treshold(authority)
  
          op = operations.Account_update(
              **{
                  "fee": {"amount": 0, "asset_id": "1.3.0"},
                  "account": account["id"],
                  permission: authority,
                  "extensions": {},
              }
          )
          if permission == "owner":
              return self.finalizeOp(op, account["name"], "owner", **kwargs)
          else:
              return self.finalizeOp(op, account["name"], "active", **kwargs)