code: def main():
      
  
      parser = argparse.ArgumentParser()
      parser.add_argument("--input_dir", help="The Input file directory", default="doc_templates/")
      parser.add_argument("--output_dir", help="Where to store the processed files", default="current_docs/")
      parser.add_argument("--java_src_dir", help="Where Java snippet source files are located",
                          default="src/test/java/io/improbable/snippet/")
      parser.add_argument("--python_src_dir", help="Where Python snippet source files are located",
                          default="src/test/python/")
      parser.add_argument("--debug", action='store_true', help="Turn on script debugging")
  
      args = parser.parse_args()
      if args.debug:
          logging.basicConfig(level=logging.DEBUG)
  
      snippet_store = {}
      for_all_files_in_dir(args.java_src_dir, lambda x: read_file_snippets(args.java_src_dir + x, snippet_store))
      for_all_files_in_dir(args.python_src_dir, lambda x: read_file_snippets(args.python_src_dir + x, snippet_store))
      stripped_snippet_store = {k: strip_block_whitespace(v) for k, v in snippet_store.items()}
      printd(str(stripped_snippet_store))
      check_output_dir_exists(args.output_dir)
      for_all_in_subdirs(args.input_dir, lambda x: do_rewrites(x,
                                                               args.input_dir,
                                                               args.output_dir,
                                                               stripped_snippet_store))
docs: Parse args (expects source and dest doc directories and snippet source dir)
         read all snippets and then process the input files
         writing out the new versions to the output location