def xargs(cmd, varargs, **kwargs):
negate = kwargs.pop('<STR_LIT>', False)<EOL>target_concurrency = kwargs.pop('<STR_LIT>', <NUM_LIT:1>)<EOL>max_length = kwargs.pop('<STR_LIT>', _get_platform_max_length())<EOL>retcode = <NUM_LIT:0><EOL>stdout = b'<STR_LIT>'<EOL>stderr = b'<STR_LIT>'<EOL>try:<EOL><INDENT>cmd = parse_shebang.normalize_cmd(cmd)<EOL><DEDENT>except parse_shebang.ExecutableNotFoundError as e:<EOL><INDENT>return e.to_output()<EOL><DEDENT>partitions = partition(cmd, varargs, target_concurrency, max_length)<EOL>def run_cmd_partition(run_cmd):<EOL><INDENT>return cmd_output(*run_cmd, encoding=None, retcode=None, **kwargs)<EOL><DEDENT>threads = min(len(partitions), target_concurrency)<EOL>with _thread_mapper(threads) as thread_map:<EOL><INDENT>results = thread_map(run_cmd_partition, partitions)<EOL>for proc_retcode, proc_out, proc_err in results:<EOL><INDENT>retcode |= bool(proc_retcode) ^ negate<EOL>stdout += proc_out<EOL>stderr += proc_err<EOL><DEDENT><DEDENT>return retcode, stdout, stderr<EOL>
A simplified implementation of xargs.

    negate: Make nonzero successful and zero a failure
    target_concurrency: Target number of partitions to run concurrently