def METHOD_NAME(procs, err_q, out_q, num):
  """
  A function that executes populated processes and processes
  the resultant array. Checks error queue for any exceptions.
  :param procs: list of Process objects
  :param out_q: thread-safe output queue
  :param err_q: thread-safe queue to populate on exception
  :param num : length of resultant array
  """
  # function to terminate processes that are still running.
  die = (lambda vals : [val.terminate() for val in vals
             if val.exitcode is None])
  try:
    for proc in procs:
      proc.start()
    for proc in procs:
      proc.join()
  except Exception as e:
    # kill all slave processes on ctrl-C
    die(procs)
    raise e
  if not err_q.empty():
    # kill all on any exception from any one slave
    die(procs)
    raise err_q.get()
  # Processes finish in arbitrary order. Process IDs double
  # as index in the resultant array.
  results=[None]*num;
  while not out_q.empty():
    idx, result = out_q.get()
    results[idx] = result
  try:
      # Remove extra dimension added by array_split
      return list(numpy.concatenate(results))
  except ValueError:
      return list(results)