code: def calculate_scaling_ranges(
      X, col, min_percentile=0.05, max_percentile=0.95
  ):
      series_vals = X[col]
      good_vals_indexes = series_vals.notnull()
  
      series_vals = list(series_vals[good_vals_indexes])
      series_vals = sorted(series_vals)
  
      max_val_idx = int(max_percentile * len(series_vals)) - 1
      min_val_idx = int(min_percentile * len(series_vals))
  
      if len(series_vals) > 0:
          max_val = series_vals[max_val_idx]
          min_val = series_vals[min_val_idx]
      else:
          return "ignore"
  
      if max_val in booleans or min_val in booleans:
          return "pass_on_col"
  
      inner_range = max_val - min_val
  
      if inner_range == 0:
          # Used to do recursion here, which is prettier and uses less code, but since we've already got the filtered and sorted series_vals, it makes sense to use those to avoid duplicate computation
          # Grab the absolute largest max and min vals, and see if there is any difference in them, since our 95th and 5th percentile vals had no difference between them
          max_val = series_vals[len(series_vals) - 1]
          min_val = series_vals[0]
          inner_range = max_val - min_val
  
          if inner_range == 0:
              # If this is a binary field, keep all the values in it, just make sure they're scaled to 1 or 0.
              if max_val == 1:
                  min_val = 0
                  inner_range = 1
              else:
                  # If this is just a column that holds all the same values for everything though, delete the column to save some space
                  return "ignore"
  
      col_summary = {
          "max_val": max_val,
          "min_val": min_val,
          "inner_range": inner_range,
      }
  
      return col_summary
  
file_path: auto_ml/auto_ml/utils_scaling.py
imports: from sklearn.base import BaseEstimator, TransformerMixin
  from auto_ml import utils
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_scaling_ranges(X, col, min_percentile, max_percentile) and returns: col_summary, str, str, str