code: def _calc_perf(self, pred, label):
      df = pd.DataFrame({"pred": pred, "label": label})
      df = df.groupby("datetime").corr(method="spearman")
      corr = df.loc(axis=0)[:, "pred"]["label"].droplevel(
          axis=0, level=-1
      )
      return corr
  
imports: import pandas
  import numpy
  from copy import deepcopy
  from joblib import Parallel, delayed
  from typing import Dict, List, Union, Text, Tuple
  from qlib.data.dataset.utils import init_task_handler
  from qlib.data.dataset import DatasetH
  from qlib.contrib.torch import data_to_tensor
  from qlib.model.meta.task import MetaTask
  from qlib.model.meta.dataset import MetaTaskDataset
  from qlib.model.trainer import TrainerR
  from qlib.log import get_module_logger
  from qlib.utils import auto_filter_kwargs, get_date_by_shift, init_instance_by_config
  from qlib.utils.data import deepcopy_basic_type
  from qlib.workflow import R
  from qlib.workflow.task.gen import RollingGen, task_generator
  from qlib.workflow.task.utils import TimeAdjuster
  from tqdm.auto import tqdm
label_desc: Use image node_id 3 for calling the InternalData obj's underlying member method code with example usage: obj._calc_perf(pred, label) and returns: corr