code: def register_task(
      cls,
      task_type: TaskType,
      query_request: Type[ServiceRecordsQuery],
      record_class: Type[ServiceRecord],
      dataset_class: Optional[Type[ServiceDataset]] = None,
      metrics: Optional[Type[ServiceBaseTaskMetrics]] = None,
  ):
      cls.__REGISTERED_TASKS__[task_type] = TaskConfig(
          task=task_type,
          dataset=dataset_class or ServiceBaseDataset,
          query=query_request,
          record=record_class,
          metrics=metrics,
      )
  
imports: from typing import List, Optional, Set, Type
  from argilla.server.commons.models import TaskType
  from argilla.server.errors import EntityNotFoundError, WrongTaskError
  from argilla.server.pydantic_v1 import BaseModel
  from argilla.server.services.datasets import ServiceBaseDataset, ServiceDataset
  from argilla.server.services.metrics import ServiceBaseMetric
  from argilla.server.services.metrics.models import ServiceBaseTaskMetrics
  from argilla.server.services.search.model import ServiceRecordsQuery
  from argilla.server.services.tasks.commons import ServiceRecord
label_desc: Use image node_id 1 for calling the TasksFactory obj's underlying member method code with example usage: obj.register_task(cls, task_type, query_request, record_class, dataset_class, metrics) without return types