code: def drop(df: "DataFrame", index: "DataFrame" = None) -> "DataFrame":
      if index.shape[0] == 0:
          return DataFrame(
              df._ctx,
              block_table=df.block_table,
              partition_order_mappings=copy.deepcopy(
                  df.partition_order_mappings
              ),
              data_manager=df.data_manager.duplicate(),
          )
  
      if index.shape[0] == df.shape[0]:
          return df.empty_frame()
  
      data_manager = df.data_manager.duplicate()
      l_flatten_func = functools.partial(
          _flatten_partition, block_num=data_manager.block_num
      )
      l_flatten_table = df.block_table.mapPartitions(
          l_flatten_func, use_previous_behavior=False
      )
  
      r_flatten_func = functools.partial(
          _flatten_partition_without_value
      )
      r_flatten_table = index.block_table.mapPartitions(
          r_flatten_func, use_previous_behavior=False
      )
  
      drop_flatten = l_flatten_table.subtractByKey(r_flatten_table)
      partition_order_mappings = (
          get_partition_order_by_raw_table(
              drop_flatten, data_manager.block_row_size
          )
          if drop_flatten.count()
          else dict()
      )
  
      _convert_to_block_func = functools.partial(
          to_blocks,
          dm=data_manager,
          partition_mappings=partition_order_mappings,
      )
  
      block_table = drop_flatten.mapPartitions(
          _convert_to_block_func, use_previous_behavior=False
      )
  
      return DataFrame(
          df._ctx, block_table, partition_order_mappings, data_manager
      )
  
imports: import copy
  import functools
  from typing import List, Union
  import torch
  from sklearn.utils import resample
  from .._dataframe import DataFrame
  from ..manager.data_manager import DataManager
  from ..manager.block_manager import Block
  from ._compress_block import compress_blocks
  from ._indexer import get_partition_order_by_raw_table, get_partition_order_mappings_by_block_table
  from ._promote_types import promote_partial_block_types
  from ._set_item import set_item
  from fate.arch.tensor import DTensor
label_desc: Use image node_id 3 for calling a global function with example usage: drop(df, index) and returns: DataFrame, DataFrame, df