I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Let me take a stab, though. Keep in mind that the text of the code does absolutely nothing until it is interpreted or compiled. Now, say your code implements a way to detect porn in an image, which is what your patent claims. By publishing the code in the patent, is Google Patents, or heck even the USPTO, making, using or selling "porn detection in images"?
A simple answer to this question is the answer to the question, "Can I submit an image to USPTO/Google Patents and get a determination of whether the image contains porn?"