<commit_before>CD3.Form.Select = Class.create(CD3.Widget.DropDown, {
  NAME: 'CD3.Form.Select',
  setup: function(){
    var options = this.options;
        select  = this.element;
    
    this.container  = new Element('span', {className: options.classNames.container});
    this.trigger    = new Element('a', {href: '#', className: options.classNames.trigger})
    this.span       = new Element('span');
    this.menu		    = new Element('div').hide();
    this.ul			    = new Element('ul');
    this.element    = new Element('input', {type: 'hidden', name: select.readAttribute('name'), value: select.getValue()});

    if (select.className){
      this.container.addClassName(select.className);
    }

    select.insert({
      before: this.container.insert([
        this.element,
        this.trigger.insert(this.span),
        this.menu.insert(this.ul)
      ])
    });

    if (options.topBottom){
      this.ul.insert({
        before:	new Element('span', {className: options.classNames.top}).insert(new Element('span')),
        after:	new Element('span', {className: options.classNames.bottom}).insert(new Element('span'))
      });
    }

    if (options.onChange){
      this.onChange = options.onChange;
    }

    $A(select.options).each(this.add.bind(this));
    select.selectedIndex && this.select(select.options[select.selectedIndex])
    
    if (options.length > options.scrollLimit){
      this.div.addClassName(options.classNames.scrolled);
    }

    if (options.reference){
      this.constructor.instances[Object.isString(options.reference) ? options.reference : select.name] = this;
    }

    Element.remove(select);
    delete this.options;
  },
  addObservers: function($super){
    $super();
    this.observers.push(this.menu.on('click', 'a', this.selectOption.bind(this)));
  },<commit_msg>check only if options exists<commit_after>CD3.Form.Select = Class.create(CD3.Widget.DropDown, {
  NAME: 'CD3.Form.Select',
  setup: function(){
    var options = this.options;
        select  = this.element;
    
    this.container  = new Element('span', {className: options.classNames.container});
    this.trigger    = new Element('a', {href: '#', className: options.classNames.trigger})
    this.span       = new Element('span');
    this.menu		    = new Element('div').hide();
    this.ul			    = new Element('ul');
    this.element    = new Element('input', {type: 'hidden', name: select.readAttribute('name')});

    if (select.className){
      this.container.addClassName(select.className);
    }

    select.insert({
      before: this.container.insert([
        this.element,
        this.trigger.insert(this.span),
        this.menu.insert(this.ul)
      ])
    });

    if (options.topBottom){
      this.ul.insert({
        before:	new Element('span', {className: options.classNames.top}).insert(new Element('span')),
        after:	new Element('span', {className: options.classNames.bottom}).insert(new Element('span'))
      });
    }

    if (options.onChange){
      this.onChange = options.onChange;
    }

    $A(select.options).each(this.add.bind(this));
    select.option.length > 0 && this.select(select.options[select.selectedIndex])
    
    if (options.length > options.scrollLimit){
      this.div.addClassName(options.classNames.scrolled);
    }

    if (options.reference){
      this.constructor.instances[Object.isString(options.reference) ? options.reference : select.name] = this;
    }

    Element.remove(select);
    delete this.options;
  },
  addObservers: function($super){
    $super();
    this.observers.push(this.menu.on('click', 'a', this.selectOption.bind(this)));
  },
{'fraction_non_alphanumeric': 0.16157445637214424, 'fraction_numerical': 0.0019267822736030828, 'mean_word_length': 3.09695603156708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '5863908', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1098, 'n_words': 183}