'''simple docstring'''





import numpy as np





def      lowerCAmelCase_    ( snake_case_	:			Union[str, Any] ,   snake_case_	:			Any ,   snake_case_	:			Dict ,   snake_case_	:			Tuple ,   snake_case_	:			List[Any]      )   ->				Union[str, Any]:


     '''simple docstring'''




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

     for k in range(snake_case_      ):
          UpperCAmelCase_	   =       f(snake_case_ ,   y[k]      )
          UpperCAmelCase_	   =       f(x + 0.5 * h ,   y[k] + 0.5 * h * ka      )
          UpperCAmelCase_	   =       f(x + 0.5 * h ,   y[k] + 0.5 * h * ka      )
          UpperCAmelCase_	   =       f(x + h ,   y[k] + h * ka      )
          UpperCAmelCase_	   =       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 os
import time

import pytest

from datasets.utils.filelock import FileLock, Timeout





def      lowerCAmelCase_    ( snake_case_	:			Union[str, Any]      )   ->				Optional[int]:


     '''simple docstring'''




     UpperCAmelCase_	   =       FileLock(str(tmpdir / "foo.lock"      )      )
     UpperCAmelCase_	   =       FileLock(str(tmpdir / "foo.lock"      )      )
     UpperCAmelCase_	   =       0.01
     with locka.acquire():
          with pytest.raises(snake_case_      ):
               UpperCAmelCase_	   =       time.time()
               locka.acquire(snake_case_      )
               assert time.time() - _start > timeout






def      lowerCAmelCase_    ( snake_case_	:			int      )   ->				Optional[int]:


     '''simple docstring'''




     UpperCAmelCase_	   =       "a" * 10_00 + ".lock"
     UpperCAmelCase_	   =       FileLock(str(tmpdir / filename      )      )
     assert locka._lock_file.endswith(".lock"      )
     assert not locka._lock_file.endswith(snake_case_      )
     assert len(os.path.basename(locka._lock_file      )      ) <= 2_55
     UpperCAmelCase_	   =       FileLock(tmpdir / filename      )
     with locka.acquire():
          with pytest.raises(snake_case_      ):
               locka.acquire(0      )




