






# this script reports modified .py files under the desired list of top-level sub-dirs passed as a list of arguments, e.g.:
#   python ./utils/get_modified_files.py utils src tests examples
#
# it uses git to find the forking point and which files were modified - i.e. files not under git won't be considered
# since the output of this script is fed into Makefile commands it doesn't print a newline after the results

import re
import subprocess
import sys


a__       =     subprocess.check_output("""git merge-base main HEAD""".split()).decode("""utf-8""")
a__       =     (
    subprocess.check_output(F'''git diff --diff-filter=d --name-only {fork_point_sha}'''.split()).decode("""utf-8""").split()
)

a__       =     """|""".join(sys.argv[1:])
a__       =     re.compile(rF'''^({joined_dirs}).*?\.py$''')

a__       =     [x for x in modified_files if regex.match(x)]
print(""" """.join(relevant_modified_files), end="""""")








from collections.abc import Callable

def _UpperCAmelCase   (	a						:	Callable[[float], float]  ,					a						:	float  ,					a						:	float ):
							snake_case__	  =       a
							snake_case__	  =       b
							if function(a ) == 0:  # one of the a or b is a root for the function
														return a
							elif function(a ) == 0:
														return b
							elif (
							    function(a ) * function(a ) > 0
							):  # if none of these are root and they are both positive or negative,
														# then this algorithm can't find the root
														raise ValueError("""could not find root in given interval.""" )
							else:
														snake_case__	  =       start + (end - start) / 2.0
														while abs(start - mid ) > 10**-7:  # until precisely equals to 10^-7
																					if function(a ) == 0:
																												return mid
																					elif function(a ) * function(a ) < 0:
																												snake_case__	  =       mid
																					else:
																												snake_case__	  =       mid
																					snake_case__	  =       start + (end - start) / 2.0
														return mid

def _UpperCAmelCase   (	a						:	float ):
							return x**3 - 2 * x - 5


if __name__ == "__main__":
	print(bisection(f, 1, 1_0_0_0))

	import doctest

	doctest.testmod()
