docstr: Do any sort of adjustment to the settings required for the given values
  
  setting_values - the values for the settings
  
  This method allows a module to specialize itself according to
  the number of settings and their value. For instance, a module that
  takes a variable number of images or objects can increase or decrease
  the number of relevant settings so they map correctly to the values.
docstr_tok: ["Do","any","sort","of","adjustment","to","the","settings","required","for","the","given","values","setting_values","-","the","values","for","the","settings","This","method","allows","a","module","to","specialize","itself","according","to","the","number","of","settings","and","their","value",".","For","instance",",","a","module","that","takes","a","variable","number","of","images","or","objects","can","increase","or","decrease","the","number","of","relevant","settings","so","they","map","correctly","to","the","values","."]
code: def prepare_settings(self, setting_values):
      """Do any sort of adjustment to the settings required for the given values
  
      setting_values - the values for the settings
  
      This method allows a module to specialize itself according to
      the number of settings and their value. For instance, a module that
      takes a variable number of images or objects can increase or decrease
      the number of relevant settings so they map correctly to the values.
      """
      #
      # Figure out how many images there are based on the number of setting_values
      #
      assert len(setting_values) % SETTINGS_PER_IMAGE == 2
      image_count = len(setting_values) // SETTINGS_PER_IMAGE
      del self.images[image_count:]
      while len(self.images) < image_count:
          self.add_image()
  
imports: import numpy
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Divider, Binary
  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 ImageSubscriber
  from cellprofiler_core.setting.text import ImageName
label_desc: Use image node_id 5 for calling the CorrectIlluminationApply obj's underlying member method code with example usage: obj.prepare_settings(setting_values) without return types