code: def _build_sequence_outputs(
      parent_ids: List[int],
      next_token_ids: List[int],
      selected_token_logprobs: List[float],
      parent_seq_ids: List[int],
      parent_logprobs: torch.Tensor,
      num_output_logprobs: Optional[int],
      st_timestamp: Optional[float],
  ) -> List[SequenceOutputs]:
      # Get top-k log probabilities for the next tokens.
      next_logprobs = _get_topk_logprobs(
          parent_logprobs, num_output_logprobs
      )
      seq_outputs: List[SequenceOutputs] = []
      for parent_id, next_token_id, token_logprob in zip(
          parent_ids, next_token_ids, selected_token_logprobs
      ):
          output_logprobs = next_logprobs[parent_id].copy()
          output_logprobs[next_token_id] = token_logprob
          ed_timestamp = time.perf_counter()
          seq_outputs.append(
              SequenceOutputs(
                  parent_seq_ids[parent_id],
                  next_token_id,
                  ed_timestamp - st_timestamp,
                  output_logprobs,
              )
          )
      return seq_outputs
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from bigdl.llm.vllm.model_executor.input_metadata import InputMetadata
  from bigdl.llm.vllm.sampling_params import SamplingParams, SamplingType
  from bigdl.llm.vllm.sequence import SamplerOutput, SequenceGroupMetadata, SequenceData, SequenceOutputs
  import time
label_desc: Use image node_id 9 for calling a global function with example usage: _build_sequence_outputs(parent_ids, next_token_ids, selected_token_logprobs, parent_seq_ids, parent_logprobs, num_output_logprobs, st_timestamp) and returns: seq_outputs