code: def group_factors_by_range(factors_set):
      factors = sorted(list(factors_set))
      is_start = []
      for i in range(0, len(factors)):
          is_start.append(i == 0 or (factors[i] != factors[i - 1] + 1))
  
      grouped_factors = []
      i = 0
      while i < len(factors):
          if is_start[i]:
              grouped_factors.append([])
          grouped_factors[-1].append(factors[i])
          i += 1
      return grouped_factors
  
file_path: catboost/catboost/python-package/catboost/eval/factor_utils.py
imports: from enum import Enum
label_desc: Use image node_id 5 for calling the FactorUtils obj's underlying member method code with example usage: obj.group_factors_by_range(factors_set) and returns: grouped_factors