



UpperCAmelCase   :							Any							 =0  # The first color of the flag.
UpperCAmelCase   :							Optional[int]							 =1  # The second color of the flag.
UpperCAmelCase   :							Optional[Any]							 =2  # The third color of the flag.
UpperCAmelCase   :							Union[str, Any]							 =(red, white, blue)



def    _lowerCAmelCase    (_lowerCAmelCase):
					if not sequence:
										return []
					if len(_lowerCAmelCase) == 1:
										return list(_lowerCAmelCase)
					UpperCamelCase_		  =   0
					UpperCamelCase_		  =   len(_lowerCAmelCase) - 1
					UpperCamelCase_		  =   0
					while mid <= high:
										if sequence[mid] == colors[0]:
															UpperCamelCase_  ,    UpperCamelCase_		  =   sequence[mid], sequence[low]
															low += 1
															mid += 1
										elif sequence[mid] == colors[1]:
															mid += 1
										elif sequence[mid] == colors[2]:
															UpperCamelCase_  ,    UpperCamelCase_		  =   sequence[high], sequence[mid]
															high -= 1
										else:
															UpperCamelCase_		  =   f"""The elements inside the sequence must contains only {colors} values"""
															raise ValueError(_lowerCAmelCase)
					return sequence


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	UpperCAmelCase   :							Tuple							 =input("""Enter numbers separated by commas:\n""").strip()
	UpperCAmelCase   :							Any							 =[int(item.strip()) for item in user_input.split(""",""")]
	print(F"{dutch_national_flag_sort(unsorted)}")





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


UpperCAmelCase   :							int							 =threading.Lock()
UpperCAmelCase   :							Optional[logging.Handler]							 =None

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

UpperCAmelCase   :							Any							 =logging.WARNING

UpperCAmelCase   :							List[Any]							 =True



def    _lowerCAmelCase    ():
					UpperCamelCase_		  =   os.getenv("TRANSFORMERS_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 TRANSFORMERS_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_		  =   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    _lowerCAmelCase    ():
					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    _lowerCAmelCase    ():
					return log_levels



def    _lowerCAmelCase    (_lowerCAmelCase = None):

					if name is None:
										UpperCamelCase_		  =   _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):
					_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):
					_configure_library_root_logger()

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



def    _lowerCAmelCase    (_lowerCAmelCase):
					_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_		  =   False



def    _lowerCAmelCase    ():
					_configure_library_root_logger()
					UpperCamelCase_		  =   True



def    _lowerCAmelCase    ():
					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(_lowerCAmelCase)



def    _lowerCAmelCase    ():
					UpperCamelCase_		  =   _get_library_root_logger().handlers

					for handler in handlers:
										handler.setFormatter(_lowerCAmelCase)



def    _lowerCAmelCase    (self   ,	*_lowerCAmelCase   ,	**_lowerCAmelCase):
					UpperCamelCase_		  =   os.getenv("TRANSFORMERS_NO_ADVISORY_WARNINGS"   ,	_lowerCAmelCase)
					if no_advisory_warnings:
										return
					self.warning(*_lowerCAmelCase   ,	**_lowerCAmelCase)


UpperCAmelCase   :							Dict							 =warning_advice



@functools.lru_cache(_lowerCAmelCase)
def    _lowerCAmelCase    (self   ,	*_lowerCAmelCase   ,	**_lowerCAmelCase):
					self.warning(*_lowerCAmelCase   ,	**_lowerCAmelCase)


UpperCAmelCase   :							Optional[Any]							 =warning_once


class       _lowercase   :
				'''simple docstring'''







				def __init__( self     , *snake_case__     , **snake_case__    ):  # pylint: disable=unused-argument

									'''simple docstring'''


									UpperCamelCase_		  =   args[0] if args else None

				def __iter__( self    ):

									'''simple docstring'''


									return iter(self._iterator    )

				def __getattr__( self     , snake_case__    ):

									'''simple docstring'''


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

									return empty_fn

				def __enter__( self    ):

									'''simple docstring'''


									return self

				def __exit__( self     , snake_case__     , snake_case__     , snake_case__    ):

									'''simple docstring'''


									return




class       _lowercase   :
				'''simple docstring'''







				def __call__( self     , *snake_case__     , **snake_case__    ):

									'''simple docstring'''


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

				def       _lowerCamelCase					( self     , *snake_case__     , **snake_case__    ):

									'''simple docstring'''


									UpperCamelCase_		  =   None
									if _tqdm_active:
														return tqdm_lib.tqdm.set_lock(*snake_case__     , **snake_case__    )

				def       _lowerCamelCase					( self    ):

									'''simple docstring'''


									if _tqdm_active:
														return tqdm_lib.tqdm.get_lock()




UpperCAmelCase   :							Tuple							 =_tqdm_cls()



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



def    _lowerCAmelCase    ():
					global _tqdm_active
					UpperCamelCase_		  =   True
					hf_hub_utils.enable_progress_bars()






def    _lowerCAmelCase    ():
					global _tqdm_active
					UpperCamelCase_		  =   False
					hf_hub_utils.disable_progress_bars()
