code: def build_codes(base_estimators, clf_list, ng_clf_list, flag_global):
      """Core function for building codes for deciding whether enable random
      projection and supervised approximation.
  
      Parameters
      ----------
      base_estimators: list, length must be greater than 1
          A list of base estimators. Certain methods must be present, e.g.,
          `fit` and `predict`.
  
      clf_list : list
          The list of outlier detection models to use a certain function. The
          detector name should be consistent with PyOD.
  
      ng_clf_list : list
          The list of outlier detection models to NOT use a certain function. The
          detector name should be consistent with PyOD.
  
      flag_global : bool
          The global flag to override the code build.
  
      Returns
      -------
  
      """
      n_estimators = len(base_estimators)
      base_estimator_names = []
      flags = np.zeros([n_estimators, 1], dtype=int)
  
      for i in range(n_estimators):
          try:
              clf_name = type(base_estimators[i]).__name__
  
          except TypeError:
              print("Unknown detection algorithm.")
              clf_name = "UNK"
  
          if clf_name not in list(clf_idx_mapping):
              # print(clf_name)
              clf_name = "UNK"
          # build the estimator list
          base_estimator_names.append(clf_name)
  
          # check whether the projection is needed
          if clf_name in clf_list:
              flags[i] = 1
          elif clf_name in ng_clf_list:
              continue
          else:
              warnings.warn(
                  "{clf_name} does not have a predefined code. "
                  "Code sets to 0.".format(clf_name=clf_name)
              )
  
      if not flag_global:
          # revert back
          flags = np.zeros([n_estimators, 1], dtype=int)
  
      return flags, base_estimator_names
  
file_path: SUOD/suod/utils/utility.py
imports: import warnings
  import numpy
  import sklearn
  from pyod.models.abod import ABOD
  from pyod.models.hbos import HBOS
  from pyod.models.iforest import IForest
  from pyod.models.knn import KNN
  from pyod.models.lof import LOF
  from pyod.models.lscp import LSCP
  from pyod.models.mcd import MCD
  from pyod.models.ocsvm import OCSVM
  from pyod.models.pca import PCA
  from scipy.special import erf
  from sklearn.preprocessing import MinMaxScaler
label_desc: Use image node_id 2 for calling a global function with example usage: build_codes(base_estimators, clf_list, ng_clf_list, flag_global) and returns: flags,  base_estimator_names