<commit_before>import {BrowserXhr} from "@angular/http";

import { Progress } from "../interfaces";

export class ProgressBrowserXhr implements BrowserXhr {
    public constructor(
        private browserXhr: BrowserXhr,
        private upload:any = null,
        private download:any = null) {
    }

    public build():any {
        const xhr = this.browserXhr.build();

        if(this.upload) {
            xhr.upload.addEventListener("progress", this.createProgressListener(this.upload));
        }

        if(this.download) {
            xhr.addEventListener("progress", this.createProgressListener(this.download));
        }

        return xhr;
    }

    private createProgressListener(listener: (progress:Progress) => void): (event:ProgressEvent) => void {
        return (event: ProgressEvent) => {<commit_msg>Removed redundant default values for progressBrowserXhr constructor parameters<commit_after>import {BrowserXhr} from "@angular/http";

import { Progress } from "../interfaces";

export class ProgressBrowserXhr implements BrowserXhr {
    public constructor(
        private browserXhr: BrowserXhr,
        private upload:any,
        private download:any) {
    }

    public build():any {
        const xhr = this.browserXhr.build();

        if(this.upload) {
            xhr.upload.addEventListener("progress", this.createProgressListener(this.upload));
        }

        if(this.download) {
            xhr.addEventListener("progress", this.createProgressListener(this.download));
        }

        return xhr;
    }

    private createProgressListener(listener: (progress:Progress) => void): (event:ProgressEvent) => void {
        return (event: ProgressEvent) => {
{'fraction_non_alphanumeric': 0.11209439528023599, 'fraction_numerical': 0.0, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3925622', 'n_tokens_mistral': 450, 'n_tokens_neox': 433, 'n_words': 97}