code: def parse_tokenized_to_result(
      result: Dict[str, List[int]],
      current_len: int,
      res: Dict[str, List[int]],
      labels: List[int],
      pad_token_id: Union[int, None] = None,
  ) -> Tuple[Dict[str, List[int]], int]:
      """
      Parses the tokenized prompt and append the tokenized input_ids, attention_mask and labels to the result
      """
  
      input_ids = res["input_ids"]
      input_len = len(input_ids)
      result["input_ids"][
          current_len : current_len + input_len
      ] = input_ids
      result["attention_mask"][
          current_len : current_len + input_len
      ] = [1 if x != pad_token_id else 0 for x in input_ids]
      result["labels"][current_len : current_len + input_len] = labels
      current_len += input_len
  
      return result, current_len
  
imports: import abc
  import copy
  import logging
  from typing import Dict, List, Tuple, Union
  from fastchat.conversation import Conversation
  from transformers import BatchEncoding, PreTrainedTokenizer
  from axolotl.monkeypatch.fastchat_conversation_turns import add_get_turns_to_conversation
  from axolotl.prompters import IGNORE_TOKEN_ID
label_desc: Use image node_id 2 for calling a global function with example usage: parse_tokenized_to_result(result, current_len, res, labels, pad_token_id) and returns: result,  current_len