
"""simple docstring"""




import unittest

import numpy as np

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

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 MobileViTImageProcessor





class  snake_case     (							unittest.TestCase   ):

							def __init__(self       ,       SCREAMING_SNAKE_CASE_       ,       SCREAMING_SNAKE_CASE_=7       ,       SCREAMING_SNAKE_CASE_=3       ,       SCREAMING_SNAKE_CASE_=18       ,       SCREAMING_SNAKE_CASE_=30       ,       SCREAMING_SNAKE_CASE_=4_00       ,       SCREAMING_SNAKE_CASE_=True       ,       SCREAMING_SNAKE_CASE_=None       ,       SCREAMING_SNAKE_CASE_=True       ,       SCREAMING_SNAKE_CASE_=None       ,       SCREAMING_SNAKE_CASE_=True       ,       ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_   = size if size is not None else {'''shortest_edge''': 20}
									SCREAMING_SNAKE_CASE_   = crop_size if crop_size is not None else {'''height''': 18, '''width''': 18}
									SCREAMING_SNAKE_CASE_   = parent
									SCREAMING_SNAKE_CASE_   = batch_size
									SCREAMING_SNAKE_CASE_   = num_channels
									SCREAMING_SNAKE_CASE_   = image_size
									SCREAMING_SNAKE_CASE_   = min_resolution
									SCREAMING_SNAKE_CASE_   = max_resolution
									SCREAMING_SNAKE_CASE_   = do_resize
									SCREAMING_SNAKE_CASE_   = size
									SCREAMING_SNAKE_CASE_   = do_center_crop
									SCREAMING_SNAKE_CASE_   = crop_size
									SCREAMING_SNAKE_CASE_   = do_flip_channel_order







							def _lowercase					(self    ):

									"""simple docstring"""







									return {
									    "do_resize": self.do_resize,
									    "size": self.size,
									    "do_center_crop": self.do_center_crop,
									    "crop_size": self.crop_size,
									    "do_flip_channel_order": self.do_flip_channel_order,
									}







@require_torch
@require_vision
class  snake_case     (							__lowercase       ,			unittest.TestCase   ):
							UpperCAmelCase__						     =      MobileViTImageProcessor if is_vision_available() else None

							def _lowercase					(self    ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_   = MobileViTImageProcessingTester(self    )

							@property
							def _lowercase					(self    ):

									"""simple docstring"""







									return self.image_processor_tester.prepare_image_processor_dict()

							def _lowercase					(self    ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_   = self.image_processing_class(**self.image_processor_dict    )
									self.assertTrue(hasattr(__a       ,       '''do_resize'''    )    )
									self.assertTrue(hasattr(__a       ,       '''size'''    )    )
									self.assertTrue(hasattr(__a       ,       '''do_center_crop'''    )    )
									self.assertTrue(hasattr(__a       ,       '''center_crop'''    )    )
									self.assertTrue(hasattr(__a       ,       '''do_flip_channel_order'''    )    )

							def _lowercase					(self    ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_   = self.image_processing_class.from_dict(self.image_processor_dict    )
									self.assertEqual(image_processor.size       ,       {'''shortest_edge''': 20}    )
									self.assertEqual(image_processor.crop_size       ,       {'''height''': 18, '''width''': 18}    )

									SCREAMING_SNAKE_CASE_   = self.image_processing_class.from_dict(self.image_processor_dict       ,       size=42       ,       crop_size=84    )
									self.assertEqual(image_processor.size       ,       {'''shortest_edge''': 42}    )
									self.assertEqual(image_processor.crop_size       ,       {'''height''': 84, '''width''': 84}    )

							def _lowercase					(self    ):

									"""simple docstring"""







									pass

							def _lowercase					(self    ):

									"""simple docstring"""







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

									# Test not batched input
									SCREAMING_SNAKE_CASE_   = 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.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )       ,       )

									# Test batched
									SCREAMING_SNAKE_CASE_   = image_processing(__a       ,       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.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )       ,       )

							def _lowercase					(self    ):

									"""simple docstring"""







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

									# Test not batched input
									SCREAMING_SNAKE_CASE_   = 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.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )       ,       )

									# Test batched
									SCREAMING_SNAKE_CASE_   = image_processing(__a       ,       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.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )       ,       )







							def _lowercase					(self    ):

									"""simple docstring"""







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

									# Test not batched input
									SCREAMING_SNAKE_CASE_   = 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.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )       ,       )

									# Test batched
									SCREAMING_SNAKE_CASE_   = image_processing(__a       ,       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.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )       ,       )

"""simple docstring"""




from __future__ import annotations



def        _lowerCamelCase ( __a,							__a    ):
		SCREAMING_SNAKE_CASE_						 = 0
		SCREAMING_SNAKE_CASE_						 = len(__a    ) - 1

		while i < j:
				if nums[i] + nums[j] == target:
						return [i, j]
				elif nums[i] + nums[j] < target:
						SCREAMING_SNAKE_CASE_						 = i + 1
				else:
						SCREAMING_SNAKE_CASE_						 = j - 1

		return []


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						print(f'''{two_pointer([2, 7, 11, 15], 9) = }''')