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
%% 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_ps.erl
0.556038
0.412234
tansu_ps.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) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. %% -module(file_handle_cache). ...
erlang_server/_build/default/lib/rabbit_common/src/file_handle_cache.erl
0.66072
0.528229
file_handle_cache.erl
starcoder
%%-------------------------------------------------------------------- %% Copyright (c) 2019 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/esockd_udp_SUITE.erl
0.511229
0.432723
esockd_udp_SUITE.erl
starcoder
-module(intcode_io). -export([ push/2, poll/1, poll_or_notify/2, as_list/1 ]). -export_type([ intcode_io/0 ]). -type intcode_io() :: tuple(). -callback poll(Reference) -> {intcode:value(), Reference} when Reference :: intcode_io(). -callback push(Reference, intcode:value()) -> Reference when Reference :: in...
src/intcode/intcode_io.erl
0.562177
0.474022
intcode_io.erl
starcoder
%% vim: set ai et sw=4 sts=4: %% See LICENSE for licensing information. -module(solarized_binary_diff). -export([ diff/2 ]). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). -endif. % A diff implementation based on: % - https://neil.fraser.name/writing/diff/ % % More complete implementations already e...
src/solarized_binary_diff.erl
0.650023
0.499023
solarized_binary_diff.erl
starcoder
%% @copyright 2013-2016 <NAME> <<EMAIL>> %% %% @doc An object which represents a node on a consistent hash ring %% @end -module(hash_ring_node). %%---------------------------------------------------------------------------------------------------------------------- %% Exported API %%-----------------------------------...
src/hash_ring_node.erl
0.663996
0.442877
hash_ring_node.erl
starcoder
%============================================================================== %% @copyright 2019-2020 Erlang Solutions Ltd. %% Licensed under the Apache License, Version 2.0 (see LICENSE file) %% @end %% %% @doc %% In this scenario, users are creating PEP nodes and publishing items. %% Users are publishing items to t...
src/scenarios/pubsub_pep.erl
0.636353
0.57827
pubsub_pep.erl
starcoder
-module(shapes). -export([perimeter/1, area/1, enclose/1]). -include_lib("eunit/include/eunit.hrl"). % <NAME> % 2017-03-12 % % Valid shapes: % {circle,{X,Y},R} % {rectangle,{X,Y},H,W} % {triangle,{X,Y},A,B,Theta} (side lengths A, B, & angle b/w of Theta) % % Assumes: "smallest enclosing rectangle" mea...
1_24/shapes.erl
0.656108
0.594698
shapes.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_ctl_SUITE.erl
0.516595
0.424412
emqx_ctl_SUITE.erl
starcoder
%% @author <NAME> <<EMAIL>> %% @copyright 2009 <NAME> %% Date: 2009-10-02 %% @doc OAuth. %% Copyright 2009 <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.apa...
modules/mod_atom/atom_convert.erl
0.525856
0.410077
atom_convert.erl
starcoder
%% @doc Module containing available functions used as aggregates, filtering or any predifined function. -module(functions). -export([max/1, min/1, mean/1, median/1, send_trigger/2, pred_filter_above/1, pred_filter_under/1, pred_filter_above_under/2]). %%% AGGREGATES %% @doc Gives the maximum of items contained the ...
src/functions.erl
0.525369
0.684205
functions.erl
starcoder
-module(utils). -export([ datetime_to_timestamp/1, string_format/2, get_legacy_rsa_ciphers/0, formap/2, map_to_sequential_list/1, sequential_list_to_map/1, float_to_string/1, float_to_string/2, int_to_string/1, string_to_float/1, emptyloop/1, reinit_mnesia_cluster/0 ]). ...
src/utils.erl
0.511717
0.610918
utils.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/gr_lc.erl
0.724091
0.460895
gr_lc.erl
starcoder
%%%=================================================================== %% @author <NAME> %% @copyright 2017 Pundun Labs AB %% 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.ap...
apps/wikix/src/wikix_bench.erl
0.565299
0.407628
wikix_bench.erl
starcoder
% inspired from 'https://github.com/robertoaloi/eunit_terms/blob/master/eunit_terms.erl' -module(eunit_jsonreport). -behaviour(eunit_listener). -include_lib("eunit/include/eunit.hrl"). -export([start/0, start/1]). -export([init/1, handle_begin/3, handle_end/3, handle_cancel/3, te...
apps/erlangbridge/src/eunit_jsonreport.erl
0.58747
0.557544
eunit_jsonreport.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.592195
0.489076
vectorclock.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 ...
src/otter_lib_snapshot_count.erl
0.648466
0.427337
otter_lib_snapshot_count.erl
starcoder
%%%---------------------------------------------------------------------------- %%% @author <NAME> <<EMAIL>> %%% @copyright 2012 University of St Andrews (See LICENCE) %%% @headerfile "skel.hrl" %%% %%% @doc This module contains various functions to help us when profiling and %%% benchmarking. %%% %%% This allows us v...
src/sk_profile.erl
0.760028
0.754056
sk_profile.erl
starcoder
-module(aoc2015_day24). -behavior(aoc_puzzle). -export([parse/1, solve1/1, solve2/1, info/0]). -include("aoc_puzzle.hrl"). -spec info() -> aoc_puzzle(). info() -> #aoc_puzzle{module = ?MODULE, year = 2015, day = 24, name = "It Hangs in the Balance", ...
src/2015/aoc2015_day24.erl
0.572842
0.656768
aoc2015_day24.erl
starcoder
%%%----------------------------------------------------------------------------- %%% %%% Copyright (c) 2016-2017 Klarna AB %%% %%% 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 th...
src/avro_decoder_hooks.erl
0.589716
0.409398
avro_decoder_hooks.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1999-2020. 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/sys_core_fold.erl
0.563258
0.435541
sys_core_fold.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2000-2015. 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_scanner.erl
0.556882
0.410993
xref_scanner.erl
starcoder
%%%============================================================================= %% Copyright 2012- Klarna AB %% Copyright 2015- 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 %%...
src/jesse_schema_validator.erl
0.73307
0.426799
jesse_schema_validator.erl
starcoder
%% ------------------------------------------------------------------- %% %% jam_math: Simple date/time math functions against Erlang's %% date/time tuples %% %% Copyright (c) 2016 Basho Technologies, Inc. All Rights Reserved. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "...
src/jam_math.erl
0.592195
0.525125
jam_math.erl
starcoder
%% Copyright 2015 <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 wr...
src/fn_error.erl
0.600774
0.47591
fn_error.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% Additional iterator utilities that are not replicas of `lists' %%% module functionality. These functions are kept separate to avoid %%% any future name clashes with additions to the stdlib. %%% %%% Unlike the functions in `llists', thes...
src/llists_utils.erl
0.699562
0.707533
llists_utils.erl
starcoder
% @doc API for the % <a href="https://reference.digilentinc.com/reference/pmod/pmodhygro/start"> % PmodHYGRO % </a>. % % Start the driver with % ``` % 1> grisp:add_device(i2c, pmod_hygro). % ''' % @end -module(pmod_hygro). -behaviour(gen_server). % API -export([start_link/2]). -export([temp/0]). -export([humid/0]). -e...
src/pmod_hygro.erl
0.533641
0.425187
pmod_hygro.erl
starcoder
%% The contents of this file are subject to the Mozilla Public License %% Version 1.1 (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.mozilla.org/MPL/ %% %% Software distributed under the License is distributed on an "AS IS" %% b...
src/mn_climber_version.erl
0.622115
0.475118
mn_climber_version.erl
starcoder
%% %% @doc Restoring RSA private key from its parts. %% %% RSA private key consists of four integer values `{p, q, t, d}'. %% The knowledge of any one of these values is sufficient to %% compute all the other three. %% %% Easy case: Attacker knows `p' (or `q'). Then %% ``` %% q = n / p %% t = (p - 1)(q - 1) / gcd(p - 1...
lib/ndpar/src/rsa_private_key.erl
0.699152
0.700612
rsa_private_key.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_core: Core Riak Application %% %% Copyright (c) 2007-2015 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 c...
src/riak_core_claim.erl
0.634996
0.425367
riak_core_claim.erl
starcoder
%% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with your Erlang distribution. If not, it can be %% retrieved via the world ...
src/lager_trunc_io.erl
0.510985
0.403508
lager_trunc_io.erl
starcoder
%% Copyright 2018 Erlio GmbH Basel Switzerland (http://erl.io) %% %% 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 b...
apps/vmq_server/src/vmq_schema.erl
0.63114
0.40489
vmq_schema.erl
starcoder
%% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang...
apps/etorrent/src/etorrent_http_uri.erl
0.582372
0.406509
etorrent_http_uri.erl
starcoder
%%%------------------------------------------------------------------- %%% @copyright (C) 2016, AdRoll %%% @doc %%% %%% Kinesis record aggregator. %%% %%% Follows the KPL aggregated record format: %%% https://github.com/awslabs/amazon-kinesis-producer/blob/master/aggregation-format.md %%% %%% This is an...
src/kpl_agg.erl
0.59843
0.481881
kpl_agg.erl
starcoder
-module(dsdc_accounts_trees). %% API - similar to OTP `gb_trees` module -export([empty/0, empty_with_backend/0, get/2, lookup/2, enter/2]). %% API - Merkle tree -export([root_hash/1, commit_to_db/1 ]). %% API - Proof of inclusion -export([ add_poi/3 , veri...
apps/dsdcore/src/dsdc_accounts_trees.erl
0.64131
0.419113
dsdc_accounts_trees.erl
starcoder
% @doc % <a href="https://reference.digilentinc.com/reference/pmod/pmodgps/reference-manual"> % PmodGPS</a> % module. % % The PmodGPS sends the GPS data over UART. % % Start the driver with % ``` % 1> grisp:add_device(uart, pmod_gps). % ''' % @end -module(pmod_gps). -behaviour(gen_server). % API -export([start_link/2...
src/pmod_gps.erl
0.527073
0.511107
pmod_gps.erl
starcoder
%% Copyright (c) 2020 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 appl...
erltc/src/erlt_import.erl
0.588298
0.408218
erlt_import.erl
starcoder
%% %% e3d_bv.erl -- %% %% Bounding volume operations. %% Bounding boxes and quickhull, and eigen-vecs calculation implemented %% %% Copyright (c) 2001-2011 <NAME> %% %% See the file "license.terms" for information on usage and redistribution %% of this file, and for a DISCLAIMER OF ALL WARRANTIES. %% %% ...
e3d/e3d_bv.erl
0.504883
0.538741
e3d_bv.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% Defines a repository. %%% %%% A repository maps to an underlying data store, controlled by the adapter. %%% For example, CrossDB ships with a `xdb_mnesia_adapter' that stores data into %%% Mnesia database. %%% %%% When used, the reposit...
src/xdb_repo.erl
0.686895
0.51068
xdb_repo.erl
starcoder
%%%============================================================================= %%% @doc Advent of code puzzle solution %%% @end %%%============================================================================= -module(aoc2020_day20). -behavior(aoc_puzzle). -export([ parse/1 , solve1/1 , solve2/1 ...
src/2020/aoc2020_day20.erl
0.509764
0.550426
aoc2020_day20.erl
starcoder
-module(aoc2018_day03). -behavior(aoc_puzzle). -export([parse/1, solve1/1, solve2/1, info/0]). -include("aoc_puzzle.hrl"). -spec info() -> aoc_puzzle(). info() -> #aoc_puzzle{module = ?MODULE, year = 2018, day = 3, name = "No Matter How You Slice It", ...
src/2018/aoc2018_day03.erl
0.509032
0.57681
aoc2018_day03.erl
starcoder
%% %% Copyright (c) dushin.net %% 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 required by applic...
src/sht3x.erl
0.73307
0.411939
sht3x.erl
starcoder
-module(spiral_memory). -export([manhattan_distance/1, find_point/1, shell/1, test/0, stress_test/1]). origin() -> {point, 0, 0}. add_point({point, X1, Y1}, {point, X2, Y2}) -> {point, X1 + X2, Y1 + Y2}. % Defaults to distance from origin manhattan_distance({point, _, _} = Point) -> manhattan_distance(Point, o...
2017/03/spiral_memory.erl
0.512449
0.706225
spiral_memory.erl
starcoder
%%%------------------------------------------------------------------- %%% @author wang <<EMAIL>> %%% @copyright (C) 2015 %%% @doc %%% %%% @end %%% Created : 2015-03-23 14:46 %%%------------------------------------------------------------------- -module(arrow). -author("wang"). %% API -export([now/0, timestam...
src/arrow.erl
0.542863
0.402627
arrow.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% This module provides the public API for eflambe. These public functions are %%% intended to be invoked by the end user to perform profiling of their %%% application. %%% @end %%%----------------------------------------------------------...
src/eflambe.erl
0.5794
0.538559
eflambe.erl
starcoder
% % Exercise 3-8: Evaluating and Compiling Expressions % % Strings are fully parenthesized and can include the following binary operators: +, -, *. % Additionally, the unary ~ (negative) operator is supported. % % Example input strings: % (4+3) % ((5-3)*2) % ~23 % (~25+3) -module(expression_parser). -export([parse/1, ...
Erlang/ErlangProgrammingBook/expression_parser.erl
0.563618
0.651355
expression_parser.erl
starcoder
%%---------------------------------------------------------------- %% Copyright (c) 2013-2016 Klarna AB %% %% 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 %% %% htt...
test/mnesia_leveled_fallback.erl
0.509032
0.438785
mnesia_leveled_fallback.erl
starcoder
%% ------------------------------------------------------------------- %% Copyright (c) 2016 <NAME>, 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 obtain %% a copy of th...
src/riak_core_table_owner.erl
0.624637
0.461805
riak_core_table_owner.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright (c) 2012 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 obtain ...
deps/yokozuna/src/yz_cover.erl
0.617974
0.402627
yz_cover.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_kv_fsm_timing: Common code for timing fsm states %% %% Copyright (c) 2007-2010 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 thi...
deps/riak_kv/src/riak_kv_fsm_timing.erl
0.616474
0.49048
riak_kv_fsm_timing.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.erl
0.729809
0.427935
jobs.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% A set of optics specific to orddicts. %%% %%% As orddicts are internally represented as a list of pairs, the %%% type checks used here are not as reliable as those used for other %%% optics. Please ensure via other means that these opti...
src/optic_orddict.erl
0.618665
0.416619
optic_orddict.erl
starcoder
%% Copyright (c) 2013-2014 <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 agr...
src/rationals.erl
0.783823
0.472988
rationals.erl
starcoder
%% Copyright 2018 Octavo Labs AG Zurich Switzerland (https://octavolabs.com) %% %% 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 %% %% Unl...
apps/vmq_swc/src/vmq_swc_dkm.erl
0.81571
0.690256
vmq_swc_dkm.erl
starcoder
%% Copyright (c) 2019-2021, <NAME> <<EMAIL>>. 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 require...
src/uef_lists.erl
0.604165
0.458349
uef_lists.erl
starcoder
%% The contents of this file are subject to the Mozilla Public License %% Version 1.1 (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.mozilla.org/MPL/ %% %% Software distributed under the License is distributed on an "AS IS" %% b...
src/qp_log.erl
0.53048
0.506591
qp_log.erl
starcoder
%% @author Couchbase <<EMAIL>> %% @copyright 2012-2018 Couchbase, Inc. %% %% 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 r...
src/vbucket_move_scheduler.erl
0.689201
0.484685
vbucket_move_scheduler.erl
starcoder
-module(teal_behaviours). -export([ has_callback/3, assert_has_callback/3, assert_has_callback/4, is_behaviour/1, assert_is_behaviour/1, assert_is_behaviour/2, implements_behaviour/2, assert_implements_behaviour/2, assert_implements_behaviour/3]). %%%===================================================...
src/teal_behaviours.erl
0.615666
0.499329
teal_behaviours.erl
starcoder
-module(day3). %% API exports -export([part1/1, part2/1]). part1(File) -> Binaries = read_binaries(File), {Gamma, Epsilon} = gamma_epsilon(Binaries), GammaDec = bin_to_dec(Gamma), EpsilonDec = bin_to_dec(Epsilon), GammaDec * EpsilonDec. gamma_epsilon(Binaries) -> Columns = transpose(Binaries)...
src/day3.erl
0.522202
0.639455
day3.erl
starcoder
%% @doc %% A collector for a set of metrics. %% %% Normal users should use {@link prometheus_gauge}, %% {@link prometheus_counter}, {@link prometheus_summary} %% and {@link prometheus_histogram}. %% %% Implementing `:prometheus_collector' behaviour is for advanced uses %% such as proxying metrics from another monitorin...
src/prometheus_collector.erl
0.596668
0.443721
prometheus_collector.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 ...
gc-couchdb/src/couch_spatial_index.erl
0.696991
0.431405
couch_spatial_index.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...
test/mria_fault_tolerance_suite.erl
0.518546
0.592224
mria_fault_tolerance_suite.erl
starcoder
-module(model_langton3d). -behaviour(model). -include("parallant.hrl"). -export([initial_population/3, move/3, get_agent_char/2]). -type cell_state() :: dead | alive. -type cell() :: {cell_state()}. -type direction() :: pos_x | neg_x | pos_y | neg_y | pos_z | neg_z. -type langton_rule() :: [directi...
src/model_langton3d.erl
0.525125
0.437283
model_langton3d.erl
starcoder
%% @doc A module to read variable-length codes from a byte stream. -module(code_reader). -export([read_code/2]). %% @doc Reads an N-bit code from the given list of bytes, where the requested %% code may span multiple bytes. %% %% A single code may be smaller than one byte. A code may also span more than %% one byte, ...
src/code_reader.erl
0.786541
0.820073
code_reader.erl
starcoder
%% @copyright <NAME> %% @author <NAME> <<EMAIL>> %% @version {@vsn}, {@date} {@time} %% @doc ETS Counter Table Garbage Collector %% @todo Optimize the implementation when markthreshold=0 (just %% delete_object({Key, 0}) from main table. %% @end -module(ectr_gc). -export([new/2 ,init_table/1 ,delete_t...
src/ectr_gc.erl
0.593374
0.432902
ectr_gc.erl
starcoder
%% @author <NAME> <<EMAIL>> [http://yarivsblog.com] %% @copyright <NAME> 2006-2007 %% @doc ErlyDB: The Erlang Twist on Database Abstraction. %% %% == Contents == %% %% {@section Introduction}<br/> %% {@section Primary and Foreign Key Conventions} %% %% == Introduction == %% ErlyDB is a ...
src/erlydb/erlydb.erl
0.63114
0.65994
erlydb.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright (c) 2015 <NAME>. 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 copy of the ...
src/lasp_type.erl
0.598547
0.461805
lasp_type.erl
starcoder
%% @doc: Implementation of HyperLogLog with bias correction as %% described in the Google paper, %% http://static.googleusercontent.com/external_content/untrusted_dlcp/ %% research.google.com/en//pubs/archive/40671.pdf -module(hyper). %%-compile(native). -export([new/1, new/2, insert/2, insert_many/2]). -export([unio...
src/hyper.erl
0.546254
0.4856
hyper.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright (c) 2017 <NAME>. 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 copy of the ...
src/trcb_base_resender.erl
0.539469
0.406067
trcb_base_resender.erl
starcoder
%% Copyright (c) 2013-2019 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 %% %% Unles...
test/emqx_pool_SUITE.erl
0.625896
0.414543
emqx_pool_SUITE.erl
starcoder
-module(statman_counter). -export([init/0, counters/0, get/1, get_all/0, reset/2]). -export([incr/1, incr/2, decr/1, decr/2, set/2]). -compile([{no_auto_import, [get/1]}]). -include_lib("eunit/include/eunit.hrl"). -define(TABLE, statman_counters). %% %% API %% init() -> ets:new(?TABLE, [named_table, public, se...
src/statman_counter.erl
0.525856
0.583055
statman_counter.erl
starcoder
-module(md_writer). -export([build_md/2]). %%============================================================================== %% API %%============================================================================== build_md(Data, Path) -> {value, {_, Name, Text}} = lists:keysearch(overview, 1, Data), filelib:ensure...
src/md_writer.erl
0.52074
0.619759
md_writer.erl
starcoder
%% @author Couchbase <<EMAIL>> %% @copyright 2015-2021 Couchbase, Inc. %% %% 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 r...
src/menelaus_web_cert.erl
0.571647
0.432183
menelaus_web_cert.erl
starcoder
%% @author Couchbase <<EMAIL>> %% @copyright 2017 Couchbase, Inc. %% %% 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 requir...
src/menelaus_web_samples.erl
0.604983
0.474449
menelaus_web_samples.erl
starcoder
% @doc OTPCL pipes up the wazoo. OTPCL treats any command that starts with a % pipe character (`|') as a command terminator - that is, it'll treat all the % words before it as one command, then resume command parsing. This is a bit % tricky to describe in English, so it's easier to just show you that this: % % ``` % ...
src/otpcl_pipes.erl
0.558568
0.578002
otpcl_pipes.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2017-2018. 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/sys_core_bsm.erl
0.568296
0.419707
sys_core_bsm.erl
starcoder
%% vim: set ai et sw=4 sts=4: %% See LICENSE for licensing information. -module(solarized_list_diff). -export([ diff/2 ]). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). -endif. % A diff implementation based on: % - https://neil.fraser.name/writing/diff/ % % More complete implementations already exi...
src/solarized_list_diff.erl
0.582254
0.55929
solarized_list_diff.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_kv_pncounter: A convergent, replicated, state based PN counter %% %% 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 m...
deps/riak_kv/src/riak_kv_pncounter.erl
0.630912
0.484624
riak_kv_pncounter.erl
starcoder
-module(tql_lists). %% API -export([ all/1 , any/1 , droplast_n/2 , intersperse/2 , shuffle/1 , take/2 , uniq/1 , groups_of/2 ]). %%%--------------------------------------------------------------------- %%% API %%%---------------------------------------...
src/tql_lists.erl
0.508056
0.558869
tql_lists.erl
starcoder
%%% @doc Internal representation and logic of a LSL match. -module(lsl_core). -author('<EMAIL>'). -type stick_state() :: clean | crossed. -type row_state() :: [stick_state()]. -type board() :: [row_state()]. -type history() :: [row_state()]. -opaque match() :: #{ board => board() ...
src/core/lsl_core.erl
0.513668
0.526038
lsl_core.erl
starcoder
%%%------------------------------------------------------------------- %% @copyright <NAME> %% @author <NAME> <<EMAIL>> %% @version {@vsn}, {@date} {@time} %% @doc Library to turn rrd datastructures into rrd command strings. %% @end %%%------------------------------------------------------------------- -module(errd_com...
src/errd_command.erl
0.646795
0.486088
errd_command.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_kv_crdt: A general purpose bridge between a CRDT and riak_object %% %% 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...
deps/riak_kv/src/riak_kv_crdt.erl
0.606615
0.403743
riak_kv_crdt.erl
starcoder
%% ---------------------------------------------------------------------------- %% %% oauth2: Erlang OAuth 2.0 implementation %% %% Copyright (c) 2012-2013 KIVRA %% %% Permission is hereby granted, free of charge, to any person obtaining a %% copy of this software and associated documentation files (the "Software"), %%...
src/oauth2_priv_set.erl
0.610686
0.403508
oauth2_priv_set.erl
starcoder
%% @author <NAME> %% @copyright 2009 <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 agr...
src/estring.erl
0.664214
0.463141
estring.erl
starcoder
%% Copyright (c) 2020 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 appl...
erltc/src/erlt_pinning.erl
0.622
0.446495
erlt_pinning.erl
starcoder
%% ------------------------------------------------------------------- %% %% Machi: a small village of replicated files %% %% Copyright (c) 2014 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...
prototype/chain-manager/src/machi_util.erl
0.5
0.414366
machi_util.erl
starcoder
%% @author <NAME> <<EMAIL>> %% @copyright 2009-2014 <NAME> %% %% @doc Utility functions for datetime handling and representation. %% Copyright 2009-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 c...
src/support/z_datetime.erl
0.505127
0.401629
z_datetime.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2010-2020. 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/diameter/src/compiler/diameter_codegen.erl
0.603932
0.491761
diameter_codegen.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1996-2015. 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/edoc/src/edoc_specs.erl
0.510008
0.400456
edoc_specs.erl
starcoder
-module(tpTc). -compile(inline). -compile({inline_size, 128}). -export([ tc/1 , tc/2 , tc/3 , ts/4 , tm/5 , cvrTimeUnit/3 , test/1 ]). %% Measure the execution time (in nanoseconds) for Fun(). -spec tc(Fun :: function()) -> {Time :: integer(), Value :: term()}. tc(F) -> T1 =...
src/tc/tpTc.erl
0.589362
0.42185
tpTc.erl
starcoder
-module(teal_types). -export([not_of_type/2, not_record/1, assert_not_record/1, assert_not_record/2, could_be_record/1, assert_could_be_record/1, assert_could_be_record/2 ]). %%%=================================================================== %%% API %%%===================================...
src/teal_types.erl
0.569972
0.462837
teal_types.erl
starcoder
%% @doc This module is used to access a sharded Redis cluster. %% %% An important thing to note about sharding is that if you change the ring, %% keys will be hashed on different shards. This requires a data migration. Right now %% it is recommend to do pre-sharding, which means, create a large number of shards up fro...
src/erldis_shard.erl
0.513425
0.567457
erldis_shard.erl
starcoder
% Copyright 2008 Konrad-Zuse-Zentrum für Informationstechnik Berlin % % 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 re...
test/util_SUITE.erl
0.675122
0.492188
util_SUITE.erl
starcoder
%% Copyright (c) 2019-2021, <NAME> <<EMAIL>>. 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 require...
src/uef_num.erl
0.766862
0.602822
uef_num.erl
starcoder
%% ------------------------------------------------------------------- %% %% xqerl - XQuery processor %% %% Copyright (c) 2019-2020 <NAME> 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...
src/xqerl_mod_expath_binary.erl
0.576184
0.427277
xqerl_mod_expath_binary.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_key_tree.erl
0.670932
0.500183
couch_key_tree.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/bigcouch_spatial_chttpd.erl
0.647464
0.40928
bigcouch_spatial_chttpd.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% A set of optics specific to dicts. %%% @end %%%------------------------------------------------------------------- -module(optic_dict). %% API -export([all/0, all/1, keys/0, keys/1, values/0, ...
src/optic_dict.erl
0.602412
0.497742
optic_dict.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1996-2009. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public Lice...
source/otp_src_R14B02/lib/stdlib/src/random.erl
0.625896
0.457318
random.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% This is the main module, which contains all Shards/ETS API %%% functions, BUT works locally. %%% %%% <b>Shards</b> is compatible with ETS API, most of the functions %%% preserves the same ETS semantics, with some exception which you %%%...
src/shards_local.erl
0.589953
0.465813
shards_local.erl
starcoder