code: def update_docstrings():
      
      modules_dict = parse_readme()
      files = {}
      # update modules
      for mod in modules_dict:
          mod_file = os.path.join(modules_directory(), mod + ".py")
          with open(mod_file) as f:
              files[mod] = f.readlines()
  
      for mod in files:
          replaced = False
          done = False
          lines = False
          out = []
          quotes = None
          for row in files[mod]:
              # deal with single or double quoted docstring
              if not quotes:
                  if row.strip().startswith('"""'):
                      quotes = '"""'
                  if row.strip().startswith("'''"):
                      quotes = "'''"
              if quotes and row.strip().startswith(quotes) and not done:
                  out.append(row)
                  if not replaced:
                      out = out + [
                          "".join(_to_docstring(modules_dict[mod])).strip() + "\n"
                      ]
                      replaced = True
                  if lines:
                      done = True
                  if not done and not lines:
                      lines = True
                  continue
              if not lines or done:
                  out.append(row)
          mod_file = os.path.join(modules_directory(), mod + ".py")
          with open(mod_file, "w") as f:
              f.writelines(out)
      print_stderr("Modules updated from README.md")
docs: update the docstring of each module using info in the
      modules/README.md file