






import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format
class     a    :



      """simple docstring"""


      a  : Any							       =	None
      def 	UpperCAmelCase      (      self					:			Union[str, Any]					)							->      Any:
        __UpperCAmelCase							:	Optional[Any]           =  self.feature_extraction_class(**self.feat_extract_dict					)
        __UpperCAmelCase							:	List[str]           =  json.loads(feat_extract.to_json_string()					)
        for key, value in self.feat_extract_dict.items():
          self.assertEqual(obj[key]		,      A_					)
      def 	UpperCAmelCase      (      self					:			Union[str, Any]					)							->      Tuple:
        __UpperCAmelCase							:	List[str]           =  self.feature_extraction_class(**self.feat_extract_dict					)

        with tempfile.TemporaryDirectory() as tmpdirname:
          __UpperCAmelCase							:	Optional[Any]           =  os.path.join(A_		,      """feat_extract.json"""					)
          feat_extract_first.to_json_file(A_					)
          __UpperCAmelCase							:	Union[str, Any]           =  self.feature_extraction_class.from_json_file(A_					)

        self.assertEqual(feat_extract_second.to_dict()		,      feat_extract_first.to_dict()					)
      def 	UpperCAmelCase      (      self					:			Any					)							->      Tuple:
        __UpperCAmelCase							:	Dict           =  self.feature_extraction_class(**self.feat_extract_dict					)

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

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




      def 	UpperCAmelCase      (      self					:			Any					)							->      Optional[int]:
        __UpperCAmelCase							:	List[Any]           =  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>")
