code: def test_expand_hostlist_invalid():
      with pytest.raises(ValueError, match=r"hostlist invalid"):
          _expand_hostlist("invalid[]")
  
imports: import os
  import pytest
  import torch
  import torch.distributed
  from ignite.distributed.comp_models import has_native_dist_support
label_desc: Use image node_id 2 for calling a global function with example usage: test_expand_hostlist_invalid() without return types