code: def test_group_by_shorthands(
      df: pl.DataFrame, method: str, expected: list[tuple[Any]]
  ) -> None:
      gb = df.group_by("b", maintain_order=True)
      result = getattr(gb, method)()
      assert result.rows() == expected
  
      gb_lazy = df.lazy().group_by("b", maintain_order=True)
      result = getattr(gb_lazy, method)().collect()
      assert result.rows() == expected
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from datetime import datetime, timedelta
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_group_by_shorthands(df, method, expected) without return types