





__lowerCamelCase			:	int					    =	"""
# Installazione di Transformers
! pip install transformers datasets
# Per installare dalla fonte invece dell'ultima versione rilasciata, commenta il comando sopra e
# rimuovi la modalità commento al comando seguente.
# ! pip install git+https://github.com/huggingface/transformers.git
"""

__lowerCamelCase			:	Optional[int]					    =	[{"""type""": """code""", """content""": INSTALL_CONTENT}]
__lowerCamelCase			:	Union[str, Any]					    =	{
    """{processor_class}""": """FakeProcessorClass""",
    """{model_class}""": """FakeModelClass""",
    """{object_class}""": """FakeObjectClass""",
}







import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format



class    A__  :
      _UpperCAmelCase      :Union[str, Any]		       =  None





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   int			      =  self.feature_extraction_class(**self.feat_extract_dict  )
       UpperCamelCase      :   Union[str, Any]			      =  json.loads(feat_extract.to_json_string()  )
       for key, value in self.feat_extract_dict.items():
        self.assertEqual(obj[key]			,				A_  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   str			      =  self.feature_extraction_class(**self.feat_extract_dict  )

       with tempfile.TemporaryDirectory() as tmpdirname:
        UpperCamelCase      :   List[Any]			      =  os.path.join(A_			,				"feat_extract.json"  )
        feat_extract_first.to_json_file(A_  )
        UpperCamelCase      :   str			      =  self.feature_extraction_class.from_json_file(A_  )

       self.assertEqual(feat_extract_second.to_dict()			,				feat_extract_first.to_dict()  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Union[str, Any]			      =  self.feature_extraction_class(**self.feat_extract_dict  )

       with tempfile.TemporaryDirectory() as tmpdirname:
        UpperCamelCase      :   int			      =  feat_extract_first.save_pretrained(A_  )[0]
        check_json_file_has_correct_format(A_  )
        UpperCamelCase      :   Optional[Any]			      =  self.feature_extraction_class.from_pretrained(A_  )

       self.assertEqual(feat_extract_second.to_dict()			,				feat_extract_first.to_dict()  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Any			      =  self.feature_extraction_class()
       self.assertIsNotNone(A_  )
