docstr: Adjust setting values if they came from a previous revision
  
  setting_values - a sequence of strings representing the settings
                   for the module as stored in the pipeline
  variable_revision_number - the variable revision number of the
                   module at the time the pipeline was saved. Use this
                   to determine how the incoming setting values map
                   to those of the current module version.
  module_name - the name of the module that did the saving. This can be
                used to import the settings from another module if
                that module was merged into the current module
docstr_tok: ["Adjust","setting","values","if","they","came","from","a","previous","revision","setting_values","-","a","sequence","of","strings","representing","the","settings","for","the","module","as","stored","in","the","pipeline","variable_revision_number","-","the","variable","revision","number","of","the","module","at","the","time","the","pipeline","was","saved",".","Use","this","to","determine","how","the","incoming","setting","values","map","to","those","of","the","current","module","version",".","module_name","-","the","name","of","the","module","that","did","the","saving",".","This","can","be","used","to","import","the","settings","from","another","module","if","that","module","was","merged","into","the","current","module"]
code: def upgrade_settings(
      self, setting_values, variable_revision_number, module_name
  ):
      """Adjust setting values if they came from a previous revision
  
      setting_values - a sequence of strings representing the settings
                       for the module as stored in the pipeline
      variable_revision_number - the variable revision number of the
                       module at the time the pipeline was saved. Use this
                       to determine how the incoming setting values map
                       to those of the current module version.
      module_name - the name of the module that did the saving. This can be
                    used to import the settings from another module if
                    that module was merged into the current module
      """
      if variable_revision_number == 1:
          # we modified this in the code but didn't want to bump the variable revision number.
          if BY_SINGLE_MEASUREMENT in setting_values[0]:
              contrast_choice = BY_SINGLE_MEASUREMENT
          else:
              contrast_choice = BY_TWO_MEASUREMENTS
          #
          # We inserted wants_low_bin and wants_high_bin in each group
          #
          new_setting_values = [contrast_choice, setting_values[1]]
          setting_values = setting_values[2:]
          for i in range(int(new_setting_values[1])):
              new_setting_values += setting_values[:3]
              #
              # Bin count changed: don't count the outer 2 bins
              #
              new_setting_values += [str(int(setting_values[3]) - 2)]
              new_setting_values += [setting_values[4]] + ["Yes"]
              new_setting_values += [setting_values[5]] + ["Yes"]
              new_setting_values += setting_values[6:11]
              setting_values = setting_values[11:]
          new_setting_values += setting_values
          setting_values = new_setting_values
          variable_revision_number = 2
      if variable_revision_number == 2:
          setting_values.insert(2, "1")
          insert_point = int(setting_values[1]) * 13 + 3
          setting_values.insert(insert_point, "None")
          setting_values.insert(insert_point + 1, "ClassifiedObjects")
          setting_values += ["No", "Default Output Folder|None", "None"]
          variable_revision_number = 3
      if variable_revision_number == 3:
          setting_values += [False]
          variable_revision_number = 4
  
      return setting_values, variable_revision_number
  
imports: import functools
  import os
  import numpy
  from cellprofiler.modules import _help
  from cellprofiler.utilities.rules import Rules
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, COLTYPE_VARCHAR, C_COUNT, C_CHILDREN, C_LOCATION, C_NUMBER, C_PARENT, FTR_OBJECT_NUMBER, FTR_CENTER_X, FTR_CENTER_Y, FTR_CENTER_Z
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.object import Objects
  from cellprofiler_core.preferences import get_default_colormap, get_headless
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import HiddenCount
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.do_something import DoSomething
  from cellprofiler_core.setting.do_something import RemoveSettingButton
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Alphanumeric, Directory, Filename, LabelName
  from cellprofiler_core.setting.text import Float
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
  from cellprofiler_core.setting.text import Text
  from cellprofiler_core.constants.measurement import FF_CHILDREN_COUNT
  from cellprofiler_core.constants.measurement import FF_COUNT
  from cellprofiler_core.constants.measurement import FF_PARENT
  from cellprofiler_core.module.image_segmentation import ImageSegmentation
label_desc: Use image node_id 26 for calling the ClassifyObjects obj's underlying member method code with example usage: obj.upgrade_settings(setting_values, variable_revision_number, module_name) and returns: setting_values,  variable_revision_number