<commit_before><?php

namespace JuanF\Lib\Persistence;

class Redis extends Persistence
{

    protected static $host = 'localhost';
    protected static $port = 6379;
    protected static $redisInstance;

    public static function init($config = [])
    {

        self::$host = isset($config['host']) ? $config['host'] : self::$host;
        self::$port = isset($config['port']) ? $config['port'] : self::$port;

        if (!(self::$redisInstance instanceof Redis)) {
            self::$redisInstance = new \Redis();
            self::$redisInstance->connect(self::$host, self::$port);
            self::$redisInstance->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);

            if (isset($config['options']) && count($config['options'])) {
                foreach ($config['options'] as $key => $value) {
                    self::$redisInstance->setOption($key, $value);
                }
            }
        }

        return new self;
    }

    public function get($key, $bit)
    {
        $pipe = self::$redisInstance->pipeline();

        $pipe->getbit($key, $bit, 1);
        $pipe->exec();
    }

    public function set($key, $bit)
    {
        echo "set $key, $bit\n";

        $pipe = self::$redisInstance->pipeline();

        $pipe->setbit($key, $bit, 1);
        $pipe->exec();
    }
}
<commit_msg>fixing<commit_after><?php

namespace JuanF\Lib\Persistence;

class Redis extends Persistence
{

    protected static $host = 'localhost';
    protected static $port = 6379;
    protected static $redisInstance;

    public static function init($config = [])
    {

        self::$host = isset($config['host']) ? $config['host'] : self::$host;
        self::$port = isset($config['port']) ? $config['port'] : self::$port;

        if (!(self::$redisInstance instanceof Redis)) {
            self::$redisInstance = new \Redis();
            self::$redisInstance->connect(self::$host, self::$port);
            self::$redisInstance->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);

            if (isset($config['options']) && count($config['options'])) {
                foreach ($config['options'] as $key => $value) {
                    self::$redisInstance->setOption($key, $value);
                }
            }
        }

        return new self;
    }

    public function get($key, $bit)
    {
        $pipe = self::$redisInstance->pipeline();

        $pipe->getbit($key, $bit);
        $pipe->exec();
    }

    public function set($key, $bit)
    {
        echo "set $key, $bit\n";

        $pipe = self::$redisInstance->pipeline();

        $pipe->setbit($key, $bit, 1);
        $pipe->exec();
    }
}

{'fraction_non_alphanumeric': 0.17870579382994733, 'fraction_numerical': 0.004138449962377728, 'mean_word_length': 2.4002557544757033, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '3380715', 'n_tokens_mistral': 805, 'n_tokens_neox': 803, 'n_words': 155}