
"""simple docstring"""

from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream

class __lowerCAmelCase		(				__SCREAMING_SNAKE_CASE      ):





     def __init__(     self     ,					__UpperCAmelCase     ,					__UpperCAmelCase = None     ,					__UpperCAmelCase = None     ,					__UpperCAmelCase = False     ,					__UpperCAmelCase = False     ,					__UpperCAmelCase = None     ,					__UpperCAmelCase = None     ,					**__UpperCAmelCase     ,					):

      '''simple docstring'''




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







     def 						UpperCAmelCase (     self				):

      '''simple docstring'''




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

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





"""simple docstring"""

import warnings

from ...utils import logging
from .image_processing_donut import DonutImageProcessor


UpperCamelCase     :    Optional[int]       =			logging.get_logger(__name__)

class __lowerCAmelCase		(				__SCREAMING_SNAKE_CASE      ):





     def __init__(     self     ,					*__UpperCAmelCase     ,					**__UpperCAmelCase				):

      '''simple docstring'''




      warnings.warn(
          'The class DonutFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'
          ' use DonutImageProcessor instead.'     ,					__UpperCAmelCase     ,					)
      super().__init__(*__UpperCAmelCase     ,					**__UpperCAmelCase				)



