code: def _recorder(pid, stop, ival):
      """Subprocess call function to record cpu and memory."""
      t = t0 = time()
  
      process = psutil.Process(pid)
  
      if stop is None:
          while True:
              m = process.memory_info()
              print(psutil.cpu_percent(), ",", m[0], ",", m[1])
              sleep(ival)
              t = time()
      else:
          while t - t0 < stop:
              m = process.memory_info()
              print(psutil.cpu_percent(), ",", m[0], ",", m[1])
              sleep(ival)
              t = time()
  
imports: from __future__ import division, print_function, with_statement
  import os
  import sys
  import warnings
  import subprocess
  from numpy import array
  from ..config import get_ivals
  from .exceptions import ParallelProcessingError, ParallelProcessingWarning
  from time import sleep
label_desc: Use image node_id 9 for calling a global function with example usage: _recorder(pid, stop, ival) without return types