I've always wondered what the chances of two people writing the same chunk of code are.
On reflection, there is much convention in code (this was c IIRC), loops, indices and cordinates variables are standard. And, each level of a problem only has a few obvious ways to approach it. The same underlying algorithm - especially in a uni course about algorithms - also tends to suggest particular designs.
The eye of an octopus is striking similar to the human eye. Does that mean they are related, other than by objective?
For me, more relevant is to compare the variable names. If both code snippets have very similar variable names, then one of them is likely a copy.