code: def write_script(dir: str, filename: str):
      with open(f"{dir}/test_job.py", "w") as f:
          f.write(
              f"""
  import hailtop.batch as hb
  b = hb.Batch()
  j = b.new_job()
  j.command('cat {filename}')
  b.run(wait=False)
  backend.close()
  """
          )
  
file_path: hail/hail/python/test/hailtop/hailctl/batch/test_submit.py
imports: import os
  import pytest
  import tempfile
  from typer.testing import CliRunner
  from hailtop.hailctl.batch import cli
label_desc: Use image node_id 2 for calling a global function with example usage: write_script(dir, filename) without return types