Earlier quoted context omitted.
if you train yourself by looking at GPL code then go implement your own things, is that code GPL?
it can be, depending on if it is different enough to convince a jury that it is not a copyright violation. See the lawsuits from Marvin Gaye's family to see how that can be unpredictable.
`if __name__ == "__main__":`
I have no idea where that line first appeared, so figuring out what license it was originally written under would be difficult to track down, and most software only has license info at the file rather than line level.