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:
          #
          # Some of the wording changed for the failed grid choice
          #
          if setting_values[-1] == "Any Previous":
              setting_values = setting_values[:-1] + [FAIL_ANY_PREVIOUS]
          elif setting_values[-1] == "The First":
              setting_values = setting_values[:-1] + [FAIL_FIRST]
      return setting_values, variable_revision_number
  
imports: import logging
  import centrosome.cpmorphology
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  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.setting import Binary
  from cellprofiler_core.setting import Coordinates
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import GridName
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
  from cellprofiler_core.utilities.grid import Grid
label_desc: Use image node_id 19 for calling the DefineGrid 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