def METHOD_NAME(team_id):
    """Create new team in Firebase."""
    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}")
        # get team name from firebase
        team_name = fb_db.reference(f"v2/teams/{team_id}/teamName").get()
        # check if reference path is valid
        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}"
            )
        # generate new uuid4 token
        new_team_token = str(uuid.uuid4())
        # set team token in firebase
        ref.update({"teamToken": new_team_token})
        logger.info(f"renewed team token: {team_id} - '{team_name}' - {new_team_token}")
        return new_team_token
    except Exception as e:
        logger.info(f"could not delete team: {team_id}")
        raise CustomError(e)