A library isn't just code that happens to be in a separate file. Someone chose an abstraction layer at which to create a library, wrote the library code, tested it and wrote documentation.
If you went and copy-pasted some code on stack overflow into a file, put it on github and released it as a "library", I might not agree that it was one.