code: 
  
  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
  
  
  if is_torch_available():
   import torch
  
  if is_vision_available():
   from PIL import Image
  
   from transformers import TvltImageProcessor
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Optional[Any]  ,						SCREAMING_SNAKE_CASE__						:			str=10  ,						SCREAMING_SNAKE_CASE__						:			Tuple=10  ,						SCREAMING_SNAKE_CASE__						:			int=False  ,						SCREAMING_SNAKE_CASE__						:			Any=False ):
      UpperCamelCase :Any										=     []
      for i in range(image_processor_tester.num_frames ):
          video.append(np.random.randint(255  ,						size=(image_processor_tester.num_channels, width, height)  ,						dtype=np.uinta ) )
  
      if not numpify and not torchify:
          # PIL expects the channel dimension as last dimension
          UpperCamelCase :Optional[Any]										=     [Image.fromarray(np.moveaxis(SCREAMING_SNAKE_CASE__  ,						0  ,						-1 ) ) for frame in video]
  
      if torchify:
          UpperCamelCase :Dict										=     [torch.from_numpy(SCREAMING_SNAKE_CASE__ ) for frame in video]
  
      return video
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Dict  ,						SCREAMING_SNAKE_CASE__						:			Dict=False  ,						SCREAMING_SNAKE_CASE__						:			Optional[Any]=False  ,						SCREAMING_SNAKE_CASE__						:			int=False ):
      assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"
  
      UpperCamelCase :str										=     []
      for i in range(image_processor_tester.batch_size ):
          if equal_resolution:
              UpperCamelCase :str										=     image_processor_tester.max_resolution
          else:
              UpperCamelCase :List[str]										=     np.random.choice(
                  np.arange(image_processor_tester.min_resolution  ,						image_processor_tester.max_resolution )  ,						2 )
              UpperCamelCase :Optional[Any]										=     prepare_video(
                  image_processor_tester=SCREAMING_SNAKE_CASE__  ,						width=SCREAMING_SNAKE_CASE__  ,						height=SCREAMING_SNAKE_CASE__  ,						numpify=SCREAMING_SNAKE_CASE__  ,						torchify=SCREAMING_SNAKE_CASE__  ,						)
          video_inputs.append(SCREAMING_SNAKE_CASE__ )
  
      return video_inputs
  
  
  
  
  
  
  
  class     UpperCAmelCase_		(      unittest.TestCase				):
  
  
  
        """simple docstring"""
        def __init__(       self					,       SCREAMING_SNAKE_CASE_					,       SCREAMING_SNAKE_CASE_=7					,       SCREAMING_SNAKE_CASE_=3					,       SCREAMING_SNAKE_CASE_=4					,       SCREAMING_SNAKE_CASE_=18					,       SCREAMING_SNAKE_CASE_=30					,       SCREAMING_SNAKE_CASE_=400					,       SCREAMING_SNAKE_CASE_=True					,       SCREAMING_SNAKE_CASE_=None					,       SCREAMING_SNAKE_CASE_=True					,       SCREAMING_SNAKE_CASE_=[0.5, 0.5, 0.5]					,       SCREAMING_SNAKE_CASE_=[0.5, 0.5, 0.5]					,       SCREAMING_SNAKE_CASE_=True					,       SCREAMING_SNAKE_CASE_=None					,       )       ->   str:
            UpperCamelCase :List[str]										=     size if size is not None else {'''shortest_edge''': 18}
            UpperCamelCase :Optional[int]										=     crop_size if crop_size is not None else {'''height''': 18, '''width''': 18}
  
            UpperCamelCase :List[Any]										=     parent
            UpperCamelCase :Any										=     batch_size
            UpperCamelCase :List[str]										=     num_channels
            UpperCamelCase :int										=     num_frames
            UpperCamelCase :Any										=     image_size
            UpperCamelCase :Union[str, Any]										=     min_resolution
            UpperCamelCase :str										=     max_resolution
            UpperCamelCase :Any										=     do_resize
            UpperCamelCase :str										=     size
            UpperCamelCase :Union[str, Any]										=     do_normalize
            UpperCamelCase :str										=     image_mean
            UpperCamelCase :Tuple										=     image_std
            UpperCamelCase :Dict										=     do_center_crop
            UpperCamelCase :Any										=     crop_size
  
  
  
  
        def 					UpperCAmelCase		(       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,
                "do_center_crop": self.do_center_crop,
                "crop_size": self.crop_size,
            }
  
  
  
  
  
  
  
  @require_torch
  @require_vision
  class     UpperCAmelCase_		(      lowercase,			unittest.TestCase				):
  
  
  
        """simple docstring"""
        UpperCamelCase_       :      Any     =TvltImageProcessor if is_vision_available() else None
        def 					UpperCAmelCase		(       self				)       ->   Optional[Any]:
            UpperCamelCase :Optional[int]										=     TvltImageProcessorTester(self				)
        @property
        def 					UpperCAmelCase		(       self				)       ->   Optional[Any]:
            return self.image_processor_tester.prepare_image_processor_dict()
        def 					UpperCAmelCase		(       self				)       ->   int:
            UpperCamelCase :Dict										=     self.image_processing_class(**self.image_processor_dict				)
            self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,       '''image_mean'''				)				)
            self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,       '''image_std'''				)				)
            self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,       '''do_normalize'''				)				)
            self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,       '''do_resize'''				)				)
            self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,       '''do_center_crop'''				)				)
            self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,       '''size'''				)				)
        def 					UpperCAmelCase		(       self				)       ->   List[Any]:
            # Initialize image_processor
            UpperCamelCase :List[str]										=     self.image_processing_class(**self.image_processor_dict				)
            # create random PIL videos
            UpperCamelCase :Tuple										=     prepare_video_inputs(self.image_processor_tester					,       equal_resolution=SCREAMING_SNAKE_CASE_				)
            for video in video_inputs:
                self.assertIsInstance(SCREAMING_SNAKE_CASE_					,       SCREAMING_SNAKE_CASE_				)
                self.assertIsInstance(video[0]					,       Image.Image				)
  
            # Test not batched input
            UpperCamelCase :List[Any]										=     image_processor(video_inputs[0]					,       return_tensors='''pt'''				).pixel_values
            self.assertEqual(
                encoded_videos.shape					,       (
                    1,
                    self.image_processor_tester.num_frames,
                    self.image_processor_tester.num_channels,
                    self.image_processor_tester.crop_size['''height'''],
                    self.image_processor_tester.crop_size['''width'''],
                )					,       )
  
            # Test batched
            UpperCamelCase :List[Any]										=     image_processor(SCREAMING_SNAKE_CASE_					,       return_tensors='''pt'''				).pixel_values
            self.assertEqual(
                encoded_videos.shape					,       (
                    self.image_processor_tester.batch_size,
                    self.image_processor_tester.num_frames,
                    self.image_processor_tester.num_channels,
                    self.image_processor_tester.crop_size['''height'''],
                    self.image_processor_tester.crop_size['''width'''],
                )					,       )
        def 					UpperCAmelCase		(       self				)       ->   Union[str, Any]:
            # Initialize image_processor
            UpperCamelCase :List[Any]										=     self.image_processing_class(**self.image_processor_dict				)
            # create random numpy tensors
            UpperCamelCase :Dict										=     prepare_video_inputs(self.image_processor_tester					,       equal_resolution=SCREAMING_SNAKE_CASE_					,       numpify=SCREAMING_SNAKE_CASE_				)
            for video in video_inputs:
                self.assertIsInstance(SCREAMING_SNAKE_CASE_					,       SCREAMING_SNAKE_CASE_				)
                self.assertIsInstance(video[0]					,       np.ndarray				)
  
            # Test not batched input
            UpperCamelCase :Optional[Any]										=     image_processor(video_inputs[0]					,       return_tensors='''pt'''				).pixel_values
            self.assertEqual(
                encoded_videos.shape					,       (
                    1,
                    self.image_processor_tester.num_frames,
                    self.image_processor_tester.num_channels,
                    self.image_processor_tester.crop_size['''height'''],
                    self.image_processor_tester.crop_size['''width'''],
                )					,       )
  
            # Test batched
            UpperCamelCase :Union[str, Any]										=     image_processor(SCREAMING_SNAKE_CASE_					,       return_tensors='''pt'''				).pixel_values
            self.assertEqual(
                encoded_videos.shape					,       (
                    self.image_processor_tester.batch_size,
                    self.image_processor_tester.num_frames,
                    self.image_processor_tester.num_channels,
                    self.image_processor_tester.crop_size['''height'''],
                    self.image_processor_tester.crop_size['''width'''],
                )					,       )
  
  
  
  
        def 					UpperCAmelCase		(       self				)       ->   Any:
            # Initialize image_processor
            UpperCamelCase :Optional[Any]										=     self.image_processing_class(**self.image_processor_dict				)
            # create random PyTorch tensors
            UpperCamelCase :List[str]										=     prepare_video_inputs(self.image_processor_tester					,       equal_resolution=SCREAMING_SNAKE_CASE_					,       torchify=SCREAMING_SNAKE_CASE_				)
            for video in video_inputs:
                self.assertIsInstance(SCREAMING_SNAKE_CASE_					,       SCREAMING_SNAKE_CASE_				)
                self.assertIsInstance(video[0]					,       torch.Tensor				)
  
            # Test not batched input
            UpperCamelCase :Optional[int]										=     image_processor(video_inputs[0]					,       return_tensors='''pt'''				).pixel_values
            self.assertEqual(
                encoded_videos.shape					,       (
                    1,
                    self.image_processor_tester.num_frames,
                    self.image_processor_tester.num_channels,
                    self.image_processor_tester.crop_size['''height'''],
                    self.image_processor_tester.crop_size['''width'''],
                )					,       )
  
            # Test batched
            UpperCamelCase :Any										=     image_processor(SCREAMING_SNAKE_CASE_					,       return_tensors='''pt'''				).pixel_values
            self.assertEqual(
                encoded_videos.shape					,       (
                    self.image_processor_tester.batch_size,
                    self.image_processor_tester.num_frames,
                    self.image_processor_tester.num_channels,
                    self.image_processor_tester.crop_size['''height'''],
                    self.image_processor_tester.crop_size['''width'''],
                )					,       )
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  
  from __future__ import annotations
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			int ):
      UpperCamelCase :int										=     {1}
      UpperCamelCase :Optional[int]										=     [1]
      for _ in range(2  ,						depth + 1 ):
          UpperCamelCase :Union[str, Any]										=     [*previous_coefficients, 0]
          UpperCamelCase :List[str]										=     [0, *previous_coefficients]
          UpperCamelCase :List[str]										=     []
          for x, y in zip(SCREAMING_SNAKE_CASE__  ,						SCREAMING_SNAKE_CASE__ ):
              coefficients.add(x + y )
              previous_coefficients.append(x + y )
      return coefficients
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			set[int] ):
      UpperCamelCase :Union[str, Any]										=     set()
      for number in unique_coefficients:
          UpperCamelCase :Optional[int]										=     2
          UpperCamelCase :List[Any]										=     number
          while divisor**2 <= copy_number:
              UpperCamelCase :List[Any]										=     0
              while copy_number % divisor == 0:
                  copy_number //= divisor
                  multiplicity += 1
              if multiplicity >= 2:
                  non_squarefrees.add(SCREAMING_SNAKE_CASE__ )
                  break
              divisor += 1
  
      return unique_coefficients.difference(SCREAMING_SNAKE_CASE__ )
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			int = 51 ):
      UpperCamelCase :Any										=     get_pascal_triangle_unique_coefficients(SCREAMING_SNAKE_CASE__ )
      UpperCamelCase :str										=     get_squarefrees(SCREAMING_SNAKE_CASE__ )
      return sum(SCREAMING_SNAKE_CASE__ )
  
  
  if __name__ == "__main__":
   print(f'''{solution() = }''')
  
  
  
  
  
  