




'''simple docstring'''






from typing import List, Optional, Union

import numpy as np
import PIL.Image

from ...image_processing_utils import BaseImageProcessor, BatchFeature
from ...image_transforms import rescale, resize, to_channel_dimension_format
from ...image_utils import (
    ChannelDimension,
    PILImageResampling,
    get_image_size,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, logging


A_			      =		logging.get_logger(__name__)






class        lowercase_      (						UpperCAmelCase__							):
     A_											=			['''pixel_values''']





     def __init__(     self     :					Optional[int]     ,							__lowerCamelCase     :					bool = True     ,							__lowerCamelCase     :					int = 32     ,							__lowerCamelCase     :					List[Any]=PILImageResampling.BILINEAR     ,							__lowerCamelCase     :					bool = True     ,							**__lowerCamelCase     :					Optional[Any]     ,							):
           snake_case__       :   List[Any]	      =    do_resize
           snake_case__       :   List[Any]	      =    do_rescale
           snake_case__       :   Optional[int]	      =    size_divisor
           snake_case__       :   Optional[int]	      =    resample
           super().__init__(**__lowerCAmelCase			)





     def 			_lowerCAmelCase      (     self     :					Any     ,							__lowerCamelCase     :					np.ndarray     ,							__lowerCamelCase     :					int     ,							__lowerCamelCase     :					Dict     ,							__lowerCamelCase     :					Optional[ChannelDimension] = None     ,							**__lowerCamelCase     :					Tuple			):
           snake_case__      ,							snake_case__       :   Any	      =    get_image_size(__lowerCAmelCase			)
           # Rounds the height and width down to the closest multiple of size_divisor
           snake_case__       :   Union[str, Any]	      =    height // size_divisor * size_divisor
           snake_case__       :   Optional[int]	      =    width // size_divisor * size_divisor
           snake_case__       :   Dict	      =    resize(__lowerCAmelCase     ,							(new_h, new_w)     ,							resample=__lowerCAmelCase     ,							data_format=__lowerCAmelCase     ,							**__lowerCAmelCase			)
           return image





     def 			_lowerCAmelCase      (     self     :					Union[str, Any]     ,							__lowerCamelCase     :					np.ndarray     ,							__lowerCamelCase     :					float     ,							__lowerCamelCase     :					Optional[ChannelDimension] = None     ,							**__lowerCamelCase     :					int			):
           return rescale(image=__lowerCAmelCase     ,							scale=__lowerCAmelCase     ,							data_format=__lowerCAmelCase     ,							**__lowerCAmelCase			)





     def 			_lowerCAmelCase      (     self     :					List[Any]     ,							__lowerCamelCase     :					Union["PIL.Image.Image", TensorType, List["PIL.Image.Image"], List[TensorType]]     ,							__lowerCamelCase     :					Optional[bool] = None     ,							__lowerCamelCase     :					Optional[int] = None     ,							__lowerCamelCase     :					Tuple=None     ,							__lowerCamelCase     :					Optional[bool] = None     ,							__lowerCamelCase     :					Optional[Union[TensorType, str]] = None     ,							__lowerCamelCase     :					ChannelDimension = ChannelDimension.FIRST     ,							**__lowerCamelCase     :					List[str]     ,							):
           snake_case__       :   Any	      =    do_resize if do_resize is not None else self.do_resize
           snake_case__       :   Any	      =    do_rescale if do_rescale is not None else self.do_rescale
           snake_case__       :   Optional[Any]	      =    size_divisor if size_divisor is not None else self.size_divisor
           snake_case__       :   List[str]	      =    resample if resample is not None else self.resample

           if do_resize and size_divisor is None:
                 raise ValueError('size_divisor is required for resizing'			)

           snake_case__       :   int	      =    make_list_of_images(__lowerCAmelCase			)

           if not valid_images(__lowerCAmelCase			):
                 raise ValueError('Invalid image(s)'			)

           # All transformations expect numpy arrays.
           snake_case__       :   Optional[int]	      =    [to_numpy_array(__lowerCAmelCase			) for img in images]

           if do_resize:
                 snake_case__       :   Any	      =    [self.resize(__lowerCAmelCase     ,							size_divisor=__lowerCAmelCase     ,							resample=__lowerCAmelCase			) for image in images]

           if do_rescale:
                 snake_case__       :   List[str]	      =    [self.rescale(__lowerCAmelCase     ,							scale=1 / 255			) for image in images]

           snake_case__       :   Dict	      =    [to_channel_dimension_format(__lowerCAmelCase     ,							__lowerCAmelCase			) for image in images]

           snake_case__       :   List[Any]	      =    {'pixel_values': images}
           return BatchFeature(data=__lowerCAmelCase     ,							tensor_type=__lowerCAmelCase			)






'''simple docstring'''


from collections import defaultdict
def 						lowerCamelCase__   (				a    ,	a							):
						__snake_case						 =   first_str.lower().strip()
						__snake_case						 =   second_str.lower().strip()

						# Remove whitespace
						__snake_case						 =   first_str.replace(' '    ,	''							)
						__snake_case						 =   second_str.replace(' '    ,	''							)

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

						# Default values for count should be 0
						__snake_case						 =   defaultdict(a							)

						# For each character in input strings,
						# increment count in the corresponding
						for i in range(len(a							)							):
												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()
	_lowercase  =			input("""Enter the first string """).strip()
	_lowercase  =			input("""Enter the second string """).strip()

	_lowercase  =			check_anagrams(input_a, input_b)
	print(f'''{input_a} and {input_b} are {'' if status else 'not '}anagrams.''')

