human
Complete this python program:
def launch(__INSTANCE__=None, **kw):
assistant
#Here is the Python program you requested.

    """Allows you to configure log handlers from the commandline.
    Examples:
    ./pox.py log --file=pox.log,w --syslog --no-default
    ./pox.py log --*TimedRotatingFile=filename=foo.log,when=D,backupCount=5
    The handlers are most of the ones described in Python\s logging.handlers,
    and the special one --no-default, which turns off the default logging to
    stderr.
    Arguments are passed positionally by default.  A leading * makes them pass
    by keyword.
    If a --format="<str>" is specified, it is used as a format string for a
    logging.Formatter instance for all loggers created with that invocation
    of the log module.  If no loggers are created with this instantiation,
    it is used for the default logger.
    If a --format is specified, you can also specify a --datefmt="<str>"
    where the string is a strftime format string for date/time stamps.
    """
    if ('format' in kw):
        df = kw.pop('datefmt', None)
        formatter = logging.Formatter(kw['format'], datefmt=df)
        del kw['format']
        if (len(kw) == 0):
            import pox.core
            pox.core._default_log_handler.setFormatter(formatter)
    else:
        formatter = _formatter
    def standard(use_kw, v, C):
        if (v is True):
            h = C()
        else:
            v = [_parse(p) for p in v.split(',')]
            if use_kw:
                v = dict([x.split('=', 1) for x in v])
                h = C(**v)
            else:
                h = C(*v)
        h.setFormatter(formatter)
        logging.getLogger().addHandler(h)
    for (_k, v) in kw.iteritems():
        k = _k
        use_kw = k.startswith('*')
        if use_kw:
            k = k[1:]
        k = k.lower()
        if ((k == 'no_default') and v):
            import pox.core
            logging.getLogger().removeHandler(pox.core._default_log_handler)
            logging.getLogger().addHandler(logging.NullHandler())
        elif (k == 'stderr'):
            standard(use_kw, v, (lambda : logging.StreamHandler()))
        elif (k == 'stdout'):
            import sys
            standard(use_kw, v, (lambda : logging.StreamHandler(sys.stdout)))
        elif (k == 'file'):
            standard(use_kw, v, logging.FileHandler)
        elif (k == 'watchedfile'):
            standard(use_kw, v, WatchedFileHandler)
        elif (k == 'rotatingfile'):
            standard(use_kw, v, RotatingFileHandler)
        elif (k == 'timedrotatingfile'):
            standard(use_kw, v, TimedRotatingFileHandler)
        elif (k == 'socket'):
            standard(use_kw, v, SocketHandler)
        elif (k == 'datagram'):
            standard(use_kw, v, DatagramHandler)
        elif (k == 'syslog'):
            if (v is True):
                v = []
                use_kw = False
            else:
                v = [_parse(p) for p in v.split(',')]
            if use_kw:
                v = dict([x.split('=', 1) for x in v])
  ...