<commit_before><?php

namespace Lingotek;

use Lingotek\RestClient;
use Lingotek\Dev;
use Lingotek\Exception;
use Lingotek\InvalidArgumentException;
use Lingotek\RestClientException;
use Lingotek\NotFound;
use Lingotek\Unauthorized;
use Lingotek\InvalidUrlPatternException;

/**
 * Lingotek SDK
 *
 * Copyright (c) 2014 Lingotek, Inc.
 *
 * For the full copyright and license information, please view
 * the file license.md that was distributed with this source code.
 *
 *
 * Usage: readme.md
 */

class LingotekApi implements LingotekApiInterface {
    public function getLocales() {
    // $this->logger->debug('Starting Locales request: /api/locale with args [limit => 1000]');
    // /** @var ResponseInterface $response */
    // try {
    //   $response = $this->lingotekClient->get('/api/locale', ['limit' => 1000]);
    //   if ($response->getStatusCode() == Response::HTTP_OK) {
    //     $data = json_decode($response->getBody(), TRUE);
    //     $this->logger->debug('getLocales response received, code %code and body %body', ['%code' => $response->getStatusCode(), '%body' => (string) $response->getBody(TRUE)]);
    //     return $data;
    //   }
    // }<commit_msg>Added constructor for LingotekApi<commit_after><?php

namespace Lingotek;

use Lingotek\RestClient;
use Lingotek\Dev;
use Lingotek\Exception;
use Lingotek\InvalidArgumentException;
use Lingotek\RestClientException;
use Lingotek\NotFound;
use Lingotek\Unauthorized;
use Lingotek\InvalidUrlPatternException;

/**
 * Lingotek SDK
 *
 * Copyright (c) 2014 Lingotek, Inc.
 *
 * For the full copyright and license information, please view
 * the file license.md that was distributed with this source code.
 *
 *
 * Usage: readme.md
 */

class LingotekApi implements LingotekApiInterface {
  protected $client;

  public function __construct($access_token) {
    $this->$client = new RestClient(array(
      'access_token' => $access_token,
      'base_url' => RestClient::URL_PRODUCTION
        ));
  }
  public function getLocales() {
    // $this->logger->debug('Starting Locales request: /api/locale with args [limit => 1000]');
    // /** @var ResponseInterface $response */
    // try {
    //   $response = $this->lingotekClient->get('/api/locale', ['limit' => 1000]);
    //   if ($response->getStatusCode() == Response::HTTP_OK) {
    //     $data = json_decode($response->getBody(), TRUE);
    //     $this->logger->debug('getLocales response received, code %code and body %body', ['%code' => $response->getStatusCode(), '%body' => (string) $response->getBody(TRUE)]);
    //     return $data;
    //   }
    // }
{'fraction_non_alphanumeric': 0.1503846153846154, 'fraction_numerical': 0.009230769230769232, 'mean_word_length': 3.6780575539568345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '3995022', 'n_tokens_mistral': 844, 'n_tokens_neox': 788, 'n_words': 197}