<commit_before>import { Component, ContentChild, EventEmitter } from '@angular/core';
import { AccordionContentComponent } from './content/accordion-content.component';

@Component({
  selector: 'accordion-entry',
  templateUrl: 'accordion-entry.component.html',
  styleUrls: [ 'accordion-entry.component.scss' ]
})
/**
 * The accordion entry. Needs exactly 1 header and 1 content component.
 * Can be styled depending on visible state. Parent div of the whole entry will have the css class "accordion-entry-hidden"
 */
export class AccordionEntryComponent {

  /**
   * The content of the entry
   */
  @ContentChild(AccordionContentComponent) public content : AccordionContentComponent;

  /**
   * Subscribable for click events of the entry header
   */
  public headerClicked : EventEmitter<AccordionEntryComponent> = new EventEmitter();

  /**
   * The value for the CSS height attribute
   */
  public height : string = '0';

  private timeout : any;
  private _visible : boolean = false;

  /**
   * Makes the content of the entry (in)visible with a nice animation
   */
  set visible(a : boolean) {
    if (this._visible === a) {
      // No change => do nothing
      return;
    }

    clearTimeout(this.timeout);
    if (!this.content) {
      return;
    }
    this._visible = a;
    if (a) {
      // Increase to the size of the content
      this.height = this.content.height + 'px';
      // Set auto to react to size changes of the content
      // MAGIC NUMBER WARNING: the delay must correspond with the animation duration!
      this.timeout = setTimeout(() => this.height = 'auto', 600);
    } else {
      // Set the height from auto to the actual size (needed for animation)
      this.height = this.content.height + 'px';
      // Animate to size 0
      this.timeout = setTimeout(() => this.height = '0', 20);
    }
  }

  get visible() : boolean {
    return this._visible;
  }

  /**
   * Emit new click event
   */
  public clickHeader() : void {
    this.headerClicked.next(this);
  }

}<commit_msg>fixed comment<commit_after>import { Component, ContentChild, EventEmitter } from '@angular/core';
import { AccordionContentComponent } from './content/accordion-content.component';

@Component({
  selector: 'accordion-entry',
  templateUrl: 'accordion-entry.component.html',
  styleUrls: [ 'accordion-entry.component.scss' ]
})
/**
 * The accordion entry. Needs exactly 1 header and 1 content component.
 * Can be styled depending on visible state. Parent div of the whole entry will have the css class "accordion-entry-hidden"
 */
export class AccordionEntryComponent {

  /**
   * The content of the entry
   */
  @ContentChild(AccordionContentComponent) public content : AccordionContentComponent;

  /**
   * Subscribable for click events of the entry header
   */
  public headerClicked : EventEmitter<AccordionEntryComponent> = new EventEmitter();

  /**
   * The value for the CSS height attribute
   */
  public height : string = '0';

  private timeout : any;
  private _visible : boolean = false;

  /**
   * Makes the content of the entry (in)visible with a nice animation
   */
  set visible(a : boolean) {
    if (this._visible === a) {
      // No change => do nothing
      return;
    }

    clearTimeout(this.timeout);
    if (!this.content) {
      return;
    }
    this._visible = a;
    if (a) {
      // Increase to the size of the content
      this.height = this.content.height + 'px';
      // Set auto to react to size changes of the content
      // MAGIC NUMBER WARNING: the delay should be a bit longer than the animation duration!
      this.timeout = setTimeout(() => this.height = 'auto', 600);
    } else {
      // Set the height from auto to the actual size (needed for animation)
      this.height = this.content.height + 'px';
      // Animate to size 0
      this.timeout = setTimeout(() => this.height = '0', 20);
    }
  }

  get visible() : boolean {
    return this._visible;
  }

  /**
   * Emit new click event
   */
  public clickHeader() : void {
    this.headerClicked.next(this);
  }

}
{'fraction_non_alphanumeric': 0.11327259295739965, 'fraction_numerical': 0.004924895345973898, 'mean_word_length': 2.8796561604584525, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1215510', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1161, 'n_words': 392}