code: def calc_ic(
      pred: pd.Series,
      label: pd.Series,
      date_col="datetime",
      dropna=False,
  ) -> (pd.Series, pd.Series):
      """calc_ic.
  
      Parameters
      ----------
      pred :
          pred
      label :
          label
      date_col :
          date_col
  
      Returns
      -------
      (pd.Series, pd.Series)
          ic and rank ic
      """
      df = pd.DataFrame({"pred": pred, "label": label})
      ic = df.groupby(date_col).apply(
          lambda df: df["pred"].corr(df["label"])
      )
      ric = df.groupby(date_col).apply(
          lambda df: df["pred"].corr(df["label"], method="spearman")
      )
      if dropna:
          return ic.dropna(), ric.dropna()
      else:
          return ic, ric
  
file_path: qlib/qlib/contrib/eva/alpha.py
imports: import pandas
  from typing import Tuple
  from qlib import get_module_logger
  from qlib.utils.paral import complex_parallel, DelayedDict
  from joblib import Parallel, delayed
label_desc: Use image node_id 5 for calling a global function with example usage: calc_ic(pred, label, date_col, dropna) and returns: ic,  ric, ic,  ric