Update codeblock.py

added self generating blocks