code: def _add_view_menu(session: Session, view_name: str) -> ViewMenu:
      """
      Check and add the new view menu
      """
      new_view = (
          session.query(ViewMenu)
          .filter(ViewMenu.name == view_name)
          .one_or_none()
      )
      if not new_view:
          new_view = ViewMenu(name=view_name)
          session.add(new_view)
      return new_view
  
imports: import logging
  from dataclasses import dataclass
  from sqlalchemy import Column, ForeignKey, Integer, Sequence, String, Table, UniqueConstraint
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import Load, relationship, Session
label_desc: Use image node_id 1 for calling a global function with example usage: _add_view_menu(session, view_name) and returns: new_view