code: def get_recommended_preset(
      input_data: InputData, input_params: ApiParams, log: LoggerAdapter
  ) -> Dict[str, Optional[str]]:
      """Get appropriate preset for `input_data` and `input_params`."""
      preset = None
  
      if input_params.timeout:
          # since there is enough time for optimization on such amount of data heavy models can be used
          if (
              input_params.timeout >= 60
              and input_data.features.shape[0]
              * input_data.features.shape[1]
              < 300000
          ):
              preset = "best_quality"
  
          # to avoid stagnation due to too long evaluation of one population
          if (
              input_params.timeout < 10
              and input_data.features.shape[0]
              * input_data.features.shape[1]
              > 300000
          ):
              preset = "fast_train"
  
      # to avoid overfitting for small datasets
      if input_data.features.shape[0] < 5000:
          preset = "fast_train"
  
      if preset:
          log.info(f"preset was set to {preset}")
      return {"preset": preset}
  
imports: from golem.core.log import LoggerAdapter
  from typing import Dict, Optional
  from fedot.api.api_utils.params import ApiParams
  from fedot.core.data.data import InputData
label_desc: Use image node_id 2 for calling a global function with example usage: get_recommended_preset(input_data, input_params, log) and returns: dict