





from typing import List, Optional, Union

from ...image_utils import ImageInput
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType







class    __snake_case	(							__lowerCamelCase      ):





       '''simple docstring'''







       lowerCAmelCase__						=					["""image_processor""", """tokenizer"""]
       lowerCAmelCase__						=					"""BlipImageProcessor"""
       lowerCAmelCase__						=					("""BertTokenizer""", """BertTokenizerFast""")




       def __init__(  self			:   Union[str, Any]							,    A			:   List[Any]							,    A			:   str		):
         __snake_case:						Optional[int]			  =						False
         super().__init__(A							,    A		)
         __snake_case:						str			  =						self.image_processor




       def __call__(  self			:   Tuple							,    A			:   ImageInput = None							,    A			:   Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None							,    A			:   bool = True							,    A			:   Union[bool, str, PaddingStrategy] = False							,    A			:   Union[bool, str, TruncationStrategy] = None							,    A			:   Optional[int] = None							,    A			:   int = 0							,    A			:   Optional[int] = None							,    A			:   Optional[bool] = None							,    A			:   bool = False							,    A			:   bool = False							,    A			:   bool = False							,    A			:   bool = False							,    A			:   bool = False							,    A			:   bool = True							,    A			:   Optional[Union[str, TensorType]] = None							,    **A			:   List[str]							,    ):
         if images is None and text is None:
           raise ValueError("""You have to specify either images or text."""		)

         # Get only text
         if images is None:
           __snake_case:						Union[str, Any]			  =						self.tokenizer
           __snake_case:						Optional[int]			  =						self.tokenizer(
               text=A							,    add_special_tokens=A							,    padding=A							,    truncation=A							,    max_length=A							,    stride=A							,    pad_to_multiple_of=A							,    return_attention_mask=A							,    return_overflowing_tokens=A							,    return_special_tokens_mask=A							,    return_offsets_mapping=A							,    return_token_type_ids=A							,    return_length=A							,    verbose=A							,    return_tensors=A							,    **A							,    )
           return text_encoding

         # add pixel_values
         __snake_case:						Dict			  =						self.image_processor(A							,    return_tensors=A		)

         if text is not None:
           __snake_case:						Any			  =						self.tokenizer(
               text=A							,    add_special_tokens=A							,    padding=A							,    truncation=A							,    max_length=A							,    stride=A							,    pad_to_multiple_of=A							,    return_attention_mask=A							,    return_overflowing_tokens=A							,    return_special_tokens_mask=A							,    return_offsets_mapping=A							,    return_token_type_ids=A							,    return_length=A							,    verbose=A							,    return_tensors=A							,    **A							,    )
         else:
           __snake_case:						Tuple			  =						None

         if text_encoding is not None:
           encoding_image_processor.update(A		)

         return encoding_image_processor




       def 							UpperCAmelCase__			(  self			:   Dict							,    *A			:   str							,    **A			:   Dict		):
         return self.tokenizer.batch_decode(*A							,    **A		)




       def 							UpperCAmelCase__			(  self			:   Dict							,    *A			:   Optional[int]							,    **A			:   List[Any]		):
         return self.tokenizer.decode(*A							,    **A		)






       @property
       def 							UpperCAmelCase__			(  self			:   Union[str, Any]		):
         __snake_case:						Tuple			  =						self.tokenizer.model_input_names
         __snake_case:						List[Any]			  =						self.image_processor.model_input_names
         return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names		)		)













import math







def       A__							(   SCREAMING_SNAKE_CASE__)       ->   int:

  if not isinstance(SCREAMING_SNAKE_CASE__ , SCREAMING_SNAKE_CASE__):
    __snake_case:						Optional[int]			  =						F'''Input value of [number={number}] must be an integer'''
    raise TypeError(SCREAMING_SNAKE_CASE__)

  if number < 1:
    __snake_case:						Optional[int]			  =						F'''Input value of [number={number}] must be > 0'''
    raise ValueError(SCREAMING_SNAKE_CASE__)
  elif number == 1:
    return 3
  elif number == 2:
    return 5
  else:
    __snake_case:						List[Any]			  =						int(math.log(number // 3 , 2)) + 2

    __snake_case:						str			  =						[3, 5]
    __snake_case:						int			  =						2
    __snake_case:						List[str]			  =						3
    for block in range(1 , SCREAMING_SNAKE_CASE__):
      for _ in range(SCREAMING_SNAKE_CASE__):
        proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1])
        proth_index += 1
      increment *= 2

  return proth_list[number - 1]


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      for number in range(11):
            __UpperCAmelCase	:       Optional[int]    	=							0
            try:
                  __UpperCAmelCase	:       int    	=							proth(number)
            except ValueError:
                  print(f'ValueError: there is no {number}th Proth number')
                  continue

            print(f'The {number}th Proth number: {value}')






