human
Here's a good function header given the following:
I wrote the below code

    logger.info('%s', subprocess.list2cmdline(arglist))
    def write_luigi_history(arglist, history):
        "\n                                Writes    history    to    a    file    in    the    job's    output    directory    in    JSON    format.\n                                Currently    just    for    tracking    the    job    ID    in    a    configuration    where\n                                no    history    is    stored    in    the    output    directory    by    Hadoop.\n                                "
        history_filename = configuration.get_config().get('core', 'history-filename', '')
        if (history_filename and ('-output' in arglist)):
            output_dir = arglist[(arglist.index('-output') + 1)]
            f = luigi.contrib.hdfs.HdfsTarget(os.path.join(output_dir, history_filename)).open('w')
            f.write(json.dumps(history))
            f.close()
    def track_process(arglist, tracking_url_callback, env=None):
        temp_stdout = tempfile.TemporaryFile('w+t')
        proc = subprocess.Popen(arglist, stdout=temp_stdout, stderr=subprocess.PIPE, env=env, close_fds=True, universal_newlines=True)
        tracking_url = None
        job_id = None
        application_id = None
        err_lines = []
        with HadoopRunContext() as hadoop_context:
            while (proc.poll() is None):
                err_line = proc.stderr.readline()
                err_lines.append(err_line)
                err_line = err_line.strip()
                if err_line:
                    logger.info('%s', err_line)
                err_line = err_line.lower()
                tracking_url_match = TRACKING_RE.search(err_line)
                if tracking_url_match:
                    tracking_url = tracking_url_match.group('url')
                    try:
                        tracking_url_callback(tracking_url)
                    except Exception as e:
                        logger.error('Error    in    tracking_url_callback,    disabling!    %s', e)
                        def...

What's a good function header?
assistant
#Here's a good function header.

def run_and_track_hadoop_job(arglist, tracking_url_callback=None, env=None):