





"""simple docstring"""




class 			__UpperCamelCase							:  # Public class to implement a graph






							def __init__(  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ )      ->					None:
								a :						int      =							row
								a :						Tuple      =							col
								a :						Optional[int]      =							graph






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ )      ->					bool:
								return (
								    0 <= i < self.ROW
								    and 0 <= j < self.COL
								    and not visited[i][j]
								    and self.graph[i][j]
								)






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ )      ->					None:
								# Checking all 8 elements surrounding nth element
								a :						Optional[Any]      =							[-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
								a :						str      =							[-1, 0, 1, -1, 1, -1, 0, 1]
								a :						str      =							True  # Make those cells visited
								for k in range(8 ):
									if self.is_safe(i + row_nbr[k] ,   j + col_nbr[k] ,   lowerCAmelCase__ ):
										self.diffs(i + row_nbr[k] ,   j + col_nbr[k] ,   lowerCAmelCase__ )






							def        __a  (  self )      ->					int:  # And finally, count all islands.
								a :						Union[str, Any]      =							[[False for j in range(self.COL )] for i in range(self.ROW )]
								a :						Dict      =							0
								for i in range(self.ROW ):
									for j in range(self.COL ):
										if visited[i][j] is False and self.graph[i][j] == 1:
											self.diffs(lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ )
											count += 1
								return count









"""simple docstring"""




import unittest

from transformers import DonutProcessor


a		:					Optional[int]	      =     '''naver-clova-ix/donut-base'''


class 			__UpperCamelCase							(		unittest.TestCase		):






							def        __a  (  self )      ->					Dict:
								a :						Optional[Any]      =							DonutProcessor.from_pretrained(lowerCAmelCase__ )






							def        __a  (  self )      ->					List[Any]:
								a :						Optional[Any]      =							{
								    "name": "John Doe",
								    "age": "99",
								    "city": "Atlanta",
								    "state": "GA",
								    "zip": "30301",
								    "phone": "123-4567",
								    "nicknames": [{"nickname": "Johnny"}, {"nickname": "JD"}],
								}

								a :						Tuple      =							(
								    "<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>"
								)
								a :						List[Any]      =							self.processor.tokenajson(lowerCAmelCase__ )

								self.assertDictEqual(lowerCAmelCase__ ,   lowerCAmelCase__ )


