code: def execute(cls, ctx, op: "GroupBySampleILoc"):
      in_data = ctx[op.inputs[0].key]
      iloc_col = _ILOC_COL_HEADER + str(op.random_col_id)
      weight_col = _WEIGHT_COL_HEADER + str(op.random_col_id)
      if op.stage == OperandStage.map:
          if op.weights is not None:
              ret = pd.DataFrame(
                  {
                      iloc_col: np.arange(
                          op.left_iloc_bound,
                          op.left_iloc_bound + len(in_data),
                      ),
                      weight_col: ctx[op.weights.key],
                  },
                  index=in_data.index,
              )
          else:
              ret = pd.DataFrame(
                  {
                      iloc_col: np.arange(
                          op.left_iloc_bound,
                          op.left_iloc_bound + len(in_data),
                      ),
                  },
                  index=in_data.index,
              )
  
          if isinstance(op.groupby_params["by"], list):
              ret = pd.concat(
                  [in_data[op.groupby_params["by"]], ret], axis=1
              )
  
          ctx[op.outputs[0].key] = ret
      else:
          if weight_col not in in_data.obj.columns:
              weight_col = None
  
          if len(in_data.obj) == 0 or in_data.ngroups == 0:
              ctx[op.outputs[0].key] = np.array([], dtype=np.int_)
          else:
              ctx[op.outputs[0].key] = np.concatenate(
                  [
                      sample_pd[iloc_col].to_numpy()
                      for sample_pd in _sample_groupby_iter(
                          in_data,
                          in_data.obj.index,
                          n=op.size,
                          frac=op.frac,
                          replace=op.replace,
                          weights=weight_col,
                          random_state=op.random_state,
                          errors=op.errors,
                      )
                  ]
              )
  
imports: import copy
  import itertools
  import random
  from collections.abc import Iterable
  from typing import Optional, Sequence, Union
  import numpy
  import pandas
  from ...None import opcodes
  from ...core import ENTITY_TYPE, OutputType, get_output_types, recursive_tile
  from ...core.operand import OperandStage, MapReduceOperand
  from ...serialization.serializables import BoolField, DictField, Float32Field, KeyField, Int32Field, Int64Field, NDArrayField, StringField
  from ...tensor.operands import TensorShuffleProxy
  from ...tensor.random import RandomStateField
  from ...tensor.utils import gen_random_seeds
  from ...utils import has_unknown_shape
  from ..initializer import Series
  from ..operands import DataFrameOperandMixin, DataFrameOperand
  from ..utils import parse_index
label_desc: Use image node_id 6 for calling the GroupBySampleILoc obj's underlying member method code with example usage: obj.execute(cls, ctx, op) without return types