code: def read_job_id(job_id: str) -> tp.List[tp.Tuple[str, ...]]:
      """Reads formated job id and returns a tuple with format:
      (main_id, [array_index, [final_array_index])
      """
      pattern = (
          r"(?P<main_id>\d+)_\[(?P<arrays>(\d+(-\d+)?(,)?)+)(\%\d+)?\]"
      )
      match = re.search(pattern, job_id)
      if match is not None:
          main = match.group("main_id")
          array_ranges = match.group("arrays").split(",")
          return [
              tuple([main] + array_range.split("-"))
              for array_range in array_ranges
          ]
      else:
          main_id, *array_id = job_id.split("_", 1)
          if not array_id:
              return [(main_id,)]
          # there is an array
          array_num = str(
              int(array_id[0])
          )  # trying to cast to int to make sure we understand
          return [(main_id, array_num)]
  
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 1 for calling a global function with example usage: read_job_id(job_id) and returns: unknown, list, list