code: def add_object_group(self, can_remove=True):
      group = SettingsGroup()
      group.append(
          "name",
          EEObjectNameSubscriber(
              "Data to export",
              doc="""\
  *(Used only when “Export all measurements?” is set to “No”)*
  
  Choose *Image*, *Experiment*, *Object relationships* or an object name
  from the list. **ExportToSpreadsheet** will write out a file of
  measurements for the given category. See *{naming_help}*
  for more details on the various measurement types.""".format(
                  naming_help=MEASUREMENT_NAMING_HELP
              ),
          ),
      )
  
      group.append(
          "previous_file",
          Binary(
              "Combine these object measurements with those of the previous object?",
              False,
              doc="""\
  *(Used only when “Export all measurements?” is set to “No”)*
  
  Select *"Yes"* to create a file composed of measurements made on
  this object and the one directly above it. This can be convenient, for
  example, if you measured Nuclei, Cells, and Cytoplasm objects, and you
  want to look at the measurements for all of them in a single spreadsheet.
  
  Select *"No"* to create separate files for this and the previous
  object.""",
          ),
      )
  
      group.append(
          "wants_automatic_file_name",
          Binary(
              "Use the object name for the file name?",
              True,
              doc="""\
  *(Used only when “Export all measurements?” is set to “No”)*
  
  Select *"Yes"* to use the object name as selected above to generate
  a file name for the spreadsheet. For example, if you selected *Image*
  above and have not checked the "*Prepend output file name*" option, your
  output file will be named “Image.csv”.
  Select *"No"* to name the file yourself.""",
          ),
      )
  
      group.append(
          "file_name",
          Text(
              "File name",
              "DATA.csv",
              metadata=True,
              doc="""\
  *(Used only when “Export all measurements?” is set to “No”)*
  
  Enter a file name for the named objects’ measurements.
  **ExportToSpreadsheet** will prepend the name of the measurements file
  to this if you asked to do so above. If you have metadata associated
  with your images, this setting will also substitute metadata tags if
  desired.
  
  {tags}
  
  {help}
  """.format(
                  tags=USING_METADATA_TAGS_REF,
                  help=USING_METADATA_HELP_REF,
              )
              % globals(),
          ),
      )
  
      group.append(
          "remover",
          RemoveSettingButton(
              "", "Remove this data set", self.object_groups, group
          ),
      )
      group.append("divider", Divider(line=False))
  
      self.object_groups.append(group)
  
imports: import base64
  import csv
  import logging
  import os
  import numpy
  from cellprofiler_core.constants.image import C_MD5_DIGEST, C_SCALING, C_HEIGHT, C_WIDTH
  from cellprofiler_core.constants.measurement import EXPERIMENT, IMAGE, AGG_MEAN, AGG_MEDIAN, AGG_STD_DEV, C_URL, C_PATH_NAME, C_FILE_NAME, NEIGHBORS, R_FIRST_IMAGE_NUMBER, R_SECOND_IMAGE_NUMBER, R_FIRST_OBJECT_NUMBER, R_SECOND_OBJECT_NUMBER
  from cellprofiler_core.constants.module import IO_FOLDER_CHOICE_HELP_TEXT, IO_WITH_METADATA_HELP_TEXT, USING_METADATA_HELP_REF, USING_METADATA_TAGS_REF
  from cellprofiler_core.constants.pipeline import EXIT_STATUS
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.preferences import ABSOLUTE_FOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_INPUT_FOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_INPUT_SUBFOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_FOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_SUBFOLDER_NAME
  from cellprofiler_core.preferences import get_headless
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import CustomChoice, Choice
  from cellprofiler_core.setting.do_something import DoSomething, RemoveSettingButton
  from cellprofiler_core.setting.multichoice import MeasurementMultiChoice
  from cellprofiler_core.setting.subscriber import ImageSubscriber, LabelSubscriber
  from cellprofiler_core.setting.text import Directory, Text
  from cellprofiler_core.utilities.core.modules.load_data import is_file_name_feature, is_path_name_feature
  from cellprofiler_core.utilities.measurement import find_metadata_tokens, get_agg_measurement_name
  from cellprofiler.gui.help.content import MEASUREMENT_NAMING_HELP
label_desc: Use image node_id 2 for calling the ExportToSpreadsheet obj's underlying member method code with example usage: obj.add_object_group(can_remove) without return types