


from __future__ import annotations

import unittest

from transformers import RoFormerConfig, 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 import (
			    TFRoFormerForCausalLM,
			    TFRoFormerForMaskedLM,
			    TFRoFormerForMultipleChoice,
			    TFRoFormerForQuestionAnswering,
			    TFRoFormerForSequenceClassification,
			    TFRoFormerForTokenClassification,
			    TFRoFormerModel,
			)
			from transformers.models.roformer.modeling_tf_roformer import (
			    TFRoFormerSelfAttention,
			    TFRoFormerSinusoidalPositionalEmbedding,
			)

class        a	:




							"""simple docstring"""


							def __init__(							self :						Any					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						Optional[Any]=13					,			lowerCamelCase :						Optional[int]=7					,			lowerCamelCase :						str=True					,			lowerCamelCase :						Optional[int]=True					,			lowerCamelCase :						List[Any]=True					,			lowerCamelCase :						Dict=True					,			lowerCamelCase :						Union[str, Any]=99					,			lowerCamelCase :						Any=32					,			lowerCamelCase :						List[str]=2					,			lowerCamelCase :						Any=4					,			lowerCamelCase :						List[str]=37					,			lowerCamelCase :						Dict="gelu"					,			lowerCamelCase :						Optional[int]=0.1					,			lowerCamelCase :						List[Any]=0.1					,			lowerCamelCase :						Tuple=512					,			lowerCamelCase :						Any=16					,			lowerCamelCase :						str=2					,			lowerCamelCase :						List[Any]=0.02					,			lowerCamelCase :						Tuple=3					,			lowerCamelCase :						Any=4					,			lowerCamelCase :						Optional[int]=None					,			)			->					int:
														__snake_case	:    Any											=     parent
														__snake_case	:    int											=     13
														__snake_case	:    Dict											=     7
														__snake_case	:    str											=     True
														__snake_case	:    Tuple											=     True
														__snake_case	:    Optional[Any]											=     True
														__snake_case	:    List[Any]											=     True
														__snake_case	:    Union[str, Any]											=     99
														__snake_case	:    Union[str, Any]											=     32
														__snake_case	:    Optional[Any]											=     2
														__snake_case	:    Tuple											=     4
														__snake_case	:    Union[str, Any]											=     37
														__snake_case	:    int											=     "gelu"
														__snake_case	:    Union[str, Any]											=     0.1
														__snake_case	:    Tuple											=     0.1
														__snake_case	:    str											=     512
														__snake_case	:    Any											=     16
														__snake_case	:    int											=     2
														__snake_case	:    int											=     0.02
														__snake_case	:    Optional[Any]											=     3
														__snake_case	:    Dict											=     4
														__snake_case	:    int											=     None

							def 					__snake_case      (							self :						Dict       )			->					Union[str, Any]:
														__snake_case	:    Optional[int]											=     ids_tensor([self.batch_size, self.seq_length]					,			self.vocab_size       )

														__snake_case	:    Optional[int]											=     None
														if self.use_input_mask:
																					__snake_case	:    Optional[Any]											=     random_attention_mask([self.batch_size, self.seq_length]       )

														__snake_case	:    List[Any]											=     None
														if self.use_token_type_ids:
																					__snake_case	:    int											=     ids_tensor([self.batch_size, self.seq_length]					,			self.type_vocab_size       )

														__snake_case	:    List[Any]											=     None
														__snake_case	:    Tuple											=     None
														__snake_case	:    Any											=     None
														if self.use_labels:
																					__snake_case	:    List[str]											=     ids_tensor([self.batch_size]					,			self.type_sequence_label_size       )
																					__snake_case	:    Any											=     ids_tensor([self.batch_size, self.seq_length]					,			self.num_labels       )
																					__snake_case	:    Optional[Any]											=     ids_tensor([self.batch_size]					,			self.num_choices       )

														__snake_case	:    Union[str, Any]											=     RoFormerConfig(
														    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					,			type_vocab_size=self.type_vocab_size					,			initializer_range=self.initializer_range					,			return_dict=lowerCamelCase					,			)

														return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels

							def 					__snake_case      (							self :						Optional[int]					,			lowerCamelCase :						Optional[int]					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						Any					,			lowerCamelCase :						str					,			lowerCamelCase :						List[str]					,			lowerCamelCase :						int					,			lowerCamelCase :						Optional[int]       )			->					str:
														__snake_case	:    List[Any]											=     TFRoFormerModel(config=lowerCamelCase       )
														__snake_case	:    Optional[Any]											=     {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}

														__snake_case	:    Union[str, Any]											=     [input_ids, input_mask]
														__snake_case	:    Optional[int]											=     model(lowerCamelCase       )

														__snake_case	:    Optional[Any]											=     model(lowerCamelCase       )

														self.parent.assertEqual(result.last_hidden_state.shape					,			(self.batch_size, self.seq_length, self.hidden_size)       )

							def 					__snake_case      (							self :						Optional[int]					,			lowerCamelCase :						Optional[int]					,			lowerCamelCase :						List[str]					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						Optional[int]					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						Optional[int]       )			->					List[Any]:
														__snake_case	:    Any											=     True
														__snake_case	:    str											=     TFRoFormerForCausalLM(config=lowerCamelCase       )
														__snake_case	:    Optional[int]											=     {
														    "input_ids": input_ids,
														    "attention_mask": input_mask,
														    "token_type_ids": token_type_ids,
														}
														__snake_case	:    List[Any]											=     model(lowerCamelCase       )["logits"]
														self.parent.assertListEqual(
														    list(prediction_scores.numpy().shape       )					,			[self.batch_size, self.seq_length, self.vocab_size]       )

							def 					__snake_case      (							self :						Optional[Any]					,			lowerCamelCase :						Union[str, Any]					,			lowerCamelCase :						Any					,			lowerCamelCase :						str					,			lowerCamelCase :						Optional[int]					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Any       )			->					Union[str, Any]:
														__snake_case	:    List[Any]											=     TFRoFormerForMaskedLM(config=lowerCamelCase       )
														__snake_case	:    Dict											=     {
														    "input_ids": input_ids,
														    "attention_mask": input_mask,
														    "token_type_ids": token_type_ids,
														}
														__snake_case	:    str											=     model(lowerCamelCase       )
														self.parent.assertEqual(result.logits.shape					,			(self.batch_size, self.seq_length, self.vocab_size)       )

							def 					__snake_case      (							self :						Dict					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Dict					,			lowerCamelCase :						Any					,			lowerCamelCase :						Union[str, Any]					,			lowerCamelCase :						Union[str, Any]       )			->					Optional[Any]:
														__snake_case	:    Dict											=     self.num_labels
														__snake_case	:    Tuple											=     TFRoFormerForSequenceClassification(config=lowerCamelCase       )
														__snake_case	:    List[Any]											=     {
														    "input_ids": input_ids,
														    "attention_mask": input_mask,
														    "token_type_ids": token_type_ids,
														}

														__snake_case	:    Tuple											=     model(lowerCamelCase       )
														self.parent.assertEqual(result.logits.shape					,			(self.batch_size, self.num_labels)       )

							def 					__snake_case      (							self :						Optional[int]					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						int					,			lowerCamelCase :						Optional[int]					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Union[str, Any]       )			->					str:
														__snake_case	:    List[str]											=     self.num_choices
														__snake_case	:    Optional[Any]											=     TFRoFormerForMultipleChoice(config=lowerCamelCase       )
														__snake_case	:    Optional[int]											=     tf.tile(tf.expand_dims(lowerCamelCase					,			1       )					,			(1, self.num_choices, 1)       )
														__snake_case	:    Optional[Any]											=     tf.tile(tf.expand_dims(lowerCamelCase					,			1       )					,			(1, self.num_choices, 1)       )
														__snake_case	:    Dict											=     tf.tile(tf.expand_dims(lowerCamelCase					,			1       )					,			(1, self.num_choices, 1)       )
														__snake_case	:    Optional[Any]											=     {
														    "input_ids": multiple_choice_inputs_ids,
														    "attention_mask": multiple_choice_input_mask,
														    "token_type_ids": multiple_choice_token_type_ids,
														}
														__snake_case	:    Optional[int]											=     model(lowerCamelCase       )
														self.parent.assertEqual(result.logits.shape					,			(self.batch_size, self.num_choices)       )

							def 					__snake_case      (							self :						Optional[int]					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						Union[str, Any]					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						List[str]					,			lowerCamelCase :						Dict					,			lowerCamelCase :						List[str]       )			->					Union[str, Any]:
														__snake_case	:    Optional[int]											=     self.num_labels
														__snake_case	:    Union[str, Any]											=     TFRoFormerForTokenClassification(config=lowerCamelCase       )
														__snake_case	:    List[str]											=     {
														    "input_ids": input_ids,
														    "attention_mask": input_mask,
														    "token_type_ids": token_type_ids,
														}
														__snake_case	:    Any											=     model(lowerCamelCase       )
														self.parent.assertEqual(result.logits.shape					,			(self.batch_size, self.seq_length, self.num_labels)       )

							def 					__snake_case      (							self :						List[Any]					,			lowerCamelCase :						Dict					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						Dict					,			lowerCamelCase :						List[str]					,			lowerCamelCase :						int					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						int       )			->					Optional[Any]:
														__snake_case	:    List[str]											=     TFRoFormerForQuestionAnswering(config=lowerCamelCase       )
														__snake_case	:    Optional[int]											=     {
														    "input_ids": input_ids,
														    "attention_mask": input_mask,
														    "token_type_ids": token_type_ids,
														}

														__snake_case	:    str											=     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 					__snake_case      (							self :						Dict       )			->					str:
														__snake_case	:    Tuple											=     self.prepare_config_and_inputs()
														(
														    (
														    __snake_case
														)				,    (
														    __snake_case
														)				,    (
														    __snake_case
														)				,    (
														    __snake_case
														)				,    (
														    __snake_case
														)				,    (
														    __snake_case
														)				,    (
														    __snake_case
														)				,    
														)	:    Optional[int]											=     config_and_inputs
														__snake_case	:    Tuple											=     {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
														return config, inputs_dict

@require_tf
class        a	(_lowerCAmelCase  ,       _lowerCAmelCase  ,       unittest.TestCase   ):




							"""simple docstring"""


							__UpperCAmelCase					:							Union[str, Any]  						=						(
							    (
							        TFRoFormerModel,
							        TFRoFormerForCausalLM,
							        TFRoFormerForMaskedLM,
							        TFRoFormerForQuestionAnswering,
							        TFRoFormerForSequenceClassification,
							        TFRoFormerForTokenClassification,
							        TFRoFormerForMultipleChoice,
							    )
							    if is_tf_available()
							    else ()
							)
							__UpperCAmelCase					:							Optional[int]  						=						(
							    {
							        "feature-extraction": TFRoFormerModel,
							        "fill-mask": TFRoFormerForMaskedLM,
							        "question-answering": TFRoFormerForQuestionAnswering,
							        "text-classification": TFRoFormerForSequenceClassification,
							        "text-generation": TFRoFormerForCausalLM,
							        "token-classification": TFRoFormerForTokenClassification,
							        "zero-shot": TFRoFormerForSequenceClassification,
							    }
							    if is_tf_available()
							    else {}
							)

							__UpperCAmelCase					:							Dict  						=						False
							__UpperCAmelCase					:							Optional[Any]  						=						False

							def 					__snake_case      (							self :						int					,			lowerCamelCase :						Any					,			lowerCamelCase :						Tuple					,			lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						int					,			lowerCamelCase :						Tuple       )			->					List[Any]:
														if pipeline_test_casse_name == "TextGenerationPipelineTests":
																					return True

														return False

							def 					__snake_case      (							self :						Union[str, Any]       )			->					str:
														__snake_case	:    List[Any]											=     TFRoFormerModelTester(self       )
														__snake_case	:    Dict											=     ConfigTester(self					,			config_class=lowerCamelCase					,			hidden_size=37       )

							def 					__snake_case      (							self :						Union[str, Any]       )			->					Optional[Any]:
														self.config_tester.run_common_tests()

							def 					__snake_case      (							self :						str       )			->					str:
														__snake_case	:    List[str]											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_model(*lowerCamelCase       )

							def 					__snake_case      (							self :						Optional[int]       )			->					Tuple:
														__snake_case	:    Optional[int]											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_masked_lm(*lowerCamelCase       )

							def 					__snake_case      (							self :						List[str]       )			->					Dict:
														__snake_case	:    List[str]											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_lm_head(*lowerCamelCase       )

							def 					__snake_case      (							self :						Tuple       )			->					Optional[int]:
														__snake_case	:    Dict											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_multiple_choice(*lowerCamelCase       )

							def 					__snake_case      (							self :						int       )			->					Optional[Any]:
														__snake_case	:    Optional[Any]											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_question_answering(*lowerCamelCase       )

							def 					__snake_case      (							self :						Union[str, Any]       )			->					List[str]:
														__snake_case	:    Optional[int]											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_sequence_classification(*lowerCamelCase       )

							def 					__snake_case      (							self :						int       )			->					Optional[int]:
														__snake_case	:    Tuple											=     self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_token_classification(*lowerCamelCase       )






							@slow
							def 					__snake_case      (							self :						Union[str, Any]       )			->					Optional[int]:
														__snake_case	:    Optional[int]											=     TFRoFormerModel.from_pretrained("junnyu/roformer_chinese_base"       )
														self.assertIsNotNone(lowerCamelCase       )

@require_tf
class        a	(unittest.TestCase   ):




							"""simple docstring"""


							@slow
							def 					__snake_case      (							self :						str       )			->					Union[str, Any]:
														__snake_case	:    Optional[Any]											=     TFRoFormerForMaskedLM.from_pretrained("junnyu/roformer_chinese_base"       )
														__snake_case	:    int											=     tf.constant([[0, 1, 2, 3, 4, 5]]       )
														__snake_case	:    Optional[Any]											=     model(lowerCamelCase       )[0]

														# TODO Replace vocab size
														__snake_case	:    Union[str, Any]											=     50000

														__snake_case	:    int											=     [1, 6, vocab_size]
														self.assertEqual(output.shape					,			lowerCamelCase       )

														print(output[:, :3, :3]       )

														# TODO Replace values below with what was printed above.
														__snake_case	:    int											=     tf.constant(
														    [
														        [
														            [-0.12_05_33_41, -1.0_26_49_01, 0.29_22_19_46],
														            [-1.5_13_37_83, 0.19_74_33, 0.15_19_06_07],
														            [-5.0_13_54_03, -3.90_02_56, -0.84_03_87_64],
														        ]
														    ]       )
														tf.debugging.assert_near(output[:, :3, :3]					,			lowerCamelCase					,			atol=1E-4       )

@require_tf
class        a	(unittest.TestCase   ):




							"""simple docstring"""


							__UpperCAmelCase					:							int  						=						1e-4

							def 					__snake_case      (							self :						Any       )			->					List[Any]:
														__snake_case	:    Optional[int]											=     tf.constant([[4, 10]]       )
														__snake_case	:    Optional[Any]											=     TFRoFormerSinusoidalPositionalEmbedding(num_positions=6					,			embedding_dim=6       )

														__snake_case	:    List[str]											=     emba(input_ids.shape       )
														__snake_case	:    List[Any]											=     tf.constant(
														    [[0.00_00, 0.00_00, 0.00_00, 1.00_00, 1.00_00, 1.00_00], [0.84_15, 0.04_64, 0.00_22, 0.54_03, 0.99_89, 1.00_00]]       )

														tf.debugging.assert_near(lowerCamelCase					,			lowerCamelCase					,			atol=self.tolerance       )






							def 					__snake_case      (							self :						Optional[Any]       )			->					Dict:
														__snake_case	:    str											=     tf.constant(
														    [
														        [0.00_00, 0.00_00, 0.00_00, 0.00_00, 0.00_00],
														        [0.84_15, 0.82_19, 0.80_20, 0.78_19, 0.76_17],
														        [0.90_93, 0.93_64, 0.95_81, 0.97_49, 0.98_70],
														    ]       )
														__snake_case	:    Tuple											=     TFRoFormerSinusoidalPositionalEmbedding(num_positions=512					,			embedding_dim=512       )
														emba([2, 16, 512]       )
														__snake_case	:    Union[str, Any]											=     emba.weight[:3, :5]

														tf.debugging.assert_near(lowerCamelCase					,			lowerCamelCase					,			atol=self.tolerance       )

@require_tf
class        a	(unittest.TestCase   ):




							"""simple docstring"""


							__UpperCAmelCase					:							Union[str, Any]  						=						1e-4

							def 					__snake_case      (							self :						Any       )			->					Dict:
														# 2,12,16,64
														__snake_case	:    List[Any]											=     tf.reshape(tf.range(2 * 12 * 16 * 64					,			dtype=tf.floataa       )					,			shape=(2, 12, 16, 64)       ) / 100

														__snake_case	:    Tuple											=     -tf.reshape(tf.range(2 * 12 * 16 * 64					,			dtype=tf.floataa       )					,			shape=(2, 12, 16, 64)       ) / 100

														__snake_case	:    Optional[Any]											=     TFRoFormerSinusoidalPositionalEmbedding(num_positions=32					,			embedding_dim=64       )
														__snake_case	:    Any											=     embed_positions([2, 16, 768]       )[None, None, :, :]

														__snake_case				,    __snake_case	:    int											=     TFRoFormerSelfAttention.apply_rotary_position_embeddings(
														    lowerCamelCase					,			lowerCamelCase					,			lowerCamelCase       )

														__snake_case	:    str											=     tf.constant(
														    [
														        [0.00_00, 0.01_00, 0.02_00, 0.03_00, 0.04_00, 0.05_00, 0.06_00, 0.07_00],
														        [-0.20_12, 0.88_97, 0.02_63, 0.94_01, 0.20_74, 0.94_63, 0.34_81, 0.93_43],
														        [-1.70_57, 0.62_71, -1.21_45, 1.38_97, -0.63_03, 1.76_47, -0.11_73, 1.89_85],
														        [-2.17_31, -1.63_97, -2.73_58, 0.28_54, -2.18_40, 1.71_83, -1.30_18, 2.48_71],
														        [0.27_17, -3.61_73, -2.92_06, -2.19_88, -3.66_38, 0.38_58, -2.91_55, 2.29_80],
														        [3.98_59, -2.15_80, -0.79_84, -4.49_04, -4.11_81, -2.02_52, -4.47_82, 1.12_53],
														    ]       )
														__snake_case	:    str											=     tf.constant(
														    [
														        [0.00_00, -0.01_00, -0.02_00, -0.03_00, -0.04_00, -0.05_00, -0.06_00, -0.07_00],
														        [0.20_12, -0.88_97, -0.02_63, -0.94_01, -0.20_74, -0.94_63, -0.34_81, -0.93_43],
														        [1.70_57, -0.62_71, 1.21_45, -1.38_97, 0.63_03, -1.76_47, 0.11_73, -1.89_85],
														        [2.17_31, 1.63_97, 2.73_58, -0.28_54, 2.18_40, -1.71_83, 1.30_18, -2.48_71],
														        [-0.27_17, 3.61_73, 2.92_06, 2.19_88, 3.66_38, -0.38_58, 2.91_55, -2.29_80],
														        [-3.98_59, 2.15_80, 0.79_84, 4.49_04, 4.11_81, 2.02_52, 4.47_82, -1.12_53],
														    ]       )

														tf.debugging.assert_near(query_layer[0, 0, :6, :8]					,			lowerCamelCase					,			atol=self.tolerance       )
														tf.debugging.assert_near(key_layer[0, 0, :6, :8]					,			lowerCamelCase					,			atol=self.tolerance       )





import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


_snake_case  :	int			      =       {
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

_snake_case  :	Dict			      =       logging.WARNING







def        lowerCAmelCase_  (      ):
							__snake_case	:    Union[str, Any]											=     os.getenv("DATASETS_VERBOSITY"							,			__lowerCamelCase			)
							if env_level_str:
														if env_level_str in log_levels:
																					return log_levels[env_level_str]
														else:
																					logging.getLogger().warning(
																					    F'Unknown option DATASETS_VERBOSITY={env_level_str}, '
																					    F'has to be one of: { ", ".join(log_levels.keys()			) }'			)
							return _default_log_level







def        lowerCAmelCase_  (      ):
							return __name__.split("."			)[0]







def        lowerCAmelCase_  (      ):
							return logging.getLogger(_get_library_name()			)







def        lowerCAmelCase_  (      ):
							# Apply our default configuration to the library root logger.
							__snake_case	:    str											=     _get_library_root_logger()
							library_root_logger.setLevel(_get_default_logging_level()			)







def        lowerCAmelCase_  (      ):
							__snake_case	:    Dict											=     _get_library_root_logger()
							library_root_logger.setLevel(logging.NOTSET			)







def        lowerCAmelCase_  (      __lowerCamelCase = None			):
							if name is None:
														__snake_case	:    Tuple											=     _get_library_name()
							return logging.getLogger(__lowerCamelCase			)







def        lowerCAmelCase_  (      ):
							return _get_library_root_logger().getEffectiveLevel()







def        lowerCAmelCase_  (      __lowerCamelCase			):
							_get_library_root_logger().setLevel(__lowerCamelCase			)







def        lowerCAmelCase_  (      ):
							return set_verbosity(__lowerCamelCase			)







def        lowerCAmelCase_  (      ):
							return set_verbosity(__lowerCamelCase			)







def        lowerCAmelCase_  (      ):
							return set_verbosity(__lowerCamelCase			)







def        lowerCAmelCase_  (      ):
							return set_verbosity(__lowerCamelCase			)







def        lowerCAmelCase_  (      ):
							__snake_case	:    List[str]											=     False







def        lowerCAmelCase_  (      ):
							__snake_case	:    Tuple											=     True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()

class        a	:




							"""simple docstring"""


							def __init__(							self :						int					,			*lowerCamelCase :						Optional[Any]					,			**lowerCamelCase :						List[str]       )			->					Optional[int]:  # pylint: disable=unused-argument
														__snake_case	:    int											=     args[0] if args else None

							def __iter__(							self :						Dict       )			->					Optional[int]:
														return iter(self._iterator       )

							def __getattr__(							self :						int					,			lowerCamelCase :						Optional[Any]       )			->					List[Any]:

														def empty_fn(*lowerCamelCase :						Optional[int]					,			**lowerCamelCase :						List[Any]       ):  # pylint: disable=unused-argument
																					return

														return empty_fn

							def __enter__(							self :						List[str]       )			->					int:
														return self






							def __exit__(							self :						Dict					,			lowerCamelCase :						Any					,			lowerCamelCase :						List[Any]					,			lowerCamelCase :						str       )			->					Dict:
														return
_snake_case  :	Optional[Any]			      =       True

class        a	:




							"""simple docstring"""


							def __call__(							self :						str					,			*lowerCamelCase :						Optional[Any]					,			lowerCamelCase :						Tuple=False					,			**lowerCamelCase :						Union[str, Any]       )			->					Optional[Any]:
														if _tqdm_active and not disable:
																					return tqdm_lib.tqdm(*lowerCamelCase					,			**lowerCamelCase       )
														else:
																					return EmptyTqdm(*lowerCamelCase					,			**lowerCamelCase       )

							def 					__snake_case      (							self :						str					,			*lowerCamelCase :						str					,			**lowerCamelCase :						Tuple       )			->					str:
														__snake_case	:    Optional[Any]											=     None
														if _tqdm_active:
																					return tqdm_lib.tqdm.set_lock(*lowerCamelCase					,			**lowerCamelCase       )






							def 					__snake_case      (							self :						List[Any]       )			->					List[Any]:
														if _tqdm_active:
																					return tqdm_lib.tqdm.get_lock()
_snake_case  :	int			      =       _tqdm_cls()







def        lowerCAmelCase_  (      ):
							global _tqdm_active
							return bool(_tqdm_active			)







def        lowerCAmelCase_  (      ):
							global _tqdm_active
							__snake_case	:    Tuple											=     True







def        lowerCAmelCase_  (      ):
							global _tqdm_active
							__snake_case	:    List[Any]											=     False

