class_docstr: HasAddresses mixin, creates a relationship to
  the address_association table for each parent.
class_docstr_tok: ["HasAddresses","mixin",",","creates","a","relationship","to","the","address_association","table","for","each","parent","."]
code: def address_association(cls):
      name = cls.__name__
      discriminator = name.lower()
  
      assoc_cls = type(
          "%sAddressAssociation" % name,
          (AddressAssociation,),
          dict(
              __tablename__=None,
              __mapper_args__={"polymorphic_identity": discriminator},
          ),
      )
  
      cls.addresses = association_proxy(
          "address_association",
          "addresses",
          creator=lambda addresses: assoc_cls(addresses=addresses),
      )
      return relationship(
          assoc_cls, backref=backref("parent", uselist=False)
      )
  
imports: from sqlalchemy import Column
  from sqlalchemy import create_engine
  from sqlalchemy import ForeignKey
  from sqlalchemy import Integer
  from sqlalchemy import String
  from sqlalchemy.ext.associationproxy import association_proxy
  from sqlalchemy.ext.declarative import as_declarative
  from sqlalchemy.ext.declarative import declared_attr
  from sqlalchemy.orm import backref
  from sqlalchemy.orm import relationship
  from sqlalchemy.orm import Session
label_desc: Use image node_id 2 for calling the HasAddresses obj's underlying member method code with example usage: obj.address_association(cls) and returns: relationship