code: def on_setting_changed(self, setting, pipeline):
      if (
          setting == self.wants_groups
          and self.wants_groups
          and not self.image_sets_initialized
      ):
          workspace = self.workspace
          self.on_deactivated()
          self.on_activated(workspace)
          needs_prepare_run = False
      else:
          needs_prepare_run = True
      #
      # Unfortunately, test_valid has the side effect of getting
      # the choices set which is why it's called here
      #
      is_valid = True
      for group in self.grouping_metadata:
          try:
              group.metadata_choice.test_valid(pipeline)
          except:
              is_valid = False
      if is_valid:
          if needs_prepare_run:
              result = self.prepare_run(
                  self.workspace, changed_setting=True
              )
              if not result:
                  return
          self.update_tables()
  
imports: import numpy
  from ..constants.image import CT_OBJECTS
  from ..constants.measurement import COLTYPE_INTEGER, COLTYPE_VARCHAR, IMAGE
  from ..constants.measurement import C_FILE_NAME
  from ..constants.measurement import C_METADATA
  from ..constants.measurement import C_OBJECTS_FILE_NAME
  from ..constants.measurement import C_OBJECTS_PATH_NAME
  from ..constants.measurement import C_PATH_NAME
  from ..constants.measurement import EXPERIMENT
  from ..constants.measurement import GROUP_INDEX
  from ..constants.measurement import GROUP_NUMBER
  from ..constants.measurement import GROUP_LENGTH
  from ..constants.measurement import M_GROUPING_TAGS
  from ..measurement import Measurements
  from ..module import Module
  from ..pipeline import Pipeline
  from ..setting import Binary
  from ..setting import Divider
  from ..setting import HTMLText
  from ..setting import HiddenCount
  from ..setting import SettingsGroup
  from ..setting import Table
  from ..setting.choice import Choice
  from ..setting.do_something import DoSomething
  from ..setting.do_something import RemoveSettingButton
  from ..utilities.image import image_resource
label_desc: Use image node_id 10 for calling the Groups obj's underlying member method code with example usage: obj.on_setting_changed(setting, pipeline) without return types