





"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


lowercase_          =		{"processing_layoutxlm": ["LayoutXLMProcessor"]}

try:
      if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_          =		["LayoutXLMTokenizer"]

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_          =		["LayoutXLMTokenizerFast"]

if TYPE_CHECKING:
      from .processing_layoutxlm import LayoutXLMProcessor

      try:
            if not is_sentencepiece_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_layoutxlm import LayoutXLMTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_layoutxlm_fast import LayoutXLMTokenizerFast

else:
      import sys

      lowercase_          =		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)









from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class     SCREAMING_SNAKE_CASE       (UpperCAmelCase				):


   def __init__(   self      :    List[str]      ,					a      :    Callable      ,					a      :    Optional[Features] = None      ,					a      :    str = None      ,					a      :    bool = False      ,					a      :    bool = False      ,					a      :    Optional[dict] = None      ,					a      :    Optional[int] = None      ,					**a      :    str      ,					)->       Tuple:





     """simple docstring"""







     super().__init__(
         features=a      ,					cache_dir=a      ,					keep_in_memory=a      ,					streaming=a      ,					num_proc=a      ,					**a      ,					)
     lowercase__           =  Generator(
         cache_dir=a      ,					features=a      ,					generator=a      ,					gen_kwargs=a      ,					**a      ,					)


   def 	SCREAMING_SNAKE_CASE_							(   self      :    Any	)->       Dict:





     """simple docstring"""







     if self.streaming:
       lowercase__           =  self.builder.as_streaming_dataset(split='train'	)
     # Build regular (map-style) dataset
     else:
       lowercase__           =  None
       lowercase__           =  None
       lowercase__           =  None
       lowercase__           =  None

       self.builder.download_and_prepare(
           download_config=a      ,					download_mode=a      ,					verification_mode=a      ,					base_path=a      ,					num_proc=self.num_proc      ,					)
       lowercase__           =  self.builder.as_dataset(
           split='train'      ,					verification_mode=a      ,					in_memory=self.keep_in_memory	)
     return dataset


