code: def _operate(lhs, rhs, op, block_indexes, rhs_block_id=None):
      block_index_set = set(block_indexes)
      if isinstance(rhs, list):
          op_ret = lhs.mapValues(
              lambda blocks: [
                  op(blocks[bid], rhs[bid])
                  if bid in block_index_set
                  else blocks[bid]
                  for bid in range(len(blocks))
              ]
          )
      elif isinstance(
          rhs,
          (
              bool,
              int,
              float,
              np.int32,
              np.float32,
              np.int64,
              np.float64,
              np.bool_,
          ),
      ):
          op_ret = lhs.mapValues(
              lambda blocks: [
                  op(blocks[bid], rhs)
                  if bid in block_index_set
                  else blocks[bid]
                  for bid in range(len(blocks))
              ]
          )
      elif is_table(rhs):
          op_ret = lhs.join(
              rhs,
              lambda blocks1, blocks2: [
                  op(blocks1[bid], blocks2[rhs_block_id])
                  if bid in block_index_set
                  else blocks1[bid]
                  for bid in range(len(blocks1))
              ],
          )
      else:
          raise ValueError(
              f"Not implement type between dataframe nad {type(rhs)}"
          )
  
      return op_ret
  
file_path: FATE/python/fate/arch/dataframe/ops/_arithmetic.py
imports: import numpy
  import pandas
  from fate.arch.computing.api import is_table
  from .._dataframe import DataFrame
  from ._promote_types import promote_types
  from .utils.series_align import series_to_ndarray
  from .utils.operators import binary_operate
label_desc: Use image node_id 2 for calling a global function with example usage: _operate(lhs, rhs, op, block_indexes, rhs_block_id) and returns: op_ret