class_docstr: Metaclass mixin that sets a model's ``__tablename__`` by converting the
  ``CamelCase`` class name to ``snake_case``. A name is set for non-abstract models
  that do not otherwise define ``__tablename__``. If a model does not define a primary
  key, it will not generate a name or ``__table__``, for single-table inheritance.
class_docstr_tok: ["Metaclass","mixin","that","sets","a","model","'s","``","__tablename__","``","by","converting","the","``","CamelCase","``","class","name","to","``","snake_case","``",".","A","name","is","set","for","non-abstract","models","that","do","not","otherwise","define","``","__tablename__","``",".","If","a","model","does","not","define","a","primary","key",",","it","will","not","generate","a","name","or","``","__table__","``",",","for","single-table","inheritance","."]
code: def __init__(
      cls,
      name: str,
      bases: tuple[type, ...],
      d: dict[str, t.Any],
      **kwargs: t.Any,
  ) -> None:
      if should_set_tablename(cls):
          cls.__tablename__ = camel_to_snake_case(cls.__name__)
  
      super().__init__(name, bases, d, **kwargs)
  
      # __table_cls__ has run. If no table was created, use the parent table.
      if (
          "__tablename__" not in cls.__dict__
          and "__table__" in cls.__dict__
          and cls.__dict__["__table__"] is None
      ):
          del cls.__table__
  
imports: from __future__ import annotations
  import re
  import typing
  import sqlalchemy
  import sqlalchemy.orm
  from .query import Query
label_desc: Use image node_id 1 to create a new NameMetaMixin object from inherited base classes: type with example: obj = NameMetaMixin(cls, name, bases, d)