class_docstr: Helper for mocking subprocess calls
code: def __call__(
      self, command: tp.Sequence[str], **kwargs: tp.Any
  ) -> bytes:
      program = command[0]
      if program in ["sacct", "sbatch", "scancel"]:
          return getattr(self, program)(command[1:]).encode()
      elif program == "tail":
          return self._subprocess_check_output(command, **kwargs)
      else:
          raise ValueError(f'Unknown command to mock "{command}".')
  
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 2 for calling the MockedSubprocess obj's underlying member method code with example usage: obj.__call__(command) and returns: getattr, self