<commit_before><?php

date_default_timezone_set ('UTC');

include 'ccxt.php';

date_default_timezone_set ('UTC');

function style ($s, $style) { return $style . $s . "\033[0m"; }
function green     ($s) { return style ($s, "\033[92m"); }
function blue      ($s) { return style ($s, "\033[94m"); }
function yellow    ($s) { return style ($s, "\033[93m"); }
function red       ($s) { return style ($s, "\033[91m"); }
function pink      ($s) { return style ($s, "\033[95m"); }
function bold      ($s) { return style ($s, "\033[1m"); }
function underline ($s) { return style ($s, "\033[4m"); }
function dump ($s) { echo implode (' ', func_get_args ()) . "\n"; }

$exchanges = null;

// $shortopts = '';
// $longopts = array (
//     "nonce::", // '::' means optional, ':' means required
// );

// $options = getopt ($shortopts, $longopts);
// var_dump ($options);
// exit ();

//-----------------------------------------------------------------------------

foreach (\ccxt\Exchange::$exchanges as $id) {
    $exchange = '\\ccxt\\' . $id;
    $exchanges[$id] = new $exchange (array ('verbose' => false));
}

$config = json_decode (file_get_contents ('./keys.json'), true);

foreach ($config as $id => $params)
    foreach ($params as $key => $value)
        if (array_key_exists ($id, $exchanges))
            $exchanges[$id]->$key = $value  ;

$exchanges['gdax']->urls['api'] = 'https://api-public.sandbox.gdax.com';
$exchanges['anxpro']->proxy = 'https://cors-anywhere.herokuapp.com/';
<commit_msg>fixed php test for nonexisting exchanges with keys<commit_after><?php

date_default_timezone_set ('UTC');

include 'ccxt.php';

date_default_timezone_set ('UTC');

function style ($s, $style) { return $style . $s . "\033[0m"; }
function green     ($s) { return style ($s, "\033[92m"); }
function blue      ($s) { return style ($s, "\033[94m"); }
function yellow    ($s) { return style ($s, "\033[93m"); }
function red       ($s) { return style ($s, "\033[91m"); }
function pink      ($s) { return style ($s, "\033[95m"); }
function bold      ($s) { return style ($s, "\033[1m"); }
function underline ($s) { return style ($s, "\033[4m"); }
function dump ($s) { echo implode (' ', func_get_args ()) . "\n"; }

$exchanges = null;

// $shortopts = '';
// $longopts = array (
//     "nonce::", // '::' means optional, ':' means required
// );

// $options = getopt ($shortopts, $longopts);
// var_dump ($options);
// exit ();

//-----------------------------------------------------------------------------

foreach (\ccxt\Exchange::$exchanges as $id) {
    $exchange = '\\ccxt\\' . $id;
    $exchanges[$id] = new $exchange (array ('verbose' => false));
}

$config = json_decode (file_get_contents ('./keys.json'), true);

foreach ($config as $id => $params)
    foreach ($params as $key => $value)
        if (array_key_exists ($id, $exchanges))
            $exchanges[$id]->$key = $value;

$exchanges['gdax']->urls['api'] = 'https://api-public.sandbox.gdax.com';
$exchanges['anxpro']->proxy = 'https://cors-anywhere.herokuapp.com/';

{'fraction_non_alphanumeric': 0.2684297520661157, 'fraction_numerical': 0.02446280991735537, 'mean_word_length': 2.830379746835443, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 4, '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': '3150316', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1015, 'n_words': 259}