code: def invert(df: DataFrame):
      data_manager = df.data_manager
      block_indexes = data_manager.infer_operable_blocks()
      for bid in block_indexes:
          if data_manager.blocks[bid] != BlockType.bool:
              raise ValueError(
                  "to use ~df syntax, data types should be bool"
              )
  
      block_table = unary_operate(
          df.block_table, operator.invert, block_indexes
      )
      return type(df)(
          df.ctx,
          block_table,
          df.partition_order_mappings,
          data_manager.duplicate(),
      )
  
imports: import operator
  from .._dataframe import DataFrame
  from ..manager import BlockType
  from .utils.operators import unary_operate
label_desc: Use image node_id 1 for calling a global function with example usage: invert(df) and returns: type