





from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import (
    center_crop,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    IMAGENET_STANDARD_MEAN,
    IMAGENET_STANDARD_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, logging


__lowercase	: Optional[Any]       =logging.get_logger(__name__)

class   A							(						__lowercase    ):
      _snake_case				  =['''pixel_values''']



      def __init__(						self:    List[str]		,	_lowerCAmelCase:    bool = True		,	_lowerCAmelCase:    Optional[Dict[str, int]] = None		,	_lowerCAmelCase:    PILImageResampling = PILImageResampling.BILINEAR		,	_lowerCAmelCase:    bool = True		,	_lowerCAmelCase:    Dict[str, int] = None		,	_lowerCAmelCase:    bool = True		,	_lowerCAmelCase:    Union[int, float] = 1 / 255		,	_lowerCAmelCase:    bool = True		,	_lowerCAmelCase:    Optional[Union[float, List[float]]] = None		,	_lowerCAmelCase:    Optional[Union[float, List[float]]] = None		,	**_lowerCAmelCase:    Optional[Any]		,	)    ->     None:
         '''simple docstring'''

         super().__init__(**_lowerCAmelCase							)
         UpperCAmelCase_           =size if size is not None else {"shortest_edge": 256}
         UpperCAmelCase_           =get_size_dict(_lowerCAmelCase		,	default_to_square=_lowerCAmelCase							)
         UpperCAmelCase_           =crop_size if crop_size is not None else {"height": 224, "width": 224}
         UpperCAmelCase_           =get_size_dict(_lowerCAmelCase							)
         UpperCAmelCase_           =do_resize
         UpperCAmelCase_           =size
         UpperCAmelCase_           =resample
         UpperCAmelCase_           =do_center_crop
         UpperCAmelCase_           =crop_size
         UpperCAmelCase_           =do_rescale
         UpperCAmelCase_           =rescale_factor
         UpperCAmelCase_           =do_normalize
         UpperCAmelCase_           =image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
         UpperCAmelCase_           =image_std if image_std is not None else IMAGENET_STANDARD_STD



      def 						lowerCAmelCase__     (						self:    Union[str, Any]		,	_lowerCAmelCase:    np.ndarray		,	_lowerCAmelCase:    Dict[str, int]		,	_lowerCAmelCase:    PILImageResampling = PILImageResampling.BICUBIC		,	_lowerCAmelCase:    Optional[Union[str, ChannelDimension]] = None		,	**_lowerCAmelCase:    Optional[int]		,	)    ->     np.ndarray:
         '''simple docstring'''

         UpperCAmelCase_           =get_size_dict(_lowerCAmelCase		,	default_to_square=_lowerCAmelCase							)
         if "shortest_edge" not in size:
            raise ValueError(F'The `size` parameter must contain the key `shortest_edge`. Got {size.keys()}'							)
         UpperCAmelCase_           =get_resize_output_image_size(_lowerCAmelCase		,	size=size["shortest_edge"]		,	default_to_square=_lowerCAmelCase							)
         return resize(_lowerCAmelCase		,	size=_lowerCAmelCase		,	resample=_lowerCAmelCase		,	data_format=_lowerCAmelCase		,	**_lowerCAmelCase							)



      def 						lowerCAmelCase__     (						self:    int		,	_lowerCAmelCase:    np.ndarray		,	_lowerCAmelCase:    Dict[str, int]		,	_lowerCAmelCase:    Optional[Union[str, ChannelDimension]] = None		,	**_lowerCAmelCase:    Dict		,	)    ->     np.ndarray:
         '''simple docstring'''

         UpperCAmelCase_           =get_size_dict(_lowerCAmelCase							)
         return center_crop(_lowerCAmelCase		,	size=(size["height"], size["width"])		,	data_format=_lowerCAmelCase		,	**_lowerCAmelCase							)



      def 						lowerCAmelCase__     (						self:    Dict		,	_lowerCAmelCase:    np.ndarray		,	_lowerCAmelCase:    float		,	_lowerCAmelCase:    Optional[Union[str, ChannelDimension]] = None		,	**_lowerCAmelCase:    Optional[Any]							)    ->     np.ndarray:
         '''simple docstring'''

         return rescale(_lowerCAmelCase		,	scale=_lowerCAmelCase		,	data_format=_lowerCAmelCase		,	**_lowerCAmelCase							)



      def 						lowerCAmelCase__     (						self:    List[str]		,	_lowerCAmelCase:    np.ndarray		,	_lowerCAmelCase:    Union[float, List[float]]		,	_lowerCAmelCase:    Union[float, List[float]]		,	_lowerCAmelCase:    Optional[Union[str, ChannelDimension]] = None		,	**_lowerCAmelCase:    List[str]		,	)    ->     np.ndarray:
         '''simple docstring'''

         return normalize(_lowerCAmelCase		,	mean=_lowerCAmelCase		,	std=_lowerCAmelCase		,	data_format=_lowerCAmelCase		,	**_lowerCAmelCase							)






      def 						lowerCAmelCase__     (						self:    Union[str, Any]		,	_lowerCAmelCase:    ImageInput		,	_lowerCAmelCase:    Optional[bool] = None		,	_lowerCAmelCase:    Dict[str, int] = None		,	_lowerCAmelCase:    PILImageResampling = None		,	_lowerCAmelCase:    bool = None		,	_lowerCAmelCase:    Dict[str, int] = None		,	_lowerCAmelCase:    Optional[bool] = None		,	_lowerCAmelCase:    Optional[float] = None		,	_lowerCAmelCase:    Optional[bool] = None		,	_lowerCAmelCase:    Optional[Union[float, List[float]]] = None		,	_lowerCAmelCase:    Optional[Union[float, List[float]]] = None		,	_lowerCAmelCase:    Optional[Union[str, TensorType]] = None		,	_lowerCAmelCase:    Union[str, ChannelDimension] = ChannelDimension.FIRST		,	**_lowerCAmelCase:    int		,	)    ->     Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_           =do_resize if do_resize is not None else self.do_resize
         UpperCAmelCase_           =size if size is not None else self.size
         UpperCAmelCase_           =get_size_dict(_lowerCAmelCase		,	default_to_square=_lowerCAmelCase							)
         UpperCAmelCase_           =resample if resample is not None else self.resample
         UpperCAmelCase_           =do_center_crop if do_center_crop is not None else self.do_center_crop
         UpperCAmelCase_           =crop_size if crop_size is not None else self.crop_size
         UpperCAmelCase_           =get_size_dict(_lowerCAmelCase							)
         UpperCAmelCase_           =do_rescale if do_rescale is not None else self.do_rescale
         UpperCAmelCase_           =rescale_factor if rescale_factor is not None else self.rescale_factor
         UpperCAmelCase_           =do_normalize if do_normalize is not None else self.do_normalize
         UpperCAmelCase_           =image_mean if image_mean is not None else self.image_mean
         UpperCAmelCase_           =image_std if image_std is not None else self.image_std

         UpperCAmelCase_           =make_list_of_images(_lowerCAmelCase							)

         if not valid_images(_lowerCAmelCase							):
            raise ValueError(
                "Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, "
                "torch.Tensor, tf.Tensor or jax.ndarray."							)

         if do_resize and size is None:
            raise ValueError("Size must be specified if do_resize is True."							)

         if do_center_crop and crop_size is None:
            raise ValueError("Crop size must be specified if do_center_crop is True."							)

         if do_rescale and rescale_factor is None:
            raise ValueError("Rescale factor must be specified if do_rescale is True."							)

         if do_normalize and (image_mean is None or image_std is None):
            raise ValueError("Image mean and std must be specified if do_normalize is True."							)

         # All transformations expect numpy arrays.
         UpperCAmelCase_           =[to_numpy_array(_lowerCAmelCase							) for image in images]

         if do_resize:
            UpperCAmelCase_           =[self.resize(image=_lowerCAmelCase		,	size=_lowerCAmelCase		,	resample=_lowerCAmelCase							) for image in images]

         if do_center_crop:
            UpperCAmelCase_           =[self.center_crop(image=_lowerCAmelCase		,	size=_lowerCAmelCase							) for image in images]

         if do_rescale:
            UpperCAmelCase_           =[self.rescale(image=_lowerCAmelCase		,	scale=_lowerCAmelCase							) for image in images]

         if do_normalize:
            UpperCAmelCase_           =[self.normalize(image=_lowerCAmelCase		,	mean=_lowerCAmelCase		,	std=_lowerCAmelCase							) for image in images]

         UpperCAmelCase_           =[to_channel_dimension_format(_lowerCAmelCase		,	_lowerCAmelCase							) for image in images]

         UpperCAmelCase_           ={"pixel_values": images}
         return BatchFeature(data=_lowerCAmelCase		,	tensor_type=_lowerCAmelCase							)







from __future__ import annotations


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			a_						:						List[str] 							= 0
			a_						:						str 							= len(a__) - 1

			while i < j:
						if nums[i] + nums[j] == target:
									return [i, j]
						elif nums[i] + nums[j] < target:
									a_						:						List[Any] 							= i + 1
						else:
									a_						:						Optional[Any] 							= j - 1

			return []


if __name__ == "__main__":
	import doctest

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


