code: def format_qwen(
      messages: List[llama_types.ChatCompletionRequestMessage],
      **kwargs: Any,
  ) -> ChatFormatterResponse:
      _roles = dict(
          user="<|im_start|>user", assistant="<|im_start|>assistant"
      )
      system_message = "You are a helpful assistant."
      system_template = "<|im_start|>system\n{system_message}"
      system_message = system_template.format(
          system_message=system_message
      )
      _messages = _map_roles(messages, _roles)
      _messages.append((_roles["assistant"], None))
      _sep = "<|im_end|>"
      _prompt = _format_chatml(system_message, _messages, _sep)
      _sep2 = "<|endoftext|>"
      return ChatFormatterResponse(prompt=_prompt, stop=_sep2)
  
imports: from __future__ import annotations
  import os
  import json
  import ctypes
  import dataclasses
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Union, Protocol
  import llama_cpp.llama
  import llama_cpp.llama_types
  import llama_cpp.llama_grammar
  from ._utils import suppress_stdout_stderr
label_desc: Use image node_id 20 for calling a global function with example usage: format_qwen(messages) and returns: ChatFormatterResponse