code: def run_monitored(code):
      """
      Run code in a new Python process, and monitor peak memory usage.
  
      Returns
      -------
      duration : float
          Duration in seconds (including Python startup time)
      peak_memusage : float or int
          Peak memory usage (rough estimate only) in bytes
  
      """
  
      if hasattr(os, "wait4"):
          return run_monitored_wait4(code)
      else:
          return run_monitored_proc(code)
  
imports: import sys
  import os
  import re
  import time
  import textwrap
  import subprocess
  import itertools
  import random
label_desc: Use image node_id 5 for calling a global function with example usage: run_monitored(code) and returns: run_monitored_wait4, run_monitored_proc