code: def _calc_poses(src_cols, pivots, ascending=True):
      # The pivots are immutable if it is got from shared memory, e.g. Ray object store.
      # Pandas < 1.4 has item setting bug and pandas >= 1.4 has fixed it.
      #
      # Here, almost all the cases that the pivots are got from shared memory.
      #
      # `pivots[col] = -pivots[col]` will automatically replace the col with a new copy
      # `-pivots[col]` in pandas >= 1.4, but it will try to inplace set col in pandas < 1.4
      #
      # So, we use assign here to walk around incorrect inplace set item bug in pandas < 1.4.
      # Please refer to: https://github.com/mars-project/mars/issues/3215
      # related issue: https://github.com/pandas-dev/pandas/pull/43406
      copy_cols = {}
      if isinstance(ascending, list):
          for asc, col in zip(ascending, pivots.columns):
              # Make pivots available to use ascending order when mixed order specified
              if not asc:
                  if pd.api.types.is_numeric_dtype(pivots.dtypes[col]):
                      # for numeric dtypes, convert to negative is more efficient
                      copy_cols[col] = -pivots[col]
                      src_cols[col] = -src_cols[col]
                  else:
                      # for other types, convert to ReversedValue
                      copy_cols[col] = pivots[col].map(
                          lambda x: x
                          if type(x) is _ReversedValue
                          else _ReversedValue(x)
                      )
          ascending = True
  
      if copy_cols:
          pivots = pivots.assign(**copy_cols)
  
      records = src_cols.to_records(index=False)
      p_records = pivots.to_records(index=False)
      if ascending:
          poses = records.searchsorted(p_records, side="right")
      else:
          poses = len(records) - records[::-1].searchsorted(
              p_records, side="right"
          )
      del records, p_records
      return poses
  
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 DataFramePSRSShuffle obj's underlying member method code with example usage: obj._calc_poses(src_cols, pivots, ascending) and returns: poses