<commit_before>/**
 * Test for a label associated with a file input element.
 */
var Case = require('Case');
const DOM = require('DOM');

var FileHasLabel = {
  run: function (test) {

    var sFiles = '[type="file"]';
    var sLabels = 'label';

    function countOfLabelsById (id, labels) {
      // Map labels by for attribute value.
      var labelsByFor = 0;
      for (var i = 0, il = labels.length; i < il; ++i) {
        var $label = labels.eq(i);
        if (DOM.getAttribute($label, 'for') === id) {
          labelsByFor++;
        }
      }
      return labelsByFor;
    }

    test.get('scope').forEach(function (scope) {
      var files = DOM.scry(sFiles, scope);
      var labels = DOM.scry(sLabels, scope);

      if (files.length === 0) {
        test.add(Case({
          element: undefined,<commit_msg>Fixing assessments<commit_after>/**
 * Test for a label associated with a file input element.
 */
var Case = require('Case');
const DOM = require('DOM');

var FileHasLabel = {
  run: function (test) {

    var sFiles = '[type="file"]';
    var sLabels = 'label';

    function countOfLabelsById (id, labels) {
      // Map labels by for attribute value.
      var labelsByFor = 0;
      for (var i = 0, il = labels.length; i < il; ++i) {
        var $label = labels[i];
        if (DOM.getAttribute($label, 'for') === id) {
          labelsByFor++;
        }
      }
      return labelsByFor;
    }

    test.get('scope').forEach(function (scope) {
      var files = DOM.scry(sFiles, scope);
      var labels = DOM.scry(sLabels, scope);

      if (files.length === 0) {
        test.add(Case({
          element: undefined,
{'fraction_non_alphanumeric': 0.14902676399026765, 'fraction_numerical': 0.0036496350364963502, 'mean_word_length': 2.336713995943205, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6792224', 'n_tokens_mistral': 524, 'n_tokens_neox': 510, 'n_words': 152}