



"""simple docstring"""
import re
import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin
class 				lowerCamelCase  (			_SCREAMING_SNAKE_CASE				):






					'''simple docstring'''





					_A		:			str						=     ["""image_processor""", """tokenizer"""]
					_A		:			List[str]						=     """AutoImageProcessor"""
					_A		:			Any						=     """AutoTokenizer"""






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

											snake_case_ :Tuple						=			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__(snake_case						,     snake_case						)
											snake_case_ :Optional[int]						=			self.image_processor
											snake_case_ :Any						=			False






					def __call__(       self:							List[Any]						,     *snake_case:							str						,     **snake_case:							Tuple						)   ->	Union[str, Any]:
											# For backward compatibility
											if self._in_target_context_manager:
																	return self.current_processor(*snake_case						,     **snake_case						)

											snake_case_ :Any						=			kwargs.pop("""images"""						,     snake_case						)
											snake_case_ :Dict						=			kwargs.pop("""text"""						,     snake_case						)
											if len(snake_case						) > 0:
																	snake_case_ :str						=			args[0]
																	snake_case_ :Dict						=			args[1:]

											if images is None and text is None:
																	raise ValueError("""You need to specify either an `images` or `text` input to process."""						)

											if images is not None:
																	snake_case_ :Any						=			self.image_processor(snake_case						,     *snake_case						,     **snake_case						)
											if text is not None:
																	snake_case_ :str						=			self.tokenizer(snake_case						,     **snake_case						)

											if text is None:
																	return inputs
											elif images is None:
																	return encodings
											else:
																	snake_case_ :Dict						=			encodings["""input_ids"""]
																	return inputs






					def    lowerCAmelCase_				(       self:							str						,     *snake_case:							Union[str, Any]						,     **snake_case:							Union[str, Any]						)   ->	List[str]:
											return self.tokenizer.batch_decode(*snake_case						,     **snake_case						)






					def    lowerCAmelCase_				(       self:							List[Any]						,     *snake_case:							Any						,     **snake_case:							Union[str, Any]						)   ->	List[str]:
											return self.tokenizer.decode(*snake_case						,     **snake_case						)






					@contextmanager
					def    lowerCAmelCase_				(       self:							str						)   ->	Union[str, Any]:
											warnings.warn(
											    """`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your """
											    """labels by using the argument `text` of the regular `__call__` method (either in the same call as """
											    """your images inputs, or in a separate call."""						)
											snake_case_ :List[str]						=			True
											snake_case_ :Optional[Any]						=			self.tokenizer
											yield
											snake_case_ :List[Any]						=			self.image_processor
											snake_case_ :List[str]						=			False






					def    lowerCAmelCase_				(       self:							Dict						,     snake_case:							List[str]						,     snake_case:							str=False						,     snake_case:							List[Any]=None						)   ->	Optional[int]:
											if added_vocab is None:
																	snake_case_ :str						=			self.tokenizer.get_added_vocab()

											snake_case_ :Union[str, Any]						=			{}

											while tokens:
																	snake_case_ :Dict						=			re.search(r"""<s_(.*?)>"""						,     snake_case						,     re.IGNORECASE						)
																	if start_token is None:
																							break
																	snake_case_ :Tuple						=			start_token.group(1						)
																	snake_case_ :Tuple						=			re.search(rf"""</s_{key}>"""						,     snake_case						,     re.IGNORECASE						)
																	snake_case_ :Tuple						=			start_token.group()
																	if end_token is None:
																							snake_case_ :str						=			tokens.replace(snake_case						,     """"""						)
																	else:
																							snake_case_ :List[str]						=			end_token.group()
																							snake_case_ :Dict						=			re.escape(snake_case						)
																							snake_case_ :int						=			re.escape(snake_case						)
																							snake_case_ :Dict						=			re.search(f"""{start_token_escaped}(.*?){end_token_escaped}"""						,     snake_case						,     re.IGNORECASE						)
																							if content is not None:
																													snake_case_ :str						=			content.group(1						).strip()
																													if r"<s_" in content and r"</s_" in content:  # non-leaf node
																																			snake_case_ :str						=			self.tokenajson(snake_case						,     is_inner_value=snake_case						,     added_vocab=snake_case						)
																																			if value:
																																									if len(snake_case						) == 1:
																																															snake_case_ :List[Any]						=			value[0]
																																									snake_case_ :Optional[Any]						=			value
																													else:  # leaf nodes
																																			snake_case_ :List[str]						=			[]
																																			for leaf in content.split(r"""<sep/>"""						):
																																									snake_case_ :Union[str, Any]						=			leaf.strip()
																																									if leaf in added_vocab and leaf[0] == "<" and leaf[-2:] == "/>":
																																															snake_case_ :Any						=			leaf[1:-2]  # for categorical special tokens
																																									output[key].append(snake_case						)
																																			if len(output[key]						) == 1:
																																									snake_case_ :Optional[Any]						=			output[key][0]

																							snake_case_ :List[Any]						=			tokens[tokens.find(snake_case						) + len(snake_case						) :].strip()
																							if tokens[:6] == r"<sep/>":  # non-leaf nodes
																													return [output] + self.tokenajson(tokens[6:]						,     is_inner_value=snake_case						,     added_vocab=snake_case						)

											if len(snake_case						):
																	return [output] if is_inner_value else output
											else:
																	return [] if is_inner_value else {"text_sequence": tokens}






					@property
					def    lowerCAmelCase_				(       self:							Dict						)   ->	int:
											warnings.warn(
											    """`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."""						,     snake_case						,     )
											return self.image_processor_class






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




'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   int					):
  '''simple docstring'''





  lowerCAmelCase_			:      Union[str, Any]			=   (1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0







def 				UpperCamelCase_			(    A__					:   int = 50_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      Optional[int]			=   [(i * (3 * i - 1)) // 2 for i in range(1							,    A__					)]
  for i, pentagonal_i in enumerate(A__					):
    for j in range(A__							,    len(A__					)					):
      lowerCAmelCase_			:      int			=   pentagonal_nums[j]
      lowerCAmelCase_			:      Union[str, Any]			=   pentagonal_i + pentagonal_j
      lowerCAmelCase_			:      List[Any]			=   pentagonal_j - pentagonal_i
      if is_pentagonal(A__					) and is_pentagonal(A__					):
        return b

  return -1


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



