code: def _parse_node_group(
      node_list: str, pos: int, parsed: tp.List[str]
  ) -> int:
      """Parse a node group of the form PREFIX[1-3,5,8] and return
      the position in the string at which the parsing stopped
      """
      prefixes = [""]
      while pos < len(node_list):
          c = node_list[pos]
          if c == ",":
              parsed.extend(prefixes)
              return pos + 1
          if c == "[":
              last_pos = node_list.index("]", pos)
              suffixes = _expand_id_suffix(
                  node_list[pos + 1 : last_pos]
              )
              prefixes = [
                  prefix + suffix
                  for prefix in prefixes
                  for suffix in suffixes
              ]
              pos = last_pos + 1
          else:
              for i, prefix in enumerate(prefixes):
                  prefixes[i] = prefix + c
              pos += 1
      parsed.extend(prefixes)
      return pos
  
imports: import functools
  import inspect
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import typing
  import uuid
  import warnings
  from pathlib import Path
  from ..core import core, job_environment, logger, utils
label_desc: Use image node_id 3 for calling a global function with example usage: _parse_node_group(node_list, pos, parsed) and returns: pos, unknown