<commit_before>import os
import sys
here = sys.path[0]
sys.path.insert(0, os.path.join(here,'..'))

import threading
from   coap   import    coap, \
                        coapResource
import test_setup

class testResource(coapResource.coapResource):
    
    def __init__(self):
        # initialize parent class
        coapResource.coapResource.__init__(
            self,
            path = 'test',
        )
    
    def GET(self,options=[]):
        
        print 'GET received'
        
        respCode        = d.COAP_RC_2_05_CONTENT
        respOptions     = []
        respPayload     = '123'
        
        return (respCode,respOptions,respPayload)

# open
c = coap.coap(ipAddress='::1')

# install resource
c.addResource(testResource())

for t in threading.enumerate():
    print t.name

# let the server run<commit_msg>COAP-9. Return array of bytes, not string.<commit_after>import os
import sys
here = sys.path[0]
sys.path.insert(0, os.path.join(here,'..'))

import threading
from   coap   import    coap,                    \
                        coapResource,            \
                        coapDefines as d
import test_setup

class testResource(coapResource.coapResource):
    
    def __init__(self):
        # initialize parent class
        coapResource.coapResource.__init__(
            self,
            path = 'test',
        )
    
    def GET(self,options=[]):
        
        print 'GET received'
        
        respCode        = d.COAP_RC_2_05_CONTENT
        respOptions     = []
        respPayload     = [ord(b) for b in 'dummy response']
        
        return (respCode,respOptions,respPayload)

# open
c = coap.coap(ipAddress='::1')

# install resource
c.addResource(testResource())

for t in threading.enumerate():
    print t.name

# let the server run
{'fraction_non_alphanumeric': 0.09745293466223699, 'fraction_numerical': 0.008859357696566999, 'mean_word_length': 1.914516129032258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1310120', 'n_tokens_mistral': 549, 'n_tokens_neox': 542, 'n_words': 125}