code: def _collect_kv_cache_of_idx_in_batch(self, idx):
      # The materialization of the tuple here is important for some reason (TODO: figure out why); Otherwise prediction differ
      return tuple(
          tuple(kv[idx, ...].unsqueeze(0) for kv in layers)
          for layers in self.context.kv_cache["past_key_values"]
      )
  
file_path: serve/test/pytest/test_data/streaming/stream_handler.py
imports: import json
  import logging
  import types
  import torch
  from transformers import AutoModelForCausalLM, AutoTokenizer
  from ts.torch_handler.base_handler import BaseHandler
label_desc: Use image node_id 8 for calling the StreamingHandler obj's underlying member method code with example usage: obj._collect_kv_cache_of_idx_in_batch(idx) and returns: tuple