code: def concat_and_pivot(
      cls, op, axis_chunk_shape, out_idx, sorted_chunks, sampled_chunks
  ):
      from .sort_values import DataFrameSortValues
  
      # stage 2: gather and merge samples, choose and broadcast p-1 pivots
      kind = None if op.psrs_kinds is None else op.psrs_kinds[1]
      if isinstance(op, DataFrameSortValues):
          output_types = op.output_types
      else:
          output_types = [OutputType.index]
      concat_pivot_op = DataFramePSRSConcatPivot(
          kind=kind,
          n_partition=axis_chunk_shape,
          output_types=output_types,
          **cls._collect_op_properties(op),
      )
      concat_pivot_shape = (
          sorted_chunks[0].shape[: op.axis]
          + (axis_chunk_shape - 1,)
          + sorted_chunks[0].shape[op.axis + 1 :]
      )
      concat_pivot_index = (
          out_idx[: op.axis] + (0,) + out_idx[op.axis :]
      )
      concat_pivot_chunk = concat_pivot_op.new_chunk(
          sampled_chunks,
          shape=concat_pivot_shape,
          index=concat_pivot_index,
      )
      return concat_pivot_chunk
  
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 3 for calling the DataFramePSRSOperandMixin obj's underlying member method code with example usage: obj.concat_and_pivot(cls, op, axis_chunk_shape, out_idx, sorted_chunks, sampled_chunks) and returns: concat_pivot_chunk