code: def load_config(
      conf_dir="conf/", exclude=None, include=None, validate=True
  ):
      """Load the configuration for StreamAlert.
  
      All configuration files live in the `conf` directory in JSON format.
      `sources` define a colleciton of AWS services (S3, Kinesis) supported as
      inputs to StreamAlert, specific entities (S3 buckets, Kinesis streams),
      and log types emitted from them.
  
      `logs` declare the schema for the listed log types in `sources`.  Each
      key denotes the name of the log type, and includes 'keys' used to match
      rules to log fields.
  
      Args:
          conf_dir (str): [optional] Path from which to load the config
          exclude (set): [optional] Names of config files or folders that should not be loaded
          include (set): [optional] Names of specific config files to only load
          validate (bool): [optional] Validate aspects of the config to check for user error
  
      Raises:
          ConfigError: Raised if errors occur with configuration file loading
  
      Returns:
          dict: Loaded configuration in dictionary form. Example:
              {
                  'clusters': {
                      'prod': <prod.json contents>
                  },
                  'global': <global.json contents>,
                  'lambda': <lambda.json contents>,
                  'logs': <logs.json contents>,
                  'outputs': <outputs.json contents>
              }
      """
      default_files = {
          file
          for file in os.listdir(conf_dir)
          if file.endswith(".json")
      }
      conf_files = (include or default_files).copy()
      include_clusters = TopLevelConfigKeys.CLUSTERS in conf_files
  
      conf_files.intersection_update(default_files)
      exclusions = exclude or set()
      conf_files = conf_files.difference(exclusions)
  
      schemas_dir = os.path.join(conf_dir, TopLevelConfigKeys.SCHEMAS)
      schema_files = []
  
      if (
          os.path.exists(schemas_dir)
          and TopLevelConfigKeys.SCHEMAS not in exclusions
          and (not include or TopLevelConfigKeys.SCHEMAS in include)
      ):
          schema_files = [
              schema_file
              for schema_file in os.listdir(schemas_dir)
              if schema_file.endswith(".json")
          ]
  
      if not (conf_files or include_clusters or schema_files):
          raise ConfigError(
              "No config files to load. The supplied directory could be incorrect or this could "
              "be due the misuse of the 'include' or 'exclude' keyword arguments."
          )
  
      config = defaultdict(dict)
      for name in conf_files:
          path = os.path.join(conf_dir, name)
          # we use object_pairs_hook=OrderdDict to preserve schema order for CSV/KV log types
          config[os.path.splitext(name)[0]] = _load_json_file(
              path, name == "logs.json"
          )
  
      # Load split logs.json configuration
      if "logs.json" not in default_files and schema_files:
          config[TopLevelConfigKeys.LOGS] = _load_schemas(
              schemas_dir, schema_files
          )
  
      # Load the configs for clusters if it is not excluded
      if (
          TopLevelConfigKeys.CLUSTERS not in exclusions
          and not include
          or include_clusters
      ):
          clusters = {
              file
              for file in os.listdir(os.path.join(conf_dir, "clusters"))
              if file.endswith(".json")
          }
          for cluster in clusters:
              cluster_path = os.path.join(
                  conf_dir, TopLevelConfigKeys.CLUSTERS, cluster
              )
              config[TopLevelConfigKeys.CLUSTERS][
                  os.path.splitext(cluster)[0]
              ] = _load_json_file(cluster_path)
  
      if validate:
          _validate_config(config)
  
      return config
  
imports: from collections import defaultdict, OrderedDict
  import json
  import os
  import re
  from streamalert.shared import CLUSTERED_FUNCTIONS
  from streamalert.shared.exceptions import ConfigError
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 7 for calling a global function with example usage: load_config(conf_dir, exclude, include, validate) and returns: config