code: def test_python_job(batch):
      with tempfile.NamedTemporaryFile("w") as output_file:
          b = batch
          head = b.new_job()
          head.command(f'echo "5" > {head.r5}')
          head.command(f'echo "3" > {head.r3}')
  
          def read(path):
              with open(path, "r") as f:
                  i = f.read()
              return int(i)
  
          def multiply(x, y):
              return x * y
  
          def reformat(x, y):
              return {"x": x, "y": y}
  
          middle = b.new_python_job()
          r3 = middle.call(read, head.r3)
          r5 = middle.call(read, head.r5)
          r_mult = middle.call(multiply, r3, r5)
  
          middle2 = b.new_python_job()
          r_mult = middle2.call(multiply, r_mult, 2)
          r_dict = middle2.call(reformat, r3, r5)
  
          tail = b.new_job()
          tail.command(
              f"cat {r3.as_str()} {r5.as_repr()} {r_mult.as_str()} {r_dict.as_json()} > {tail.ofile}"
          )
  
          b.write_output(tail.ofile, output_file.name)
          b.run()
          assert (
              open(output_file.name).read()
              == '3\n5\n30\n{"x": 3, "y": 5}\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 27 for calling a global function with example usage: test_python_job(batch) and returns: int, unknown, dict