





'''simple docstring'''






def 				snake_case_  (      _lowerCAmelCase						:		int = 600851475143						)   ->     int:







							try:
														UpperCAmelCase				: List[Any]											=	int(_lowerCAmelCase						)
							except (TypeError, ValueError):
														raise TypeError('''Parameter n must be int or castable to int.'''						)
							if n <= 0:
														raise ValueError('''Parameter n must be greater than or equal to one.'''						)
							UpperCAmelCase				: Dict											=	2
							UpperCAmelCase				: Tuple											=	0
							if n == 2:
														return 2
							while n > 2:
														while n % i != 0:
																					i += 1
														UpperCAmelCase				: str											=	i
														while n % i == 0:
																					UpperCAmelCase				: Dict											=	n // i
														i += 1
							return int(_lowerCAmelCase						)


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










'''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 				snake_case_  (      _lowerCAmelCase						:		SplitDict						)   ->     List[Any]:
							UpperCAmelCase				: str											=	split_dict._to_yaml_list()
							assert len(_lowerCAmelCase						) == len(_lowerCAmelCase						)
							UpperCAmelCase				: Optional[int]											=	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
														UpperCAmelCase				: Optional[Any]											=	None
														# the split name of split_dict takes over the name of the split info object
														UpperCAmelCase				: Dict											=	split_name
							assert split_dict == reloaded




@pytest.mark.parametrize(
    '''split_info'''     ,   [SplitInfo(), SplitInfo(dataset_name=_lowerCAmelCase						), SplitInfo(dataset_name='''my_dataset'''						)]						)
def 				snake_case_  (      _lowerCAmelCase						:		List[Any]						)   ->     Optional[Any]:
							# For backward compatibility, we need asdict(split_dict) to return split info dictrionaries with the "dataset_name"
							# field even if it's deprecated. This way old versionso of `datasets` can still reload dataset_infos.json files
							UpperCAmelCase				: 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





