<commit_before>import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';


import { PypiPackage } from './package.model';

@Injectable()
export class PackageService {
  private pypiUrl = 'http://pypi.python.org/pypi';

  constructor(private http: Http) { }

  getPackages(packages: Array<string>): Observable<PypiPackage> {
    const packageObservables = packages.map((packageName: string) => {
      return this.http.get(`${this.pypiUrl}/${packageName}/json`);
    });

    return Observable.merge(...packageObservables)
      .map((res: Response) => <PypiPackage>res.json())
      .catch(this.handleError);
  }

  private handleError(error) {
    const msg = `Status code {error.status} on url {error.url}`;
    console.error(msg);
    return Observable.throw(msg);
  }

}
<commit_msg>Set https on API fetching.<commit_after>import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';


import { PypiPackage } from './package.model';

@Injectable()
export class PackageService {
  private pypiUrl = 'https://pypi.python.org/pypi';

  constructor(private http: Http) { }

  getPackages(packages: Array<string>): Observable<PypiPackage> {
    const packageObservables = packages.map((packageName: string) => {
      return this.http.get(`${this.pypiUrl}/${packageName}/json`);
    });

    return Observable.merge(...packageObservables)
      .map((res: Response) => <PypiPackage>res.json())
      .catch(this.handleError);
  }

  private handleError(error) {
    const msg = `Status code {error.status} on url {error.url}`;
    console.error(msg);
    return Observable.throw(msg);
  }

}

{'fraction_non_alphanumeric': 0.15844027640671274, 'fraction_numerical': 0.0, 'mean_word_length': 4.251295336787565, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 1, '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': '2485374', 'n_tokens_mistral': 660, 'n_tokens_neox': 641, 'n_words': 130}