docstr: Creates Task from problem name and task_params
docstr_tok: ["Creates","Task","from","problem","name","and","task_params"]
code: def _get_task_with_params(
      self, problem: str, task_params: Optional[TaskParams] = None
  ) -> Task:
      """Creates Task from problem name and task_params"""
      if problem == "ts_forecasting" and task_params is None:
          self.log.warning(
              f"The value of the forecast depth was set to {DEFAULT_FORECAST_LENGTH}."
          )
          task_params = TsForecastingParams(
              forecast_length=DEFAULT_FORECAST_LENGTH
          )
  
      task_dict = {
          "regression": Task(
              TaskTypesEnum.regression, task_params=task_params
          ),
          "classification": Task(
              TaskTypesEnum.classification, task_params=task_params
          ),
          "ts_forecasting": Task(
              TaskTypesEnum.ts_forecasting, task_params=task_params
          ),
      }
      try:
          return task_dict[problem]
      except ValueError:
          ValueError("Wrong type name of the given task")
  
imports: import datetime
  from collections import UserDict
  from copy import deepcopy, copy
  from typing import Any, Dict, Optional, Union
  from golem.core.log import LoggerAdapter, default_log
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from golem.core.optimisers.optimizer import GraphGenerationParams
  from golem.utilities.utilities import determine_n_jobs
  from fedot.api.api_utils.api_params_repository import ApiParamsRepository
  from fedot.api.api_utils.presets import OperationsPreset
  from fedot.core.constants import AUTO_PRESET_NAME, DEFAULT_FORECAST_LENGTH
  from fedot.core.data.data import InputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.pipelines.adapters import PipelineAdapter
  from fedot.core.pipelines.pipeline_advisor import PipelineChangeAdvisor
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from fedot.core.pipelines.pipeline_node_factory import PipelineOptNodeFactory
  from fedot.core.pipelines.verification import rules_by_task
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.pipeline_operation_repository import PipelineOperationRepository
  from fedot.core.repository.tasks import Task, TaskTypesEnum, TaskParams, TsForecastingParams
label_desc: Use image node_id 5 for calling the ApiParams obj's underlying member method code with example usage: obj._get_task_with_params(problem, task_params) and returns: task_dict