code: def _prepare_data(self, data, data_name):
      if data is None:
          return None
      if isinstance(data, DataFrame) and self.dataset_conf is None:
          logger.info(
              "Input data {} is FATE DataFrame and dataset conf is None, will automatically handle the input data".format(
                  data_name
              )
          )
          if self.task_type == consts.MULTI:
              dataset = TableDataset(
                  flatten_label=True, label_dtype="long", to_tensor=True
              )
          else:
              dataset = TableDataset(to_tensor=True)
          dataset.load(data)
      else:
          dataset = loader_load_from_conf(self.dataset_conf)
          if hasattr(dataset, "load"):
              logger.info("load path is {}".format(data))
              dataset.load(data)
          else:
              raise ValueError(
                  f"The dataset {dataset} lacks a load() method, which is required for data parsing in the DefaultRunner. \
                                  Please implement this method in your dataset class. You can refer to the base class 'Dataset' in 'fate.ml.nn.dataset.base' \
                                  for the necessary interfaces to implement."
              )
      if dataset is not None and not issubclass(type(dataset), Dataset):
          raise TypeError(
              f"SetupReturn Error: {data_name}_set must be a subclass of fate built-in Dataset but got {type(dataset)}, \n"
              f"You can get the class via: from fate.ml.nn.dataset.table import Dataset"
          )
  
      return dataset
  
imports: import torch
  import os
  from fate.components.components.nn.nn_runner import NNRunner, load_model_dict_from_path, dir_warning, loader_load_from_conf, run_dataset_func
  from fate.ml.nn.homo.fedavg import FedAVG, FedAVGArguments, FedAVGClient, FedAVGServer
  from typing import Dict
  from fate.components.components.nn.loader import Loader
  import torch.nn
  import torch.optim
  from torch.optim.lr_scheduler import _LRScheduler
  from fate.ml.nn.trainer.trainer_base import FedArguments, TrainingArguments, HomoTrainerClient, HomoTrainerServer
  from typing import Union, Type, Callable, Optional
  from transformers.trainer_utils import get_last_checkpoint
  from typing import Literal
  import logging
  from fate.components.components.utils import consts
  from fate.ml.nn.dataset.table import TableDataset, Dataset
  from fate.arch.dataframe import DataFrame
label_desc: Use image node_id 2 for calling the DefaultRunner obj's underlying member method code with example usage: obj._prepare_data(data, data_name) and returns: dataset, None