docstr: Construct the correct number of flags
docstr_tok: ["Construct","the","correct","number","of","flags"]
code: def prepare_settings(self, setting_values):
      """Construct the correct number of flags"""
      flag_count = int(setting_values[0])
      del self.flags[:]
      self.add_flag(can_delete=False)
      while len(self.flags) < flag_count:
          self.add_flag()
  
      setting_values = setting_values[N_FIXED_SETTINGS:]
      for flag in self.flags:
          count = int(setting_values[0])
          # Adding a flag adds the first measurement automatically
          while len(flag.measurement_settings) < count:
              self.add_measurement(flag, can_delete=True)
          setting_values = setting_values[
              N_FIXED_SETTINGS_PER_FLAG
              + count * N_SETTINGS_PER_MEASUREMENT :
          ]
  
imports: import logging
  import os
  import numpy
  from cellprofiler_core.constants.measurement import IMAGE, COLTYPE_INTEGER
  from cellprofiler_core.constants.module import IO_FOLDER_CHOICE_HELP_TEXT
  from cellprofiler_core.constants.workspace import DISPOSITION_CONTINUE, DISPOSITION_SKIP
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.preferences import DEFAULT_INPUT_FOLDER_NAME
  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, RemoveSettingButton
  from cellprofiler_core.setting.multichoice import MultiChoice
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Text, Filename, Directory, Float
  from cellprofiler.utilities.rules import Rules
label_desc: Use image node_id 6 for calling the FlagImage obj's underlying member method code with example usage: obj.prepare_settings(setting_values) without return types