<commit_before>// Util functions

function isFloat(n){
  return Number(n) === n && n % 1 !== 0;
}

function secondsToStringFR(seconds)
{
  var sentence = "";
  var numyears = Math.floor(seconds / 31536000);
  var numdays = Math.floor((seconds % 31536000) / 86400);
  var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
  var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
  var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;
  var sentence = "";
  if (numyears > 0) {
    sentence = sentence + numyears + " ans ";
  }
  if (numdays > 0) {
    sentence = sentence + numdays + " jours ";
  }
  if (numhours > 0) {
    sentence = sentence + numhours + " heures ";
  }
  if (numminutes > 0) {
    sentence = sentence + numminutes + " minutes ";
  }
  return sentence;
}

function metersToKmString(meters) {
  return Math.round( (meters / 1000) * 10 ) / 10;
}

var Point = function(lat, lon, rank, kind) {
  this.lat = lat;
  this.lon = lon;
  this.rank = rank;
  this.kind = kind;
  this.arrayValue = function() {
    return [this.lat, this.lon];
  }
}

var TripDrawing = function() {
  var self = this;

  self.init = function(aRouting, aPointArray) {
    self.totalDistance = 0.0;
    self.totalTime = 0.0;
    self.maxRank = 99;
    self.points = [];
    self.routing = aRouting;
    if (self.hasAFirstLatLon(aPointArray)) {
      self.points = aPointArray;
      self.renderRouting();
    }
    self.observeGeonameChanges();
    self.manageCocoonEvents();
    self.observeAndGetRouteInfo();
  }

  self.observeGeonameChanges = function() {
    $(".trip_points_lon input").change(self.updateOrCreatePoint);
  }

  self.manageCocoonEvents = function() {
    $("#steps")<commit_msg>code review<commit_after>// Util functions

function isFloat(n){
  return Number(n) === n && n % 1 !== 0;
}

function secondsToStringFR(seconds)
{
  var sentence = "";
  var numyears = Math.floor(seconds / 31536000);
  var numdays = Math.floor((seconds % 31536000) / 86400);
  var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
  var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
  var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;

  if (numyears > 0) {
    sentence = sentence + numyears + " ans ";
  }
  if (numdays > 0) {
    sentence = sentence + numdays + " jours ";
  }
  if (numhours > 0) {
    sentence = sentence + numhours + " heures ";
  }
  if (numminutes > 0) {
    sentence = sentence + numminutes + " minutes ";
  }
  return sentence;
}

function metersToKmString(meters) {
  return Math.round( (meters / 1000) * 10 ) / 10;
}

var Point = function(lat, lon, rank, kind) {
  this.lat = lat;
  this.lon = lon;
  this.rank = rank;
  this.kind = kind;
  this.arrayValue = function() {
    return [this.lat, this.lon];
  };
}

var TripDrawing = function() {
  var self = this;

  self.init = function(aRouting, aPointArray) {
    self.totalDistance = 0.0;
    self.totalTime = 0.0;
    self.maxRank = 99;
    self.points = [];
    self.routing = aRouting;
    if (self.hasAFirstLatLon(aPointArray)) {
      self.points = aPointArray;
      self.renderRouting();
    }
    self.observeGeonameChanges();
    self.manageCocoonEvents();
    self.observeAndGetRouteInfo();
  }

  self.observeGeonameChanges = function() {
    $(".trip_points_lon input").change(self.updateOrCreatePoint);
  }

  self.manageCocoonEvents = function() {
    $("#steps")
{'fraction_non_alphanumeric': 0.15216758801280186, 'fraction_numerical': 0.05586267093395403, 'mean_word_length': 3.10752688172043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2541542', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1207, 'n_words': 270}