docstr: Initialize graph files
docstr_tok: ["Initialize","graph","files"]
code: def prepare_run(self, workspace):
      """Initialize graph files"""
      if not self.wants_objskeleton_graph:
          return True
      edge_files = set()
      vertex_files = set()
      m = workspace.measurements
      assert isinstance(m, Measurements)
      for image_number in m.get_image_numbers():
          edge_path, vertex_path = self.get_graph_file_paths(
              m, image_number
          )
          edge_files.add(edge_path)
          vertex_files.add(vertex_path)
  
      for file_path, header in (
          (edge_path, self.edge_file_columns),
          (vertex_path, self.vertex_file_columns),
      ):
          if os.path.exists(file_path):
              import wx
  
              if (
                  wx.MessageBox(
                      "%s already exists. Do you want to overwrite it?"
                      % file_path,
                      "Warning: overwriting file",
                      style=wx.YES_NO,
                      parent=workspace.frame,
                  )
                  != wx.YES
              ):
                  return False
              os.remove(file_path)
          with open(file_path, "wt") as fd:
              header = ",".join(header)
              fd.write(header + "\n")
      return True
  
imports: import os
  import centrosome.cpmorphology
  import centrosome.propagate
  import numpy
  import scipy.ndimage
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
  from cellprofiler_core.image import Image
  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_default_colormap
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.subscriber import LabelSubscriber, ImageSubscriber
  from cellprofiler_core.setting.text import ImageName, Directory
  from cellprofiler_core.setting.text import Integer
  from cellprofiler_core.setting.text import Text
  from cellprofiler_core.utilities.core.object import size_similarly
  from centrosome.cpmorphology import fixup_scipy_ndimage_result
  from scipy.ndimage import grey_dilation, grey_erosion
label_desc: Use image node_id 5 for calling the MeasureObjectSkeleton obj's underlying member method code with example usage: obj.prepare_run(workspace) and returns: True, True, False