<commit_before>import throwParseError from '../../../core/utils/throw_parse_error.js';
import Type from '../type.js';
import AstroClass from '../../../core/class.js';
import ScalarField from '../scalar_field.js';
import ObjectField from '../object_field.js';
import ListField from '../list_field.js';

function checkTypeExistence(type, className, fieldName) {
  if (!type) {
    throwParseError([{
        'class': className
      }, {
        'property': 'fields'
      }, {
        'field': fieldDefinition.name
      },
      'Type does not exist'
    ]);
  }
}

function onApplyDefinition(Class, parsedDefinition, className) {
  _.each(parsedDefinition.fields, function(fieldDefinition, fieldName) {
    // Prepare field variable.<commit_msg>Fix variable name in the fields module apply definition hook<commit_after>import throwParseError from '../../../core/utils/throw_parse_error.js';
import Type from '../type.js';
import AstroClass from '../../../core/class.js';
import ScalarField from '../scalar_field.js';
import ObjectField from '../object_field.js';
import ListField from '../list_field.js';

function checkTypeExistence(type, className, fieldName) {
  if (!type) {
    throwParseError([{
        'class': className
      }, {
        'property': 'fields'
      }, {
        'field': fieldName
      },
      'Type does not exist'
    ]);
  }
}

function onApplyDefinition(Class, parsedDefinition, className) {
  _.each(parsedDefinition.fields, function(fieldDefinition, fieldName) {
    // Prepare field variable.
{'fraction_non_alphanumeric': 0.149869109947644, 'fraction_numerical': 0.0, 'mean_word_length': 3.2354570637119116, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6530757', 'n_tokens_mistral': 425, 'n_tokens_neox': 430, 'n_words': 110}