code: def expand_mapped_task(
      mapped: MappedOperator,
      run_id: str,
      upstream_task_id: str,
      length: int,
      session: Session,
  ):
      session.add(
          TaskMap(
              dag_id=mapped.dag_id,
              task_id=upstream_task_id,
              run_id=run_id,
              map_index=-1,
              length=length,
              keys=None,
          )
      )
      session.flush()
  
      mapped.expand_mapped_task(run_id, session=session)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from airflow.models.taskmap import TaskMap
label_desc: Use image node_id 1 for calling a global function with example usage: expand_mapped_task(mapped, run_id, upstream_task_id, length, session) without return types