Re: Some functions are very simple
I spy, with my little eye, someone who has absolutely no idea what the concepts of "copyright" and "licensing" mean!
Firstly, except for a few outlier cases (unless you want to bring them up), *all* of the source code you are ever going to interact with is copyrighted.
Secondly, *all* licensing *requires* that the material be copyrighted, otherwise there is nothing that *can* be licensed.
Thirdly, (ignoring courtesy, academic requirements and plain common sense) it is the licence provisions that say under what conditions the code can be copied and whether attribution is required.
Unless they state otherwise (because they can put into their books code from other people, so long as they obey the relevant licence - and that code can include code from yet other people, so long as ...) then all the code in the book is (c) O'Reilly. Your use of that code is controlled by their licence, which itself is included inside the book (and is also included, verbatim, in the online provided-for-your-convenience copy which I linked to and which Richard 12 was kind enough to copy from the book as confirmation).
Finally, at the risk of breaking your brain, even if O'Reilly decided to publish a book that contained nothing more than 200 suitable source code examples - and clearly stated which bits were copyrighted by whom - with nothing more than a contents page and a blurb on the back saying "this is a collection of other people's copyrighted source code, used under the terms of the the MIT licence, arranged so that you can learn by working your way through from start to finish" they would STILL clearly mark that book as "Copyright O'Reilly and Associates". And be totally correct in doing so.