code: def groupby(
      cls, dataset, dimensions, container_type, group_type, **kwargs
  ):
      index_dims = [
          dataset.get_dimension(d, strict=True) for d in dimensions
      ]
      element_dims = [
          kdim for kdim in dataset.kdims if kdim not in index_dims
      ]
  
      group_kwargs = {}
      if group_type != "raw" and issubclass(group_type, Element):
          group_kwargs = dict(
              util.get_param_values(dataset), kdims=element_dims
          )
      group_kwargs.update(kwargs)
  
      # Propagate dataset
      group_kwargs["dataset"] = dataset.dataset
  
      group_by = [d.name for d in index_dims]
      if len(group_by) == 1 and util.pandas_version >= Version("1.5.0"):
          # Because of this deprecation warning from pandas 1.5.0:
          # In a future version of pandas, a length 1 tuple will be returned
          # when iterating over a groupby with a grouper equal to a list of length 1.
          # Don't supply a list with a single grouper to avoid this warning.
          group_by = group_by[0]
      data = [
          (k, group_type(v, **group_kwargs))
          for k, v in dataset.data.groupby(group_by, sort=False)
      ]
      if issubclass(container_type, NdMapping):
          with item_check(False), sorted_context(False):
              return container_type(data, kdims=index_dims)
      else:
          return container_type(data)
  
imports: import numpy
  import pandas
  from packaging.version import Version
  from pandas.api.types import is_numeric_dtype
  from ..None import util
  from ..dimension import Dimension, dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from .interface import DataError, Interface
  from .util import finite_range
label_desc: Use image node_id 8 for calling the PandasInterface obj's underlying member method code with example usage: obj.groupby(cls, dataset, dimensions, container_type, group_type) and returns: container_type, container_type