code: def test_truncate_from_right(self, mock_tokenize):
      # Create a prompt that exceed max context length: 36 * 57 = 2052 tokens.
      # Our naive concatenation of the strings here also leads to extra tokens.
      long_prompt: str = TEST_PROMPT * 57
      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)
          == 2047
      )
      assert self.window_service.fits_within_context_window(
          truncated_long_prompt
      )
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/window_services/test_ai21_window_service.py
imports: import pytest
  from typing import List
  import unittest
  from unittest import mock
  from helm.common.authentication import Authentication
  from helm.common.tokenization_request import TokenizationRequestResult, TokenizationToken, TextRange
  from helm.proxy.services.remote_service import RemoteService
  from .test_utils import TEST_PROMPT
  from .tokenizer_service import TokenizerService
  from .window_service_factory import WindowServiceFactory
label_desc: Use image node_id 6 for calling the TestAI21WindowService obj's underlying member method code with example usage: obj.test_truncate_from_right(mock_tokenize) without return types