
"""simple docstring"""






import os
import unittest

from transformers.models.cpmant.tokenization_cpmant import VOCAB_FILES_NAMES, CpmAntTokenizer
from transformers.testing_utils import require_jieba, tooslow

from ...test_tokenization_common import TokenizerTesterMixin





@require_jieba
class 				snake_case    (			__A				,    unittest.TestCase						):
   a_ :						str			 =			CpmAntTokenizer
   a_ :						Union[str, Any]			 =			False







   def 					UpperCAmelCase__     (      self)					->Optional[int]:
      super().setUp()

      a_							=			[
          "<d>",
          "</d>",
          "<s>",
          "</s>",
          "</_>",
          "<unk>",
          "<pad>",
          "</n>",
          "我",
          "是",
          "C",
          "P",
          "M",
          "A",
          "n",
          "t",
      ]
      a_							=			os.path.join(self.tmpdirname    ,				VOCAB_FILES_NAMES["vocab_file"])
      with open(self.vocab_file    ,				"w"    ,				encoding="utf-8") as vocab_writer:
         vocab_writer.write("".join([x + "\n" for x in vocab_tokens]))







   @tooslow
   def 					UpperCAmelCase__     (      self)					->List[str]:
      a_							=			CpmAntTokenizer.from_pretrained("openbmb/cpm-ant-10b")
      a_							=			"今天天气真好！"
      a_							=			["今天", "天气", "真", "好", "！"]
      a_							=			tokenizer.tokenize(_UpperCamelCase)
      self.assertListEqual(_UpperCamelCase    ,				_UpperCamelCase)
      a_							=			"今天天气真好！"
      a_							=			[tokenizer.bos_token] + tokens

      a_							=			[6, 98_02, 1_49_62, 20_82, 8_31, 2_44]
      self.assertListEqual(tokenizer.convert_tokens_to_ids(_UpperCamelCase)    ,				_UpperCamelCase)

      a_							=			tokenizer.decode(_UpperCamelCase)
      self.assertEqual(_UpperCamelCase    ,				_UpperCamelCase)


from decimal import Decimal, getcontext
from math import ceil, factorial


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						if not isinstance(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
												raise TypeError('''Undefined for non-integers'''       )
						elif precision < 1:
												raise ValueError('''Undefined for non-natural numbers'''       )

						snake_case_   =	precision
						snake_case_   =	ceil(precision / 14       )
						snake_case_   =	426880 * Decimal(10005       ).sqrt()
						snake_case_   =	1
						snake_case_   =	13591409
						snake_case_   =	Decimal(SCREAMING_SNAKE_CASE__       )
						for k in range(1  ,		SCREAMING_SNAKE_CASE__       ):
												snake_case_   =	factorial(6 * k       ) // (factorial(3 * k       ) * factorial(SCREAMING_SNAKE_CASE__       ) ** 3)
												linear_term += 545140134
												exponential_term *= -262537412640768000
												partial_sum += Decimal(multinomial_term * linear_term       ) / exponential_term
						return str(constant_term / partial_sum       )[:-1]


if __name__ == "__main__":
					lowerCAmelCase_       	=	50
					print(f"""The first {n} digits of pi is: {pi(n)}""")