gevent library documentation suggests to use gevent.monkey.patch_all() function to make standard library modules cooperative. 
As I understand this method only works for my code (written by me), because I can explicitly monkey-patch standard library before importing standard library modules. 
What about third-party libraries (websocket client for example), which import threading, socket modules internally. Is there a way for this libraries to use patched version of threading and socket modules ?
Monkey patch at the earliest possible moment in your code (i.e. before any of your third party modules have been imported).
Then, when the third party modules are imported, they will use the monkey-patched versions of the standard libraries.
gevent.patch_all() and third-party libraries