class_docstr: deals with inheritance and many-to-many relationships
class_docstr_tok: ["deals","with","inheritance","and","many-to-many","relationships"]
code: def test_basic(self):
      class Principal:
          def __init__(self, **kwargs):
              for key, value in kwargs.items():
                  setattr(self, key, value)
  
      class User(Principal):
          pass
  
      class Group(Principal):
          pass
  
      self.mapper_registry.map_imperatively(Principal, principals)
      self.mapper_registry.map_imperatively(
          User, users, inherits=Principal
      )
  
      self.mapper_registry.map_imperatively(
          Group,
          groups,
          inherits=Principal,
          properties={
              "users": relationship(
                  User,
                  secondary=user_group_map,
                  lazy="select",
                  backref="groups",
              )
          },
      )
  
      g = Group(name="group1")
      g.users.append(
          User(
              name="user1",
              password="pw",
              email="foo@bar.com",
              login_id="lg1",
          )
      )
      sess = fixture_session()
      sess.add(g)
      sess.flush()
  
imports: from sqlalchemy import Column
  from sqlalchemy import ForeignKey
  from sqlalchemy import Integer
  from sqlalchemy import Sequence
  from sqlalchemy import String
  from sqlalchemy import Table
  from sqlalchemy.orm import class_mapper
  from sqlalchemy.orm import relationship
  from sqlalchemy.testing import config
  from sqlalchemy.testing import eq_
  from sqlalchemy.testing import fixtures
  from sqlalchemy.testing.fixtures import fixture_session
  from sqlalchemy.testing.provision import normalize_sequence
label_desc: Use image node_id 2 for calling the InheritTest obj's underlying member method code with example usage: obj.test_basic() without return types