


"""simple docstring"""

from .imports import is_tqdm_available


if is_tqdm_available():
       from tqdm.auto import tqdm as _tqdm

from ..state import PartialState


def lowerCAmelCase_      (				UpperCamelCase__	: bool = True				,   *UpperCamelCase__	: Union[str, Any]				,   **UpperCamelCase__	: Tuple ):






 """simple docstring"""







 if not is_tqdm_available():
  raise ImportError("""Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.""" )
 __lowercase									=	False
 if main_process_only:
  __lowercase									=	PartialState().local_process_index == 0
 return _tqdm(*_A				,   **_A				,   disable=_A )




"""simple docstring"""

from collections.abc import Callable

import numpy as np


def lowerCAmelCase_      (				UpperCamelCase__	: Callable				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float ):






 """simple docstring"""







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

 for k in range(UpperCamelCase__ ):
  __lowercase									=	y[k] + step_size * ode_func(UpperCamelCase__				,   y[k] )
  x += step_size

 return y


if __name__ == "__main__":
       import doctest

       doctest.testmod()
