def uri2options(uri):
    options   = []
    
    log.debug('uri      : {0}'.format(uri))
    
    # scheme
    if not uri.startswith(d.COAP_SCHEME):
        raise e.coapMalformattedUri('does not start with {0}'.format(d.COAP_SCHEME))
    
    # remove scheme
    uri       = uri.split(d.COAP_SCHEME,1)[1]
    
    # host and port
    host      = None
    port      = None
    hostPort  = uri.split('/')[0]
    if (not host) or (not port):
        # try format [aaaa::1]:1244
        m = re.match('\[([0-9a-fA-F:]+)\]:([0-9]+)',hostPort)
        if m:
            host   =     m.group(1)
            port   = int(m.group(2))
    if (not host) or (not port):
        # try format [aaaa::1]
        m = re.match('\[([0-9a-fA-F:]+)\]',hostPort)
        if m:
            host   = m.group(1)
            port   = d.DEFAULT_UDP_PORT
    if (not host) or (not port):
        # try formats:
        #    123.123.123.123:1234
        #    www.example.com:1234
        m = re.match('([0-9a-zA-Z.\-\_]+):([0-9]+)',hostPort)
        if m:
            host   =     m.group(1)
            port   = int(m.group(2))
    if (not host) or (not port):
        # try formats:
        #    123.123.123.123
        #    www.example.com
        m = re.match('([0-9a-zA-Z.\-\_]+)',hostPort)
        if m:
            host   = m.group(1)
            port   = d.DEFAULT_UDP_PORT
    if (not host) or (not port):
        raise e.coapMalformattedUri('invalid host and port {0}'.format(hostPort))
    
    # log
    log.debug('host     : {0}'.format(host))
    log.debug('port     : {0}'.format(port))
    
    # remove hostPort
    uri       = uri.split(hostPort,1)[1]
    
    # Uri-path
    paths     = [p for p in uri.split('?')[0].split('/') if p]
    log.debug('paths    : {0}'.format(paths))
    for p in paths:
        options += [o.UriPath(path=p)]
    
    # Uri-query
    if len(uri.split('?'))>1:
        queries   = [q for q in uri.split('?')[1].split('&') if q]
        log.debug('queries  : {0}'.format(queries))
        raise NotImplementedError()
    
    host=host.lower()
    host=u.trimAddress(host)
    
    return (host,port,options)
Returns the mean accuracy on the given test data and labels.
dataset/ETHPy150Open openwsn-berkeley/coap/coap/coapUri.py/uri2options--crossover with--dataset/ETHPy150Open fchollet/keras/keras/wrappers/scikit_learn.py/KerasClassifier.score