

def 						UpperCamelCase (lowercase_:			str   ,				lowercase_:			bool = False )					->				str:

	if not isinstance(lowercase_   ,				lowercase_ ):
		A__							:   str					       =		f"""Expected string as input, found {type(lowercase_ )}"""
		raise ValueError(lowercase_ )
	if not isinstance(lowercase_   ,				lowercase_ ):
		A__							:   Optional[Any]					       =		f"""Expected boolean as use_pascal parameter, found {type(lowercase_ )}"""
		raise ValueError(lowercase_ )

	A__							:   str					       =		input_str.split("""_""" )

	A__							:   Optional[int]					       =		0 if use_pascal else 1

	A__							:   str					       =		words[start_index:]

	A__							:   Any					       =		[word[0].upper() + word[1:] for word in words_to_capitalize]

	A__							:   Union[str, Any]					       =		"""""" if use_pascal else words[0]

	return "".join([initial_word, *capitalized_words] )


if __name__ == "__main__":
	from doctest import testmod

	testmod()






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

import huggingface_hub.utils as hf_hub_utils
from tqdm import auto as tqdm_lib


A_	:			Any  	=      threading.Lock()
A_	:			Optional[logging.Handler]  	=      None

A_	:			Any  	=      {
    'debug': logging.DEBUG,
    'info': logging.INFO,
    'warning': logging.WARNING,
    'error': logging.ERROR,
    'critical': logging.CRITICAL,
}

A_	:			Optional[int]  	=      logging.WARNING

A_	:			Tuple  	=      True

def 						UpperCamelCase ()					->				List[Any]:
	A__							:   List[str]					       =		os.getenv("""TRANSFORMERS_VERBOSITY"""   ,				lowercase_ )
	if env_level_str:
		if env_level_str in log_levels:
			return log_levels[env_level_str]
		else:
			logging.getLogger().warning(
			    f"""Unknown option TRANSFORMERS_VERBOSITY={env_level_str}, """
			    f"""has to be one of: { ', '.join(log_levels.keys() ) }""" )
	return _default_log_level

def 						UpperCamelCase ()					->				str:
	return __name__.split(""".""" )[0]

def 						UpperCamelCase ()					->				logging.Logger:
	return logging.getLogger(_get_library_name() )

def 						UpperCamelCase ()					->				None:
	global _default_handler

	with _lock:
		if _default_handler:
			# This library has already configured the library root logger.
			return
		A__							:   Tuple					       =		logging.StreamHandler()  # Set sys.stderr as stream.
		A__							:   Union[str, Any]					       =		sys.stderr.flush

		# Apply our default configuration to the library root logger.
		A__							:   Optional[int]					       =		_get_library_root_logger()
		library_root_logger.addHandler(_default_handler )
		library_root_logger.setLevel(_get_default_logging_level() )
		A__							:   str					       =		False

def 						UpperCamelCase ()					->				None:
	global _default_handler

	with _lock:
		if not _default_handler:
			return

		A__							:   Tuple					       =		_get_library_root_logger()
		library_root_logger.removeHandler(_default_handler )
		library_root_logger.setLevel(logging.NOTSET )
		A__							:   Dict					       =		None

def 						UpperCamelCase ()					->				Dict:
	return log_levels

def 						UpperCamelCase (lowercase_:			Optional[str] = None )					->				logging.Logger:

	if name is None:
		A__							:   List[Any]					       =		_get_library_name()

	_configure_library_root_logger()
	return logging.getLogger(lowercase_ )

def 						UpperCamelCase ()					->				int:
	_configure_library_root_logger()
	return _get_library_root_logger().getEffectiveLevel()

def 						UpperCamelCase (lowercase_:			int )					->				None:
	_configure_library_root_logger()
	_get_library_root_logger().setLevel(lowercase_ )

def 						UpperCamelCase ()					->				Union[str, Any]:
	return set_verbosity(lowercase_ )

def 						UpperCamelCase ()					->				List[str]:
	return set_verbosity(lowercase_ )

def 						UpperCamelCase ()					->				Any:
	return set_verbosity(lowercase_ )

def 						UpperCamelCase ()					->				List[str]:
	return set_verbosity(lowercase_ )

def 						UpperCamelCase ()					->				None:
	_configure_library_root_logger()

	assert _default_handler is not None
	_get_library_root_logger().removeHandler(_default_handler )

def 						UpperCamelCase ()					->				None:
	_configure_library_root_logger()

	assert _default_handler is not None
	_get_library_root_logger().addHandler(_default_handler )

def 						UpperCamelCase (lowercase_:			logging.Handler )					->				None:
	_configure_library_root_logger()

	assert handler is not None
	_get_library_root_logger().addHandler(lowercase_ )

def 						UpperCamelCase (lowercase_:			logging.Handler )					->				None:
	_configure_library_root_logger()

	assert handler is not None and handler not in _get_library_root_logger().handlers
	_get_library_root_logger().removeHandler(lowercase_ )

def 						UpperCamelCase ()					->				None:
	_configure_library_root_logger()
	A__							:   Dict					       =		False

def 						UpperCamelCase ()					->				None:
	_configure_library_root_logger()
	A__							:   List[str]					       =		True

def 						UpperCamelCase ()					->				None:
	A__							:   List[str]					       =		_get_library_root_logger().handlers

	for handler in handlers:
		A__							:   Union[str, Any]					       =		logging.Formatter("""[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s""" )
		handler.setFormatter(lowercase_ )

def 						UpperCamelCase ()					->				None:
	A__							:   Dict					       =		_get_library_root_logger().handlers

	for handler in handlers:
		handler.setFormatter(lowercase_ )

def 						UpperCamelCase (self:			Tuple   ,				*lowercase_:			int   ,				**lowercase_:			List[Any] )					->				Optional[Any]:
	A__							:   int					       =		os.getenv("""TRANSFORMERS_NO_ADVISORY_WARNINGS"""   ,				lowercase_ )
	if no_advisory_warnings:
		return
	self.warning(*lowercase_   ,				**lowercase_ )


A_	:			int  	=      warning_advice

@functools.lru_cache(lowercase_ )
def 						UpperCamelCase (self:			Any   ,				*lowercase_:			List[str]   ,				**lowercase_:			Dict )					->				Optional[int]:
	self.warning(*lowercase_   ,				**lowercase_ )


A_	:			Tuple  	=      warning_once



class    _a						:


					'''simple docstring'''






					def __init__(			self   ,	*A__   ,	**A__      ):  # pylint: disable=unused-argument
						A__							:   int					       =		args[0] if args else None






					def __iter__(			self      ):
						return iter(self._iterator      )






					def __getattr__(			self   ,	A__      ):

						def empty_fn(*A__   ,	**A__      ):  # pylint: disable=unused-argument
							return

						return empty_fn






					def __enter__(			self      ):
						return self






					def __exit__(			self   ,	A__   ,	A__   ,	A__      ):
						return



class    _a						:


					'''simple docstring'''






					def __call__(			self   ,	*A__   ,	**A__      ):
						if _tqdm_active:
							return tqdm_lib.tqdm(*A__   ,	**A__      )
						else:
							return EmptyTqdm(*A__   ,	**A__      )






					def   __A      (			self   ,	*A__   ,	**A__      ):
						A__							:   List[Any]					       =		None
						if _tqdm_active:
							return tqdm_lib.tqdm.set_lock(*A__   ,	**A__      )






					def   __A      (			self      ):
						if _tqdm_active:
							return tqdm_lib.tqdm.get_lock()



A_	:			List[Any]  	=      _tqdm_cls()

def 						UpperCamelCase ()					->				bool:
	global _tqdm_active
	return bool(_tqdm_active )

def 						UpperCamelCase ()					->				List[str]:
	global _tqdm_active
	A__							:   int					       =		True
	hf_hub_utils.enable_progress_bars()


def 						UpperCamelCase ()					->				Optional[Any]:
	global _tqdm_active
	A__							:   Tuple					       =		False
	hf_hub_utils.disable_progress_bars()



