code: def test_binary_on_list_agg_3345() -> None:
      df = pl.DataFrame(
          {
              "group": ["A", "A", "A", "B", "B", "B", "B"],
              "id": [1, 2, 1, 4, 5, 4, 6],
          }
      )
  
      assert (
          df.group_by(["group"], maintain_order=True)
          .agg(
              [
                  (
                      (
                          pl.col("id").unique_counts()
                          / pl.col("id").len()
                      ).log()
                      * -1
                      * (
                          pl.col("id").unique_counts()
                          / pl.col("id").len()
                      )
                  ).sum()
              ]
          )
          .to_dict(as_series=False)
      ) == {
          "group": ["A", "B"],
          "id": [0.6365141682948128, 1.0397207708399179],
      }
  
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  from typing import Any
  import numpy
  import pandas
  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_binary_on_list_agg_3345() without return types