code: def truncate_sequence_helper(
      tokens: List[str], request: Request, expected_tokens: List[str]
  ):
      sequence = Sequence(
          text="".join(tokens),
          tokens=[
              Token(text=text, logprob=-1, top_logprobs={})
              for text in tokens
          ],
          logprob=-len(tokens),
      )
  
      output_sequence = truncate_sequence(sequence, request)
  
      assert expected_tokens == [
          token.text for token in output_sequence.tokens
      ]
      assert "".join(expected_tokens) == output_sequence.text
      assert output_sequence.logprob == sum(
          token.logprob for token in output_sequence.tokens
      )
  
imports: from .client import truncate_sequence
  from typing import List
  from helm.common.request import Request, Sequence, Token
label_desc: Use image node_id 1 for calling a global function with example usage: truncate_sequence_helper(tokens, request, expected_tokens) without return types