def launch_job_generator(
        job_generator: job_blocks.JobGeneratorType) -> Awaitable[None]:
      if (not inspect.iscoroutinefunction(job_generator) and
          not inspect.iscoroutinefunction(job_generator.__call__)):
        raise ValueError(
            'Job generator must be an async function. Signature needs to be '
            '`async def job_generator(work_unit: xm.WorkUnit):`')
      return job_generator(self, **(args or {}))