<commit_before>#!/usr/bin/python
# License : BSD 3-Clause
# Version :0.0.1
# Author  : <NAME>


import pynmea2, time
from flask import Flask
from flask_restful import Resource, Api, reqparse


app = Flask(__name__)
api = Api(app, prefix="/api/v1")


nmea_sentence_parser = reqparse.RequestParser()
nmea_sentence_parser.add_argument("lat", type=float, required=True, help="Input latitude coordinates")
nmea_sentence_parser.add_argument("lon", type=float, required=True, help="Input longitude coordinates")


class server_info(Resource):
    def get(self):
        info = "nmea_faker server"
        return(info, 200)

class nmea_sentence(Resource):
    def put(self):
        coordinates = nmea_sentence_parser.parse_args(strict=True)
        utc_time = time.strftime("%H%M%S", time.gmtime())
        utc_date = time.strftime("%d%m%y", time.gmtime())
 
        nmea_raw = "$GPRMC,{0},A,{2},N,{3},E,0.168,,{1},,,A".format(utc_time, utc_date, coordinates.lat, coordinates.lon)
        nmea_gprmc = pynmea2.parse(nmea_raw)
        nmea_gprmc = str(nmea_gprmc)
        return(nmea_gprmc, 201)

def run_server():
    api.add_resource(server_info, '/nmea_faker/')
    api.add_resource(nmea_sentence, '/nmea_faker/sentence')
    app.run(debug=True)

if __name__ == '__main__':
    run_server()<commit_msg>fixing info url<commit_after>#!/usr/bin/python
# License : BSD 3-Clause
# Version :0.0.1
# Author  : <NAME>


import pynmea2, time
from flask import Flask
from flask_restful import Resource, Api, reqparse


app = Flask(__name__)
api = Api(app, prefix="/api/v1")


nmea_sentence_parser = reqparse.RequestParser()
nmea_sentence_parser.add_argument("lat", type=float, required=True, help="Input latitude coordinates")
nmea_sentence_parser.add_argument("lon", type=float, required=True, help="Input longitude coordinates")


class server_info(Resource):
    def get(self):
        info = "nmea_faker server"
        return(info, 200)

class nmea_sentence(Resource):
    def put(self):
        coordinates = nmea_sentence_parser.parse_args(strict=True)
        utc_time = time.strftime("%H%M%S", time.gmtime())
        utc_date = time.strftime("%d%m%y", time.gmtime())
 
        nmea_raw = "$GPRMC,{0},A,{2},N,{3},E,0.168,,{1},,,A".format(utc_time, utc_date, coordinates.lat, coordinates.lon)
        nmea_gprmc = pynmea2.parse(nmea_raw)
        nmea_gprmc = str(nmea_gprmc)
        return(nmea_gprmc, 201)

def run_server():
    api.add_resource(server_info, '/nmea_faker')
    api.add_resource(nmea_sentence, '/nmea_faker/sentence')
    app.run(debug=True)

if __name__ == '__main__':
    run_server()
{'fraction_non_alphanumeric': 0.14296724470134875, 'fraction_numerical': 0.016184971098265895, 'mean_word_length': 4.476793248945148, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7422442', 'n_tokens_mistral': 1031, 'n_tokens_neox': 970, 'n_words': 167}