in submitit/core/core.py [0:0]
def results(self) -> tp.List[R]:
"""Waits for and outputs the result of the submitted function
Returns
-------
output
the output of the submitted function.
If the job has several tasks, it will return the output of every tasks in a List
Raises
------
Exception
Any exception raised by the job
"""
self.wait()
if self._sub_jobs:
return [tp.cast(R, sub_job.result()) for sub_job in self._sub_jobs]
outcome, result = self._get_outcome_and_result()
if outcome == "error":
job_exception = self.exception()
if job_exception is None:
raise RuntimeError("Unknown job exception")
raise job_exception # pylint: disable=raising-bad-type
return [result]