





import os
from collections.abc import Iterator





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE = "."				)							-> Iterator[str]:




    """simple docstring"""




    for dir_path, dir_names, filenames in os.walk(_SCREAMING_SNAKE_CASE				):
        _A     =							[d for d in dir_names if d != 'scripts' and d[0] not in '._']
        for filename in filenames:
            if filename == "__init__.py":
                continue
            if os.path.splitext(_SCREAMING_SNAKE_CASE				)[1] in (".py", ".ipynb"):
                yield os.path.join(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				).lstrip('./'				)





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE				)							-> Tuple:




    """simple docstring"""




    return F"{i * '  '}*" if i else "\n##"





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)							-> str:




    """simple docstring"""




    _A     =							old_path.split(os.sep				)
    for i, new_part in enumerate(new_path.split(os.sep				)				):
        if (i + 1 > len(_SCREAMING_SNAKE_CASE				) or old_parts[i] != new_part) and new_part:
            print(F"{md_prefix(_SCREAMING_SNAKE_CASE				)} {new_part.replace('_'							,     ' '				).title()}"				)
    return new_path





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE = "."				)							-> None:




    """simple docstring"""




    _A     =							''
    for filepath in sorted(good_file_paths(_SCREAMING_SNAKE_CASE				)				):
        _A,			_A     =							os.path.split(_SCREAMING_SNAKE_CASE				)
        if filepath != old_path:
            _A     =							print_path(_SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)
        _A     =							(filepath.count(os.sep				) + 1) if filepath else 0
        _A     =							F"{filepath}/{filename}".replace(' '							,     '%20'				)
        _A     =							os.path.splitext(filename.replace('_'							,     ' '				).title()				)[0]
        print(F"{md_prefix(_SCREAMING_SNAKE_CASE				)} [{filename}]({url})"				)


if __name__ == "__main__":
 print_directory_md(".")












from collections.abc import Callable





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)							-> float:




    """simple docstring"""




    _A     =							a
    _A     =							b
    if function(_SCREAMING_SNAKE_CASE				) == 0:  # one of the a or b is a root for the function
        return a
    elif function(_SCREAMING_SNAKE_CASE				) == 0:
        return b
    elif (
        function(_SCREAMING_SNAKE_CASE				) * function(_SCREAMING_SNAKE_CASE				) > 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:
        _A     =							start + (end - start) / 2.0
        while abs(start - mid				) > 10**-7:  # until precisely equals to 10^-7
            if function(_SCREAMING_SNAKE_CASE				) == 0:
                return mid
            elif function(_SCREAMING_SNAKE_CASE				) * function(_SCREAMING_SNAKE_CASE				) < 0:
                _A     =							mid
            else:
                _A     =							mid
            _A     =							start + (end - start) / 2.0
        return mid





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE				)							-> float:




    """simple docstring"""




    return x**3 - 2 * x - 5


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

 import doctest

 doctest.testmod()





