code: def get_config_from_metadata(
      metadata: List[FieldMetadata], targets: Set[str] = None
  ) -> dict:
      """Builds input/output feature sections of auto-train config using field metadata.
  
      # Inputs
      :param metadata: (List[FieldMetadata]) field descriptions
      :param targets (Set[str]) names of target features
  
      # Return
      :return: (dict) section of auto_train config for input_features and output_features
      """
      config = {
          "input_features": [],
          "output_features": [],
      }
  
      for field_meta in metadata:
          if field_meta.name in targets:
              config["output_features"].append(
                  field_meta.config.to_dict()
              )
          elif not field_meta.excluded and field_meta.mode == "input":
              config["input_features"].append(
                  field_meta.config.to_dict()
              )
  
      return config
  
imports: import logging
  import os
  from dataclasses import dataclass
  from typing import Any, Dict, List, Set, Union
  import dask.dataframe
  import numpy
  import pandas
  import yaml
  from dataclasses_json import dataclass_json, LetterCase
  from tqdm import tqdm
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.backend import Backend
  from ludwig.constants import COLUMN, COMBINER, ENCODER, EXECUTOR, HYPEROPT, INPUT_FEATURES, PREPROCESSING, SCHEDULER, SEARCH_ALG, SPLIT, TEXT, TYPE
  from ludwig.types import ModelConfigDict
  from ludwig.utils.automl.data_source import DataSource, wrap_data_source
  from ludwig.utils.automl.field_info import FieldConfig, FieldInfo, FieldMetadata
  from ludwig.utils.automl.type_inference import infer_type, should_exclude
  from ludwig.utils.data_utils import load_yaml
  from ludwig.utils.misc_utils import merge_dict
  from ludwig.utils.system_utils import Resources
label_desc: Use image node_id 12 for calling a global function with example usage: get_config_from_metadata(metadata, targets) and returns: config