code: def create_settings(self):
      # XXX needs to use cps.SettingsGroup
      class Operand(object):
          """Represents the collection of settings needed by each operand"""
  
          def __init__(self, index, operation):
              self.__index = index
              self.__operation = operation
              self.__operand_choice = Choice(
                  self.operand_choice_text(),
                  MC_ALL,
                  doc="""Indicate whether the operand is an image or object measurement.""",
              )
  
              self.__operand_objects = LabelSubscriber(
                  self.operand_objects_text(),
                  "None",
                  doc="""Choose the objects you want to measure for this operation.""",
              )
  
              self.__operand_measurement = Measurement(
                  self.operand_measurement_text(),
                  self.object_fn,
                  doc="""\
  Enter the category that was used to create the measurement. You
  will be prompted to add additional information depending on
  the type of measurement that is requested.""",
              )
  
              self.__multiplicand = Float(
                  "Multiply the above operand by",
                  1,
                  doc="""Enter the number by which you would like to multiply the above operand.""",
              )
  
              self.__exponent = Float(
                  "Raise the power of above operand by",
                  1,
                  doc="""Enter the power by which you would like to raise the above operand.""",
              )
  
          @property
          def operand_choice(self):
              """Either MC_IMAGE for image measurements or MC_OBJECT for object"""
              return self.__operand_choice
  
          @property
          def operand_objects(self):
              """Get measurements from these objects"""
              return self.__operand_objects
  
          @property
          def operand_measurement(self):
              """The measurement providing the value of the operand"""
              return self.__operand_measurement
  
          @property
          def multiplicand(self):
              """Premultiply the measurement by this value"""
              return self.__multiplicand
  
          @property
          def exponent(self):
              """Raise the measurement to this power"""
              return self.__exponent
  
          @property
          def object(self):
              """The name of the object for measurement or "Image\" """
              if self.operand_choice == MC_IMAGE:
                  return IMAGE
              else:
                  return self.operand_objects.value
  
          def object_fn(self):
              if self.__operand_choice == MC_IMAGE:
                  return IMAGE
              elif self.__operand_choice == MC_OBJECT:
                  return self.__operand_objects.value
              else:
                  raise NotImplementedError(
                      "Measurement type %s is not supported"
                      % self.__operand_choice.value
                  )
  
          def operand_name(self):
              """A fancy name based on what operation is being performed"""
              if self.__index == 0:
                  return (
                      "first operand"
                      if self.__operation in (O_ADD, O_MULTIPLY)
                      else "minuend"
                      if self.__operation == O_SUBTRACT
                      else "numerator"
                  )
              elif self.__index == 1:
                  return (
                      "second operand"
                      if self.__operation in (O_ADD, O_MULTIPLY)
                      else "subtrahend"
                      if self.__operation == O_SUBTRACT
                      else "denominator"
                  )
  
          def operand_choice_text(self):
              return self.operand_text("Select the %s measurement type")
  
          def operand_objects_text(self):
              return self.operand_text("Select the %s objects")
  
          def operand_text(self, format):
              return format % self.operand_name()
  
          def operand_measurement_text(self):
              return self.operand_text("Select the %s measurement")
  
          def settings(self):
              """The operand settings to be saved in the output file"""
              return [
                  self.operand_choice,
                  self.operand_objects,
                  self.operand_measurement,
                  self.multiplicand,
                  self.exponent,
              ]
  
          def visible_settings(self):
              """The operand settings to be displayed"""
              self.operand_choice.text = self.operand_choice_text()
              self.operand_objects.text = self.operand_objects_text()
              self.operand_measurement.text = (
                  self.operand_measurement_text()
              )
              result = [self.operand_choice]
              result += (
                  [self.operand_objects]
                  if self.operand_choice == MC_OBJECT
                  else []
              )
              result += [
                  self.operand_measurement,
                  self.multiplicand,
                  self.exponent,
              ]
              return result
  
      self.output_feature_name = Alphanumeric(
          "Name the output measurement",
          "Measurement",
          doc="""Enter a name for the measurement calculated by this module.""",
      )
  
      self.operation = Choice(
          "Operation",
          O_ALL,
          doc="""\
  Choose the arithmetic operation you would like to perform. *None* is
  useful if you simply want to select some of the later options in the
  module, such as multiplying or exponentiating your image by a constant.
  """,
      )
  
      self.operands = (
          Operand(0, self.operation),
          Operand(1, self.operation),
      )
  
      self.spacer_1 = Divider(line=True)
  
      self.spacer_2 = Divider(line=True)
  
      self.spacer_3 = Divider(line=True)
  
      self.wants_log = Binary(
          "Take log10 of result?",
          False,
          doc="""Select *Yes* if you want the log (base 10) of the result."""
          % globals(),
      )
  
      self.final_multiplicand = Float(
          "Multiply the result by",
          1,
          doc="""\
  *(Used only for operations other than "None")*
  
  Enter the number by which you would like to multiply the result.
  """,
      )
  
      self.final_exponent = Float(
          "Raise the power of result by",
          1,
          doc="""\
  *(Used only for operations other than "None")*
  
  Enter the power by which you would like to raise the result.
  """,
      )
  
      self.final_addend = Float(
          "Add to the result",
          0,
          doc="""Enter the number you would like to add to the result.""",
      )
  
      self.constrain_lower_bound = Binary(
          "Constrain the result to a lower bound?",
          False,
          doc="""Select *Yes* if you want the result to be constrained to a lower bound."""
          % globals(),
      )
  
      self.lower_bound = Float(
          "Enter the lower bound",
          0,
          doc="""Enter the lower bound of the result here.""",
      )
  
      self.constrain_upper_bound = Binary(
          "Constrain the result to an upper bound?",
          False,
          doc="""Select *Yes* if you want the result to be constrained to an upper bound."""
          % globals(),
      )
  
      self.upper_bound = Float(
          "Enter the upper bound",
          1,
          doc="""Enter the upper bound of the result here.""",
      )
  
      self.rounding = Choice(
          "How should the output value be rounded?",
          ROUNDING,
          doc="""\
  Choose how the values should be rounded- not at all, to a specified number of decimal places, 
  to the next lowest integer ("floor rounding"), or to the next highest integer ("ceiling rounding").
  Note that for rounding to an arbitrary number of decimal places, Python uses "round to even" rounding,
  such that ties round to the nearest even number. Thus, 1.5 and 2.5 both round to to 2 at 0 decimal 
  places, 2.45 rounds to 2.4, 2.451 rounds to 2.5, and 2.55 rounds to 2.6 at 1 decimal place. See the 
  numpy documentation for more information.  
  """,
      )
  
      self.rounding_digit = Integer(
          "Enter how many decimal places the value should be rounded to",
          0,
          doc="""\
  Enter how many decimal places the value should be rounded to. 0 will round to an integer (e.g. 1, 2), 1 to 
  one decimal place (e.g. 0.1, 0.2), -1 to one value before the decimal place (e.g. 10, 20), etc.
  """,
      )
  
imports: import logging
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.constants.measurement import R_FIRST_IMAGE_NUMBER
  from cellprofiler_core.constants.measurement import R_FIRST_OBJECT_NUMBER
  from cellprofiler_core.constants.measurement import R_PARENT
  from cellprofiler_core.constants.measurement import R_SECOND_IMAGE_NUMBER
  from cellprofiler_core.constants.measurement import R_SECOND_OBJECT_NUMBER
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Alphanumeric
  from cellprofiler_core.setting.text import Float
  from cellprofiler_core.setting.text import Integer
label_desc: Use image node_id 1 for calling the CalculateMath obj's underlying member method code with example usage: obj.create_settings() and returns: self, self, self, self, self, self, self, unknown, self, list, result, IMAGE, self, IMAGE, unknown, self, unknown