
import json
import os
import unittest

from transformers.models.ctrl.tokenization_ctrl import VOCAB_FILES_NAMES, CTRLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin



class 		UpperCamelCase__  (       __lowercase    ,unittest.TestCase    ):
   _SCREAMING_SNAKE_CASE      :							Optional[int]	       =      CTRLTokenizer
   _SCREAMING_SNAKE_CASE      :							int	       =      False
   _SCREAMING_SNAKE_CASE      :							List[Any]	       =      False
   def       lowerCAmelCase			(self :					Any   ):
    super().setUp()

    # Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
    __a :  Any						=  ['''adapt''', '''re@@''', '''a@@''', '''apt''', '''c@@''', '''t''', '''<unk>''']
    __a :  Union[str, Any]						=  dict(zip(snake_case_					,				range(len(snake_case_   )   )   )   )
    __a :  Dict						=  ['''#version: 0.2''', '''a p''', '''ap t</w>''', '''r e''', '''a d''', '''ad apt</w>''', '''''']
    __a :  Union[str, Any]						=  {'''unk_token''': '''<unk>'''}

    __a :  Dict						=  os.path.join(self.tmpdirname					,				VOCAB_FILES_NAMES['''vocab_file''']   )
    __a :  Union[str, Any]						=  os.path.join(self.tmpdirname					,				VOCAB_FILES_NAMES['''merges_file''']   )
    with open(self.vocab_file					,				'''w'''					,				encoding='''utf-8'''   ) as fp:
     fp.write(json.dumps(snake_case_   ) + '''\n'''   )
    with open(self.merges_file					,				'''w'''					,				encoding='''utf-8'''   ) as fp:
     fp.write('''\n'''.join(snake_case_   )   )
   def       lowerCAmelCase			(self :					List[Any]					,				**snake_case_ :					Tuple   ):
    kwargs.update(self.special_tokens_map   )
    return CTRLTokenizer.from_pretrained(self.tmpdirname					,				**snake_case_   )
   def       lowerCAmelCase			(self :					Optional[Any]					,				snake_case_ :					Optional[int]   ):
    __a :  Optional[Any]						=  '''adapt react readapt apt'''
    __a :  Union[str, Any]						=  '''adapt react readapt apt'''
    return input_text, output_text







   def       lowerCAmelCase			(self :					Dict   ):
    __a :  Union[str, Any]						=  CTRLTokenizer(self.vocab_file					,				self.merges_file					,				**self.special_tokens_map   )
    __a :  Any						=  '''adapt react readapt apt'''
    __a :  int						=  '''adapt re@@ a@@ c@@ t re@@ adapt apt'''.split()
    __a :  Tuple						=  tokenizer.tokenize(snake_case_   )
    self.assertListEqual(snake_case_					,				snake_case_   )

    __a :  str						=  tokens + [tokenizer.unk_token]

    __a :  Optional[int]						=  [0, 1, 2, 4, 5, 1, 0, 3, 6]
    self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case_   )					,				snake_case_   )


from __future__ import annotations




def    __UpperCamelCase     (				lowerCAmelCase__							:				list[float]  ,   lowerCAmelCase__							:				list[float]  ):
 __a :  Dict						=  sorted(numsa + numsa  )
 __a				,       __a :  Optional[Any]						=  divmod(len(lowerCAmelCase__  )  ,   2  )
 if mod == 1:
  return all_numbers[div]
 else:
  return (all_numbers[div] + all_numbers[div - 1]) / 2


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      lowercase__       =[float(x) for x in input('Enter the elements of first array: ').split()]
      lowercase__       =[float(x) for x in input('Enter the elements of second array: ').split()]
      print(F"""The median of two arrays is: {median_of_two_arrays(array_a, array_a)}""")
