<commit_before>
const commonService = require('../commonService');

/**
 * The Microsoft Academic Graph is a heterogeneous graph containing scientific publication records, citation relationships between those publications, 
 * as well as authors, institutions, journals, conferences, and fields of study. 
 * This graph is used to power experiences in Bing, Cortana, Word, and in Microsoft Academic.
 * The graph is currently being updated on a weekly basis.
 * @augments commonService
 * {@link https://westus.dev.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/565d9001ca73072048922d97|documentation}
 */
class academicKnowledge extends commonService {
    /**
     * Constructor.
     * 
     * @param {Object} obj
     * @param {string} obj.apiKey
     * @param {string} obj.endpoint
     */
    constructor({ apiKey, endpoint }) {
        super({ apiKey, endpoint });
        this.endpoints = [
            "westus.api.cognitive.microsoft.com"
        ];
    }


    /**
     * Calculate the distribution of attribute values for a set of paper entities.
     * @returns {Promise.<object>}
     */
    calcHistogram({ parameters }) {

        const operation = {
            "path": "academic/v1.0/calchistogram",
            "method": "GET",
            "operationId": "565d9001ca73072048922d97",
            "parameters": [{
                "name": "expr",
                "description": "A query expression that specifies the entities over which to calculate histograms.",
                "value": null,
                "required": true,
                "type": "queryStringParam",
                "typeName": "string"
            }, {
                "name": "model",
                "description": "Name of the model that you wish to query. Currently, the value defaults to \"latest\".\n",
                "value": "latest",
                "required": false,
                "type": "queryStringParam",<commit_msg>Add labs endpoint to academic knowledge api (#55)<commit_after>
const commonService = require('../commonService');

/**
 * The Microsoft Academic Graph is a heterogeneous graph containing scientific publication records, citation relationships between those publications, 
 * as well as authors, institutions, journals, conferences, and fields of study. 
 * This graph is used to power experiences in Bing, Cortana, Word, and in Microsoft Academic.
 * The graph is currently being updated on a weekly basis.
 * @augments commonService
 * {@link https://westus.dev.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/565d9001ca73072048922d97|documentation}
 */
class academicKnowledge extends commonService {
    /**
     * Constructor.
     * 
     * @param {Object} obj
     * @param {string} obj.apiKey
     * @param {string} obj.endpoint
     */
    constructor({ apiKey, endpoint }) {
        super({ apiKey, endpoint });
        this.endpoints = [
            "westus.api.cognitive.microsoft.com",
            "api.labs.cognitive.microsoft.com"
        ];
    }


    /**
     * Calculate the distribution of attribute values for a set of paper entities.
     * @returns {Promise.<object>}
     */
    calcHistogram({ parameters }) {

        const operation = {
            "path": "academic/v1.0/calchistogram",
            "method": "GET",
            "operationId": "565d9001ca73072048922d97",
            "parameters": [{
                "name": "expr",
                "description": "A query expression that specifies the entities over which to calculate histograms.",
                "value": null,
                "required": true,
                "type": "queryStringParam",
                "typeName": "string"
            }, {
                "name": "model",
                "description": "Name of the model that you wish to query. Currently, the value defaults to \"latest\".\n",
                "value": "latest",
                "required": false,
                "type": "queryStringParam",
{'fraction_non_alphanumeric': 0.11144578313253012, 'fraction_numerical': 0.02961847389558233, 'mean_word_length': 2.3070539419087135, 'pattern_counts': {'":': 30, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5376660', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1003, 'n_words': 317}