



'''simple docstring'''


import unittest

import numpy as np

from transformers.file_utils import is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
      import torch

if is_vision_available():
      from PIL import Image

      from transformers import DPTImageProcessor




class      __UpperCamelCase       (unittest.TestCase			):







 def __init__(    self ,				_lowerCAmelCase ,				_lowerCAmelCase=7 ,				_lowerCAmelCase=3 ,				_lowerCAmelCase=18 ,				_lowerCAmelCase=30 ,				_lowerCAmelCase=400 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=None ,				_lowerCAmelCase=True ,				_lowerCAmelCase=[0.5, 0.5, 0.5] ,				_lowerCAmelCase=[0.5, 0.5, 0.5] ,				)    ->    Optional[int]:
       '''simple docstring'''






       lowercase        =							size if size is not None else {"""height""": 18, """width""": 18}
       lowercase        =							parent
       lowercase        =							batch_size
       lowercase        =							num_channels
       lowercase        =							image_size
       lowercase        =							min_resolution
       lowercase        =							max_resolution
       lowercase        =							do_resize
       lowercase        =							size
       lowercase        =							do_normalize
       lowercase        =							image_mean
       lowercase        =							image_std







 def   _a   (    self						)    ->    Optional[Any]:
       '''simple docstring'''






       return {
           "image_mean": self.image_mean,
           "image_std": self.image_std,
           "do_normalize": self.do_normalize,
           "do_resize": self.do_resize,
           "size": self.size,
       }




@require_torch
@require_vision
class      __UpperCamelCase       (_a			,   unittest.TestCase			):
 __A			  =					DPTImageProcessor if is_vision_available() else None







 def   _a   (    self						)    ->    Tuple:
       '''simple docstring'''






       lowercase        =							DPTImageProcessingTester(self						)







 @property
 def   _a   (    self						)    ->    str:
       '''simple docstring'''






       return self.image_processor_tester.prepare_image_processor_dict()







 def   _a   (    self						)    ->    Any:
       '''simple docstring'''






       lowercase        =							self.image_processing_class(**self.image_processor_dict						)
       self.assertTrue(hasattr(snake_case_ ,				"""image_mean"""						)						)
       self.assertTrue(hasattr(snake_case_ ,				"""image_std"""						)						)
       self.assertTrue(hasattr(snake_case_ ,				"""do_normalize"""						)						)
       self.assertTrue(hasattr(snake_case_ ,				"""do_resize"""						)						)
       self.assertTrue(hasattr(snake_case_ ,				"""size"""						)						)







 def   _a   (    self						)    ->    List[Any]:
       '''simple docstring'''






       lowercase        =							self.image_processing_class.from_dict(self.image_processor_dict						)
       self.assertEqual(image_processor.size ,				{"""height""": 18, """width""": 18}						)

       lowercase        =							self.image_processing_class.from_dict(self.image_processor_dict ,				size=42						)
       self.assertEqual(image_processor.size ,				{"""height""": 42, """width""": 42}						)







 def   _a   (    self						)    ->    int:
       '''simple docstring'''






       lowercase        =							self.image_processing_class(**self.image_processor_dict						)
       # create random PIL images
       lowercase        =							prepare_image_inputs(self.image_processor_tester ,				equal_resolution=snake_case_						)
       for image in image_inputs:
             self.assertIsInstance(snake_case_ ,				Image.Image						)

       # Test not batched input
       lowercase        =							image_processing(image_inputs[0] ,				return_tensors="""pt"""						).pixel_values
       self.assertEqual(
           encoded_images.shape ,				(
               1,
               self.image_processor_tester.num_channels,
               self.image_processor_tester.size["""height"""],
               self.image_processor_tester.size["""width"""],
           ) ,				)

       # Test batched
       lowercase        =							image_processing(snake_case_ ,				return_tensors="""pt"""						).pixel_values
       self.assertEqual(
           encoded_images.shape ,				(
               self.image_processor_tester.batch_size,
               self.image_processor_tester.num_channels,
               self.image_processor_tester.size["""height"""],
               self.image_processor_tester.size["""width"""],
           ) ,				)







 def   _a   (    self						)    ->    str:
       '''simple docstring'''






       lowercase        =							self.image_processing_class(**self.image_processor_dict						)
       # create random numpy tensors
       lowercase        =							prepare_image_inputs(self.image_processor_tester ,				equal_resolution=snake_case_ ,				numpify=snake_case_						)
       for image in image_inputs:
             self.assertIsInstance(snake_case_ ,				np.ndarray						)

       # Test not batched input
       lowercase        =							image_processing(image_inputs[0] ,				return_tensors="""pt"""						).pixel_values
       self.assertEqual(
           encoded_images.shape ,				(
               1,
               self.image_processor_tester.num_channels,
               self.image_processor_tester.size["""height"""],
               self.image_processor_tester.size["""width"""],
           ) ,				)

       # Test batched
       lowercase        =							image_processing(snake_case_ ,				return_tensors="""pt"""						).pixel_values
       self.assertEqual(
           encoded_images.shape ,				(
               self.image_processor_tester.batch_size,
               self.image_processor_tester.num_channels,
               self.image_processor_tester.size["""height"""],
               self.image_processor_tester.size["""width"""],
           ) ,				)







 def   _a   (    self						)    ->    Optional[Any]:
       '''simple docstring'''






       lowercase        =							self.image_processing_class(**self.image_processor_dict						)
       # create random PyTorch tensors
       lowercase        =							prepare_image_inputs(self.image_processor_tester ,				equal_resolution=snake_case_ ,				torchify=snake_case_						)
       for image in image_inputs:
             self.assertIsInstance(snake_case_ ,				torch.Tensor						)

       # Test not batched input
       lowercase        =							image_processing(image_inputs[0] ,				return_tensors="""pt"""						).pixel_values
       self.assertEqual(
           encoded_images.shape ,				(
               1,
               self.image_processor_tester.num_channels,
               self.image_processor_tester.size["""height"""],
               self.image_processor_tester.size["""width"""],
           ) ,				)

       # Test batched
       lowercase        =							image_processing(snake_case_ ,				return_tensors="""pt"""						).pixel_values
       self.assertEqual(
           encoded_images.shape ,				(
               self.image_processor_tester.batch_size,
               self.image_processor_tester.num_channels,
               self.image_processor_tester.size["""height"""],
               self.image_processor_tester.size["""width"""],
           ) ,				)







'''simple docstring'''


import os







def      SCREAMING_SNAKE_CASE				(				):
						lowercase        =							os.path.join(os.path.dirname(lowercase_						) ,  """num.txt"""						)
						with open(lowercase_						) as file_hand:
												return str(sum(int(lowercase_						) for line in file_hand						)						)[:10]


if __name__ == "__main__":
						print(solution())


