


import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format







class  snake_case_     :
					UpperCAmelCase__      :					int					   =    None
					def 				lowerCamelCase__(   self     :Dict   )      ->					Dict:
												a__    =  self.feature_extraction_class(**self.feat_extract_dict   )
												a__    =  json.loads(feat_extract.to_json_string()   )
												for key, value in self.feat_extract_dict.items():
																			self.assertEqual(obj[key]    ,UpperCamelCase__   )
					def 				lowerCamelCase__(   self     :Optional[int]   )      ->					int:
												a__    =  self.feature_extraction_class(**self.feat_extract_dict   )

												with tempfile.TemporaryDirectory() as tmpdirname:
																			a__    =  os.path.join(UpperCamelCase__    ,'feat_extract.json'   )
																			feat_extract_first.to_json_file(UpperCamelCase__   )
																			a__    =  self.feature_extraction_class.from_json_file(UpperCamelCase__   )

												self.assertEqual(feat_extract_second.to_dict()    ,feat_extract_first.to_dict()   )
					def 				lowerCamelCase__(   self     :List[Any]   )      ->					List[Any]:
												a__    =  self.feature_extraction_class(**self.feat_extract_dict   )

												with tempfile.TemporaryDirectory() as tmpdirname:
																			a__    =  feat_extract_first.save_pretrained(UpperCamelCase__   )[0]
																			check_json_file_has_correct_format(UpperCamelCase__   )
																			a__    =  self.feature_extraction_class.from_pretrained(UpperCamelCase__   )

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



					def 				lowerCamelCase__(   self     :int   )      ->					Any:
												a__    =  self.feature_extraction_class()
												self.assertIsNotNone(UpperCamelCase__   )








def 							__lowercase     (				__lowerCAmelCase							:       int     ):

							if length <= 0 or not isinstance(__lowerCAmelCase      ,					__lowerCAmelCase     ):
														raise ValueError('Length must be a positive integer.'     )
							return [n * (2 * n - 1) for n in range(__lowerCAmelCase     )]


if __name__ == "__main__":
						print(hexagonal_numbers(length=5))
						print(hexagonal_numbers(length=10))




