code: def _set_parallel(resource, cursor, default=1):
      cursor.execute(
          "SELECT COUNT(*) FROM resource WHERE type=?;", (resource,)
      )
      nparallel = cursor.fetchone()[0]
      val = [i for i in range(1, nparallel + 1)]
      nparallel = get_from_options(
          "Number of parallel execution on %s, up to %d"
          % (resource, nparallel),
          val,
          default=default,
      )
  
      return nparallel
  
file_path: auptimizer/src/aup/init.py
imports: import importlib
  import json
  import logging
  import os
  from collections import defaultdict
  import click
  import coloredlogs
  from six.moves import input
  from .Proposer import PROPOSERS
  from .utils import LOG_LEVEL, get_default_connector, DEFAULT_AUPTIMIZER_PATH, get_from_options
label_desc: Use image node_id 3 for calling a global function with example usage: _set_parallel(resource, cursor, default) and returns: nparallel