<commit_before><?php

class Behance_Api {
    const ENDPOINT_PROJECTS   = '/projects';
    const ENDPOINT_USERS      = '/users';
    const TIMEOUT_DEFAULT_SEC = 30;

    protected $_api_root      = 'https://www.behance.net/v2';
    protected $_client_id;

    public function __construct( $client_id ) {
        $this->_client_id = $client_id;
    }

    public function getUserProfile( $id_or_username) {
        $endpoint = $this->_api_root . self::ENDPOINT_USERS . '/' . $id_or_username . '?api_key=' . $this->_client_id;

        return $this->_executeRequest( $endpoint );
    }

    public function getUserProjects( $id_or_username) {
        $endpoint = $this->_api_root . self::ENDPOINT_USERS . '/' . $id_or_username . self::ENDPOINT_PROJECTS . '?api_key=' . $this->_client_id;

        return $this->_executeRequest( $endpoint );
    }

    protected function _executeRequest($url) {
        $user_agent = "Behance API/PHP (App {$this->_client_id})";

        $ch = curl_init();
        <commit_msg>Refactored Behance class<commit_after><?php

namespace Behance;

class Behance
{
    const ENDPOINT_PROJECTS   = '/projects';
    const ENDPOINT_USERS      = '/users';
    const TIMEOUT_DEFAULT_SEC = 30;

    protected $_api_root      = 'https://www.behance.net/v2';
    protected $_client_id;

    public function __construct($client_id)
    {
        $this->_client_id = $client_id;
    }

    public function getUserProfile($id_or_username)
    {
        $endpoint = $this->_api_root . self::ENDPOINT_USERS . '/' . $id_or_username . '?api_key=' . $this->_client_id;

        return $this->_executeRequest( $endpoint );
    }

    public function getUserProjects($id_or_username)
    {
        $endpoint = $this->_api_root . self::ENDPOINT_USERS . '/' . $id_or_username . self::ENDPOINT_PROJECTS . '?api_key=' . $this->_client_id;

        return $this->_executeRequest( $endpoint );
    }

    protected function _executeRequest($url)
    {
        $user_agent = "Behance API/PHP (App {$this->_client_id})";

        $ch = curl_init();
        
{'fraction_non_alphanumeric': 0.13576642335766423, 'fraction_numerical': 0.00291970802919708, 'mean_word_length': 2.893939393939394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '7298800', 'n_tokens_mistral': 686, 'n_tokens_neox': 661, 'n_words': 121}