code: def add_pvms(
      session: Session,
      pvm_data: dict[str, tuple[str, ...]],
      commit: bool = False,
  ) -> list[PermissionView]:
      """
      Checks if exists and adds new Permissions, Views and PermissionView's
      """
      pvms = []
      for view_name, permissions in pvm_data.items():
          # Check and add the new View
          new_view = _add_view_menu(session, view_name)
          for permission_name in permissions:
              new_permission = _add_permission(session, permission_name)
              # Check and add the new PVM
              pvms.append(
                  _add_permission_view(
                      session, new_permission, new_view
                  )
              )
      if commit:
          session.commit()
      return pvms
  
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 5 for calling a global function with example usage: add_pvms(session, pvm_data, commit) and returns: pvms