<s> import sys <EOL> from pubnub import Pubnub as Pubnub <EOL> publish_key = len ( sys . argv ) > <NUM_LIT:1> and sys . argv [ <NUM_LIT:1> ] or '<STR_LIT>' <EOL> subscribe_key = len ( sys . argv ) > <NUM_LIT:2> and sys . argv [ <NUM_LIT:2> ] or '<STR_LIT>' <EOL> secret_key = len ( sys . argv ) > <NUM_LIT:3> and sys . argv [ <NUM_LIT:3> ] or '<STR_LIT>' <EOL> cipher_key = len ( sys . argv ) > <NUM_LIT:4> and sys . argv [ <NUM_LIT:4> ] or '<STR_LIT>' <EOL> ssl_on = len ( sys . argv ) > <NUM_LIT:5> and bool ( sys . argv [ <NUM_LIT:5> ] ) or False <EOL> pubnub = Pubnub ( publish_key = publish_key , subscribe_key = subscribe_key , <EOL> secret_key = secret_key , cipher_key = cipher_key , ssl_on = ssl_on ) <EOL> channel = '<STR_LIT>' <EOL> def callback_abc ( message , channel , real_channel ) : <EOL> print ( str ( message ) + '<STR_LIT>' + channel + '<STR_LIT:U+002CU+0020>' + real_channel ) <EOL> pubnub . unsubscribe_group ( channel_group = '<STR_LIT:abc>' ) <EOL> def callback_d ( message , channel ) : <EOL> print ( str ( message ) + '<STR_LIT>' + channel ) <EOL> def error ( message ) : <EOL> print ( "<STR_LIT>" + str ( message ) ) <EOL> def connect_abc ( message ) : <EOL> print ( "<STR_LIT>" + str ( message ) ) <EOL> def connect_d ( message ) : <EOL> print ( "<STR_LIT>" + str ( message ) ) <EOL> pubnub . unsubscribe ( channel = '<STR_LIT:d>' ) <EOL> def reconnect ( message ) : <EOL> print ( "<STR_LIT>" + str ( message ) ) <EOL> def disconnect ( message ) : <EOL> print ( "<STR_LIT>" + str ( message ) ) <EOL> print ( pubnub . channel_group_add_channel ( channel_group = '<STR_LIT:abc>' , channel = "<STR_LIT:b>" ) ) <EOL> pubnub . subscribe_group ( channel_groups = '<STR_LIT:abc>' , callback = callback_abc , error = error , <EOL> connect = connect_abc , reconnect = reconnect , disconnect = disconnect ) <EOL> pubnub . subscribe ( channels = '<STR_LIT:d>' , callback = callback_d , error = error , <EOL> connect = connect_d , reconnect = reconnect , disconnect = disconnect ) <EOL> pubnub . start ( ) </s>
