code: def _wrap_results(self, results):
      keys = []
      values = []
      for key, value in compat.iteritems(results):
          keys.extend([key] * len(value))
          values.append(value)
      results = pd.concat(values, axis=0, ignore_index=False)
      if isinstance(results, pd.Series):
          results = ModelSeries(results)
          # keys must be list
          results = results.groupby(by=keys)
      elif isinstance(results, pd.DataFrame):
          results = ModelFrame(results)
          # keys must be Series
          results = results.groupby(by=pd.Series(keys))
      else:
          raise ValueError(
              "Unknown type: {0}".format(results.__class__.__name__)
          )
  
      return results
  
imports: import pandas
  import pandas.compat
  from pandas_ml.compat import Appender
  from pandas_ml.core.base import _BaseEstimator
  from pandas_ml.core.frame import ModelFrame
  from pandas_ml.core.generic import ModelPredictor, _shared_docs
  from pandas_ml.core.series import ModelSeries
label_desc: Use image node_id 6 for calling the ModelFrameGroupBy obj's underlying member method code with example usage: obj._wrap_results(results) and returns: results