


'''simple docstring'''
from typing import Optional, Union

from ...file_utils import TensorType
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, TruncationStrategy






class 				__lowerCAmelCase      (      lowercase	):

						"""simple docstring"""






						_UpperCAmelCase		:					str      	="MarkupLMFeatureExtractor"
						_UpperCAmelCase		:					Optional[Any]      	=("MarkupLMTokenizer", "MarkupLMTokenizerFast")
						_UpperCAmelCase		:					Optional[Any]      	=True






						def __call__(     self       :			List[Any]   ,     lowerCAmelCase       :			Union[str, Any]=None   ,     lowerCAmelCase       :			str=None   ,     lowerCAmelCase       :			Optional[int]=None   ,     lowerCAmelCase       :			Any=None   ,     lowerCAmelCase       :			Tuple=None   ,     lowerCAmelCase       :			bool = True   ,     lowerCAmelCase       :			Union[bool, str, PaddingStrategy] = False   ,     lowerCAmelCase       :			Union[bool, str, TruncationStrategy] = None   ,     lowerCAmelCase       :			Optional[int] = None   ,     lowerCAmelCase       :			int = 0   ,     lowerCAmelCase       :			Optional[int] = None   ,     lowerCAmelCase       :			Optional[bool] = None   ,     lowerCAmelCase       :			Optional[bool] = None   ,     lowerCAmelCase       :			bool = False   ,     lowerCAmelCase       :			bool = False   ,     lowerCAmelCase       :			bool = False   ,     lowerCAmelCase       :			bool = False   ,     lowerCAmelCase       :			bool = True   ,     lowerCAmelCase       :			Optional[Union[str, TensorType]] = None   ,     **lowerCAmelCase       :			List[Any]   ,     ):
													# first, create nodes and xpaths
													if self.parse_html:
																				if html_strings is None:
																											raise ValueError("Make sure to pass HTML strings in case `parse_html` is set to `True`"  )

																				if nodes is not None or xpaths is not None or node_labels is not None:
																											raise ValueError(
																											    "Please don't pass nodes, xpaths nor node labels in case `parse_html` is set to `True`"  )

																				A_ 						=		self.feature_extractor(lowerCAmelCase  )
																				A_ 						=		features["nodes"]
																				A_ 						=		features["xpaths"]
													else:
																				if html_strings is not None:
																											raise ValueError("You have passed HTML strings but `parse_html` is set to `False`."  )
																				if nodes is None or xpaths is None:
																											raise ValueError("Make sure to pass nodes and xpaths in case `parse_html` is set to `False`"  )

        # # second, apply the tokenizer
													if questions is not None and self.parse_html:
																				if isinstance(lowerCAmelCase   ,     lowerCAmelCase  ):
																											A_ 						=		[questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

													A_ 						=		self.tokenizer(
													    text=questions if questions is not None else nodes   ,     text_pair=nodes if questions is not None else None   ,     xpaths=lowerCAmelCase   ,     node_labels=lowerCAmelCase   ,     add_special_tokens=lowerCAmelCase   ,     padding=lowerCAmelCase   ,     truncation=lowerCAmelCase   ,     max_length=lowerCAmelCase   ,     stride=lowerCAmelCase   ,     pad_to_multiple_of=lowerCAmelCase   ,     return_token_type_ids=lowerCAmelCase   ,     return_attention_mask=lowerCAmelCase   ,     return_overflowing_tokens=lowerCAmelCase   ,     return_special_tokens_mask=lowerCAmelCase   ,     return_offsets_mapping=lowerCAmelCase   ,     return_length=lowerCAmelCase   ,     verbose=lowerCAmelCase   ,     return_tensors=lowerCAmelCase   ,     **lowerCAmelCase   ,     )

													return encoded_inputs






						def 							_UpperCAmelCase					(     self       :			int   ,     *lowerCAmelCase       :			List[str]   ,     **lowerCAmelCase       :			Tuple  ):
													return self.tokenizer.batch_decode(*lowerCAmelCase   ,     **lowerCAmelCase  )






						def 							_UpperCAmelCase					(     self       :			Optional[Any]   ,     *lowerCAmelCase       :			Optional[int]   ,     **lowerCAmelCase       :			List[str]  ):
													return self.tokenizer.decode(*lowerCAmelCase   ,     **lowerCAmelCase  )






						@property
						def 							_UpperCAmelCase					(     self       :			Any  ):
													A_ 						=		self.tokenizer.model_input_names
													return tokenizer_input_names









'''simple docstring'''
def 			a_							(  UpperCamelCase_   ):
							if not isinstance(UpperCamelCase_	,     UpperCamelCase_   ):
														A_ 						=		f"Input value of [number={number}] must be an integer"
														raise TypeError(UpperCamelCase_   )
							if number < 0 or number % 2 == 1:
														return False
							A_ 						=		int(number**0.5   )
							return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
							import doctest

							doctest.testmod()





