code: def node_fixture(self):
      Node = self.classes.Node
      nodes = self.tables.nodes
  
      def go(join_depth):
          self.mapper_registry.map_imperatively(
              Node,
              nodes,
              properties={
                  "parent": relationship(
                      Node,
                      remote_side=nodes.c.id,
                      lazy="immediate",
                      join_depth=join_depth,
                  )
              },
          )
  
          return Node
  
      yield go
  
      # 1. the fixture uses InnoDB, so foreign keys are enforced
      # 2. "delete from nodes" in InnoDB is not smart enough to delete
      #    all rows in the correct order automatically
      # 3. "DELETE..ORDER BY" is mysql specific.  we want the TablesTest
      #    fixture to be generic
      # 4. Can't add "ON DELETE CASCADE" to that fixture because SQL Server
      #    rejects it
      # 5. so until we have a "delete from all tables taking FKs into
      #    account" routine, we need a custom teardown here for MySQL/MariaDB
      # 6. A similar fixture in test_recursive_loaders is cheating since it's
      #    hardcoding to using MyISAM for MySQL
      with Session(testing.db) as sess:
          for node in sess.scalars(select(Node)):
              sess.delete(node)
  
          sess.commit()
  
file_path: sqlalchemy/test/orm/test_immediate_load.py
imports: from sqlalchemy import select
  from sqlalchemy import testing
  from sqlalchemy.orm import immediateload
  from sqlalchemy.orm import relationship
  from sqlalchemy.orm import Session
  from sqlalchemy.testing import eq_
  from sqlalchemy.testing import is_
  from sqlalchemy.testing.fixtures import fixture_session
  from test.orm import _fixtures
label_desc: Use image node_id 1 for calling the SelfReferentialTest obj's underlying member method code with example usage: obj.node_fixture() and returns: Node