code: def create_heroes():
      with Session(engine) as session:
          team_preventers = Team(
              name="Preventers", headquarters="Sharp Tower"
          )
          team_z_force = Team(
              name="Z-Force", headquarters="Sister Margaret's Bar"
          )
  
          hero_deadpond = Hero(
              name="Deadpond",
              secret_name="Dive Wilson",
          )
          hero_rusty_man = Hero(
              name="Rusty-Man",
              secret_name="Tommy Sharp",
              age=48,
          )
          hero_spider_boy = Hero(
              name="Spider-Boy",
              secret_name="Pedro Parqueador",
          )
          deadpond_team_z_link = HeroTeamLink(
              team=team_z_force, hero=hero_deadpond
          )
          deadpond_preventers_link = HeroTeamLink(
              team=team_preventers, hero=hero_deadpond, is_training=True
          )
          spider_boy_preventers_link = HeroTeamLink(
              team=team_preventers,
              hero=hero_spider_boy,
              is_training=True,
          )
          rusty_man_preventers_link = HeroTeamLink(
              team=team_preventers, hero=hero_rusty_man
          )
  
          session.add(deadpond_team_z_link)
          session.add(deadpond_preventers_link)
          session.add(spider_boy_preventers_link)
          session.add(rusty_man_preventers_link)
          session.commit()
  
          for link in team_z_force.hero_links:
              print(
                  "Z-Force hero:",
                  link.hero,
                  "is training:",
                  link.is_training,
              )
  
          for link in team_preventers.hero_links:
              print(
                  "Preventers hero:",
                  link.hero,
                  "is training:",
                  link.is_training,
              )
  
file_path: sqlmodel/docs_src/tutorial/many_to_many/tutorial003_py39.py
imports: from typing import Optional
  from sqlmodel import Field, Relationship, Session, SQLModel, create_engine, select
label_desc: Use image node_id 2 for calling a global function with example usage: create_heroes() without return types