<commit_before>var Section = function(map, feature, styles, type){
  this.status = null;
  
  this.raw_feature = feature;
  this.feature = null;
  this.feature_extra = null;
  this.properties = feature.properties;
  this.map = map;
  this.styles = styles;
  this.__has_building_data = false;
  this.__been_inaugurated = false;
  this.__type = type;
  this.__length = feature.properties.length;
  
  var self = this;
  
  const STATION_INNER_LAYER = 'station_inner';
  const STATION_TOP_LAYER = 'line_hover';
   
  this.source_name = function(t,s){
    var t = t || self.__type;

    var str = t + "_";
    
    if (s){
        str += s;
    } else {
        if (self.status=='buildstart')
           str += self.status;
        else
           str += self.properties.line;
    }

    return str;
  }


  this.before_layer = function(){
    var b = self.source_name('station','buildstart');
    if (self.__type == 'station' || !self.map.getLayer(b)) b = STATION_TOP_LAYER;
    if (!self.map.getLayer(b)) b = STATION_INNER_LAYER;
    return b;
  }

  this.has_building_data = function(){
    return self.__has_building_data;
  };

  this.been_inaugurated = function(){
    return self.__been_inaugurated;
  };

  this.line = function(){
    return self.properties.line
  };

  this.type = function(){
    return self.__type;
  };

  this.length = function(){
    return round((self.__length/1000)); //in km
  };

  this.__style = function(operation,opts){
    var opts = opts || {};
    var style;
    switch (self.__type){
      case 'line':
        style = (operation == 'opening') ?
          $.extend(true,{},self.styles.line[operation]["default"],self.styles.line[operation][self.properties.line]) :
          $.extend(true,{},self.styles.line[operation]);
          
        style["line-color"] = style["color"];
        break;
      
      case 'station':
        style = (operation == 'opening') ?
          $.extend(true,{},self.styles.point[operation],self.styles.line[operation][self.properties.line]) :
          $.extend(true,{},self.styles.point[operation]);
        
        style["circle-color"] = style["color"];
         
        if (opts.source_name == STATION_INNER_LAYER) {
            style["circle-color"] = style["fillColor"];
            style["circle-radius"] = style["circle-radius"] - 3;    
        }
        
        delete style["line-width"];
        
        break;
    }
    
    delete style["labelFontColor"];    
    delete style["fillColor"];
    delete style["color"];
     
    return style;
  };

  this.draw = function(operation,batch){
    var style = self.__style(operation);
    var f_extra = null;
    var opts = {
        map:self.map,
        source_name:self.source_name(),
        feature:self.raw_feature,
        style:style,
        before_layer: self.before_layer(),
        type:self.__type
    }

    if (self.__type == 'station'){
        var extra_opts = $.extend({},opts,{
            source_name: STATION_INNER_LAYER,
            before_layer: null,
            style: self.__style(operation,{source_name: STATION_INNER_LAYER})
        });
        
        self.feature_extra = new Feature(batch,extra_opts);
    }
    
    return new Feature(batch,opts);
  };
  
  this.__update_feature = function(batch){
    if (self.feature) {
        self.feature.remove(batch);
    }
    self.feature = self.draw(self.status,batch);
  }

  this.buildstart = function(batch){
    self.status = 'buildstart';
    self.__has_building_data = true;
    self.__update_feature(batch);
  };

  this.open = function(batch){
    self.status = 'opening';
    self.__been_inaugurated = true;
    self.__update_feature(batch);
  };<commit_msg>Section: building data and ever inaugurated methods fixed<commit_after>var Section = function(map, feature, styles, type){
  this.status = null;
  
  this.raw_feature = feature;
  this.feature = null;
  this.feature_extra = null;
  this.properties = feature.properties;
  this.map = map;
  this.styles = styles;
  this.__type = type;
  this.__length = feature.properties.length;
  
  var self = this;
  
  const STATION_INNER_LAYER = 'station_inner';
  const STATION_TOP_LAYER = 'line_hover';
   
  this.source_name = function(t,s){
    var t = t || self.__type;

    var str = t + "_";
    
    if (s){
        str += s;
    } else {
        if (self.status=='buildstart')
           str += self.status;
        else
           str += self.properties.line;
    }

    return str;
  }

  this.before_layer = function(){
    var b = self.source_name('station','buildstart');
    if (self.__type == 'station' || !self.map.getLayer(b)) b = STATION_TOP_LAYER;
    if (!self.map.getLayer(b)) b = STATION_INNER_LAYER;
    return b;
  }

  this.has_building_data = function(){
    return self.properties.buildstart != null;
  };

  this.been_inaugurated = function(){
    return self.properties.opening != null;
  };

  this.line = function(){
    return self.properties.line
  };

  this.type = function(){
    return self.__type;
  };

  this.length = function(){
    return round((self.__length/1000)); //in km
  };

  this.__style = function(operation,opts){
    var opts = opts || {};
    var style;
    switch (self.__type){
      case 'line':
        style = (operation == 'opening') ?
          $.extend(true,{},self.styles.line[operation]["default"],self.styles.line[operation][self.properties.line]) :
          $.extend(true,{},self.styles.line[operation]);
          
        style["line-color"] = style["color"];
        break;
      
      case 'station':
        style = (operation == 'opening') ?
          $.extend(true,{},self.styles.point[operation],self.styles.line[operation][self.properties.line]) :
          $.extend(true,{},self.styles.point[operation]);
        
        style["circle-color"] = style["color"];
         
        if (opts.source_name == STATION_INNER_LAYER) {
            style["circle-color"] = style["fillColor"];
            style["circle-radius"] = style["circle-radius"] - 3;    
        }
        
        delete style["line-width"];
        
        break;
    }
    
    delete style["labelFontColor"];    
    delete style["fillColor"];
    delete style["color"];
     
    return style;
  };

  this.draw = function(operation,batch){
    var style = self.__style(operation);
    var f_extra = null;
    var opts = {
        map:self.map,
        source_name:self.source_name(),
        feature:self.raw_feature,
        style:style,
        before_layer: self.before_layer(),
        type:self.__type
    }

    if (self.__type == 'station'){
        var extra_opts = $.extend({},opts,{
            source_name: STATION_INNER_LAYER,
            before_layer: null,
            style: self.__style(operation,{source_name: STATION_INNER_LAYER})
        });
        
        self.feature_extra = new Feature(batch,extra_opts);
    }
    
    return new Feature(batch,opts);
  };
  
  this.__update_feature = function(batch){
    if (self.feature) {
        self.feature.remove(batch);
    }
    self.feature = self.draw(self.status,batch);
  }

  this.buildstart = function(batch){
    self.status = 'buildstart';
    self.__update_feature(batch);
  };

  this.open = function(batch){
    self.status = 'opening';
    self.__update_feature(batch);
  };
{'fraction_non_alphanumeric': 0.14482189520011002, 'fraction_numerical': 0.0013753266400770184, 'mean_word_length': 2.467811158798283, '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': '1239324', 'n_tokens_mistral': 2305, 'n_tokens_neox': 2252, 'n_words': 407}