




'''simple docstring'''


import numpy as np
def 						snake_case_       (UpperCamelCase			:    Optional[int]					,		UpperCamelCase			:    Union[str, Any]					,		UpperCamelCase			:    Optional[Any]					,		UpperCamelCase			:    List[str]					,		UpperCamelCase			:    Dict ):





							'''simple docstring'''


							_a      	=							int(np.ceil((x_end - xa) / h ) )
							_a      	=							np.zeros((n + 1,) )
							_a      	=							ya
							_a      	=							xa

							for k in range(UpperCamelCase ):
														_a      	=							f(UpperCamelCase					,		y[k] )
														_a      	=							f(x + 0.5 * h					,		y[k] + 0.5 * h * ka )
														_a      	=							f(x + 0.5 * h					,		y[k] + 0.5 * h * ka )
														_a      	=							f(x + h					,		y[k] + h * ka )
														_a      	=							y[k] + (1 / 6) * h * (ka + 2 * ka + 2 * ka + ka)
														x += h

							return y


if __name__ == "__main__":
				import doctest

				doctest.testmod()







'''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_       (UpperCamelCase			:    SplitDict ):





							'''simple docstring'''


							_a      	=							split_dict._to_yaml_list()
							assert len(UpperCamelCase ) == len(UpperCamelCase )
							_a      	=							SplitDict._from_yaml_list(UpperCamelCase )
							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=UpperCamelCase ), SplitInfo(dataset_name='''my_dataset''' )] )
def 						snake_case_       (UpperCamelCase			:    List[str] ):





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

