





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


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

__lowercase  :   Tuple						      ={
    """debug""": logging.DEBUG,
    """info""": logging.INFO,
    """warning""": logging.WARNING,
    """error""": logging.ERROR,
    """critical""": logging.CRITICAL,
}

__lowercase  :   List[Any]						      =logging.WARNING

__lowercase  :   Any						      =True




def     a__ (					):






   '''simple docstring'''






   UpperCAmelCase_											=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     a__ (					):






   '''simple docstring'''






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




def     a__ (					):






   '''simple docstring'''






   return logging.getLogger(_get_library_name()  )




def     a__ (					):






   '''simple docstring'''






   global _default_handler

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

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




def     a__ (					):






   '''simple docstring'''






   global _default_handler

   with _lock:
      if not _default_handler:
         return

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




def     a__ (					):






   '''simple docstring'''






   return log_levels




def     a__ (					lowercase__ = None  ):






   '''simple docstring'''






   if name is None:
      UpperCAmelCase_											=_get_library_name()

   _configure_library_root_logger()
   return logging.getLogger(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   _configure_library_root_logger()
   return _get_library_root_logger().getEffectiveLevel()




def     a__ (					lowercase__  ):






   '''simple docstring'''






   _configure_library_root_logger()
   _get_library_root_logger().setLevel(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   return set_verbosity(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   return set_verbosity(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   return set_verbosity(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   return set_verbosity(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   _configure_library_root_logger()

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




def     a__ (					):






   '''simple docstring'''






   _configure_library_root_logger()

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




def     a__ (					lowercase__  ):






   '''simple docstring'''






   _configure_library_root_logger()

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




def     a__ (					lowercase__  ):






   '''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(lowercase__  )




def     a__ (					):






   '''simple docstring'''






   _configure_library_root_logger()
   UpperCAmelCase_											=False




def     a__ (					):






   '''simple docstring'''






   _configure_library_root_logger()
   UpperCAmelCase_											=True




def     a__ (					):






   '''simple docstring'''






   UpperCAmelCase_											=_get_library_root_logger().handlers

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




def     a__ (					):






   '''simple docstring'''






   UpperCAmelCase_											=_get_library_root_logger().handlers

   for handler in handlers:
      handler.setFormatter(lowercase__  )




def     a__ (					self  ,    *lowercase__  ,    **lowercase__  ):






   '''simple docstring'''






   UpperCAmelCase_											=os.getenv("TRANSFORMERS_NO_ADVISORY_WARNINGS"  ,    lowercase__  )
   if no_advisory_warnings:
      return
   self.warning(*lowercase__  ,    **lowercase__  )


__lowercase  :   Union[str, Any]						      =warning_advice




@functools.lru_cache(lowercase__  )
def     a__ (					self  ,    *lowercase__  ,    **lowercase__  ):






   '''simple docstring'''






   self.warning(*lowercase__  ,    **lowercase__  )


__lowercase  :   Optional[Any]						      =warning_once

class      A       :



      def __init__(	self:						Optional[int]		,  *_lowerCAmelCase:						Optional[Any]		,  **_lowerCAmelCase:						List[str]       )						->    Dict:  # pylint: disable=unused-argument
         '''simple docstring'''

         UpperCAmelCase_											=args[0] if args else None



      def __iter__(	self:						int       )						->    List[Any]:
         '''simple docstring'''

         return iter(self._iterator       )



      def __getattr__(	self:						Dict		,  _lowerCAmelCase:						Optional[Any]       )						->    Union[str, Any]:
         '''simple docstring'''

         def empty_fn(*_lowerCAmelCase:						Optional[Any]		,  **_lowerCAmelCase:						Optional[Any]       ):  # pylint: disable=unused-argument
            return

         return empty_fn



      def __enter__(	self:						Optional[int]       )						->    Union[str, Any]:
         '''simple docstring'''

         return self






      def __exit__(	self:						int		,  _lowerCAmelCase:						int		,  _lowerCAmelCase:						Any		,  _lowerCAmelCase:						Dict       )						->    Dict:
         '''simple docstring'''

         return

class      A       :



      def __call__(	self:						List[Any]		,  *_lowerCAmelCase:						Optional[Any]		,  **_lowerCAmelCase:						Dict       )						->    Any:
         '''simple docstring'''

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



      def 	lowerCAmelCase__    (	self:						List[str]		,  *_lowerCAmelCase:						Optional[int]		,  **_lowerCAmelCase:						Optional[int]       )						->    List[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=None
         if _tqdm_active:
            return tqdm_lib.tqdm.set_lock(*_lowerCAmelCase		,  **_lowerCAmelCase       )






      def 	lowerCAmelCase__    (	self:						Tuple       )						->    Optional[Any]:
         '''simple docstring'''

         if _tqdm_active:
            return tqdm_lib.tqdm.get_lock()

__lowercase  :   int						      =_tqdm_cls()




def     a__ (					):






   '''simple docstring'''






   global _tqdm_active
   return bool(_tqdm_active  )




def     a__ (					):






   '''simple docstring'''






   global _tqdm_active
   UpperCAmelCase_											=True
   hf_hub_utils.enable_progress_bars()





def     a__ (					):






   '''simple docstring'''






   global _tqdm_active
   UpperCAmelCase_											=False
   hf_hub_utils.disable_progress_bars()











import sys
import turtle




def     a__ (					lowercase__  ,    lowercase__  ):






   '''simple docstring'''






   return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2




def     a__ (					lowercase__  ,    lowercase__  ,    lowercase__  ,    lowercase__  ,    ):






   '''simple docstring'''






   my_pen.up()
   my_pen.goto(vertexa[0]  ,    vertexa[1]  )
   my_pen.down()
   my_pen.goto(vertexa[0]  ,    vertexa[1]  )
   my_pen.goto(vertexa[0]  ,    vertexa[1]  )
   my_pen.goto(vertexa[0]  ,    vertexa[1]  )

   if depth == 0:
      return

   triangle(lowercase__  ,    get_mid(lowercase__  ,    lowercase__  )  ,    get_mid(lowercase__  ,    lowercase__  )  ,    depth - 1  )
   triangle(lowercase__  ,    get_mid(lowercase__  ,    lowercase__  )  ,    get_mid(lowercase__  ,    lowercase__  )  ,    depth - 1  )
   triangle(lowercase__  ,    get_mid(lowercase__  ,    lowercase__  )  ,    get_mid(lowercase__  ,    lowercase__  )  ,    depth - 1  )


if __name__ == "__main__":
     if len(sys.argv) != 2:
          raise ValueError(
              """Correct format for using this script: """
              """python fractals.py <int:depth_for_fractal>"""
          )
     __lowercase  :   Any						      =turtle.Turtle()
     my_pen.ht()
     my_pen.speed(5)
     my_pen.pencolor("""red""")

     __lowercase  :   str						      =[(-175, -125), (0, 175), (175, -125)]  # vertices of triangle
     triangle(vertices[0], vertices[1], vertices[2], int(sys.argv[1]))




