

'''simple docstring'''

import unittest

from transformers import DonutProcessor


a  :     List[str]    			=					"naver-clova-ix/donut-base"







class     UpperCamelCase__       (  unittest.TestCase  ):


		"""simple docstring"""

		def  A_			(					self     ):


							'''simple docstring'''

							UpperCAmelCase						:				Dict     =  DonutProcessor.from_pretrained(lowerCamelCase__     )







		def  A_			(					self     ):


							'''simple docstring'''

							UpperCAmelCase						:				str     =  {
							    "name": "John Doe",
							    "age": "99",
							    "city": "Atlanta",
							    "state": "GA",
							    "zip": "30301",
							    "phone": "123-4567",
							    "nicknames": [{"nickname": "Johnny"}, {"nickname": "JD"}],
							}

							UpperCAmelCase						:				List[Any]     =  (
							    "<s_name>John Doe</s_name><s_age>99</s_age><s_city>Atlanta</s_city>"
							    "<s_state>GA</s_state><s_zip>30301</s_zip><s_phone>123-4567</s_phone>"
							    "<s_nicknames><s_nickname>Johnny</s_nickname>"
							    "<sep/><s_nickname>JD</s_nickname></s_nicknames>"
							)
							UpperCAmelCase						:				Optional[Any]     =  self.processor.tokenajson(lowerCamelCase__     )

							self.assertDictEqual(lowerCamelCase__       ,     lowerCamelCase__     )



import logging
import os
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


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

__lowercase				      =						logging.WARNING







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      A_							       =		os.getenv('''DATASETS_VERBOSITY'''		,				SCREAMING_SNAKE_CASE   )
      if env_level_str:
            if env_level_str in log_levels:
                  return log_levels[env_level_str]
            else:
                  logging.getLogger().warning(
                      f"Unknown option DATASETS_VERBOSITY={env_level_str}, "
                      f"has to be one of: { ', '.join(log_levels.keys()   ) }"   )
      return _default_log_level







def 							_lowerCamelCase   (			):
      '''simple docstring'''







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







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      return logging.getLogger(_get_library_name()   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      A_							       =		_get_library_root_logger()
      library_root_logger.setLevel(_get_default_logging_level()   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      A_							       =		_get_library_root_logger()
      library_root_logger.setLevel(logging.NOTSET   )







def 							_lowerCamelCase   (			SCREAMING_SNAKE_CASE = None   ):
      '''simple docstring'''







      if name is None:
            A_							       =		_get_library_name()
      return logging.getLogger(SCREAMING_SNAKE_CASE   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      return _get_library_root_logger().getEffectiveLevel()







def 							_lowerCamelCase   (			SCREAMING_SNAKE_CASE   ):
      '''simple docstring'''







      _get_library_root_logger().setLevel(SCREAMING_SNAKE_CASE   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      return set_verbosity(SCREAMING_SNAKE_CASE   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      return set_verbosity(SCREAMING_SNAKE_CASE   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      return set_verbosity(SCREAMING_SNAKE_CASE   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      return set_verbosity(SCREAMING_SNAKE_CASE   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      A_							       =		False







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      A_							       =		True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()

class    _lowercase				:

   def __init__(				self	:    Optional[int]			,						*lowerCamelCase__	:    int			,						**lowerCamelCase__	:    Tuple       ) ->			Dict:  # pylint: disable=unused-argument
         """simple docstring"""





         A_							       =		args[0] if args else None

   def __iter__(				self	:    Optional[int]       ) ->			List[str]:
         """simple docstring"""





         return iter(self._iterator       )

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





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

         return empty_fn

   def __enter__(				self	:    Tuple       ) ->			Tuple:
         """simple docstring"""





         return self





   def __exit__(				self	:    Tuple			,						lowerCamelCase__	:    List[Any]			,						lowerCamelCase__	:    List[str]			,						lowerCamelCase__	:    Optional[Any]       ) ->			Optional[int]:
         """simple docstring"""





         return



__lowercase				      =						True

class    _lowercase				:

   def __call__(				self	:    Optional[int]			,						*lowerCamelCase__	:    Optional[int]			,						lowerCamelCase__	:    List[str]=False			,						**lowerCamelCase__	:    Optional[Any]       ) ->			Optional[Any]:
         """simple docstring"""





         if _tqdm_active and not disable:
               return tqdm_lib.tqdm(*lowerCamelCase__			,						**lowerCamelCase__       )
         else:
               return EmptyTqdm(*lowerCamelCase__			,						**lowerCamelCase__       )

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





         A_							       =		None
         if _tqdm_active:
               return tqdm_lib.tqdm.set_lock(*lowerCamelCase__			,						**lowerCamelCase__       )





   def     UpperCamelCase					(				self	:    Optional[Any]       ) ->			int:
         """simple docstring"""





         if _tqdm_active:
               return tqdm_lib.tqdm.get_lock()



__lowercase				      =						_tqdm_cls()







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      global _tqdm_active
      return bool(_tqdm_active   )







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      global _tqdm_active
      A_							       =		True







def 							_lowerCamelCase   (			):
      '''simple docstring'''







      global _tqdm_active
      A_							       =		False





