in submitit/slurm/slurm.py [0:0]
def _get_job_id_from_submission_command(string: Union[bytes, str]) -> str:
"""Returns the job ID from the output of sbatch string"""
if not isinstance(string, str):
string = string.decode()
output = re.search(r"job (?P<id>[0-9]+)", string)
if output is None:
raise utils.FailedSubmissionError(
f'Could not make sense of sbatch output "{string}"\n'
"Job instance will not be able to fetch status\n"
"(you may however set the job job_id manually if needed)"
)
return output.group("id")