code: def _get_next_run_id_local(run_dir_root: str) -> int:
      """Reads all directory names in a given directory (non-recursive) and returns the next (increasing) run id. Assumes IDs are numbers at the start of the directory names."""
      dir_names = [
          d
          for d in os.listdir(run_dir_root)
          if os.path.isdir(os.path.join(run_dir_root, d))
      ]
      r = re.compile(
          "^\\d+"
      )  # match one or more digits at the start of the string
      run_id = 0
  
      for dir_name in dir_names:
          m = r.match(dir_name)
  
          if m is not None:
              i = int(m.group())
              run_id = max(run_id, i + 1)
  
      return run_id
  
imports: import copy
  import inspect
  import os
  import pathlib
  import pickle
  import platform
  import pprint
  import re
  import shutil
  import sys
  import time
  import traceback
  from enum import Enum
  from ..None import util
label_desc: Use image node_id 8 for calling a global function with example usage: _get_next_run_id_local(run_dir_root) and returns: run_id