I know the answer is probably no, but I'm confused about something. The underlying algorithm is never copyrightable. So as long as you "learn from the code" someone else has wrote, and re-implement it, you are allowed to reuse what you learned. But isn't this the same as making a few changes to the source code, i.e. reordering things, changing names etc.? So does this mean running source code through a code obfuscater would avoid copyright infringement issues? I know it's a strange question, but I'm serious.
I'm talking about small portions of code, less than 100 lines, not whole programs.
I ask this question after having read Does copyrighted code protect intellectual property rights on novel algorithms it implements? and Algorithm (pseudo)code in academic papers -- what is the copyright/license status?