code: def test_subset_group():
      rank_example_dir = (
          Path(__file__).absolute().parents[2]
          / "examples"
          / "lambdarank"
      )
      X_train, y_train = load_svmlight_file(
          str(rank_example_dir / "rank.train")
      )
      q_train = np.loadtxt(str(rank_example_dir / "rank.train.query"))
      lgb_train = lgb.Dataset(X_train, y_train, group=q_train)
      assert len(lgb_train.get_group()) == 201
      subset = lgb_train.subset(list(range(10))).construct()
      subset_group = subset.get_group()
      assert len(subset_group) == 2
      assert subset_group[0] == 1
      assert subset_group[1] == 9
  
imports: import filecmp
  import numbers
  import re
  from copy import deepcopy
  from os import getenv
  from pathlib import Path
  import numpy
  import pytest
  from scipy import sparse
  from sklearn.datasets import dump_svmlight_file, load_svmlight_file
  from sklearn.model_selection import train_test_split
  import lightgbm
  from lightgbm.compat import PANDAS_INSTALLED, pd_DataFrame, pd_Series
  from .utils import dummy_obj, load_breast_cancer, mse_obj, np_assert_array_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_subset_group() without return types