def METHOD_NAME(team_id):
    """Delete team in Firebase."""
    # TODO: What is the consequence of this on projects and users
    #   do we expect that the teamId is removed there as well?
    #   teamId is removed for users, but not for projects at the moment
    fb_db = firebaseDB()  # noqa E841
    try:
        # check if team exist in firebase
        if not fb_db.reference(f"v2/teams/{team_id}").get():
            raise CustomError(f"can't find team in firebase: {team_id}")
        # remove all team members
        remove_all_team_members(team_id)
        # get team name from firebase
        team_name = fb_db.reference(f"v2/teams/{team_id}/teamName").get()
        # check if reference path is valid, e.g. if team_id is None
        ref = fb_db.reference(f"v2/teams/{team_id}")
        if not re.match(r"/v2/\w+/[-a-zA-Z0-9]+", ref.path):
            raise CustomError(
                "Given argument resulted in invalid "
                "Firebase Realtime Database reference. "
                f"{ref.path}"
            )
        # delete team in firebase
        ref.delete()
        logger.info(f"deleted team: {team_id} - '{team_name}'")
    except Exception as e:
        logger.info(f"could not delete team: {team_id}")
        raise CustomError(e)