code: def get_to_bin_cols(
      columns,
      anonymous_columns,
      bin_col,
      bin_idx,
      category_col,
      category_idx,
  ):
      if anonymous_columns is not None:
          if bin_col is not None:
              bin_col = [
                  columns[anonymous_columns.index(col)]
                  for col in bin_col
              ]
          if category_col is not None:
              category_col = [
                  columns[anonymous_columns.index(col)]
                  for col in category_col
              ]
  
      if bin_col is not None:
          if bin_idx is not None:
              raise ValueError(
                  f"`bin_col` and `bin_idx` cannot be specified simultaneously, please check."
              )
          select_col = bin_col
      elif bin_idx is not None:
          select_col = [columns[i] for i in bin_idx]
      else:
          select_col = columns
      col_set = set(columns)
      if not all(col in col_set for col in select_col):
          raise ValueError(
              f"Given bin columns not found in data schema, please check."
          )
  
      if category_col is not None:
          if category_idx is not None:
              raise ValueError(
                  f"`category_col` and `category_idx` cannot be specified simultaneously, please check."
              )
      elif category_idx is not None:
          category_col = [columns[i] for i in category_idx]
      else:
          return select_col, []
      if not all(col in col_set for col in category_col):
          raise ValueError(
              f"Given category columns not found in data schema, please check."
          )
      category_col_set = set(category_col)
      select_col = [
          col for col in select_col if col not in category_col_set
      ]
      return select_col, category_col
  
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 6 for calling a global function with example usage: get_to_bin_cols(columns, anonymous_columns, bin_col, bin_idx, category_col, category_idx) and returns: select_col,  category_col, select_col,  list