code: def fetch_df_by_col(
      df: pd.DataFrame, col_set: Union[str, List[str]]
  ) -> pd.DataFrame:
      from .handler import DataHandler  # pylint: disable=C0415
  
      if (
          not isinstance(df.columns, pd.MultiIndex)
          or col_set == DataHandler.CS_RAW
      ):
          return df
      elif col_set == DataHandler.CS_ALL:
          return df.droplevel(axis=1, level=0)
      else:
          return df.loc(axis=1)[col_set]
  
file_path: qlib/qlib/data/dataset/utils.py
imports: from __future__ import annotations
  import pandas
  from typing import Union, List, TYPE_CHECKING
  from qlib.utils import init_instance_by_config
label_desc: Use image node_id 3 for calling a global function with example usage: fetch_df_by_col(df, col_set) and returns: df, df, df