


from collections import defaultdict



def 							UpperCamelCase_( lowerCamelCase_				,					lowerCamelCase_					)       ->		bool:
    _lowercase			:				Any 						=						first_str.lower().strip()
    _lowercase			:				List[str] 						=						second_str.lower().strip()

    # Remove whitespace
    _lowercase			:				str 						=						first_str.replace(' '				,					''					)
    _lowercase			:				List[Any] 						=						second_str.replace(' '				,					''					)

    # Strings of different lengths are not anagrams
    if len(lowerCamelCase_					) != len(lowerCamelCase_					):
        return False

    # Default values for count should be 0
    _lowercase			:				defaultdict[str, int] 						=						defaultdict(lowerCamelCase_					)

    # For each character in input strings,
    # increment count in the corresponding
    for i in range(len(lowerCamelCase_					)					):
        count[first_str[i]] += 1
        count[second_str[i]] -= 1

    return all(_count == 0 for _count in count.values()					)


if __name__ == "__main__":
 from doctest import testmod

 testmod()
 SCREAMING_SNAKE_CASE			: List[Any]				   =					input("Enter the first string ").strip()
 SCREAMING_SNAKE_CASE			: Any				   =					input("Enter the second string ").strip()

 SCREAMING_SNAKE_CASE			: int				   =					check_anagrams(input_a, input_b)
 print(F"{input_a} and {input_b} are {'' if status else 'not '}anagrams.")




import numpy as np
import torch
import torch.nn as nn
from transformers import CLIPConfig, CLIPVisionModelWithProjection, PreTrainedModel

from ...utils import logging


__A							=logging.get_logger(__name__)




class        _SCREAMING_SNAKE_CASE	( snake_case_		):
	lowerCAmelCase__   =					CLIPConfig

	lowerCAmelCase__   =					['CLIPEncoderLayer']



	def __init__(       self		,    lowercase					)							->			int:
					super().__init__(lowercase					)

					lowerCamelCase_         =     CLIPVisionModelWithProjection(config.vision_config					)

					lowerCamelCase_         =     nn.Linear(config.vision_config.projection_dim		,    1					)
					lowerCamelCase_         =     nn.Linear(config.vision_config.projection_dim		,    1					)



	@torch.no_grad()
	def        SCREAMING_SNAKE_CASE_(       self		,    lowercase		,    lowercase		,    lowercase=0.5		,    lowercase=0.5					)							->			int:
					lowerCamelCase_         =     self.vision_model(lowercase					)[0]

					lowerCamelCase_         =     self.p_head(lowercase					)
					lowerCamelCase_         =     nsfw_detected.flatten()
					lowerCamelCase_         =     nsfw_detected > p_threshold
					lowerCamelCase_         =     nsfw_detected.tolist()

					if any(lowercase					):
									logger.warning(
									    "Potential NSFW content was detected in one or more images. A black image will be returned instead."
									    " Try again with a different prompt and/or seed."					)

					for idx, nsfw_detected_ in enumerate(lowercase					):
									if nsfw_detected_:
													lowerCamelCase_         =     np.zeros(images[idx].shape					)

					lowerCamelCase_         =     self.w_head(lowercase					)
					lowerCamelCase_         =     watermark_detected.flatten()
					lowerCamelCase_         =     watermark_detected > w_threshold
					lowerCamelCase_         =     watermark_detected.tolist()

					if any(lowercase					):
									logger.warning(
									    "Potential watermarked content was detected in one or more images. A black image will be returned instead."
									    " Try again with a different prompt and/or seed."					)

					for idx, watermark_detected_ in enumerate(lowercase					):
									if watermark_detected_:
													lowerCamelCase_         =     np.zeros(images[idx].shape					)

					return images, nsfw_detected, watermark_detected


