code: def local_sort_and_regular_sample(
      cls, op, in_data, axis_chunk_shape, axis_offsets, out_idx
  ):
      # stage 1: local sort and regular samples collected
      sorted_chunks, indices_chunks, sampled_chunks = [], [], []
      for i in range(axis_chunk_shape):
          in_chunk = in_data.chunks[i]
          kind = None if op.psrs_kinds is None else op.psrs_kinds[0]
          chunk_op = DataFramePSRSSortRegularSample(
              kind=kind,
              n_partition=axis_chunk_shape,
              output_types=op.output_types,
              **cls._collect_op_properties(op),
          )
          kws = []
          sort_shape = in_chunk.shape
          kws.append(
              {
                  "shape": sort_shape,
                  "index_value": in_chunk.index_value,
                  "index": in_chunk.index,
              }
          )
          if chunk_op.sort_type == "sort_values":
              sampled_shape = (
                  (axis_chunk_shape, len(op.by))
                  if op.by
                  else (axis_chunk_shape,)
              )
          else:
              sampled_shape = (
                  (axis_chunk_shape, sort_shape[1])
                  if len(sort_shape) == 2
                  else (axis_chunk_shape,)
              )
          kws.append(
              {
                  "shape": sampled_shape,
                  "index_value": in_chunk.index_value,
                  "index": (i,),
                  "type": "regular_sampled",
              }
          )
          if op.outputs[0].ndim == 2:
              kws[0].update(
                  {
                      "columns_value": in_chunk.columns_value,
                      "dtypes": in_chunk.dtypes,
                  }
              )
              kws[1].update(
                  {
                      "columns_value": in_chunk.columns_value,
                      "dtypes": in_chunk.dtypes,
                  }
              )
          else:
              kws[0].update(
                  ({"dtype": in_chunk.dtype, "name": in_chunk.name})
              )
              kws[1].update({"dtype": in_chunk.dtype})
  
          chunks = chunk_op.new_chunks(
              [in_chunk], kws=kws, output_limit=len(kws)
          )
          sort_chunk, sampled_chunk = chunks
          sorted_chunks.append(sort_chunk)
          sampled_chunks.append(sampled_chunk)
      return sorted_chunks, indices_chunks, sampled_chunks
  
imports: import os
  import numpy
  import pandas
  from ...None import opcodes
  from ...core.operand import OperandStage, MapReduceOperand
  from ...utils import lazy_import, calc_nsplits
  from ...serialization.serializables import AnyField, Int32Field, ListField, StringField, BoolField
  from ...tensor.base.psrs import PSRSOperandMixin
  from ..core import IndexValue, OutputType
  from ..utils import standardize_range_index, parse_index, is_cudf
  from ..operands import DataFrameOperandMixin, DataFrameOperand, DataFrameShuffleProxy
label_desc: Use image node_id 2 for calling the DataFramePSRSOperandMixin obj's underlying member method code with example usage: obj.local_sort_and_regular_sample(cls, op, in_data, axis_chunk_shape, axis_offsets, out_idx) and returns: sorted_chunks,  indices_chunks,  sampled_chunks