code: def quantize(
      data_path,
      column_description=None,
      pairs=None,
      delimiter="\t",
      has_header=False,
      ignore_csv_quoting=False,
      feature_names=None,
      thread_count=-1,
      ignored_features=None,
      per_float_feature_quantization=None,
      border_count=None,
      max_bin=None,
      feature_border_type=None,
      nan_mode=None,
      input_borders=None,
      task_type=None,
      used_ram_limit=None,
      random_seed=None,
      log_cout=sys.stdout,
      log_cerr=sys.stderr,
      **kwargs,
  ):
      """
      Construct quantized Pool from non-quantized pool stored in file.
      This method does not load whole non-quantized source dataset into memory
      so it can be used for huge datasets that fit in memory only after quantization.
  
      Parameters
      ----------
      data_path : string or pathlib.Path
          Path (with optional scheme) to non-quantized dataset.
  
      column_description : string, [default=None]
          ColumnsDescription parameter.
          There are several columns description types: Label, Categ, Num, Auxiliary, DocId, Weight, Baseline, GroupId, Timestamp.
          All columns are Num as default, it's not necessary to specify
          this type of columns. Default Label column index is 0 (zero).
          If None, Label column is 0 (zero) as default, all data columns are Num as default.
          If string or pathlib.Path, giving the path to the file with ColumnsDescription in column_description format.
  
      pairs : string or pathlib.Path, [default=None]
          Path to the file with pairs description.
  
      has_header : bool, [default=False]
          If True, read column names from first line.
  
      ignore_csv_quoting : bool optional (default=False)
          If True ignore quoting '"'.
  
      feature_names : string or pathlib.Path, [default=None]
          Path with scheme for feature names data to load.
  
      thread_count : int, [default=-1]
          Thread count for data processing.
          If -1, then the number of threads is set to the number of CPU cores.
  
      ignored_features : list, [default=None]
          Indices or names of features that should be excluded when training.
  
      per_float_feature_quantization : list of strings, [default=None]
          List of float binarization descriptions.
          Format : described in documentation on catboost.ai
          Example 1: ['0:1024'] means that feature 0 will have 1024 borders.
          Example 2: ['0:border_count=1024', '1:border_count=1024', ...] means that two first features have 1024 borders.
          Example 3: ['0:nan_mode=Forbidden,border_count=32,border_type=GreedyLogSum',
                      '1:nan_mode=Forbidden,border_count=32,border_type=GreedyLogSum'] - defines more quantization properties for first two features.
  
      border_count : int, [default = 254 for training on CPU or 128 for training on GPU]
          The number of partitions in numeric features binarization. Used in the preliminary calculation.
          range: [1,65535] on CPU, [1,255] on GPU
  
      max_bin : float, synonym for border_count.
  
      feature_border_type : string, [default='GreedyLogSum']
          The binarization mode in numeric features binarization. Used in the preliminary calculation.
          Possible values:
              - 'Median'
              - 'Uniform'
              - 'UniformAndQuantiles'
              - 'GreedyLogSum'
              - 'MaxLogSum'
              - 'MinEntropy'
  
      nan_mode : string, [default=None]
          Way to process missing values for numeric features.
          Possible values:
              - 'Forbidden' - raises an exception if there is a missing value for a numeric feature in a dataset.
              - 'Min' - each missing value will be processed as the minimum numerical value.
              - 'Max' - each missing value will be processed as the maximum numerical value.
          If None, then nan_mode=Min.
  
      input_borders : string or pathlib.Path, [default=None]
          input file with borders used in numeric features binarization.
  
      task_type : string, [default=None]
          The calcer type used to train the model.
          Possible values:
              - 'CPU'
              - 'GPU'
  
      used_ram_limit=None
  
      random_seed : int, [default=None]
          The random seed used for data sampling.
          If None, 0 is used.
  
      Returns
      -------
      pool : Pool
          Constructed and quantized pool.
      """
      if not data_path:
          raise CatBoostError("Data filename is empty.")
      if not isinstance(data_path, PATH_TYPES):
          raise CatBoostError(
              "Data filename should be string or pathlib.Path type."
          )
  
      if pairs is not None and not isinstance(pairs, PATH_TYPES):
          raise CatBoostError(
              "pairs should have None or string or pathlib.Path type when the pool is read from the file."
          )
      if column_description is not None and not isinstance(
          column_description, PATH_TYPES
      ):
          raise CatBoostError(
              "column_description should have None or string or pathlib.Path type when the pool is read from the file."
          )
      if feature_names is not None and not isinstance(
          feature_names, PATH_TYPES
      ):
          raise CatBoostError(
              "feature_names should have None or string or pathlib.Path type when the pool is read from the file."
          )
  
      params = {}
      _process_synonyms(params)
  
      if border_count is None:
          border_count = max_bin
  
      if "dev_block_size" in kwargs:
          params["dev_block_size"] = kwargs.pop("dev_block_size")
  
      dev_max_subset_size_for_build_borders = kwargs.pop(
          "dev_max_subset_size_for_build_borders", None
      )
  
      if kwargs:
          raise CatBoostError(
              "got an unexpected keyword arguments: {}".format(
                  kwargs.keys()
              )
          )
  
      _update_params_quantize_part(
          params,
          ignored_features,
          per_float_feature_quantization,
          border_count,
          feature_border_type,
          None,  # sparse_features_conflict_fraction
          None,  # dev_efb_max_buckets
          nan_mode,
          input_borders,
          task_type,
          used_ram_limit,
          random_seed,
          dev_max_subset_size_for_build_borders,
      )
  
      pool = Pool(
          data_path,
          column_description=column_description,
          pairs=pairs,
          feature_names=feature_names,
          delimiter=delimiter,
          has_header=has_header,
          ignore_csv_quoting=ignore_csv_quoting,
          thread_count=thread_count,
          log_cout=log_cout,
          log_cerr=log_cerr,
      )
      pool._read(
          data_path,
          column_description,
          pairs,
          feature_names,
          delimiter,
          has_header,
          ignore_csv_quoting,
          thread_count,
          params,
          log_cout=log_cout,
          log_cerr=log_cerr,
      )
  
      return pool
  
imports: from .None import _catboost
  from .core import Pool, CatBoostError, ARRAY_TYPES, PATH_TYPES, fspath, _update_params_quantize_part, _process_synonyms
  from collections import defaultdict
  from contextlib import contextmanager
  import sys
  import numpy
  import warnings
label_desc: Use image node_id 13 for calling a global function with example usage: quantize(data_path, column_description, pairs, delimiter, has_header, ignore_csv_quoting, feature_names, thread_count, ignored_features, per_float_feature_quantization, border_count, max_bin, feature_border_type, nan_mode, input_borders, task_type, used_ram_limit, random_seed, log_cout, log_cerr) and returns: pool