code: def increment_path(path, exist_ok=True, sep=""):
      # Increment path, i.e. runs/exp --> runs/exp{sep}0, runs/exp{sep}1 etc.
      path = Path(path)  # os-agnostic
      if (path.exists() and exist_ok) or (not path.exists()):
          return str(path)
      else:
          dirs = glob.glob(f"{path}{sep}*")  # similar paths
          matches = [
              re.search(rf"%s{sep}(\d+)" % path.stem, d) for d in dirs
          ]
          i = [int(m.groups()[0]) for m in matches if m]  # indices
          n = max(i) + 1 if i else 2  # increment number
          return f"{path}{sep}{n}"
  
imports: import glob
  import json
  import ntpath
  import os
  import pickle
  import re
  import urllib.request
  import zipfile
  from pathlib import Path
  from typing import Optional
  import numpy
label_desc: Use image node_id 11 for calling a global function with example usage: increment_path(path, exist_ok, sep) and returns: str, path, sep, n