code: def _parse_hardware(runner_args, config={}):
      resources_needed = {}
      parse_list = ["gpus", "cpus", "ram", "hdd", "gpuMem", "gpuCount"]
      for key in parse_list:
          from_args = runner_args.__dict__.get(key)
          from_config = config.get(key, None)
          if from_args is not None:
              resources_needed[key] = from_args
          elif from_config is not None:
              resources_needed[key] = from_config
  
      return resources_needed
  
imports: import copy
  import sys
  import argparse
  import re
  import os
  import uuid
  import importlib
  import time
  import six
  import numpy
  from studio.credentials.credentials import KEY_CREDENTIALS
  from studio.hyperparameter import HyperparameterParser
  from studio.extra_util import Progbar, rsync_cp
  from studio.experiments.experiment import create_experiment
  from studio.experiment_submitter import submit_experiments
  from studio import model
  from studio import git_util
  from studio import local_worker
  from studio import fs_tracker
  from studio.dependencies_policies.studio_dependencies_policy import StudioDependencyPolicy
  from studio.util import logs, util
label_desc: Use image node_id 7 for calling a global function with example usage: _parse_hardware(runner_args, config) and returns: resources_needed