




"""simple docstring"""


import unittest

from transformers import is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device


if is_torch_available():
     import torch

     from transformers import AutoModelForImageClassification

if is_vision_available():
     from transformers import AutoImageProcessor






@require_torch
@require_vision
class 					lowercase(     unittest.TestCase ):







 '''simple docstring'''





 @slow
 def  UpperCamelCase_   (				self:		str		):




   '''simple docstring'''



   _snake_case							:		Optional[Any]								=  AutoImageProcessor.from_pretrained("""microsoft/dit-base-finetuned-rvlcdip"""		)
   _snake_case							:		int								=  AutoModelForImageClassification.from_pretrained("""microsoft/dit-base-finetuned-rvlcdip"""		)
   model.to(__a		)

   from datasets import load_dataset

   _snake_case							:		Any								=  load_dataset("""nielsr/rvlcdip-demo"""		)

   _snake_case							:		List[str]								=  dataset["""train"""][0]["""image"""].convert("""RGB"""		)

   _snake_case							:		Any								=  image_processor(__a,      return_tensors="""pt"""		).to(__a		)

   # forward pass
   with torch.no_grad():
     _snake_case							:		List[Any]								=  model(**__a		)
     _snake_case							:		List[str]								=  outputs.logits

   _snake_case							:		Union[str, Any]								=  torch.Size((1, 16)		)
   self.assertEqual(logits.shape,      __a		)

   _snake_case							:		Tuple								=  torch.tensor(
       [-0.4_158, -0.4_092, -0.4_347],      device=__a,      dtype=torch.float,      )
   self.assertTrue(torch.allclose(logits[0, :3],      __a,      atol=1E-4		)		)










from itertools import permutations
def 					snake_case_						(   lowerCAmelCase_				:  tuple					):
							if num[3] % 2 != 0:
														return False

							if (num[2] + num[3] + num[4]) % 3 != 0:
														return False

							if num[5] % 5 != 0:
														return False

							__lowercase					:							Dict			=   [7, 11, 13, 17]
							for i, test in enumerate(lowerCAmelCase_					):
														if (num[i + 4] * 100 + num[i + 5] * 10 + num[i + 6]) % test != 0:
																					return False
							return True
def 					snake_case_						(   lowerCAmelCase_				:  int = 10					):
							return sum(
							    int("""""".join(map(lowerCAmelCase_				,				lowerCAmelCase_					)					)					)
							    for num in permutations(range(lowerCAmelCase_					)					)
							    if is_substring_divisible(lowerCAmelCase_					)					)


if __name__ == "__main__":
	print(f'''{solution() = }''')