text: #
  #  Copyright 2019 The FATE Authors. All Rights Reserved.
  #
  #  Licensed under the Apache License, Version 2.0 (the "License");
  #  you may not use this file except in compliance with the License.
  #  You may obtain a copy of the License at
  #
  #      http://www.apache.org/licenses/LICENSE-2.0
  #
  #  Unless required by applicable law or agreed to in writing, software
  #  distributed under the License is distributed on an "AS IS" BASIS,
  #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  #  See the License for the specific language governing permissions and
  #  limitations under the License.
  #
  
  import argparse
  import os
  import sys
  
  cur_path = os.path.realpath(__file__)
  for i in range(4):
      cur_path = os.path.dirname(cur_path)
  print(f'fate_path: {cur_path}')
  sys.path.append(cur_path)
  
  from examples.pipeline.hetero_feature_binning import common_tools
  from pipeline.utils.tools import load_job_config
  from pipeline.runtime.entity import JobParameters
  
  
  def main(config="../../config.yaml", namespace=""):
      # obtain config
      if isinstance(config, str):
          config = load_job_config(config)
      backend = config.backend
      work_mode = config.work_mode
      param = {
          "name": "hetero_feature_binning_0",
          "method": "quantile",
          "compress_thres": 10000,
          "head_size": 10000,
          "error": 0.001,
          "bin_num": 10,
          "bin_indexes": -1,
          "bin_names": None,
          "category_indexes": None,
          "category_names": None,
          "adjustment_factor": 0.5,
          "local_only": False,
          "transform_param": {
              "transform_cols": -1,
              "transform_names": None,
              "transform_type": "bin_num"
          }
      }
      pipeline = common_tools.make_add_one_hot_dsl(config, namespace, param)
      job_parameters = JobParameters(backend=backend, work_mode=work_mode)
      pipeline.fit(job_parameters)
      # common_tools.prettify(pipeline.get_component("hetero_feature_binning_0").get_summary())
      # summary = pipeline.get_component("hetero_feature_binning_0").get_summary()
      # ivs = {x[0]: x[1] for x in summary["iv"]}
      # common_tools.prettify(ivs)
  
  if __name__ == "__main__":
      parser = argparse.ArgumentParser("PIPELINE DEMO")
      parser.add_argument("-config", type=str,
                          help="config file")
      args = parser.parse_args()
      if args.config is not None:
          main(args.config)
      else:
          main()
  