As @3ventic said, sleep blocks the current thread, so every event you receive won’t get processed. This means that a PING will stay unanswered, and will result in you being disconnected. You would likely have to get into the threading module or the asyncio module.
As of writing this, I’m working on a Twitch IRC Library for python, based on asyncio. If you’re interested, you can find it here
Something else I just want to say: use snake_case for functions, as of PEP 8
~ martmists