




import os
import unittest

from transformers import FunnelTokenizer, FunnelTokenizerFast
from transformers.models.funnel.tokenization_funnel import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin






@require_tokenizers
class  __magic_name__						(  __UpperCAmelCase    ,  unittest.TestCase):
				'''simple docstring'''







				SCREAMING_SNAKE_CASE__					:							Tuple	      =					FunnelTokenizer
				SCREAMING_SNAKE_CASE__					:							Union[str, Any]	      =					FunnelTokenizerFast
				SCREAMING_SNAKE_CASE__					:							Tuple	      =					True
				SCREAMING_SNAKE_CASE__					:							Union[str, Any]	      =					True


				def     _A							(							self:   List[Any]		):
											super().setUp()

											SCREAMING_SNAKE_CASE_   	=    [
											    '''<unk>''',
											    '''<cls>''',
											    '''<sep>''',
											    '''want''',
											    '''##want''',
											    '''##ed''',
											    '''wa''',
											    '''un''',
											    '''runn''',
											    '''##ing''',
											    ''',''',
											    '''low''',
											    '''lowest''',
											]
											SCREAMING_SNAKE_CASE_   	=    os.path.join(self.tmpdirname		,					VOCAB_FILES_NAMES['''vocab_file''']		)
											with open(self.vocab_file		,					'''w'''		,					encoding='''utf-8'''		) as vocab_writer:
																		vocab_writer.write(''''''.join([x + '''\n''' for x in vocab_tokens]		)		)


				def     _A							(							self:   str		,					**_lowerCamelCase:   Dict		):
											return FunnelTokenizer.from_pretrained(self.tmpdirname		,					**_lowerCamelCase		)


				def     _A							(							self:   List[Any]		,					**_lowerCamelCase:   List[str]		):
											return FunnelTokenizerFast.from_pretrained(self.tmpdirname		,					**_lowerCamelCase		)


				def     _A							(							self:   Union[str, Any]		,					_lowerCamelCase:   str		):
											SCREAMING_SNAKE_CASE_   	=    '''UNwant\u00E9d,running'''
											SCREAMING_SNAKE_CASE_   	=    '''unwanted, running'''
											return input_text, output_text


				def     _A							(							self:   Any		):
											SCREAMING_SNAKE_CASE_   	=    self.tokenizer_class(self.vocab_file		)

											SCREAMING_SNAKE_CASE_   	=    tokenizer.tokenize('''UNwant\u00E9d,running'''		)
											self.assertListEqual(_lowerCamelCase		,					['''un''', '''##want''', '''##ed''', ''',''', '''runn''', '''##ing''']		)
											self.assertListEqual(tokenizer.convert_tokens_to_ids(_lowerCamelCase		)		,					[7, 4, 5, 10, 8, 9]		)





				def     _A							(							self:   Optional[int]		):
											SCREAMING_SNAKE_CASE_   	=    self.get_tokenizers(do_lower_case=_lowerCamelCase		)
											for tokenizer in tokenizers:
																		SCREAMING_SNAKE_CASE_   	=    tokenizer('''UNwant\u00E9d,running'''		)
																		SCREAMING_SNAKE_CASE_   	=    len(inputs['''input_ids''']		) - 1
																		self.assertListEqual(inputs['''token_type_ids''']		,					[2] + [0] * sentence_len		)

																		SCREAMING_SNAKE_CASE_   	=    tokenizer('''UNwant\u00E9d,running'''		,					'''UNwant\u00E9d,running'''		)
																		self.assertListEqual(inputs['''token_type_ids''']		,					[2] + [0] * sentence_len + [1] * sentence_len		)








import requests

def 			a   (_lowerCAmelCase  ,    _lowerCAmelCase     ):
							SCREAMING_SNAKE_CASE_   	=    {'''Content-Type''': '''application/json'''}
							SCREAMING_SNAKE_CASE_   	=    requests.post(_lowerCAmelCase  ,    json={'''text''': message_body}  ,    headers=_lowerCAmelCase     )
							if response.status_code != 2_0_0:
														SCREAMING_SNAKE_CASE_   	=    (
														    '''Request to slack returned an error '''
														    F"{response.status_code}, the response is:\n{response.text}"
														)
														raise ValueError(_lowerCAmelCase     )


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>""")


