





"""simple docstring"""


import gc
import unittest

import numpy as np
import torch
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    EulerAncestralDiscreteScheduler,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionPanoramaPipeline,
    UNetaDConditionModel,
)
from diffusers.utils import slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu, skip_mps

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin


enable_full_determinism()






@skip_mps
class 							lowercase__			(   __SCREAMING_SNAKE_CASE					,     __SCREAMING_SNAKE_CASE					,     unittest.TestCase	):

			"""simple docstring"""
			__lowerCAmelCase     :				Tuple										=  StableDiffusionPanoramaPipeline
			__lowerCAmelCase     :				int										=  TEXT_TO_IMAGE_PARAMS
			__lowerCAmelCase     :				Union[str, Any]										=  TEXT_TO_IMAGE_BATCH_PARAMS
			__lowerCAmelCase     :				List[str]										=  TEXT_TO_IMAGE_IMAGE_PARAMS
			__lowerCAmelCase     :				Optional[Any]										=  TEXT_TO_IMAGE_IMAGE_PARAMS







			def   _a      (      self    ):






									'''simple docstring'''







									torch.manual_seed(0    )
									UpperCamelCase				:		int				   =			UNetaDConditionModel(
									    block_out_channels=(3_2, 6_4)						,   layers_per_block=1						,   sample_size=3_2						,   in_channels=4						,   out_channels=4						,   down_block_types=("""DownBlock2D""", """CrossAttnDownBlock2D""")						,   up_block_types=("""CrossAttnUpBlock2D""", """UpBlock2D""")						,   cross_attention_dim=3_2						,   )
									UpperCamelCase				:		str				   =			DDIMScheduler()
									torch.manual_seed(0    )
									UpperCamelCase				:		Dict				   =			AutoencoderKL(
									    block_out_channels=[3_2, 6_4]						,   in_channels=3						,   out_channels=3						,   down_block_types=["""DownEncoderBlock2D""", """DownEncoderBlock2D"""]						,   up_block_types=["""UpDecoderBlock2D""", """UpDecoderBlock2D"""]						,   latent_channels=4						,   )
									torch.manual_seed(0    )
									UpperCamelCase				:		Tuple				   =			CLIPTextConfig(
									    bos_token_id=0						,   eos_token_id=2						,   hidden_size=3_2						,   intermediate_size=3_7						,   layer_norm_eps=1e-0_5						,   num_attention_heads=4						,   num_hidden_layers=5						,   pad_token_id=1						,   vocab_size=1_0_0_0						,   )
									UpperCamelCase				:		Union[str, Any]				   =			CLIPTextModel(_A    )
									UpperCamelCase				:		str				   =			CLIPTokenizer.from_pretrained("""hf-internal-testing/tiny-random-clip"""    )

									UpperCamelCase				:		Optional[Any]				   =			{
									    """unet""": unet,
									    """scheduler""": scheduler,
									    """vae""": vae,
									    """text_encoder""": text_encoder,
									    """tokenizer""": tokenizer,
									    """safety_checker""": None,
									    """feature_extractor""": None,
									}
									return components







			def   _a      (      self						,   _A						,   _A=0    ):






									'''simple docstring'''







									UpperCamelCase				:		Tuple				   =			torch.manual_seed(_A    )
									UpperCamelCase				:		Optional[Any]				   =			{
									    """prompt""": """a photo of the dolomites""",
									    """generator""": generator,
									    # Setting height and width to None to prevent OOMs on CPU.
									    """height""": None,
									    """width""": None,
									    """num_inference_steps""": 1,
									    """guidance_scale""": 6.0,
									    """output_type""": """numpy""",
									}
									return inputs







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		List[Any]				   =			"""cpu"""  # ensure determinism for the device-dependent torch.Generator
									UpperCamelCase				:		Dict				   =			self.get_dummy_components()
									UpperCamelCase				:		str				   =			StableDiffusionPanoramaPipeline(**_A    )
									UpperCamelCase				:		Optional[int]				   =			sd_pipe.to(_A    )
									sd_pipe.set_progress_bar_config(disable=_A    )

									UpperCamelCase				:		str				   =			self.get_dummy_inputs(_A    )
									UpperCamelCase				:		Any				   =			sd_pipe(**_A    ).images
									UpperCamelCase				:		Optional[int]				   =			image[0, -3:, -3:, -1]
									assert image.shape == (1, 6_4, 6_4, 3)

									UpperCamelCase				:		Optional[Any]				   =			np.array([0.61_86, 0.53_74, 0.49_15, 0.41_35, 0.41_14, 0.45_63, 0.51_28, 0.49_77, 0.47_57]    )

									assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2







			def   _a      (      self    ):






									'''simple docstring'''







									super().test_inference_batch_consistent(batch_sizes=[1, 2]    )







			def   _a      (      self    ):






									'''simple docstring'''







									super().test_inference_batch_single_identical(batch_size=2						,   expected_max_diff=3.2_5e-3    )







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		Any				   =			"""cpu"""  # ensure determinism for the device-dependent torch.Generator
									UpperCamelCase				:		int				   =			self.get_dummy_components()
									UpperCamelCase				:		List[Any]				   =			StableDiffusionPanoramaPipeline(**_A    )
									UpperCamelCase				:		List[str]				   =			sd_pipe.to(_A    )
									sd_pipe.set_progress_bar_config(disable=_A    )

									UpperCamelCase				:		List[Any]				   =			self.get_dummy_inputs(_A    )
									UpperCamelCase				:		List[Any]				   =			"""french fries"""
									UpperCamelCase				:		int				   =			sd_pipe(**_A						,   negative_prompt=_A    )
									UpperCamelCase				:		Optional[int]				   =			output.images
									UpperCamelCase				:		Union[str, Any]				   =			image[0, -3:, -3:, -1]

									assert image.shape == (1, 6_4, 6_4, 3)

									UpperCamelCase				:		Optional[int]				   =			np.array([0.61_87, 0.53_75, 0.49_15, 0.41_36, 0.41_14, 0.45_63, 0.51_28, 0.49_76, 0.47_57]    )

									assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		Dict				   =			"""cpu"""  # ensure determinism for the device-dependent torch.Generator
									UpperCamelCase				:		Dict				   =			self.get_dummy_components()
									UpperCamelCase				:		Any				   =			StableDiffusionPanoramaPipeline(**_A    )
									UpperCamelCase				:		List[str]				   =			sd_pipe.to(_A    )
									sd_pipe.set_progress_bar_config(disable=_A    )

									UpperCamelCase				:		int				   =			self.get_dummy_inputs(_A    )
									UpperCamelCase				:		Union[str, Any]				   =			sd_pipe(**_A						,   view_batch_size=2    )
									UpperCamelCase				:		Tuple				   =			output.images
									UpperCamelCase				:		Optional[int]				   =			image[0, -3:, -3:, -1]

									assert image.shape == (1, 6_4, 6_4, 3)

									UpperCamelCase				:		Union[str, Any]				   =			np.array([0.61_87, 0.53_75, 0.49_15, 0.41_36, 0.41_14, 0.45_63, 0.51_28, 0.49_76, 0.47_57]    )

									assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		str				   =			"""cpu"""  # ensure determinism for the device-dependent torch.Generator
									UpperCamelCase				:		List[str]				   =			self.get_dummy_components()
									UpperCamelCase				:		Optional[Any]				   =			EulerAncestralDiscreteScheduler(
									    beta_start=0.0_00_85						,   beta_end=0.0_12						,   beta_schedule="""scaled_linear"""    )
									UpperCamelCase				:		Optional[int]				   =			StableDiffusionPanoramaPipeline(**_A    )
									UpperCamelCase				:		str				   =			sd_pipe.to(_A    )
									sd_pipe.set_progress_bar_config(disable=_A    )

									UpperCamelCase				:		Any				   =			self.get_dummy_inputs(_A    )
									UpperCamelCase				:		Optional[Any]				   =			sd_pipe(**_A    ).images
									UpperCamelCase				:		int				   =			image[0, -3:, -3:, -1]

									assert image.shape == (1, 6_4, 6_4, 3)

									UpperCamelCase				:		Any				   =			np.array([0.40_24, 0.65_10, 0.49_01, 0.53_78, 0.58_13, 0.56_22, 0.47_95, 0.44_67, 0.49_52]    )

									assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		List[Any]				   =			"""cpu"""  # ensure determinism for the device-dependent torch.Generator
									UpperCamelCase				:		Optional[int]				   =			self.get_dummy_components()
									UpperCamelCase				:		Any				   =			PNDMScheduler(
									    beta_start=0.0_00_85						,   beta_end=0.0_12						,   beta_schedule="""scaled_linear"""						,   skip_prk_steps=_A    )
									UpperCamelCase				:		Any				   =			StableDiffusionPanoramaPipeline(**_A    )
									UpperCamelCase				:		Dict				   =			sd_pipe.to(_A    )
									sd_pipe.set_progress_bar_config(disable=_A    )

									UpperCamelCase				:		List[Any]				   =			self.get_dummy_inputs(_A    )
									UpperCamelCase				:		int				   =			sd_pipe(**_A    ).images
									UpperCamelCase				:		Dict				   =			image[0, -3:, -3:, -1]

									assert image.shape == (1, 6_4, 6_4, 3)

									UpperCamelCase				:		List[Any]				   =			np.array([0.63_91, 0.62_91, 0.48_61, 0.51_34, 0.55_52, 0.45_78, 0.50_32, 0.50_23, 0.45_39]    )

									assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-2






@slow
@require_torch_gpu
class 							lowercase__			(   unittest.TestCase	):

			"""simple docstring"""







			def   _a      (      self    ):






									'''simple docstring'''







									super().tearDown()
									gc.collect()
									torch.cuda.empty_cache()







			def   _a      (      self						,   _A=0    ):






									'''simple docstring'''







									UpperCamelCase				:		Optional[Any]				   =			torch.manual_seed(_A    )
									UpperCamelCase				:		Optional[Any]				   =			{
									    """prompt""": """a photo of the dolomites""",
									    """generator""": generator,
									    """num_inference_steps""": 3,
									    """guidance_scale""": 7.5,
									    """output_type""": """numpy""",
									}
									return inputs







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		Optional[Any]				   =			"""stabilityai/stable-diffusion-2-base"""
									UpperCamelCase				:		Union[str, Any]				   =			DDIMScheduler.from_pretrained(_A						,   subfolder="""scheduler"""    )
									UpperCamelCase				:		Union[str, Any]				   =			StableDiffusionPanoramaPipeline.from_pretrained(_A						,   scheduler=_A						,   safety_checker=_A    )
									pipe.to(_A    )
									pipe.set_progress_bar_config(disable=_A    )
									pipe.enable_attention_slicing()

									UpperCamelCase				:		List[Any]				   =			self.get_inputs()
									UpperCamelCase				:		Tuple				   =			pipe(**_A    ).images
									UpperCamelCase				:		List[str]				   =			image[0, -3:, -3:, -1].flatten()

									assert image.shape == (1, 5_1_2, 2_0_4_8, 3)

									UpperCamelCase				:		Optional[Any]				   =			np.array(
									    [
									        0.36_96_83_92,
									        0.27_02_53_72,
									        0.32_44_67_66,
									        0.28_37_93_87,
									        0.36_36_32_74,
									        0.30_73_33_47,
									        0.27_10_00_27,
									        0.27_05_41_25,
									        0.25_53_60_96,
									    ]    )

									assert np.abs(expected_slice - image_slice    ).max() < 1e-2







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		Dict				   =			StableDiffusionPanoramaPipeline.from_pretrained(
									    """stabilityai/stable-diffusion-2-base"""						,   safety_checker=_A    )
									UpperCamelCase				:		Tuple				   =			LMSDiscreteScheduler.from_config(pipe.scheduler.config    )
									pipe.to(_A    )
									pipe.set_progress_bar_config(disable=_A    )
									pipe.enable_attention_slicing()

									UpperCamelCase				:		Any				   =			self.get_inputs()
									UpperCamelCase				:		str				   =			pipe(**_A    ).images
									UpperCamelCase				:		List[Any]				   =			image[0, -3:, -3:, -1].flatten()

									assert image.shape == (1, 5_1_2, 2_0_4_8, 3)

									UpperCamelCase				:		Union[str, Any]				   =			np.array(
									    [
									        [
									            0.0,
									            0.0,
									            0.0,
									            0.0,
									            0.0,
									            0.0,
									            0.0,
									            0.0,
									            0.0,
									        ]
									    ]    )

									assert np.abs(expected_slice - image_slice    ).max() < 1e-3







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		Optional[Any]				   =			0

									def callback_fn(_A						,   _A						,   _A    ) -> None:
															UpperCamelCase				:		List[Any]				   =			True
															nonlocal number_of_steps
															number_of_steps += 1
															if step == 1:
																					UpperCamelCase				:		Optional[Any]				   =			latents.detach().cpu().numpy()
																					assert latents.shape == (1, 4, 6_4, 2_5_6)
																					UpperCamelCase				:		Tuple				   =			latents[0, -3:, -3:, -1]

																					UpperCamelCase				:		int				   =			np.array(
																					    [
																					        0.18_68_18_69,
																					        0.33_90_78_16,
																					        0.5_36_12_76,
																					        0.14_43_28_65,
																					        -0.02_85_66_11,
																					        -0.73_94_11_23,
																					        0.23_39_79_87,
																					        0.47_32_26_82,
																					        -0.37_82_31_64,
																					    ]    )
																					assert np.abs(latents_slice.flatten() - expected_slice    ).max() < 5e-2
															elif step == 2:
																					UpperCamelCase				:		str				   =			latents.detach().cpu().numpy()
																					assert latents.shape == (1, 4, 6_4, 2_5_6)
																					UpperCamelCase				:		List[Any]				   =			latents[0, -3:, -3:, -1]

																					UpperCamelCase				:		Dict				   =			np.array(
																					    [
																					        0.18_53_96_45,
																					        0.33_98_72_48,
																					        0.5_37_85_59,
																					        0.14_43_71_42,
																					        -0.02_45_52_61,
																					        -0.7_33_83_17,
																					        0.23_99_07_55,
																					        0.47_35_62_72,
																					        -0.3_78_65_05,
																					    ]    )

																					assert np.abs(latents_slice.flatten() - expected_slice    ).max() < 5e-2

									UpperCamelCase				:		List[Any]				   =			False

									UpperCamelCase				:		Union[str, Any]				   =			"""stabilityai/stable-diffusion-2-base"""
									UpperCamelCase				:		Dict				   =			DDIMScheduler.from_pretrained(_A						,   subfolder="""scheduler"""    )
									UpperCamelCase				:		Optional[Any]				   =			StableDiffusionPanoramaPipeline.from_pretrained(_A						,   scheduler=_A						,   safety_checker=_A    )
									UpperCamelCase				:		int				   =			pipe.to(_A    )
									pipe.set_progress_bar_config(disable=_A    )
									pipe.enable_attention_slicing()

									UpperCamelCase				:		Tuple				   =			self.get_inputs()
									pipe(**_A						,   callback=_A						,   callback_steps=1    )
									assert callback_fn.has_been_called
									assert number_of_steps == 3







			def   _a      (      self    ):






									'''simple docstring'''







									torch.cuda.empty_cache()
									torch.cuda.reset_max_memory_allocated()
									torch.cuda.reset_peak_memory_stats()

									UpperCamelCase				:		Optional[Any]				   =			"""stabilityai/stable-diffusion-2-base"""
									UpperCamelCase				:		Any				   =			DDIMScheduler.from_pretrained(_A						,   subfolder="""scheduler"""    )
									UpperCamelCase				:		List[Any]				   =			StableDiffusionPanoramaPipeline.from_pretrained(_A						,   scheduler=_A						,   safety_checker=_A    )
									UpperCamelCase				:		Dict				   =			pipe.to(_A    )
									pipe.set_progress_bar_config(disable=_A    )
									pipe.enable_attention_slicing(1    )
									pipe.enable_sequential_cpu_offload()

									UpperCamelCase				:		int				   =			self.get_inputs()
									UpperCamelCase				:		List[str]				   =			pipe(**_A    )

									UpperCamelCase				:		Optional[int]				   =			torch.cuda.max_memory_allocated()
									# make sure that less than 5.2 GB is allocated
									assert mem_bytes < 5.5 * 1_0**9





from collections.abc import Iterable
from typing import Any





class     lowerCamelCase      :







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







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= value
				SCREAMING_SNAKE_CASE     						= None  # Added in order to delete a node easier
				SCREAMING_SNAKE_CASE     						= None
				SCREAMING_SNAKE_CASE     						= None







	def __repr__(     self      :Tuple			)		->      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     lowerCamelCase      :







	def __init__(     self      :Union[str, Any]   ,     lowercase      :Node | None = None			)		->      Dict:







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= root







	def __str__(     self      :int			)		->      str:







				"""simple docstring"""






				return str(self.root			)







	def  snake_case__     (     self      :Optional[Any]   ,     lowercase      :Node   ,     lowercase      :Node | None			)		->      None:







				"""simple docstring"""






				if new_children is not None:  # reset its kids
							SCREAMING_SNAKE_CASE     						= node.parent
				if node.parent is not None:  # reset its parent
							if self.is_right(lowercase			):  # If it is the right children
										SCREAMING_SNAKE_CASE     						= new_children
							else:
										SCREAMING_SNAKE_CASE     						= new_children
				else:
							SCREAMING_SNAKE_CASE     						= new_children







	def  snake_case__     (     self      :List[str]   ,     lowercase      :Node			)		->      bool:







				"""simple docstring"""






				if node.parent and node.parent.right:
							return node == node.parent.right
				return False







	def  snake_case__     (     self      :Tuple			)		->      bool:







				"""simple docstring"""






				return self.root is None







	def  snake_case__     (     self      :Union[str, Any]   ,     lowercase      :List[Any]			)		->      None:







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= Node(lowercase			)  # create a new Node
				if self.empty():  # if Tree is empty
							SCREAMING_SNAKE_CASE     						= new_node  # set its root
				else:  # Tree is not empty
							SCREAMING_SNAKE_CASE     						= 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:
																SCREAMING_SNAKE_CASE     						= new_node  # We insert the new node in a leaf
																break
													else:
																SCREAMING_SNAKE_CASE     						= parent_node.left
										else:
													if parent_node.right is None:
																SCREAMING_SNAKE_CASE     						= new_node
																break
													else:
																SCREAMING_SNAKE_CASE     						= parent_node.right
							SCREAMING_SNAKE_CASE     						= parent_node







	def  snake_case__     (     self      :Union[str, Any]   ,     *lowercase      :Optional[int]			)		->      None:







				"""simple docstring"""






				for value in values:
							self.__insert(lowercase			)







	def  snake_case__     (     self      :Union[str, Any]   ,     lowercase      :Any			)		->      Node | None:







				"""simple docstring"""






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







	def  snake_case__     (     self      :str   ,     lowercase      :Node | None = None			)		->      Node | None:







				"""simple docstring"""






				if node is None:
							if self.root is None:
										return None
							SCREAMING_SNAKE_CASE     						= self.root

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







	def  snake_case__     (     self      :int   ,     lowercase      :Node | None = None			)		->      Node | None:







				"""simple docstring"""






				if node is None:
							SCREAMING_SNAKE_CASE     						= self.root
				if self.root is None:
							return None
				if not self.empty():
							SCREAMING_SNAKE_CASE     						= self.root
							while node.left is not None:
										SCREAMING_SNAKE_CASE     						= node.left
				return node







	def  snake_case__     (     self      :Optional[int]   ,     lowercase      :int			)		->      None:







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= self.search(lowercase			)  # 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(lowercase   ,     lowercase			)
							elif node.left is None:  # Has only right children
										self.__reassign_nodes(lowercase   ,     node.right			)
							elif node.right is None:  # Has only left children
										self.__reassign_nodes(lowercase   ,     node.left			)
							else:
										SCREAMING_SNAKE_CASE     						= self.get_max(
										    node.left			)  # Gets the max value of the left branch
										self.remove(tmp_node.value			)  # type: ignore
										SCREAMING_SNAKE_CASE     						= (
										    tmp_node.value  # type: ignore
										)  # Assigns the value to the node to delete and keep tree structure







	def  snake_case__     (     self      :Dict   ,     lowercase      :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  snake_case__     (     self      :Tuple   ,     lowercase      :List[str]=None			)		->      Any:







				"""simple docstring"""






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







	def  snake_case__     (     self      :Optional[Any]   ,     lowercase      :list   ,     lowercase      :Node | None			)		->      None:







				"""simple docstring"""






				if node:
							self.inorder(lowercase   ,     node.left			)
							arr.append(node.value			)
							self.inorder(lowercase   ,     node.right			)







	def  snake_case__     (     self      :Tuple   ,     lowercase      :int   ,     lowercase      :Node			)		->      int:







				"""simple docstring"""






				SCREAMING_SNAKE_CASE     						= []
				self.inorder(lowercase   ,     lowercase			)  # append all values to list using inorder traversal
				return arr[k - 1]



def    a      ( a	)     ->list[Node]:




			'''simple docstring'''


			SCREAMING_SNAKE_CASE     						= []
			if curr_node is not None:
						SCREAMING_SNAKE_CASE     						= postorder(curr_node.left	) + postorder(curr_node.right	) + [curr_node]
			return node_list


def    a      ( )     ->None:




			'''simple docstring'''


			SCREAMING_SNAKE_CASE     						= (8, 3, 6, 1, 10, 14, 13, 4, 7)
			SCREAMING_SNAKE_CASE     						= BinarySearchTree()
			for i in testlist:
						t.insert(a	)

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

			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(a	)
						print(a	)


if __name__ == "__main__":
							import doctest

							doctest.testmod(verbose=True)