<commit_before><?php

namespace Prometheus\Storage;


use Prometheus\Collector;
use Prometheus\MetricFamilySamples;
use Prometheus\Sample;

class InMemory implements Adapter
{
    /**
     * @var array
     */
    private $metrics = array();
    /**
     * @var array
     */
    private $samples = array();

    /**
     * @return MetricFamilySamples[]
     */
    public function collect()
    {
        $responses = array();
        foreach ($this->metrics as $metric) {
            $responses[] = new MetricFamilySamples(
                array(
                    'name' => $metric->getName(),
                    'type' => $metric->getType(),
                    'help' => $metric->getHelp(),
                    'samples' => $this->samples[$metric->getKey()]
                )
            );
        }
        return $responses;
    }

    public function store($command, Collector $metric, Sample $sample)
    {
        if (isset($this->samples[$metric->getKey()][$sample->getKey()])) {<commit_msg>fix comment<commit_after><?php

namespace Prometheus\Storage;


use Prometheus\Collector;
use Prometheus\MetricFamilySamples;
use Prometheus\Sample;

class InMemory implements Adapter
{
    /**
     * @var Collector[]
     */
    private $metrics = array();
    /**
     * @var array
     */
    private $samples = array();

    /**
     * @return MetricFamilySamples[]
     */
    public function collect()
    {
        $responses = array();
        foreach ($this->metrics as $metric) {
            $responses[] = new MetricFamilySamples(
                array(
                    'name' => $metric->getName(),
                    'type' => $metric->getType(),
                    'help' => $metric->getHelp(),
                    'samples' => $this->samples[$metric->getKey()]
                )
            );
        }
        return $responses;
    }

    public function store($command, Collector $metric, Sample $sample)
    {
        if (isset($this->samples[$metric->getKey()][$sample->getKey()])) {
{'fraction_non_alphanumeric': 0.1488095238095238, 'fraction_numerical': 0.0, 'mean_word_length': 1.8488700564971752, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '2959264', 'n_tokens_mistral': 564, 'n_tokens_neox': 543, 'n_words': 115}