def subscribe(self, args):
    "\n        #**\n        #* Subscribe\n        #*\n        #* This is BLOCKING.\n        #* Listen for a message on a channel.\n        #*\n        #* @param array args with channel and callback.\n        #* @return false on fail, array on success.\n        #**\n\n        ## Subscribe Example\n        def receive(message) :\n            print(message)\n            return True\n\n        pubnub.subscribe({\n            'channel'  : 'hello_world',\n            'callback' : receive \n        })\n\n        "
    if (not ('channel' in args)):
        raise Exception('Missing Channel.')
        return False
    if (not ('callback' in args)):
        raise Exception('Missing Callback.')
        return False
    channel = str(args['channel'])
    callback = args['callback']
    subscribe_key = (args.get('subscribe_key') or self.subscribe_key)
    while True:
        timetoken = ((('timetoken' in args) and args['timetoken']) or 0)
        try:
            response = self._request((self._encode(['subscribe', subscribe_key, channel, '0', str(timetoken)]) + [('?uuid=' + self.uuid)]), encode=False)
            messages = response[0]
            args['timetoken'] = response[1]
            if (not len(messages)):
                continue
            for message in messages:
                if (not callback(message)):
                    return
        except Exception:
            time.sleep(1)
    return True
#**
#* Subscribe
#*
#* This is BLOCKING.
#* Listen for a message on a channel.
#*
#* @param array args with channel and callback.
#* @return false on fail, array on success.
#**

## Subscribe Example
def receive(message) :
    print(message)
    return True

pubnub.subscribe({
    'channel'  : 'hello_world',
    'callback' : receive 
})
def subscribe(self, args):
    "\n        #**\n        #* Subscribe\n        #*\n        #* This is BLOCKING.\n        #* Listen for a message on a channel.\n        #*\n        #* @param array args with channel and callback.\n        #* @return false on fail, array on success.\n        #**\n\n        ## Subscribe Example\n        def receive(message) :\n            print(message)\n            return True\n\n        pubnub.subscribe({\n            'channel'  : 'hello_world',\n            'callback' : receive \n        })\n\n        "
    if (not ('channel' in args)):
        raise Exception('Missing Channel.')
        return False
    if (not ('callback' in args)):
        raise Exception('Missing Callback.')
        return False
    channel = str(args['channel'])
    callback = args['callback']
    subscribe_key = (args.get('subscribe_key') or self.subscribe_key)
    while True:
        timetoken = ((('timetoken' in args) and args['timetoken']) or 0)
        try:
            response = self._request((self._encode(['subscribe', subscribe_key, channel, '0', str(timetoken)]) + [('?uuid=' + self.uuid)]), encode=False)
            messages = response[0]
            args['timetoken'] = response[1]
            if (not len(messages)):
                continue
            for message in messages:
                if (not callback(message)):
                    return
        except Exception:
            time.sleep(1)
    return True