code: def create_auto_config(
      dataset: Union[str, pd.DataFrame, dd.core.DataFrame, DatasetInfo],
      target: Union[str, List[str]],
      time_limit_s: Union[int, float],
      tune_for_memory: bool = False,
      user_config: Dict = None,
      random_seed: int = default_random_seed,
      imbalance_threshold: float = 0.9,
      use_reference_config: bool = False,
      backend: Union[Backend, str] = None,
  ) -> ModelConfigDict:
      """Returns an auto-generated Ludwig config with the intent of training the best model on given given dataset /
      target in the given time limit.
  
      # Inputs
      :param dataset: (str, pd.DataFrame, dd.core.DataFrame, DatasetInfo) data source to train over.
      :param target: (str, List[str]) name of target feature
      :param time_limit_s: (int, float) total time allocated to auto_train. acts
                           as the stopping parameter
      :param tune_for_memory: (bool) DEPRECATED refine hyperopt search space for available
                              host / GPU memory
      :param user_config: (dict) override automatic selection of specified config items
      :param random_seed: (int, default: `42`) a random seed that will be used anywhere
                          there is a call to a random number generator, including
                          hyperparameter search sampling, as well as data splitting,
                          parameter initialization and training set shuffling
      :param imbalance_threshold: (float) maximum imbalance ratio (minority / majority) to perform stratified sampling
      :param use_reference_config: (bool) refine hyperopt search space by setting first
                                   search point from reference model config, if any
  
      # Return
      :return: (dict) selected model configuration
      """
      backend = initialize_backend(backend)
  
      if not isinstance(dataset, DatasetInfo):
          # preload ludwig datasets
          dataset, _, _, _ = load_dataset_uris(
              dataset, None, None, None, backend
          )
          if isinstance(dataset, CacheableDataset):
              dataset = dataset.unwrap()
          dataset = load_dataset(
              dataset, df_lib=backend.df_engine.df_lib
          )
  
      dataset_info = (
          get_dataset_info(dataset)
          if not isinstance(dataset, DatasetInfo)
          else dataset
      )
      features_config = create_features_config(dataset_info, target)
      return create_automl_config_for_features(
          features_config,
          dataset_info,
          target,
          time_limit_s=time_limit_s,
          user_config=user_config,
          random_seed=random_seed,
          imbalance_threshold=imbalance_threshold,
          use_reference_config=use_reference_config,
          backend=backend,
      )
  
imports: import argparse
  import copy
  import logging
  import os
  import warnings
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  import yaml
  from ludwig.api import LudwigModel
  from ludwig.api_annotations import PublicAPI
  from ludwig.automl.base_config import create_default_config, DatasetInfo, get_dataset_info, get_features_config, get_reference_configs
  from ludwig.backend import Backend, initialize_backend
  from ludwig.constants import AUTO, AUTOML_DEFAULT_IMAGE_ENCODER, AUTOML_DEFAULT_TABULAR_MODEL, AUTOML_DEFAULT_TEXT_ENCODER, BINARY, CATEGORY, ENCODER, HYPEROPT, IMAGE, INPUT_FEATURES, NAME, NUMBER, OUTPUT_FEATURES, TABULAR, TEXT, TRAINER, TYPE
  from ludwig.contrib import add_contrib_callback_args
  from ludwig.data.cache.types import CacheableDataset
  from ludwig.datasets import load_dataset_uris
  from ludwig.globals import LUDWIG_VERSION
  from ludwig.hyperopt.run import hyperopt
  from ludwig.schema.model_config import ModelConfig
  from ludwig.types import ModelConfigDict
  from ludwig.utils.automl.ray_utils import _ray_init
  from ludwig.utils.automl.utils import _add_transfer_config, get_model_type, set_output_feature_metric
  from ludwig.utils.data_utils import load_dataset, use_credentials
  from ludwig.utils.defaults import default_random_seed
  from ludwig.utils.fs_utils import open_file
  from ludwig.utils.heuristics import get_auto_learning_rate
  from ludwig.utils.misc_utils import merge_dict
  from ludwig.utils.print_utils import print_ludwig
label_desc: Use image node_id 2 for calling a global function with example usage: create_auto_config(dataset, target, time_limit_s, tune_for_memory, user_config, random_seed, imbalance_threshold, use_reference_config, backend) and returns: create_automl_config_for_features