def assign_shell_account(tid=None):

    db = api.common.get_conn()

    tid = get_team(tid=tid)["tid"]

    if db.ssh.find({"tid": tid}).count() > 0:
        raise InternalException("Team {} was already assigned a shell account.".format(tid))

    if not shell_accounts_available():
        raise InternalException("There are no available shell accounts.")

    db.ssh.update({"tid": {"$exists": False}}, {"$set": {"tid": tid}}, multi=False)
Assigns a webshell account for the team.
dataset/ETHPy150Open picoCTF/picoCTF-Platform-2/api/api/team.py/assign_shell_account