import warnings
from typing import List

import numpy as np

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
from ...utils import is_flax_available, is_tf_available, is_torch_available


class      lowerCamelCase    (SCREAMING_SNAKE_CASE__    ):
  """simple docstring"""







  lowerCamelCase__   =  ['''image_processor''', '''tokenizer''']
  lowerCamelCase__   =  '''OwlViTImageProcessor'''
  lowerCamelCase__   =  ('''CLIPTokenizer''', '''CLIPTokenizerFast''')







  def __init__(							self       :				int     ,   __magic_name__       :				List[Any]=None     ,   __magic_name__       :				str=None     ,   **__magic_name__       :				Tuple      )     ->		Optional[int]:
        SCREAMING_SNAKE_CASE_      =     None
        if "feature_extractor" in kwargs:
              warnings.warn(
                  "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
                  " instead."     ,   __magic_name__     ,   )
              SCREAMING_SNAKE_CASE_      =     kwargs.pop("feature_extractor"      )

        SCREAMING_SNAKE_CASE_      =     image_processor if image_processor is not None else feature_extractor
        if image_processor is None:
              raise ValueError("You need to specify an `image_processor`."      )
        if tokenizer is None:
              raise ValueError("You need to specify a `tokenizer`."      )

        super().__init__(__magic_name__     ,   __magic_name__      )







  def __call__(							self       :				Dict     ,   __magic_name__       :				Optional[int]=None     ,   __magic_name__       :				Union[str, Any]=None     ,   __magic_name__       :				Union[str, Any]=None     ,   __magic_name__       :				Union[str, Any]="max_length"     ,   __magic_name__       :				List[Any]="np"     ,   **__magic_name__       :				Union[str, Any]      )     ->		Any:

        if text is None and query_images is None and images is None:
              raise ValueError(
                  "You have to specify at least one text or query image or image. All three cannot be none."      )

        if text is not None:
              if isinstance(__magic_name__     ,   __magic_name__      ) or (isinstance(__magic_name__     ,   __magic_name__      ) and not isinstance(text[0]     ,   __magic_name__      )):
                    SCREAMING_SNAKE_CASE_      =     [self.tokenizer(__magic_name__     ,   padding=__magic_name__     ,   return_tensors=__magic_name__     ,   **__magic_name__      )]

              elif isinstance(__magic_name__     ,   __magic_name__      ) and isinstance(text[0]     ,   __magic_name__      ):
                    SCREAMING_SNAKE_CASE_      =     []

                    # Maximum number of queries across batch
                    SCREAMING_SNAKE_CASE_      =     max([len(__magic_name__      ) for t in text]      )

                    # Pad all batch samples to max number of text queries
                    for t in text:
                          if len(__magic_name__      ) != max_num_queries:
                                SCREAMING_SNAKE_CASE_      =     t + [" "] * (max_num_queries - len(__magic_name__      ))

                          SCREAMING_SNAKE_CASE_      =     self.tokenizer(__magic_name__     ,   padding=__magic_name__     ,   return_tensors=__magic_name__     ,   **__magic_name__      )
                          encodings.append(__magic_name__      )
              else:
                    raise TypeError("Input text should be a string, a list of strings or a nested list of strings"      )

              if return_tensors == "np":
                    SCREAMING_SNAKE_CASE_      =     np.concatenate([encoding["input_ids"] for encoding in encodings]     ,   axis=0      )
                    SCREAMING_SNAKE_CASE_      =     np.concatenate([encoding["attention_mask"] for encoding in encodings]     ,   axis=0      )

              elif return_tensors == "jax" and is_flax_available():
                    import jax.numpy as jnp

                    SCREAMING_SNAKE_CASE_      =     jnp.concatenate([encoding["input_ids"] for encoding in encodings]     ,   axis=0      )
                    SCREAMING_SNAKE_CASE_      =     jnp.concatenate([encoding["attention_mask"] for encoding in encodings]     ,   axis=0      )

              elif return_tensors == "pt" and is_torch_available():
                    import torch

                    SCREAMING_SNAKE_CASE_      =     torch.cat([encoding["input_ids"] for encoding in encodings]     ,   dim=0      )
                    SCREAMING_SNAKE_CASE_      =     torch.cat([encoding["attention_mask"] for encoding in encodings]     ,   dim=0      )

              elif return_tensors == "tf" and is_tf_available():
                    import tensorflow as tf

                    SCREAMING_SNAKE_CASE_      =     tf.stack([encoding["input_ids"] for encoding in encodings]     ,   axis=0      )
                    SCREAMING_SNAKE_CASE_      =     tf.stack([encoding["attention_mask"] for encoding in encodings]     ,   axis=0      )

              else:
                    raise ValueError("Target return tensor type could not be returned"      )

              SCREAMING_SNAKE_CASE_      =     BatchEncoding()
              SCREAMING_SNAKE_CASE_      =     input_ids
              SCREAMING_SNAKE_CASE_      =     attention_mask

        if query_images is not None:
              SCREAMING_SNAKE_CASE_      =     BatchEncoding()
              SCREAMING_SNAKE_CASE_      =     self.image_processor(
                  __magic_name__     ,   return_tensors=__magic_name__     ,   **__magic_name__      ).pixel_values
              SCREAMING_SNAKE_CASE_      =     query_pixel_values

        if images is not None:
              SCREAMING_SNAKE_CASE_      =     self.image_processor(__magic_name__     ,   return_tensors=__magic_name__     ,   **__magic_name__      )

        if text is not None and images is not None:
              SCREAMING_SNAKE_CASE_      =     image_features.pixel_values
              return encoding
        elif query_images is not None and images is not None:
              SCREAMING_SNAKE_CASE_      =     image_features.pixel_values
              return encoding
        elif text is not None or query_images is not None:
              return encoding
        else:
              return BatchEncoding(data=dict(**__magic_name__      )     ,   tensor_type=__magic_name__      )







  def       __A   (							self       :				List[Any]     ,   *__magic_name__       :				Dict     ,   **__magic_name__       :				List[Any]      )     ->		Optional[int]:
        return self.image_processor.post_process(*__magic_name__     ,   **__magic_name__      )







  def       __A   (							self       :				Dict     ,   *__magic_name__       :				Optional[int]     ,   **__magic_name__       :				int      )     ->		List[str]:
        return self.image_processor.post_process_object_detection(*__magic_name__     ,   **__magic_name__      )







  def       __A   (							self       :				Tuple     ,   *__magic_name__       :				Optional[Any]     ,   **__magic_name__       :				int      )     ->		Optional[int]:
        return self.image_processor.post_process_image_guided_detection(*__magic_name__     ,   **__magic_name__      )







  def       __A   (							self       :				List[Any]     ,   *__magic_name__       :				Tuple     ,   **__magic_name__       :				Optional[int]      )     ->		Optional[Any]:
        return self.tokenizer.batch_decode(*__magic_name__     ,   **__magic_name__      )







  def       __A   (							self       :				Tuple     ,   *__magic_name__       :				Dict     ,   **__magic_name__       :				int      )     ->		str:
        return self.tokenizer.decode(*__magic_name__     ,   **__magic_name__      )







  @property
  def       __A   (							self       :				Union[str, Any]      )     ->		Optional[int]:
        warnings.warn(
            "`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."     ,   __magic_name__     ,   )
        return self.image_processor_class







  @property
  def       __A   (							self       :				Union[str, Any]      )     ->		Optional[Any]:
        warnings.warn(
            "`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead."     ,   __magic_name__     ,   )
        return self.image_processor



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)}")


