{"size": 393, "ext": "js", "max_stars_repo_path": "backend/data/controllers/gov_entities.js", "max_stars_repo_name": "Abjiri/DataGen", "max_stars_repo_stars_event_min_datetime": "2021-06-27T21:48:26.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-05T03:13:00.000Z", "max_issues_repo_path": "backend/data/controllers/gov_entities.js", "max_issues_repo_name": "Jcc20/DataGen", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend/data/controllers/gov_entities.js", "max_forks_repo_name": "Jcc20/DataGen", "max_forks_repo_forks_event_min_datetime": "2021-06-29T01:12:58.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-30T22:07:35.000Z"}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 28.0714285714, "max_line_length": 68, "alphanum_fraction": 0.6844783715}
const entitiesJS = require('../datasets/gov_entities.js');
const entities = entitiesJS.gov_entities

const _ = require('lodash')

const govEntitiesAPI = {
    get() { return entities },
    gov_entity(lang, i, sample) {
        if (sample > -1) return _.sampleSize(entities, sample)
        return entities[Math.floor(Math.random() * entities.length)]
    }
}

module.exports =  govEntitiesAPI