code: def test_transpose_struct() -> None:
      df = pl.DataFrame(
          {
              "a": ["foo", "bar", "ham"],
              "b": [
                  {"a": date(2022, 1, 1), "b": True},
                  {"a": date(2022, 1, 2), "b": False},
                  {"a": date(2022, 1, 3), "b": False},
              ],
          }
      )
      result = df.transpose()
      expected = pl.DataFrame(
          {
              "column_0": ["foo", "{2022-01-01,true}"],
              "column_1": ["bar", "{2022-01-02,false}"],
              "column_2": ["ham", "{2022-01-03,false}"],
          }
      )
      assert_frame_equal(result, expected)
  
      df = pl.DataFrame(
          {
              "b": [
                  {"a": date(2022, 1, 1), "b": True},
                  {"a": date(2022, 1, 2), "b": False},
                  {"a": date(2022, 1, 3), "b": False},
              ]
          }
      )
      result = df.transpose()
      expected = pl.DataFrame(
          {
              "column_0": [{"a": date(2022, 1, 1), "b": True}],
              "column_1": [{"a": date(2022, 1, 2), "b": False}],
              "column_2": [{"a": date(2022, 1, 3), "b": False}],
          }
      )
      assert_frame_equal(result, expected)
  
file_path: polars/py-polars/tests/unit/operations/test_transpose.py
imports: from datetime import date, datetime
  from typing import Iterator
  import pytest
  import polars
  from polars.exceptions import ComputeError, StringCacheMismatchError
  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_transpose_struct() without return types