docstr: Adjust the setting_values of previous revisions to match this one
docstr_tok: ["Adjust","the","setting_values","of","previous","revisions","to","match","this","one"]
code: def upgrade_settings(
      self, setting_values, variable_revision_number, module_name
  ):
      """Adjust the setting_values of previous revisions to match this one"""
      if variable_revision_number == 1:
          new_setting_values = setting_values[:2]
          for i in range(
              2, len(setting_values), FUNCTION_SETTING_COUNT_V1
          ):
              new_setting_values += setting_values[
                  i : i + FUNCTION_SETTING_COUNT_V1
              ]
              new_setting_values += ["3"]
          setting_values = new_setting_values
          variable_revision_number = 2
  
      if variable_revision_number == 2:
          new_setting_values = setting_values[:2]
          for i in range(
              2, len(setting_values), FUNCTION_SETTING_COUNT_V2
          ):
              new_setting_values += setting_values[
                  i : i + FUNCTION_SETTING_COUNT_V2
              ]
              new_setting_values += [
                  "disk",
                  "1",
                  "1",
                  "0",
                  "3",
                  "3",
                  "3,3,111111111",
              ]
          setting_values = new_setting_values
          variable_revision_number = 3
  
      if variable_revision_number == 3:
          new_setting_values = setting_values[:2]
          for i in range(
              2, len(setting_values), FUNCTION_SETTING_COUNT_V3
          ):
              new_setting_values += setting_values[
                  i : i + FUNCTION_SETTING_COUNT_V3
              ]
              new_setting_values += ["Yes"]
          setting_values = new_setting_values
          variable_revision_number = 4
  
      if variable_revision_number == 4:
          functions = setting_values[2::12]
  
          repeats = setting_values[3::12]
  
          repeat_counts = setting_values[4::12]
  
          rescale = setting_values[13::12]
  
          new_setting_values = list(
              sum(
                  list(zip(functions, repeats, repeat_counts, rescale)),
                  (),
              )
          )
  
          setting_values = setting_values[:2] + new_setting_values
  
          variable_revision_number = 5
  
      if variable_revision_number == 5:
          # Removed "life" operation
          LOGGER.warning(
              "Morph's 'Life' option has been removed, this pipeline might "
              "not be compatible with the current version of CellProfiler."
          )
  
          variable_revision_number = 6
  
      return setting_values, variable_revision_number
  
imports: import logging
  import centrosome.cpmorphology
  import centrosome.filter
  import numpy
  import scipy.ndimage
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import SettingsGroup
  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 ImageSubscriber
  from cellprofiler_core.setting.text import ImageName, Integer
label_desc: Use image node_id 9 for calling the Morph 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