code: def assert_subprocess_calls(expected_commands_or_calls, **kwargs):
      calls = [
          _ensure_mock_call_object(obj, **kwargs)
          for obj in expected_commands_or_calls
      ]
      with mock.patch("subprocess.run", autospec=True) as run:
          run.return_value = SuccessfulSubprocessResult()
          yield run
          run.assert_has_calls(calls)
  
file_path: arrow/dev/archery/archery/testing.py
imports: from contextlib import contextmanager
  import os
  from unittest import mock
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: assert_subprocess_calls(expected_commands_or_calls) without return types