



'''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 			_SCREAMING_SNAKE_CASE				(lowercase__      ):
			A__								=  'MarkupLMFeatureExtractor'
			A__								=  ('MarkupLMTokenizer', 'MarkupLMTokenizerFast')
			A__								=  True



			def __call__(     self		:						List[Any]    ,			__UpperCamelCase		:						Optional[int]=None    ,			__UpperCamelCase		:						Tuple=None    ,			__UpperCamelCase		:						Optional[Any]=None    ,			__UpperCamelCase		:						Tuple=None    ,			__UpperCamelCase		:						List[Any]=None    ,			__UpperCamelCase		:						bool = True    ,			__UpperCamelCase		:						Union[bool, str, PaddingStrategy] = False    ,			__UpperCamelCase		:						Union[bool, str, TruncationStrategy] = None    ,			__UpperCamelCase		:						Optional[int] = None    ,			__UpperCamelCase		:						int = 0    ,			__UpperCamelCase		:						Optional[int] = None    ,			__UpperCamelCase		:						Optional[bool] = None    ,			__UpperCamelCase		:						Optional[bool] = None    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = True    ,			__UpperCamelCase		:						Optional[Union[str, TensorType]] = None    ,			**__UpperCamelCase		:						Optional[int]    ,			)      ->      BatchEncoding:
							"""simple docstring"""





							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`'''			)

											snake_case__      :   Optional[Any]      =    self.feature_extractor(__UpperCamelCase			)
											snake_case__      :   Union[str, Any]      =    features['''nodes''']
											snake_case__      :   str      =    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(__UpperCamelCase    ,			__UpperCamelCase			):
															snake_case__      :   Dict      =    [questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

							snake_case__      :   List[str]      =    self.tokenizer(
							    text=questions if questions is not None else nodes    ,			text_pair=nodes if questions is not None else None    ,			xpaths=__UpperCamelCase    ,			node_labels=__UpperCamelCase    ,			add_special_tokens=__UpperCamelCase    ,			padding=__UpperCamelCase    ,			truncation=__UpperCamelCase    ,			max_length=__UpperCamelCase    ,			stride=__UpperCamelCase    ,			pad_to_multiple_of=__UpperCamelCase    ,			return_token_type_ids=__UpperCamelCase    ,			return_attention_mask=__UpperCamelCase    ,			return_overflowing_tokens=__UpperCamelCase    ,			return_special_tokens_mask=__UpperCamelCase    ,			return_offsets_mapping=__UpperCamelCase    ,			return_length=__UpperCamelCase    ,			verbose=__UpperCamelCase    ,			return_tensors=__UpperCamelCase    ,			**__UpperCamelCase    ,			)

							return encoded_inputs



			def 				lowerCAmelCase (     self		:						int    ,			*__UpperCamelCase		:						int    ,			**__UpperCamelCase		:						str			)      ->      Union[str, Any]:
							"""simple docstring"""





							return self.tokenizer.batch_decode(*__UpperCamelCase    ,			**__UpperCamelCase			)



			def 				lowerCAmelCase (     self		:						Tuple    ,			*__UpperCamelCase		:						Union[str, Any]    ,			**__UpperCamelCase		:						int			)      ->      Optional[int]:
							"""simple docstring"""





							return self.tokenizer.decode(*__UpperCamelCase    ,			**__UpperCamelCase			)







			@property
			def 				lowerCAmelCase (     self		:						Tuple			)      ->      str:
							"""simple docstring"""





							snake_case__      :   Optional[Any]      =    self.tokenizer.model_input_names
							return tokenizer_input_names








'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


a_       :     Any 							=     {"configuration_bit": ["BIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BitConfig", "BitOnnxConfig"]}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_       :     int 							=     [
     "BIT_PRETRAINED_MODEL_ARCHIVE_LIST",
     "BitForImageClassification",
     "BitModel",
     "BitPreTrainedModel",
     "BitBackbone",
 ]


try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_       :     Tuple 							=     ["BitImageProcessor"]


if TYPE_CHECKING:
 from .configuration_bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig, BitOnnxConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_bit import (
      BIT_PRETRAINED_MODEL_ARCHIVE_LIST,
      BitBackbone,
      BitForImageClassification,
      BitModel,
      BitPreTrainedModel,
  )

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .image_processing_bit import BitImageProcessor

else:
 import sys

 a_       :     Union[str, Any] 							=     _LazyModule(__name__, globals()["__file__"], _import_structure)

