I got to mark an assignment at uni that I'd also done. There seemed to be just three different versions that were "obviously" copied... then I saw one identical with mine! With just wminor differences. I hadn't copied, and I couldn't see how they could have copied mine.
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?
This could be an investigation work to get hard data. From personal experience would say that exist many cases where a given code can only be written in a given manner. On other cases, people simply copied the code many years ago and never again know where it can be found.
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.
I've found a couple of Chinese companies offering compiled versions of my open source code before...They would change the class names and stuff but keep all the interface methods the same so it was pretty easy to figure out what they had done.
Yes. Found this once on the code from a Chinese developer. Really made a big effort to rewrite the code but then the comments were done in a too perfect English that made it obvious as copied from elsewhere.