code: def stats(pool=None):
      "return a string containing stats response from the pp.Server"
      server = None if pool is None else __STATE.get(pool._id, tuple())
  
      import io
      import sys
  
      stdout = sys.stdout
      try:
          sys.stdout = result = io.StringIO()
          __print_stats(server)
      except:
          result = None  # XXX: better throw an error?
      sys.stdout = stdout
      result = result.getvalue() if result else ""
      return result
  
imports: from pathos.helpers import parallelpython
  from pathos.helpers import cpu_count
  import builtins
  from pathos.abstract_launcher import AbstractWorkerPool
  from pathos.helpers.pp_helper import ApplyResult, MapResult
label_desc: Use image node_id 2 for calling a global function with example usage: stats(pool) and returns: result