






'''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_    ):
		_UpperCAmelCase         ='''MarkupLMFeatureExtractor'''
		_UpperCAmelCase         =('''MarkupLMTokenizer''', '''MarkupLMTokenizerFast''')
		_UpperCAmelCase         =True



		def __call__(    self:    List[Any]				,   a:    Optional[int]=None				,   a:    Tuple=None				,   a:    Any=None				,   a:    Optional[Any]=None				,   a:    Optional[int]=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:    Optional[bool] = None				,   a:    bool = False				,   a:    bool = False				,   a:    bool = False				,   a:    bool = False				,   a:    bool = True				,   a:    Optional[Union[str, TensorType]] = None				,   **a:    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`")

														a_				     =   self.feature_extractor(a)
														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(a				,   a):
																				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=a				,   node_labels=a				,   add_special_tokens=a				,   padding=a				,   truncation=a				,   max_length=a				,   stride=a				,   pad_to_multiple_of=a				,   return_token_type_ids=a				,   return_attention_mask=a				,   return_overflowing_tokens=a				,   return_special_tokens_mask=a				,   return_offsets_mapping=a				,   return_length=a				,   verbose=a				,   return_tensors=a				,   **a				,   )

								return encoded_inputs



		def _lowerCAmelCase     (    self:    str				,   *a:    Tuple				,   **a:    Dict)  ->str:






								'''simple docstring'''


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



		def _lowerCAmelCase     (    self:    List[str]				,   *a:    List[Any]				,   **a:    List[str])  ->str:






								'''simple docstring'''


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




		@property
		def _lowerCAmelCase     (    self:    str)  ->Union[str, Any]:






								'''simple docstring'''


								a_				     =   self.tokenizer.model_input_names
								return tokenizer_input_names











'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


a_      = {
    'configuration_segformer': ['SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SegformerConfig', 'SegformerOnnxConfig']
}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a_      = ['SegformerFeatureExtractor']
							a_      = ['SegformerImageProcessor']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a_      = [
							    'SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'SegformerDecodeHead',
							    'SegformerForImageClassification',
							    'SegformerForSemanticSegmentation',
							    'SegformerLayer',
							    'SegformerModel',
							    'SegformerPreTrainedModel',
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a_      = [
							    'TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'TFSegformerDecodeHead',
							    'TFSegformerForImageClassification',
							    'TFSegformerForSemanticSegmentation',
							    'TFSegformerModel',
							    'TFSegformerPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_segformer import SegformerFeatureExtractor
														from .image_processing_segformer import SegformerImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_segformer import (
														    SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    SegformerDecodeHead,
														    SegformerForImageClassification,
														    SegformerForSemanticSegmentation,
														    SegformerLayer,
														    SegformerModel,
														    SegformerPreTrainedModel,
														)
							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_segformer import (
														    TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFSegformerDecodeHead,
														    TFSegformerForImageClassification,
														    TFSegformerForSemanticSegmentation,
														    TFSegformerModel,
														    TFSegformerPreTrainedModel,
														)

else:
							import sys

							a_      = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



