code: def get_operations_for_task(
      task: Optional[Task],
      data_type: Optional[DataTypesEnum] = None,
      mode="all",
      tags=None,
      forbidden_tags=None,
      preset: str = None,
  ):
      """Function returns aliases of operations.
  
      Args:
          task: task to solve
          data_type: type of input data
          mode: mode to return operations
  
              .. details:: the possible parameters of ``mode``:
  
                  - ``all`` -> return list with all operations
                  - ``model`` -> return only list with models
                  - ``data_operation`` -> return only list with data_operations
  
          tags: tags for grabbing when filtering
          forbidden_tags: tags for skipping when filtering
          preset: operations from this preset will be obtained
  
      Returns:
          list:  operation aliases
      """
  
      # Preset None means that all operations will be returned
      if preset is not None:
          if (
              BEST_QUALITY_PRESET_NAME in preset
              or AUTO_PRESET_NAME in preset
          ):
              preset = None
  
      task_type = task.task_type if task else None
      if mode in AVAILABLE_REPO_NAMES:
          repo = OperationTypesRepository(mode)
          model_types = repo.suitable_operation(
              task_type,
              data_type=data_type,
              tags=tags,
              forbidden_tags=forbidden_tags,
              preset=preset,
          )
          return model_types
      else:
          raise ValueError(f'Such mode "{mode}" is not supported')
  
imports: import json
  import os
  from collections import defaultdict
  from dataclasses import dataclass
  from typing import Dict, List, Optional, TYPE_CHECKING, Union
  import numpy
  from golem.core.log import default_log
  from golem.utilities.data_structures import ensure_wrapped_in_sequence
  from fedot.core.constants import AUTO_PRESET_NAME, BEST_QUALITY_PRESET_NAME
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.json_evaluation import import_enums_from_str, import_strategy_from_str, read_field
  from fedot.core.repository.tasks import Task, TaskTypesEnum
label_desc: Use image node_id 7 for calling a global function with example usage: get_operations_for_task(task, data_type, mode, tags, forbidden_tags, preset) and returns: model_types