code: def test_event_handler_completed_basic_profiler():
      true_event_handler_time = 0.1
      true_max_epochs = 2
      true_num_iters = 2
  
      profiler = BasicTimeProfiler()
      dummy_trainer = Engine(_do_nothing_update_fn)
      profiler.attach(dummy_trainer)
  
      @dummy_trainer.on(Events.COMPLETED)
      def delay_complete(engine):
          time.sleep(true_event_handler_time)
  
      dummy_trainer.run(
          range(true_num_iters), max_epochs=true_max_epochs
      )
      results = profiler.get_results()
      event_results = results["event_handlers_stats"]["COMPLETED"]
  
      assert event_results["total"] == approx(
          true_event_handler_time, abs=1e-1
      )
  
imports: import sys
  import time
  from unittest.mock import patch
  import pytest
  from pytest import approx
  from ignite.engine import Engine, EventEnum, Events
  from ignite.handlers.time_profilers import BasicTimeProfiler, HandlersTimeProfiler
label_desc: Use image node_id 11 for calling a global function with example usage: test_event_handler_completed_basic_profiler() without return types