



"""simple docstring"""






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible






class        __snake_case       (	unittest.TestCase):




  def 						SCREAMING_SNAKE_CASE				( self     :						int		):






         """simple docstring"""






         _lowerCamelCase						:				Union[str, Any]    			= [
             '''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(__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Any		):






         """simple docstring"""






         _lowerCamelCase						:				List[Any]    			= [
             '''unet/diffusion_pytorch_model.bin''',
             '''unet/diffusion_pytorch_model.safetensors''',
         ]
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Union[str, Any]		):






         """simple docstring"""






         _lowerCamelCase						:				Optional[int]    			= [
             '''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(__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Optional[int]		):






         """simple docstring"""






         _lowerCamelCase						:				Optional[Any]    			= [
             '''text_encoder/pytorch_model.bin''',
             '''text_encoder/model.safetensors''',
         ]
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						str		):






         """simple docstring"""






         _lowerCamelCase						:				int    			= [
             '''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(__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Tuple		):






         """simple docstring"""






         _lowerCamelCase						:				int    			= [
             '''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''',
         ]
         _lowerCamelCase						:				Optional[int]    			= '''fp16'''
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Optional[Any]		):






         """simple docstring"""






         _lowerCamelCase						:				Optional[Any]    			= [
             '''unet/diffusion_pytorch_model.fp16.bin''',
             '''unet/diffusion_pytorch_model.fp16.safetensors''',
         ]
         _lowerCamelCase						:				Union[str, Any]    			= '''fp16'''
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						List[Any]		):






         """simple docstring"""






         _lowerCamelCase						:				str    			= [
             '''unet/diffusion_pytorch_model.bin''',
             '''unet/diffusion_pytorch_model.safetensors''',
         ]
         _lowerCamelCase						:				Optional[Any]    			= '''fp16'''
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Tuple		):






         """simple docstring"""






         _lowerCamelCase						:				Tuple    			= [
             '''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',
         ]
         _lowerCamelCase						:				Any    			= '''fp16'''
         self.assertFalse(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						str		):






         """simple docstring"""






         _lowerCamelCase						:				Optional[Any]    			= [
             '''text_encoder/pytorch_model.fp16.bin''',
             '''text_encoder/model.fp16.safetensors''',
         ]
         _lowerCamelCase						:				str    			= '''fp16'''
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Optional[Any]		):






         """simple docstring"""






         _lowerCamelCase						:				Optional[Any]    			= [
             '''text_encoder/pytorch_model.bin''',
             '''text_encoder/model.safetensors''',
         ]
         _lowerCamelCase						:				Union[str, Any]    			= '''fp16'''
         self.assertTrue(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)




  def 						SCREAMING_SNAKE_CASE				( self     :						Any		):






         """simple docstring"""






         _lowerCamelCase						:				int    			= [
             '''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''',
         ]
         _lowerCamelCase						:				int    			= '''fp16'''
         self.assertFalse(is_safetensors_compatible(__lowerCAmelCase						,					variant=__lowerCAmelCase		)		)





from __future__ import annotations

import collections
import pprint
from pathlib import Path





def 					__lowerCamelCase	( UpperCamelCase__      ):







							'''simple docstring'''






							return "".join(sorted(UpperCamelCase__      )      )





def 					__lowerCamelCase	( UpperCamelCase__      ):







							'''simple docstring'''






							return word_by_signature[signature(UpperCamelCase__      )]


_UpperCAmelCase		:   str										=       Path(__file__).parent.joinpath("""words.txt""").read_text(encoding="""utf-8""")
_UpperCAmelCase		:   Dict										=       sorted({word.strip().lower() for word in data.splitlines()})

_UpperCAmelCase		:   List[str]										=       collections.defaultdict(list)
for word in word_list:
					word_by_signature[signature(word)].append(word)

if __name__ == "__main__":
					_UpperCAmelCase		:   Dict										=       {word: anagram(word) for word in word_list if len(anagram(word)) > 1}

					with open("""anagrams.txt""", """w""") as file:
										file.write("""all_anagrams = \n """)
										file.write(pprint.pformat(all_anagrams))




