<commit_before>#!/usr/bin/env python
import os
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler

ROUTES = [
    ('/', '/var/www/doc-html')
]

class MyHandler(SimpleHTTPRequestHandler):
    def translate_path(self, path):
        print "path: " + path
	# default root -> cwd        
        root = os.getcwd()
        
        # look up routes and get root directory
        for patt, rootDir in ROUTES:
            if path.startswith(patt):                
                path = path[len(patt):]
                root = rootDir
                break
        # new path
        return os.path.join(root, path)    

if __name__ == '__main__':
    print "Start server"
    httpd = HTTPServer(('127.0.0.1', 8000), MyHandler)
    httpd.serve_forever()
    print "Started server"<commit_msg>Working server<commit_after>#!/usr/bin/env python
import os
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler

ROUTES = [
    ('/', '/var/www/doc-html')
]

class MyHandler(SimpleHTTPRequestHandler):
    def translate_path(self, path):
        print "path: " + path
	# default root -> cwd        
        root = os.getcwd()
        
        # look up routes and get root directory
        for patt, rootDir in ROUTES:
            if path.startswith(patt):                
                path = path[len(patt):]
                root = rootDir
                break
        # new path
        return os.path.join(root, path)    

if __name__ == '__main__':
    print "Start server"
    httpd = HTTPServer(('0.0.0.0', 8000), MyHandler)
    httpd.serve_forever()
    print "Started server"
{'fraction_non_alphanumeric': 0.1027190332326284, 'fraction_numerical': 0.010876132930513595, 'mean_word_length': 2.066666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '7398602', 'n_tokens_mistral': 515, 'n_tokens_neox': 501, 'n_words': 130}