human
I wrote the below code

    kwargs = {'shell': True, 'cwd': None}
    pids = []
    if out_log:
        out_log_file = open(out_log, 'w')
        kwargs['stdout'] = out_log_file
    if err_log:
        err_log_file = open(err_log, 'w')
        kwargs['stderr'] = err_log_file
    if tasks.environment.dry_run:
        for cmd in cmd_list:
            tasks.environment.info(cmd)
        return
    try:
        for cmd in cmd_list:
            pids.extend([subprocess.Popen(cmd, **kwargs)])
        def _signal_handler(*args):
            '\n                                                What    to    do    when    process    is    ended\n                                                '
            print('\nEnding...')
        signal.signal(signal.SIGINT, _signal_handler)
        print('Enter    CTL-C    to    end')
        signal.pause()
        print('Processes    ending')
    except Exception as err:
        print('Error    running    process    {}'.format(err), file=sys.stderr)
    finally:
        for pid in pids:
            kill_process(pid)

What's a good function header?
 ... Here    to    do    when    process    is    ended\n                                                '?
assistant
#Here    to    do    when    process    is    ended\n                                                '
.

def run_multi_processes(cmd_list, out_log=None, err_log=None):