code: def test_map_elements_pass_name() -> None:
      df = pl.DataFrame(
          {
              "bar": [1, 1, 2],
              "foo": [1, 2, 3],
          }
      )
  
      mapper = {"foo": "foo1"}
  
      def element_mapper(s: pl.Series) -> pl.Series:
          return pl.Series([mapper[s.name]])
  
      assert df.group_by("bar", maintain_order=True).agg(
          pl.col("foo").map_elements(element_mapper, pass_name=True),
      ).to_dict(as_series=False) == {
          "bar": [1, 2],
          "foo": [["foo1"], ["foo1"]],
      }
  
imports: from __future__ import annotations
  import json
  from datetime import date, datetime, timedelta
  import numpy
  import pytest
  import polars
  from polars.exceptions import PolarsInefficientMapWarning
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 14 for calling a global function with example usage: test_map_elements_pass_name() and returns: pl