code: def test_dataframe_aggregate():
      data = pd.DataFrame(np.random.rand(20, 19))
      agg_funcs = [
          "sum",
          "min",
          "max",
          "mean",
          "var",
          "std",
          "all",
          "any",
          "skew",
          "kurt",
          "sem",
      ]
  
      df = from_pandas_df(data)
      result = tile(df.agg(agg_funcs))
      assert len(result.chunks) == 1
      assert result.shape == (len(agg_funcs), data.shape[1])
      assert list(result.columns_value.to_pandas()) == list(range(19))
      assert list(result.index_value.to_pandas()) == agg_funcs
      assert result.op.output_types[0] == OutputType.dataframe
      assert result.op.func == agg_funcs
  
      df = from_pandas_df(data, chunk_size=(3, 4))
  
      result = tile(df.agg("sum"))
      assert len(result.chunks) == 5
      assert result.shape == (data.shape[1],)
      assert list(result.index_value.to_pandas()) == list(
          range(data.shape[1])
      )
      assert result.op.output_types[0] == OutputType.series
      assert result.op.func == ["sum"]
      agg_chunk = result.chunks[0]
      assert agg_chunk.shape == (4,)
      assert list(agg_chunk.index_value.to_pandas()) == list(range(4))
      assert agg_chunk.op.stage == OperandStage.agg
  
      result = tile(df.agg("sum", axis=1))
      assert len(result.chunks) == 7
      assert result.shape == (data.shape[0],)
      assert list(result.index_value.to_pandas()) == list(
          range(data.shape[0])
      )
      assert result.op.output_types[0] == OutputType.series
      agg_chunk = result.chunks[0]
      assert agg_chunk.shape == (3,)
      assert list(agg_chunk.index_value.to_pandas()) == list(range(3))
      assert agg_chunk.op.stage == OperandStage.agg
  
      result = tile(df.agg("var", axis=1))
      assert len(result.chunks) == 7
      assert result.shape == (data.shape[0],)
      assert list(result.index_value.to_pandas()) == list(
          range(data.shape[0])
      )
      assert result.op.output_types[0] == OutputType.series
      assert result.op.func == ["var"]
      agg_chunk = result.chunks[0]
      assert agg_chunk.shape == (3,)
      assert list(agg_chunk.index_value.to_pandas()) == list(range(3))
      assert agg_chunk.op.stage == OperandStage.agg
  
      result = tile(df.agg(agg_funcs))
      assert len(result.chunks) == 5
      assert result.shape == (len(agg_funcs), data.shape[1])
      assert list(result.columns_value.to_pandas()) == list(
          range(data.shape[1])
      )
      assert list(result.index_value.to_pandas()) == agg_funcs
      assert result.op.output_types[0] == OutputType.dataframe
      assert result.op.func == agg_funcs
      agg_chunk = result.chunks[0]
      assert agg_chunk.shape == (len(agg_funcs), 4)
      assert list(agg_chunk.columns_value.to_pandas()) == list(range(4))
      assert list(agg_chunk.index_value.to_pandas()) == agg_funcs
      assert agg_chunk.op.stage == OperandStage.agg
  
      result = tile(df.agg(agg_funcs, axis=1))
      assert len(result.chunks) == 7
      assert result.shape == (data.shape[0], len(agg_funcs))
      assert list(result.columns_value.to_pandas()) == agg_funcs
      assert list(result.index_value.to_pandas()) == list(
          range(data.shape[0])
      )
      assert result.op.output_types[0] == OutputType.dataframe
      assert result.op.func == agg_funcs
      agg_chunk = result.chunks[0]
      assert agg_chunk.shape == (3, len(agg_funcs))
      assert list(agg_chunk.columns_value.to_pandas()) == agg_funcs
      assert list(agg_chunk.index_value.to_pandas()) == list(range(3))
      assert agg_chunk.op.stage == OperandStage.agg
  
      dict_fun = {
          0: "sum",
          2: ["var", "max"],
          9: ["mean", "var", "std"],
      }
      all_cols = set(
          reduce(
              operator.add,
              [
                  [v] if isinstance(v, str) else v
                  for v in dict_fun.values()
              ],
          )
      )
      result = tile(df.agg(dict_fun))
      assert len(result.chunks) == 2
      assert result.shape == (len(all_cols), len(dict_fun))
      assert set(result.columns_value.to_pandas()) == set(
          dict_fun.keys()
      )
      assert set(result.index_value.to_pandas()) == all_cols
      assert result.op.output_types[0] == OutputType.dataframe
      assert result.op.func[0] == [dict_fun[0]]
      assert result.op.func[2] == dict_fun[2]
      agg_chunk = result.chunks[0]
      assert agg_chunk.shape == (len(all_cols), 2)
      assert list(agg_chunk.columns_value.to_pandas()) == [0, 2]
      assert set(agg_chunk.index_value.to_pandas()) == all_cols
      assert agg_chunk.op.stage == OperandStage.agg
  
      with pytest.raises(TypeError):
          df.agg(sum_0="sum", mean_0="mean")
      with pytest.raises(NotImplementedError):
          df.agg(
              {0: ["sum", "min", "var"], 9: ["mean", "var", "std"]},
              axis=1,
          )
  
imports: import functools
  import operator
  from functools import reduce
  from typing import NamedTuple
  import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....core import tile
  from ....core.operand import OperandStage
  from ....tensor import Tensor
  from ...core import DataFrame, IndexValue, Series, OutputType
  from ...datasource.series import from_pandas
  from ...datasource.dataframe import from_pandas
  from ...merge import DataFrameConcat
  from ..None import DataFrameSum, DataFrameProd, DataFrameMin, DataFrameMax, DataFrameCount, DataFrameMean, DataFrameVar, DataFrameAll, DataFrameAny, DataFrameSkew, DataFrameKurtosis, DataFrameSem, DataFrameAggregate, DataFrameCummin, DataFrameCummax, DataFrameCumprod, DataFrameCumsum, DataFrameNunique, CustomReduction
  from ..aggregation import where_function
  from ..core import ReductionCompiler
label_desc: Use image node_id 6 for calling a global function with example usage: test_dataframe_aggregate() without return types