<commit_before>import { Component , ContentChild, ElementRef, EventEmitter, Input, OnDestroy,
  OnInit, Output, Renderer2, TemplateRef, ViewChild} from '@angular/core';

@Component({
 selector: 'amexio-virtual-scroller',
 templateUrl: 'virtualscroller.component.html',
})
export class AmexioVirtualScrollerComponent implements OnInit, OnDestroy {

 @Input('height') height: number;

 @Input('data') data: any[];

 @Input('item-size') itemSize: number;

 @Input('window-scroll') windowScroll = true;

 @Output() onScrollDown: any = new EventEmitter<any>();

 @ContentChild('amexioBodyTmpl') bodyTemplate: TemplateRef<any>;

 @ViewChild('virtualscoller') public virtualscoller: ElementRef;

 windowscrolllistener: any;
 divscrolllistener: any;
 currentViewData: any[] = [];
 totalCount: number;
 pageSize: number;
 isOverloaded = false;
 show = true;
 newheight: string;
 constructor(private renderer: Renderer2) {
   this.newheight = '100%';
 }

 ngOnInit() {
   setTimeout(() => {
     this.pageAndTotalCountCal();
     this.initLoad();
     this.bindDocumentClickListener();
   }, 500);
 }

 // TO CALCULATE PAGE AND TOTAL SIZE
 private pageAndTotalCountCal() {
   const el = this.virtualscoller.nativeElement;
   this.height = this.windowScroll ? el.clientHeight : this.height;
   if (this.data && this.height && this.itemSize && this.data.length > 0) {
     this.totalCount = this.data.length;
     this.pageSize = Math.round(this.height / this.itemSize);
   }
   this.newheight = this.height + 'px';
 }

 // TO INIT LOAD DATA
 private initLoad() {
   if (this.currentViewData && this.currentViewData.length === 0) {
     for (let i = 0; i < this.pageSize; i++) {
       if (this.data && i < this.totalCount) {
         this.currentViewData.push(this.data[i]);
       }
     }
   }
 }
<commit_msg>vs:updated<commit_after>import { Component , ContentChild, ElementRef, EventEmitter, Input, OnDestroy,
  OnInit, Output, Renderer2, TemplateRef, ViewChild} from '@angular/core';

@Component({
 selector: 'amexio-virtual-scroller',
 templateUrl: 'virtualscroller.component.html',
})
export class AmexioVirtualScrollerComponent implements OnInit, OnDestroy {

 @Input('height') height: number;

 @Input('data') data: any[];

 @Input('item-size') itemSize: number;

 @Input('window-scroll') windowScroll = true;

 @Output() onScrollDown: any = new EventEmitter<any>();

 @ContentChild('amexioBodyTmpl') bodyTemplate: TemplateRef<any>;

 @ViewChild('virtualscoller') public virtualscoller: ElementRef;

 windowscrolllistener: any;
 divscrolllistener: any;
 currentViewData: any[] = [];
 totalCount: number;
 pageSize: number;
 isOverloaded = false;
 show = true;
 newheight: string;
 constructor(private renderer: Renderer2) {
   this.newheight = '100%';
 }

 ngOnInit() {
   setTimeout(() => {
     this.pageAndTotalCountCal();
     this.initLoad();
     this.bindDocumentClickListener();
   }, 500);
 }

 // TO CALCULATE PAGE AND TOTAL SIZE
 private pageAndTotalCountCal() {
   const el = this.virtualscoller.nativeElement;
   this.height = this.windowScroll ? el.clientHeight : this.height;
   if ( this.height === 0) {
    this.height = 450;
   }
   if (this.data && this.height && this.itemSize && this.data.length > 0) {
     this.totalCount = this.data.length;
     this.pageSize = Math.round(this.height / this.itemSize);
   }
   this.newheight = this.height + ' px';
 }

 // TO INIT LOAD DATA
 private initLoad() {
   if (this.currentViewData && this.currentViewData.length === 0) {
     for (let i = 0; i < this.pageSize; i++) {
       if (this.data && i < this.totalCount) {
         this.currentViewData.push(this.data[i]);
       }
     }
   }
 }

{'fraction_non_alphanumeric': 0.14336525307797537, 'fraction_numerical': 0.007113543091655267, 'mean_word_length': 4.021978021978022, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5934612', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1141, 'n_words': 259}