Repository: pytorch/ignite

Issue:
Bug with `_expand_nodelist`
## 🐛 Bug description

```
_expand_hostlist('gpu-compute-on-demand-dy-g4dnxlarge-[1-4]')
> 
['g4dnxlarge-1', 'g4dnxlarge-2', 'g4dnxlarge-3', 'g4dnxlarge-4']
```
but should be
```
scontrol show hostnames 'gpu-compute-on-demand-dy-g4dnxlarge-[1-4]'
>
gpu-compute-on-demand-dy-g4dnxlarge-1
gpu-compute-on-demand-dy-g4dnxlarge-2
gpu-compute-on-demand-dy-g4dnxlarge-3
gpu-compute-on-demand-dy-g4dnxlarge-4
```

## Environment

- PyTorch Version (e.g., 1.4):
- Ignite Version (e.g., 0.3.0): 0.4.6
- OS (e.g., Linux):
- How you installed Ignite (`conda`, `pip`, source):
- Python version:
- Any other relevant information:


cc @sdesrozis 


Discussion:

Resolving patch:
diff --git a/ignite/distributed/comp_models/native.py b/ignite/distributed/comp_models/native.py
--- a/ignite/distributed/comp_models/native.py
+++ b/ignite/distributed/comp_models/native.py
@@ -450,13 +450,13 @@ def _expand_hostlist(nodelist: str) -> List[str]:
 
         result_hostlist = []
         for node in node_list:
-            nodelist_match = r"(\w+-?)\[((,?[0-9]+-?,?-?){0,})\](.*)?"
-            if re.search(nodelist_match, node):
-                match = re.search(nodelist_match, node)
+            nodelist_match = r"(.+)\[((,?[0-9]+-?,?-?){0,})\](.*)?"
 
-                if match is None:
-                    raise ValueError(f"hostlist unvalid : {nodelist}")
+            match = re.search(nodelist_match, node)
 
+            if match is None:
+                result_hostlist.append(node)
+            else:
                 # holds the ranges of nodes as a string
                 # now we can manipulate the string and cast it to a list of numbers
                 num = str(match.group(2)).replace("[", "").replace("]", "")
@@ -485,7 +485,7 @@ def _expand_hostlist(nodelist: str) -> List[str]:
                 final_list = [item for sublist in nodes_list for item in sublist]
 
                 # put final list in ascending order and append cluster name to each node number
-                final_list = list(set(sorted(final_list)))
+                final_list = list(sorted(set(final_list)))
 
                 # prepend leading zeros to numbers required
                 hostlist_tmp = [str(elem).zfill(lead_zeros + 1) for elem in final_list]
@@ -497,7 +497,5 @@ def _expand_hostlist(nodelist: str) -> List[str]:
                 final_hostlist = [elem + match.group(4) for elem in hostlist_no_suffix]
 
                 result_hostlist += final_hostlist
-            else:
-                result_hostlist.append(node)
 
         return result_hostlist


Test patch:
diff --git a/tests/ignite/distributed/comp_models/test_native.py b/tests/ignite/distributed/comp_models/test_native.py
--- a/tests/ignite/distributed/comp_models/test_native.py
+++ b/tests/ignite/distributed/comp_models/test_native.py
@@ -18,6 +18,15 @@
     [
         ("localhost", "localhost"),
         ("quartz[4-8]", "quartz4,quartz5,quartz6,quartz7,quartz8"),
+        ("c1001a-[11,17]", "c1001a-11,c1001a-17"),
+        ("c1001a-s[11,17]", "c1001a-s11,c1001a-s17"),
+        (
+            "gpu-compute-on-demand-dy-g4dnxlarge-[1-4]",
+            "gpu-compute-on-demand-dy-g4dnxlarge-1,"
+            "gpu-compute-on-demand-dy-g4dnxlarge-2,"
+            "gpu-compute-on-demand-dy-g4dnxlarge-3,"
+            "gpu-compute-on-demand-dy-g4dnxlarge-4",
+        ),
         (
             "node[18-19,1-16,21-22]",
             "node1,node2,node3,node4,node5,"