def get_team(tid=None, name=None):

    db = api.api.common.get_conn()

    match = {}
    if tid is not None:
        match.update({'tid': tid})
    elif name is not None:
        match.update({'team_name': name})
    elif api.auth.is_logged_in():
        match.update({"tid": api.user.get_user()["tid"]})
    else:
        raise InternalException("Must supply tid or team name to get_team")

    team = db.teams.find_one(match, {"_id": 0})

    if team is None:
        raise InternalException("Team does not exist.")

    return team
Retrieve a team based on a property (tid, name, etc.).
dataset/ETHPy150Open picoCTF/picoCTF-Platform-2/api/api/team.py/get_team