<commit_before><?php namespace Completionistv2;

class Users
{
    public static function select($columns = array("*"), $filters = array())
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";

        return Database::select("users", $columns, $filters);
    }

    public static function insert($name, $email, $password)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\PasswordHelper.php";
        $hash = PasswordHelper::encode($password);

        if (empty($email)) {
            return Database::insert("users", array("name","hash"), array(Database::encodeString($name), $hash));
        } else {
            return Database::insert(
                "users",
                array("name","email","hash"),
                array(Database::encodeString($name),Database::encodeString($email), $hash)
            );
        }
    }

    public static function update($userid, $name, $email, $password)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\PasswordHelper.php";
        $hash = PasswordHelper::encode($password);

        $columns = array();
        $values = array();

        if (!empty($name)) {
            $columns[] = "name";
            $values [] = Database::encodeString($name);
        }
        if (!empty($email)) {
            $columns[] = "email";
            $values [] = Databse::encodeString($email);
        }
        if (!empty($hash)) {
            $columns[] = "hash";
            $values [] = $hash;
        }

        $result = Database::select(
            "users",
            array("useridorigin","name","email","hash","modification","active"),
            array("userid=useridorigin", "useridorigin=$userid")
        );
        $result = json_decode(json_encode($result->rows[0]), true);
        Database::insert("users", array("useridorigin","name","email","hash","modification","active"), $result);

        return Database::update("users", $columns, $values, array("userid=useridorigin", "useridorigin=$userid"));
    }

    public static function activate($name)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        return Database::update("users", array("active"), array(1), array("name = '$name'"));
    }

    public static function deactivate($name)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        return Database::update("users", array("active"), array(0), array("name = '$name'"));
    }
}
<commit_msg>Corrected a wrongly written call<commit_after><?php namespace Completionistv2;

class Users
{
    public static function select($columns = array("*"), $filters = array())
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";

        return Database::select("users", $columns, $filters);
    }

    public static function insert($name, $email, $password)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\PasswordHelper.php";
        $hash = PasswordHelper::encode($password);

        if (empty($email)) {
            return Database::insert("users", array("name","hash"), array(Database::encodeString($name), $hash));
        } else {
            return Database::insert(
                "users",
                array("name","email","hash"),
                array(Database::encodeString($name),Database::encodeString($email), $hash)
            );
        }
    }

    public static function update($userid, $name, $email, $password)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\PasswordHelper.php";
        $hash = PasswordHelper::encode($password);

        $columns = array();
        $values = array();

        if (!empty($name)) {
            $columns[] = "name";
            $values [] = Database::encodeString($name);
        }
        if (!empty($email)) {
            $columns[] = "email";
            $values [] = Database::encodeString($email);
        }
        if (!empty($hash)) {
            $columns[] = "hash";
            $values [] = $hash;
        }

        $result = Database::select(
            "users",
            array("useridorigin","name","email","hash","modification","active"),
            array("userid=useridorigin", "useridorigin=$userid")
        );
        $result = json_decode(json_encode($result->rows[0]), true);
        Database::insert("users", array("useridorigin","name","email","hash","modification","active"), $result);

        return Database::update("users", $columns, $values, array("userid=useridorigin", "useridorigin=$userid"));
    }

    public static function activate($name)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        return Database::update("users", array("active"), array(1), array("name = '$name'"));
    }

    public static function deactivate($name)
    {
        require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Database.php";
        return Database::update("users", array("active"), array(0), array("name = '$name'"));
    }
}

{'fraction_non_alphanumeric': 0.17916186082276048, 'fraction_numerical': 0.0015378700499807767, 'mean_word_length': 2.8117216117216115, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4958801', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1413, 'n_words': 246}