<commit_before>import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'countdown',
  template: '<h1>Time left: {{seconds}}</h1>'
})
export class CountdownComponent {
  // Set input field for the Component
  @Input() seconds: number;
  intervalId: number;
  // Set output delegate(event) which can be subscribed outside
  @Output() complete: EventEmitter<any> = new EventEmitter();
  // output delegate which can report the progress to outside
  @Output() progress: EventEmitter<number> = new EventEmitter();

  constructor() {
    this.intervalId = setInterval(() => this.tick(), 1000);
  }

  private tick(): void {
    if (--this.seconds < 1) {
      clearInterval(this.intervalId);
      // An event is emitted upon finishing the coundown
      this.complete.emit(null);
    }
    this.progress.emit(this.seconds);
  }
}<commit_msg>show an alternative way for setting inputs and outputs of component<commit_after>import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'countdown',
  template: '<h1>Time left: {{seconds}}</h1>',
  // an alternative way for setting inputs and outputs
  // then we can remove @Input() and @Output() decorators
  // inputs: ['seconds'],
  // outputs: ['complete', 'progress']
})
export class CountdownComponent {
  // Set input field for the Component
  @Input() seconds: number;
  intervalId: number;
  // Set output delegate(event) which can be subscribed outside
  @Output() complete: EventEmitter<any> = new EventEmitter();
  // output delegate which can report the progress to outside
  @Output() progress: EventEmitter<number> = new EventEmitter();

  constructor() {
    this.intervalId = setInterval(() => this.tick(), 1000);
  }

  private tick(): void {
    if (--this.seconds < 1) {
      clearInterval(this.intervalId);
      // An event is emitted upon finishing the coundown
      this.complete.emit(null);
    }
    this.progress.emit(this.seconds);
  }
}
{'fraction_non_alphanumeric': 0.13423831070889894, 'fraction_numerical': 0.007038712921065862, 'mean_word_length': 3.8300970873786406, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4246145', 'n_tokens_mistral': 569, 'n_tokens_neox': 560, 'n_words': 185}