I regularly link comments in my code pointing to the source of the code I have "cribbed"

It means that future readers understand where it came from, and can look at that source to see more rationalisation about it than what I can provide.