




"""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 							lowercase   (     lowerCAmelCase_):
				__lowerCAmelCase     :     Dict								= 'MarkupLMFeatureExtractor'
				__lowerCAmelCase     :     int								= ('MarkupLMTokenizer', 'MarkupLMTokenizerFast')
				__lowerCAmelCase     :     Any								= True







				def __call__(				self :       int   ,  _lowerCamelCase :       List[Any]=None   ,  _lowerCamelCase :       List[str]=None   ,  _lowerCamelCase :       List[Any]=None   ,  _lowerCamelCase :       Dict=None   ,  _lowerCamelCase :       List[Any]=None   ,  _lowerCamelCase :       Optional[int] = True   ,  _lowerCamelCase :       Dict = False   ,  _lowerCamelCase :       List[Any] = None   ,  _lowerCamelCase :       Optional[Any] = None   ,  _lowerCamelCase :       str = 0   ,  _lowerCamelCase :       Dict = None   ,  _lowerCamelCase :       Dict = None   ,  _lowerCamelCase :       List[Any] = None   ,  _lowerCamelCase :       Any = False   ,  _lowerCamelCase :       int = False   ,  _lowerCamelCase :       Dict = False   ,  _lowerCamelCase :       Any = False   ,  _lowerCamelCase :       Optional[int] = True   ,  _lowerCamelCase :       str = None   ,  **_lowerCamelCase :       Union[str, Any]   ,  ):



					"""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_	:					int						 =		self.feature_extractor(lowerCamelCase_							)
						A_	:					Tuple						 =		features['''nodes''']
						A_	:					Tuple						 =		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_	:					int						 =		[questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

					A_	:					List[Any]						 =		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        a_	(				self :       Any   ,  *_lowerCamelCase :       List[Any]   ,  **_lowerCamelCase :       int							):



					"""simple docstring"""

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







				def        a_	(				self :       Optional[int]   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       Tuple							):



					"""simple docstring"""

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







				@property
				def        a_	(				self :       List[str]							):



					"""simple docstring"""

					A_	:					str						 =		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


SCREAMING_SNAKE_CASE_  					= {'configuration_detr': ['DETR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DetrConfig', 'DetrOnnxConfig']}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE_  					= ['DetrFeatureExtractor']
  SCREAMING_SNAKE_CASE_  					= ['DetrImageProcessor']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE_  					= [
      'DETR_PRETRAINED_MODEL_ARCHIVE_LIST',
      'DetrForObjectDetection',
      'DetrForSegmentation',
      'DetrModel',
      'DetrPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_detr import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DetrConfig, DetrOnnxConfig

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_detr import DetrFeatureExtractor
    from .image_processing_detr import DetrImageProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_detr import (
        DETR_PRETRAINED_MODEL_ARCHIVE_LIST,
        DetrForObjectDetection,
        DetrForSegmentation,
        DetrModel,
        DetrPreTrainedModel,
    )

else:
  import sys

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

