def retype_path(<EOL>src, pyi_dir, targets, *, src_explicitly_given=False, quiet=False, hg=False<EOL>):
if src.is_dir():<EOL><INDENT>for child in src.iterdir():<EOL><INDENT>if child == pyi_dir or child == targets:<EOL><INDENT>continue<EOL><DEDENT>yield from retype_path(<EOL>child, pyi_dir / src.name, targets / src.name, quiet=quiet, hg=hg,<EOL>)<EOL><DEDENT><DEDENT>elif src.suffix == '<STR_LIT>' or src_explicitly_given:<EOL><INDENT>try:<EOL><INDENT>retype_file(src, pyi_dir, targets, quiet=quiet, hg=hg)<EOL><DEDENT>except Exception as e:<EOL><INDENT>yield (<EOL>src,<EOL>str(e),<EOL>type(e),<EOL>traceback.format_tb(e.__traceback__),<EOL>)<EOL><DEDENT><DEDENT>
Recursively retype files or directories given. Generate errors.