code: def erroneous_runner(run, n=1, error=Exception):
      counter = Counter()
  
      def wrapped_run(*args, **kwargs):
          counter.checkin()
          if counter.value <= n:
              raise error("Error")
          return run(*args, **kwargs)
  
      yield wrapped_run
  
imports: import contextlib
  import datetime
  import pytest
  import library.python.retry
label_desc: Use image node_id 5 for calling a global function with example usage: erroneous_runner(run, n, error) and returns: run