code: def get_config(args):
      """Builds a config dictionary based on supplied `args`."""
      config = {}
      if args.path:
          config["PATH"] = os.path.abspath(
              os.path.expanduser(args.path)
          )
      if args.output:
          config["OUTPUT_PATH"] = os.path.abspath(
              os.path.expanduser(args.output)
          )
      if args.theme:
          abstheme = os.path.abspath(os.path.expanduser(args.theme))
          config["THEME"] = (
              abstheme if os.path.exists(abstheme) else args.theme
          )
      if args.delete_outputdir is not None:
          config["DELETE_OUTPUT_DIRECTORY"] = args.delete_outputdir
      if args.ignore_cache:
          config["LOAD_CONTENT_CACHE"] = False
      if args.cache_path:
          config["CACHE_PATH"] = args.cache_path
      if args.relative_paths:
          config["RELATIVE_URLS"] = args.relative_paths
      if args.port is not None:
          config["PORT"] = args.port
      if args.bind is not None:
          config["BIND"] = args.bind
      config["DEBUG"] = args.verbosity == logging.DEBUG
      config.update(args.overrides)
  
      return config
  
imports: import argparse
  import importlib.metadata
  import json
  import logging
  import multiprocessing
  import os
  import pprint
  import sys
  import time
  import traceback
  from collections.abc import Iterable
  from pkgutil import extend_path
  from pelican.log import console
  from pelican.log import init
  from pelican.generators import ArticlesGenerator, PagesGenerator, SourceFileGenerator, StaticGenerator, TemplatePagesGenerator
  from pelican.plugins import signals
  from pelican.plugins._utils import get_plugin_name, load_plugins
  from pelican.readers import Readers
  from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
  from pelican.settings import read_settings
  from pelican.utils import clean_output_dir, maybe_pluralize, wait_for_changes
  from pelican.writers import Writer
label_desc: Use image node_id 2 for calling a global function with example usage: get_config(args) and returns: config