<commit_before>function layerModel(options, parent) {
    var self = this,
        $descriptionTemp;

    // properties
    self.id = options.id || null;
    self.name = options.name || null;
    self.featureAttributionName = self.name;
    self.url = options.url || null;
    self.arcgislayers = options.arcgis_layers || -1;
    self.type = options.type || null;
    self.utfurl = options.utfurl || false;
    self.legend = options.legend || false;
    self.legendVisibility = ko.observable(false);
    self.legendTitle = options.legend_title || false;
    self.legendSubTitle = options.legend_subtitle || false;
    self.themes = ko.observableArray();
    //self.attributeTitle = options.attributes ? options.attributes.title : self.name;
    self.attributes = options.attributes ? options.attributes.attributes : [];
    self.compress_attributes = options.attributes ? options.attributes.compress_attributes : false;
    self.attributeEvent = options.attributes ? options.attributes.event : [];
    self.lookupField = options.lookups ? options.lookups.field : null;
    self.lookupDetails = options.lookups ? options.lookups.details : [];
    self.color = options.color || "#ee9900";
    self.fillOpacity = options.fill_opacity || 0.0;
    self.defaultOpacity = options.opacity || 0.5;
    self.opacity = ko.observable(self.defaultOpacity);
    self.graphic = options.graphic || null;
    
    self.sharedBy = ko.observable(false);
    self.shared = ko.observable(false);
    
    if (self.featureAttributionName === 'OCS Lease Blocks') {
        self.featureAttributionName = 'OCS Lease Blocks -- DRAFT Report';
    } else if (self.featureAttributionName === 'Party & Charter Boat') {
        self.featureAttributionName = 'Party & Charter Boat Trips';
    } 
    
    // if legend is not provided, try using legend from web services 
    if ( !self.legend && self.url && (self.arcgislayers !== -1) ) {
        $.ajax({
            dataType: "jsonp",
            url: self.url.replace('/export', '/legend/?f=pjson'),
            type: 'GET',
            success: function(data) {
                $.each(data['layers'], function(i, layerobj) {
                    if (parseInt(layerobj['layerId'], 10) === parseInt(self.arcgislayers, 10)) {
                        self.legend = {'elements': []};
                        $.each(layerobj['legend'], function(j, legendobj) {
                            var swatchURL = self.url.replace('/export', '/'+self.arcgislayers+'/images/'+legendobj['url']),
                                label = legendobj['label'];
                            if (label === "") {
                                label = layerobj['layerName'];
                            }<commit_msg>adding a couple comments<commit_after>function layerModel(options, parent) {
    var self = this,
        $descriptionTemp;

    // properties
    self.id = options.id || null;
    self.name = options.name || null;
    self.featureAttributionName = self.name;
    self.url = options.url || null;
    self.arcgislayers = options.arcgis_layers || -1;
    self.type = options.type || null;
    self.utfurl = options.utfurl || false;
    self.legend = options.legend || false;
    self.legendVisibility = ko.observable(false);
    self.legendTitle = options.legend_title || false;
    self.legendSubTitle = options.legend_subtitle || false;
    self.themes = ko.observableArray();
    //self.attributeTitle = options.attributes ? options.attributes.title : self.name;
    self.attributes = options.attributes ? options.attributes.attributes : [];
    self.compress_attributes = options.attributes ? options.attributes.compress_attributes : false;
    self.attributeEvent = options.attributes ? options.attributes.event : [];
    self.lookupField = options.lookups ? options.lookups.field : null;
    self.lookupDetails = options.lookups ? options.lookups.details : [];
    self.color = options.color || "#ee9900";
    self.fillOpacity = options.fill_opacity || 0.0;
    self.defaultOpacity = options.opacity || 0.5;
    self.opacity = ko.observable(self.defaultOpacity);
    self.graphic = options.graphic || null;
    
    self.sharedBy = ko.observable(false);
    self.shared = ko.observable(false);
    
    if (self.featureAttributionName === 'OCS Lease Blocks') {
        self.featureAttributionName = 'OCS Lease Blocks -- DRAFT Report';
    } else if (self.featureAttributionName === 'Party & Charter Boat') {
        self.featureAttributionName = 'Party & Charter Boat Trips';
    } 
    
    // if legend is not provided, try using legend from web services 
    if ( !self.legend && self.url && (self.arcgislayers !== -1) ) {
        $.ajax({
            dataType: "jsonp",
            //http://ocean.floridamarine.org/arcgis/rest/services/SAFMC/SAFMC_Regulations/MapServer/legend/?f=pjson
            url: self.url.replace('/export', '/legend/?f=pjson'),
            type: 'GET',
            success: function(data) {
                $.each(data['layers'], function(i, layerobj) {
                    if (parseInt(layerobj['layerId'], 10) === parseInt(self.arcgislayers, 10)) {
                        self.legend = {'elements': []};
                        $.each(layerobj['legend'], function(j, legendobj) {
                            //http://ocean.floridamarine.org/arcgis/rest/services/SAFMC/SAFMC_Regulations/MapServer/13/images/94ed037ab533027972ba3fc4a7c9d05c
                            var swatchURL = self.url.replace('/export', '/'+self.arcgislayers+'/images/'+legendobj['url']),
                                label = legendobj['label'];
                            if (label === "") {
                                label = layerobj['layerName'];
                            }
{'fraction_non_alphanumeric': 0.136077057793345, 'fraction_numerical': 0.008756567425569177, 'mean_word_length': 2.4259148170365927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5276693', 'n_tokens_mistral': 1700, 'n_tokens_neox': 1606, 'n_words': 307}