class_docstr: CPU and Memory logger.
  
  Class for starting a monitor job of CPU and memory utilization in the
  background in a Python script. The ``monitor`` class records the
  ``cpu_percent``, ``rss`` and ``vms`` as collected by the
  psutil_ library for the parent process' pid.
  
  CPU usage and memory utilization are stored as attributes in numpy arrays.
  
  .. _psutil: https://pypi.python.org/pypi/psutil
  
  Examples
  --------
  >>> from time import sleep
  >>> from mlens.utils.utils import CMLog
  >>> cm = CMLog(verbose=True)
  >>> cm.monitor(2, 0.5)
  >>> _ = [i for i in range(10000000)]
  >>>
  >>> # Collecting before completion triggers a message but no error
  >>> cm._collect()
  >>>
  >>> sleep(2)
  >>> cm._collect()
  >>> print('CPU usage:')
  >>> cm.cpu
  [CMLog] Monitoring for 2 seconds with checks every 0.5 seconds.
  [CMLog] Job not finished. Cannot _collect yet.
  [CMLog] Collecting... done. Read 4 lines in 0.000 seconds.
  CPU usage:
  array([ 50. ,  22.4,   6. ,  11.9])
  
  Raises
  ------
  ImportError :
      Depends on psutil. If not installed, raises ImportError on
      instantiation.
  
  Parameters
  ----------
  verbose : bool
      whether to notify of job start.
code: def __init__(self, verbose=False):
      self.verbose = verbose
      self.pid = os.getpid()
  
      if psutil is None:
          raise ImportError(
              "psutil not installed. Install psutil, for "
              "example through pip (pip install psutil) "
              "before initializing CMLog."
          )
  
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 1 to create a new CMLog object from inherited base classes: object with example: obj = CMLog(verbose)