<commit_before><?php

namespace BitWasp\Bitcoin\Script;

use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Buffertools\Buffer;
use BitWasp\Bitcoin\Crypto\Hash;
use BitWasp\Bitcoin\Serializable;

class Script extends Serializable implements ScriptInterface
{

    /**
     * @var Opcodes
     */
    private $opcodes;

    /**
     * @var null|string
     */
    protected $script;

    /**
     * @param Buffer|null $script
     * @param Opcodes|null $opcodes
     */
    public function __construct(Buffer $script = null, Opcodes $opcodes = null)
    {
        $this->script = $script instanceof Buffer ? $script->getBinary() : '';
        $this->opcodes = $opcodes ?: new Opcodes();
    }

    /**
     * @return Buffer
     */
    public function getBuffer()
    {
        return new Buffer($this->script);
    }

    /**
     * @return ScriptParser
     */
    public function getScriptParser()
    {
        return new ScriptParser(Bitcoin::getMath(), $this);
    }

    /**
     * Get all opcodes
     *
     * @return Opcodes
     */
    public function getOpCodes()
    {
        return $this->opcodes;
    }

    /**
     * Return a buffer containing the hash of this script.
     *
     * @return \BitWasp\Buffertools\Buffer
     */
    public function getScriptHash()
    {
        return Hash::sha256ripe160($this->getBuffer());
    }

    /**
     * @param bool|true $accurate
     * @return int
     */
    public function countSigOps($accurate = true)
    {
        $count = 0;
        $ops = $this->opcodes;
        $parser = $this->getScriptParser();
        $op = Opcodes::OP_INVALIDOPCODE;
        $pushData = new Buffer();
        $lastOp = 0xff;
        while ($parser->next($op, $pushData)) {
            if ($op > 78) {<commit_msg>Remove unused assignment in Script<commit_after><?php

namespace BitWasp\Bitcoin\Script;

use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Buffertools\Buffer;
use BitWasp\Bitcoin\Crypto\Hash;
use BitWasp\Bitcoin\Serializable;

class Script extends Serializable implements ScriptInterface
{

    /**
     * @var Opcodes
     */
    private $opcodes;

    /**
     * @var null|string
     */
    protected $script;

    /**
     * @param Buffer|null $script
     * @param Opcodes|null $opcodes
     */
    public function __construct(Buffer $script = null, Opcodes $opcodes = null)
    {
        $this->script = $script instanceof Buffer ? $script->getBinary() : '';
        $this->opcodes = $opcodes ?: new Opcodes();
    }

    /**
     * @return Buffer
     */
    public function getBuffer()
    {
        return new Buffer($this->script);
    }

    /**
     * @return ScriptParser
     */
    public function getScriptParser()
    {
        return new ScriptParser(Bitcoin::getMath(), $this);
    }

    /**
     * Get all opcodes
     *
     * @return Opcodes
     */
    public function getOpCodes()
    {
        return $this->opcodes;
    }

    /**
     * Return a buffer containing the hash of this script.
     *
     * @return \BitWasp\Buffertools\Buffer
     */
    public function getScriptHash()
    {
        return Hash::sha256ripe160($this->getBuffer());
    }

    /**
     * @param bool|true $accurate
     * @return int
     */
    public function countSigOps($accurate = true)
    {
        $count = 0;
        $parser = $this->getScriptParser();
        $op = Opcodes::OP_INVALIDOPCODE;
        $pushData = new Buffer();
        $lastOp = 0xff;
        while ($parser->next($op, $pushData)) {
            if ($op > 78) {
{'fraction_non_alphanumeric': 0.1310344827586207, 'fraction_numerical': 0.005747126436781609, 'mean_word_length': 2.1108132260947277, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '772274', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1073, 'n_words': 240}