If you feel it would benefit you to look at someone else’s implementation of a particular coding exercise, take notes only on the coding concepts employed while you read through their code. Do not copy the code, or part of the code, or use any cut and paste mechanisms verbatim. In your notes, write things like “They are using the Python function ‘reversed’ to reverse strings.” Once you have read through any code, use your notes to start coding in a fresh window.
If you are working with a group of students to try to understand a concept, make sure everyone understands that you will be splitting up afterward to complete the code on your own. If you end up writing code together, make it clear that you will not be using this code verbatim in your assignment.