code: def _parse_spec(spec):
      out = []  # will return a list of tuples (min, max) for each layer
      if not spec:
          return out
      for ilevel, level in enumerate(spec.split("/")):
          if not level:
              continue
          minmax = level.split("-")
          if len(minmax) == 1:  # only abs number specified
              minmax = int(minmax[0])
              min_, max_ = (minmax, minmax)
          elif len(minmax) == 2:
              min_, max_ = minmax
              if not min_:  # might be omitted entirely
                  min_ = 0
              if not max_:
                  raise ValueError(
                      "Specify max number at level %d. Full spec was: %s"
                      % (ilevel, spec)
                  )
              min_ = int(min_)
              max_ = int(max_)
          else:
              raise ValueError(
                  "Must have only min-max at level %d" % ilevel
              )
          out.append((min_, max_))
      return out
  
file_path: datalad/datalad/distribution/create_test_dataset.py
imports: import random
  import logging
  import tempfile
  from datalad.utils import get_tempfile_kwargs
  import os
  from os.path import join, exists, isabs, abspath
  from datalad.distribution.dataset import Dataset
  from datalad.support.param import Parameter
  from datalad.support.constraints import EnsureStr, EnsureNone, EnsureInt
  from datalad.support.gitrepo import GitRepo
  from datalad.support.annexrepo import AnnexRepo
  from datalad.interface.base import Interface
  from datalad.interface.base import build_doc
label_desc: Use image node_id 1 for calling a global function with example usage: _parse_spec(spec) and returns: out, out