


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 							__lowercase     (				__lowerCAmelCase							:       SplitDict     ):
							a__    =  split_dict._to_yaml_list()
							assert len(__lowerCAmelCase     ) == len(__lowerCAmelCase     )
							a__    =  SplitDict._from_yaml_list(__lowerCAmelCase     )
							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=__lowerCAmelCase     ), SplitInfo(dataset_name='my_dataset'     )]     )
def 							__lowercase     (				__lowerCAmelCase							:       Union[str, Any]     ):
							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 math import ceil, sqrt






def 							__lowercase     (				__lowerCAmelCase							:       int = 1_0_0_0_0_0_0     ):
							a__    =  0

							for outer_width in range(3      ,					(limit // 4) + 2     ):
														if outer_width**2 > limit:
																					a__    =  max(ceil(sqrt(outer_width**2 - limit     )     )      ,					1     )
														else:
																					a__    =  1
														if (outer_width - hole_width_lower_bound) % 2:
																					hole_width_lower_bound += 1

														answer += (outer_width - hole_width_lower_bound - 2) // 2 + 1

							return answer


if __name__ == "__main__":
						print(f"""{solution() = }""")




