code: def _set_resource(resource, config, target, start_rid):
      """Update resource allocation in Auptimizer and track resource ID"""
      if resource == "none":
          if config.has_option("Auptimizer", target):
              logger.warning(
                  "Remove conflict resource %s in Auptimizer.", target
              )
              config.remove_option("Auptimizer", target)
      else:
          if os.path.isfile(resource):
              with open(resource, "r") as f:
                  d = f.readlines()
          else:
              d = resource.split(",")
          if len(d) == 0 or d[0] == "":
              logger.critical("No resources for %s", target)
          resources = {}
          for i in d:
              resources[start_rid] = i.strip()
              start_rid += 1
          logger.info(
              "Assign resource %s as %s", target, json.dumps(resources)
          )
          config.set("Auptimizer", target, json.dumps(resources))
      return start_rid
  
file_path: auptimizer/src/aup/setup.py
imports: import json
  import logging
  import os
  from shutil import rmtree
  import sys
  import click
  import coloredlogs
  from six.moves import input
  from six.moves.configparser import ConfigParser
  from .utils import get_default_username, LOG_LEVEL
label_desc: Use image node_id 2 for calling a global function with example usage: _set_resource(resource, config, target, start_rid) and returns: start_rid