
import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format


class 				lowercase					:
		__lowercase       :       Any	     =				None



		def __UpperCamelCase ( self       )  ->					Any:
				"""simple docstring"""
				UpperCamelCase		=     self.feature_extraction_class(**self.feat_extract_dict       )
				UpperCamelCase		=     json.loads(feat_extract.to_json_string()       )
				for key, value in self.feat_extract_dict.items():
						self.assertEqual(obj[key]				,      A_       )



		def __UpperCamelCase ( self       )  ->					Tuple:
				"""simple docstring"""
				UpperCamelCase		=     self.feature_extraction_class(**self.feat_extract_dict       )

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

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



		def __UpperCamelCase ( self       )  ->					Tuple:
				"""simple docstring"""
				UpperCamelCase		=     self.feature_extraction_class(**self.feat_extract_dict       )

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

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



		def __UpperCamelCase ( self       )  ->					Optional[int]:
				"""simple docstring"""
				UpperCamelCase		=     self.feature_extraction_class()
				self.assertIsNotNone(A_       )


import requests


def       A       (					lowercase    ,       lowercase )   ->  None:
		'''simple docstring'''

		UpperCamelCase		=     {'Content-Type': 'application/json'}
		UpperCamelCase		=     requests.post(lowercase    ,       json={'text': message_body}    ,       headers=lowercase )
		if response.status_code != 200:
				UpperCamelCase		=     (
				    'Request to slack returned an error '
				    f'''{response.status_code}, the response is:\n{response.text}'''
				)
				raise ValueError(lowercase )


if __name__ == "__main__":
					# Set the slack url to the one provided by Slack when you create the webhook at
					# https://my.slack.com/services/new/incoming-webhook/
					send_slack_message("<YOUR MESSAGE BODY>", "<SLACK CHANNEL URL>")
