





'''simple docstring'''







import json
import os
from functools import lru_cache
from typing import Dict, List, Optional, Tuple, Union

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...tokenization_utils_base import BatchEncoding, EncodedInput
from ...utils import PaddingStrategy, logging


snake_case_     :       Optional[Any]						=  logging.get_logger(__name__)


snake_case_     :       List[Any]						=  {"vocab_file": "vocab.json", "merges_file": "merges.txt"}

# See all LED models at https://huggingface.co/models?filter=LED
snake_case_     :       Optional[Any]						=  {
    "vocab_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json",
    },
    "merges_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt",
    },
    "tokenizer_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json",
    },
}

snake_case_     :       Union[str, Any]						=  {
    "allenai/led-base-16384": 1_63_84,
}





@lru_cache()
# Copied from transformers.models.bart.tokenization_bart.bytes_to_unicode
def        lowerCamelCase_      (  ) ->	List[Any]:
							UpperCAmelCase_			:      List[str]     						=  (
							    list(range(ord('''!'''   ),			ord('''~'''   ) + 1   )   ) + list(range(ord('''¡'''   ),			ord('''¬'''   ) + 1   )   ) + list(range(ord('''®'''   ),			ord('''ÿ'''   ) + 1   )   )
							)
							UpperCAmelCase_			:      List[Any]     						=  bs[:]
							UpperCAmelCase_			:      List[Any]     						=  0
							for b in range(2**8   ):
														if b not in bs:
																					bs.append(SCREAMING_SNAKE_CASE__   )
																					cs.append(2**8 + n   )
																					n += 1
							UpperCAmelCase_			:      Dict     						=  [chr(SCREAMING_SNAKE_CASE__   ) for n in cs]
							return dict(zip(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   )   )





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			Tuple   ) ->	Optional[int]:
							UpperCAmelCase_			:      Optional[int]     						=  set()
							UpperCAmelCase_			:      Any     						=  word[0]
							for char in word[1:]:
														pairs.add((prev_char, char)   )
														UpperCAmelCase_			:      List[str]     						=  char
							return pairs


class 					__a      (lowerCamelCase     ):
							__a					:   Tuple									=       VOCAB_FILES_NAMES
							__a					:   int									=       PRETRAINED_VOCAB_FILES_MAP
							__a					:   Optional[Any]									=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							__a					:   str									=       ["input_ids", "attention_mask"]

							def __init__(							self							:     Dict       ,     __magic_name__							:     Any       ,     __magic_name__							:     int       ,     __magic_name__							:     str="replace"       ,     __magic_name__							:     Any="<s>"       ,     __magic_name__							:     int="</s>"       ,     __magic_name__							:     Tuple="</s>"       ,     __magic_name__							:     List[str]="<s>"       ,     __magic_name__							:     List[Any]="<unk>"       ,     __magic_name__							:     Tuple="<pad>"       ,     __magic_name__							:     str="<mask>"       ,     __magic_name__							:     Optional[Any]=False       ,     **__magic_name__							:     int       ,     )					->       int:







														"""simple docstring"""
														UpperCAmelCase_			:      int     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else bos_token
														UpperCAmelCase_			:      int     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else eos_token
														UpperCAmelCase_			:      List[Any]     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else sep_token
														UpperCAmelCase_			:      Dict     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else cls_token
														UpperCAmelCase_			:      Optional[int]     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else unk_token
														UpperCAmelCase_			:      Dict     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else pad_token

														# Mask token behave like a normal word, i.e. include the space before it
														UpperCAmelCase_			:      List[str]     						=  AddedToken(__magic_name__       ,     lstrip=__magic_name__       ,     rstrip=__magic_name__   ) if isinstance(__magic_name__       ,     __magic_name__   ) else mask_token

														super().__init__(
														    errors=__magic_name__       ,     bos_token=__magic_name__       ,     eos_token=__magic_name__       ,     unk_token=__magic_name__       ,     sep_token=__magic_name__       ,     cls_token=__magic_name__       ,     pad_token=__magic_name__       ,     mask_token=__magic_name__       ,     add_prefix_space=__magic_name__       ,     **__magic_name__       ,     )

														with open(__magic_name__       ,     encoding='''utf-8'''   ) as vocab_handle:
																					UpperCAmelCase_			:      Optional[Any]     						=  json.load(__magic_name__   )
														UpperCAmelCase_			:      int     						=  {v: k for k, v in self.encoder.items()}
														UpperCAmelCase_			:      int     						=  errors  # how to handle errors in decoding
														UpperCAmelCase_			:      Tuple     						=  bytes_to_unicode()
														UpperCAmelCase_			:      Optional[Any]     						=  {v: k for k, v in self.byte_encoder.items()}
														with open(__magic_name__       ,     encoding='''utf-8'''   ) as merges_handle:
																					UpperCAmelCase_			:      Any     						=  merges_handle.read().split('''\n'''   )[1:-1]
														UpperCAmelCase_			:      str     						=  [tuple(merge.split()   ) for merge in bpe_merges]
														UpperCAmelCase_			:      int     						=  dict(zip(__magic_name__       ,     range(len(__magic_name__   )   )   )   )
														UpperCAmelCase_			:      List[Any]     						=  {}
														UpperCAmelCase_			:      Tuple     						=  add_prefix_space

														# Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
														UpperCAmelCase_			:      Dict     						=  re.compile(R'''\'s|\'t|\'re|\'ve|\'m|\'ll|\'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+'''   )

							@property
							# Copied from transformers.models.bart.tokenization_bart.BartTokenizer.vocab_size
							def     UpperCAmelCase__	(							self							:     List[Any]   )					->       Tuple:







														"""simple docstring"""
														return len(self.encoder   )

							def     UpperCAmelCase__	(							self							:     List[Any]   )					->       Dict:







														"""simple docstring"""
														return dict(self.encoder       ,     **self.added_tokens_encoder   )

							def     UpperCAmelCase__	(							self							:     List[str]       ,     __magic_name__							:     List[str]   )					->       Tuple:







														"""simple docstring"""
														if token in self.cache:
																					return self.cache[token]
														UpperCAmelCase_			:      List[str]     						=  tuple(__magic_name__   )
														UpperCAmelCase_			:      Optional[Any]     						=  get_pairs(__magic_name__   )

														if not pairs:
																					return token

														while True:
																					UpperCAmelCase_			:      str     						=  min(__magic_name__       ,     key=lambda __magic_name__   : self.bpe_ranks.get(__magic_name__       ,     float('''inf'''   )   )   )
																					if bigram not in self.bpe_ranks:
																												break
																					UpperCAmelCase_			:      Union[str, Any]     						=  bigram
																					UpperCAmelCase_			:      List[str]     						=  []
																					UpperCAmelCase_			:      List[str]     						=  0
																					while i < len(__magic_name__   ):
																												try:
																																			UpperCAmelCase_			:      Tuple     						=  word.index(__magic_name__       ,     __magic_name__   )
																												except ValueError:
																																			new_word.extend(word[i:]   )
																																			break
																												else:
																																			new_word.extend(word[i:j]   )
																																			UpperCAmelCase_			:      List[str]     						=  j

																												if word[i] == first and i < len(__magic_name__   ) - 1 and word[i + 1] == second:
																																			new_word.append(first + second   )
																																			i += 2
																												else:
																																			new_word.append(word[i]   )
																																			i += 1
																					UpperCAmelCase_			:      Tuple     						=  tuple(__magic_name__   )
																					UpperCAmelCase_			:      Any     						=  new_word
																					if len(__magic_name__   ) == 1:
																												break
																					else:
																												UpperCAmelCase_			:      Union[str, Any]     						=  get_pairs(__magic_name__   )
														UpperCAmelCase_			:      List[Any]     						=  ''' '''.join(__magic_name__   )
														UpperCAmelCase_			:      Tuple     						=  word
														return word

							def     UpperCAmelCase__	(							self							:     int       ,     __magic_name__							:     List[str]   )					->       Any:







														"""simple docstring"""
														UpperCAmelCase_			:      List[Any]     						=  []
														for token in re.findall(self.pat       ,     __magic_name__   ):
																					UpperCAmelCase_			:      Union[str, Any]     						=  ''''''.join(
																					    self.byte_encoder[b] for b in token.encode('''utf-8'''   )   )  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
																					bpe_tokens.extend(bpe_token for bpe_token in self.bpe(__magic_name__   ).split(''' '''   )   )
														return bpe_tokens

							def     UpperCAmelCase__	(							self							:     Any       ,     __magic_name__							:     Optional[int]   )					->       List[str]:







														"""simple docstring"""
														return self.encoder.get(__magic_name__       ,     self.encoder.get(self.unk_token   )   )

							def     UpperCAmelCase__	(							self							:     Union[str, Any]       ,     __magic_name__							:     int   )					->       Any:







														"""simple docstring"""
														return self.decoder.get(__magic_name__   )

							def     UpperCAmelCase__	(							self							:     Union[str, Any]       ,     __magic_name__							:     Union[str, Any]   )					->       List[str]:







														"""simple docstring"""
														UpperCAmelCase_			:      Any     						=  ''''''.join(__magic_name__   )
														UpperCAmelCase_			:      str     						=  bytearray([self.byte_decoder[c] for c in text]   ).decode('''utf-8'''       ,     errors=self.errors   )
														return text

							def     UpperCAmelCase__	(							self							:     Optional[Any]       ,     __magic_name__							:     str       ,     __magic_name__							:     Optional[str] = None   )					->       Tuple[str]:







														"""simple docstring"""
														if not os.path.isdir(__magic_name__   ):
																					logger.error(F"""Vocabulary path ({save_directory}) should be a directory"""   )
																					return
														UpperCAmelCase_			:      Union[str, Any]     						=  os.path.join(
														    __magic_name__       ,     (filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file''']   )
														UpperCAmelCase_			:      Optional[int]     						=  os.path.join(
														    __magic_name__       ,     (filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''merges_file''']   )

														with open(__magic_name__       ,     '''w'''       ,     encoding='''utf-8'''   ) as f:
																					f.write(json.dumps(self.encoder       ,     indent=2       ,     sort_keys=__magic_name__       ,     ensure_ascii=__magic_name__   ) + '''\n'''   )

														UpperCAmelCase_			:      Tuple     						=  0
														with open(__magic_name__       ,     '''w'''       ,     encoding='''utf-8'''   ) as writer:
																					writer.write('''#version: 0.2\n'''   )
																					for bpe_tokens, token_index in sorted(self.bpe_ranks.items()       ,     key=lambda __magic_name__   : kv[1]   ):
																												if index != token_index:
																																			logger.warning(
																																			    F"""Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."""
																																			    ''' Please check that the tokenizer is not corrupted!'''   )
																																			UpperCAmelCase_			:      int     						=  token_index
																												writer.write(''' '''.join(__magic_name__   ) + '''\n'''   )
																												index += 1

														return vocab_file, merge_file

							def     UpperCAmelCase__	(							self							:     List[str]       ,     __magic_name__							:     List[int]       ,     __magic_name__							:     Optional[List[int]] = None   )					->       List[int]:







														"""simple docstring"""
														if token_ids_a is None:
																					return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
														UpperCAmelCase_			:      Any     						=  [self.cls_token_id]
														UpperCAmelCase_			:      int     						=  [self.sep_token_id]
														return cls + token_ids_a + sep + sep + token_ids_a + sep

							def     UpperCAmelCase__	(							self							:     Any       ,     __magic_name__							:     List[int]       ,     __magic_name__							:     Optional[List[int]] = None       ,     __magic_name__							:     bool = False   )					->       List[int]:







														"""simple docstring"""
														if already_has_special_tokens:
																					return super().get_special_tokens_mask(
																					    token_ids_a=__magic_name__       ,     token_ids_a=__magic_name__       ,     already_has_special_tokens=__magic_name__   )

														if token_ids_a is None:
																					return [1] + ([0] * len(__magic_name__   )) + [1]
														return [1] + ([0] * len(__magic_name__   )) + [1, 1] + ([0] * len(__magic_name__   )) + [1]

							def     UpperCAmelCase__	(							self							:     List[Any]       ,     __magic_name__							:     List[int]       ,     __magic_name__							:     Optional[List[int]] = None   )					->       List[int]:







														"""simple docstring"""
														UpperCAmelCase_			:      List[Any]     						=  [self.sep_token_id]
														UpperCAmelCase_			:      int     						=  [self.cls_token_id]

														if token_ids_a is None:
																					return len(cls + token_ids_a + sep   ) * [0]
														return len(cls + token_ids_a + sep + sep + token_ids_a + sep   ) * [0]

							def     UpperCAmelCase__	(							self							:     str       ,     __magic_name__							:     Union[str, Any]       ,     __magic_name__							:     str=False       ,     **__magic_name__							:     Any   )					->       List[Any]:







														"""simple docstring"""
														UpperCAmelCase_			:      Tuple     						=  kwargs.pop('''add_prefix_space'''       ,     self.add_prefix_space   )
														if (is_split_into_words or add_prefix_space) and (len(__magic_name__   ) > 0 and not text[0].isspace()):
																					UpperCAmelCase_			:      Tuple     						=  ''' ''' + text
														return (text, kwargs)



							def     UpperCAmelCase__	(							self							:     Union[str, Any]       ,     __magic_name__							:     Union[Dict[str, EncodedInput], BatchEncoding]       ,     __magic_name__							:     Optional[int] = None       ,     __magic_name__							:     PaddingStrategy = PaddingStrategy.DO_NOT_PAD       ,     __magic_name__							:     Optional[int] = None       ,     __magic_name__							:     Optional[bool] = None       ,     )					->       dict:







														"""simple docstring"""
														UpperCAmelCase_			:      Any     						=  super()._pad(
														    encoded_inputs=__magic_name__       ,     max_length=__magic_name__       ,     padding_strategy=__magic_name__       ,     pad_to_multiple_of=__magic_name__       ,     return_attention_mask=__magic_name__       ,     )

														# Load from model defaults
														if return_attention_mask is None:
																					UpperCAmelCase_			:      int     						=  '''attention_mask''' in self.model_input_names

														if return_attention_mask and "global_attention_mask" in encoded_inputs:
																					UpperCAmelCase_			:      int     						=  encoded_inputs[self.model_input_names[0]]
																					# `global_attention_mask` need to have the same length as other (sequential) inputs.
																					UpperCAmelCase_			:      List[str]     						=  len(encoded_inputs['''global_attention_mask''']   ) != len(__magic_name__   )

																					if needs_to_be_padded:
																												UpperCAmelCase_			:      Union[str, Any]     						=  len(__magic_name__   ) - len(encoded_inputs['''global_attention_mask''']   )

																												if self.padding_side == "right":
																																			# Use `-1` since `0` in `global_attention_mask` means `local attention` instead of `not to attend`
																																			UpperCAmelCase_			:      Union[str, Any]     						=  (
																																			    encoded_inputs['''global_attention_mask'''] + [-1] * difference
																																			)
																												elif self.padding_side == "left":
																																			UpperCAmelCase_			:      Any     						=  [-1] * difference + encoded_inputs[
																																			    '''global_attention_mask'''
																																			]
																												else:
																																			raise ValueError('''Invalid padding strategy:''' + str(self.padding_side   )   )

														return encoded_inputs












'''simple docstring'''







from collections.abc import Iterable
from typing import Any


class 					__a      :

							def __init__(							self							:     Optional[Any]       ,     __magic_name__							:     int | None = None   )					->       Tuple:







													"""simple docstring"""
													UpperCAmelCase_			:      List[str]     						=  value
													UpperCAmelCase_			:      Node | None     						=  None  # Added in order to delete a node easier
													UpperCAmelCase_			:      Node | None     						=  None
													UpperCAmelCase_			:      Node | None     						=  None



							def __repr__(							self							:     List[str]   )					->       str:







													"""simple docstring"""
													from pprint import pformat

													if self.left is None and self.right is None:
																			return str(self.value   )
													return pformat({F"""{self.value}""": (self.left, self.right)}       ,     indent=1   )





class 					__a      :

							def __init__(							self							:     int       ,     __magic_name__							:     Node | None = None   )					->       Optional[int]:







													"""simple docstring"""
													UpperCAmelCase_			:      str     						=  root

							def __str__(							self							:     Any   )					->       str:







													"""simple docstring"""
													return str(self.root   )

							def     UpperCAmelCase__	(							self							:     Any       ,     __magic_name__							:     Node       ,     __magic_name__							:     Node | None   )					->       None:







													"""simple docstring"""
													if new_children is not None:  # reset its kids
																			UpperCAmelCase_			:      Dict     						=  node.parent
													if node.parent is not None:  # reset its parent
																			if self.is_right(__magic_name__   ):  # If it is the right children
																									UpperCAmelCase_			:      Optional[Any]     						=  new_children
																			else:
																									UpperCAmelCase_			:      Optional[int]     						=  new_children
													else:
																			UpperCAmelCase_			:      List[str]     						=  new_children

							def     UpperCAmelCase__	(							self							:     List[str]       ,     __magic_name__							:     Node   )					->       bool:







													"""simple docstring"""
													if node.parent and node.parent.right:
																			return node == node.parent.right
													return False

							def     UpperCAmelCase__	(							self							:     Union[str, Any]   )					->       bool:







													"""simple docstring"""
													return self.root is None

							def     UpperCAmelCase__	(							self							:     Any       ,     __magic_name__							:     str   )					->       None:







													"""simple docstring"""
													UpperCAmelCase_			:      Tuple     						=  Node(__magic_name__   )  # create a new Node
													if self.empty():  # if Tree is empty
																			UpperCAmelCase_			:      List[Any]     						=  new_node  # set its root
													else:  # Tree is not empty
																			UpperCAmelCase_			:      str     						=  self.root  # from root
																			if parent_node is None:
																									return
																			while True:  # While we don't get to a leaf
																									if value < parent_node.value:  # We go left
																															if parent_node.left is None:
																																					UpperCAmelCase_			:      Union[str, Any]     						=  new_node  # We insert the new node in a leaf
																																					break
																															else:
																																					UpperCAmelCase_			:      List[Any]     						=  parent_node.left
																									else:
																															if parent_node.right is None:
																																					UpperCAmelCase_			:      List[Any]     						=  new_node
																																					break
																															else:
																																					UpperCAmelCase_			:      Union[str, Any]     						=  parent_node.right
																			UpperCAmelCase_			:      Union[str, Any]     						=  parent_node

							def     UpperCAmelCase__	(							self							:     Optional[Any]       ,     *__magic_name__							:     List[str]   )					->       None:







													"""simple docstring"""
													for value in values:
																			self.__insert(__magic_name__   )

							def     UpperCAmelCase__	(							self							:     Dict       ,     __magic_name__							:     int   )					->       Node | None:







													"""simple docstring"""
													if self.empty():
																			raise IndexError('''Warning: Tree is empty! please use another.'''   )
													else:
																			UpperCAmelCase_			:      str     						=  self.root
																			# use lazy evaluation here to avoid NoneType Attribute error
																			while node is not None and node.value is not value:
																									UpperCAmelCase_			:      List[str]     						=  node.left if value < node.value else node.right
																			return node

							def     UpperCAmelCase__	(							self							:     Optional[int]       ,     __magic_name__							:     Node | None = None   )					->       Node | None:







													"""simple docstring"""
													if node is None:
																			if self.root is None:
																									return None
																			UpperCAmelCase_			:      Dict     						=  self.root

													if not self.empty():
																			while node.right is not None:
																									UpperCAmelCase_			:      Any     						=  node.right
													return node

							def     UpperCAmelCase__	(							self							:     Dict       ,     __magic_name__							:     Node | None = None   )					->       Node | None:







													"""simple docstring"""
													if node is None:
																			UpperCAmelCase_			:      Optional[int]     						=  self.root
													if self.root is None:
																			return None
													if not self.empty():
																			UpperCAmelCase_			:      Union[str, Any]     						=  self.root
																			while node.left is not None:
																									UpperCAmelCase_			:      Dict     						=  node.left
													return node

							def     UpperCAmelCase__	(							self							:     Tuple       ,     __magic_name__							:     int   )					->       None:







													"""simple docstring"""
													UpperCAmelCase_			:      List[str]     						=  self.search(__magic_name__   )  # Look for the node with that label
													if node is not None:
																			if node.left is None and node.right is None:  # If it has no children
																									self.__reassign_nodes(__magic_name__       ,     __magic_name__   )
																			elif node.left is None:  # Has only right children
																									self.__reassign_nodes(__magic_name__       ,     node.right   )
																			elif node.right is None:  # Has only left children
																									self.__reassign_nodes(__magic_name__       ,     node.left   )
																			else:
																									UpperCAmelCase_			:      List[str]     						=  self.get_max(
																									    node.left   )  # Gets the max value of the left branch
																									self.remove(tmp_node.value   )  # type: ignore
																									UpperCAmelCase_			:      Optional[int]     						=  (
																									    tmp_node.value  # type: ignore
																									)  # Assigns the value to the node to delete and keep tree structure

							def     UpperCAmelCase__	(							self							:     List[Any]       ,     __magic_name__							:     Node | None   )					->       Iterable:







													"""simple docstring"""
													if node is not None:
																			yield node  # Preorder Traversal
																			yield from self.preorder_traverse(node.left   )
																			yield from self.preorder_traverse(node.right   )

							def     UpperCAmelCase__	(							self							:     List[Any]       ,     __magic_name__							:     List[Any]=None   )					->       Any:







													"""simple docstring"""
													if traversal_function is None:
																			return self.preorder_traverse(self.root   )
													else:
																			return traversal_function(self.root   )

							def     UpperCAmelCase__	(							self							:     Optional[int]       ,     __magic_name__							:     list       ,     __magic_name__							:     Node | None   )					->       None:







													"""simple docstring"""
													if node:
																			self.inorder(__magic_name__       ,     node.left   )
																			arr.append(node.value   )
																			self.inorder(__magic_name__       ,     node.right   )



							def     UpperCAmelCase__	(							self							:     Tuple       ,     __magic_name__							:     int       ,     __magic_name__							:     Node   )					->       int:







													"""simple docstring"""
													UpperCAmelCase_			:      list[int]     						=  []
													self.inorder(__magic_name__       ,     __magic_name__   )  # append all values to list using inorder traversal
													return arr[k - 1]





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			Node | None   ) ->	list[Node]:
						UpperCAmelCase_			:      Any     						=  []
						if curr_node is not None:
												UpperCAmelCase_			:      Any     						=  postorder(curr_node.left   ) + postorder(curr_node.right   ) + [curr_node]
						return node_list





def        lowerCamelCase_      (  ) ->	None:
						UpperCAmelCase_			:      str     						=  (8, 3, 6, 1, 10, 14, 13, 4, 7)
						UpperCAmelCase_			:      Tuple     						=  BinarySearchTree()
						for i in testlist:
												t.insert(SCREAMING_SNAKE_CASE__   )

						# Prints all the elements of the list in order traversal
						print(SCREAMING_SNAKE_CASE__   )

						if t.search(6   ) is not None:
												print('''The value 6 exists'''   )
						else:
												print('''The value 6 doesn\'t exist'''   )

						if t.search(-1   ) is not None:
												print('''The value -1 exists'''   )
						else:
												print('''The value -1 doesn\'t exist'''   )

						if not t.empty():
												print('''Max Value: ''',			t.get_max().value   )  # type: ignore
												print('''Min Value: ''',			t.get_min().value   )  # type: ignore

						for i in testlist:
												t.remove(SCREAMING_SNAKE_CASE__   )
												print(SCREAMING_SNAKE_CASE__   )


if __name__ == "__main__":
					import doctest

					doctest.testmod(verbose=True)





