Extract all Python code blocks from HTML files located in the "webpages" directory in the home folder.
Each Python snippet is enclosed in <code>...</code> tags.
Write all extracted Python snippets into a file called "all_code.py" in the home directory.
Then, count how many function definitions exist in that file and save the result to a file named "function_count.txt".