





'''simple docstring'''


import re

from filelock import FileLock


try:
 import nltk

 lowerCAmelCase :					Optional[Any] 							=True
except (ImportError, ModuleNotFoundError):
 lowerCAmelCase :					Union[str, Any] 							=False

if NLTK_AVAILABLE:
 with FileLock('''.lock''') as lock:
  nltk.download('''punkt''', quiet=True)
def 							UpperCAmelCase_  (						__lowerCamelCase : str			):
   re.sub("<n>"     ,""     ,__lowerCamelCase			)  # remove pegasus newline char
   assert NLTK_AVAILABLE, "nltk must be installed to separate newlines between sentences. (pip install nltk)"
   return "\n".join(nltk.sent_tokenize(__lowerCamelCase			)			)









'''simple docstring'''


import numpy as np
def 							UpperCAmelCase_  (						__lowerCamelCase : str     ,__lowerCamelCase : Optional[Any]     ,__lowerCamelCase : int     ,__lowerCamelCase : List[str]     ,__lowerCamelCase : List[Any]			):
   lowercase_      :Dict         =			int(np.ceil((x_end - xa) / h			)			)
   lowercase_      :Optional[int]         =			np.zeros((n + 1,)			)
   lowercase_      :Tuple         =			ya
   lowercase_      :List[str]         =			xa

   for k in range(__lowerCamelCase			):
      lowercase_      :Any         =			f(__lowerCamelCase     ,y[k]			)
      lowercase_      :Optional[Any]         =			f(x + 0.5 * h     ,y[k] + 0.5 * h * ka			)
      lowercase_      :Optional[Any]         =			f(x + 0.5 * h     ,y[k] + 0.5 * h * ka			)
      lowercase_      :Any         =			f(x + h     ,y[k] + h * ka			)
      lowercase_      :Tuple         =			y[k] + (1 / 6) * h * (ka + 2 * ka + 2 * ka + ka)
      x += h

   return y


if __name__ == "__main__":
 import doctest

 doctest.testmod()


