<commit_before>/**
 * The Blue Alliance API Library for node.js es6 v1.2.2
 * (c) 2014 <NAME> [FRC 3188 (2010), FRC 3636 (2011-12), FRC 1540 (2013-14)]
 * Modified by <NAME> [FRC 3135 (2015-16)]
 * License: MIT
 */

/*
  TBA API docs are at: http://www.thebluealliance.com/apidocs
*/

const req = require('superagent');

const isDefined = variable => (typeof variable !== 'undefined' && variable !== null);

// you have to set a header in order to get the request methods
class initTBA {

  constructor (name, description, version) {
    // all TBA API v2 requests go to this root uri
    this.ROOT_URL = 'http://www.thebluealliance.com/api/v2';
    this.headers = { 'X-TBA-App-Id': null };
    // set header or throw error
    if (isDefined(name) && isDefined(description) && isDefined(version)) {
      this.headers['X-TBA-App-Id'] = [name, description, version].join(':');
    } else {
      return new Error('can not set header with null or undefined values');
    }
    /*********************************************
    ****************** Aliases *******************
    **********************************************/
    this.getListOfTeams = this.getTeamList;
    this.getTeamById = this.getTeam;
    this.getEventsForTeam = this.getTeamEvents;
    this.getAwardsForTeamAtEvent = this.getTeamEventAwards;
    this.getMatchesForTeamAtEvent = this.getTeamEventMatches;
    this.getYearsParticipatedByTeam = this.getTeamYearsParticipated;
    this.getMediaForTeam = this.getTeamMedia;
    this.getEventHistoryForTeam = this.getTeamEventHistory;
    this.getAwardHistoryForTeam = this.getTeamAwardHistory;
    this.getRobotHistoryForTeam = this.getTeamRobotHistory;
    this.getDistrictHistoryForTeam = this.getTeamDistrictHistory;
    this.getListOfEvents = this.getEventList;
    this.getEventById = this.getEvent;
    this.getTeamsAtEvent = this.getEventTeams;
    this.getMatchesAtEvent = this.getEventMatches;
    this.getStatsAtEvent = this.getEventStats;
    this.getRankingsAtEvent = this.getEventRankings;
    this.getAwardsAtEvent = this.getEventAwards;
    this.getSingleMatchFromKey = this.getSingleMatch;<commit_msg>Use HTTPS in API URL<commit_after>/**
 * The Blue Alliance API Library for node.js es6 v1.2.2
 * (c) 2014 <NAME> [FRC 3188 (2010), FRC 3636 (2011-12), FRC 1540 (2013-14)]
 * Modified by <NAME> [FRC 3135 (2015-16)]
 * License: MIT
 */

/*
  TBA API docs are at: http://www.thebluealliance.com/apidocs
*/

const req = require('superagent');

const isDefined = variable => (typeof variable !== 'undefined' && variable !== null);

// you have to set a header in order to get the request methods
class initTBA {

  constructor (name, description, version) {
    // all TBA API v2 requests go to this root uri
    this.ROOT_URL = 'https://www.thebluealliance.com/api/v2';
    this.headers = { 'X-TBA-App-Id': null };
    // set header or throw error
    if (isDefined(name) && isDefined(description) && isDefined(version)) {
      this.headers['X-TBA-App-Id'] = [name, description, version].join(':');
    } else {
      return new Error('can not set header with null or undefined values');
    }
    /*********************************************
    ****************** Aliases *******************
    **********************************************/
    this.getListOfTeams = this.getTeamList;
    this.getTeamById = this.getTeam;
    this.getEventsForTeam = this.getTeamEvents;
    this.getAwardsForTeamAtEvent = this.getTeamEventAwards;
    this.getMatchesForTeamAtEvent = this.getTeamEventMatches;
    this.getYearsParticipatedByTeam = this.getTeamYearsParticipated;
    this.getMediaForTeam = this.getTeamMedia;
    this.getEventHistoryForTeam = this.getTeamEventHistory;
    this.getAwardHistoryForTeam = this.getTeamAwardHistory;
    this.getRobotHistoryForTeam = this.getTeamRobotHistory;
    this.getDistrictHistoryForTeam = this.getTeamDistrictHistory;
    this.getListOfEvents = this.getEventList;
    this.getEventById = this.getEvent;
    this.getTeamsAtEvent = this.getEventTeams;
    this.getMatchesAtEvent = this.getEventMatches;
    this.getStatsAtEvent = this.getEventStats;
    this.getRankingsAtEvent = this.getEventRankings;
    this.getAwardsAtEvent = this.getEventAwards;
    this.getSingleMatchFromKey = this.getSingleMatch;
{'fraction_non_alphanumeric': 0.16557530402245088, 'fraction_numerical': 0.02245088868101029, 'mean_word_length': 4.122155688622755, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, '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': '3174092', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1318, 'n_words': 293}