



import copy
import random

from transformers import CLIPTokenizer



class      _UpperCAmelCase      (							A__  ):




     def __init__(					self			,    *a__			,    **a__):
         super().__init__(*a__			,    **a__)
         A__					=       {}




     def 		snake_case_		(					self			,    a__			,    *a__			,    **a__):
         A__					=       super().add_tokens(a__			,    *a__			,    **a__)
         if num_added_tokens == 0:
             raise ValueError(
                 F"The tokenizer already contains the token {placeholder_token}. Please pass a different"
                 ''' `placeholder_token` that is not already in the tokenizer.''')




     def 		snake_case_		(					self			,    a__			,    *a__			,    a__=1			,    **a__):
         A__					=       []
         if num_vec_per_token == 1:
             self.try_adding_tokens(a__			,    *a__			,    **a__)
             output.append(a__)
         else:
             A__					=       []
             for i in range(a__):
                 A__					=       placeholder_token + F"_{i}"
                 self.try_adding_tokens(a__			,    *a__			,    **a__)
                 output.append(a__)
        # handle cases where there is a new placeholder token that contains the current placeholder token but is larger
         for token in self.token_map:
             if token in placeholder_token:
                 raise ValueError(
                     F"The tokenizer already has placeholder token {token} that can get confused with"
                     F" {placeholder_token}keep placeholder tokens independent")
         A__					=       output




     def 		snake_case_		(					self			,    a__			,    a__=False			,    a__=1.0):
         if isinstance(a__			,    a__):
             A__					=       []
             for i in range(len(a__)):
                 output.append(self.replace_placeholder_tokens_in_text(text[i]			,    vector_shuffle=a__))
             return output
         for placeholder_token in self.token_map:
             if placeholder_token in text:
                 A__					=       self.token_map[placeholder_token]
                 A__					=       tokens[: 1 + int(len(a__) * prop_tokens_to_load)]
                 if vector_shuffle:
                     A__					=       copy.copy(a__)
                     random.shuffle(a__)
                 A__					=       text.replace(a__			,    ''' '''.join(a__))
         return text




     def __call__(					self			,    a__			,    *a__			,    a__=False			,    a__=1.0			,    **a__):
         return super().__call__(
             self.replace_placeholder_tokens_in_text(
                 a__			,    vector_shuffle=a__			,    prop_tokens_to_load=a__)			,    *a__			,    **a__			,    )




     def 		snake_case_		(					self			,    a__			,    *a__			,    a__=False			,    a__=1.0			,    **a__):
         return super().encode(
             self.replace_placeholder_tokens_in_text(
                 a__			,    vector_shuffle=a__			,    prop_tokens_to_load=a__)			,    *a__			,    **a__			,    )





# Lint as: python3
# pylint: enable=line-too-long
# pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position

_lowercase    	=		"2.13.1"

import platform

import pyarrow
from packaging import version


if version.parse(platform.python_version()) < version.parse("3.7"):
   raise ImportWarning(
       "To use `datasets`, Python>=3.7 is required, and the current version of Python doesn't match this condition."
   )

if version.parse(pyarrow.__version__).major < 8:
   raise ImportWarning(
       "To use `datasets`, the module `pyarrow>=8.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n"
       "If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`."
   )

del platform
del pyarrow
del version

from .arrow_dataset import Dataset
from .arrow_reader import ReadInstruction
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
from .combine import concatenate_datasets, interleave_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .download import *
from .features import *
from .fingerprint import disable_caching, enable_caching, is_caching_enabled, set_caching_enabled
from .info import DatasetInfo, MetricInfo
from .inspect import (
    get_dataset_config_info,
    get_dataset_config_names,
    get_dataset_infos,
    get_dataset_split_names,
    inspect_dataset,
    inspect_metric,
    list_datasets,
    list_metrics,
)
from .iterable_dataset import IterableDataset
from .load import load_dataset, load_dataset_builder, load_from_disk, load_metric
from .metric import Metric
from .splits import (
    NamedSplit,
    NamedSplitAll,
    Split,
    SplitBase,
    SplitDict,
    SplitGenerator,
    SplitInfo,
    SubSplitInfo,
    percent,
)
from .tasks import *
from .utils import *
from .utils import logging


# deprecated modules
from datasets import arrow_dataset as _arrow_dataset  # isort:skip
from datasets import utils as _utils  # isort:skip
from datasets.utils import download_manager as _deprecated_download_manager  # isort:skip

_lowercase    	=		concatenate_datasets
_lowercase    	=		DownloadConfig
_lowercase    	=		DownloadManager
_lowercase    	=		DownloadMode
_lowercase    	=		DownloadConfig
_lowercase    	=		DownloadMode
_lowercase    	=		DownloadManager

del _arrow_dataset, _utils, _deprecated_download_manager
