code: def test_custom_event_with_arg_handlers_profiler():
      true_event_handler_time = 0.1
      true_max_epochs = 1
      true_num_iters = 2
  
      profiler = HandlersTimeProfiler()
      dummy_trainer = Engine(_do_nothing_update_fn)
      dummy_trainer.register_events("custom_event")
      profiler.attach(dummy_trainer)
  
      @dummy_trainer.on(Events.ITERATION_COMPLETED(every=1))
      def trigger_custom_event():
          dummy_trainer.fire_event("custom_event")
  
      args = [122, 324]
  
      @dummy_trainer.on("custom_event", args)
      def on_custom_event(args):
          time.sleep(true_event_handler_time)
  
      dummy_trainer.run(
          range(true_num_iters), max_epochs=true_max_epochs
      )
      results = profiler.get_results()
      event_results = None
      for row in results:
          if row[1] == "custom_event":
              event_results = row
              break
      assert event_results is not None
      assert "on_custom_event" in event_results[0]
  
      assert event_results[2] == approx(
          true_max_epochs * true_num_iters * true_event_handler_time,
          abs=1e-1,
      )  # total
      assert event_results[3][0] == approx(
          true_event_handler_time, abs=1e-1
      )  # min
      assert event_results[4][0] == approx(
          true_event_handler_time, abs=1e-1
      )  # max
      assert event_results[5] == approx(
          true_event_handler_time, abs=1e-1
      )  # mean
      assert event_results[6] == approx(0.0, 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 27 for calling a global function with example usage: test_custom_event_with_arg_handlers_profiler() without return types