code: def test_cm():
      """[Utils] CMLog: test logging."""
      if psutil is not None and not __version__.startswith("2."):
          cm = utils.CMLog(verbose=True)
  
          with open(os.devnull, "w") as f, redirect_stdout(f):
              cm.monitor(0.3)
  
              while not hasattr(cm, "cpu"):
                  sleep(0.3)
                  cm.collect()
  
          assert len(cm.cpu) == 3
          assert len(cm.rss) == 3
          assert len(cm.vms) == 3
  
          # Check that it overwrites
          with open(os.devnull, "w") as f, redirect_stdout(f):
              cm.monitor(0.2)
  
              while not hasattr(cm, "cpu"):
                  sleep(0.2)
                  cm.collect()
  
          assert len(cm.cpu) == 2
          assert len(cm.rss) == 2
          assert len(cm.vms) == 2
  
imports: from __future__ import division
  import os
  import numpy
  import sysconfig
  import subprocess
  from mlens import config
  from mlens.utils import utils
  from mlens.utils.exceptions import ParallelProcessingError
  from time import sleep
label_desc: Use image node_id 5 for calling a global function with example usage: test_cm() without return types