<commit_before>import os
from .utils import *
import simplekml
import time


def sendDemoKmlToLG(fileName):
    millis = int(round(time.time() * 1000))
    command = "echo 'http://" + getDjangoIp() + ":8000/static/demos/" + fileName + "?a=" + str(millis) + \
              "' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + " 'cat - > /var/www/html/kmls.txt'"
    os.system(command)


def sendKmlToLG(fileName):
    millis = int(round(time.time() * 1000))
    command = "echo 'http://" + getDjangoIp() + ":8000/static/kmls/" + fileName + "?a=" + str(millis) + \
              "' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + " 'cat - > /var/www/html/kmls.txt'"
    os.system(command)


def sendFlyToToLG(lat, lon, altitude, heading, tilt, pRange, duration):
    flyTo = "flytoview=<LookAt>" \
            + "<longitude>" + str(lon) + "</longitude>" \
            + "<latitude>" + str(lat) + "</latitude>" \
            + "<altitude>"+str(altitude)+"</altitude>" \
            + "<heading>"+str(heading)+"</heading>" \
            + "<tilt>"+str(tilt)+"</tilt>" \
            + "<range>"+str(pRange)+"</range>" \
            + "<altitudeMode>relativeToGround</altitudeMode>" \
            + "<gx:altitudeMode>relativeToGround</gx:altitudeMode>" \
            + "<gx:duration>"+str(duration)+"</gx:duration>" \
            + "</LookAt>"

    command = "echo '" + flyTo + "' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + " 'cat - > /tmp/query.txt'"
    os.system(command)


def playTour(tourName):
    command = "echo 'playtour="+tourName+"' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + \
              " 'cat - > /tmp/query.txt'"<commit_msg>Stop a tour before playing a new one<commit_after>import os
from .utils import *
import simplekml
import time


def sendDemoKmlToLG(fileName):
    millis = int(round(time.time() * 1000))
    command = "echo 'http://" + getDjangoIp() + ":8000/static/demos/" + fileName + "?a=" + str(millis) + \
              "' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + " 'cat - > /var/www/html/kmls.txt'"
    os.system(command)


def sendKmlToLG(fileName):
    millis = int(round(time.time() * 1000))
    command = "echo 'http://" + getDjangoIp() + ":8000/static/kmls/" + fileName + "?a=" + str(millis) + \
              "' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + " 'cat - > /var/www/html/kmls.txt'"
    os.system(command)


def sendFlyToToLG(lat, lon, altitude, heading, tilt, pRange, duration):
    flyTo = "flytoview=<LookAt>" \
            + "<longitude>" + str(lon) + "</longitude>" \
            + "<latitude>" + str(lat) + "</latitude>" \
            + "<altitude>"+str(altitude)+"</altitude>" \
            + "<heading>"+str(heading)+"</heading>" \
            + "<tilt>"+str(tilt)+"</tilt>" \
            + "<range>"+str(pRange)+"</range>" \
            + "<altitudeMode>relativeToGround</altitudeMode>" \
            + "<gx:altitudeMode>relativeToGround</gx:altitudeMode>" \
            + "<gx:duration>"+str(duration)+"</gx:duration>" \
            + "</LookAt>"

    command = "echo '" + flyTo + "' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + " 'cat - > /tmp/query.txt'"
    os.system(command)


def playTour(tourName):
    stopTour()
    time.sleep(2)
    command = "echo 'playtour="+tourName+"' | sshpass -p "+getLGPass()+" ssh lg@" + getLGIp() + \
              " 'cat - > /tmp/query.txt'"
{'fraction_non_alphanumeric': 0.21686390532544378, 'fraction_numerical': 0.009763313609467455, 'mean_word_length': 2.647249190938511, 'pattern_counts': {'":': 4, '<': 43, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6328296', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1208, 'n_words': 212}