code: def where(df: DataFrame, other: DataFrame):
      if df.shape[0] != other.shape[0]:
          raise ValueError("Row numbers should be identical.")
  
      data_manager = df.data_manager
      other_data_manager = other.data_manager
  
      column_names = data_manager.infer_operable_field_names()
      other_column_names = (
          other_data_manager.infer_operable_field_names()
      )
  
      if (set(column_names) & set(other_column_names)) != set(
          column_names
      ):
          raise ValueError(
              "To use df[mask], mask's columns should contains all df's columns"
          )
  
      if column_names != other_column_names:
          other = other[column_names]
          other_column_names = column_names
  
      false_column_set = _get_false_columns(other)
      if not false_column_set:
          return df
  
      """
      need type promote ?
      """
      need_promoted = False
      for name in column_names:
          bid = data_manager.loc_block(name, with_offset=False)
          if not BlockType.is_float(
              data_manager.get_block(bid).block_type
          ):
              need_promoted = True
              break
  
      if not need_promoted:
          block_table = _where_float_type(
              df.block_table,
              other.block_table,
              data_manager,
              other.data_manager,
              column_names,
          )
          return DataFrame(
              df._ctx,
              block_table,
              df.partition_order_mappings,
              data_manager.duplicate(),
          )
  
file_path: FATE/python/fate/arch/dataframe/ops/_where.py
imports: import numpy
  import torch
  from typing import List
  from .._dataframe import DataFrame
  from ..manager import BlockType
  from ..manager import DataManager
label_desc: Use image node_id 1 for calling a global function with example usage: where(df, other) and returns: df, DataFrame