

"""simple docstring"""




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


SCREAMING_SNAKE_CASE_     :			str	  =			threading.Lock()
SCREAMING_SNAKE_CASE_     :			Optional[int]	  =			None

SCREAMING_SNAKE_CASE_     :			List[str]	  =			{
    '''debug''': logging.DEBUG,
    '''info''': logging.INFO,
    '''warning''': logging.WARNING,
    '''error''': logging.ERROR,
    '''critical''': logging.CRITICAL,
}

SCREAMING_SNAKE_CASE_     :			List[str]	  =			logging.WARNING

SCREAMING_SNAKE_CASE_     :			Any	  =			True



def 	UpperCAmelCase__   (				)      ->      Union[str, Any]:




   """simple docstring"""
   lowerCamelCase__						=			os.getenv("TRANSFORMERS_VERBOSITY"	,    UpperCamelCase__   )
   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__   (				)      ->      Optional[Any]:




   """simple docstring"""
   return __name__.split("."   )[0]



def 	UpperCAmelCase__   (				)      ->      Union[str, Any]:




   """simple docstring"""
   return logging.getLogger(_get_library_name()   )



def 	UpperCAmelCase__   (				)      ->      List[Any]:




   """simple docstring"""
   global _default_handler

   with _lock:
      if _default_handler:
         # This library has already configured the library root logger.
         return
      lowerCamelCase__						=			logging.StreamHandler()  # Set sys.stderr as stream.
      lowerCamelCase__						=			sys.stderr.flush

      # Apply our default configuration to the library root logger.
      lowerCamelCase__						=			_get_library_root_logger()
      library_root_logger.addHandler(_default_handler   )
      library_root_logger.setLevel(_get_default_logging_level()   )
      lowerCamelCase__						=			False



def 	UpperCAmelCase__   (				)      ->      Union[str, Any]:




   """simple docstring"""
   global _default_handler

   with _lock:
      if not _default_handler:
         return

      lowerCamelCase__						=			_get_library_root_logger()
      library_root_logger.removeHandler(_default_handler   )
      library_root_logger.setLevel(logging.NOTSET   )
      lowerCamelCase__						=			None



def 	UpperCAmelCase__   (				)      ->      List[Any]:




   """simple docstring"""
   return log_levels



def 	UpperCAmelCase__   (				A__ = None   )      ->      int:




   """simple docstring"""

   if name is None:
      lowerCamelCase__						=			_get_library_name()

   _configure_library_root_logger()
   return logging.getLogger(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      List[str]:




   """simple docstring"""
   _configure_library_root_logger()
   return _get_library_root_logger().getEffectiveLevel()



def 	UpperCAmelCase__   (				A__   )      ->      Optional[Any]:




   """simple docstring"""
   _configure_library_root_logger()
   _get_library_root_logger().setLevel(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      List[str]:




   """simple docstring"""
   return set_verbosity(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      int:




   """simple docstring"""
   return set_verbosity(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      Dict:




   """simple docstring"""
   return set_verbosity(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      str:




   """simple docstring"""
   return set_verbosity(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      Optional[int]:




   """simple docstring"""
   _configure_library_root_logger()

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



def 	UpperCAmelCase__   (				)      ->      Union[str, Any]:




   """simple docstring"""
   _configure_library_root_logger()

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



def 	UpperCAmelCase__   (				A__   )      ->      List[Any]:




   """simple docstring"""
   _configure_library_root_logger()

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



def 	UpperCAmelCase__   (				A__   )      ->      Tuple:




   """simple docstring"""
   _configure_library_root_logger()

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



def 	UpperCAmelCase__   (				)      ->      Any:




   """simple docstring"""
   _configure_library_root_logger()
   lowerCamelCase__						=			False



def 	UpperCAmelCase__   (				)      ->      Any:




   """simple docstring"""
   _configure_library_root_logger()
   lowerCamelCase__						=			True



def 	UpperCAmelCase__   (				)      ->      Any:




   """simple docstring"""
   lowerCamelCase__						=			_get_library_root_logger().handlers

   for handler in handlers:
      lowerCamelCase__						=			logging.Formatter("[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s"   )
      handler.setFormatter(UpperCamelCase__   )



def 	UpperCAmelCase__   (				)      ->      Optional[int]:




   """simple docstring"""
   lowerCamelCase__						=			_get_library_root_logger().handlers

   for handler in handlers:
      handler.setFormatter(UpperCamelCase__   )



def 	UpperCAmelCase__   (				self	,    *A__	,    **A__   )      ->      List[Any]:




   """simple docstring"""
   lowerCamelCase__						=			os.getenv("TRANSFORMERS_NO_ADVISORY_WARNINGS"	,    UpperCamelCase__   )
   if no_advisory_warnings:
      return
   self.warning(*UpperCamelCase__	,    **UpperCamelCase__   )


SCREAMING_SNAKE_CASE_     :			Optional[int]	  =			warning_advice



@functools.lru_cache(UpperCamelCase__   )
def 	UpperCAmelCase__   (				self	,    *A__	,    **A__   )      ->      Optional[Any]:




   """simple docstring"""
   self.warning(*UpperCamelCase__	,    **UpperCamelCase__   )


SCREAMING_SNAKE_CASE_     :			Union[str, Any]	  =			warning_once


class 		_A       :





      def __init__(  self    ,						*SCREAMING_SNAKE_CASE__    ,						**SCREAMING_SNAKE_CASE__		)   ->					str:  # pylint: disable=unused-argument
         lowerCamelCase__						=			args[0] if args else None





      def __iter__(  self		)   ->					List[str]:
         return iter(self._iterator		)





      def __getattr__(  self    ,						SCREAMING_SNAKE_CASE__		)   ->					List[Any]:



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

         return empty_fn





      def __enter__(  self		)   ->					str:
         return self





      def __exit__(  self    ,						SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__		)   ->					Any:
         return






class 		_A       :





      def __call__(  self    ,						*SCREAMING_SNAKE_CASE__    ,						**SCREAMING_SNAKE_CASE__		)   ->					List[Any]:



         if _tqdm_active:
            return tqdm_lib.tqdm(*__A    ,						**__A		)
         else:
            return EmptyTqdm(*__A    ,						**__A		)





      def 					_lowerCamelCase  (  self    ,						*SCREAMING_SNAKE_CASE__    ,						**SCREAMING_SNAKE_CASE__		)   ->					str:
         lowerCamelCase__						=			None
         if _tqdm_active:
            return tqdm_lib.tqdm.set_lock(*__A    ,						**__A		)





      def 					_lowerCamelCase  (  self		)   ->					List[Any]:



         if _tqdm_active:
            return tqdm_lib.tqdm.get_lock()






SCREAMING_SNAKE_CASE_     :			str	  =			_tqdm_cls()



def 	UpperCAmelCase__   (				)      ->      Optional[int]:




   """simple docstring"""
   global _tqdm_active
   return bool(_tqdm_active   )



def 	UpperCAmelCase__   (				)      ->      Tuple:




   """simple docstring"""
   global _tqdm_active
   lowerCamelCase__						=			True
   hf_hub_utils.enable_progress_bars()



def 	UpperCAmelCase__   (				)      ->      Any:




   """simple docstring"""
   global _tqdm_active
   lowerCamelCase__						=			False
   hf_hub_utils.disable_progress_bars()







"""simple docstring"""




from __future__ import annotations

from typing import Any



def 	UpperCAmelCase__   (				A__   )      ->      None:




   """simple docstring"""
   create_state_space_tree(A__	,    []	,    0   )



def 	UpperCAmelCase__   (				A__	,    A__	,    A__   )      ->      None:




   """simple docstring"""

   if index == len(A__   ):
      print(A__   )
      return

   create_state_space_tree(A__	,    A__	,    index + 1   )
   current_subsequence.append(sequence[index]   )
   create_state_space_tree(A__	,    A__	,    index + 1   )
   current_subsequence.pop()


if __name__ == "__main__":
     SCREAMING_SNAKE_CASE_     :			list[Any]	  =			[3, 1, 2, 4]
     generate_all_subsequences(seq)

     seq.clear()
     seq.extend(['''A''', '''B''', '''C'''])
     generate_all_subsequences(seq)




