code: def add_function(self, can_remove=True):
      group = MorphSettingsGroup()
      group.can_remove = can_remove
      if can_remove:
          group.append("divider", Divider(line=False))
      group.append(
          "function",
          Choice(
              "Select the operation to perform",
              F_ALL,
              doc="""Choose one of the operations described in this module's help.""",
          ),
      )
  
      group.append(
          "repeats_choice",
          Choice(
              "Number of times to repeat operation",
              R_ALL,
              doc="""\
  This setting controls the number of times that the same operation is
  applied successively to the image.
  
  -  *%(R_ONCE)s:* Perform the operation once on the image.
  -  *%(R_FOREVER)s:* Perform the operation on the image until successive
     iterations yield the same image.
  -  *%(R_CUSTOM)s:* Perform the operation a custom number of times."""
              % globals(),
          ),
      )
  
      group.append(
          "custom_repeats",
          Integer(
              self.CUSTOM_REPEATS_TEXT,
              2,
              1,
              doc=self.CUSTOM_REPEATS_DOC,
          ),
      )
  
      group.append(
          "rescale_values",
          Binary(
              "Rescale values from 0 to 1?",
              True,
              doc="""\
  *(Used only for the "%(F_DISTANCE)s" operation).*
  
  Select "*Yes*" to rescale the transformed values to lie between 0 and
  1. This is the option to use if the distance transformed image is to be
  used for thresholding by an **Identify** module or the like, which
  assumes a 0-1 scaling.
  
  Select "*No*" to leave the values in absolute pixel units. This useful
  in cases where the actual pixel distances are to be used downstream as
  input for a measurement module."""
              % globals(),
          ),
      )
  
      if can_remove:
          group.append(
              "remove",
              RemoveSettingButton(
                  "", "Remove this operation", self.functions, group
              ),
          )
      self.functions.append(group)
  
imports: import logging
  import centrosome.cpmorphology
  import centrosome.filter
  import numpy
  import scipy.ndimage
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import SettingsGroup
  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, Integer
label_desc: Use image node_id 2 for calling the Morph obj's underlying member method code with example usage: obj.add_function(can_remove) without return types