<commit_before>/*
Define an object to interact with API Umbrella Admin API
Documentation site: http://apiumbrella.io/docs/admin-api/
*/
apiUmbrellaWeb = {
  "baseUrl": Meteor.settings.api_umbrella.base_url,
  "requestHeaders": {
    "X-Api-Key": Meteor.settings.api_umbrella.api_key,
    "X-Admin-Auth-Token": Meteor.settings.api_umbrella.auth_token,
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  /*
  Get a response object from server
  return response or error
  */
  getResponseObject: function (url) {
    try {
      var response = HTTP.get(url, {
        headers: this.requestHeaders
      });
    } catch (error) {
      return error;
    }

    // If successful, return the response object
    return response;
  },
  /*
  Get a specific user from API Umbrella Admin API
  given a User ID
  return the JSON user object or error
  */
  getUser: function (userId) {
    // Set up base url with user ID
    var url = this.baseUrl + "users/" + userId;

    return this.getResponseObject(url);
  },
  /*
  Get all users from API Umbrella Admin API
  return the JSON user object or error
  */
  getUsers: function () {
    // Set up base url for users
    var url = this.baseUrl + "users/";

    return this.getResponseObject(url);
  },
  /*
  Get a specific user from API Umbrella Admin API
  given a User ID
  return the JSON user object or error
  */
  getApiBackend: function (apiBackendId) {
    // Set up base url with API Backend ID
    var url = this.baseUrl + "apis/" + apiBackendId;

    return this.getResponseObject(url);
  },
  /*
  Get all users from API Umbrella Admin API
  return the JSON user object or error
  */
  getApiBackends: function () {
    // Set up base url for users
    var url = this.baseUrl + "apis/";

    return this.getResponseObject(url);
  }
};<commit_msg>Added admin user methods. Cleanup.<commit_after>/*
Define an object to interact with API Umbrella Admin API
Documentation site: http://apiumbrella.io/docs/admin-api/
*/
apiUmbrellaWeb = {
  "baseUrl": Meteor.settings.api_umbrella.base_url,
  "requestHeaders": {
    "X-Api-Key": Meteor.settings.api_umbrella.api_key,
    "X-Admin-Auth-Token": Meteor.settings.api_umbrella.auth_token,
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  /*
  Get a response object from server
  given a request URL
  return response object
  */
  getResponseObject: function (url) {
    try {
      var response = HTTP.get(url, {
        headers: this.requestHeaders
      });
    } catch (error) {
      return error;
    }

    // If successful, return the response object
    return response;
  },
  /*
  Get a specific user given an ID
  return the JSON user object or error
  */
  getUser: function (id) {
    // Set up request url with ID
    var url = this.baseUrl + "users/" + id;

    return this.getResponseObject(url);
  },
  /*
  Get all users
  return the JSON response object
  */
  getUsers: function () {
    // Set up request url
    var url = this.baseUrl + "users/";

    return this.getResponseObject(url);
  },
  /*
  Get a specific API backend given an ID
  return the JSON response object
  */
  getApiBackend: function (id) {
    // Set up request url with ID
    var url = this.baseUrl + "apis/" + id;

    return this.getResponseObject(url);
  },
  /*
  Get all API backends
  return the JSON response object
  */
  getApiBackends: function () {
    // Set up request url
    var url = this.baseUrl + "apis/";

    return this.getResponseObject(url);
  },
  /*
  Get a specific admin account given an ID
  return the JSON response object
  */
  getAdmin: function (id) {
    // Set up request url with ID
    var url = this.baseUrl + "admins/" + id;

    return this.getResponseObject(url);
  },
  /*
  Get all admin users
  return the JSON response object
  */
  getAdmins: function () {
    // Set up request url
    var url = this.baseUrl + "admins/";

    return this.getResponseObject(url);
  }
};
{'fraction_non_alphanumeric': 0.1081149193548387, 'fraction_numerical': 0.0, 'mean_word_length': 2.6989748369058715, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, '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': '1038092', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1246, 'n_words': 404}