<commit_before><?php

namespace UWDOEM\Framework\PickA;

use UWDOEM\Framework\Visitor\VisitableTrait;
use UWDOEM\Framework\Writer\WritableInterface;


class PickA implements PickAInterface {

    protected $_manifest = [];

    use VisitableTrait;


    public function getHash() {
        return md5(json_encode($this->getManifest()));
    }

    public function __construct($manifest) {
        $this->_manifest = $manifest;
    }

    public function getWritables() {
        $writables = [];
        foreach ($this->_manifest as $manifestItem) {
            if ($manifestItem instanceof WritableInterface) {
                $writables[] = $manifestItem;
            }
        }

        return $writables;
    }

    public function getLabels() {
        $labels = [];
        foreach ($this->_manifest as $key => $manifestItem) {
            if (!($manifestItem instanceof WritableInterface)) {
                $labels[] = $key;
            }
        }

        return $labels;
    }

    public function getManifest() {
        return $this->_manifest;
    }
}<commit_msg>Return PickA writables with manifest key.<commit_after><?php

namespace UWDOEM\Framework\PickA;

use UWDOEM\Framework\Visitor\VisitableTrait;
use UWDOEM\Framework\Writer\WritableInterface;


class PickA implements PickAInterface {

    protected $_manifest = [];

    use VisitableTrait;


    public function getHash() {
        return md5(json_encode($this->getManifest()));
    }

    public function __construct($manifest) {
        $this->_manifest = $manifest;
    }

    public function getWritables() {
        $writables = [];
        foreach ($this->_manifest as $key => $manifestItem) {
            if ($manifestItem instanceof WritableInterface) {
                $writables[$key] = $manifestItem;
            }
        }

        return $writables;
    }

    public function getLabels() {
        $labels = [];
        foreach ($this->_manifest as $key => $manifestItem) {
            if (!($manifestItem instanceof WritableInterface)) {
                $labels[] = $key;
            }
        }

        return $labels;
    }

    public function getManifest() {
        return $this->_manifest;
    }
}
{'fraction_non_alphanumeric': 0.11429872495446267, 'fraction_numerical': 0.0009107468123861566, 'mean_word_length': 2.235640648011782, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '4186551', 'n_tokens_mistral': 633, 'n_tokens_neox': 585, 'n_words': 132}