<commit_before>import zerorpc
import json
import main

class routeData():
    def __init__(self, startLat, startLong, endLat, endLong, distance, chargerTypes):
        self.start = (startLat, startLong)
        self.end = (endLat, endLong)
        self.distance = distance
        self.chargerTypes = chargerTypes

class routeRPC(object):
    def getPossibleRoute(self, object):
        print("Calling getPossibleRoute... \n")
        obj = json.loads(object)
        sampleRoute = routeData(obj['start']['lat'], obj['start']['long'], obj['end']['lat'], obj['end']['long'], obj['distance'], obj['chargerTypes'])
        JSONresult = main.main(sampleRoute.start[0], sampleRoute.start[1], sampleRoute.end[0], sampleRoute.end[1], sampleRoute.distance, chargerTypes)
        print("getPossibleRoute returned: " + json.dumps(JSONresult) + "\n")
        return json.dumps(JSONresult)

s = zerorpc.Server(routeRPC())
s.bind("tcp://0.0.0.0:4242")
s.run()
print("Server running... \n")

#test stuff
#JSONtest = '{"start":{"lat":99,"long":0},"end":{"lat":10,"long":5},"distance": 50, "chargerTypes": [1, 2]}'
#obj = json.loads(JSONtest)

#sampleRoute = routeData(obj['start']['lat'], obj['start']['long'], obj['end']['lat'], obj['end']['long'], obj['distance'], obj['chargerTypes'])<commit_msg>I feex again<commit_after>import zerorpc
import json
import main

class routeData():
    def __init__(self, startLat, startLong, endLat, endLong, distance, chargerTypes):
        self.start = (startLat, startLong)
        self.end = (endLat, endLong)
        self.distance = distance
        self.chargerTypes = chargerTypes

class routeRPC(object):
    def getPossibleRoute(self, object):
        print("Calling getPossibleRoute... \n")
        obj = json.loads(object)
        sampleRoute = routeData(obj['start']['lat'], obj['start']['long'], obj['end']['lat'], obj['end']['long'], obj['distance'], obj['chargerTypes'])
        JSONresult = main.main(sampleRoute.start[0], sampleRoute.start[1], sampleRoute.end[0], sampleRoute.end[1], sampleRoute.distance, sampleRoute.chargerTypes)
        print("getPossibleRoute returned: " + json.dumps(JSONresult) + "\n")
        return json.dumps(JSONresult)

s = zerorpc.Server(routeRPC())
s.bind("tcp://0.0.0.0:4242")
s.run()
print("Server running... \n")

#test stuff
#JSONtest = '{"start":{"lat":99,"long":0},"end":{"lat":10,"long":5},"distance": 50, "chargerTypes": [1, 2]}'
#obj = json.loads(JSONtest)

#sampleRoute = routeData(obj['start']['lat'], obj['start']['long'], obj['end']['lat'], obj['end']['long'], obj['distance'], obj['chargerTypes'])
{'fraction_non_alphanumeric': 0.20201628538193098, 'fraction_numerical': 0.017060876308646764, 'mean_word_length': 4.890410958904109, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2717712', 'n_tokens_mistral': 853, 'n_tokens_neox': 832, 'n_words': 161}