<commit_before>import {Client} from 'theseus';
import {Http} from 'any-http-reqwest';

import apiUriByEnv from './media-api.config.json!';


const client = new Client({
    promise: Promise,
    http: new Http
});

function isDefined(val) {
    return typeof val !== 'undefined';
}

export function listEnvironments() {
    return Object.keys(apiUriByEnv);
};

export function search(env, {query, valid, free, picdar, offset = 0, length = 10}) {
    const apiUrl = apiUriByEnv[env];<commit_msg>Add withCredentials flag<commit_after>import {Client} from 'theseus';
import {Http} from 'any-http-reqwest';

import apiUriByEnv from './media-api.config.json!';


const client = new Client({
    promise: Promise,
    http: new Http({
        withCredentials: true
    })
});

function isDefined(val) {
    return typeof val !== 'undefined';
}

export function listEnvironments() {
    return Object.keys(apiUriByEnv);
};

export function search(env, {query, valid, free, picdar, offset = 0, length = 10}) {
    const apiUrl = apiUriByEnv[env];
{'fraction_non_alphanumeric': 0.13776493256262043, 'fraction_numerical': 0.005780346820809248, 'mean_word_length': 4.247474747474747, 'pattern_counts': {'":': 0, '<': 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': '1244135', 'n_tokens_mistral': 336, 'n_tokens_neox': 327, 'n_words': 95}