'Return text content of a message for client channel and decoding it if json kwarg is set'

def receive(self, json=True):

    content = super(WSClient, self).receive()
    if (content and json and ('text' in content) and isinstance(content['text'], six.string_types)):
        return json_module.loads(content['text'])
    return (content.get('text', content) if content else None)
