
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=1_3_3_7						,  num_examples=4_2						,  dataset_name="my_dataset"		)}		),
        SplitDict({"train": SplitInfo(name="train"						,  num_bytes=1_3_3_7						,  num_examples=4_2		)}		),
        SplitDict({"train": SplitInfo()}		),
    ]						,  )
def 		UpperCAmelCase     (      a_		)						->      List[str]:







				"""simple docstring"""



				__A       =					split_dict._to_yaml_list()
				assert len(_a		) == len(_a		)
				__A       =					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
								__A       =					None
								# the split name of split_dict takes over the name of the split info object
								__A       =					split_name
				assert split_dict == reloaded


@pytest.mark.parametrize(
    "split_info"						,  [SplitInfo(), SplitInfo(dataset_name=_a		), SplitInfo(dataset_name="my_dataset"		)]		)
def 		UpperCAmelCase     (      a_		)						->      Tuple:







				"""simple docstring"""



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



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a_      =     {
    'configuration_instructblip': [
        'INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'InstructBlipConfig',
        'InstructBlipQFormerConfig',
        'InstructBlipVisionConfig',
    ],
    'processing_instructblip': ['InstructBlipProcessor'],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			a_      =     [
			    'INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'InstructBlipQFormerModel',
			    'InstructBlipPreTrainedModel',
			    'InstructBlipForConditionalGeneration',
			    'InstructBlipVisionModel',
			]

if TYPE_CHECKING:
			from .configuration_instructblip import (
			    INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    InstructBlipConfig,
			    InstructBlipQFormerConfig,
			    InstructBlipVisionConfig,
			)
			from .processing_instructblip import InstructBlipProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_instructblip import (
						    INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
						    InstructBlipForConditionalGeneration,
						    InstructBlipPreTrainedModel,
						    InstructBlipQFormerModel,
						    InstructBlipVisionModel,
						)

else:
			import sys

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