


import inspect
import tempfile
from collections import OrderedDict, UserDict
from collections.abc import MutableMapping
from contextlib import ExitStack, contextmanager
from dataclasses import fields
from enum import Enum
from typing import Any, ContextManager, List, Tuple

import numpy as np

from .import_utils import is_flax_available, is_tf_available, is_torch_available, is_torch_fx_proxy


if is_flax_available():
							import jax.numpy as jnp





class        lowerCAmelCase__ (					lowercase__  ):






						"""simple docstring"""




						def __get__(       self ,				a_ ,				a_=None      ):


							if obj is None:
								return self
							if self.fget is None:
								raise AttributeError("unreadable attribute"      )
							lowerCamelCase_					:				Optional[Any]              =  "__cached_" + self.fget.__name__
							lowerCamelCase_					:				Dict              =  getattr(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      )
							if cached is None:
								lowerCamelCase_					:				Optional[Any]              =  self.fget(SCREAMING_SNAKE_CASE_      )
								setattr(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      )
							return cached







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	lowerCamelCase_					:				str              =  val.lower()
	if val in {"y", "yes", "t", "true", "on", "1"}:
		return 1
	if val in {"n", "no", "f", "false", "off", "0"}:
		return 0
	raise ValueError(F"""invalid truth value {val!r}""")







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	if is_torch_fx_proxy(_lowerCamelCase):
		return True
	if is_torch_available():
		import torch

		if isinstance(_lowerCamelCase     ,	torch.Tensor):
			return True
	if is_tf_available():
		import tensorflow as tf

		if isinstance(_lowerCamelCase     ,	tf.Tensor):
			return True

	if is_flax_available():
		import jax.numpy as jnp
		from jax.core import Tracer

		if isinstance(_lowerCamelCase     ,	(jnp.ndarray, Tracer)):
			return True

	return isinstance(_lowerCamelCase     ,	np.ndarray)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return isinstance(_lowerCamelCase     ,	np.ndarray)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return _is_numpy(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	import torch

	return isinstance(_lowerCamelCase     ,	torch.Tensor)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return False if not is_torch_available() else _is_torch(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	import torch

	return isinstance(_lowerCamelCase     ,	torch.device)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return False if not is_torch_available() else _is_torch_device(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	import torch

	if isinstance(_lowerCamelCase     ,	_lowerCamelCase):
		if hasattr(_lowerCamelCase     ,	_lowerCamelCase):
			lowerCamelCase_					:				List[str]              =  getattr(_lowerCamelCase     ,	_lowerCamelCase)
		else:
			return False
	return isinstance(_lowerCamelCase     ,	torch.dtype)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return False if not is_torch_available() else _is_torch_dtype(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	import tensorflow as tf

	return isinstance(_lowerCamelCase     ,	tf.Tensor)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return False if not is_tf_available() else _is_tensorflow(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	import tensorflow as tf

	# the `is_symbolic_tensor` predicate is only available starting with TF 2.14
	if hasattr(_lowerCamelCase     ,	"is_symbolic_tensor"):
		return tf.is_symbolic_tensor(_lowerCamelCase)
	return type(_lowerCamelCase) == tf.Tensor







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return False if not is_tf_available() else _is_tf_symbolic_tensor(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	import jax.numpy as jnp  # noqa: F811

	return isinstance(_lowerCamelCase     ,	jnp.ndarray)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	return False if not is_flax_available() else _is_jax(_lowerCamelCase)







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	if isinstance(_lowerCamelCase     ,	(dict, UserDict)):
		return {k: to_py_obj(_lowerCamelCase) for k, v in obj.items()}
	elif isinstance(_lowerCamelCase     ,	(list, tuple)):
		return [to_py_obj(_lowerCamelCase) for o in obj]
	elif is_tf_tensor(_lowerCamelCase):
		return obj.numpy().tolist()
	elif is_torch_tensor(_lowerCamelCase):
		return obj.detach().cpu().tolist()
	elif is_jax_tensor(_lowerCamelCase):
		return np.asarray(_lowerCamelCase).tolist()
	elif isinstance(_lowerCamelCase     ,	(np.ndarray, np.number)):  # tolist also works on 0d np arrays
		return obj.tolist()
	else:
		return obj







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	if isinstance(_lowerCamelCase     ,	(dict, UserDict)):
		return {k: to_numpy(_lowerCamelCase) for k, v in obj.items()}
	elif isinstance(_lowerCamelCase     ,	(list, tuple)):
		return np.array(_lowerCamelCase)
	elif is_tf_tensor(_lowerCamelCase):
		return obj.numpy()
	elif is_torch_tensor(_lowerCamelCase):
		return obj.detach().cpu().numpy()
	elif is_jax_tensor(_lowerCamelCase):
		return np.asarray(_lowerCamelCase)
	else:
		return obj





class        lowerCAmelCase__ (					lowercase__  ):






						"""simple docstring"""




						def 	_UpperCamelCase					(       self      ):
							lowerCamelCase_					:				str              =  fields(self      )

							# Safety and consistency checks
							if not len(SCREAMING_SNAKE_CASE_      ):
								raise ValueError(F"""{self.__class__.__name__} has no fields."""      )
							if not all(field.default is None for field in class_fields[1:]      ):
								raise ValueError(F"""{self.__class__.__name__} should not have more than one required field."""      )

							lowerCamelCase_					:				str              =  getattr(self ,				class_fields[0].name      )
							lowerCamelCase_					:				List[str]              =  all(getattr(self ,				field.name      ) is None for field in class_fields[1:]      )

							if other_fields_are_none and not is_tensor(SCREAMING_SNAKE_CASE_      ):
								if isinstance(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      ):
									lowerCamelCase_					:				Dict              =  first_field.items()
									lowerCamelCase_					:				Dict              =  True
								else:
									try:
										lowerCamelCase_					:				List[str]              =  iter(SCREAMING_SNAKE_CASE_      )
										lowerCamelCase_					:				Optional[int]              =  True
									except TypeError:
										lowerCamelCase_					:				Optional[Any]              =  False

            # if we provided an iterator as first field and the iterator is a (key, value) iterator
            # set the associated fields
								if first_field_iterator:
									for idx, element in enumerate(SCREAMING_SNAKE_CASE_      ):
										if (
										    not isinstance(SCREAMING_SNAKE_CASE_ ,				(list, tuple)      )
										    or not len(SCREAMING_SNAKE_CASE_      ) == 2
										    or not isinstance(element[0] ,				SCREAMING_SNAKE_CASE_      )
										):
											if idx == 0:
												# If we do not have an iterator of key/values, set it as attribute
												lowerCamelCase_					:				Tuple              =  first_field
											else:
												# If we have a mixed iterator, raise an error
												raise ValueError(
												    F"""Cannot set key/value for {element}. It needs to be a tuple (key, value)."""      )
											break
										setattr(self ,				element[0] ,				element[1]      )
										if element[1] is not None:
											lowerCamelCase_					:				Dict              =  element[1]
								elif first_field is not None:
									lowerCamelCase_					:				Dict              =  first_field
							else:
								for field in class_fields:
									lowerCamelCase_					:				int              =  getattr(self ,				field.name      )
									if v is not None:
										lowerCamelCase_					:				Tuple              =  v




						def __delitem__(       self ,				*a_ ,				**a_      ):
							raise Exception(F"""You cannot use ``__delitem__`` on a {self.__class__.__name__} instance."""      )




						def 	_UpperCamelCase					(       self ,				*a_ ,				**a_      ):
							raise Exception(F"""You cannot use ``setdefault`` on a {self.__class__.__name__} instance."""      )




						def 	_UpperCamelCase					(       self ,				*a_ ,				**a_      ):
							raise Exception(F"""You cannot use ``pop`` on a {self.__class__.__name__} instance."""      )




						def 	_UpperCamelCase					(       self ,				*a_ ,				**a_      ):
							raise Exception(F"""You cannot use ``update`` on a {self.__class__.__name__} instance."""      )




						def __getitem__(       self ,				a_      ):


							if isinstance(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      ):
								lowerCamelCase_					:				Tuple              =  dict(self.items()      )
								return inner_dict[k]
							else:
								return self.to_tuple()[k]




						def __setattr__(       self ,				a_ ,				a_      ):


							if name in self.keys() and value is not None:
								# Don't call self.__setitem__ to avoid recursion errors
								super().__setitem__(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      )
							super().__setattr__(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      )




						def __setitem__(       self ,				a_ ,				a_      ):
							super().__setitem__(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      )
							# Don't call self.__setattr__ to avoid recursion errors
							super().__setattr__(SCREAMING_SNAKE_CASE_ ,				SCREAMING_SNAKE_CASE_      )




						def 	_UpperCamelCase					(       self      ):
							return tuple(self[k] for k in self.keys()      )





class        lowerCAmelCase__ (					lowercase__,							lowercase__  ):






						"""simple docstring"""




						@classmethod
						def 	_UpperCamelCase					(       cls ,				a_      ):
							raise ValueError(
							    F"""{value} is not a valid {cls.__name__}, please select one of {list(cls._valueamember_map_.keys()      )}"""      )





class        lowerCAmelCase__ (					lowercase__  ):






						"""simple docstring"""
						__UpperCAmelCase       :						Any    	=			'''longest'''
						__UpperCAmelCase       :						List[str]    	=			'''max_length'''
						__UpperCAmelCase       :						Optional[int]    	=			'''do_not_pad'''





class        lowerCAmelCase__ (					lowercase__  ):






						"""simple docstring"""
						__UpperCAmelCase       :						int    	=			'''pt'''
						__UpperCAmelCase       :						List[str]    	=			'''tf'''
						__UpperCAmelCase       :						Union[str, Any]    	=			'''np'''
						__UpperCAmelCase       :						Any    	=			'''jax'''





class        lowerCAmelCase__ :






						"""simple docstring"""




						def __init__(       self ,				a_      ):
							lowerCamelCase_					:				List[Any]              =  context_managers
							lowerCamelCase_					:				str              =  ExitStack()




						def __enter__(       self      ):


							for context_manager in self.context_managers:
								self.stack.enter_context(SCREAMING_SNAKE_CASE_      )




						def __exit__(       self ,				*a_ ,				**a_      ):
							self.stack.__exit__(*SCREAMING_SNAKE_CASE_ ,				**SCREAMING_SNAKE_CASE_      )







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	lowerCamelCase_					:				Union[str, Any]              =  infer_framework(_lowerCamelCase)
	if framework == "tf":
		lowerCamelCase_					:				Union[str, Any]              =  inspect.signature(model_class.call)  # TensorFlow models
	elif framework == "pt":
		lowerCamelCase_					:				Optional[int]              =  inspect.signature(model_class.forward)  # PyTorch models
	else:
		lowerCamelCase_					:				Dict              =  inspect.signature(model_class.__call__)  # Flax models

	for p in signature.parameters:
		if p == "return_loss" and signature.parameters[p].default is True:
			return True

	return False







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	lowerCamelCase_					:				Dict              =  model_class.__name__
	lowerCamelCase_					:				List[Any]              =  infer_framework(_lowerCamelCase)
	if framework == "tf":
		lowerCamelCase_					:				str              =  inspect.signature(model_class.call)  # TensorFlow models
	elif framework == "pt":
		lowerCamelCase_					:				Union[str, Any]              =  inspect.signature(model_class.forward)  # PyTorch models
	else:
		lowerCamelCase_					:				str              =  inspect.signature(model_class.__call__)  # Flax models

	if "QuestionAnswering" in model_name:
		return [p for p in signature.parameters if "label" in p or p in ("start_positions", "end_positions")]
	else:
		return [p for p in signature.parameters if "label" in p]







def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_ = ""     ,	lowerCAmelCase_ = "."):
	'''simple docstring'''


	def _flatten_dict(lowerCAmelCase_     ,	lowerCAmelCase_=""     ,	lowerCAmelCase_="."):
		for k, v in d.items():
			lowerCamelCase_					:				str              =  str(_lowerCamelCase) + delimiter + str(_lowerCamelCase) if parent_key else k
			if v and isinstance(_lowerCamelCase     ,	_lowerCamelCase):
				yield from flatten_dict(_lowerCamelCase     ,	_lowerCamelCase     ,	delimiter=_lowerCamelCase).items()
			else:
				yield key, v

	return dict(_flatten_dict(_lowerCamelCase     ,	_lowerCamelCase     ,	_lowerCamelCase))







@contextmanager
def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_ = False):
	'''simple docstring'''


	if use_temp_dir:
		with tempfile.TemporaryDirectory() as tmp_dir:
			yield tmp_dir
	else:
		yield working_dir







def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_=None):
	'''simple docstring'''


	if is_numpy_array(_lowerCamelCase):
		return np.transpose(_lowerCamelCase     ,	axes=_lowerCamelCase)
	elif is_torch_tensor(_lowerCamelCase):
		return array.T if axes is None else array.permute(*_lowerCamelCase)
	elif is_tf_tensor(_lowerCamelCase):
		import tensorflow as tf

		return tf.transpose(_lowerCamelCase     ,	perm=_lowerCamelCase)
	elif is_jax_tensor(_lowerCamelCase):
		return jnp.transpose(_lowerCamelCase     ,	axes=_lowerCamelCase)
	else:
		raise ValueError(F"""Type not supported for transpose: {type(_lowerCamelCase)}.""")







def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_):
	'''simple docstring'''


	if is_numpy_array(_lowerCamelCase):
		return np.reshape(_lowerCamelCase     ,	_lowerCamelCase)
	elif is_torch_tensor(_lowerCamelCase):
		return array.reshape(*_lowerCamelCase)
	elif is_tf_tensor(_lowerCamelCase):
		import tensorflow as tf

		return tf.reshape(_lowerCamelCase     ,	_lowerCamelCase)
	elif is_jax_tensor(_lowerCamelCase):
		return jnp.reshape(_lowerCamelCase     ,	_lowerCamelCase)
	else:
		raise ValueError(F"""Type not supported for reshape: {type(_lowerCamelCase)}.""")







def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_=None):
	'''simple docstring'''


	if is_numpy_array(_lowerCamelCase):
		return np.squeeze(_lowerCamelCase     ,	axis=_lowerCamelCase)
	elif is_torch_tensor(_lowerCamelCase):
		return array.squeeze() if axis is None else array.squeeze(dim=_lowerCamelCase)
	elif is_tf_tensor(_lowerCamelCase):
		import tensorflow as tf

		return tf.squeeze(_lowerCamelCase     ,	axis=_lowerCamelCase)
	elif is_jax_tensor(_lowerCamelCase):
		return jnp.squeeze(_lowerCamelCase     ,	axis=_lowerCamelCase)
	else:
		raise ValueError(F"""Type not supported for squeeze: {type(_lowerCamelCase)}.""")







def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_):
	'''simple docstring'''


	if is_numpy_array(_lowerCamelCase):
		return np.expand_dims(_lowerCamelCase     ,	_lowerCamelCase)
	elif is_torch_tensor(_lowerCamelCase):
		return array.unsqueeze(dim=_lowerCamelCase)
	elif is_tf_tensor(_lowerCamelCase):
		import tensorflow as tf

		return tf.expand_dims(_lowerCamelCase     ,	axis=_lowerCamelCase)
	elif is_jax_tensor(_lowerCamelCase):
		return jnp.expand_dims(_lowerCamelCase     ,	axis=_lowerCamelCase)
	else:
		raise ValueError(F"""Type not supported for expand_dims: {type(_lowerCamelCase)}.""")







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	if is_numpy_array(_lowerCamelCase):
		return np.size(_lowerCamelCase)
	elif is_torch_tensor(_lowerCamelCase):
		return array.numel()
	elif is_tf_tensor(_lowerCamelCase):
		import tensorflow as tf

		return tf.size(_lowerCamelCase)
	elif is_jax_tensor(_lowerCamelCase):
		return array.size
	else:
		raise ValueError(F"""Type not supported for expand_dims: {type(_lowerCamelCase)}.""")







def 							__magic_name__    (     lowerCAmelCase_     ,	lowerCAmelCase_):
	'''simple docstring'''


	for key, value in auto_map.items():
		if isinstance(_lowerCamelCase     ,	(tuple, list)):
			lowerCamelCase_					:				Tuple              =  [F"""{repo_id}--{v}""" if (v is not None and "--" not in v) else v for v in value]
		elif value is not None and "--" not in value:
			lowerCamelCase_					:				List[Any]              =  F"""{repo_id}--{value}"""

	return auto_map







def 							__magic_name__    (     lowerCAmelCase_):
	'''simple docstring'''


	for base_class in inspect.getmro(_lowerCamelCase):
		lowerCamelCase_					:				Optional[int]              =  base_class.__module__
		lowerCamelCase_					:				Optional[Any]              =  base_class.__name__
		if module.startswith("tensorflow") or module.startswith("keras") or name == "TFPreTrainedModel":
			return "tf"
		elif module.startswith("torch") or name == "PreTrainedModel":
			return "pt"
		elif module.startswith("flax") or module.startswith("jax") or name == "FlaxPreTrainedModel":
			return "flax"
	else:
		raise TypeError(F"""Could not infer framework from class {model_class}.""")



"""simple docstring"""






import os
import unittest

from huggingface_hub.utils import are_progress_bars_disabled

import transformers.models.bart.tokenization_bart
from transformers import logging
from transformers.testing_utils import CaptureLogger, mockenv, mockenv_context
from transformers.utils.logging import disable_progress_bar, enable_progress_bar



class 			lowercase					( unittest.TestCase		):






			def 					UpperCAmelCase							(self  :	Union[str, Any]			)       ->	Optional[Any]:





				"""simple docstring"""


				lowerCAmelCase												=  logging.get_logger()

				# the current default level is logging.WARNING
				lowerCAmelCase												=  logging.get_verbosity()

				logging.set_verbosity_error()
				self.assertEqual(logger.getEffectiveLevel()      ,logging.get_verbosity()			)

				logging.set_verbosity_warning()
				self.assertEqual(logger.getEffectiveLevel()      ,logging.get_verbosity()			)

				logging.set_verbosity_info()
				self.assertEqual(logger.getEffectiveLevel()      ,logging.get_verbosity()			)

				logging.set_verbosity_debug()
				self.assertEqual(logger.getEffectiveLevel()      ,logging.get_verbosity()			)

				# restore to the original level
				logging.set_verbosity(SCREAMING_SNAKE_CASE_			)






			def 					UpperCAmelCase							(self  :	Union[str, Any]			)       ->	Optional[int]:





				"""simple docstring"""


				lowerCAmelCase												=  logging.get_verbosity()

				lowerCAmelCase												=  logging.get_logger('''transformers.models.bart.tokenization_bart'''			)
				lowerCAmelCase												=  '''Testing 1, 2, 3'''

				# should be able to log warnings (if default settings weren't overridden by `pytest --log-level-all`)
				if level_origin <= logging.WARNING:
					with CaptureLogger(SCREAMING_SNAKE_CASE_			) as cl:
						logger.warning(SCREAMING_SNAKE_CASE_			)
					self.assertEqual(cl.out      ,msg + '''\n'''			)

				# this is setting the level for all of `transformers.*` loggers
				logging.set_verbosity_error()

				# should not be able to log warnings
				with CaptureLogger(SCREAMING_SNAKE_CASE_			) as cl:
					logger.warning(SCREAMING_SNAKE_CASE_			)
				self.assertEqual(cl.out      ,''''''			)

				# should be able to log warnings again
				logging.set_verbosity_warning()
				with CaptureLogger(SCREAMING_SNAKE_CASE_			) as cl:
					logger.warning(SCREAMING_SNAKE_CASE_			)
				self.assertEqual(cl.out      ,msg + '''\n'''			)

				# restore to the original level
				logging.set_verbosity(SCREAMING_SNAKE_CASE_			)






			@mockenv(TRANSFORMERS_VERBOSITY='''error'''			)
			def 					UpperCAmelCase							(self  :	Any			)       ->	str:





				"""simple docstring"""


				transformers.utils.logging._reset_library_root_logger()
				# this action activates the env var
				lowerCAmelCase												=  logging.get_logger('''transformers.models.bart.tokenization_bart'''			)

				lowerCAmelCase												=  os.getenv('''TRANSFORMERS_VERBOSITY'''      ,SCREAMING_SNAKE_CASE_			)
				lowerCAmelCase												=  logging.log_levels[env_level_str]

				lowerCAmelCase												=  logging.get_verbosity()
				self.assertEqual(
				    SCREAMING_SNAKE_CASE_      ,SCREAMING_SNAKE_CASE_      ,F"""TRANSFORMERS_VERBOSITY={env_level_str}/{env_level}, but internal verbosity is {current_level}"""      ,)

				# restore to the original level
				lowerCAmelCase												=  ''''''
				transformers.utils.logging._reset_library_root_logger()






			@mockenv(TRANSFORMERS_VERBOSITY='''super-error'''			)
			def 					UpperCAmelCase							(self  :	List[Any]			)       ->	Tuple:





				"""simple docstring"""


				transformers.utils.logging._reset_library_root_logger()
				lowerCAmelCase												=  logging.logging.getLogger()
				with CaptureLogger(SCREAMING_SNAKE_CASE_			) as cl:
					# this action activates the env var
					logging.get_logger('''transformers.models.bart.tokenization_bart'''			)
				self.assertIn('''Unknown option TRANSFORMERS_VERBOSITY=super-error'''      ,cl.out			)

				# no need to restore as nothing was changed






			def 					UpperCAmelCase							(self  :	Dict			)       ->	Any:





				"""simple docstring"""


				transformers.utils.logging._reset_library_root_logger()

				lowerCAmelCase												=  logging.get_logger('''transformers.models.bart.tokenization_bart'''			)
				lowerCAmelCase												=  '''Testing 1, 2, 3'''

				with mockenv_context(TRANSFORMERS_NO_ADVISORY_WARNINGS='''1'''			):
					# nothing should be logged as env var disables this method
					with CaptureLogger(SCREAMING_SNAKE_CASE_			) as cl:
						logger.warning_advice(SCREAMING_SNAKE_CASE_			)
					self.assertEqual(cl.out      ,''''''			)

				with mockenv_context(TRANSFORMERS_NO_ADVISORY_WARNINGS=''''''			):
					# should log normally as TRANSFORMERS_NO_ADVISORY_WARNINGS is unset
					with CaptureLogger(SCREAMING_SNAKE_CASE_			) as cl:
						logger.warning_advice(SCREAMING_SNAKE_CASE_			)
					self.assertEqual(cl.out      ,msg + '''\n'''			)





def __magic_name__	(				)					->						List[Any]:

	'''simple docstring'''




	disable_progress_bar()
	assert are_progress_bars_disabled()

	enable_progress_bar()
	assert not are_progress_bars_disabled()


