






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

from tqdm import auto as tqdm_lib


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

a		:	List[Any]      					=			{
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

a		:	Union[str, Any]      					=			logging.WARNING

a		:	int      					=			True






def     lowerCamelCase__				(   ):
  __UpperCAmelCase							:     Optional[Any]									=  os.getenv("""DIFFUSERS_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 DIFFUSERS_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__				(   ):
  global _default_handler

  with _lock:
    if _default_handler:
      # This library has already configured the library root logger.
      return
    __UpperCAmelCase							:     Optional[Any]									=  logging.StreamHandler()  # Set sys.stderr as stream.
    __UpperCAmelCase							:     Optional[int]									=  sys.stderr.flush

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






def     lowerCamelCase__				(   ):
  global _default_handler

  with _lock:
    if not _default_handler:
      return

    __UpperCAmelCase							:     int									=  _get_library_root_logger()
    library_root_logger.removeHandler(_default_handler		)
    library_root_logger.setLevel(logging.NOTSET		)
    __UpperCAmelCase							:     Optional[int]									=  None






def     lowerCamelCase__				(   ):
  return log_levels






def     lowerCamelCase__				(   __lowerCamelCase      :					Optional[str] = None		):

  if name is None:
    __UpperCAmelCase							:     Optional[int]									=  _get_library_name()

  _configure_library_root_logger()
  return logging.getLogger(__lowerCamelCase		)






def     lowerCamelCase__				(   ):
  _configure_library_root_logger()
  return _get_library_root_logger().getEffectiveLevel()






def     lowerCamelCase__				(   __lowerCamelCase      :					int		):
  _configure_library_root_logger()
  _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__				(   ):
  _configure_library_root_logger()

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






def     lowerCamelCase__				(   ):
  _configure_library_root_logger()

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






def     lowerCamelCase__				(   __lowerCamelCase      :					logging.Handler		):
  _configure_library_root_logger()

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






def     lowerCamelCase__				(   __lowerCamelCase      :					logging.Handler		):
  _configure_library_root_logger()

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






def     lowerCamelCase__				(   ):
  _configure_library_root_logger()
  __UpperCAmelCase							:     Optional[Any]									=  False






def     lowerCamelCase__				(   ):
  _configure_library_root_logger()
  __UpperCAmelCase							:     int									=  True






def     lowerCamelCase__				(   ):
  __UpperCAmelCase							:     Optional[Any]									=  _get_library_root_logger().handlers

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






def     lowerCamelCase__				(   ):
  __UpperCAmelCase							:     Any									=  _get_library_root_logger().handlers

  for handler in handlers:
    handler.setFormatter(__lowerCamelCase		)






def     lowerCamelCase__				(   self      :					Dict  ,		*__lowerCamelCase      :					int  ,		**__lowerCamelCase      :					List[Any]		):
  __UpperCAmelCase							:     int									=  os.getenv("""DIFFUSERS_NO_ADVISORY_WARNINGS"""  ,		__lowerCamelCase		)
  if no_advisory_warnings:
    return
  self.warning(*__lowerCamelCase  ,		**__lowerCamelCase		)


a		:	int      					=			warning_advice
class    a   :



      """simple docstring"""


      def __init__(				self :      Dict		,				*__lowercase :      List[str]		,				**__lowercase :      Dict )							->				int:  # pylint: disable=unused-argument
        __UpperCAmelCase							:     List[str]									=  args[0] if args else None
      def __iter__(				self :      Optional[int] )							->				Optional[Any]:
        return iter(self._iterator )
      def __getattr__(				self :      int		,				__lowercase :      Optional[int] )							->				List[Any]:

        def empty_fn(*__lowercase :      Any		,				**__lowercase :      Dict ):  # pylint: disable=unused-argument
          return

        return empty_fn
      def __enter__(				self :      Optional[int] )							->				Tuple:
        return self




      def __exit__(				self :      Tuple		,				__lowercase :      Any		,				__lowercase :      Dict		,				__lowercase :      Union[str, Any] )							->				Optional[int]:
        return


class    a   :



      """simple docstring"""


      def __call__(				self :      Any		,				*__lowercase :      Dict		,				**__lowercase :      List[Any] )							->				List[str]:
        if _tqdm_active:
          return tqdm_lib.tqdm(*__lowercase		,				**__lowercase )
        else:
          return EmptyTqdm(*__lowercase		,				**__lowercase )
      def      UpperCAmelCase				(				self :      str		,				*__lowercase :      str		,				**__lowercase :      List[Any] )							->				str:
        __UpperCAmelCase							:     str									=  None
        if _tqdm_active:
          return tqdm_lib.tqdm.set_lock(*__lowercase		,				**__lowercase )




      def      UpperCAmelCase				(				self :      Optional[Any] )							->				Union[str, Any]:
        if _tqdm_active:
          return tqdm_lib.tqdm.get_lock()


a		:	Tuple      					=			_tqdm_cls()






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






def     lowerCamelCase__				(   ):
  global _tqdm_active
  __UpperCAmelCase							:     Optional[int]									=  True







def     lowerCamelCase__				(   ):
  global _tqdm_active
  __UpperCAmelCase							:     Union[str, Any]									=  False










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


a		:	Any      					=			{
    "configuration_deta": ["DETA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetaConfig"],
}

try:
       if not is_vision_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a		:	Optional[int]      					=			["DetaImageProcessor"]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a		:	Tuple      					=			[
           "DETA_PRETRAINED_MODEL_ARCHIVE_LIST",
           "DetaForObjectDetection",
           "DetaModel",
           "DetaPreTrainedModel",
       ]


if TYPE_CHECKING:
       from .configuration_deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .image_processing_deta import DetaImageProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_deta import (
                  DETA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  DetaForObjectDetection,
                  DetaModel,
                  DetaPreTrainedModel,
              )

else:
       import sys

       a		:	Any      					=			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


