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	(						__UpperCAmelCase						):
     UpperCAmelCase__       :							Union[str, Any]     =	["""image_processor""", """tokenizer"""]
     UpperCAmelCase__       :							List[str]     =	"""OwlViTImageProcessor"""
     UpperCAmelCase__       :							List[Any]     =	("""CLIPTokenizer""", """CLIPTokenizerFast""")





     def __init__(self   :					Tuple       ,					_A   :					List[str]=None       ,					_A   :					Optional[int]=None       ,					**_A   :					Any     )		->		str:
         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."       ,					UpperCAmelCase_       ,					)
             snake_case				  =      kwargs.pop("feature_extractor"     )

         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__(UpperCAmelCase_       ,					UpperCAmelCase_     )





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

         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(UpperCAmelCase_       ,					UpperCAmelCase_     ) or (isinstance(UpperCAmelCase_       ,					UpperCAmelCase_     ) and not isinstance(text[0]       ,					UpperCAmelCase_     )):
                 snake_case				  =      [self.tokenizer(UpperCAmelCase_       ,					padding=UpperCAmelCase_       ,					return_tensors=UpperCAmelCase_       ,					**UpperCAmelCase_     )]

             elif isinstance(UpperCAmelCase_       ,					UpperCAmelCase_     ) and isinstance(text[0]       ,					UpperCAmelCase_     ):
                 snake_case				  =      []

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

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

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

             if return_tensors == "np":
                 snake_case				  =      np.concatenate([encoding["input_ids"] for encoding in encodings]       ,					axis=0     )
                 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

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

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

                 snake_case				  =      torch.cat([encoding["input_ids"] for encoding in encodings]       ,					dim=0     )
                 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

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

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

             snake_case				  =      BatchEncoding()
             snake_case				  =      input_ids
             snake_case				  =      attention_mask

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

         if images is not None:
             snake_case				  =      self.image_processor(UpperCAmelCase_       ,					return_tensors=UpperCAmelCase_       ,					**UpperCAmelCase_     )

         if text is not None and images is not None:
             snake_case				  =      image_features.pixel_values
             return encoding
         elif query_images is not None and images is not None:
             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(**UpperCAmelCase_     )       ,					tensor_type=UpperCAmelCase_     )





     def 	UpperCAmelCase(self   :					Optional[Any]       ,					*_A   :					Dict       ,					**_A   :					int     )		->		Dict:
         return self.image_processor.post_process(*UpperCAmelCase_       ,					**UpperCAmelCase_     )





     def 	UpperCAmelCase(self   :					Optional[int]       ,					*_A   :					Optional[int]       ,					**_A   :					Optional[Any]     )		->		Tuple:
         return self.image_processor.post_process_object_detection(*UpperCAmelCase_       ,					**UpperCAmelCase_     )





     def 	UpperCAmelCase(self   :					Optional[int]       ,					*_A   :					Any       ,					**_A   :					str     )		->		Tuple:
         return self.image_processor.post_process_image_guided_detection(*UpperCAmelCase_       ,					**UpperCAmelCase_     )





     def 	UpperCAmelCase(self   :					str       ,					*_A   :					Any       ,					**_A   :					int     )		->		int:
         return self.tokenizer.batch_decode(*UpperCAmelCase_       ,					**UpperCAmelCase_     )





     def 	UpperCAmelCase(self   :					List[str]       ,					*_A   :					str       ,					**_A   :					Optional[Any]     )		->		List[Any]:
         return self.tokenizer.decode(*UpperCAmelCase_       ,					**UpperCAmelCase_     )





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





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



import sys

_A						      =				(
    "73167176531330624919225119674426574742355349194934"
    "96983520312774506326239578318016984801869478851843"
    "85861560789112949495459501737958331952853208805511"
    "12540698747158523863050715693290963295227443043557"
    "66896648950445244523161731856403098711121722383113"
    "62229893423380308135336276614282806444486645238749"
    "30358907296290491560440772390713810515859307960866"
    "70172427121883998797908792274921901699720888093776"
    "65727333001053367881220235421809751254540594752243"
    "52584907711670556013604839586446706324415722155397"
    "53697817977846174064955149290862569321978468622482"
    "83972241375657056057490261407972968652414535100474"
    "82166370484403199890008895243450658541227588666881"
    "16427171479924442928230863465674813919123162824586"
    "17866458359124566529476545682848912883142607690042"
    "24219022671055626321111109370544217506941658960408"
    "07198403850962455444362981230987879927244284909188"
    "84580156166097919133875499200524063689912560717606"
    "05886116467109405077541002256983155200055935729725"
    "71636269561882670428252483600823257530420752963450"
)



def 		lowercase_    (     A__	)							->							int:
    """simple docstring"""

    snake_case				  =      1
    for digit in s:
        product *= int(A__	)
    return product



def 		lowercase_    (     A__ = N	)							->							int:
    """simple docstring"""

    snake_case				  =      -sys.maxsize - 1
    snake_case				  =      n[:13]
    snake_case				  =      13
    while cur_index < len(A__	) - 13:
        if int(n[cur_index]	) >= int(substr[0]	):
            snake_case				  =      substr[1:] + n[cur_index]
            cur_index += 1
        else:
            snake_case				  =      max(A__				,	str_eval(A__	)	)
            snake_case				  =      n[cur_index : cur_index + 13]
            cur_index += 13
    return largest_product


if __name__ == "__main__":
   print(f"{solution() = }")

