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.
      """
  
      single_measurement_count = int(setting_values[1])
      desired_classes_count = int(setting_values[2])
      if single_measurement_count < len(self.single_measurements):
          del self.single_measurements[single_measurement_count:]
      while single_measurement_count > len(self.single_measurements):
          self.add_single_measurement(True)
      while desired_classes_count > len(self.desired_classes):
          self.add_single_class(True)
  
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 24 for calling the ClassifyObjects obj's underlying member method code with example usage: obj.prepare_settings(setting_values) without return types