



"""simple docstring"""
from __future__ import annotations


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						Union[str, Any]:







  '''simple docstring'''


  if b == 0:
    return (1, 0)
  (lowercase_)								= extended_euclid(__lowerCAmelCase ,  a % b							)
  lowercase_								= a // b
  return (y, x - k * y)


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







  '''simple docstring'''


  (lowercase_)								= extended_euclid(__lowerCAmelCase ,  __lowerCAmelCase							)
  lowercase_								= na * na
  lowercase_								= ra * x * na + ra * y * na
  return (n % m + m) % m


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						Optional[int]:







  '''simple docstring'''


  (lowercase_)								= extended_euclid(__lowerCAmelCase ,  __lowerCAmelCase							)
  if b < 0:
    lowercase_								= (b % n + n) % n
  return b


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







  '''simple docstring'''


  lowercase_								= invert_modulo(__lowerCAmelCase ,  __lowerCAmelCase							), invert_modulo(__lowerCAmelCase ,  __lowerCAmelCase							)
  lowercase_								= na * na
  lowercase_								= ra * x * na + ra * y * na
  return (n % m + m) % m


if __name__ == "__main__":
   from doctest import testmod

   testmod(name="chinese_remainder_theorem", verbose=True)
   testmod(name="chinese_remainder_theorem2", verbose=True)
   testmod(name="invert_modulo", verbose=True)
   testmod(name="extended_euclid", verbose=True)






"""simple docstring"""
import os
from collections.abc import Iterator


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







  '''simple docstring'''


  for dir_path, dir_names, filenames in os.walk(__lowerCAmelCase							):
    lowercase_								= [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(__lowerCAmelCase							)[1] in (".py", ".ipynb"):
        yield os.path.join(__lowerCAmelCase ,  __lowerCAmelCase							).lstrip("""./"""							)


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase							) ->						Any:







  '''simple docstring'''


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


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						str:







  '''simple docstring'''


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


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







  '''simple docstring'''


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


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

