code: def test_multiple_dependent_jobs(batch):
      with tempfile.NamedTemporaryFile("w") as output_file:
          b = batch
          j = b.new_job()
          j.command(f'echo "0" >> {j.ofile}')
  
          for i in range(1, 3):
              j2 = b.new_job()
              j2.command(f'echo "{i}" > {j2.tmp1}')
              j2.command(f"cat {j.ofile} {j2.tmp1} > {j2.ofile}")
              j = j2
  
          b.write_output(j.ofile, output_file.name)
          b.run()
  
          assert open(output_file.name).read() == "0\n1\n2\n"
  
imports: from typing import AsyncIterator
  import os
  import pytest
  import subprocess
  import tempfile
  from hailtop import pip_version
  from hailtop.batch import Batch, LocalBackend, ResourceGroup
  from hailtop.batch.resource import JobResourceFile
  from hailtop.batch.utils import concatenate
label_desc: Use image node_id 18 for calling a global function with example usage: test_multiple_dependent_jobs(batch) without return types