<commit_before>/**
 * Location
 *
 * @class Backbone model representing a location on the map.
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @type {Backbone.Model}
 */
var Location = Backbone.Model.extend(
    /** @lends Location */
    {
      defaults: {
        id: 0,
        campus: 'unknown',
        type: 'unknown',
        subType: null,
        shape: "point",
        text: "",
        coords: [],
        directionAware: true,
        hasIcon: false,
        pin: new google.maps.MarkerImage(
            'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkw' +
                'AAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQWIJ3tCJcAAAC/SURBVAjXNc4/jgFRAMDh3/tj8oaJKchENBRsQTZ2VCpncAFO4A' +
                'QkDqB0AYnCCfRuQGYzhUypUWzEyEp072n4TvABUNS6Hxmzqfl+Ehmz9pX6BhAlrQejZnM/7XZNKwzJ8pxVmj525/NQlwqF+SyOTadScVgrqv' +
                'W6Czwv2F8uCynh5ysMwVoBgLWiXS4joSctHE55DlI6AKR02f2OhaNykP09n+NGEHieUvxer2KZJP/p7TbhvY0jY7bv7eazfQE67zjGgilfew' +
                'AAAABJRU5ErkJggg==')
      },

      /**
       * Get google points for this location.
       *
       * @return {Array} an array of google.maps.LatLng representing the points for this location.
       */
      getGPoints: function () {
        var points = [];

        $.each(this.get("coords"), function (index, point) {
          var coord = new google.maps.LatLng(point[0], point[1]);
          points.push(coord);
        });

        return points;
      },

      /**
       * Get a generated poi-type.
       * @return {string} the poi-type
       */
      getPoiType: function () {
        return this.get('campus') + "." + this.get('type');
      }
    });

/**
 * Collection of locations.
 *
 * @class Backbone collection of Locations
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @type {Backbone.Collection}
 */
var Locations = Backbone.Collection.extend(
    /** @lends Locations */
    {
      /** The model used for this Location. */
      model: Location,
      bounds: null,
      campuses: null,
      
      /** 
       * Intercept method performed after fetch(). 
       * In this method the bounds and campuses variable are set.
       */
      parse: function(response) {
        this.bounds = response.bounds;
        this.campuses = response.campuses;
        return response.locations;
      },
  	  

      /**
       * Constructs the URL used for getting locations.
       *
       * @return {string} the URL.
       */
      url: function () {
        return 'http://pgbroker-dev.it.su.se/geo/poi';
      },

      /**
       * Filter Locations by campus.
       *
       * @param {string} campus the Campus to filter by.
       * @return {Array} an array of filtered Locations.
       */
      byCampus: function (campus) {
        return _(this.filter(function (data) {
          return data.get("campus") == campus;
        }));
      },

      /**
       * Filter Locations by type.
       *
       * @param {string} type the type to filter by.
       * @return {Array} an array of filtered Locations.
       */
      byType: function (type) {
        return _(this.filter(function (data) {
          return data.get("type") == type;
        }));
      },

      /**
       * Filter Locations by campus and types.
       *
       * @param {string} campus the Campus to filter by.
       * @param {Array} types an array of types to filter by.
       * @return {Array} an array of filtered Locations.
       */
      byCampusAndType: function (campus, types) {
        var ret = this.byCampus(campus);
        return _(ret.filter(function (data) {
          return _.contains(types, data.get("type"));
        }));
      }
    });

/**
 * A collection of searchresults for Locations.
 *
 * @class Backbone collection of Locations
 * @type {Backbone.Collection}
 */
var LocationSearchResult = Backbone.Collection.extend(
    /** @lends LocationSearchResult */
    {
      /** The model used for this collection. */
      model: Location,
      bounds: null,
      campuses: null,
      
      /** 
       * Intercept method performed after fetch(). 
       * In this method the bounds and campuses variable are set.
       */
      parse: function(response) {
        this.bounds = response.bounds;
        this.campuses = response.campuses;
        return response.locations;
      },

      /**
       * Constructs the URL used for getting search results.
       *
       * @return {string} the URL.
       */
      url: function () {
        return 'http://pgbroker-dev.it.su.se/geo/search';
      }
    });<commit_msg>Removed tab.<commit_after>/**
 * Location
 *
 * @class Backbone model representing a location on the map.
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @type {Backbone.Model}
 */
var Location = Backbone.Model.extend(
    /** @lends Location */
    {
      defaults: {
        id: 0,
        campus: 'unknown',
        type: 'unknown',
        subType: null,
        shape: "point",
        text: "",
        coords: [],
        directionAware: true,
        hasIcon: false,
        pin: new google.maps.MarkerImage(
            'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkw' +
                'AAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQWIJ3tCJcAAAC/SURBVAjXNc4/jgFRAMDh3/tj8oaJKchENBRsQTZ2VCpncAFO4A' +
                'QkDqB0AYnCCfRuQGYzhUypUWzEyEp072n4TvABUNS6Hxmzqfl+Ehmz9pX6BhAlrQejZnM/7XZNKwzJ8pxVmj525/NQlwqF+SyOTadScVgrqv' +
                'W6Czwv2F8uCynh5ysMwVoBgLWiXS4joSctHE55DlI6AKR02f2OhaNykP09n+NGEHieUvxer2KZJP/p7TbhvY0jY7bv7eazfQE67zjGgilfew' +
                'AAAABJRU5ErkJggg==')
      },

      /**
       * Get google points for this location.
       *
       * @return {Array} an array of google.maps.LatLng representing the points for this location.
       */
      getGPoints: function () {
        var points = [];

        $.each(this.get("coords"), function (index, point) {
          var coord = new google.maps.LatLng(point[0], point[1]);
          points.push(coord);
        });

        return points;
      },

      /**
       * Get a generated poi-type.
       * @return {string} the poi-type
       */
      getPoiType: function () {
        return this.get('campus') + "." + this.get('type');
      }
    });

/**
 * Collection of locations.
 *
 * @class Backbone collection of Locations
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @type {Backbone.Collection}
 */
var Locations = Backbone.Collection.extend(
    /** @lends Locations */
    {
      /** The model used for this Location. */
      model: Location,
      bounds: null,
      campuses: null,

      /**
       * Intercept method performed after fetch().
       * In this method the bounds and campuses variable are set.
       */
      parse: function (response) {
        this.bounds = response.bounds;
        this.campuses = response.campuses;
        return response.locations;
      },

      /**
       * Constructs the URL used for getting locations.
       *
       * @return {string} the URL.
       */
      url: function () {
        return 'http://pgbroker-dev.it.su.se/geo/poi';
      },

      /**
       * Filter Locations by campus.
       *
       * @param {string} campus the Campus to filter by.
       * @return {Array} an array of filtered Locations.
       */
      byCampus: function (campus) {
        return _(this.filter(function (data) {
          return data.get("campus") == campus;
        }));
      },

      /**
       * Filter Locations by type.
       *
       * @param {string} type the type to filter by.
       * @return {Array} an array of filtered Locations.
       */
      byType: function (type) {
        return _(this.filter(function (data) {
          return data.get("type") == type;
        }));
      },

      /**
       * Filter Locations by campus and types.
       *
       * @param {string} campus the Campus to filter by.
       * @param {Array} types an array of types to filter by.
       * @return {Array} an array of filtered Locations.
       */
      byCampusAndType: function (campus, types) {
        var ret = this.byCampus(campus);
        return _(ret.filter(function (data) {
          return _.contains(types, data.get("type"));
        }));
      }
    });

/**
 * A collection of searchresults for Locations.
 *
 * @class Backbone collection of Locations
 * @type {Backbone.Collection}
 */
var LocationSearchResult = Backbone.Collection.extend(
    /** @lends LocationSearchResult */
    {
      /** The model used for this collection. */
      model: Location,
      bounds: null,
      campuses: null,

      /**
       * Intercept method performed after fetch().
       * In this method the bounds and campuses variable are set.
       */
      parse: function (response) {
        this.bounds = response.bounds;
        this.campuses = response.campuses;
        return response.locations;
      },

      /**
       * Constructs the URL used for getting search results.
       *
       * @return {string} the URL.
       */
      url: function () {
        return 'http://pgbroker-dev.it.su.se/geo/search';
      }
    });
{'fraction_non_alphanumeric': 0.12141376677211738, 'fraction_numerical': 0.011999563652230828, 'mean_word_length': 2.018768521567336, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '7137715', 'n_tokens_mistral': 3061, 'n_tokens_neox': 2952, 'n_words': 663}