code: def isin(df: DataFrame, values):
      """
      support types are: scalar、list、series、dict
      note: torch.isin and np.isin does not support nan, so use torch.isnan and np.isnan.
            value type of set and list are not same, e.g.: {1.0}/[1.0] may lead to different result,
                so does ont change to set now
      """
      if isinstance(values, (list, dict, pd.Series)):
          data_manager = df.data_manager
          block_indexes = data_manager.infer_operable_blocks()
          if isinstance(values, pd.Series):
              values = values.to_dict()
          if isinstance(values, dict):
              value_indexers = dict()
              for column_name, in_value in values.items():
                  bid, offset = data_manager.loc_block(column_name)
                  if bid not in value_indexers:
                      value_indexers[bid] = dict()
                  value_indexers[bid][offset] = in_value
              block_table = _isin(
                  df.block_table, value_indexers, block_indexes
              )
          else:
              block_table = _isin(df.block_table, values, block_indexes)
      else:
          raise ValueError(
              f"isin only support type in [list, dict, pandas.Series], but {type(values)} was found"
          )
  
      dst_data_manager = data_manager.duplicate()
      to_promote_types = []
      for bid in block_indexes:
          to_promote_types.append((bid, torch.bool))
  
      dst_data_manager.promote_types(to_promote_types)
      dst_block_table, dst_data_manager = compress_blocks(
          block_table, dst_data_manager
      )
  
      return type(df)(
          df._ctx,
          dst_block_table,
          df.partition_order_mappings,
          dst_data_manager,
      )
  
imports: import numpy
  import pandas
  import torch
  from ._compress_block import compress_blocks
  from .._dataframe import DataFrame
label_desc: Use image node_id 1 for calling a global function with example usage: isin(df, values) and returns: type