code: def get_test_data(ngroups=8, n=50):
      unique_groups = list(range(ngroups))
      arr = np.asarray(np.tile(unique_groups, n // ngroups))
  
      if len(arr) < n:
          arr = np.asarray(list(arr) + unique_groups[: n - len(arr)])
  
      np.random.default_rng(2).shuffle(arr)
      return arr
  
imports: import re
  import numpy
  import pytest
  import pandas.util._test_decorators
  import pandas
  from pandas import Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, bdate_range, concat, merge, option_context
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: get_test_data(ngroups, n) and returns: arr