'Implement function'

def func(self):

    caller = self.caller
    channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')]
    if (not channels):
        self.msg('No    channels    available.')
        return
    subs = ChannelDB.objects.get_subscriptions(caller)
    if (self.cmdstring == 'comlist'):
        comtable = evtable.EvTable('|wchannel|n', '|wmy    aliases|n', '|wdescription|n', align='l', maxwidth=_DEFAULT_WIDTH)
        for chan in subs:
            clower = chan.key.lower()
            nicks = caller.nicks.get(category='channel', return_obj=True)
            comtable.add_row(*[('%s%s' % (chan.key, ((chan.aliases.all() and ('(%s)' % ','.join(chan.aliases.all()))) or ''))), ('%s' % ','.join((nick.db_key for nick in make_iter(nicks) if (nick and (nick.value[3].lower() == clower))))), chan.db.desc])
        self.msg(('\n|wChannel    subscriptions|n    (use    |w@channels|n    to    list    all,    |waddcom|n/|wdelcom|n    to    sub/unsub):|n\n%s' % comtable))
    else:
        comtable = evtable.EvTable('|wsub|n', '|wchannel|n', '|wmy    aliases|n', '|wlocks|n', '|wdescription|n', maxwidth=_DEFAULT_WIDTH)
        for chan in channels:
            clower = chan.key.lower()
            nicks = caller.nicks.get(category='channel', return_obj=True)
            nicks = (nicks or [])
            if (chan not in subs):
                substatus = '|rNo|n'
            elif (caller in chan.mutelist):
                substatus = '|rMuted|n'
            else:
                substatus = '|gYes|n'
            comtable.add_row(*[substatus, ('%s%s' % (chan.key, ((chan.aliases.all() and ('(%s)' % ','.join(chan.aliases.all()))) or ''))), ('%s' % ','.join((nick.db_key for nick in make_iter(nicks) if (nick.value[3].lower() == clower)))), str(chan.locks), chan.db.desc])
        comtable.reformat_column(0, width=9)
        comtable.reformat_column(3, width=14)
        self.msg(('\n|wAvailable    channels|n    (use    |wcomlist|n,|waddcom|n    and    |wdelcom|n    to    manage    subscriptions):\n%s' % comtable))
