code: def test_truncate_from_right(self):
      # Create a prompt that exceed max context length: 6 * 342 = 2,052 tokens
      long_prompt: str = self.prompt * 342
      assert not self.window_service.fits_within_context_window(
          long_prompt
      )
  
      # Truncate and ensure it fits within the context window
      truncated_long_prompt: str = (
          self.window_service.truncate_from_right(long_prompt)
      )
      assert (
          self.window_service.get_num_tokens(truncated_long_prompt)
          == self.window_service.max_request_length
      )
      assert self.window_service.fits_within_context_window(
          truncated_long_prompt
      )
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/window_services/test_cohere_window_service.py
imports: import os
  import shutil
  import tempfile
  from typing import List
  from sqlitedict import SqliteDict
  from helm.common.general import ensure_directory_exists
  from .test_cohere_window_service_utils import REQUESTS_TO_RESPONSES, TEST_PROMPT, TOKENIZED_PROMPT
  from .tokenizer_service import TokenizerService
  from .window_service_factory import WindowServiceFactory
  from .test_utils import get_tokenizer_service
label_desc: Use image node_id 9 for calling the TestCohereWindowService obj's underlying member method code with example usage: obj.test_truncate_from_right() without return types