def update_docstrings():
modules_dict = parse_readme()<EOL>files = {}<EOL>for mod in modules_dict:<EOL><INDENT>mod_file = os.path.join(modules_directory(), mod + "<STR_LIT>")<EOL>with open(mod_file) as f:<EOL><INDENT>files[mod] = f.readlines()<EOL><DEDENT><DEDENT>for mod in files:<EOL><INDENT>replaced = False<EOL>done = False<EOL>lines = False<EOL>out = []<EOL>quotes = None<EOL>for row in files[mod]:<EOL><INDENT>if not quotes:<EOL><INDENT>if row.strip().startswith('<STR_LIT>'):<EOL><INDENT>quotes = '<STR_LIT>'<EOL><DEDENT>if row.strip().startswith("<STR_LIT>"):<EOL><INDENT>quotes = "<STR_LIT>"<EOL><DEDENT><DEDENT>if quotes and row.strip().startswith(quotes) and not done:<EOL><INDENT>out.append(row)<EOL>if not replaced:<EOL><INDENT>out = out + [<EOL>"<STR_LIT>".join(_to_docstring(modules_dict[mod])).strip() + "<STR_LIT:\n>"<EOL>]<EOL>replaced = True<EOL><DEDENT>if lines:<EOL><INDENT>done = True<EOL><DEDENT>if not done and not lines:<EOL><INDENT>lines = True<EOL><DEDENT>continue<EOL><DEDENT>if not lines or done:<EOL><INDENT>out.append(row)<EOL><DEDENT><DEDENT>mod_file = os.path.join(modules_directory(), mod + "<STR_LIT>")<EOL>with open(mod_file, "<STR_LIT:w>") as f:<EOL><INDENT>f.writelines(out)<EOL><DEDENT><DEDENT>print_stderr("<STR_LIT>")<EOL>
update the docstring of each module using info in the
modules/README.md file