




from .integrations import (
    is_optuna_available,
    is_ray_available,
    is_sigopt_available,
    is_wandb_available,
    run_hp_search_optuna,
    run_hp_search_ray,
    run_hp_search_sigopt,
    run_hp_search_wandb,
)
from .trainer_utils import (
    HPSearchBackend,
    default_hp_space_optuna,
    default_hp_space_ray,
    default_hp_space_sigopt,
    default_hp_space_wandb,
)
from .utils import logging


UpperCAmelCase__				     = logging.get_logger(__name__)







class a :
						"""simple docstring"""

						UpperCamelCase_	:       str
						UpperCamelCase_	:       str       	=		None






						@staticmethod
						def     UpperCAmelCase_      ( )    ->						Dict:
													"""simple docstring"""


													raise NotImplementedError






						def     UpperCAmelCase_      ( self :     int				,							lowerCamelCase__ :     List[str]				,							lowerCamelCase__ :     int				,							lowerCamelCase__ :     str				,							**lowerCamelCase__ :     Union[str, Any]				)    ->						List[str]:
													"""simple docstring"""


													raise NotImplementedError






						def     UpperCAmelCase_      ( self :     Optional[Any]				,							lowerCamelCase__ :     Any				)    ->						List[Any]:
													"""simple docstring"""


													raise NotImplementedError






						def     UpperCAmelCase_      ( self :     Tuple				)    ->						Dict:
													"""simple docstring"""


													if not self.is_available():
																				raise RuntimeError(
																				    f'You picked the {self.name} backend, but it is not installed. Run {self.pip_install()}.'				)






						@classmethod
						def     UpperCAmelCase_      ( cls :     Tuple				)    ->						List[Any]:
													"""simple docstring"""


													return f'`pip install {cls.pip_package or cls.name}`'







class a (     __SCREAMING_SNAKE_CASE  ):
						"""simple docstring"""

						UpperCamelCase_	:       List[Any]       	=		'optuna'






						@staticmethod
						def     UpperCAmelCase_      ( )    ->						Any:
													"""simple docstring"""


													return is_optuna_available()






						def     UpperCAmelCase_      ( self :     Any				,							lowerCamelCase__ :     Union[str, Any]				,							lowerCamelCase__ :     int				,							lowerCamelCase__ :     str				,							**lowerCamelCase__ :     str				)    ->						Optional[int]:
													"""simple docstring"""


													return run_hp_search_optuna(lowerCamelCase__				,							lowerCamelCase__				,							lowerCamelCase__				,							**lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     str				,							lowerCamelCase__ :     List[str]				)    ->						Dict:
													"""simple docstring"""


													return default_hp_space_optuna(lowerCamelCase__				)







class a (     __SCREAMING_SNAKE_CASE  ):
						"""simple docstring"""

						UpperCamelCase_	:       List[str]       	=		'ray'
						UpperCamelCase_	:       Optional[Any]       	=		'\'ray[tune]\''






						@staticmethod
						def     UpperCAmelCase_      ( )    ->						Union[str, Any]:
													"""simple docstring"""


													return is_ray_available()






						def     UpperCAmelCase_      ( self :     int				,							lowerCamelCase__ :     Dict				,							lowerCamelCase__ :     int				,							lowerCamelCase__ :     str				,							**lowerCamelCase__ :     Optional[int]				)    ->						Union[str, Any]:
													"""simple docstring"""


													return run_hp_search_ray(lowerCamelCase__				,							lowerCamelCase__				,							lowerCamelCase__				,							**lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     Optional[int]				,							lowerCamelCase__ :     int				)    ->						int:
													"""simple docstring"""


													return default_hp_space_ray(lowerCamelCase__				)







class a (     __SCREAMING_SNAKE_CASE  ):
						"""simple docstring"""

						UpperCamelCase_	:       Union[str, Any]       	=		'sigopt'






						@staticmethod
						def     UpperCAmelCase_      ( )    ->						Dict:
													"""simple docstring"""


													return is_sigopt_available()






						def     UpperCAmelCase_      ( self :     Dict				,							lowerCamelCase__ :     Tuple				,							lowerCamelCase__ :     int				,							lowerCamelCase__ :     str				,							**lowerCamelCase__ :     Dict				)    ->						str:
													"""simple docstring"""


													return run_hp_search_sigopt(lowerCamelCase__				,							lowerCamelCase__				,							lowerCamelCase__				,							**lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     List[Any]				,							lowerCamelCase__ :     List[Any]				)    ->						str:
													"""simple docstring"""


													return default_hp_space_sigopt(lowerCamelCase__				)







class a (     __SCREAMING_SNAKE_CASE  ):
						"""simple docstring"""

						UpperCamelCase_	:       str       	=		'wandb'






						@staticmethod
						def     UpperCAmelCase_      ( )    ->						List[Any]:
													"""simple docstring"""


													return is_wandb_available()






						def     UpperCAmelCase_      ( self :     Union[str, Any]				,							lowerCamelCase__ :     List[str]				,							lowerCamelCase__ :     int				,							lowerCamelCase__ :     str				,							**lowerCamelCase__ :     List[str]				)    ->						int:
													"""simple docstring"""


													return run_hp_search_wandb(lowerCamelCase__				,							lowerCamelCase__				,							lowerCamelCase__				,							**lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     int				,							lowerCamelCase__ :     int				)    ->						Optional[Any]:
													"""simple docstring"""


													return default_hp_space_wandb(lowerCamelCase__				)





UpperCAmelCase__				     = {
    HPSearchBackend(backend.name): backend for backend in [OptunaBackend, RayTuneBackend, SigOptBackend, WandbBackend]
}







def 		_A(       )    -> str:
							'''simple docstring'''


							__lowercase      =    [backend for backend in ALL_HYPERPARAMETER_SEARCH_BACKENDS.values() if backend.is_available()]
							if len(UpperCamelCase__				) > 0:
														__lowercase      =    available_backends[0].name
														if len(UpperCamelCase__				) > 1:
																					logger.info(
																					    F'{len(UpperCamelCase__				)} hyperparameter search backends available. Using {name} as the default.'				)
														return name
							raise RuntimeError(
							    '''No hyperparameter search backend available.\n'''
							    + '''\n'''.join(
							        F' - To install {backend.name} run {backend.pip_install()}'
							        for backend in ALL_HYPERPARAMETER_SEARCH_BACKENDS.values()				)				)












from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels
from .squad import SquadExample, SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features
from .utils import DataProcessor, InputExample, InputFeatures, SingleSentenceClassificationProcessor
from .xnli import xnli_output_modes, xnli_processors, xnli_tasks_num_labels






