





import unittest

from transformers import DonutProcessor


snake_case_           =      '''naver-clova-ix/donut-base'''

class 		SCREAMING_SNAKE_CASE__    (	unittest.TestCase  ):


						def        a			(self	:				Any				):





									"""simple docstring"""



									__snake_case								=       DonutProcessor.from_pretrained(a__				)


						def        a			(self	:				str				):





									"""simple docstring"""



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

									__snake_case								=       (
									    "<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>"
									)
									__snake_case								=       self.processor.tokenajson(a__				)

									self.assertDictEqual(a__    ,      a__				)








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


snake_case_           =      {
    'configuration_git': ['GIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'GitConfig', 'GitVisionConfig'],
    'processing_git': ['GitProcessor'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      [
        'GIT_PRETRAINED_MODEL_ARCHIVE_LIST',
        'GitForCausalLM',
        'GitModel',
        'GitPreTrainedModel',
        'GitVisionModel',
    ]

if TYPE_CHECKING:
    from .configuration_git import GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitVisionConfig
    from .processing_git import GitProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_git import (
            GIT_PRETRAINED_MODEL_ARCHIVE_LIST,
            GitForCausalLM,
            GitModel,
            GitPreTrainedModel,
            GitVisionModel,
        )

else:
    import sys

    snake_case_           =      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

