class_docstr: Helper for mocking subprocess calls
docstr: Create a "RUNNING" job.
docstr_tok: ["Create","a","``","RUNNING","''","job","."]
code: def sbatch(self, args: tp.Sequence[str]) -> str:
      """Create a "RUNNING" job."""
      job_id = str(self.job_count)
      self.job_count += 1
      sbatch_file = Path(args[0])
      array = 0
      if sbatch_file.exists():
          array_lines = [
              l
              for l in sbatch_file.read_text().splitlines()
              if "--array" in l
          ]
          if array_lines:
              # SBATCH --array=0-4%3
              array = int(array_lines[0].split("=0-")[-1].split("%")[0])
              array += 1
      self.set_job_state(job_id, "RUNNING", array)
      return f"Running job {job_id}\n"
  
imports: import contextlib
  import pickle
  import subprocess
  import sys
  import time
  import typing
  from pathlib import Path
  from unittest.mock import patch
  import pytest
  from .None import core, submission, utils
label_desc: Use image node_id 4 for calling the MockedSubprocess obj's underlying member method code with example usage: obj.sbatch(args) and returns: str, job_id, str