I am lucky to have found this Debian package https://tracker.debian.org/pkg/similarity-tester (source https://dickgrune.com/Programs/similarity_tester/ ) to help me detect plagiarism in my students's C++ code. The tool is perfect as it gives side by side comparison of codes to help see if there's a really an issue. Usually, it is easy to confirm by spotting specific constructions or even the positions of punctuation in code. I have found something for Python though.