



'''simple docstring'''

import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format

class       __magic_name__		:
							lowerCAmelCase			:       List[str]  							=   None







							def 				__lowercase     (				self   :			Optional[Any]						):
									_a	: Any								=				self.feature_extraction_class(**self.feat_extract_dict						)
									_a	: List[str]								=				json.loads(feat_extract.to_json_string()						)
									for key, value in self.feat_extract_dict.items():
											self.assertEqual(obj[key]      ,lowerCamelCase_						)







							def 				__lowercase     (				self   :			int						):
									_a	: Tuple								=				self.feature_extraction_class(**self.feat_extract_dict						)

									with tempfile.TemporaryDirectory() as tmpdirname:
											_a	: Union[str, Any]								=				os.path.join(lowerCamelCase_      ,'feat_extract.json'						)
											feat_extract_first.to_json_file(lowerCamelCase_						)
											_a	: Optional[int]								=				self.feature_extraction_class.from_json_file(lowerCamelCase_						)

									self.assertEqual(feat_extract_second.to_dict()      ,feat_extract_first.to_dict()						)







							def 				__lowercase     (				self   :			List[Any]						):
									_a	: Optional[int]								=				self.feature_extraction_class(**self.feat_extract_dict						)

									with tempfile.TemporaryDirectory() as tmpdirname:
											_a	: int								=				feat_extract_first.save_pretrained(lowerCamelCase_						)[0]
											check_json_file_has_correct_format(lowerCamelCase_						)
											_a	: Optional[Any]								=				self.feature_extraction_class.from_pretrained(lowerCamelCase_						)

									self.assertEqual(feat_extract_second.to_dict()      ,feat_extract_first.to_dict()						)







							def 				__lowercase     (				self   :			int						):
									_a	: str								=				self.feature_extraction_class()
									self.assertIsNotNone(lowerCamelCase_						)











def       SCREAMING_SNAKE_CASE__  (       _lowercase     : str			)   ->							str:




		'''simple docstring'''
		if not all(char in '01' for char in bin_string			):
				raise ValueError('Non-binary value was passed to the function'			)
		if not bin_string:
				raise ValueError('Empty string was passed to the function'			)
		lowercase__					:      Tuple      =		''
		while len(_lowercase			) % 3 != 0:
				lowercase__					:      Optional[int]      =		'0' + bin_string
		lowercase__					:      List[Any]      =		[
		    bin_string[index : index + 3]
		    for index in range(len(_lowercase			)			)
		    if index % 3 == 0
		]
		for bin_group in bin_string_in_3_list:
				lowercase__					:      int      =		0
				for index, val in enumerate(_lowercase			):
						oct_val += int(2 ** (2 - index) * int(_lowercase			)			)
				oct_string += str(_lowercase			)
		return oct_string


if __name__ == "__main__":
			from doctest import testmod

			testmod()


