code: def test_get_batch_commands(resources, capsys):
      batch_file = os.path.join(resources, "batch_data.h5")
  
      cellprofiler.__main__.get_batch_commands(batch_file)
  
      batch_commands = capsys.readouterr()[0].strip().split("\n")
  
      assert len(batch_commands) == 9
  
      for idx, batch_command in enumerate(batch_commands):
          first, last = re.match(
              ".* -f ([0-9]) -l ([0-9])", batch_command
          ).groups()
  
          assert first == str(idx + 1)
  
          assert last == first
  
file_path: CellProfiler/tests/frontend/test_main.py
imports: import os.path
  import re
  import pytest
  import cellprofiler.__main__
  import tests.frontend
label_desc: Use image node_id 3 for calling a global function with example usage: test_get_batch_commands(resources, capsys) without return types