code: def predict(
      ctx,
      input_model,
      test_data,
      test_output_data,
      role,
      transform_method,
      skip_metrics,
  ):
      sub_ctx = ctx.sub_ctx("predict")
      model = input_model.read()
      if role.is_guest:
          binning = HeteroBinningModuleGuest.from_model(model)
      elif role.is_host:
          binning = HeteroBinningModuleHost.from_model(model)
      # model_meta = model["meta_data"]
      else:
          raise ValueError(f"unknown role: {role}")
  
      binning.set_transform_method(transform_method)
      test_data = test_data.read()
      if skip_metrics and transform_method is None:
          return test_data
      binned_data = binning._bin_obj.bucketize_data(test_data)
      if not skip_metrics:
          binning.compute_metrics(sub_ctx, binned_data)
      output_data = test_data
      if transform_method is not None:
          output_data = binning.transform(sub_ctx, binned_data)
      test_output_data.write(output_data)
  
file_path: FATE/python/fate/components/components/hetero_feature_binning.py
imports: import logging
  from typing import List
  from fate.arch import Context
  from fate.components.core import GUEST, HOST, Role, cpn, params
  from fate.ml.feature_binning import HeteroBinningModuleHost, HeteroBinningModuleGuest
label_desc: Use image node_id 5 for calling a global function with example usage: predict(ctx, input_model, test_data, test_output_data, role, transform_method, skip_metrics) and returns: test_data