code: def __init__(
      self,
      df: "DataFrame",
      group_type: str,
      grouping_cols: Sequence["Column"],
      pivot_col: Optional["Column"] = None,
      pivot_values: Optional[Sequence["LiteralType"]] = None,
      grouping_sets: Optional[Sequence[Sequence["Column"]]] = None,
  ) -> None:
      from pyspark.sql.connect.dataframe import DataFrame
  
      assert isinstance(df, DataFrame)
      self._df = df
  
      assert isinstance(group_type, str) and group_type in [
          "groupby",
          "rollup",
          "cube",
          "pivot",
          "grouping_sets",
      ]
      self._group_type = group_type
  
      assert isinstance(grouping_cols, list) and all(
          isinstance(g, Column) for g in grouping_cols
      )
      self._grouping_cols: List[Column] = grouping_cols
  
      self._pivot_col: Optional["Column"] = None
      self._pivot_values: Optional[List[Any]] = None
      if group_type == "pivot":
          assert pivot_col is not None and isinstance(pivot_col, Column)
          assert pivot_values is None or isinstance(pivot_values, list)
          self._pivot_col = pivot_col
          self._pivot_values = pivot_values
  
      self._grouping_sets: Optional[Sequence[Sequence["Column"]]] = None
      if group_type == "grouping_sets":
          assert grouping_sets is None or isinstance(
              grouping_sets, list
          )
          self._grouping_sets = grouping_sets
  
imports: from pyspark.sql.connect.utils import check_dependencies
  import warnings
  from typing import Any, Dict, List, Sequence, Union, TYPE_CHECKING, Optional, overload, cast
  from pyspark.rdd import PythonEvalType
  from pyspark.sql.group import GroupedData
  from pyspark.sql.pandas.group_ops import PandasCogroupedOps
  from pyspark.sql.types import NumericType
  from pyspark.sql.types import StructType
  import pyspark.sql.connect.plan
  from pyspark.sql.connect.column import Column
  from pyspark.sql.connect.functions.builtin import _invoke_function, col, lit
  from pyspark.errors import PySparkNotImplementedError, PySparkTypeError
label_desc: Use image node_id 1 to create a new GroupedData object  with example: obj = GroupedData(df, group_type, grouping_cols, pivot_col, pivot_values, grouping_sets)