Maybe "Take the following example::" and keeping the "This"? Otherwise it might be confusing once compiled that there is a code block in the middle of the sentence?