class_docstr: Group the rolling dict
docstr: Given an rolling dict likes {(A,B,R): things}, return the grouped dict likes {(A,B): {R:things}}
  
  NOTE: There is an assumption which is the rolling key is at the end of the key tuple, because the rolling results always need to be ensemble firstly.
  
  Args:
      rolling_dict (dict): an rolling dict. If the key is not a tuple, then do nothing.
  
  Returns:
      dict: grouped dict
code: def group(self, rolling_dict: dict) -> dict:
      """Given an rolling dict likes {(A,B,R): things}, return the grouped dict likes {(A,B): {R:things}}
  
      NOTE: There is an assumption which is the rolling key is at the end of the key tuple, because the rolling results always need to be ensemble firstly.
  
      Args:
          rolling_dict (dict): an rolling dict. If the key is not a tuple, then do nothing.
  
      Returns:
          dict: grouped dict
      """
      grouped_dict = {}
      for key, values in rolling_dict.items():
          if isinstance(key, tuple):
              grouped_dict.setdefault(key[:-1], {})[key[-1]] = values
          else:
              raise TypeError(
                  f"Expected `tuple` type, but got a value `{key}`"
              )
      return grouped_dict
  
file_path: qlib/qlib/model/ens/group.py
imports: from qlib.model.ens.ensemble import Ensemble, RollingEnsemble
  from typing import Callable
  from joblib import Parallel, delayed
label_desc: Use image node_id 1 for calling the RollingGroup obj's underlying member method code with example usage: obj.group(rolling_dict) and returns: grouped_dict