code: def test_describe_with_duplicate_output_column_names(as_index, keys):
      # GH 35314
      df = DataFrame(
          {
              "a1": [99, 99, 99, 88, 88, 88],
              "a2": [99, 99, 99, 88, 88, 88],
              "b": [1, 2, 3, 4, 5, 6],
              "c": [10, 20, 30, 40, 50, 60],
          },
          columns=["a1", "a2", "b", "b"],
          copy=False,
      )
      if keys == ["a1"]:
          df = df.drop(columns="a2")
  
      expected = (
          DataFrame.from_records(
              [
                  ("b", "count", 3.0, 3.0),
                  ("b", "mean", 5.0, 2.0),
                  ("b", "std", 1.0, 1.0),
                  ("b", "min", 4.0, 1.0),
                  ("b", "25%", 4.5, 1.5),
                  ("b", "50%", 5.0, 2.0),
                  ("b", "75%", 5.5, 2.5),
                  ("b", "max", 6.0, 3.0),
                  ("b", "count", 3.0, 3.0),
                  ("b", "mean", 5.0, 2.0),
                  ("b", "std", 1.0, 1.0),
                  ("b", "min", 4.0, 1.0),
                  ("b", "25%", 4.5, 1.5),
                  ("b", "50%", 5.0, 2.0),
                  ("b", "75%", 5.5, 2.5),
                  ("b", "max", 6.0, 3.0),
              ],
          )
          .set_index([0, 1])
          .T
      )
      expected.columns.names = [None, None]
      if len(keys) == 2:
          expected.index = MultiIndex(
              levels=[[88, 99], [88, 99]],
              codes=[[0, 1], [0, 1]],
              names=["a1", "a2"],
          )
      else:
          expected.index = Index([88, 99], name="a1")
  
      if not as_index:
          expected = expected.reset_index()
  
      result = df.groupby(keys, as_index=as_index).describe()
  
      tm.assert_frame_equal(result, expected)
  
file_path: pandas/pandas/tests/groupby/methods/test_describe.py
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 8 for calling a global function with example usage: test_describe_with_duplicate_output_column_names(as_index, keys) without return types