original_docstring: 
      Commit the user commit to the db.
      :param db: The db session to use.
      :param tid: The tid of the entry in the log to commit.
      :return: None
      
docstring: Commit the user commit to the db.
docstring_tokens: Commit the user commit to the db .
code: def create_or_update_user(db: Session, tid: int):
      """
      Commit the user commit to the db.
      :param db: The db session to use.
      :param tid: The tid of the entry in the log to commit.
      :return: None
      """
      db_user = None
      to_commit = get_log(db, tid)
      existing_user = get_user_by_name(db, to_commit.name)
      if existing_user:
          db.query(models.User)\
              .filter(models.User.name == to_commit.name)\
              .update({models.User.admin: to_commit.admin}, synchronize_session=False)
      else:
          db_user = models.User(name=to_commit.name, admin=to_commit.admin)
          db.add(db_user)
      db.commit()
      # if db_user:
      #     db.refresh(db_user)
code_tokens: def create_or_update_user ( db : Session , tid : int ) : db_user = None to_commit = get_log ( db , tid ) existing_user = get_user_by_name ( db , to_commit . name ) if existing_user : db . query ( models . User ) . filter ( models . User . name == to_commit . name ) . update ( { models . User . admin : to_commit . admin } , synchronize_session = False ) else : db_user = models . User ( name = to_commit . name , admin = to_commit . admin ) db . add ( db_user ) db . commit ( )
short_docstring: Commit the user commit to the db.
short_docstring_tokens: Commit the user commit to the db .
comment: """
      Commit the user commit to the db.
      :param db: The db session to use.
      :param tid: The tid of the entry in the log to commit.
      :return: None
      """$SEP$# if db_user:$SEP$#     db.refresh(db_user)