code: def get_dummies(df: "DataFrame", dtype="int32"):
      data_manager = df.data_manager
      block_indexes = data_manager.infer_operable_blocks()
      field_names = data_manager.infer_operable_field_names()
  
      if len(field_names) != 1:
          raise ValueError(
              f"get_dummies only support single column, but {len(field_names)} columns are found."
          )
  
      categories = _get_categories(df.block_table, block_indexes)[0][0]
      dst_field_names = [
          "_".join(map(str, [field_names[0], c])) for c in categories
      ]
      dst_data_manager = data_manager.duplicate()
      dst_data_manager.pop_blocks(block_indexes)
      dst_data_manager.append_columns(
          dst_field_names, block_types=BlockType.get_block_type(dtype)
      )
  
      block_table = _one_hot_encode(
          df.block_table,
          block_indexes,
          dst_data_manager,
          [[categories]],
          dtype=dtype,
      )
  
      return DataFrame(
          df._ctx,
          block_table,
          partition_order_mappings=df.partition_order_mappings,
          data_manager=dst_data_manager,
      )
  
file_path: FATE/python/fate/arch/dataframe/ops/_encoder.py
imports: import functools
  import pandas
  import numpy
  import torch
  from sklearn.preprocessing import OneHotEncoder
  from typing import Union
  from ._compress_block import compress_blocks
  from .._dataframe import DataFrame
  from ..manager import BlockType, DataManager
label_desc: Use image node_id 1 for calling a global function with example usage: get_dummies(df, dtype) and returns: DataFrame