





import unittest

from transformers import AlbertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
     import torch

     from transformers import (
         MODEL_FOR_PRETRAINING_MAPPING,
         AlbertForMaskedLM,
         AlbertForMultipleChoice,
         AlbertForPreTraining,
         AlbertForQuestionAnswering,
         AlbertForSequenceClassification,
         AlbertForTokenClassification,
         AlbertModel,
     )
     from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST







class 				__lowerCAmelCase       :







      def __init__(    self		,      lowerCAmelCase__		,      lowerCAmelCase__=1_3		,      lowerCAmelCase__=7		,      lowerCAmelCase__=True		,      lowerCAmelCase__=True		,      lowerCAmelCase__=True		,      lowerCAmelCase__=True		,      lowerCAmelCase__=9_9		,      lowerCAmelCase__=1_6		,      lowerCAmelCase__=3_6		,      lowerCAmelCase__=6		,      lowerCAmelCase__=6		,      lowerCAmelCase__=6		,      lowerCAmelCase__=3_7		,      lowerCAmelCase__="gelu"		,      lowerCAmelCase__=0.1		,      lowerCAmelCase__=0.1		,      lowerCAmelCase__=5_1_2		,      lowerCAmelCase__=1_6		,      lowerCAmelCase__=2		,      lowerCAmelCase__=0.02		,      lowerCAmelCase__=3		,      lowerCAmelCase__=4		,      lowerCAmelCase__=None		,      )   ->						List[str]:



        '''simple docstring'''




        a__	:					Optional[Any]										=parent
        a__	:					Any										=batch_size
        a__	:					List[str]										=seq_length
        a__	:					Tuple										=is_training
        a__	:					Any										=use_input_mask
        a__	:					Dict										=use_token_type_ids
        a__	:					str										=use_labels
        a__	:					Optional[Any]										=vocab_size
        a__	:					Any										=embedding_size
        a__	:					Union[str, Any]										=hidden_size
        a__	:					str										=num_hidden_layers
        a__	:					Tuple										=num_hidden_groups
        a__	:					Union[str, Any]										=num_attention_heads
        a__	:					Dict										=intermediate_size
        a__	:					Optional[Any]										=hidden_act
        a__	:					Optional[int]										=hidden_dropout_prob
        a__	:					Optional[Any]										=attention_probs_dropout_prob
        a__	:					Tuple										=max_position_embeddings
        a__	:					Optional[Any]										=type_vocab_size
        a__	:					Optional[Any]										=type_sequence_label_size
        a__	:					Tuple										=initializer_range
        a__	:					List[str]										=num_labels
        a__	:					str										=num_choices
        a__	:					List[Any]										=scope







      def    _lowercase  (    self							)   ->						Any:



        '''simple docstring'''




        a__	:					str										=ids_tensor([self.batch_size, self.seq_length]		,      self.vocab_size							)

        a__	:					List[Any]										=None
        if self.use_input_mask:
          a__	:					List[str]										=random_attention_mask([self.batch_size, self.seq_length]							)

        a__	:					Union[str, Any]										=None
        if self.use_token_type_ids:
          a__	:					Union[str, Any]										=ids_tensor([self.batch_size, self.seq_length]		,      self.type_vocab_size							)

        a__	:					str										=None
        a__	:					Union[str, Any]										=None
        a__	:					Union[str, Any]										=None
        if self.use_labels:
          a__	:					Optional[int]										=ids_tensor([self.batch_size]		,      self.type_sequence_label_size							)
          a__	:					Union[str, Any]										=ids_tensor([self.batch_size, self.seq_length]		,      self.num_labels							)
          a__	:					List[Any]										=ids_tensor([self.batch_size]		,      self.num_choices							)

        a__	:					List[str]										=self.get_config()

        return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







      def    _lowercase  (    self							)   ->						List[Any]:



        '''simple docstring'''




        return AlbertConfig(
            vocab_size=self.vocab_size		,      hidden_size=self.hidden_size		,      num_hidden_layers=self.num_hidden_layers		,      num_attention_heads=self.num_attention_heads		,      intermediate_size=self.intermediate_size		,      hidden_act=self.hidden_act		,      hidden_dropout_prob=self.hidden_dropout_prob		,      attention_probs_dropout_prob=self.attention_probs_dropout_prob		,      max_position_embeddings=self.max_position_embeddings		,      type_vocab_size=self.type_vocab_size		,      initializer_range=self.initializer_range		,      num_hidden_groups=self.num_hidden_groups		,      )







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						str:



        '''simple docstring'''




        a__	:					str										=AlbertModel(config=_a							)
        model.to(_a							)
        model.eval()
        a__	:					Union[str, Any]										=model(_a		,      attention_mask=_a		,      token_type_ids=_a							)
        a__	:					int										=model(_a		,      token_type_ids=_a							)
        a__	:					Any										=model(_a							)
        self.parent.assertEqual(result.last_hidden_state.shape		,      (self.batch_size, self.seq_length, self.hidden_size)							)
        self.parent.assertEqual(result.pooler_output.shape		,      (self.batch_size, self.hidden_size)							)







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						int:



        '''simple docstring'''




        a__	:					Dict										=AlbertForPreTraining(config=_a							)
        model.to(_a							)
        model.eval()
        a__	:					Optional[Any]										=model(
            _a		,      attention_mask=_a		,      token_type_ids=_a		,      labels=_a		,      sentence_order_label=_a		,      )
        self.parent.assertEqual(result.prediction_logits.shape		,      (self.batch_size, self.seq_length, self.vocab_size)							)
        self.parent.assertEqual(result.sop_logits.shape		,      (self.batch_size, config.num_labels)							)







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						Dict:



        '''simple docstring'''




        a__	:					Optional[Any]										=AlbertForMaskedLM(config=_a							)
        model.to(_a							)
        model.eval()
        a__	:					List[Any]										=model(_a		,      attention_mask=_a		,      token_type_ids=_a		,      labels=_a							)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.seq_length, self.vocab_size)							)







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						Optional[Any]:



        '''simple docstring'''




        a__	:					Optional[Any]										=AlbertForQuestionAnswering(config=_a							)
        model.to(_a							)
        model.eval()
        a__	:					List[str]										=model(
            _a		,      attention_mask=_a		,      token_type_ids=_a		,      start_positions=_a		,      end_positions=_a		,      )
        self.parent.assertEqual(result.start_logits.shape		,      (self.batch_size, self.seq_length)							)
        self.parent.assertEqual(result.end_logits.shape		,      (self.batch_size, self.seq_length)							)







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						Tuple:



        '''simple docstring'''




        a__	:					int										=self.num_labels
        a__	:					Any										=AlbertForSequenceClassification(_a							)
        model.to(_a							)
        model.eval()
        a__	:					Tuple										=model(_a		,      attention_mask=_a		,      token_type_ids=_a		,      labels=_a							)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.num_labels)							)







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						Optional[Any]:



        '''simple docstring'''




        a__	:					List[Any]										=self.num_labels
        a__	:					Tuple										=AlbertForTokenClassification(config=_a							)
        model.to(_a							)
        model.eval()
        a__	:					int										=model(_a		,      attention_mask=_a		,      token_type_ids=_a		,      labels=_a							)
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.seq_length, self.num_labels)							)







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__							)   ->						List[str]:



        '''simple docstring'''




        a__	:					Any										=self.num_choices
        a__	:					Dict										=AlbertForMultipleChoice(config=_a							)
        model.to(_a							)
        model.eval()
        a__	:					Any										=input_ids.unsqueeze(1							).expand(-1		,      self.num_choices		,      -1							).contiguous()
        a__	:					int										=token_type_ids.unsqueeze(1							).expand(-1		,      self.num_choices		,      -1							).contiguous()
        a__	:					List[Any]										=input_mask.unsqueeze(1							).expand(-1		,      self.num_choices		,      -1							).contiguous()
        a__	:					List[str]										=model(
            _a		,      attention_mask=_a		,      token_type_ids=_a		,      labels=_a		,      )
        self.parent.assertEqual(result.logits.shape		,      (self.batch_size, self.num_choices)							)







      def    _lowercase  (    self							)   ->						str:



        '''simple docstring'''




        a__	:					Tuple										=self.prepare_config_and_inputs()
        (
            a__    
        )	:					Dict										=config_and_inputs
        a__	:					Optional[int]										={"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
        return config, inputs_dict







@require_torch
class 				__lowerCAmelCase       (    a_						,				a_						,				unittest.TestCase):
      _lowercase				:					List[Any]						=			(
          (
              AlbertModel,
              AlbertForPreTraining,
              AlbertForMaskedLM,
              AlbertForMultipleChoice,
              AlbertForSequenceClassification,
              AlbertForTokenClassification,
              AlbertForQuestionAnswering,
          )
          if is_torch_available()
          else ()
      )
      _lowercase				:					Union[str, Any]						=			(
          {
              """feature-extraction""": AlbertModel,
              """fill-mask""": AlbertForMaskedLM,
              """question-answering""": AlbertForQuestionAnswering,
              """text-classification""": AlbertForSequenceClassification,
              """token-classification""": AlbertForTokenClassification,
              """zero-shot""": AlbertForSequenceClassification,
          }
          if is_torch_available()
          else {}
      )
      _lowercase				:					Union[str, Any]						=			True







      def    _lowercase  (    self		,      lowerCAmelCase__		,      lowerCAmelCase__		,      lowerCAmelCase__=False							)   ->						List[str]:



        '''simple docstring'''




        a__	:					Union[str, Any]										=super()._prepare_for_class(_a		,      _a		,      return_labels=_a							)

        if return_labels:
          if model_class in get_values(_a							):
            a__	:					Union[str, Any]										=torch.zeros(
                (self.model_tester.batch_size, self.model_tester.seq_length)		,      dtype=torch.long		,      device=_a							)
            a__	:					Tuple										=torch.zeros(
                self.model_tester.batch_size		,      dtype=torch.long		,      device=_a							)
        return inputs_dict







      def    _lowercase  (    self							)   ->						List[str]:



        '''simple docstring'''




        a__	:					Dict										=AlbertModelTester(self							)
        a__	:					Union[str, Any]										=ConfigTester(self		,      config_class=_a		,      hidden_size=3_7							)







      def    _lowercase  (    self							)   ->						int:



        '''simple docstring'''




        self.config_tester.run_common_tests()







      def    _lowercase  (    self							)   ->						Optional[Any]:



        '''simple docstring'''




        a__	:					Dict										=self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*_a							)







      def    _lowercase  (    self							)   ->						Optional[int]:



        '''simple docstring'''




        a__	:					Dict										=self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_pretraining(*_a							)







      def    _lowercase  (    self							)   ->						Optional[int]:



        '''simple docstring'''




        a__	:					int										=self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_masked_lm(*_a							)







      def    _lowercase  (    self							)   ->						List[Any]:



        '''simple docstring'''




        a__	:					Dict										=self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_multiple_choice(*_a							)







      def    _lowercase  (    self							)   ->						Dict:



        '''simple docstring'''




        a__	:					Union[str, Any]										=self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_question_answering(*_a							)







      def    _lowercase  (    self							)   ->						int:



        '''simple docstring'''




        a__	:					Any										=self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_sequence_classification(*_a							)







      def    _lowercase  (    self							)   ->						Optional[Any]:



        '''simple docstring'''




        a__	:					str										=self.model_tester.prepare_config_and_inputs()
        for type in ["absolute", "relative_key", "relative_key_query"]:
          a__	:					List[Any]										=type
          self.model_tester.create_and_check_model(*_a							)







      @slow
      def    _lowercase  (    self							)   ->						str:



        '''simple docstring'''




        for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
          a__	:					Tuple										=AlbertModel.from_pretrained(_a							)
          self.assertIsNotNone(_a							)







@require_torch
class 				__lowerCAmelCase       (    unittest.TestCase):







      @slow
      def    _lowercase  (    self							)   ->						List[str]:



        '''simple docstring'''




        a__	:					str										=AlbertModel.from_pretrained("albert-base-v2"							)
        a__	:					int										=torch.tensor([[0, 3_4_5, 2_3_2, 3_2_8, 7_4_0, 1_4_0, 1_6_9_5, 6_9, 6_0_7_8, 1_5_8_8, 2]]							)
        a__	:					Any										=torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]							)
        with torch.no_grad():
          a__	:					List[Any]										=model(_a		,      attention_mask=_a							)[0]
        a__	:					List[str]										=torch.Size((1, 1_1, 7_6_8)							)
        self.assertEqual(output.shape		,      _a							)
        a__	:					List[Any]										=torch.tensor(
            [[[-0.65_13, 1.50_35, -0.27_66], [-0.65_15, 1.50_46, -0.27_80], [-0.65_12, 1.50_49, -0.27_84]]]							)

        self.assertTrue(torch.allclose(output[:, 1:4, 1:4]		,      _a		,      atol=1E-4							)							)








"""simple docstring"""




import os
import re
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


_A			:       List[str]   		=       logging.get_logger(__name__)

_A			:       List[str]   		=       {"""vocab_file""": """spiece.model"""}

_A			:       List[Any]   		=       {
    """vocab_file""": {
        """google/bigbird-roberta-base""": """https://huggingface.co/google/bigbird-roberta-base/resolve/main/spiece.model""",
        """google/bigbird-roberta-large""": (
            """https://huggingface.co/google/bigbird-roberta-large/resolve/main/spiece.model"""
        ),
        """google/bigbird-base-trivia-itc""": (
            """https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/spiece.model"""
        ),
    }
}

_A			:       str   		=       {
    """google/bigbird-roberta-base""": 40_96,
    """google/bigbird-roberta-large""": 40_96,
    """google/bigbird-base-trivia-itc""": 40_96,
}

class 		a__						(      a_						):
   __lowerCAmelCase            =				VOCAB_FILES_NAMES
   __lowerCAmelCase            =				PRETRAINED_VOCAB_FILES_MAP
   __lowerCAmelCase            =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   __lowerCAmelCase            =				["""input_ids""", """attention_mask"""]
   __lowerCAmelCase            =				[]
   def __init__(			self	,    _a	,    _a="<unk>"	,    _a="<s>"	,    _a="</s>"	,    _a="<pad>"	,    _a="[SEP]"	,    _a="[MASK]"	,    _a="[CLS]"	,    _a = None	,    **_a	,    ):
          lowercase    :				Dict       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else bos_token
          lowercase    :				Any       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else eos_token
          lowercase    :				Any       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else unk_token
          lowercase    :				List[Any]       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else pad_token
          lowercase    :				Any       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else cls_token
          lowercase    :				Any       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else sep_token

          # Mask token behave like a normal word, i.e. include the space before it
          lowercase    :				List[Any]       		=							AddedToken(_a	,    lstrip=_a	,    rstrip=_a				) if isinstance(_a	,    _a				) else mask_token

          lowercase    :				Optional[int]       		=							{} if sp_model_kwargs is None else sp_model_kwargs

          super().__init__(
              bos_token=_a	,    eos_token=_a	,    unk_token=_a	,    pad_token=_a	,    sep_token=_a	,    mask_token=_a	,    cls_token=_a	,    sp_model_kwargs=self.sp_model_kwargs	,    **_a	,    )

          lowercase    :				Optional[Any]       		=							vocab_file

          lowercase    :				List[str]       		=							spm.SentencePieceProcessor(**self.sp_model_kwargs				)
          self.sp_model.Load(_a				)
   @property
   def 			__magic_name__			(			self				):
          return self.sp_model.get_piece_size()
   def 			__magic_name__			(			self				):
          lowercase    :				str       		=							{self.convert_ids_to_tokens(_a				): i for i in range(self.vocab_size				)}
          vocab.update(self.added_tokens_encoder				)
          return vocab
   def __getstate__(			self				):
          lowercase    :				Union[str, Any]       		=							self.__dict__.copy()
          lowercase    :				Dict       		=							None
          return state
   def __setstate__(			self	,    _a				):
          lowercase    :				str       		=							d

          # for backward compatibility
          if not hasattr(self	,    "sp_model_kwargs"				):
                 lowercase    :				List[str]       		=							{}

          lowercase    :				Any       		=							spm.SentencePieceProcessor(**self.sp_model_kwargs				)
          self.sp_model.Load(self.vocab_file				)
   def 			__magic_name__			(			self	,    _a				):
          return self.sp_model.encode(_a	,    out_type=_a				)
   def 			__magic_name__			(			self	,    _a				):
          return self.sp_model.piece_to_id(_a				)
   def 			__magic_name__			(			self	,    _a				):
          lowercase    :				Union[str, Any]       		=							self.sp_model.IdToPiece(_a				)
          return token
   def 			__magic_name__			(			self	,    _a				):
          lowercase    :				List[Any]       		=							[]
          lowercase    :				List[Any]       		=							""
          lowercase    :				List[Any]       		=							False
          for token in tokens:
                 # make sure that special tokens are not decoded using sentencepiece model
                 if token in self.all_special_tokens:
                        if not prev_is_special:
                               out_string += " "
                        out_string += self.sp_model.decode(_a				) + token
                        lowercase    :				int       		=							True
                        lowercase    :				Union[str, Any]       		=							[]
                 else:
                        current_sub_tokens.append(_a				)
                        lowercase    :				int       		=							False
          out_string += self.sp_model.decode(_a				)
          return out_string.strip()
   def 			__magic_name__			(			self	,    _a	,    _a = False	,    _a = None	,    _a = True	,    **_a	,    ):
          lowercase    :				int       		=							kwargs.pop("use_source_tokenizer"	,    _a				)

          lowercase    :				Union[str, Any]       		=							self.convert_ids_to_tokens(_a	,    skip_special_tokens=_a				)

          # To avoid mixing byte-level and unicode for byte-level BPT
          # we need to build string separately for added tokens and byte-level tokens
          # cf. https://github.com/huggingface/transformers/issues/1133
          lowercase    :				Any       		=							[]
          lowercase    :				Dict       		=							[]
          for token in filtered_tokens:
                 if skip_special_tokens and token in self.all_special_ids:
                        continue
                 if token in self.added_tokens_encoder:
                        if current_sub_text:
                               sub_texts.append(self.convert_tokens_to_string(_a				)				)
                               lowercase    :				int       		=							[]
                        sub_texts.append(_a				)
                 else:
                        current_sub_text.append(_a				)
          if current_sub_text:
                 sub_texts.append(self.convert_tokens_to_string(_a				)				)

          # Mimic the behavior of the Rust tokenizer:
          # No space before [MASK] and [SEP]
          if spaces_between_special_tokens:
                 lowercase    :				Dict       		=							re.sub(R" (\[(MASK|SEP)\])"	,    R"\1"	,    " ".join(_a				)				)
          else:
                 lowercase    :				Union[str, Any]       		=							"".join(_a				)

          lowercase    :				int       		=							(
              clean_up_tokenization_spaces
              if clean_up_tokenization_spaces is not None
              else self.clean_up_tokenization_spaces
          )
          if clean_up_tokenization_spaces:
                 lowercase    :				Union[str, Any]       		=							self.clean_up_tokenization(_a				)
                 return clean_text
          else:
                 return text
   def 			__magic_name__			(			self	,    _a	,    _a = None				):
          if not os.path.isdir(_a				):
                 logger.error(f"""Vocabulary path ({save_directory}) should be a directory"""				)
                 return
          lowercase    :				List[Any]       		=							os.path.join(
              _a	,    (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]				)

          if os.path.abspath(self.vocab_file				) != os.path.abspath(_a				) and os.path.isfile(self.vocab_file				):
                 copyfile(self.vocab_file	,    _a				)
          elif not os.path.isfile(self.vocab_file				):
                 with open(_a	,    "wb"				) as fi:
                        lowercase    :				int       		=							self.sp_model.serialized_model_proto()
                        fi.write(_a				)

          return (out_vocab_file,)
   def 			__magic_name__			(			self	,    _a	,    _a = None				):
          if token_ids_a is None:
                 return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
          lowercase    :				List[str]       		=							[self.cls_token_id]
          lowercase    :				Tuple       		=							[self.sep_token_id]
          return cls + token_ids_a + sep + token_ids_a + sep
   def 			__magic_name__			(			self	,    _a	,    _a = None	,    _a = False				):
          if already_has_special_tokens:
                 return super().get_special_tokens_mask(
                     token_ids_a=_a	,    token_ids_a=_a	,    already_has_special_tokens=_a				)

          if token_ids_a is None:
                 return [1] + ([0] * len(_a				)) + [1]
          return [1] + ([0] * len(_a				)) + [1] + ([0] * len(_a				)) + [1]

   def 			__magic_name__			(			self	,    _a	,    _a = None				):
          lowercase    :				Tuple       		=							[self.sep_token_id]
          lowercase    :				Tuple       		=							[self.cls_token_id]
          if token_ids_a is None:
                 return len(cls + token_ids_a + sep				) * [0]
          return len(cls + token_ids_a + sep				) * [0] + len(token_ids_a + sep				) * [1]


