<commit_before><?php

namespace monad\admin;

class Multi_Media_Controller extends Controller
{
    protected function get(array $args)
    {
        extract($args);
        $ids = explode(',', $ids);
        if (!($medias = Media_Finder::instance()->all($ids))) {
            throw new HTTP404_Exception();
        }
        uasort($medias, function($a, $b) {
            if ($a['originalname'] == $b['originalname']) {
                return $a['id'] < $b['id'] ? -1 : 1;
            }
            return $a['originalname'] < $b['originalname'] ? -1 : 1;
        });
        switch ($type) {
            case 'png': $args['mimetype'] = 'image/png'; break;
            case 'jpg':
            case 'jpeg':
                $args['mimetype'] = 'image/jpeg';
                break;
        }
        $this->template = false;
        return $this->view('misc/media/multi', compact('medias') + $args);
    }
}
<commit_msg>fix and modernize<commit_after><?php

namespace monad\admin;

class Multi_Media_Controller extends Controller
{
    protected function get(array $args)
    {
        extract($args);
        $ids = explode(',', $ids);
        if (!($medias = Media_Finder::instance()->ids($ids))) {
            throw new HTTP404_Exception;
        }
        uasort($medias, function($a, $b) {
            if ($a['originalname'] == $b['originalname']) {
                return $a['id'] < $b['id'] ? -1 : 1;
            }
            return $a['originalname'] < $b['originalname'] ? -1 : 1;
        });
        switch ($type) {
            case 'png': $args['mimetype'] = 'image/png'; break;
            case 'jpg':
            case 'jpeg':
                $args['mimetype'] = 'image/jpeg';
                break;
        }
        $this->template = false;
        $helper = new Media_Helper;
        return $this->view(
            'misc/media/multi',
            compact('medias', 'helper') + $args
        );
    }
}

{'fraction_non_alphanumeric': 0.17413972888425444, 'fraction_numerical': 0.0072992700729927005, 'mean_word_length': 1.7973760932944607, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '499395', 'n_tokens_mistral': 590, 'n_tokens_neox': 573, 'n_words': 121}