<commit_before>
-module(pgsql_sample).
-compile(export_all).

merchants() ->
  {ok,[{column,<<"idmerchant">>,int4,4,-1,0},
       {column,<<"merchantname">>,varchar,-1,104,0},
       {column,<<"logourl">>,varchar,-1,504,0},
       {column,<<"lastupdated">>,date,4,-1,0},
       {column,<<"isdeleted">>,bit,-1,1,0}],
      [{<<"100059">>,<<"<NAME>">>,
        <<"http://img.shopzilla.com/merchant/100059.gif">>,
        <<"2009-01-10">>,<<"0">>},
       {<<"100134">>,<<"LeGrand Treasures">>,
        <<"http://img.shopzilla.com/merchant/100134.gif">>,
        <<"2009-01-21">>,<<"0">>},
       {<<"100293">>,<<"Austad\\'s Golf">>,
        <<"http://img.shopzilla.com/merchant/100293.gif">>,
        <<"2009-01-21">>,<<"0">>},
       {<<"100436">>,<<"Need Plumbing Supplies">>,
        <<"http://img.shopzilla.com/merchant/100436.gif">>,
        <<"2009-01-21">>,<<"0">>}]}.
<commit_msg>cols now returns proplist; get_col works and takes the default value<commit_after>
-module(pgsql_sample).
-compile(export_all).

merchants() ->
  {ok,[{column,<<"idmerchant">>,int4,4,-1,0},
       {column,<<"merchantname">>,varchar,-1,104,0},
       {column,<<"logourl">>,varchar,-1,504,0},
       {column,<<"lastupdated">>,date,4,-1,0},
       {column,<<"isdeleted">>,bit,-1,1,0}],
      [{<<"100059">>,<<"<NAME>">>,
        <<"http://img.shopzilla.com/merchant/100059.gif">>,
        <<"2009-01-10">>,<<"0">>},
       {<<"100134">>,<<"LeGrand Treasures">>,
        <<"http://img.shopzilla.com/merchant/100134.gif">>,
        <<"2009-01-21">>,<<"0">>},
       {<<"100293">>,<<"Austad\\'s Golf">>,
        <<"http://img.shopzilla.com/merchant/100293.gif">>,
        <<"2009-01-21">>,<<"0">>},
       {<<"100436">>,<<"Need Plumbing Supplies">>,
        <<"http://img.shopzilla.com/merchant/100436.gif">>,
        <<"2009-01-21">>,<<"0">>}]}.

cols(Cols) ->
  [{binary_to_list(Name), {Pos, Rec}} ||
   {Pos, {column, Name, _Type, _Prec, _Len, _} = Rec}
     <- lists:zip(lists:seq(1, length(Cols)), Cols) ].

get_col(Name, Row, Cols) -> get_col(Name, Row, Cols, undefined) ->

get_col(Name, Row, Cols, Default) ->
  case proplists:get_value(Name, Cols) of
    {Pos, _Col} -> element(Pos, Row);
    undefined -> Default
  end.

{'fraction_non_alphanumeric': 0.29728506787330317, 'fraction_numerical': 0.09457013574660633, 'mean_word_length': 3.549382716049383, 'pattern_counts': {'":': 0, '<': 106, '<?xml version=': 0, '>': 113, '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': '459247', 'n_tokens_mistral': 1033, 'n_tokens_neox': 909, 'n_words': 96}