code: def bench_groupby_sample(
      benchmark,
      dataframe,
      num_key_cols,
      use_frac,
      replace,
      target_sample_frac,
  ):
      grouper = dataframe.groupby(
          by=list(dataframe.columns[:num_key_cols])
      )
      if use_frac:
          kwargs = {"frac": target_sample_frac, "replace": replace}
      else:
          minsize = grouper.size().min()
          target_size = numpy.round(
              target_sample_frac * minsize, decimals=0
          ).astype(int)
          kwargs = {"n": target_size, "replace": replace}
  
      benchmark(grouper.sample, **kwargs)
  
imports: import string
  import numpy
  import pytest
  import pytest_cases
  from config import cudf, cupy
  from utils import benchmark_with_object
label_desc: Use image node_id 13 for calling a global function with example usage: bench_groupby_sample(benchmark, dataframe, num_key_cols, use_frac, replace, target_sample_frac) without return types