code: def test_space_encoding(self):
      tokenizer = self.get_tokenizer()
  
      sequence = "Encode this sequence."
      space_encoding = tokenizer.byte_encoder[" ".encode("utf-8")[0]]
  
      # Testing encoder arguments
      encoded = tokenizer.encode(
          sequence, add_special_tokens=False, add_prefix_space=False
      )
      first_char = tokenizer.convert_ids_to_tokens(encoded[0])[0]
      self.assertNotEqual(first_char, space_encoding)
  
      encoded = tokenizer.encode(
          sequence, add_special_tokens=False, add_prefix_space=True
      )
      first_char = tokenizer.convert_ids_to_tokens(encoded[0])[0]
      self.assertEqual(first_char, space_encoding)
  
      tokenizer.add_special_tokens({"bos_token": "<s>"})
      encoded = tokenizer.encode(sequence, add_special_tokens=True)
      first_char = tokenizer.convert_ids_to_tokens(encoded[1])[0]
      self.assertNotEqual(first_char, space_encoding)
  
      # Testing spaces after special tokens
      mask = "<mask>"
      tokenizer.add_special_tokens(
          {"mask_token": AddedToken(mask, lstrip=True, rstrip=False)}
      )  # mask token has a left space
      mask_ind = tokenizer.convert_tokens_to_ids(mask)
  
      sequence = "Encode <mask> sequence"
      sequence_nospace = "Encode <mask>sequence"
  
      encoded = tokenizer.encode(sequence)
      mask_loc = encoded.index(mask_ind)
      first_char = tokenizer.convert_ids_to_tokens(
          encoded[mask_loc + 1]
      )[0]
      self.assertEqual(first_char, space_encoding)
  
      encoded = tokenizer.encode(sequence_nospace)
      mask_loc = encoded.index(mask_ind)
      first_char = tokenizer.convert_ids_to_tokens(
          encoded[mask_loc + 1]
      )[0]
      self.assertNotEqual(first_char, space_encoding)
  
imports: import unittest
  from typing import Tuple
  from transformers import AddedToken, LukeTokenizer
  from transformers.testing_utils import get_tests_dir, require_torch, slow
  from ...test_tokenization_common import TokenizerTesterMixin
label_desc: Use image node_id 7 for calling the LukeTokenizerTest obj's underlying member method code with example usage: obj.test_space_encoding() without return types