<commit_before><?php

namespace WrapIt\Helpers;

use WrapIt\WrapIt;
use WrapIt\Exceptions\WrapItParameterException;
use WrapIt\Exceptions\WrapItResponseException;
use WrapIt\Http\WrapItUserRequester;

/**
 * Class WrapItUserHelper
 *
 * @package WrapIt
 */
class WrapItUserHelper {

    private $access_token = null;

    private $client_id = null;
    private $client_secret = null;

    private $requester;

    public function __construct($wi, $access_token) {
        if (!($wi instanceof WrapIt)) {
            throw new WrapItParameterException("WrapIt class required");
        }

        $this->client_id = $wi->getClientId();
        $this->client_secret = $wi->getClientSecret();
        $this->access_token = $access_token;
        $this->requester = new WrapItUserRequester($wi->getDomain(), $access_token);
    }

    public function getUserData($userid = "me") {
        $data = $this->requester->get("people/$userid");
        if (!isset($data["error"])) {
            return $data;
        } else {
            throw new WrapItResponseException($data["error"]["message"]);
        }
    }

    public function getProfilePicture($userid = "me") {
        $data = $this->requester->get("people/$userid/picture", array("redirect" => "false"));
        if (isset($data["error"])) {
            throw new WrapItResponseException($data["error"]["message"]);
        }

        if (isset($data["url"])) {
            return $data["url"];
        } else {
            throw new WrapItResponseException("Unknown Exception");
        }
    }

}<commit_msg>data checking<commit_after><?php

namespace WrapIt\Helpers;

use WrapIt\WrapIt;
use WrapIt\Exceptions\WrapItParameterException;
use WrapIt\Exceptions\WrapItResponseException;
use WrapIt\Http\WrapItUserRequester;

/**
 * Class WrapItUserHelper
 *
 * @package WrapIt
 */
class WrapItUserHelper {

    private $access_token = null;

    private $client_id = null;
    private $client_secret = null;

    private $requester;

    public function __construct($wi, $access_token) {
        if (!($wi instanceof WrapIt)) {
            throw new WrapItParameterException("WrapIt class required");
        }

        $this->client_id = $wi->getClientId();
        $this->client_secret = $wi->getClientSecret();
        $this->access_token = $access_token;
        $this->requester = new WrapItUserRequester($wi->getDomain(), $access_token);
    }

    public function getUserData($userid = "me") {
        $data = $this->requester->get("people/$userid");
        if ($data != null && !isset($data["error"])) {
            return $data;
        } else {
            throw new WrapItResponseException($data["error"]["message"]);
        }
    }

    public function getProfilePicture($userid = "me") {
        $data = $this->requester->get("people/$userid/picture", array("redirect" => "false"));
        if (isset($data["error"])) {
            throw new WrapItResponseException($data["error"]["message"]);
        }

        if (isset($data["url"])) {
            return $data["url"];
        } else {
            throw new WrapItResponseException("Unknown Exception");
        }
    }

}
{'fraction_non_alphanumeric': 0.14740528494110156, 'fraction_numerical': 0.0, 'mean_word_length': 2.8694581280788176, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '4318843', 'n_tokens_mistral': 941, 'n_tokens_neox': 937, 'n_words': 177}