code: def test_force_overwrite():
      with TemporaryDirectory() as out_dir:
          data_path, _, _ = get_fnames("small_25")
          mo_flow = MedianOtsuFlow(output_strategy="absolute")
  
          # Generate the first results
          mo_flow.run(data_path, out_dir=out_dir, vol_idx=[0])
          mask_file = mo_flow.last_generated_outputs["out_mask"]
          first_time = os.path.getmtime(mask_file)
  
          # re-run with no force overwrite, modified time should not change
          mo_flow.run(data_path, out_dir=out_dir)
          mask_file = mo_flow.last_generated_outputs["out_mask"]
          second_time = os.path.getmtime(mask_file)
          assert first_time == second_time
  
          # re-run with force overwrite, modified time should change
          mo_flow = MedianOtsuFlow(
              output_strategy="absolute", force=True
          )
          # Make sure that at least one second elapsed, so that time-stamp is
          # different (sometimes measured in whole seconds)
          time.sleep(1)
          mo_flow.run(data_path, out_dir=out_dir, vol_idx=[0])
          mask_file = mo_flow.last_generated_outputs["out_mask"]
          third_time = os.path.getmtime(mask_file)
          assert third_time != second_time
  
file_path: dipy/dipy/workflows/tests/test_workflow.py
imports: import os
  import time
  from os.path import join
  from tempfile import TemporaryDirectory
  import numpy.testing
  from dipy.data import get_fnames
  from dipy.workflows.segment import MedianOtsuFlow
  from dipy.workflows.workflow import Workflow
label_desc: Use image node_id 1 for calling a global function with example usage: test_force_overwrite() without return types