code: def test_map_groups_none() -> None:
      df = pl.DataFrame(
          {
              "g": [1, 1, 1, 2, 2, 2, 5],
              "a": [2, 4, 5, 190, 1, 4, 1],
              "b": [1, 3, 2, 1, 43, 3, 1],
          }
      )
  
      out = (
          df.group_by("g", maintain_order=True).agg(
              pl.map_groups(
                  exprs=["a", pl.col("b") ** 4, pl.col("a") / 4],
                  function=lambda x: x[0] * x[1] + x[2].sum(),
              ).alias("multiple")
          )
      )["multiple"]
      assert out[0].to_list() == [4.75, 326.75, 82.75]
      assert out[1].to_list() == [238.75, 3418849.75, 372.75]
  
      out_df = df.select(
          pl.map_batches(
              exprs=["a", "b"], function=lambda s: s[0] * s[1]
          )
      )
      assert out_df["a"].to_list() == (df["a"] * df["b"]).to_list()
  
      # check if we can return None
      def func(s: Sequence[pl.Series]) -> pl.Series | None:
          if s[0][0] == 190:
              return None
          else:
              return s[0]
  
      out = (
          df.group_by("g", maintain_order=True).agg(
              pl.map_groups(
                  exprs=["a", pl.col("b") ** 4, pl.col("a") / 4],
                  function=func,
              ).alias("multiple")
          )
      )["multiple"]
      assert out[1] is None
  
file_path: polars/py-polars/tests/unit/operations/map/test_map_groups.py
imports: from __future__ import annotations
  from typing import Any, Sequence
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_map_groups_none() and returns: None, s