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 Foo:
          def __init__(self, data=None):
              self.data = data
  
          def __repr__(self):
              return "Foo id %d, data %s" % (self.id, self.data)
  
      self.mapper_registry.map_imperatively(Foo, foo)
  
      class Bar(Foo):
          def __repr__(self):
              return "Bar id %d, data %s" % (self.id, self.data)
  
      self.mapper_registry.map_imperatively(
          Bar,
          bar,
          inherits=Foo,
          properties={
              "foos": relationship(
                  Foo, secondary=bar_foo, lazy="select"
              )
          },
      )
  
      sess = fixture_session()
      b = Bar("bar #1")
      sess.add(b)
      b.foos.append(Foo("foo #1"))
      b.foos.append(Foo("foo #2"))
      sess.flush()
      compare = [repr(b)] + sorted([repr(o) for o in b.foos])
      sess.expunge_all()
      result = sess.query(Bar).all()
      print(repr(result[0]) + repr(result[0].foos))
      found = [repr(result[0])] + sorted(
          [repr(o) for o in result[0].foos]
      )
      eq_(found, compare)
  
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 InheritTest3 obj's underlying member method code with example usage: obj.test_basic() and returns: unknown, unknown