code: def test_customized_aggregator():
      """
      Test customized aggregate
      """
  
      def myAggFunc(df, agg="and"):
          if agg == "and":
              return df.all(axis=1)
          elif agg == "or":
              return df.any(axis=1)
          else:
              raise ValueError("`agg` must be either 'and' or 'or'.")
  
      model = aggt.CustomizedAggregator(myAggFunc)
  
      df = pd.DataFrame(
          [[1, 1], [1, 0], [0, 1], [0, 0]],
          index=pd.date_range(start="2017-1-1", periods=4, freq="D"),
      )
  
      pd.testing.assert_series_equal(
          model.aggregate(df),
          pd.Series([True, False, False, False], index=df.index),
      )
  
      model.aggregate_func_params = {"agg": "or"}
      pd.testing.assert_series_equal(
          model.aggregate(df),
          pd.Series([True, True, True, False], index=df.index),
      )
  
file_path: adtk/tests/test_aggregators.py
imports: import pandas
  from pandas import Timestamp
  import adtk.aggregator
label_desc: Use image node_id 7 for calling a global function with example usage: test_customized_aggregator() and returns: df, df