


from __future__ import annotations

import unittest

from transformers import MPNetConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
    import tensorflow as tf

    from transformers.models.mpnet.modeling_tf_mpnet import (
        TFMPNetForMaskedLM,
        TFMPNetForMultipleChoice,
        TFMPNetForQuestionAnswering,
        TFMPNetForSequenceClassification,
        TFMPNetForTokenClassification,
        TFMPNetModel,
    )







class      _lowercase					:


       """simple docstring"""




       def __init__(  self				:     List[Any]   , __lowerCamelCase				:     int   , __lowerCamelCase				:     List[str]=13   , __lowerCamelCase				:     Dict=7   , __lowerCamelCase				:     int=True   , __lowerCamelCase				:     Tuple=True   , __lowerCamelCase				:     List[str]=False   , __lowerCamelCase				:     Union[str, Any]=True   , __lowerCamelCase				:     Tuple=99   , __lowerCamelCase				:     Any=64   , __lowerCamelCase				:     Dict=2   , __lowerCamelCase				:     List[str]=4   , __lowerCamelCase				:     Dict=64   , __lowerCamelCase				:     str="gelu"   , __lowerCamelCase				:     List[str]=0.1   , __lowerCamelCase				:     str=0.1   , __lowerCamelCase				:     Any=512   , __lowerCamelCase				:     Optional[int]=16   , __lowerCamelCase				:     Union[str, Any]=2   , __lowerCamelCase				:     Dict=0.0_2   , __lowerCamelCase				:     Tuple=3   , __lowerCamelCase				:     List[Any]=4   , __lowerCamelCase				:     List[str]=None   , ):


             '''simple docstring'''



             lowerCamelCase__						:							str       =    parent
             lowerCamelCase__						:							Union[str, Any]       =    batch_size
             lowerCamelCase__						:							str       =    seq_length
             lowerCamelCase__						:							List[str]       =    is_training
             lowerCamelCase__						:							int       =    use_input_mask
             lowerCamelCase__						:							List[str]       =    use_token_type_ids
             lowerCamelCase__						:							List[Any]       =    use_labels
             lowerCamelCase__						:							Union[str, Any]       =    vocab_size
             lowerCamelCase__						:							List[Any]       =    hidden_size
             lowerCamelCase__						:							Any       =    num_hidden_layers
             lowerCamelCase__						:							Dict       =    num_attention_heads
             lowerCamelCase__						:							Any       =    intermediate_size
             lowerCamelCase__						:							Optional[int]       =    hidden_act
             lowerCamelCase__						:							List[Any]       =    hidden_dropout_prob
             lowerCamelCase__						:							int       =    attention_probs_dropout_prob
             lowerCamelCase__						:							str       =    max_position_embeddings
             lowerCamelCase__						:							Tuple       =    type_vocab_size
             lowerCamelCase__						:							Optional[int]       =    type_sequence_label_size
             lowerCamelCase__						:							List[Any]       =    initializer_range
             lowerCamelCase__						:							Optional[Any]       =    num_labels
             lowerCamelCase__						:							Any       =    num_choices
             lowerCamelCase__						:							Tuple       =    scope





       def 		lowerCAmelCase	(  self				:     Tuple			):


             '''simple docstring'''



             lowerCamelCase__						:							Tuple       =    ids_tensor([self.batch_size, self.seq_length]   , self.vocab_size			)

             lowerCamelCase__						:							Tuple       =    None
             if self.use_input_mask:
                   lowerCamelCase__						:							int       =    random_attention_mask([self.batch_size, self.seq_length]			)

             lowerCamelCase__						:							Any       =    None
             lowerCamelCase__						:							Any       =    None
             lowerCamelCase__						:							int       =    None
             if self.use_labels:
                   lowerCamelCase__						:							int       =    ids_tensor([self.batch_size]   , self.type_sequence_label_size			)
                   lowerCamelCase__						:							Tuple       =    ids_tensor([self.batch_size, self.seq_length]   , self.num_labels			)
                   lowerCamelCase__						:							Union[str, Any]       =    ids_tensor([self.batch_size]   , self.num_choices			)

             lowerCamelCase__						:							int       =    MPNetConfig(
                 vocab_size=self.vocab_size   , hidden_size=self.hidden_size   , num_hidden_layers=self.num_hidden_layers   , num_attention_heads=self.num_attention_heads   , intermediate_size=self.intermediate_size   , hidden_act=self.hidden_act   , hidden_dropout_prob=self.hidden_dropout_prob   , attention_probs_dropout_prob=self.attention_probs_dropout_prob   , max_position_embeddings=self.max_position_embeddings   , initializer_range=self.initializer_range   , )
             return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels





       def 		lowerCAmelCase	(  self				:     int   , __lowerCamelCase				:     Optional[Any]   , __lowerCamelCase				:     Union[str, Any]   , __lowerCamelCase				:     int   , __lowerCamelCase				:     Any   , __lowerCamelCase				:     Optional[Any]   , __lowerCamelCase				:     int			):


             '''simple docstring'''



             lowerCamelCase__						:							int       =    TFMPNetModel(config=_lowerCAmelCase			)
             lowerCamelCase__						:							int       =    {"""input_ids""": input_ids, """attention_mask""": input_mask}
             lowerCamelCase__						:							Dict       =    model(_lowerCAmelCase			)
             lowerCamelCase__						:							Dict       =    [input_ids, input_mask]
             lowerCamelCase__						:							Tuple       =    model(_lowerCAmelCase			)
             self.parent.assertEqual(result.last_hidden_state.shape   , (self.batch_size, self.seq_length, self.hidden_size)			)





       def 		lowerCAmelCase	(  self				:     List[Any]   , __lowerCamelCase				:     Any   , __lowerCamelCase				:     Dict   , __lowerCamelCase				:     List[Any]   , __lowerCamelCase				:     Optional[int]   , __lowerCamelCase				:     Optional[Any]   , __lowerCamelCase				:     Union[str, Any]			):


             '''simple docstring'''



             lowerCamelCase__						:							str       =    TFMPNetForMaskedLM(config=_lowerCAmelCase			)
             lowerCamelCase__						:							List[str]       =    {"""input_ids""": input_ids, """attention_mask""": input_mask}
             lowerCamelCase__						:							List[Any]       =    model(_lowerCAmelCase			)
             self.parent.assertEqual(result.logits.shape   , (self.batch_size, self.seq_length, self.vocab_size)			)





       def 		lowerCAmelCase	(  self				:     Tuple   , __lowerCamelCase				:     Dict   , __lowerCamelCase				:     Optional[Any]   , __lowerCamelCase				:     List[str]   , __lowerCamelCase				:     str   , __lowerCamelCase				:     str   , __lowerCamelCase				:     str			):


             '''simple docstring'''



             lowerCamelCase__						:							Union[str, Any]       =    TFMPNetForQuestionAnswering(config=_lowerCAmelCase			)
             lowerCamelCase__						:							List[Any]       =    {
                 """input_ids""": input_ids,
                 """attention_mask""": input_mask,
             }
             lowerCamelCase__						:							Any       =    model(_lowerCAmelCase			)
             self.parent.assertEqual(result.start_logits.shape   , (self.batch_size, self.seq_length)			)
             self.parent.assertEqual(result.end_logits.shape   , (self.batch_size, self.seq_length)			)





       def 		lowerCAmelCase	(  self				:     Any   , __lowerCamelCase				:     List[str]   , __lowerCamelCase				:     Tuple   , __lowerCamelCase				:     Union[str, Any]   , __lowerCamelCase				:     str   , __lowerCamelCase				:     str   , __lowerCamelCase				:     Dict			):


             '''simple docstring'''



             lowerCamelCase__						:							int       =    self.num_labels
             lowerCamelCase__						:							Union[str, Any]       =    TFMPNetForSequenceClassification(_lowerCAmelCase			)
             lowerCamelCase__						:							Union[str, Any]       =    {"""input_ids""": input_ids, """attention_mask""": input_mask}
             lowerCamelCase__						:							Dict       =    model(_lowerCAmelCase			)
             self.parent.assertEqual(result.logits.shape   , (self.batch_size, self.num_labels)			)





       def 		lowerCAmelCase	(  self				:     int   , __lowerCamelCase				:     Optional[int]   , __lowerCamelCase				:     int   , __lowerCamelCase				:     Any   , __lowerCamelCase				:     Optional[int]   , __lowerCamelCase				:     List[str]   , __lowerCamelCase				:     Union[str, Any]			):


             '''simple docstring'''



             lowerCamelCase__						:							List[Any]       =    self.num_choices
             lowerCamelCase__						:							Dict       =    TFMPNetForMultipleChoice(_lowerCAmelCase			)
             lowerCamelCase__						:							List[Any]       =    tf.tile(tf.expand_dims(_lowerCAmelCase   , 1			)   , (1, self.num_choices, 1)			)
             lowerCamelCase__						:							int       =    tf.tile(tf.expand_dims(_lowerCAmelCase   , 1			)   , (1, self.num_choices, 1)			)
             lowerCamelCase__						:							Optional[Any]       =    {
                 """input_ids""": multiple_choice_inputs_ids,
                 """attention_mask""": multiple_choice_input_mask,
             }
             lowerCamelCase__						:							str       =    model(_lowerCAmelCase			)
             self.parent.assertEqual(result.logits.shape   , (self.batch_size, self.num_choices)			)





       def 		lowerCAmelCase	(  self				:     Union[str, Any]   , __lowerCamelCase				:     str   , __lowerCamelCase				:     Tuple   , __lowerCamelCase				:     Dict   , __lowerCamelCase				:     Optional[int]   , __lowerCamelCase				:     Tuple   , __lowerCamelCase				:     Any			):


             '''simple docstring'''



             lowerCamelCase__						:							Any       =    self.num_labels
             lowerCamelCase__						:							Any       =    TFMPNetForTokenClassification(_lowerCAmelCase			)
             lowerCamelCase__						:							Union[str, Any]       =    {"""input_ids""": input_ids, """attention_mask""": input_mask}
             lowerCamelCase__						:							str       =    model(_lowerCAmelCase			)
             self.parent.assertEqual(result.logits.shape   , (self.batch_size, self.seq_length, self.num_labels)			)





       def 		lowerCAmelCase	(  self				:     List[str]			):


             '''simple docstring'''



             lowerCamelCase__						:							List[Any]       =    self.prepare_config_and_inputs()
             (lowerCamelCase__)						:							str       =    config_and_inputs
             lowerCamelCase__						:							str       =    {"""input_ids""": input_ids, """attention_mask""": input_mask}
             return config, inputs_dict







@require_tf
class      _lowercase					(				__UpperCamelCase				,    __UpperCamelCase				,    unittest.TestCase):


       """simple docstring"""




       A__   		=     (
           (
               TFMPNetForMaskedLM,
               TFMPNetForMultipleChoice,
               TFMPNetForQuestionAnswering,
               TFMPNetForSequenceClassification,
               TFMPNetForTokenClassification,
               TFMPNetModel,
           )
           if is_tf_available()
           else ()
       )
       A__   		=     (
           {
               "feature-extraction": TFMPNetModel,
               "fill-mask": TFMPNetForMaskedLM,
               "question-answering": TFMPNetForQuestionAnswering,
               "text-classification": TFMPNetForSequenceClassification,
               "token-classification": TFMPNetForTokenClassification,
               "zero-shot": TFMPNetForSequenceClassification,
           }
           if is_tf_available()
           else {}
       )
       A__   		=     False
       A__   		=     False





       def 		lowerCAmelCase	(  self				:     Any			):


             '''simple docstring'''



             lowerCamelCase__						:							List[Any]       =    TFMPNetModelTester(self			)
             lowerCamelCase__						:							Dict       =    ConfigTester(self   , config_class=_lowerCAmelCase   , hidden_size=37			)





       def 		lowerCAmelCase	(  self				:     Optional[Any]			):


             '''simple docstring'''



             self.config_tester.run_common_tests()





       def 		lowerCAmelCase	(  self				:     List[str]			):


             '''simple docstring'''



             lowerCamelCase__						:							List[str]       =    self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_mpnet_model(*_lowerCAmelCase			)





       def 		lowerCAmelCase	(  self				:     Any			):


             '''simple docstring'''



             lowerCamelCase__						:							int       =    self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_mpnet_for_masked_lm(*_lowerCAmelCase			)





       def 		lowerCAmelCase	(  self				:     List[Any]			):


             '''simple docstring'''



             lowerCamelCase__						:							Any       =    self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_mpnet_for_question_answering(*_lowerCAmelCase			)





       def 		lowerCAmelCase	(  self				:     Tuple			):


             '''simple docstring'''



             lowerCamelCase__						:							str       =    self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_mpnet_for_sequence_classification(*_lowerCAmelCase			)





       def 		lowerCAmelCase	(  self				:     str			):


             '''simple docstring'''



             lowerCamelCase__						:							Dict       =    self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_mpnet_for_multiple_choice(*_lowerCAmelCase			)





       def 		lowerCAmelCase	(  self				:     int			):


             '''simple docstring'''



             lowerCamelCase__						:							int       =    self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_mpnet_for_token_classification(*_lowerCAmelCase			)





       @slow
       def 		lowerCAmelCase	(  self				:     Tuple			):


             '''simple docstring'''



             for model_name in ["microsoft/mpnet-base"]:
                   lowerCamelCase__						:							List[str]       =    TFMPNetModel.from_pretrained(_lowerCAmelCase			)
                   self.assertIsNotNone(_lowerCAmelCase			)







@require_tf
class      _lowercase					(				unittest.TestCase):


       """simple docstring"""




       @slow
       def 		lowerCAmelCase	(  self				:     Dict			):


             '''simple docstring'''



             lowerCamelCase__						:							Tuple       =    TFMPNetModel.from_pretrained("microsoft/mpnet-base"			)
             lowerCamelCase__						:							Optional[int]       =    tf.constant([[0, 1, 2, 3, 4, 5]]			)
             lowerCamelCase__						:							int       =    model(_lowerCAmelCase			)[0]

             lowerCamelCase__						:							int       =    [1, 6, 768]
             self.assertEqual(output.shape   , _lowerCAmelCase			)

             lowerCamelCase__						:							int       =    tf.constant(
                 [
                     [
                         [-0.1_0_6_7_1_7_2, 0.0_8_2_1_6_4_7_3, 0.0_0_2_4_5_4_3],
                         [-0.0_3_4_6_5_8_7_9, 0.8_3_5_4_1_1_8, -0.0_3_2_5_2_2_8_8],
                         [-0.0_6_5_6_9_4_7_6, -0.1_2_4_2_4_1_1_1, -0.0_4_9_4_4_3_6],
                     ]
                 ]			)
             tf.debugging.assert_near(output[:, :3, :3]   , _lowerCAmelCase   , atol=1E-4			)



import tempfile
import unittest

from diffusers import (
    DDIMScheduler,
    DDPMScheduler,
    DPMSolverMultistepScheduler,
    EulerAncestralDiscreteScheduler,
    EulerDiscreteScheduler,
    PNDMScheduler,
    logging,
)
from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.utils.testing_utils import CaptureLogger







class      SCREAMING_SNAKE_CASE__					(  __UpperCamelCase    ):
       A							:	str          =	"config.json"

       @register_to_config
       def __init__(							self					:     Any			,			_lowerCAmelCase					:     Tuple=2			,			_lowerCAmelCase					:     List[Any]=5			,			_lowerCAmelCase					:     int=(2, 5)			,			_lowerCAmelCase					:     Dict="for diffusion"			,			_lowerCAmelCase					:     List[str]=[1, 3]			,			):
           pass







class      SCREAMING_SNAKE_CASE__					(  __UpperCamelCase    ):
       A							:	Optional[int]          =	"config.json"

       @register_to_config
       def __init__(							self					:     int			,			_lowerCAmelCase					:     Dict=2			,			_lowerCAmelCase					:     Union[str, Any]=5			,			_lowerCAmelCase					:     Any=(2, 5)			,			_lowerCAmelCase					:     Optional[int]="for diffusion"			,			_lowerCAmelCase					:     int=[1, 3]			,			):
           pass







class      SCREAMING_SNAKE_CASE__					(  __UpperCamelCase    ):
       A							:	str          =	"config.json"

       @register_to_config
       def __init__(							self					:     Any			,			_lowerCAmelCase					:     Optional[int]=2			,			_lowerCAmelCase					:     Optional[int]=5			,			_lowerCAmelCase					:     int=(2, 5)			,			_lowerCAmelCase					:     Tuple="for diffusion"			,			_lowerCAmelCase					:     Any=[1, 3]			,			_lowerCAmelCase					:     str=[1, 3]			,			):
           pass







class      SCREAMING_SNAKE_CASE__					(  __UpperCamelCase    ):
       A							:	Union[str, Any]          =	"config.json"

       @register_to_config
       def __init__(							self					:     Any			,			_lowerCAmelCase					:     Dict=2			,			_lowerCAmelCase					:     Optional[int]=5			,			_lowerCAmelCase					:     Optional[Any]=(2, 5)			,			_lowerCAmelCase					:     int="for diffusion"			,			_lowerCAmelCase					:     Dict=[1, 5]			,			_lowerCAmelCase					:     Optional[Any]=[5, 4]			,			):
           pass







class      SCREAMING_SNAKE_CASE__					(  unittest.TestCase    ):

       def 			snake_case__    (							self					:     List[str]			):
           with self.assertRaises(_lowerCAmelCase			):
               ConfigMixin.load_config("""dummy_path"""			)

       def 			snake_case__    (							self					:     List[Any]			):
           __snake_case       :				List[Any] 			=    SampleObject()
           __snake_case       :				Optional[Any] 			=    obj.config
           assert config["a"] == 2
           assert config["b"] == 5
           assert config["c"] == (2, 5)
           assert config["d"] == "for diffusion"
           assert config["e"] == [1, 3]

           # init ignore private arguments
           __snake_case       :				Optional[Any] 			=    SampleObject(_name_or_path="""lalala"""			)
           __snake_case       :				List[Any] 			=    obj.config
           assert config["a"] == 2
           assert config["b"] == 5
           assert config["c"] == (2, 5)
           assert config["d"] == "for diffusion"
           assert config["e"] == [1, 3]

           # can override default
           __snake_case       :				int 			=    SampleObject(c=6			)
           __snake_case       :				Union[str, Any] 			=    obj.config
           assert config["a"] == 2
           assert config["b"] == 5
           assert config["c"] == 6
           assert config["d"] == "for diffusion"
           assert config["e"] == [1, 3]

           # can use positional arguments.
           __snake_case       :				List[str] 			=    SampleObject(1			,			c=6			)
           __snake_case       :				str 			=    obj.config
           assert config["a"] == 1
           assert config["b"] == 5
           assert config["c"] == 6
           assert config["d"] == "for diffusion"
           assert config["e"] == [1, 3]

       def 			snake_case__    (							self					:     Union[str, Any]			):
           __snake_case       :				Union[str, Any] 			=    SampleObject()
           __snake_case       :				Optional[Any] 			=    obj.config

           assert config["a"] == 2
           assert config["b"] == 5
           assert config["c"] == (2, 5)
           assert config["d"] == "for diffusion"
           assert config["e"] == [1, 3]

           with tempfile.TemporaryDirectory() as tmpdirname:
               obj.save_config(_lowerCAmelCase			)
               __snake_case       :				List[Any] 			=    SampleObject.from_config(SampleObject.load_config(_lowerCAmelCase			)			)
               __snake_case       :				Union[str, Any] 			=    new_obj.config

           # unfreeze configs
           __snake_case       :				Optional[Any] 			=    dict(_lowerCAmelCase			)
           __snake_case       :				Optional[Any] 			=    dict(_lowerCAmelCase			)

           assert config.pop("""c"""			) == (2, 5)  # instantiated as tuple
           assert new_config.pop("""c"""			) == [2, 5]  # saved & loaded as list because of json
           config.pop("""_use_default_values"""			)
           assert config == new_config

       def 			snake_case__    (							self					:     Tuple			):
           __snake_case       :				Optional[Any] 			=    logging.get_logger("""diffusers.configuration_utils"""			)
           # 30 for warning
           logger.setLevel(30			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger:
               __snake_case       :				List[Any] 			=    DDIMScheduler.from_pretrained(
                   """hf-internal-testing/tiny-stable-diffusion-torch"""			,			subfolder="""scheduler"""			)

           assert ddim.__class__ == DDIMScheduler
           # no warning should be thrown
           assert cap_logger.out == ""

       def 			snake_case__    (							self					:     Optional[int]			):
           __snake_case       :				int 			=    logging.get_logger("""diffusers.configuration_utils"""			)
           # 30 for warning
           logger.setLevel(30			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger:
               __snake_case       :				Optional[int] 			=    EulerDiscreteScheduler.from_pretrained(
                   """hf-internal-testing/tiny-stable-diffusion-torch"""			,			subfolder="""scheduler"""			)

           assert euler.__class__ == EulerDiscreteScheduler
           # no warning should be thrown
           assert cap_logger.out == ""

       def 			snake_case__    (							self					:     Tuple			):
           __snake_case       :				int 			=    logging.get_logger("""diffusers.configuration_utils"""			)
           # 30 for warning
           logger.setLevel(30			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger:
               __snake_case       :				Any 			=    EulerAncestralDiscreteScheduler.from_pretrained(
                   """hf-internal-testing/tiny-stable-diffusion-torch"""			,			subfolder="""scheduler"""			)

           assert euler.__class__ == EulerAncestralDiscreteScheduler
           # no warning should be thrown
           assert cap_logger.out == ""

       def 			snake_case__    (							self					:     List[Any]			):
           __snake_case       :				str 			=    logging.get_logger("""diffusers.configuration_utils"""			)
           # 30 for warning
           logger.setLevel(30			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger:
               __snake_case       :				Optional[int] 			=    PNDMScheduler.from_pretrained(
                   """hf-internal-testing/tiny-stable-diffusion-torch"""			,			subfolder="""scheduler"""			)

           assert pndm.__class__ == PNDMScheduler
           # no warning should be thrown
           assert cap_logger.out == ""

       def 			snake_case__    (							self					:     Tuple			):
           __snake_case       :				int 			=    logging.get_logger("""diffusers.configuration_utils"""			)
           # 30 for warning
           logger.setLevel(30			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger:
               __snake_case       :				List[str] 			=    DDPMScheduler.from_pretrained(
                   """hf-internal-testing/tiny-stable-diffusion-torch"""			,			subfolder="""scheduler"""			,			prediction_type="""sample"""			,			beta_end=8			,			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger_a:
               __snake_case       :				Optional[Any] 			=    DDPMScheduler.from_pretrained("""google/ddpm-celebahq-256"""			,			beta_start=88			)

           assert ddpm.__class__ == DDPMScheduler
           assert ddpm.config.prediction_type == "sample"
           assert ddpm.config.beta_end == 8
           assert ddpm_a.config.beta_start == 88

           # no warning should be thrown
           assert cap_logger.out == ""
           assert cap_logger_a.out == ""

       def 			snake_case__    (							self					:     List[Any]			):
           __snake_case       :				List[Any] 			=    logging.get_logger("""diffusers.configuration_utils"""			)
           # 30 for warning
           logger.setLevel(30			)

           with CaptureLogger(_lowerCAmelCase			) as cap_logger:
               __snake_case       :				str 			=    DPMSolverMultistepScheduler.from_pretrained(
                   """hf-internal-testing/tiny-stable-diffusion-torch"""			,			subfolder="""scheduler"""			)

           assert dpm.__class__ == DPMSolverMultistepScheduler
           # no warning should be thrown
           assert cap_logger.out == ""





       def 			snake_case__    (							self					:     List[Any]			):
           # let's first save a config that should be in the form
           #    a=2,
           #    b=5,
           #    c=(2, 5),
           #    d="for diffusion",
           #    e=[1, 3],

           __snake_case       :				Optional[Any] 			=    SampleObject()

           __snake_case       :				Union[str, Any] 			=    {k: v for k, v in config.config.items() if not k.startswith("""_"""			)}

           # make sure that default config has all keys in `_use_default_values`
           assert set(config_dict.keys()			) == set(config.config._use_default_values			)

           with tempfile.TemporaryDirectory() as tmpdirname:
               config.save_config(_lowerCAmelCase			)

               # now loading it with SampleObject2 should put f into `_use_default_values`
               __snake_case       :				Union[str, Any] 			=    SampleObjecta.from_config(_lowerCAmelCase			)

               assert "f" in config._use_default_values
               assert config.f == [1, 3]

           # now loading the config, should **NOT** use [1, 3] for `f`, but the default [1, 4] value
           # **BECAUSE** it is part of `config._use_default_values`
           __snake_case       :				Optional[int] 			=    SampleObjecta.from_config(config.config			)
           assert new_config.f == [5, 4]

           config.config._use_default_values.pop()
           __snake_case       :				Optional[Any] 			=    SampleObjecta.from_config(config.config			)
           assert new_config_a.f == [1, 3]

           # Nevertheless "e" should still be correctly loaded to [1, 3] from SampleObject2 instead of defaulting to [1, 5]
           assert new_config_a.e == [1, 3]



