



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__snake_case       :	Dict            ={
    'configuration_bigbird_pegasus': [
        'BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BigBirdPegasusConfig',
        'BigBirdPegasusOnnxConfig',
    ],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__snake_case       :	Optional[Any]            =[
							    'BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'BigBirdPegasusForCausalLM',
							    'BigBirdPegasusForConditionalGeneration',
							    'BigBirdPegasusForQuestionAnswering',
							    'BigBirdPegasusForSequenceClassification',
							    'BigBirdPegasusModel',
							    'BigBirdPegasusPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_bigbird_pegasus import (
							    BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    BigBirdPegasusConfig,
							    BigBirdPegasusOnnxConfig,
							)

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_bigbird_pegasus import (
														    BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
														    BigBirdPegasusForCausalLM,
														    BigBirdPegasusForConditionalGeneration,
														    BigBirdPegasusForQuestionAnswering,
														    BigBirdPegasusForSequenceClassification,
														    BigBirdPegasusModel,
														    BigBirdPegasusPreTrainedModel,
														)


else:
							import sys

							__snake_case       :	str            =_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






from collections.abc import Callable

import numpy as np






def 			lowerCAmelCase__	(					lowerCamelCase_	:	Callable ,lowerCamelCase_	:	float ,lowerCamelCase_	:	float ,lowerCamelCase_	:	float ,lowerCamelCase_	:	float):





				'''simple docstring'''

				lowerCAmelCase__  :       Dict				=  int(np.ceil((x_end - xa) / step_size))
				lowerCAmelCase__  :       Any				=  np.zeros((n + 1,))
				lowerCAmelCase__  :       Union[str, Any]				=  ya
				lowerCAmelCase__  :       str				=  xa

				for k in range(lowerCamelCase_):
								lowerCAmelCase__  :       Tuple				=  y[k] + step_size * ode_func(lowerCamelCase_ ,y[k])
								lowerCAmelCase__  :       str				=  y[k] + (
								    (step_size / 2) * (ode_func(lowerCamelCase_ ,y[k]) + ode_func(x + step_size ,lowerCamelCase_))
								)
								x += step_size

				return y


if __name__ == "__main__":
							import doctest

							doctest.testmod()

