


import unittest

from transformers import DonutProcessor


_SCREAMING_SNAKE_CASE      :			Tuple      				=   "naver-clova-ix/donut-base"

class   A__ (   unittest.TestCase     ):







    """simple docstring"""

    def 		a_      (	self   ):
         snake_case					=    DonutProcessor.from_pretrained(_UpperCAmelCase   )




    def 		a_      (	self   ):
         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(_UpperCAmelCase   )

         self.assertDictEqual(_UpperCAmelCase      , _UpperCAmelCase   )








def       UpperCAmelCase__						(UpperCamelCase_							,UpperCamelCase_							,UpperCamelCase_    ):



     """simple docstring"""






     snake_case					=    len(UpperCamelCase_    )
     snake_case					=    [[0] * n for i in range(UpperCamelCase_    )]
     for i in range(UpperCamelCase_    ):
          snake_case					=    y_points[i]

     for i in range(2							,UpperCamelCase_    ):
          for j in range(UpperCamelCase_							,UpperCamelCase_    ):
               snake_case					=    (
                   (xa - x_points[j - i + 1]) * q[j][i - 1]
                   - (xa - x_points[j]) * q[j - 1][i - 1]
               ) / (x_points[j] - x_points[j - i + 1])

     return [q[n - 1][n - 1], q]


if __name__ == "__main__":
 import doctest

 doctest.testmod()




