




from typing import TYPE_CHECKING

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


UpperCAmelCase_									=	{
    '''configuration_falcon''': ['''FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''FalconConfig'''],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase_									=	[
           '''FALCON_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''FalconForCausalLM''',
           '''FalconModel''',
           '''FalconPreTrainedModel''',
           '''FalconForSequenceClassification''',
           '''FalconForTokenClassification''',
           '''FalconForQuestionAnswering''',
       ]


if TYPE_CHECKING:
       from .configuration_falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_falcon import (
                  FALCON_PRETRAINED_MODEL_ARCHIVE_LIST,
                  FalconForCausalLM,
                  FalconForQuestionAnswering,
                  FalconForSequenceClassification,
                  FalconForTokenClassification,
                  FalconModel,
                  FalconPreTrainedModel,
              )


else:
       import sys

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








'''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=1337				,  num_examples=42				,  dataset_name='my_dataset'     )}     ),
        SplitDict({'train': SplitInfo(name='train'				,  num_bytes=1337				,  num_examples=42     )}     ),
        SplitDict({'train': SplitInfo()}     ),
    ]				,  )
def 				lowercase__   (   __lowercase						:  SplitDict     ) ->      int:



       """simple docstring"""






       __UpperCamelCase       =  split_dict._to_yaml_list()
       assert len(__lowercase     ) == len(__lowercase     )
       __UpperCamelCase       =  SplitDict._from_yaml_list(__lowercase     )
       for split_name, split_info in split_dict.items():
              # dataset_name field is deprecated, and is therefore not part of the YAML dump
              __UpperCamelCase       =  None
              # the split name of split_dict takes over the name of the split info object
              __UpperCamelCase       =  split_name
       assert split_dict == reloaded


@pytest.mark.parametrize(
    'split_info'				,  [SplitInfo(), SplitInfo(dataset_name=__lowercase     ), SplitInfo(dataset_name='my_dataset'     )]     )
def 				lowercase__   (   __lowercase						:  Dict     ) ->      Any:



       """simple docstring"""






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