code: def test_agg_consistency():
      # agg with ([]) and () not consistent
      # GH 6715
      def P1(a):
          return np.percentile(a.dropna(), q=1)
  
      df = DataFrame(
          {
              "col1": [1, 2, 3, 4],
              "col2": [10, 25, 26, 31],
              "date": [
                  dt.date(2013, 2, 10),
                  dt.date(2013, 2, 10),
                  dt.date(2013, 2, 11),
                  dt.date(2013, 2, 11),
              ],
          }
      )
  
      g = df.groupby("date")
  
      expected = g.agg([P1])
      expected.columns = expected.columns.levels[0]
  
      result = g.agg(P1)
      tm.assert_frame_equal(result, expected)
  
imports: import datetime
  from functools import partial
  import numpy
  import pytest
  from pandas.errors import SpecificationError
  import pandas
  from pandas import DataFrame, Index, MultiIndex, PeriodIndex, Series, date_range, period_range
  import pandas._testing
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 14 for calling a global function with example usage: test_agg_consistency() and returns: np