def METHOD_NAME(
    args: argparse.Namespace, command: List[str], exit_on_error: bool = True, **kwargs: Any
) -> Optional[CompletedProcess]:
    if args.verbose or args.dry_run:
        print(shlex.join(command))
    if not args.dry_run or "stdout" in kwargs:
        if args.stack_trace and exit_on_error and not "checks" in kwargs:
            kwargs["check"] = True
        process = subprocess.METHOD_NAME(command, **kwargs)  # nosec
        if exit_on_error and process.returncode != 0:
            print(f"An error occurred during execution of `{shlex.join(command)}`")
            sys.exit(process.returncode)
        return process
    return None