code: def task_type_infer(predict_result, true_label):
      pred_shape = predict_result.shape
  
      if true_label.max() == 1.0 and true_label.min() == 0.0:
          return consts.BINARY
  
      if (len(pred_shape) > 1) and (pred_shape[1] > 1):
          if np.isclose(
              predict_result.sum(axis=1), np.array([1.0])
          ).all():
              return consts.MULTI
          else:
              return None
      elif (len(pred_shape) == 1) or (pred_shape[1] == 1):
          return consts.REGRESSION
  
      return None
  
imports: import os
  import torch
  import torch
  import logging
  import numpy
  from torch import optim, nn
  import pandas
  from typing import Literal, Type, Callable
  from fate.ml.nn.trainer.trainer_base import TrainingArguments
  from fate.components.core import Role
  from fate.arch import Context
  from typing import Optional, Union
  from transformers.trainer_utils import PredictionOutput
  from fate.arch.dataframe._dataframe import DataFrame
  from fate.components.components.utils import consts
  from torch.optim.lr_scheduler import _LRScheduler
  from fate.ml.utils.predict_tools import to_dist_df, array_to_predict_df
  from fate.ml.utils.predict_tools import BINARY, MULTI, REGRESSION, OTHER, LABEL, PREDICT_SCORE
  from fate.components.components.nn.loader import Loader
label_desc: Use image node_id 2 for calling a global function with example usage: task_type_infer(predict_result, true_label) and returns: None, consts, consts, None, consts