'''simple docstring'''

import unittest

from transformers import MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING, is_vision_available
from transformers.pipelines import pipeline
from transformers.testing_utils import (
    is_pipeline_test,
    nested_simplify,
    require_tf,
    require_torch,
    require_vision,
    slow,
)

from .test_pipelines_common import ANY


if is_vision_available():
  from PIL import Image
else:



  class 			UpperCAmelCase  :





         '''simple docstring'''



         @staticmethod
         def _lowerCAmelCase(						*__lowerCAmelCase	,   **__lowerCAmelCase )  ->  Dict:
          pass



@is_pipeline_test
@require_torch
@require_vision
class 			UpperCAmelCase  (						unittest.TestCase					):





       '''simple docstring'''



       SCREAMING_SNAKE_CASE							=    MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  Tuple:
        lowercase__				:    List[str]  =					pipeline('''visual-question-answering'''	,   model='''hf-internal-testing/tiny-vilt-random-vqa''' )
        lowercase__				:    int  =					[
            {
                '''image''': Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png''' ),
                '''question''': '''How many cats are there?''',
            },
            {
                '''image''': '''./tests/fixtures/tests_samples/COCO/000000039769.png''',
                '''question''': '''How many cats are there?''',
            },
        ]
        return vqa_pipeline, examples

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  Dict:
        lowercase__				:    str  =					vqa_pipeline(__lowerCAmelCase	,   top_k=1 )
        self.assertEqual(
            __lowerCAmelCase	,   [
                [{'''score''': ANY(__lowerCAmelCase ), '''answer''': ANY(__lowerCAmelCase )}],
                [{'''score''': ANY(__lowerCAmelCase ), '''answer''': ANY(__lowerCAmelCase )}],
            ]	,   )

       @require_torch
       def _lowerCAmelCase(						self )  ->  List[str]:
        lowercase__				:    Optional[int]  =					pipeline('''visual-question-answering'''	,   model='''hf-internal-testing/tiny-vilt-random-vqa''' )
        lowercase__				:    Optional[Any]  =					'''./tests/fixtures/tests_samples/COCO/000000039769.png'''
        lowercase__				:    Union[str, Any]  =					'''How many cats are there?'''

        lowercase__				:    Tuple  =					vqa_pipeline(image=__lowerCAmelCase	,   question='''How many cats are there?'''	,   top_k=2 )
        self.assertEqual(
            __lowerCAmelCase	,   [{'''score''': ANY(__lowerCAmelCase ), '''answer''': ANY(__lowerCAmelCase )}, {'''score''': ANY(__lowerCAmelCase ), '''answer''': ANY(__lowerCAmelCase )}] )

        lowercase__				:    Optional[int]  =					vqa_pipeline({'''image''': image, '''question''': question}	,   top_k=2 )
        self.assertEqual(
            __lowerCAmelCase	,   [{'''score''': ANY(__lowerCAmelCase ), '''answer''': ANY(__lowerCAmelCase )}, {'''score''': ANY(__lowerCAmelCase ), '''answer''': ANY(__lowerCAmelCase )}] )

       @slow
       @require_torch
       def _lowerCAmelCase(						self )  ->  Optional[Any]:
        lowercase__				:    List[Any]  =					pipeline('''visual-question-answering'''	,   model='''dandelin/vilt-b32-finetuned-vqa''' )
        lowercase__				:    int  =					'''./tests/fixtures/tests_samples/COCO/000000039769.png'''
        lowercase__				:    Dict  =					'''How many cats are there?'''

        lowercase__				:    List[Any]  =					vqa_pipeline(image=__lowerCAmelCase	,   question=__lowerCAmelCase	,   top_k=2 )
        self.assertEqual(
            nested_simplify(__lowerCAmelCase	,   decimals=4 )	,   [{'''score''': 0.8_7_9_9, '''answer''': '''2'''}, {'''score''': 0.2_9_6, '''answer''': '''1'''}] )

        lowercase__				:    List[str]  =					vqa_pipeline({'''image''': image, '''question''': question}	,   top_k=2 )
        self.assertEqual(
            nested_simplify(__lowerCAmelCase	,   decimals=4 )	,   [{'''score''': 0.8_7_9_9, '''answer''': '''2'''}, {'''score''': 0.2_9_6, '''answer''': '''1'''}] )

        lowercase__				:    Optional[Any]  =					vqa_pipeline(
            [{'''image''': image, '''question''': question}, {'''image''': image, '''question''': question}]	,   top_k=2 )
        self.assertEqual(
            nested_simplify(__lowerCAmelCase	,   decimals=4 )	,   [[{'''score''': 0.8_7_9_9, '''answer''': '''2'''}, {'''score''': 0.2_9_6, '''answer''': '''1'''}]] * 2	,   )


       @require_tf
       @unittest.skip('''Visual question answering not implemented in TF''' )
       def _lowerCAmelCase(						self )  ->  Any:
        pass


import math
from datetime import datetime, timedelta


def    a__       (						__UpperCamelCase ):
      SCREAMING_SNAKE_CASE_      =     year % 1_9
      SCREAMING_SNAKE_CASE_      =     year % 4
      SCREAMING_SNAKE_CASE_      =     year % 7
      SCREAMING_SNAKE_CASE_      =     math.floor(year / 1_0_0 )
      SCREAMING_SNAKE_CASE_      =     math.floor((1_3 + 8 * leap_day_inhibits) / 2_5 )
      SCREAMING_SNAKE_CASE_      =     leap_day_inhibits / 4
      SCREAMING_SNAKE_CASE_      =     (
          1_5 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
      ) % 3_0
      SCREAMING_SNAKE_CASE_      =     (4 + leap_day_inhibits - leap_day_reinstall_number) % 7

      # days to be added to March 21
      SCREAMING_SNAKE_CASE_      =     (1_9 * metonic_cycle + secular_moon_shift) % 3_0

      # PHM -> Paschal Full Moon
      SCREAMING_SNAKE_CASE_      =     (
          2 * julian_leap_year
          + 4 * non_leap_year
          + 6 * days_to_add
          + century_starting_point
      ) % 7

      if days_to_add == 2_9 and days_from_phm_to_sunday == 6:
            return datetime(__UpperCamelCase   ,					4   ,					1_9 )
      elif days_to_add == 2_8 and days_from_phm_to_sunday == 6:
            return datetime(__UpperCamelCase   ,					4   ,					1_8 )
      else:
            return datetime(__UpperCamelCase   ,					3   ,					2_2 ) + timedelta(
                days=int(days_to_add + days_from_phm_to_sunday ) )


if __name__ == "__main__":
      for year in (19_94, 20_00, 20_10, 20_21, 20_23):
            A   :     Dict       =				"will be" if year > datetime.now().year else "was"
            print(f"Easter in {year} {tense} {gauss_easter(year)}")


