code: def test_truncate_sequence():
      # echo_prompt = True, nothing gets truncated
      truncate_sequence_helper(
          ["a", "b", "c"],
          Request(prompt="abc", echo_prompt=True),
          ["a", "b", "c"],
      )
  
      # Nothing gets truncated
      truncate_sequence_helper(
          ["hello", " world"],
          Request(stop_sequences=["#"]),
          ["hello", " world"],
      )
  
      # Truncate using stop sequences
      truncate_sequence_helper(
          ["hello", " world", "\n", "what"],
          Request(stop_sequences=["\n"]),
          ["hello", " world"],
      )
  
      # Truncate using max tokens
      truncate_sequence_helper(
          ["a", "b", "c"], Request(max_tokens=2), ["a", "b"]
      )
  
imports: from .client import truncate_sequence
  from typing import List
  from helm.common.request import Request, Sequence, Token
label_desc: Use image node_id 2 for calling a global function with example usage: test_truncate_sequence() without return types