




import time
from contextlib import contextmanager
from pathlib import Path

import pytest
import requests
from huggingface_hub.hf_api import HfApi, HfFolder


__a          =			'__DUMMY_TRANSFORMERS_USER__'
__a          =			'Dummy User'
__a          =			'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'

__a          =			'https://hub-ci.huggingface.co'
__a          =			CI_HUB_ENDPOINT + '/datasets/{repo_id}/resolve/{revision}/{path}'
__a          =			CI_HUB_ENDPOINT + '/{repo_id}/resolve/{revision}/{filename}'
__a          =			Path('~/.huggingface/hub_ci_token').expanduser()







@pytest.fixture
def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     monkeypatch.setattr(
         '''huggingface_hub.file_download.HUGGINGFACE_CO_URL_TEMPLATE'''			,						_lowercase				)







@pytest.fixture
def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     monkeypatch.setattr('''datasets.config.HF_ENDPOINT'''			,						_lowercase				)
     monkeypatch.setattr('''datasets.config.HUB_DATASETS_URL'''			,						_lowercase				)







@pytest.fixture
def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     monkeypatch.setattr('''huggingface_hub.hf_api.HfFolder.path_token'''			,						_lowercase				)







@pytest.fixture
def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     HfFolder.save_token(_lowercase				)
     yield
     HfFolder.delete_token()







@pytest.fixture(scope='''session'''				)
def lowerCamelCase__       (      ):

     '''simple docstring'''


     return HfApi(endpoint=_lowercase				)







@pytest.fixture(scope='''session'''				)
def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Dict       =      HfFolder.get_token()
     HfFolder.save_token(_lowercase				)
     yield CI_HUB_USER_TOKEN
     if previous_token is not None:
          HfFolder.save_token(_lowercase				)







@pytest.fixture
def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     def _cleanup_repo(_lowercase				):
          hf_api.delete_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''				)

     return _cleanup_repo







@pytest.fixture
def lowerCamelCase__       (      _lowercase				):

     '''simple docstring'''


     @contextmanager
     def _temporary_repo(_lowercase				):
          try:
               yield repo_id
          finally:
               cleanup_repo(_lowercase				)

     return _temporary_repo







@pytest.fixture(scope='''session'''				)
def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Tuple       =      f'''repo_txt_data-{int(time.time() * 1_0E3				)}'''
     UpperCAmelCase_      :							List[Any]       =      f'''{CI_HUB_USER}/{repo_name}'''
     hf_api.create_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''			,						private=_lowercase				)
     hf_api.upload_file(
         token=_lowercase			,						path_or_fileobj=str(_lowercase				)			,						path_in_repo='''data/text_data.txt'''			,						repo_id=_lowercase			,						repo_type='''dataset'''			,						)
     yield repo_id
     try:
          hf_api.delete_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''				)
     except (requests.exceptions.HTTPError, ValueError):  # catch http error and token invalid error
          pass







@pytest.fixture()
def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     return hf_private_dataset_repo_txt_data_







@pytest.fixture(scope='''session'''				)
def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[Any]       =      f'''repo_zipped_txt_data-{int(time.time() * 1_0E3				)}'''
     UpperCAmelCase_      :							List[str]       =      f'''{CI_HUB_USER}/{repo_name}'''
     hf_api.create_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''			,						private=_lowercase				)
     hf_api.upload_file(
         token=_lowercase			,						path_or_fileobj=str(_lowercase				)			,						path_in_repo='''data.zip'''			,						repo_id=_lowercase			,						repo_type='''dataset'''			,						)
     yield repo_id
     try:
          hf_api.delete_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''				)
     except (requests.exceptions.HTTPError, ValueError):  # catch http error and token invalid error
          pass







@pytest.fixture()
def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     return hf_private_dataset_repo_zipped_txt_data_







@pytest.fixture(scope='''session'''				)
def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							str       =      f'''repo_zipped_img_data-{int(time.time() * 1_0E3				)}'''
     UpperCAmelCase_      :							str       =      f'''{CI_HUB_USER}/{repo_name}'''
     hf_api.create_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''			,						private=_lowercase				)
     hf_api.upload_file(
         token=_lowercase			,						path_or_fileobj=str(_lowercase				)			,						path_in_repo='''data.zip'''			,						repo_id=_lowercase			,						repo_type='''dataset'''			,						)
     yield repo_id
     try:
          hf_api.delete_repo(_lowercase			,						token=_lowercase			,						repo_type='''dataset'''				)
     except (requests.exceptions.HTTPError, ValueError):  # catch http error and token invalid error
          pass







@pytest.fixture()
def lowerCamelCase__       (      _lowercase			,						_lowercase			,						_lowercase				):

     '''simple docstring'''


     return hf_private_dataset_repo_zipped_img_data_





from collections import defaultdict







def lowerCamelCase__       (      _lowercase			,						_lowercase				):

     '''simple docstring'''


     UpperCAmelCase_      :							Optional[int]       =      first_str.lower().strip()
     UpperCAmelCase_      :							Any       =      second_str.lower().strip()

     # Remove whitespace
     UpperCAmelCase_      :							Any       =      first_str.replace(''' '''			,						''''''				)
     UpperCAmelCase_      :							int       =      second_str.replace(''' '''			,						''''''				)

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

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

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

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