<commit_before>import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { RequestOptions, URLSearchParams } from '@angular/http';

import * as moment from 'moment';
import '../../rxjs-operators';
import { HttpClientService, SetupService } from '.';
import { Event, Group } from '../models';

@Injectable()
export class ApiService {
  constructor(private http: HttpClientService, private setupService: SetupService) {
  }

  getEventMaps(eventId: string) {
    const url = `${process.env.ECHECK_API_ENDPOINT}/events/${eventId}/eventmaps`;
    return this.http.get(url)
                    .map(res => Event.fromJsons(res.json()))
                    .catch(this.handleError);
  }

  getEvent(eventId: string) {
    const url = `${process.env.ECHECK_API_ENDPOINT}/events/${eventId}`;
    return this.http.get(url)
                    .map(res => Event.fromJson(res.json()))
                    .catch(this.handleError);
  }

  getEvents(startDate: any, endDate: any, site?: number) {
    const url = `${process.env.ECHECK_API_ENDPOINT}/events`;
    if (!site) { site = this.getSite(); }
    let formattedStartDate = moment(startDate, 'YYYY-MM-DD').format('YYYY-MM-DD');
    let formattedEndDate = moment(endDate, 'YYYY-MM-DD').format('YYYY-MM-DD');
    let options = new RequestOptions({
        search: new URLSearchParams(`site=${site}&startDate=${formattedStartDate}&endDate=${formattedEndDate}`)
    });
    return this.http.get(url, options)
                    .map(res => res.json())
                    .catch(this.handleError);<commit_msg>change redundant endpoint<commit_after>import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { RequestOptions, URLSearchParams } from '@angular/http';

import * as moment from 'moment';
import '../../rxjs-operators';
import { HttpClientService, SetupService } from '.';
import { Event, Group } from '../models';

@Injectable()
export class ApiService {
  constructor(private http: HttpClientService, private setupService: SetupService) {
  }

  getEventMaps(eventId: string) {
    const url = `${process.env.ECHECK_API_ENDPOINT}/events/${eventId}/maps`;
    return this.http.get(url)
                    .map(res => Event.fromJsons(res.json()))
                    .catch(this.handleError);
  }

  getEvent(eventId: string) {
    const url = `${process.env.ECHECK_API_ENDPOINT}/events/${eventId}`;
    return this.http.get(url)
                    .map(res => Event.fromJson(res.json()))
                    .catch(this.handleError);
  }

  getEvents(startDate: any, endDate: any, site?: number) {
    const url = `${process.env.ECHECK_API_ENDPOINT}/events`;
    if (!site) { site = this.getSite(); }
    let formattedStartDate = moment(startDate, 'YYYY-MM-DD').format('YYYY-MM-DD');
    let formattedEndDate = moment(endDate, 'YYYY-MM-DD').format('YYYY-MM-DD');
    let options = new RequestOptions({
        search: new URLSearchParams(`site=${site}&startDate=${formattedStartDate}&endDate=${formattedEndDate}`)
    });
    return this.http.get(url, options)
                    .map(res => res.json())
                    .catch(this.handleError);
{'fraction_non_alphanumeric': 0.15602390688895879, 'fraction_numerical': 0.0, 'mean_word_length': 3.2456608811748997, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5443872', 'n_tokens_mistral': 970, 'n_tokens_neox': 965, 'n_words': 187}