text: import re
  import uuid
  
  from sqlalchemy import Column
  from sqlalchemy.dialects.postgresql import UUID
  from sqlalchemy.orm import declared_attr, registry
  
  
  mapper_registry = registry()
  
  
  @mapper_registry.as_declarative_base()
  class Base:
      id: uuid.UUID = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
  
      @declared_attr
      def __tablename__(cls) -> str:
          return re.sub(r"(?<!^)(?=[A-Z])", "_", cls.__name__).lower()
  