<commit_before><?php

class TwitterAPI {
    private $consumerKey;
    private $consumerSecret;
    private $accessToken;
    private $accessTokenSecret;

    public function __construct($APICredentials) {
        if($APICredentials == null || sizeof($APICredentials) != 4 || !isset($APICredentials["consumerKey"], $APICredentials["consumerSecret"], $APICredentials["acessToken"], $APICredentials["accessTokenSecret"]))
            return null;
        foreach($APICredentials as $key => $value) {
            $$key = $value;
        }
    }

    private function query($url, $method, $fields) {
        $oauth = array(
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_nonce' => time(),
            'oauth_signature_method' => 'HMAC-SHA1',
            'oauth_token' => $this->accessToken,
            'oauth_timestamp' => time(),
            'oauth_version' => '1.0'
        );
        $oauth += $fields;
        ksort($oauth);
        $tmp = array();
        $values = array();
        foreach($oauth as $key => $value) {
            $tmp[] = "$key=$value";
            $values[] = $key.'="'.rawurlencode($value).'"';
        }
        $base = $method.'&'.rawurlencode($url).'&'.rawurlencode(implode('&', $tmp));
        $compositeKey = rawurlencode($this->consumerSecret).'&'.rawurlencode($this->accessTokenSecret);
        $oauth['oauth_signature'] = base64_encode(hash_hmac('sha1', $base, $compositeKey, true));
        $header = array('Authorization: OAuth '.implode(', ', $values), 'Expect:');<commit_msg>fix function privacy<commit_after><?php

class TwitterAPI {
    private $consumerKey;
    private $consumerSecret;
    private $accessToken;
    private $accessTokenSecret;

    public function __construct($APICredentials) {
        if($APICredentials == null || sizeof($APICredentials) != 4 || !isset($APICredentials["consumerKey"], $APICredentials["consumerSecret"], $APICredentials["acessToken"], $APICredentials["accessTokenSecret"]))
            return null;
        foreach($APICredentials as $key => $value) {
            $$key = $value;
        }
    }

    public function query($url, $method, $fields) {
        $oauth = array(
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_nonce' => time(),
            'oauth_signature_method' => 'HMAC-SHA1',
            'oauth_token' => $this->accessToken,
            'oauth_timestamp' => time(),
            'oauth_version' => '1.0'
        );
        $oauth += $fields;
        ksort($oauth);
        $tmp = array();
        $values = array();
        foreach($oauth as $key => $value) {
            $tmp[] = "$key=$value";
            $values[] = $key.'="'.rawurlencode($value).'"';
        }
        $base = $method.'&'.rawurlencode($url).'&'.rawurlencode(implode('&', $tmp));
        $compositeKey = rawurlencode($this->consumerSecret).'&'.rawurlencode($this->accessTokenSecret);
        $oauth['oauth_signature'] = base64_encode(hash_hmac('sha1', $base, $compositeKey, true));
        $header = array('Authorization: OAuth '.implode(', ', $values), 'Expect:');
{'fraction_non_alphanumeric': 0.17597402597402598, 'fraction_numerical': 0.004545454545454545, 'mean_word_length': 2.846441947565543, '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': '3045019', 'n_tokens_mistral': 953, 'n_tokens_neox': 934, 'n_words': 161}