human
Complete this python program:
def _process_commands(msg):
assistant
#Here is the Python program you requested.

    """Processes logger commands
    """
    def get(key):
        r = msg.get(key)
        if (r is not None):
            if (not isinstance(r, dict)):
                r = {None: r}
        else:
            return {}
        return r
    lowerLevels = get('lowerLevels')
    raiseLevels = get('raiseLevels')
    setLevels = get('setLevels')
    for (k, v) in lowerLevels.iteritems():
        logger = core.getLogger(k)
        level = logging._checkLevel(v)
        if (not l.isEnabledFor((level + 1))):
            logger.setLevel(v)
    for (k, v) in raiseLevels.iteritems():
        logger = core.getLogger(k)
        if (not l.isEnabledFor(v)):
            logger.setLevel(v)
    for (k, v) in setLevels.iteritems():
        logger = core.getLogger(k)
        logger.setLevel(v)
    message = msg.get('message', None)
    if message:
        level = msg.get('level', 'DEBUG')
        if isinstance(level, basestring):
            import logging
            if (not level.isalpha()):
                level = logging.DEBUG
            else:
                level = level.upper()
                level = getattr(logging, level, logging.DEBUG)
        sub = msg.get('subsystem', '<external>')
        logging.getLogger(sub).log(level, message)