



'''simple docstring'''





import shutil
import tempfile
import unittest

import numpy as np
import pytest

from transformers.testing_utils import require_vision
from transformers.utils import is_vision_available


if is_vision_available():
       from PIL import Image

       from transformers import (
           AutoProcessor,
           BertTokenizerFast,
           BlipImageProcessor,
           GPTaTokenizer,
           InstructBlipProcessor,
           PreTrainedTokenizerFast,
       )







@require_vision
class        UpperCAmelCase_			(			unittest.TestCase      ):
    """simple docstring"""







    def lowerCamelCase			(       self   :	List[Any]		):
          snake_case__    :       Union[str, Any]       		= tempfile.mkdtemp()

          snake_case__    :       int       		= BlipImageProcessor()
          snake_case__    :       List[str]       		= GPTaTokenizer.from_pretrained("""hf-internal-testing/tiny-random-GPT2Model"""		)
          snake_case__    :       str       		= BertTokenizerFast.from_pretrained("""hf-internal-testing/tiny-random-bert"""		)

          snake_case__    :       Dict       		= InstructBlipProcessor(snake_case_					,	snake_case_					,	snake_case_		)

          processor.save_pretrained(self.tmpdirname		)




    def lowerCamelCase			(       self   :	str					,	**snake_case_   :	str		):
          return AutoProcessor.from_pretrained(self.tmpdirname					,	**snake_case_		).tokenizer




    def lowerCamelCase			(       self   :	Optional[Any]					,	**snake_case_   :	List[str]		):
          return AutoProcessor.from_pretrained(self.tmpdirname					,	**snake_case_		).image_processor




    def lowerCamelCase			(       self   :	List[str]					,	**snake_case_   :	List[str]		):
          return AutoProcessor.from_pretrained(self.tmpdirname					,	**snake_case_		).qformer_tokenizer




    def lowerCamelCase			(       self   :	Any		):
          shutil.rmtree(self.tmpdirname		)




    def lowerCamelCase			(       self   :	Union[str, Any]		):
          snake_case__    :       str       		= [np.random.randint(255					,	size=(3, 30, 400)					,	dtype=np.uinta		)]

          snake_case__    :       Optional[Any]       		= [Image.fromarray(np.moveaxis(snake_case_					,	0					,	-1		)		) for x in image_inputs]

          return image_inputs




    def lowerCamelCase			(       self   :	List[str]		):
          snake_case__    :       Any       		= InstructBlipProcessor(
              tokenizer=self.get_tokenizer()					,	image_processor=self.get_image_processor()					,	qformer_tokenizer=self.get_qformer_tokenizer()					,	)
          processor.save_pretrained(self.tmpdirname		)

          snake_case__    :       List[str]       		= self.get_tokenizer(bos_token="""(BOS)"""					,	eos_token="""(EOS)"""		)
          snake_case__    :       int       		= self.get_image_processor(do_normalize=snake_case_					,	padding_value=1.0		)

          snake_case__    :       Union[str, Any]       		= InstructBlipProcessor.from_pretrained(
              self.tmpdirname					,	bos_token="""(BOS)"""					,	eos_token="""(EOS)"""					,	do_normalize=snake_case_					,	padding_value=1.0		)

          self.assertEqual(processor.tokenizer.get_vocab()					,	tokenizer_add_kwargs.get_vocab()		)
          self.assertIsInstance(processor.tokenizer					,	snake_case_		)

          self.assertEqual(processor.image_processor.to_json_string()					,	image_processor_add_kwargs.to_json_string()		)
          self.assertIsInstance(processor.image_processor					,	snake_case_		)
          self.assertIsInstance(processor.qformer_tokenizer					,	snake_case_		)




    def lowerCamelCase			(       self   :	Tuple		):
          snake_case__    :       str       		= self.get_image_processor()
          snake_case__    :       List[str]       		= self.get_tokenizer()
          snake_case__    :       Any       		= self.get_qformer_tokenizer()

          snake_case__    :       List[Any]       		= InstructBlipProcessor(
              tokenizer=snake_case_					,	image_processor=snake_case_					,	qformer_tokenizer=snake_case_		)

          snake_case__    :       Any       		= self.prepare_image_inputs()

          snake_case__    :       str       		= image_processor(snake_case_					,	return_tensors="""np"""		)
          snake_case__    :       int       		= processor(images=snake_case_					,	return_tensors="""np"""		)

          for key in input_feat_extract.keys():
                self.assertAlmostEqual(input_feat_extract[key].sum()					,	input_processor[key].sum()					,	delta=1E-2		)




    def lowerCamelCase			(       self   :	List[str]		):
          snake_case__    :       Dict       		= self.get_image_processor()
          snake_case__    :       List[Any]       		= self.get_tokenizer()
          snake_case__    :       Optional[int]       		= self.get_qformer_tokenizer()

          snake_case__    :       List[str]       		= InstructBlipProcessor(
              tokenizer=snake_case_					,	image_processor=snake_case_					,	qformer_tokenizer=snake_case_		)

          snake_case__    :       int       		= """lower newer"""

          snake_case__    :       Optional[int]       		= processor(text=snake_case_		)

          snake_case__    :       Optional[int]       		= tokenizer(snake_case_					,	return_token_type_ids=snake_case_		)
          snake_case__    :       Dict       		= qformer_tokenizer(snake_case_					,	return_token_type_ids=snake_case_		)

          for key in encoded_tokens.keys():
                self.assertListEqual(encoded_tokens[key]					,	encoded_processor[key]		)

          for key in encoded_tokens_qformer.keys():
                self.assertListEqual(encoded_tokens_qformer[key]					,	encoded_processor["""qformer_""" + key]		)




    def lowerCamelCase			(       self   :	List[str]		):
          snake_case__    :       str       		= self.get_image_processor()
          snake_case__    :       List[str]       		= self.get_tokenizer()
          snake_case__    :       Any       		= self.get_qformer_tokenizer()

          snake_case__    :       str       		= InstructBlipProcessor(
              tokenizer=snake_case_					,	image_processor=snake_case_					,	qformer_tokenizer=snake_case_		)

          snake_case__    :       Tuple       		= """lower newer"""
          snake_case__    :       Dict       		= self.prepare_image_inputs()

          snake_case__    :       Optional[int]       		= processor(text=snake_case_					,	images=snake_case_		)

          self.assertListEqual(
              list(inputs.keys()		)					,	["""input_ids""", """attention_mask""", """qformer_input_ids""", """qformer_attention_mask""", """pixel_values"""]					,	)

          # test if it raises when no input is passed
          with pytest.raises(snake_case_		):
                processor()




    def lowerCamelCase			(       self   :	Union[str, Any]		):
          snake_case__    :       List[Any]       		= self.get_image_processor()
          snake_case__    :       Dict       		= self.get_tokenizer()
          snake_case__    :       Tuple       		= self.get_qformer_tokenizer()

          snake_case__    :       Optional[Any]       		= InstructBlipProcessor(
              tokenizer=snake_case_					,	image_processor=snake_case_					,	qformer_tokenizer=snake_case_		)

          snake_case__    :       Any       		= [[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

          snake_case__    :       Tuple       		= processor.batch_decode(snake_case_		)
          snake_case__    :       Union[str, Any]       		= tokenizer.batch_decode(snake_case_		)

          self.assertListEqual(snake_case_					,	snake_case_		)




    def lowerCamelCase			(       self   :	List[str]		):
          snake_case__    :       Optional[Any]       		= self.get_image_processor()
          snake_case__    :       List[str]       		= self.get_tokenizer()
          snake_case__    :       Optional[Any]       		= self.get_qformer_tokenizer()

          snake_case__    :       Tuple       		= InstructBlipProcessor(
              tokenizer=snake_case_					,	image_processor=snake_case_					,	qformer_tokenizer=snake_case_		)

          snake_case__    :       Union[str, Any]       		= """lower newer"""
          snake_case__    :       List[Any]       		= self.prepare_image_inputs()

          snake_case__    :       Optional[int]       		= processor(text=snake_case_					,	images=snake_case_		)

          self.assertListEqual(
              list(inputs.keys()		)					,	["""input_ids""", """attention_mask""", """qformer_input_ids""", """qformer_attention_mask""", """pixel_values"""]					,	)





'''simple docstring'''





import sys

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





def 		__snake_case(							_lowerCAmelCase = N						)						->					int:
      snake_case__    :       Dict       		= -sys.maxsize - 1
      for i in range(len(_lowerCAmelCase						) - 12						):
            snake_case__    :       Any       		= 1
            for j in range(13						):
                  product *= int(n[i + j]						)
            if product > largest_product:
                  snake_case__    :       List[str]       		= product
      return largest_product


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