docstr: Make sure it's ok to overwrite any existing files before starting run
  
  workspace - workspace with all image sets already populated
  
  returns True if ok to proceed, False if user cancels
docstr_tok: ["Make","sure","it","'s","ok","to","overwrite","any","existing","files","before","starting","run","workspace","-","workspace","with","all","image","sets","already","populated","returns","True","if","ok","to","proceed",",","False","if","user","cancels"]
code: def check_overwrite(self, workspace):
      """Make sure it's ok to overwrite any existing files before starting run
  
      workspace - workspace with all image sets already populated
  
      returns True if ok to proceed, False if user cancels
      """
      if self.wants_overwrite_without_warning:
          return True
  
      files_to_check = []
      if self.wants_everything:
          object_names = {IMAGE, EXPERIMENT, OBJECT_RELATIONSHIPS}
          object_providers = workspace.pipeline.get_provider_dictionary(
              "objectgroup", self
          )
          object_names.update(list(object_providers.keys()))
          metadata_groups = self.get_metadata_groups(workspace)
          for object_name in object_names:
              for metadata_group in metadata_groups:
                  image_number = metadata_group.image_numbers[0]
                  if (
                      object_name == IMAGE
                      and self.wants_genepattern_file
                  ):
                      files_to_check.append(
                          self.make_gct_file_name(
                              workspace, image_number
                          )
                      )
                  files_to_check.append(
                      self.make_objects_file_name(
                          object_name, workspace, image_number
                      )
                  )
      else:
          first_in_file = True
          for i, group in enumerate(self.object_groups):
              if first_in_file:
                  metadata_groups = self.get_metadata_groups(
                      workspace, group
                  )
                  for metadata_group in metadata_groups:
                      image_number = metadata_group.image_numbers[0]
                      files_to_check.append(
                          self.make_objects_file_name(
                              group.name.value,
                              workspace,
                              image_number,
                              group,
                          )
                      )
              #
              # set first_in_file for next time around
              #
              first_in_file = self.last_in_file(i)
  
      files_to_overwrite = list(filter(os.path.isfile, files_to_check))
      if len(files_to_overwrite) > 0:
          if get_headless():
              LOGGER.error(
                  "ExportToSpreadsheet is configured to refrain from overwriting files and the following file(s) already exist: %s"
                  % ", ".join(files_to_overwrite)
              )
              return False
          msg = "Overwrite the following file(s)?\n" + "\n".join(
              files_to_overwrite
          )
          import wx
  
          result = wx.MessageBox(
              msg,
              caption="ExportToSpreadsheet: Overwrite existing files",
              style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION,
          )
          if result != wx.YES:
              return False
  
      return True
  
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 22 for calling the ExportToSpreadsheet obj's underlying member method code with example usage: obj.check_overwrite(workspace) and returns: True, True, False, False