"""simple docstring"""
import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format



class   lowerCAmelCase_    :



				"""simple docstring"""
				_lowerCAmelCase     :    Dict			  =						None

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.feature_extraction_class(**self.feat_extract_dict    )
										snake_case								=			json.loads(feat_extract.to_json_string()    )
										for key, value in self.feat_extract_dict.items():
																self.assertEqual(obj[key]		,    lowerCAmelCase    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.feature_extraction_class(**self.feat_extract_dict    )

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

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

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.feature_extraction_class(**self.feat_extract_dict    )

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

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

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.feature_extraction_class()
										self.assertIsNotNone(lowerCAmelCase    )





"""simple docstring"""
def    lowerCAmelCase__    (			_UpperCamelCase       :				int ,			_UpperCamelCase       :				int					)					->				int:





						"""simple docstring"""






						return int((input_a, input_a).count(0					) == 0					)





def    lowerCAmelCase__    (			)					->				None:





						"""simple docstring"""






						assert and_gate(0 ,			0					) == 0
						assert and_gate(0 ,			1					) == 0
						assert and_gate(1 ,			0					) == 0
						assert and_gate(1 ,			1					) == 1


if __name__ == "__main__":
					test_and_gate()
					print(and_gate(1, 0))
					print(and_gate(0, 0))
					print(and_gate(0, 1))
					print(and_gate(1, 1))


