code: def test_parser_errors():
      """Ensure we catch errors."""
      hosts = {"worker-0": [0, 1, 2, 3], "worker-1": [0, 1, 2, 3]}
  
      # host does not exist
      with pytest.raises(ValueError):
          dsrun.parse_resource_filter(hosts, include_str="jeff")
      with pytest.raises(ValueError):
          dsrun.parse_resource_filter(hosts, exclude_str="jeff")
  
      # slot does not exist
      with pytest.raises(ValueError):
          dsrun.parse_resource_filter(hosts, include_str="worker-1:4")
      with pytest.raises(ValueError):
          dsrun.parse_resource_filter(hosts, exclude_str="worker-1:4")
  
      # formatting
      with pytest.raises(ValueError):
          dsrun.parse_resource_filter(
              hosts, exclude_str="worker-1@worker-0:1@5"
          )
  
file_path: deepspeed/tests/unit/launcher/test_run.py
imports: import pytest
  from deepspeed.launcher import runner
label_desc: Use image node_id 4 for calling a global function with example usage: test_parser_errors() without return types