
"""simple docstring"""






import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict





@pytest.mark.parametrize(
    '''split_dict'''		,		[
        SplitDict(),
        SplitDict({'''train''': SplitInfo(name='''train'''		,		num_bytes=13_37		,		num_examples=42		,		dataset_name='''my_dataset'''     )}     ),
        SplitDict({'''train''': SplitInfo(name='''train'''		,		num_bytes=13_37		,		num_examples=42     )}     ),
        SplitDict({'''train''': SplitInfo()}     ),
    ]		,		)
def __A						(   a_ :							SplitDict     )->							Optional[int]:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     str				= split_dict._to_yaml_list()
		assert len(a_     ) == len(a_     )
		SCREAMING_SNAKE_CASE       :     List[Any]				= SplitDict._from_yaml_list(a_     )
		for split_name, split_info in split_dict.items():
				# dataset_name field is deprecated, and is therefore not part of the YAML dump
				SCREAMING_SNAKE_CASE       :     Dict				= None
				# the split name of split_dict takes over the name of the split info object
				SCREAMING_SNAKE_CASE       :     List[str]				= split_name
		assert split_dict == reloaded





@pytest.mark.parametrize(
    '''split_info'''		,		[SplitInfo(), SplitInfo(dataset_name=a_     ), SplitInfo(dataset_name='''my_dataset'''     )]     )
def __A						(   a_ :							Dict     )->							Union[str, Any]:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     Any				= asdict(SplitDict({'''train''': split_info}     )     )
		assert "dataset_name" in split_dict_asdict["train"]
		assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name







"""simple docstring"""






from typing import TYPE_CHECKING

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


lowerCamelCase__ :       Optional[Any]						     =			{
    "configuration_funnel": ["FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig"],
    "convert_funnel_original_tf_checkpoint_to_pytorch": [],
    "tokenization_funnel": ["FunnelTokenizer"],
}

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Optional[Any]						     =			["FunnelTokenizerFast"]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Dict						     =			[
					    "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "FunnelBaseModel",
					    "FunnelForMaskedLM",
					    "FunnelForMultipleChoice",
					    "FunnelForPreTraining",
					    "FunnelForQuestionAnswering",
					    "FunnelForSequenceClassification",
					    "FunnelForTokenClassification",
					    "FunnelModel",
					    "FunnelPreTrainedModel",
					    "load_tf_weights_in_funnel",
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase__ :       Tuple						     =			[
					    "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "TFFunnelBaseModel",
					    "TFFunnelForMaskedLM",
					    "TFFunnelForMultipleChoice",
					    "TFFunnelForPreTraining",
					    "TFFunnelForQuestionAnswering",
					    "TFFunnelForSequenceClassification",
					    "TFFunnelForTokenClassification",
					    "TFFunnelModel",
					    "TFFunnelPreTrainedModel",
					]


if TYPE_CHECKING:
					from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
					from .tokenization_funnel import FunnelTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_funnel_fast import FunnelTokenizerFast

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_funnel import (
										    FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
										    FunnelBaseModel,
										    FunnelForMaskedLM,
										    FunnelForMultipleChoice,
										    FunnelForPreTraining,
										    FunnelForQuestionAnswering,
										    FunnelForSequenceClassification,
										    FunnelForTokenClassification,
										    FunnelModel,
										    FunnelPreTrainedModel,
										    load_tf_weights_in_funnel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_funnel import (
										    TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFFunnelBaseModel,
										    TFFunnelForMaskedLM,
										    TFFunnelForMultipleChoice,
										    TFFunnelForPreTraining,
										    TFFunnelForQuestionAnswering,
										    TFFunnelForSequenceClassification,
										    TFFunnelForTokenClassification,
										    TFFunnelModel,
										    TFFunnelPreTrainedModel,
										)

else:
					import sys

					lowerCamelCase__ :       Optional[int]						     =			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





