You should never submit for assessment any work except your own .
Markers in the department routinely check assignment code for similarities between students, and run web searches to check for plagiarism in essays. The penalties for students caught doing these things are dramatic. A University regulation requires that if markers find evidence of plagiarism or copying in a students internal assessment, they are obliged to report it to Student Administration. If the evidence is confirmed, the student may forfeit the entire paper, and a permanent note to this effect may be made on their student record. Please don't force us into having to take this course of action!
Note that there are exceptions to the rule about not using someone else's code: your lecturer may require you to divide work up between the members of a team, or may have given you permission to re-use code written by someone who has no objection to such re-use (in which case you should of course acknowledge the author). But usually you are expected to produce all code yourself, and should deviate from this only when specifically allowed to.