code: 
  
  
  
  """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 ConvNextImageProcessor
  
  
  
  
  
  
  class 			UpperCAmelCase_						(       unittest.TestCase		):
  
  
  
        def __init__(  self  :			str  ,			A  :			Any  ,			A  :			Dict=7  ,			A  :			Dict=3  ,			A  :			Tuple=1_8  ,			A  :			List[str]=3_0  ,			A  :			int=4_0_0  ,			A  :			List[str]=True  ,			A  :			str=None  ,			A  :			Optional[Any]=0.875  ,			A  :			Union[str, Any]=True  ,			A  :			str=[0.5, 0.5, 0.5]  ,			A  :			str=[0.5, 0.5, 0.5]  ,			):
             _UpperCAmelCase    :			Any              =					size if size is not None else {"shortest_edge": 2_0}
             _UpperCAmelCase    :			int              =					parent
             _UpperCAmelCase    :			int              =					batch_size
             _UpperCAmelCase    :			str              =					num_channels
             _UpperCAmelCase    :			Optional[int]              =					image_size
             _UpperCAmelCase    :			Optional[Any]              =					min_resolution
             _UpperCAmelCase    :			List[Any]              =					max_resolution
             _UpperCAmelCase    :			Dict              =					do_resize
             _UpperCAmelCase    :			List[Any]              =					size
             _UpperCAmelCase    :			Union[str, Any]              =					crop_pct
             _UpperCAmelCase    :			Any              =					do_normalize
             _UpperCAmelCase    :			Optional[int]              =					image_mean
             _UpperCAmelCase    :			Tuple              =					image_std
  
  
  
        def 		snake_case_      (  self  :			Dict		):
             return {
                 "image_mean": self.image_mean,
                 "image_std": self.image_std,
                 "do_normalize": self.do_normalize,
                 "do_resize": self.do_resize,
                 "size": self.size,
                 "crop_pct": self.crop_pct,
             }
  
  
  
  
  
  
  
  @require_torch
  @require_vision
  class 			UpperCAmelCase_						(       UpperCAmelCase__ ,    unittest.TestCase		):
        __SCREAMING_SNAKE_CASE		:     List[str]				  =				ConvNextImageProcessor if is_vision_available() else None
  
  
  
        def 		snake_case_      (  self  :			int		):
             _UpperCAmelCase    :			List[Any]              =					ConvNextImageProcessingTester(self		)
  
  
  
        @property
        def 		snake_case_      (  self  :			int		):
             return self.image_processor_tester.prepare_image_processor_dict()
  
  
  
        def 		snake_case_      (  self  :			Union[str, Any]		):
             _UpperCAmelCase    :			Dict              =					self.image_processing_class(**self.image_processor_dict		)
             self.assertTrue(hasattr(lowerCamelCase__  ,			"do_resize"		)		)
             self.assertTrue(hasattr(lowerCamelCase__  ,			"size"		)		)
             self.assertTrue(hasattr(lowerCamelCase__  ,			"crop_pct"		)		)
             self.assertTrue(hasattr(lowerCamelCase__  ,			"do_normalize"		)		)
             self.assertTrue(hasattr(lowerCamelCase__  ,			"image_mean"		)		)
             self.assertTrue(hasattr(lowerCamelCase__  ,			"image_std"		)		)
  
  
  
        def 		snake_case_      (  self  :			Dict		):
             _UpperCAmelCase    :			Dict              =					self.image_processing_class.from_dict(self.image_processor_dict		)
             self.assertEqual(image_processor.size  ,			{"shortest_edge": 2_0}		)
  
             _UpperCAmelCase    :			List[Any]              =					self.image_processing_class.from_dict(self.image_processor_dict  ,			size=4_2		)
             self.assertEqual(image_processor.size  ,			{"shortest_edge": 4_2}		)
  
  
  
        def 		snake_case_      (  self  :			Optional[Any]		):
             pass
  
  
  
        def 		snake_case_      (  self  :			List[str]		):
             # Initialize image_processing
             _UpperCAmelCase    :			Tuple              =					self.image_processing_class(**self.image_processor_dict		)
             # create random PIL images
             _UpperCAmelCase    :			Union[str, Any]              =					prepare_image_inputs(self.image_processor_tester  ,			equal_resolution=lowerCamelCase__		)
             for image in image_inputs:
                  self.assertIsInstance(lowerCamelCase__  ,			Image.Image		)
  
             # Test not batched input
             _UpperCAmelCase    :			List[str]              =					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["shortest_edge"],
                     self.image_processor_tester.size["shortest_edge"],
                 )  ,			)
  
             # Test batched
             _UpperCAmelCase    :			Optional[Any]              =					image_processing(lowerCamelCase__  ,			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["shortest_edge"],
                     self.image_processor_tester.size["shortest_edge"],
                 )  ,			)
  
  
  
        def 		snake_case_      (  self  :			List[str]		):
             # Initialize image_processing
             _UpperCAmelCase    :			int              =					self.image_processing_class(**self.image_processor_dict		)
             # create random numpy tensors
             _UpperCAmelCase    :			List[str]              =					prepare_image_inputs(self.image_processor_tester  ,			equal_resolution=lowerCamelCase__  ,			numpify=lowerCamelCase__		)
             for image in image_inputs:
                  self.assertIsInstance(lowerCamelCase__  ,			np.ndarray		)
  
             # Test not batched input
             _UpperCAmelCase    :			Optional[Any]              =					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["shortest_edge"],
                     self.image_processor_tester.size["shortest_edge"],
                 )  ,			)
  
             # Test batched
             _UpperCAmelCase    :			List[Any]              =					image_processing(lowerCamelCase__  ,			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["shortest_edge"],
                     self.image_processor_tester.size["shortest_edge"],
                 )  ,			)
  
  
  
        def 		snake_case_      (  self  :			str		):
             # Initialize image_processing
             _UpperCAmelCase    :			List[str]              =					self.image_processing_class(**self.image_processor_dict		)
             # create random PyTorch tensors
             _UpperCAmelCase    :			Tuple              =					prepare_image_inputs(self.image_processor_tester  ,			equal_resolution=lowerCamelCase__  ,			torchify=lowerCamelCase__		)
             for image in image_inputs:
                  self.assertIsInstance(lowerCamelCase__  ,			torch.Tensor		)
  
             # Test not batched input
             _UpperCAmelCase    :			List[Any]              =					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["shortest_edge"],
                     self.image_processor_tester.size["shortest_edge"],
                 )  ,			)
  
             # Test batched
             _UpperCAmelCase    :			int              =					image_processing(lowerCamelCase__  ,			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["shortest_edge"],
                     self.image_processor_tester.size["shortest_edge"],
                 )  ,			)
  
style_context: 
  
  
  
  """simple docstring"""
  
  
  
  
  import sys
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		int		,						SCREAMING_SNAKE_CASE__			:		list[int]       )						->     int:
  
  
  
  
  
       '''simple docstring'''
  
       if not numbers:
            return 0
       if target == 0 and target in numbers:
            return 0
       if not isinstance(SCREAMING_SNAKE_CASE__		,						(list, tuple)       ) or not all(
           isinstance(SCREAMING_SNAKE_CASE__		,						SCREAMING_SNAKE_CASE__       ) for number in numbers       ):
            raise ValueError("numbers must be an iterable of integers"       )
  
       _UpperCAmelCase    :			List[Any]              =					0
       _UpperCAmelCase    :			str              =					sys.maxsize
  
       while right < len(SCREAMING_SNAKE_CASE__       ):
            curr_sum += numbers[right]
            while curr_sum >= target and left <= right:
                 _UpperCAmelCase    :			Any              =					min(SCREAMING_SNAKE_CASE__		,						right - left + 1       )
                 curr_sum -= numbers[left]
                 left += 1
            right += 1
  
       return 0 if min_len == sys.maxsize else min_len
  