


'''simple docstring'''



import collections
import json
import math
import os
import re
import time
from fnmatch import fnmatch
from typing import Dict

import requests
from slack_sdk import WebClient


__lowercase     :						Tuple	=     WebClient(token=os.environ['CI_SLACK_BOT_TOKEN'])






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE				:       Any       ):
					__a      :	Any    =  test_results.split(' '       )

					__a      :	Optional[int]    =  0
					__a      :	Optional[int]    =  0

					# When the output is short enough, the output is surrounded by = signs: "== OUTPUT =="
					# When it is too long, those signs are not present.
					__a      :	Tuple    =  expressions[-2] if '=' in expressions[-1] else expressions[-1]

					for i, expression in enumerate(_SCREAMING_SNAKE_CASE       ):
										if "failed" in expression:
															failed += int(expressions[i - 1]       )
										if "passed" in expression:
															success += int(expressions[i - 1]       )

					return failed, success, time_spent






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE				:       Tuple       ):
					__a      :	Any    =  {}
					__a      :	Union[str, Any]    =  None
					__a      :	Dict    =  False
					for line in failures_short_lines.split('\n'       ):
										if re.search(r'_ \[doctest\]'						,				_SCREAMING_SNAKE_CASE       ):
															__a      :	Any    =  True
															__a      :	int    =  line.split(' '       )[2]
										elif in_error and not line.split(' '       )[0].isdigit():
															__a      :	Optional[int]    =  line
															__a      :	Any    =  False

					return failures





class 							__UpperCamelCase    :




	def __init__(       self						,    __a						,    __a							):

						'''simple docstring'''





						__a      :	Optional[int]    =  title

						__a      :	int    =  doc_test_results['time_spent'].split(','							)[0]
						__a      :	Any    =  doc_test_results['success']
						__a      :	List[Any]    =  doc_test_results['failures']
						__a      :	Optional[int]    =  self.n_success + self.n_failures

						# Failures and success of the modeling tests
						__a      :	Optional[Any]    =  doc_test_results




	@property
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	Dict    =  [self._time_spent]
						__a      :	Any    =  0

						for time in time_spent:
											__a      :	int    =  time.split(':'							)

											# Time can be formatted as xx:xx:xx, as .xx, or as x.xx if the time spent was less than a minute.
											if len(__a							) == 1:
																__a      :	List[str]    =  [0, 0, time_parts[0]]

											__a   ,    __a   ,    __a      :	List[Any]    =  int(time_parts[0]							), int(time_parts[1]							), float(time_parts[2]							)
											total_secs += hours * 3600 + minutes * 60 + seconds

						__a   ,    __a   ,    __a      :	List[Any]    =  total_secs // 3600, (total_secs % 3600) // 60, total_secs % 60
						return f"""{int(__a							)}h{int(__a							)}m{int(__a							)}s"""




	@property
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						return {"type": "header", "text": {"type": "plain_text", "text": self.title}}




	@property
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						return {
						    "type": "section",
						    "text": {
						        "type": "plain_text",
						        "text": f"""🌞 There were no failures: all {self.n_tests} tests passed. The suite ran in {self.time}.""",
						        "emoji": True,
						    },
						    "accessory": {
						        "type": "button",
						        "text": {"type": "plain_text", "text": "Check Action results", "emoji": True},
						        "url": f"""https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}""",
						    },
						}




	@property
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						return {
						    "type": "section",
						    "text": {
						        "type": "plain_text",
						        "text": (
						            f"""There were {self.n_failures} failures, out of {self.n_tests} tests.\nThe suite ran in"""
						            f""" {self.time}."""
						        ),
						        "emoji": True,
						    },
						    "accessory": {
						        "type": "button",
						        "text": {"type": "plain_text", "text": "Check Action results", "emoji": True},
						        "url": f"""https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}""",
						    },
						}




	@property
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	Tuple    =  40
						__a      :	Dict    =  {k: v['failed'] for k, v in doc_test_results.items() if isinstance(__a						,    __a							)}

						__a      :	Optional[int]    =  ''
						for category, failures in category_failures.items():
											if len(__a							) == 0:
																continue

											if report != "":
																report += "\n\n"

											report += f"""*{category} failures*:""".ljust(line_length // 2							).rjust(line_length // 2							) + "\n"
											report += "`"
											report += "`\n`".join(__a							)
											report += "`"

						return {
						    "type": "section",
						    "text": {
						        "type": "mrkdwn",
						        "text": f"""The following examples had failures:\n\n\n{report}\n""",
						    },
						}




	@property
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	Dict    =  [self.header]

						if self.n_failures > 0:
											blocks.append(self.failures							)

						if self.n_failures > 0:
											blocks.extend([self.category_failures]							)

						if self.n_failures == 0:
											blocks.append(self.no_failures							)

						return json.dumps(__a							)




	@staticmethod
	def 				__UpperCAmelCase							(       ):

						'''simple docstring'''





						__a      :	Union[str, Any]    =  [
						    {
						        'type': 'section',
						        'text': {
						            'type': 'plain_text',
						            'text': 'There was an issue running the tests.',
						        },
						        'accessory': {
						            'type': 'button',
						            'text': {'type': 'plain_text', 'text': 'Check Action results', 'emoji': True},
						            'url': f"""https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}""",
						        },
						    }
						]

						print('Sending the following payload'							)
						print(json.dumps({'blocks': json.loads(__a							)}							)							)

						client.chat_postMessage(
						    channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']						,    text='There was an issue running the tests.'						,    blocks=__a						,    )




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						print('Sending the following payload'							)
						print(json.dumps({'blocks': json.loads(self.payload							)}							)							)

						__a      :	Optional[int]    =  f"""{self.n_failures} failures out of {self.n_tests} tests,""" if self.n_failures else 'All tests passed.'

						__a      :	Dict    =  client.chat_postMessage(
						    channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']						,    blocks=self.payload						,    text=__a						,    )




	def 				__UpperCAmelCase							(       self						,    __a						,    __a						,    __a						,    __a							):

						'''simple docstring'''





						__a      :	Union[str, Any]    =  ''
						for key, value in failures.items():
											__a      :	Dict    =  value[:200] + ' [Truncated]' if len(__a							) > 250 else value
											failures_text += f"""*{key}*\n_{value}_\n\n"""

						__a      :	List[str]    =  job_name
						__a      :	Dict    =  {'type': 'section', 'text': {'type': 'mrkdwn', 'text': text}}

						if job_link is not None:
											__a      :	int    =  {
											    'type': 'button',
											    'text': {'type': 'plain_text', 'text': 'GitHub Action job', 'emoji': True},
											    'url': job_link,
											}

						return [
						    {"type": "header", "text": {"type": "plain_text", "text": title.upper(), "emoji": True}},
						    content,
						    {"type": "section", "text": {"type": "mrkdwn", "text": failures_text}},
						]





	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						if self.thread_ts is None:
											raise ValueError('Can only post reply if a post has been made.'							)

						__a      :	Optional[int]    =  self.doc_test_results.pop('job_link'							)
						self.doc_test_results.pop('failures'							)
						self.doc_test_results.pop('success'							)
						self.doc_test_results.pop('time_spent'							)

						__a      :	Optional[int]    =  sorted(self.doc_test_results.items()						,    key=lambda __a							: t[0]							)
						for job, job_result in sorted_dict:
											if len(job_result['failures']							):
																__a      :	List[str]    =  f"""*Num failures* :{len(job_result["failed"]							)} \n"""
																__a      :	Optional[Any]    =  job_result['failures']
																__a      :	List[Any]    =  self.get_reply_blocks(__a						,    __a						,    __a						,    text=__a							)

																print('Sending the following reply'							)
																print(json.dumps({'blocks': blocks}							)							)

																client.chat_postMessage(
																    channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']						,    text=f"""Results for {job}"""						,    blocks=__a						,    thread_ts=self.thread_ts['ts']						,    )

																time.sleep(1							)






def   lowerCamelCase							():
					__a      :	Tuple    =  os.environ['GITHUB_RUN_ID']
					__a      :	int    =  F"""https://api.github.com/repos/huggingface/transformers/actions/runs/{run_id}/jobs?per_page=100"""
					__a      :	Tuple    =  requests.get(_SCREAMING_SNAKE_CASE       ).json()
					__a      :	Optional[Any]    =  {}

					try:
										jobs.update({job['name']: job['html_url'] for job in result['jobs']}       )
										__a      :	Optional[int]    =  math.ceil((result['total_count'] - 100) / 100       )

										for i in range(_SCREAMING_SNAKE_CASE       ):
															__a      :	str    =  requests.get(url + F"""&page={i + 2}"""       ).json()
															jobs.update({job['name']: job['html_url'] for job in result['jobs']}       )

										return jobs
					except Exception as e:
										print('Unknown error, could not fetch links.'						,				_SCREAMING_SNAKE_CASE       )

					return {}






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE				:       str       ):
					__a      :	Optional[Any]    =  {}

					if os.path.exists(_SCREAMING_SNAKE_CASE       ):
										__a      :	str    =  os.listdir(_SCREAMING_SNAKE_CASE       )
										for file in files:
															try:
																				with open(os.path.join(_SCREAMING_SNAKE_CASE						,				_SCREAMING_SNAKE_CASE       )						,				encoding='utf-8'       ) as f:
																									__a      :	Any    =  f.read()
															except UnicodeDecodeError as e:
																				raise ValueError(F"""Could not open {os.path.join(_SCREAMING_SNAKE_CASE						,				_SCREAMING_SNAKE_CASE       )}."""       ) from e

					return _artifact






def   lowerCamelCase							():





					class 							__UpperCamelCase    :




						def __init__(       self						,    __a							):

											'''simple docstring'''





											__a      :	str    =  name
											__a      :	Dict    =  []




						def __str__(       self							):

											'''simple docstring'''





											return self.name





						def 				__UpperCAmelCase							(       self						,    __a							):

											'''simple docstring'''





											self.paths.append({'name': self.name, 'path': path}							)



					__a      :	Dict[str, Artifact]    =  {}

					__a      :	Tuple    =  filter(os.path.isdir						,				os.listdir()       )
					for directory in directories:
										__a      :	List[str]    =  directory
										if artifact_name not in _available_artifacts:
															__a      :	Union[str, Any]    =  Artifact(_SCREAMING_SNAKE_CASE       )

															_available_artifacts[artifact_name].add_path(_SCREAMING_SNAKE_CASE       )

					return _available_artifacts


if __name__ == "__main__":
	__lowercase     :						Union[str, Any]	=     get_job_links()
	__lowercase     :						Optional[Any]	=     retrieve_available_artifacts()

	__lowercase     :						int	=     collections.OrderedDict(
	    [
	        ('*.py', 'API Examples'),
	        ('*.md', 'MD Examples'),
	    ]
	)

	# This dict will contain all the information relative to each doc test category:
	# - failed: list of failed tests
	# - failures: dict in the format 'test': 'error_message'
	__lowercase     :						List[str]	=     {
	    v: {
	        'failed': [],
	        'failures': {},
	    }
	    for v in docs.values()
	}

	# Link to the GitHub Action job
	__lowercase     :						List[str]	=     github_actions_job_links.get('run_doctests')

	__lowercase     :						Any	=     available_artifacts['doc_tests_gpu_test_reports'].paths[0]
	__lowercase     :						List[str]	=     retrieve_artifact(artifact_path['name'])
	if "stats" in artifact:
		__lowercase	,				__lowercase	,				__lowercase     :						Optional[int]	=     handle_test_results(artifact['stats'])
		__lowercase     :						Union[str, Any]	=     failed
		__lowercase     :						Dict	=     success
		__lowercase     :						Optional[Any]	=     time_spent[1:-1] + ', '

		__lowercase     :						Tuple	=     extract_first_line_failure(artifact['failures_short'])
		for line in artifact["summary_short"].split('\n'):
			if re.search('FAILED', line):
				__lowercase     :						Tuple	=     line.replace('FAILED ', '')
				__lowercase     :						str	=     line.split()[0].replace('\n', '')

				if "::" in line:
					__lowercase	,				__lowercase     :						str	=     line.split('::')
				else:
					__lowercase	,				__lowercase     :						List[str]	=     line, line

				for file_regex in docs.keys():
					if fnmatch(file_path, file_regex):
						__lowercase     :						Optional[int]	=     docs[file_regex]
						doc_test_results[category]["failed"].append(test)

						__lowercase     :						str	=     all_failures[test] if test in all_failures else 'N/A'
						__lowercase     :						Any	=     failure
						break

	__lowercase     :						Dict	=     Message('🤗 Results of the doc tests.', doc_test_results)
	message.post()
	message.post_reply()







'''simple docstring'''



import json
import os
import re
import unittest

from transformers import CodeGenTokenizer, CodeGenTokenizerFast
from transformers.models.codegen.tokenization_codegen import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin





@require_tokenizers
class 							__UpperCamelCase    (		lowerCAmelCase_		,				unittest.TestCase ):
	A_           =   CodeGenTokenizer
	A_           =   CodeGenTokenizerFast
	A_           =   True
	A_           =   {"add_prefix_space": True}
	A_           =   False




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						super().setUp()

						# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
						__a      :	Tuple    =  [
						    'l',
						    'o',
						    'w',
						    'e',
						    'r',
						    's',
						    't',
						    'i',
						    'd',
						    'n',
						    '\u0120',
						    '\u0120l',
						    '\u0120n',
						    '\u0120lo',
						    '\u0120low',
						    'er',
						    '\u0120lowest',
						    '\u0120newer',
						    '\u0120wider',
						    '<unk>',
						    '<|endoftext|>',
						]
						__a      :	Union[str, Any]    =  dict(zip(__a						,    range(len(__a							)							)							)							)
						__a      :	Tuple    =  ['#version: 0.2', '\u0120 l', '\u0120l o', '\u0120lo w', 'e r', '']
						__a      :	Dict    =  {'unk_token': '<unk>'}

						__a      :	List[Any]    =  os.path.join(self.tmpdirname						,    VOCAB_FILES_NAMES['vocab_file']							)
						__a      :	List[str]    =  os.path.join(self.tmpdirname						,    VOCAB_FILES_NAMES['merges_file']							)
						with open(self.vocab_file						,    'w'						,    encoding='utf-8'							) as fp:
											fp.write(json.dumps(__a							) + '\n'							)
						with open(self.merges_file						,    'w'						,    encoding='utf-8'							) as fp:
											fp.write('\n'.join(__a							)							)




	def 				__UpperCAmelCase							(       self						,    **__a							):

						'''simple docstring'''





						kwargs.update(self.special_tokens_map							)
						return CodeGenTokenizer.from_pretrained(self.tmpdirname						,    **__a							)




	def 				__UpperCAmelCase							(       self						,    **__a							):

						'''simple docstring'''





						kwargs.update(self.special_tokens_map							)
						return CodeGenTokenizerFast.from_pretrained(self.tmpdirname						,    **__a							)




	def 				__UpperCAmelCase							(       self						,    __a							):

						'''simple docstring'''





						__a      :	Tuple    =  'lower newer'
						__a      :	Tuple    =  'lower newer'
						return input_text, output_text




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	List[Any]    =  CodeGenTokenizer(self.vocab_file						,    self.merges_file						,    **self.special_tokens_map							)
						__a      :	str    =  'lower newer'
						__a      :	Tuple    =  ['\u0120low', 'er', '\u0120', 'n', 'e', 'w', 'er']
						__a      :	Dict    =  tokenizer.tokenize(__a						,    add_prefix_space=__a							)
						self.assertListEqual(__a						,    __a							)

						__a      :	List[str]    =  tokens + [tokenizer.unk_token]
						__a      :	Any    =  [14, 15, 10, 9, 3, 2, 15, 19]
						self.assertListEqual(tokenizer.convert_tokens_to_ids(__a							)						,    __a							)




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						if not self.test_rust_tokenizer:
											return

						__a      :	List[Any]    =  self.get_tokenizer()
						__a      :	List[str]    =  self.get_rust_tokenizer(add_prefix_space=__a							)

						__a      :	Any    =  'lower newer'

						# Testing tokenization
						__a      :	Dict    =  tokenizer.tokenize(__a						,    add_prefix_space=__a							)
						__a      :	Dict    =  rust_tokenizer.tokenize(__a							)
						self.assertListEqual(__a						,    __a							)

						# Testing conversion to ids without special tokens
						__a      :	int    =  tokenizer.encode(__a						,    add_special_tokens=__a						,    add_prefix_space=__a							)
						__a      :	Tuple    =  rust_tokenizer.encode(__a						,    add_special_tokens=__a							)
						self.assertListEqual(__a						,    __a							)

						# Testing conversion to ids with special tokens
						__a      :	Tuple    =  self.get_rust_tokenizer(add_prefix_space=__a							)
						__a      :	Union[str, Any]    =  tokenizer.encode(__a						,    add_prefix_space=__a							)
						__a      :	int    =  rust_tokenizer.encode(__a							)
						self.assertListEqual(__a						,    __a							)

						# Testing the unknown token
						__a      :	Any    =  tokens + [rust_tokenizer.unk_token]
						__a      :	Tuple    =  [14, 15, 10, 9, 3, 2, 15, 19]
						self.assertListEqual(rust_tokenizer.convert_tokens_to_ids(__a							)						,    __a							)




	def 				__UpperCAmelCase							(       self						,    *__a						,    **__a							):

						'''simple docstring'''





						pass




	def 				__UpperCAmelCase							(       self						,    __a=15							):

						'''simple docstring'''





						for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
											with self.subTest(f"""{tokenizer.__class__.__name__} ({pretrained_name})"""							):
																__a      :	Optional[int]    =  self.rust_tokenizer_class.from_pretrained(__a						,    **__a							)

																# Simple input
																__a      :	List[Any]    =  'This is a simple input'
																__a      :	Tuple    =  ['This is a simple input 1', 'This is a simple input 2']
																__a      :	Tuple    =  ('This is a simple input', 'This is a pair')
																__a      :	str    =  [
																    ('This is a simple input 1', 'This is a simple input 2'),
																    ('This is a simple pair 1', 'This is a simple pair 2'),
																]

																# Simple input tests
																self.assertRaises(__a						,    tokenizer_r.encode						,    __a						,    max_length=__a						,    padding='max_length'							)

																# Simple input
																self.assertRaises(__a						,    tokenizer_r.encode_plus						,    __a						,    max_length=__a						,    padding='max_length'							)

																# Simple input
																self.assertRaises(
																    __a						,    tokenizer_r.batch_encode_plus						,    __a						,    max_length=__a						,    padding='max_length'						,    )

																# Pair input
																self.assertRaises(__a						,    tokenizer_r.encode						,    __a						,    max_length=__a						,    padding='max_length'							)

																# Pair input
																self.assertRaises(__a						,    tokenizer_r.encode_plus						,    __a						,    max_length=__a						,    padding='max_length'							)

																# Pair input
																self.assertRaises(
																    __a						,    tokenizer_r.batch_encode_plus						,    __a						,    max_length=__a						,    padding='max_length'						,    )




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	List[Any]    =  CodeGenTokenizer.from_pretrained(self.tmpdirname						,    pad_token='<pad>'							)

						# Simple input
						__a      :	str    =  'This is a simple input'
						__a      :	Any    =  ['This is a simple input looooooooong', 'This is a simple input']
						__a      :	Optional[int]    =  ('This is a simple input', 'This is a pair')
						__a      :	Optional[Any]    =  [
						    ('This is a simple input loooooong', 'This is a simple input'),
						    ('This is a simple pair loooooong', 'This is a simple pair'),
						]

						__a      :	int    =  tokenizer.pad_token_id

						__a      :	List[Any]    =  tokenizer(__a						,    padding='max_length'						,    max_length=30						,    return_tensors='np'							)
						__a      :	Union[str, Any]    =  tokenizer(__a						,    padding=__a						,    truncate=__a						,    return_tensors='np'							)
						__a      :	Optional[Any]    =  tokenizer(*__a						,    padding='max_length'						,    max_length=60						,    return_tensors='np'							)
						__a      :	List[Any]    =  tokenizer(__a						,    padding=__a						,    truncate=__a						,    return_tensors='np'							)

						# s
						# test single string max_length padding
						self.assertEqual(out_s['input_ids'].shape[-1]						,    30							)
						self.assertTrue(pad_token_id in out_s['input_ids']							)
						self.assertTrue(0 in out_s['attention_mask']							)

						# s2
						# test automatic padding
						self.assertEqual(out_sa['input_ids'].shape[-1]						,    33							)
						# long slice doesn't have padding
						self.assertFalse(pad_token_id in out_sa['input_ids'][0]							)
						self.assertFalse(0 in out_sa['attention_mask'][0]							)
						# short slice does have padding
						self.assertTrue(pad_token_id in out_sa['input_ids'][1]							)
						self.assertTrue(0 in out_sa['attention_mask'][1]							)

						# p
						# test single pair max_length padding
						self.assertEqual(out_p['input_ids'].shape[-1]						,    60							)
						self.assertTrue(pad_token_id in out_p['input_ids']							)
						self.assertTrue(0 in out_p['attention_mask']							)

						# p2
						# test automatic padding pair
						self.assertEqual(out_pa['input_ids'].shape[-1]						,    52							)
						# long slice pair doesn't have padding
						self.assertFalse(pad_token_id in out_pa['input_ids'][0]							)
						self.assertFalse(0 in out_pa['attention_mask'][0]							)
						# short slice pair does have padding
						self.assertTrue(pad_token_id in out_pa['input_ids'][1]							)
						self.assertTrue(0 in out_pa['attention_mask'][1]							)




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	Optional[int]    =  '$$$'
						__a      :	List[str]    =  CodeGenTokenizer.from_pretrained(self.tmpdirname						,    bos_token=__a						,    add_bos_token=__a							)

						__a      :	Union[str, Any]    =  'This is a simple input'
						__a      :	List[Any]    =  ['This is a simple input 1', 'This is a simple input 2']

						__a      :	List[Any]    =  tokenizer.bos_token_id

						__a      :	List[str]    =  tokenizer(__a							)
						__a      :	Optional[Any]    =  tokenizer(__a							)

						self.assertEqual(out_s.input_ids[0]						,    __a							)
						self.assertTrue(all(o[0] == bos_token_id for o in out_sa.input_ids							)							)

						__a      :	Any    =  tokenizer.decode(out_s.input_ids							)
						__a      :	Union[str, Any]    =  tokenizer.batch_decode(out_sa.input_ids							)

						self.assertEqual(decode_s.split()[0]						,    __a							)
						self.assertTrue(all(d.split()[0] == bos_token for d in decode_sa							)							)




	@slow
	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	Any    =  CodeGenTokenizer.from_pretrained('Salesforce/codegen-350M-mono'							)

						__a      :	Optional[int]    =  '\nif len_a > len_b:\n    result = a\nelse:\n    result = b\n\n\n\n#'
						__a      :	Tuple    =  '\nif len_a > len_b:      result = a\nelse:      result = b'

						__a      :	Optional[int]    =  tokenizer.encode(__a							)
						__a      :	Union[str, Any]    =  ['^#', re.escape('<|endoftext|>'							), '^\'\'\'', '^"""', '\n\n\n']
						__a      :	Tuple    =  tokenizer.decode(__a						,    truncate_before_pattern=__a							)
						self.assertEqual(__a						,    __a							)





	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						pass



