


"""simple docstring"""


from __future__ import annotations

from typing import Any



class 			lowerCamelCase__						:







						def __init__(							self   :    str			,			_lowercase   :    Tuple = 6		):
								A					       = None
								A					       = None
								self.create_linked_list(__lowerCAmelCase		)







						def __a						(							self   :    List[str]			,			_lowercase   :    List[str]		):
								A					       = Node()
								A					       = current_node
								A					       = current_node
								A					       = current_node
								for _ in range(1			,			__lowerCAmelCase		):
										A					       = Node()
										A					       = current_node
										A					       = previous_node
										A					       = current_node
								A					       = self.front
								A					       = previous_node







						def __a						(							self   :    str		):
								return (
								    self.front == self.rear
								    and self.front is not None
								    and self.front.data is None
								)







						def __a						(							self   :    Union[str, Any]		):
								self.check_can_perform_operation()
								return self.front.data if self.front else None







						def __a						(							self   :    Union[str, Any]			,			_lowercase   :    List[Any]		):







								if self.rear is None:
										return

								self.check_is_full()
								if not self.is_empty():
										A					       = self.rear.next
								if self.rear:
										A					       = data







						def __a						(							self   :    str		):
								self.check_can_perform_operation()
								if self.rear is None or self.front is None:
										return None
								if self.front == self.rear:
										A					       = self.front.data
										A					       = None
										return data

								A					       = self.front
								A					       = old_front.next
								A					       = old_front.data
								A					       = None
								return data







						def __a						(							self   :    Any		):







								if self.is_empty():
										raise Exception('Empty Queue'		)







						def __a						(							self   :    str		):







								if self.rear and self.rear.next == self.front:
										raise Exception('Full Queue'		)



class 			lowerCamelCase__						:







						def __init__(							self   :    Any		):
								A					       = None
								A					       = None
								A					       = None


if __name__ == "__main__":
	import doctest

	doctest.testmod()









"""simple docstring"""


import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible



class 			lowerCamelCase__						(   unittest.TestCase			):







						def __a						(							self   :    Dict		):
								A					       = [
								    'safety_checker/pytorch_model.bin',
								    'safety_checker/model.safetensors',
								    'vae/diffusion_pytorch_model.bin',
								    'vae/diffusion_pytorch_model.safetensors',
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertTrue(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = [
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertTrue(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    int		):
								A					       = [
								    'safety_checker/pytorch_model.bin',
								    'safety_checker/model.safetensors',
								    'vae/diffusion_pytorch_model.bin',
								    'vae/diffusion_pytorch_model.safetensors',
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								    'unet/diffusion_pytorch_model.bin',
								    # Removed: 'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertFalse(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Dict		):
								A					       = [
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								]
								self.assertTrue(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = [
								    'safety_checker/pytorch_model.bin',
								    'safety_checker/model.safetensors',
								    'vae/diffusion_pytorch_model.bin',
								    'vae/diffusion_pytorch_model.safetensors',
								    'text_encoder/pytorch_model.bin',
								    # Removed: 'text_encoder/model.safetensors',
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertFalse(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Any		):
								A					       = [
								    'safety_checker/pytorch_model.fp16.bin',
								    'safety_checker/model.fp16.safetensors',
								    'vae/diffusion_pytorch_model.fp16.bin',
								    'vae/diffusion_pytorch_model.fp16.safetensors',
								    'text_encoder/pytorch_model.fp16.bin',
								    'text_encoder/model.fp16.safetensors',
								    'unet/diffusion_pytorch_model.fp16.bin',
								    'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = [
								    'unet/diffusion_pytorch_model.fp16.bin',
								    'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Optional[Any]		):
								# pass variant but use the non-variant filenames
								A					       = [
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Dict		):
								A					       = [
								    'safety_checker/pytorch_model.fp16.bin',
								    'safety_checker/model.fp16.safetensors',
								    'vae/diffusion_pytorch_model.fp16.bin',
								    'vae/diffusion_pytorch_model.fp16.safetensors',
								    'text_encoder/pytorch_model.fp16.bin',
								    'text_encoder/model.fp16.safetensors',
								    'unet/diffusion_pytorch_model.fp16.bin',
								    # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertFalse(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Dict		):
								A					       = [
								    'text_encoder/pytorch_model.fp16.bin',
								    'text_encoder/model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Any		):
								# pass variant but use the non-variant filenames
								A					       = [
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    List[str]		):
								A					       = [
								    'safety_checker/pytorch_model.fp16.bin',
								    'safety_checker/model.fp16.safetensors',
								    'vae/diffusion_pytorch_model.fp16.bin',
								    'vae/diffusion_pytorch_model.fp16.safetensors',
								    'text_encoder/pytorch_model.fp16.bin',
								    # 'text_encoder/model.fp16.safetensors',
								    'unet/diffusion_pytorch_model.fp16.bin',
								    'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertFalse(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)





