async def subscribe(self, *args, **kwargs):
        """
        Subscribe to channels. Channels supplied as keyword arguments expect
        a channel name as the key and a callable as the value. A channel's
        callable will be invoked automatically when a message is received on
        that channel rather than producing a message via ``listen()`` or
        ``get_message()``.
        """
        if args:
            args = list_or_args(args[0], args[1:])
        new_channels = {}
        new_channels.update(dict.fromkeys(map(self.encode, args)))
        for channel, handler in iteritems(kwargs):
            new_channels[self.encode(channel)] = handler
        ret_val = await self.execute_command('SUBSCRIBE', *iterkeys(new_channels))
        # update the channels dict AFTER we send the command. we don't want to
        # subscribe twice to these channels, once for the command and again
        # for the reconnection.
        self.channels.update(new_channels)
        return ret_val
async def subscribe ( self , * args , ** kwargs ) : if args : args = list_or_args ( args [ 0 ] , args [ 1 : ] ) new_channels = { } new_channels . update ( dict . fromkeys ( map ( self . encode , args ) ) ) for channel , handler in iteritems ( kwargs ) : new_channels [ self . encode ( channel ) ] = handler ret_val = await self . execute_command ( 'SUBSCRIBE' , * iterkeys ( new_channels ) ) self . channels . update ( new_channels ) return ret_val
Subscribe to channels. Channels supplied as keyword arguments expect
        a channel name as the key and a callable as the value. A channel's
        callable will be invoked automatically when a message is received on
        that channel rather than producing a message via ``listen()`` or
        ``get_message()``.