code: def test_count():
      n = 1 << 15
      dr = date_range("2015-08-30", periods=n // 10, freq="min")
  
      df = DataFrame(
          {
              "1st": np.random.default_rng(2).choice(
                  list(ascii_lowercase), n
              ),
              "2nd": np.random.default_rng(2).integers(0, 5, n),
              "3rd": np.random.default_rng(2)
              .standard_normal(n)
              .round(3),
              "4th": np.random.default_rng(2).integers(-10, 10, n),
              "5th": np.random.default_rng(2).choice(dr, n),
              "6th": np.random.default_rng(2)
              .standard_normal(n)
              .round(3),
              "7th": np.random.default_rng(2)
              .standard_normal(n)
              .round(3),
              "8th": np.random.default_rng(2).choice(dr, n)
              - np.random.default_rng(2).choice(dr, 1),
              "9th": np.random.default_rng(2).choice(
                  list(ascii_lowercase), n
              ),
          }
      )
  
      for col in df.columns.drop(["1st", "2nd", "4th"]):
          df.loc[
              np.random.default_rng(2).choice(n, n // 10), col
          ] = np.nan
  
      df["9th"] = df["9th"].astype("category")
  
      for key in ["1st", "2nd", ["1st", "2nd"]]:
          left = df.groupby(key).count()
          msg = (
              "DataFrameGroupBy.apply operated on the grouping columns"
          )
          with tm.assert_produces_warning(FutureWarning, match=msg):
              right = (
                  df.groupby(key)
                  .apply(DataFrame.count)
                  .drop(key, axis=1)
              )
          tm.assert_frame_equal(left, right)
  
imports: from itertools import product
  from string import ascii_lowercase
  import numpy
  import pytest
  from pandas import DataFrame, Index, MultiIndex, Period, Series, Timedelta, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 2 for calling a global function with example usage: test_count() without return types