<commit_before>let

  mkOption = attrs: attrs // {_type = "option";};

  typeOf = x: if x ? _type then x._type else "";


  combine = defs: opts: opts //
    builtins.listToAttrs (map (defName:
      { attr = defName;
        value = 
          let
            defValue = builtins.getAttr defName defs;
            optValue = builtins.getAttr defName opts;
          in
          if typeOf defValue == "option"
          then
            # `defValue' is an option.
            if builtins.hasAttr defName opts
            then builtins.getAttr defName opts
            else defValue.default
          else
            # `defValue' is an attribute set containing options.
            # So recurse.<commit_msg>fix: listToAttr takes name instead of attr as argument<commit_after>let

  mkOption = attrs: attrs // {_type = "option";};

  typeOf = x: if x ? _type then x._type else "";


  combine = defs: opts: opts //
    builtins.listToAttrs (map (defName:
      { name = defName;
        value = 
          let
            defValue = builtins.getAttr defName defs;
            optValue = builtins.getAttr defName opts;
          in
          if typeOf defValue == "option"
          then
            # `defValue' is an option.
            if builtins.hasAttr defName opts
            then builtins.getAttr defName opts
            else defValue.default
          else
            # `defValue' is an attribute set containing options.
            # So recurse.
{'fraction_non_alphanumeric': 0.0789293067947838, 'fraction_numerical': 0.0, 'mean_word_length': 1.6752293577981652, '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': '5790966', 'n_tokens_mistral': 411, 'n_tokens_neox': 406, 'n_words': 133}