code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
-module(typecheck). -import(lists, [zip/2, unzip/1, unzip3/1, seq/2, nth/2]). -import(domain, [intersection/1, intersection/2, intersect_envs/2, union/1, union/2]). -export([domain/6, qualified_apply/7]). -include_lib("eunit/include/eunit.hrl"). domain(Mode, Arities, Stack, Args, DomainModule, Term) -> ArgDomain...
src/type/typecheck.erl
0.562177
0.458652
typecheck.erl
starcoder
%% Licensed under the Apache License, Version 2.0 (the “License”); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in writing, software %% distributed ...
src/gb_merkle_trees.erl
0.835685
0.537223
gb_merkle_trees.erl
starcoder
-module (deliv_dependency_failures_impl). %% Provides the business logic for dependency failures data -include("deliv_types.hrl"). -export ([ merge_overlapping_sets/2, are_dependencies_blocked/1, is_pipeline_blocked/2, get_all_blocked_pipeline_ids/1 ]). %% Blocked se...
components/automate-workflow-server/apps/delivery/src/deliv_dependency_failures_impl.erl
0.545528
0.514705
deliv_dependency_failures_impl.erl
starcoder
%% Licensed to the Apache Software Foundation (ASF) under one %% or more contributor license agreements. See the NOTICE file %% distributed with this work for additional information %% regarding copyright ownership. The ASF licenses this file %% to you under the Apache License, Version 2.0 (the %% "License"); you may...
src/systemd_journal_h.erl
0.659624
0.540742
systemd_journal_h.erl
starcoder
%%============================================================================== %% Copyright 2014 <NAME> %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licen...
src/jobs_app.erl
0.8059
0.615637
jobs_app.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2000-2017. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% ...
lib/tools/src/xref_reader.erl
0.532425
0.454412
xref_reader.erl
starcoder
%%%------------------------------------------------------------------- %%% File: gen_stream_odd_nums.erl %%% Author: <NAME> %%% Description: %%% Generate odd numbers as a binary stream. This is an example of %%% a gen_stream behaviour which does not have any internal state. %%% To accomplish this, the functions n...
src/gen_stream_odd_nums.erl
0.570331
0.465934
gen_stream_odd_nums.erl
starcoder
%% Copyright (c) 2013 <NAME> %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file %% except in compliance with the License. You may obtain %% a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable...
src/rebar_vim_listener.erl
0.523177
0.412826
rebar_vim_listener.erl
starcoder
%% Copyright (c) Facebook, Inc. and its affiliates. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicabl...
test/assert_diagnostic.erl
0.747892
0.507446
assert_diagnostic.erl
starcoder
%%%------------------------------------------------------------------------ %% Copyright 2019, OpenTelemetry Authors %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.o...
apps/opentelemetry_api/src/ot_meter.erl
0.819496
0.480905
ot_meter.erl
starcoder
%%% Licensed under the Apache License, Version 2.0 (the "License"); %%% you may not use this file except in compliance with the License. %%% You may obtain a copy of the License at %%% %%% http://www.apache.org/licenses/LICENSE-2.0 %%% %%% Unless required by applicable law or agreed to in writing, software %%% distri...
src/mvptree.erl
0.563138
0.63202
mvptree.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% A library for creating "optics", a composable traversal over %%% arbitrary containers with the possibility of error. %%% %%% The traversal is modeled as an opaque type containing both a fold %%% and mapfold type. As mapfold is a superse...
src/optic.erl
0.675978
0.565899
optic.erl
starcoder
%%-------------------------------------------------------------------- %% Copyright (c) 2020-2021 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the Lice...
apps/emqx/src/emqx_map_lib.erl
0.617974
0.451327
emqx_map_lib.erl
starcoder
%% @author <NAME> <<EMAIL>> [http://yarivsblog.com] %% @copyright <NAME> 2006-2007 %% %% @doc Smerl: Simple Metaprogramming for Erlang %% %% Smerl is an Erlang library %% that simplifies the creation and manipulation of Erlang modules in %% runtime. %% %% You don't need to know Smerl in order to use ErlyWeb; Smerl...
apps/vmq_plugin/src/smerl.erl
0.519034
0.585042
smerl.erl
starcoder
%% @author <NAME> <<EMAIL>> [http://yarivsblog.com] %% @copyright <NAME> 2006-2007 %% %% @doc %% ErlSQL is a domain specific embedded language for %% expressing SQL statements in Erlang as well as a library %% for generating the literal equivalents of ErlSQL expressions. %% %% ErlSQL lets you describe SQL queries usin...
src/erlsql.erl
0.558086
0.634784
erlsql.erl
starcoder
%% Copyright (c) Facebook, Inc. and its affiliates. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicabl...
apps/els_lsp/src/els_erlfmt_ast.erl
0.644784
0.496399
els_erlfmt_ast.erl
starcoder
%%% ========================================================================== %%% Copyright 2015 Silent Circle %%% %%% Licensed under the Apache License, Version 2.0 (the "License"); %%% you may not use this file except in compliance with the License. %%% You may obtain a copy of the License at %%% %%% http://www....
src/sc_util_srv.erl
0.713232
0.452657
sc_util_srv.erl
starcoder
%% @doc horrible-hash is implementation of (perl) hash as an erlang process %% @version 0.1 %% @reference <a href="https://github.com/eiri/horrible-hash">https://github.com/eiri/horrible-hash</a> %% @author <NAME> <<EMAIL>> %% @copyright 2016 <NAME> -module(horrible_hash). %% API exports -export([new/1, delete/1, get...
src/horrible_hash.erl
0.502197
0.52208
horrible_hash.erl
starcoder
-module(solution). -export([main/0]). % The a_i and val are from S={1,..,100} % S contains 25 prime numbers % We use the fundamental theorem of arithmetic, % x = prod_1^25 P_i^e_i, % representing each number x as vector of exponents (e_i) in N^25 % Then: % mult(x, y) -> (e_i + f_i) % lcm(x, y) -> (max(...
Functional Programming/Persistent Structures/Minimum Multiple/version 4/solution.erl
0.529263
0.47792
solution.erl
starcoder
%%%------------------------------------------------------------------- %% @author <NAME> <<EMAIL>> %% @copyright (C) 2017, <NAME> %% @doc erl_knearest_neighbor.erl %% We have a set of movies with textual desciption (assoicated "tags"), %% We have a set of users and their preference of movies in the form of ratings %% W...
erl_content_based_recommendation/erl_content_based_recommendation.erl
0.654453
0.671498
erl_content_based_recommendation.erl
starcoder
-module(zset). -record(zset, {map :: #{}, tree :: gb_trees:tree()}). -export_type([zset/2, result/2, iterator/2, next/2]). -type result(K, V) :: {K, integer(), V}. -opaque zset(K, V) :: #zset{map::#{K => integer()}, tree::gb_trees:tree({integer(), K}, V)}. -opaque iterato...
src/zset.erl
0.594198
0.471467
zset.erl
starcoder
-module(influxdb_uri). -export([ encode/1 ]). -export([ encode_query/1, encode_component/1, encode_component_plus/1, encode_component/2, is_char_reserved/1, is_char_unreserved/1 ]). -export_type([ uri/0, query/0 ]). %% == Encoding URI == -spec encode(uri()) -> binary(). -type uri...
src/influxdb_uri.erl
0.539469
0.472562
influxdb_uri.erl
starcoder
%%% %%% Asynchronous Game of Life %%% http://en.wikipedia.org/wiki/Conway's_Game_of_Life %%% %%% This implementation preserves the standard game behaviour by %%% introducing a master process which represents a global clock. %%% %%% The game runs for finite number of steps and then stops. %%% %%% Another feature of this...
src/life_async.erl
0.590425
0.676994
life_async.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2002-2013. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% ...
lib/compiler/src/beam_dead.erl
0.548915
0.423637
beam_dead.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright (c) 2014 SyncFree Consortium. All Rights Reserved. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file %% except in compliance with the License. You may obtain %% a...
src/vectorclock.erl
0.636579
0.452657
vectorclock.erl
starcoder
%%%------------------------------------------------------------------- %%% @author <NAME> %%% @copyright (C) 2021, <COMPANY> %%% @doc %%% Providing a game grid functionality for a 2048 game with a desired size %%% @end %%%------------------------------------------------------------------- -module(tofe_grid). -define(D...
src/tofe_grid.erl
0.558207
0.545891
tofe_grid.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% Provides a set of utilities to work with enumerables. %%% @end %%%------------------------------------------------------------------- -module(shards_enum). %% API -export([ map/2, reduce/3, reduce_while/3, pmap/2, pmap/3 ]). ...
src/shards_enum.erl
0.573201
0.450239
shards_enum.erl
starcoder
%% @author <NAME> <<EMAIL>> %% @copyright 2010 <NAME> %% @doc Operators for expression evaluation in templates %% Copyright 2010 <NAME> %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %%...
src/erlydtl/erlydtl_operators.erl
0.504639
0.465205
erlydtl_operators.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2017. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Un...
erts/preloaded/src/prim_buffer.erl
0.523908
0.407068
prim_buffer.erl
starcoder
%% @doc %% Encoder/decoder for PostGIS binary data representation. %% %% <ul> %% <li>[https://en.wikipedia.org/wiki/Well-known_text]</li> %% <li>[http://postgis.net/docs/manual-2.4/using_postgis_dbmanagement.html#EWKB_EWKT]</li> %% </ul> -module(ewkb). -export([decode_geometry/1, encode_geometry/1]). -export_type([po...
src/ewkb.erl
0.660501
0.655915
ewkb.erl
starcoder
%%-------------------------------------------------------------------- %% Copyright (c) 2021 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License a...
src/mria_condition_var.erl
0.560854
0.406891
mria_condition_var.erl
starcoder
% Copyright (c) 2014-2015, <NAME> <<EMAIL>> % % Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, % provided that the above copyright notice and this permission notice appear in all copies. % % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM...
src/noesis_proplists.erl
0.735642
0.429908
noesis_proplists.erl
starcoder
-module(directed_weighted_graph_SUITE). -compile(export_all). -compile(nowarn_export_all). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -include("data_structures.hrl"). all() -> [ add_edge_test, delete_edge_test, delete_vertex_test, delete_not_existing_verte...
test/directed_weighted_graph_SUITE.erl
0.529507
0.544135
directed_weighted_graph_SUITE.erl
starcoder
-module(ktn_lists). -export([ delete_first/2, split_when/2, map/3, filter/3 ]). %% @doc Returns a copy of List deleting the first Element where Fun(Element) %% returns true, if there is such an element. %% @end -spec delete_first(fun((term()) -> boolean()), list()) -> ...
src/ktn_lists.erl
0.519765
0.661294
ktn_lists.erl
starcoder
-module(pratt_parser). -export([eval/1, expression/2, expect/2]). -record(pratt_parser, {tokens}). -define(is_pratt_parser(Term), is_record(Term, pratt_parser)). -include("token.hrl"). %% A Pratt parser. Similar to a recursive decent parser but instead %% of coding a function for each production, the syntax is code...
src/pratt_parser.erl
0.546496
0.569075
pratt_parser.erl
starcoder
%% Minimalistic module for performing time-ordered actions in load tests without an event loop -module(timetable). -export([new/3, do/3, do/4, merge/1]). -type time_diff() :: non_neg_integer(). %% milliseconds -type timetable(Event) :: [{time_diff(), Event}]. -type executor(Event) :: fun((escalus:client(), Event) ->...
src/helpers/timetable.erl
0.542136
0.565869
timetable.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
src/config_writer.erl
0.712332
0.469034
config_writer.erl
starcoder
%% Copyright (c) 2013 <NAME> %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in w...
src/luerl_comp_peep.erl
0.586996
0.520618
luerl_comp_peep.erl
starcoder
%% @author <NAME> <<EMAIL>> %% @doc Measure the rate of a connection %% <p>The rate module can measure the current rate of a connection by %% using a sliding window protocol on top of updates.</p> %% <p>You can initialize a new rate object with {@link init/0} after %% which you can subsequently update it by calling {@l...
apps/etorrent/src/etorrent_rate.erl
0.706089
0.699691
etorrent_rate.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
src/couchdb/couch_task_status.erl
0.653238
0.428652
couch_task_status.erl
starcoder
%% @author <NAME> <<EMAIL>> %% @copyright 2009-2010 <NAME> %% Date: 2009-04-26 %% @doc String related functions %% @todo Make this UTF-8 safe %% @todo Check valid chars for filenames, allow chinese, japanese, etc? %% CJK Unified Ideographs Extension A: Range: 3400-4DBF %% CJK Unified Ideographs: Range: 4E00-9FAF %% Ka...
src/support/z_string.erl
0.564219
0.432063
z_string.erl
starcoder
%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless req...
test/emqx_pqueue_SUITE.erl
0.607081
0.48249
emqx_pqueue_SUITE.erl
starcoder
%% -*- erlang -*- %% %% A generic Petri net OTP behavior. %% %% Copyright 2016-2017 <NAME> %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE...
src/gen_pnet.erl
0.717507
0.513607
gen_pnet.erl
starcoder
%% This is an extreme simplification of a typical transient fault. %% The underlaying error is a possible race condition that kicks in now and then. %% The race is observable by a non-functioning API call, resulting in 'error' %% instead of expected value 'ok' %% %% The original bug is a piece of software with many mor...
transient/src/transient.erl
0.513181
0.549761
transient.erl
starcoder
%%%------------------------------------------------------------------------ %% Copyright 2019, OpenTelemetry Authors %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.o...
apps/opentelemetry/src/otel_batch_processor.erl
0.586168
0.435241
otel_batch_processor.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
vtree/src/vtree_modify.erl
0.7413
0.649926
vtree_modify.erl
starcoder
%% @doc Read configuration from eterm files %% %% This module accepts files that looks like this: %% ``` %% {key1, Value1}. %% {key2, Value2}. %% ...''' %% or this: %% ``` %% #{key1 => Value1 %% ,key2 => Value2 %% ... %% }''' %% %% Note that keys don't match directly with the model keys. Instead %% `file_key' metapa...
src/application/lee_consult.erl
0.546617
0.458773
lee_consult.erl
starcoder
%% %% e3d_transf.erl -- %% %% More transformation matrix utilities %% %% Copyright (c) 2010-2011 <NAME> %% %% See the file "license.terms" for information on usage and redistribution %% of this file, and for a DISCLAIMER OF ALL WARRANTIES. %% %% $Id$ %%% %%% @doc More transformation matrix utilities %%% %...
e3d/e3d_transform.erl
0.54359
0.547283
e3d_transform.erl
starcoder
%%% %%% Copyright (c) 2016 The Talla Authors. All rights reserved. %%% Use of this source code is governed by a BSD-style %%% license that can be found in the LICENSE file. %%% %%% ----------------------------------------------------------- %%% @author <NAME> <<EMAIL>> %%% @doc Binary Utility API %%% %%% This module co...
src/onion_binary.erl
0.613584
0.471223
onion_binary.erl
starcoder
?_assert(from_roman("I") == 1), ?_assert(from_roman("II") == 2), ?_assert(from_roman("III") == 3), ?_assert(from_roman("IV") == 4), ?_assert(from_roman("V") == 5), ?_assert(from_roman("VI") == 6), ?_assert(from_roman("VII") == 7), ?_assert(from_roman("VIII") == 8), ?_assert(from_roman("IX") == 9), ?_assert(from_roman("...
fromBash.erl
0.721154
0.553385
fromBash.erl
starcoder
%%%---------------------------------------------------------------------------- %%% Copyright <NAME> 2019. All Rights Reserved. %%% %%% Licensed under the Apache License, Version 2.0 (the "License"); %%% you may not use this file except in compliance with the License. %%% You may obtain a copy of the License at %%% %%%...
src/erleans_timer.erl
0.530723
0.456652
erleans_timer.erl
starcoder
%%%------------------------------------------------------------------- %%% @author <NAME> %%% @copyright (C) 2021 ACK CYFRONET AGH %%% This software is released under the MIT license %%% cited in 'LICENSE.txt'. %%% @end %%%------------------------------------------------------------------- %%% @doc %%% Internal datasto...
src/modules/datastore/time_series/time_series_collection.erl
0.58059
0.470919
time_series_collection.erl
starcoder
%% ============================================================================= %% bondy_dealer.erl - %% %% Copyright (c) 2016-2021 Leapsight. All rights reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may o...
apps/bondy/src/bondy_dealer.erl
0.603114
0.445349
bondy_dealer.erl
starcoder
%%%------------------------------------------------------------------------ %% Copyright 2019, OpenTelemetry Authors %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.o...
apps/opentelemetry/src/otel_exporter.erl
0.601477
0.408277
otel_exporter.erl
starcoder
%%-------------------------------------------------------------------- %% Copyright (c) 2019-2021 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the Lice...
test/ekka_ct.erl
0.560734
0.473231
ekka_ct.erl
starcoder
%% --------------------------------------------------------------------- %% %% Copyright (c) 2007-2013 Basho Technologies, Inc. All Rights Reserved. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file %% except in compliance with the License. You may ...
src/riak_cs_access_log_handler.erl
0.695235
0.504639
riak_cs_access_log_handler.erl
starcoder
%% @doc %% Collects information about the sockets and processes involved %% in the Erlang distribution mechanism. %% %% All metrics include a label 'peer' that indicates which %% distributed connection the metric is about. %% %% ==Exported metrics== %% %% Metrics pertaining to processes may apply to three different typ...
src/collectors/vm/prometheus_vm_dist_collector.erl
0.566858
0.417568
prometheus_vm_dist_collector.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1996-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %...
lib/stdlib/src/string.erl
0.600305
0.470737
string.erl
starcoder
%%%--------------------------------------------------------------------------- %%% @doc %%% Erlang term (jsx-style, %%% [http://www.erlang.org/eeps/eep-0018.html EEP-0018]) to JSON serializer %%% and deserializer. %%% %%% For deserialized JSON hashes, they are compatible with functions from %%% {@link orddict...
src/indira_json.erl
0.562177
0.416559
indira_json.erl
starcoder
-module(aec_db_gc). %% Implementation of Garbage Collection of Account state. %% To run periodically, the GC needs to be `enabled` (config param), %% and node should be synced (although it's not strict requirement - if not synced, %% GC will run a lot more during syncing without much benefit (and slow down syncing). %...
apps/aecore/src/aec_db_gc.erl
0.568775
0.525673
aec_db_gc.erl
starcoder
% ============LICENSE_START======================================================= % org.onap.dcae % ================================================================================ % Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. % ==================================================================...
src/httpabs.erl
0.712632
0.409162
httpabs.erl
starcoder
-module(mysql_pool). -export([start/0, stop/0]). -export([ checkin/2, checkout/1, execute/3, execute/4, query/2, query/3, query/4, transaction/2, transaction/3, transaction/4, with/2 ]). start()-> case application:start(mysql_pool) of ok -> ok; {error, {already_st...
src/mysql_pool.erl
0.529263
0.577168
mysql_pool.erl
starcoder
-module(calculator_eunit). -include_lib("eunit/include/eunit.hrl"). -compile(export_all). calculate_test() -> ?assertEqual(2, calculator:calculate("(1 + 1)")), ?assertEqual(1, calculator:calculate("((2 + 3) - 4)")), ?assertEqual(6, calculator:calculate("((1 + 1) + (2 + 2))")), ?assertEqual({error, braces_error...
test/calculator_eunit.erl
0.5
0.911888
calculator_eunit.erl
starcoder
%%% vim:ts=2:sw=2:et %%%----------------------------------------------------------------------------- %%% @doc Parse transform that implements `str/2' %%% %%% Use `{parse_transform,str}' compiler's option to use this transform. %%% ``` %%% str(Fmt, Args) -> lists:flatten(io_lib:format(Fmt, Args)) %%% throw(Fmt, Arg...
src/str.erl
0.531209
0.411702
str.erl
starcoder
-module(features_count_router_SUITE). -compile(export_all). -include_lib("eunit/include/eunit.hrl"). -include_lib("common_test/include/ct.hrl"). -define(MUT, features_count_router). -define(COUNTER_MOD, features_counter). -define(STORE_LIB, test_store_lib). all() -> [{group, test_count}]. groups() -> [ ...
tests/features_count_router_SUITE.erl
0.533884
0.444444
features_count_router_SUITE.erl
starcoder
% License: Apache License, Version 2.0 % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in...
src/ej.erl
0.723114
0.402862
ej.erl
starcoder
%% Licensed under the Apache License, Version 2.0 (the "License"); you may %% not use this file except in compliance with the License. You may obtain %% a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0> %% %% Unless required by applicable law or agreed to in writing, software %% distributed under th...
apps/zotonic_filewatcher/src/zotonic_filewatcher_monitor.erl
0.696681
0.400339
zotonic_filewatcher_monitor.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
src/hastings_fabric_search.erl
0.601828
0.427337
hastings_fabric_search.erl
starcoder
%% Copyright (c) 2012, Treetop Software LLC %% %% Permission to use, copy, modify, and/or distribute this software for any %% purpose with or without fee is hereby granted, provided that the above %% copyright notice and this permission notice appear in all copies. %% %% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR ...
src/geohash.erl
0.678007
0.427815
geohash.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2018-2022. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% ...
lib/runtime_tools/src/scheduler.erl
0.674908
0.476397
scheduler.erl
starcoder
%% @author <NAME> <<EMAIL>> %% @copyright 2007 Mochi Media, Inc. %% @doc Case preserving (but case insensitive) HTTP Header dictionary. -module(mochiweb_headers). -author('<EMAIL>'). -export([from_list/1, insert/3, enter/3, get_value/2, lookup/2]). -export([delete_any/2, get_primary_value/2]). -export([default/3, ent...
src/mochiweb_headers.erl
0.62395
0.534552
mochiweb_headers.erl
starcoder
%% @doc This implements an http client using the Erlang built in http client. %% If desired, this could be abstracted to support arbitrary http clients that %% return `{ok, Status :: non_neg_integer(), Body :: binary(), Headers :: map()}' %% or `{error, Reasons :: [term()]}'. %% %% On errors, there will be a number of ...
src/aws_credentials_httpc.erl
0.605449
0.415966
aws_credentials_httpc.erl
starcoder
% @doc Bitstring editing and printing. % @end -module(grisp_bitmap). % API -export([set_bits/3]). -export([get_bits/3]). -export([set_bytes/3]). -export([get_bytes/3]). -export([pp/1]). -export([pp/2]). %--- Types --------------------------------------------------------------------- -type coding() :: bin | binary | ...
src/grisp_bitmap.erl
0.546012
0.414366
grisp_bitmap.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
src/couch_jobs/src/couch_jobs_type_monitor.erl
0.589953
0.460713
couch_jobs_type_monitor.erl
starcoder
-module(autocluster_periodic). %% @doc %% Manages periodic activities in a centralized fashion. TRefs from %% {@link timer:apply_interval/4} are stored to ETS along with the %% provided identifier, so you can later stop the activity using only %% that identifier (withouth knowing timer ref). %% %% Initial plan was to...
src/autocluster_periodic.erl
0.634883
0.49048
autocluster_periodic.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
src/couch_jobs/src/couch_jobs_activity_monitor.erl
0.604399
0.421909
couch_jobs_activity_monitor.erl
starcoder
%%%------------------------------------------------------------------- %% @doc %% This module models the LWT SubDAO contract %% In its state it maintains: %% %% - Nonce of synced state with LWT chain %% %% - Holders of LWT tokens %% %% - Staked validator information %% %% - How much HNT needs to be burned next time the...
src/lwt_contract.erl
0.545044
0.411584
lwt_contract.erl
starcoder
%%%------------------------------------------------------------------- %%% @author <NAME> <<EMAIL>> %%% @copyright (C) 2014, <NAME> %%% @doc %%% Generic utility functions that are independent from the %%% problem context %%% @end %%% Created : 10 Feb 2014 by <NAME> %%%---------------------------------------------------...
src/symbolic-execution/utils.erl
0.63273
0.678307
utils.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% This module encapsulates the partitioned table metadata. %%% %%% Different properties must be stored somewhere so `shards' %%% can work properly. Shards perform logic on top of ETS tables, %%% for example, compute the partition based o...
src/shards_meta.erl
0.569613
0.414395
shards_meta.erl
starcoder
%%-------------------------------------------------------------------- %% Copyright (c) 2020 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License a...
test/emqx_misc_SUITE.erl
0.550607
0.508849
emqx_misc_SUITE.erl
starcoder
-module(rational). -export([new/1, new/2, add/2, multiply/2, subtract/2, reciprocal/1, compare/2, minimum/2, maximum/2]). -export_type([rational/0]). -record(rational, {numerator :: integer(), denominator :: integer()}). -opaque rational() :: #rational{}. %% @doc Create a new rational n...
src/rational.erl
0.747339
0.632474
rational.erl
starcoder
-module(cqerl_hash). -behaviour(gen_server). %% This module performs the heavy lifting for the 'hash' application mode. %% Below is some background behind the creation of this mode as well as an %% overview of its operation. %% %% A note on terminology: When I say "client" I mean a cqerl_client process. %% When I say...
src/cqerl_hash.erl
0.590071
0.461077
cqerl_hash.erl
starcoder
%% `perforator_ci` is a continious performance integration tool which %% uses `perforator` output statistics. It can nicely track and show %% performance tests degradations. %% %% `perforator_ci` consists of 3 "major" objects: %% * projects (`perforator_ci_project`) %% * builders (`perforator_ci_builder`) %% * web back...
src/perforator_ci.erl
0.564098
0.51751
perforator_ci.erl
starcoder
%%% Concurrent Programming In Erlang -- The University of Kent / FutureLearn %%% Exercise 2 : URL https://www.futurelearn.com/courses/concurrent-programming-erlang/3/steps/488337 %% Author: <NAME>. -module(reader). -export([receiver/0]). %% Using indirect recursion to avoid repeating the call back to receiver in ...
exercises/e2/reader.erl
0.503174
0.450359
reader.erl
starcoder
%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless req...
test/ekka_SUITE.erl
0.521959
0.415551
ekka_SUITE.erl
starcoder
%% This Source Code Form is subject to the terms of the Mozilla Public %% License, v. 2.0. If a copy of the MPL was not distributed with this %% file, You can obtain one at https://mozilla.org/MPL/2.0/. %% %% Copyright (c) 2021-2022 VMware, Inc. or its affiliates. All rights reserved. %% -module(tx_funs). -include_l...
test/tx_funs.erl
0.649579
0.441974
tx_funs.erl
starcoder
%% ------------------------------------------------------------------- %% %% riaknostic - automated diagnostic tools for Riak %% %% Copyright (c) 2011 Basho Technologies, Inc. All Rights Reserved. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); you may not use this file %% ...
deps/riaknostic/src/riaknostic_node.erl
0.612889
0.475484
riaknostic_node.erl
starcoder
-module(knuth). -export([knuth/1]). -export_type([ group/0, constraint/0, exact_cover_request/0, treatment_fun/0, evaluation/0]). -type group() :: list(). -type constraint() :: fun((list()) -> boolean()). -type exact_cover_request() :: {list(group()),list(constraint())}. -type treatment_fun() ::...
src/knuth.erl
0.552298
0.429071
knuth.erl
starcoder
%%% @doc %%% BLOCKTYPE %%% Floating point value to Seven Segment Variable Digits Decoder %%% DESCRIPTION %%% Convert an input floating point number to a set of bytes. %%% one per digit, indicating which segments of a %%% seven segment display digit should be turned on. %%% LINKS %%% @end -module(...
src/block_types/lblx_float_to_7seg.erl
0.502686
0.485844
lblx_float_to_7seg.erl
starcoder
-module(primality). %% API exports -export([ is_prime/1, is_prime/2 ]). %% Type exports -export_type([ is_prime_option/0, is_prime_options/0 ]). %%==================================================================== %% Internal macros %%================================================================...
src/primality.erl
0.743354
0.586404
primality.erl
starcoder
%% @copyright 2007-2008 Basho Technologies %% @reference <NAME> (1978). "Time, clocks, and the ordering of events in a distributed system". Communications of the ACM 21 (7): 558-565. %% @reference <NAME> (1988). "Virtual Time and Global States of Distributed Systems". Workshop on Parallel and Distributed Algorithms: ...
src/vclock.erl
0.683525
0.423071
vclock.erl
starcoder
%% @doc %% Infinite lists realization. %% %% @author <NAME> % Module name. -module(inflists). % We don't need hd and tl functions for lists because we use the same names for infinite lists. -compile({no_auto_import, [hd/1, tl/1]}). % Export. -export([% Constructors. iterate/3, iterate/2, % Get infi...
src/inflists.erl
0.507812
0.455259
inflists.erl
starcoder
-module(coello_queue_spec). -include_lib("espec/include/espec.hrl"). -include_lib("hamcrest/include/hamcrest.hrl"). -include_lib("amqp_client/include/amqp_client.hrl"). spec() -> before_all(fun() -> meck:new([amqp_connection, amqp_channel]), meck:expect(amqp_connection, start, 1, connection), ...
test/spec/coello_queue_spec.erl
0.655557
0.428054
coello_queue_spec.erl
starcoder
%% Copyright (c) 2016 <NAME> <<EMAIL>> %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed t...
src/tansu_api.erl
0.509032
0.412353
tansu_api.erl
starcoder
%% Copyright (c) 2012, <NAME> <<EMAIL>> %% %% Permission to use, copy, modify, and/or distribute this software for any %% purpose with or without fee is hereby granted, provided that the above %% copyright notice and this permission notice appear in all copies. %% %% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISC...
src/glc.erl
0.729038
0.46132
glc.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% Streams is the Strava term for the raw data associated with an %%% activity. %%% @reference http://strava.github.io/api/v3/streams/ %%% @end %%% For copyright notice see LICENSE. %%%------------------------------------------------------...
src/strava_stream.erl
0.51879
0.46217
strava_stream.erl
starcoder
-module(iso8601). -export([add_time/4, add_days/2, add_months/2, add_years/2, subtract_time/4, format/1, parse/1, parse_exact/1, parse_duration/1, apply_duration/2]). -export_types([timestamp/0]). -define(MIDNIGHT, {0,0,0}). -define(NOON...
src/iso8601.erl
0.54359
0.423995
iso8601.erl
starcoder
%%% @doc Merkle Trees are a data structures devised especially to find %%% conflicts or diverging pieces of data between two data sets. %%% %%% They're more or less a hybrid between a sparse K-ary tree and a %%% trie of hash values. %%% %%% Each `{Key, Value}' pair gets two hashes: a hash of the key (Hkey), and %%% a h...
src/merklet.erl
0.524638
0.7773
merklet.erl
starcoder
%% @doc API for various coding schemes with Rust NIF as the backend. %% %% Exposes: %% %% `golay_extended_encode' %% %% `golay_extended_decode' %% %% `golay_standard_encode' %% %% `golay_standard_decode' %% %% `golay_shortened_encode' %% %% `golay_shortened_decode' %% %% `bch_encode' %% %% `bch_decode' %% %% `hamming_s...
src/erlcode.erl
0.600657
0.48377
erlcode.erl
starcoder
% Licensed under the Apache License, Version 2.0 (the "License"); you may not % use this file except in compliance with the License. You may obtain a copy of % the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the ...
src/knit_kmod.erl
0.620277
0.433262
knit_kmod.erl
starcoder