<commit_before><?php

/**
 * Vultr.com API Client
 * @package vultr
 * @version 1.0
 * @author  https://github.com/usefulz
 * @license http://www.opensource.org/licenses/mit-license.php MIT
 * @see     https://github.com/usefulz/vultr-api-client
 */

class Vultr
{

  /**
   * API Token
   * @access private
   * @type string $api_token Vultr.com API token
   * @see https://my.vultr.com/settings/
   */

  private $api_token = '';

  /**
   * API Endpoint
   * @access public
   * @type string URL for Vultr.com API
   */

  public $endpoint = 'https://api.vultr.com/v1/';

  /**
   * Current Version
   * @access public
   * @type string Current version number
   */

  public $version = '1.0';

  /**
   * User Agent
   * @access public
   * @type string API User-Agent string
   */

  public $agent = 'Vultr.com API Client';

  /**
   * Debug Variable
   * @access public
   * @type bool Debug API requests
   */

  public $debug = FALSE;

  /**
   * Snapshots Variable
   * @access public
   * @type mixed Array to store snapshot IDs
   */

  public $snapshots = array();

  /**
   * Plans Variable
   * @access public
   * @type mixed Array to store VPS Plan IDs
   */

  public $plans     = array();

  /**
   * Regions Variable
   * @access public
   * @type mixed Array to store available regions
   */

  public $regions   = array();

  /**
   * Scripts Variable
   * @access public
   * @type mixed Array to store startup scripts
   */

  public $scripts   = array();

  /**
   * Servers Variable
   * @access public
   * @type mixed Array to store server data
   */

  public $servers   = array();

  /**
   * Account Variable
   * @access public
   * @type mixed Array to store account data
   */

  public $account   = array();

  /**
   * OS List Variable
   * @access public
   * @type mixed Array to store OS list
   */

  public $oses   = array();

  /**
   * SSH Keys variable
   * @access public
   * @type mixed Array to store SSH keys
   **/

  public $ssh_keys = array();

  /**
   * Response code variable
   * @access public
   * @type int Holds HTTP response code from API
   **/

  public $response_code = 0;

  /**
   * Response code variable
   * @access public
   * @type bool Determines whether to include the response code, default: false
   **/

  public $get_code = false;


  /**
   * Cache ttl for all get requests
   * @access public
   * $type int TTL in seconds
   */
  public $cache_ttl = 3600;


  /**
   * Cache folder
   * @access public
   * $type string Cache dir
   */
  public $cache_dir = '/tmp/vultr-api-client-cache';

  /**
   * Constructor function
   * @param string $token
   * @param int $cache_ttl
   * @see https://my.vultr.com/settings/
   * @return void
   */

  public function __construct($token, $cache_ttl = 600)
  {
    $this->api_token = $token;
    $this->account   = self::account_info();
    $this->snapshots = self::snapshot_list();
    $this->scripts   = self::startupscript_list();
    $this->regions   = self::regions_list();
    $this->servers   = self::server_list();
    $this->plans     = self::plans_list();
    $this->oses      = self::os_list();
    $this->ssh_keys  = self::sshkeys_list();
  }<commit_msg>Change the timeout in the constructor<commit_after><?php

/**
 * Vultr.com API Client
 * @package vultr
 * @version 1.0
 * @author  https://github.com/usefulz
 * @license http://www.opensource.org/licenses/mit-license.php MIT
 * @see     https://github.com/usefulz/vultr-api-client
 */

class Vultr
{

  /**
   * API Token
   * @access private
   * @type string $api_token Vultr.com API token
   * @see https://my.vultr.com/settings/
   */

  private $api_token = '';

  /**
   * API Endpoint
   * @access public
   * @type string URL for Vultr.com API
   */

  public $endpoint = 'https://api.vultr.com/v1/';

  /**
   * Current Version
   * @access public
   * @type string Current version number
   */

  public $version = '1.0';

  /**
   * User Agent
   * @access public
   * @type string API User-Agent string
   */

  public $agent = 'Vultr.com API Client';

  /**
   * Debug Variable
   * @access public
   * @type bool Debug API requests
   */

  public $debug = FALSE;

  /**
   * Snapshots Variable
   * @access public
   * @type mixed Array to store snapshot IDs
   */

  public $snapshots = array();

  /**
   * Plans Variable
   * @access public
   * @type mixed Array to store VPS Plan IDs
   */

  public $plans     = array();

  /**
   * Regions Variable
   * @access public
   * @type mixed Array to store available regions
   */

  public $regions   = array();

  /**
   * Scripts Variable
   * @access public
   * @type mixed Array to store startup scripts
   */

  public $scripts   = array();

  /**
   * Servers Variable
   * @access public
   * @type mixed Array to store server data
   */

  public $servers   = array();

  /**
   * Account Variable
   * @access public
   * @type mixed Array to store account data
   */

  public $account   = array();

  /**
   * OS List Variable
   * @access public
   * @type mixed Array to store OS list
   */

  public $oses   = array();

  /**
   * SSH Keys variable
   * @access public
   * @type mixed Array to store SSH keys
   **/

  public $ssh_keys = array();

  /**
   * Response code variable
   * @access public
   * @type int Holds HTTP response code from API
   **/

  public $response_code = 0;

  /**
   * Response code variable
   * @access public
   * @type bool Determines whether to include the response code, default: false
   **/

  public $get_code = false;


  /**
   * Cache ttl for all get requests
   * @access public
   * $type int TTL in seconds
   */
  public $cache_ttl = 3600;


  /**
   * Cache folder
   * @access public
   * $type string Cache dir
   */
  public $cache_dir = '/tmp/vultr-api-client-cache';

  /**
   * Constructor function
   * @param string $token
   * @param int $cache_ttl
   * @see https://my.vultr.com/settings/
   * @return void
   */

  public function __construct($token, $cache_ttl = 3600)
  {
    $this->api_token = $token;
    $this->account   = self::account_info();
    $this->snapshots = self::snapshot_list();
    $this->scripts   = self::startupscript_list();
    $this->regions   = self::regions_list();
    $this->servers   = self::server_list();
    $this->plans     = self::plans_list();
    $this->oses      = self::os_list();
    $this->ssh_keys  = self::sshkeys_list();
  }
{'fraction_non_alphanumeric': 0.13573103987490226, 'fraction_numerical': 0.004222048475371384, 'mean_word_length': 2.391304347826087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, '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': '3254274', 'n_tokens_mistral': 2183, 'n_tokens_neox': 2059, 'n_words': 593}