code: def _parse_slurm_node_list(s: str) -> List[str]:
      nodes = []
      # Extract "hostname", "hostname[1-2,3,4-5]," substrings
      p = re.compile(r"(([^\[]+)(?:\[([^\]]+)\])?),?")
      for m in p.finditer(s):
          prefix, suffixes = (
              s[m.start(2) : m.end(2)],
              s[m.start(3) : m.end(3)],
          )
          for suffix in suffixes.split(","):
              span = suffix.split("-")
              if len(span) == 1:
                  nodes.append(prefix + suffix)
              else:
                  width = len(span[0])
                  start, end = int(span[0]), int(span[1]) + 1
                  nodes.extend(
                      [
                          prefix + f"{i:0{width}}"
                          for i in range(start, end)
                      ]
                  )
      return nodes
  
imports: import os
  import random
  import re
  import socket
  from typing import Dict, List
  import torch
  import torch.distributed
label_desc: Use image node_id 12 for calling a global function with example usage: _parse_slurm_node_list(s) and returns: nodes