code: def test_duration_function_literal() -> None:
      df = pl.DataFrame(
          {
              "A": ["x", "x", "y", "y", "y"],
              "T": pl.datetime_range(
                  date(2022, 1, 1),
                  date(2022, 5, 1),
                  interval="1mo",
                  eager=True,
              ),
              "S": [1, 2, 4, 8, 16],
          }
      )
  
      result = df.group_by("A", maintain_order=True).agg(
          (pl.col("T").max() + pl.duration(seconds=1)) - pl.col("T")
      )
  
      # this checks if the `pl.duration` is flagged as AggState::Literal
      expected = pl.DataFrame(
          {
              "A": ["x", "y"],
              "T": [
                  [timedelta(days=31, seconds=1), timedelta(seconds=1)],
                  [
                      timedelta(days=61, seconds=1),
                      timedelta(days=30, seconds=1),
                      timedelta(seconds=1),
                  ],
              ],
          }
      )
      assert_frame_equal(result, expected)
  
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING, Any
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_duration_function_literal() without return types