





'''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


'''simple docstring'''







import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


__lowerCAmelCase         =    HUGGINGFACE_HUB_CACHE


__lowerCAmelCase         =    """config.json"""
__lowerCAmelCase         =    """diffusion_pytorch_model.bin"""
__lowerCAmelCase         =    """diffusion_flax_model.msgpack"""
__lowerCAmelCase         =    """model.onnx"""
__lowerCAmelCase         =    """diffusion_pytorch_model.safetensors"""
__lowerCAmelCase         =    """weights.pb"""
__lowerCAmelCase         =    """https://huggingface.co"""
__lowerCAmelCase         =    default_cache_path
__lowerCAmelCase         =    """diffusers_modules"""
__lowerCAmelCase         =    os.getenv("""HF_MODULES_CACHE""", os.path.join(hf_cache_home, """modules"""))
__lowerCAmelCase         =    ["""fp16""", """non-ema"""]
__lowerCAmelCase         =    """.self_attn"""



