class_docstr: Helper for mocking subprocess calls
code: def context(self) -> tp.Iterator[None]:
      with patch(
          "submitit.core.utils.CommandFunction", new=self.mock_cmd_fn
      ):
          with patch("subprocess.check_output", new=self):
              with patch("shutil.which", new=self.which):
                  with patch("subprocess.check_call", new=self):
                      yield None
  
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 10 for calling the MockedSubprocess obj's underlying member method code with example usage: obj.context() without return types