code: def test_slurm_weird_dir(weird_tmp_path: Path) -> None:
      if "\n" in weird_tmp_path.name:
          pytest.skip(
              "test doesn't support newline in 'weird_tmp_path'"
          )
      with mocked_slurm():
          executor = slurm.SlurmExecutor(folder=weird_tmp_path)
          job = executor.submit(test_core.do_nothing, 1, 2, blublu=3)
  
      # Touch the ouputfiles
      job.paths.stdout.write_text("")
      job.paths.stderr.write_text("")
  
      # Try to read sbatch flags from the file like sbatch would do it.
      sbatch_args = {}
      for l in job.paths.submission_file.read_text().splitlines():
          if not l.startswith("#SBATCH"):
              continue
          if "=" not in l:
              continue
          key, val = l[len("#SBATCH") :].strip().split("=", 1)
          sbatch_args[key] = val.replace("%j", job.job_id).replace(
              "%t", "0"
          )
  
      # We do not quote --output and --error values here,
      # because we want to check if they have been properly quoted before.
      subprocess.check_call("ls " + sbatch_args["--output"], shell=True)
      subprocess.check_call("ls " + sbatch_args["--error"], shell=True)
  
imports: import contextlib
  import os
  import signal
  import subprocess
  import typing
  from pathlib import Path
  from unittest.mock import patch
  import pytest
  import submitit
  from ..None import helpers
  from ..core import job_environment, submission, test_core, utils
  from ..core.core import Job
  from .None import slurm
label_desc: Use image node_id 31 for calling a global function with example usage: test_slurm_weird_dir(weird_tmp_path) without return types