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
%%%------------------------------------------------------------------- %% wrapper implementations for the APIs & RPCs for the gateway service %% basically this module handles various RPC and function calls from grpcbox_stream %% and routes it to the required application specific handler module %% due to issues with the...
src/grpc/helium_gateway_service.erl
0.50952
0.479016
helium_gateway_service.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_kv_mrc_sink: A simple process to act as a Pipe sink for %% MapReduce queries %% %% Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License...
deps/riak_kv/src/riak_kv_mrc_sink.erl
0.693992
0.457621
riak_kv_mrc_sink.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2007-2016. 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/array.erl
0.756537
0.578865
array.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/src/couch_debug.erl
0.831793
0.636678
couch_debug.erl
starcoder
% Both garbage collection (GC) and re-replication (RR) require working % from a consistent snapshot of DDFS. Since computing this snapshot % is expensive in both time and memory, once computed, the snapshot is % used for both purposes, and GC and RR are implemented together. GC % is performed before RR, so that GC ca...
master/src/ddfs/ddfs_gc_main.erl
0.504639
0.528168
ddfs_gc_main.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 %%...
test/cache_shards_SUITE.erl
0.681833
0.465023
cache_shards_SUITE.erl
starcoder
% @doc Digilent Pmod_ALS module % This component provides ambient light-to-digital % sensing through the SPI2 interface on a 6-pin connector. % % For further information about the Digilent Pmod_ALS % and its components : % https://store.digilentinc.com/pmod-als-ambient-light-sensor/ % % Texas Instrument's ADC081S021 an...
src/pmod_als.erl
0.683842
0.473536
pmod_als.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/erlfmt_algebra_SUITE.erl
0.649912
0.432483
erlfmt_algebra_SUITE.erl
starcoder
%% This module documents the callbacks that an FMKE driver for a Key-Value Store must implement. %% %% A brief explanation about FMKe adapters and drivers: %% %% An adapter is an Erlang module that implements the complete FMKe callback set, but that is able to make assumptions %% about the data model, connection pool o...
src/gen_fmke_kv_driver.erl
0.730578
0.729761
gen_fmke_kv_driver.erl
starcoder
%% -*- mode: erlang; indent-tabs-mode: nil; -*- %%============================================================================= %% 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 t...
src/setup.erl
0.655777
0.452052
setup.erl
starcoder
%% ------------------------------------------------------------------- %% %% Riak: A lightweight, decentralized key-value store. %% %% 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 this ...
src/riak_core_wm_urlmap.erl
0.563618
0.49292
riak_core_wm_urlmap.erl
starcoder
% @copyright 2008-2011 Zuse Institute 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 required by applicable law ...
test/util_SUITE.erl
0.627152
0.489259
util_SUITE.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...
src/ot_ctx_pdict.erl
0.510252
0.415699
ot_ctx_pdict.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1997-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/kernel/src/inet_udp.erl
0.524395
0.41114
inet_udp.erl
starcoder
%% @copyright 2021 Driebit BV %% @doc Extract properties from a compact RDF document encoded by zotonic_rdf. %% Copyright 2021 Driebit BV %% %% 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 ...
apps/zotonic_core/src/support/z_rdf_props.erl
0.511961
0.465387
z_rdf_props.erl
starcoder
%%%---------------------------------------------------------------------------- %%% @author <NAME> <<EMAIL>> %%% @copyright 2012 University of St Andrews (See LICENCE) %%% @headerfile "skel.hrl" %%% %%% @doc This module contains the Map skeleton initialisation logic. %%% %%% The Map skeleton is a parallel map. The sk...
src/sk_map.erl
0.508056
0.774967
sk_map.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/porkrind_fun_calls.erl
0.572364
0.528168
porkrind_fun_calls.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...
src/ot_exporter.erl
0.629433
0.454896
ot_exporter.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright (c) 2012 Basho Technologies, Inc. %% %% 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 Licen...
test/verify_claimant.erl
0.583915
0.436142
verify_claimant.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 %% %%...
tapestry/apps/tapestry/src/nci.erl
0.747892
0.647022
nci.erl
starcoder
%% @doc Implements a data structure for cryptographically signed transactions. %% This is the envelope around transactions to make them cryptographically safe. %% The transactions normally also have keys of the "signers" in the transaction, %% which are extracted using the signers/1 function in the respective transacti...
apps/aetx/src/aetx_sign.erl
0.73431
0.622287
aetx_sign.erl
starcoder
-module(atom_gotchas_app). -behaviour(application). -export([start/2, stop/1]). % callbacks -export([atom5/0]). % exposed function %% "atom bomb" gotcha demo function -export([generate_atoms/1]). %% "attempt_atom" gotcha demo functions -export([json/1, decode/1, check/1]). %% This section, togeth...
src/atom_gotchas_app.erl
0.718989
0.570511
atom_gotchas_app.erl
starcoder
%% -------- SST (Variant) --------- %% %% A FSM module intended to wrap a persisted, ordered view of Keys and Values %% %% The persisted view is built from a list (which may be created by merging %% multiple lists). The list is built first, then the view is created in bulk. %% %% -------- Slots --------- %% %% The vie...
src/leveled_sst.erl
0.523908
0.646307
leveled_sst.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 sending multiple messages to their neighbours in %% intervals. %% %% == Use...
src/scenarios/mongoose_one_to_one.erl
0.579876
0.467393
mongoose_one_to_one.erl
starcoder
%% Copyright (c) 2008-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...
src/lfe_parse.erl
0.51562
0.428891
lfe_parse.erl
starcoder
%% @doc %% This module defines `intcode' instruction set along with providing tools to read `intcode' programs from a string. -module(intcode). -include_lib("eunit/include/eunit.hrl"). -include("intcode.hrl"). -export([ % Actual public API read_program/1, % API for VM implementations instruction/1, increm...
src/intcode/intcode.erl
0.63624
0.409988
intcode.erl
starcoder
%%%============================================================================= %%% @doc Worker process to handle hackney metrics %%% %%% A worker process has two jobs: %%% %%% (1) Calculate the metric value. %%% %%% Hackney does not keep the state of its metrics, but instead emits events to %%% the metrics engine,...
src/hackney_telemetry_worker.erl
0.53777
0.424889
hackney_telemetry_worker.erl
starcoder
%% ----------------------------------------------------------------------------- %% %% Hamcrest Erlang. %% %% Copyright (c) 2017 <NAME> (<EMAIL>) %% %% Permission is hereby granted, free of charge, to any person obtaining a copy %% of this software and associated documentation files (the "Software"), to deal %% in the ...
src/hamcrest_transform.erl
0.642993
0.514888
hamcrest_transform.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/mria_membership_SUITE.erl
0.519765
0.442637
mria_membership_SUITE.erl
starcoder
%% ------------------------------------------------------------------- %% %% merge_index: main interface to merge_index library. %% %% Copyright (c) 2007-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 ...
deps/merge_index/src/merge_index.erl
0.727104
0.417153
merge_index.erl
starcoder
%%------------------------------------------------------------------------------ %% Copyright 2012 FlowForwarding.org %% %% 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....
apps/linc_us4/src/linc_us4_sliding_window.erl
0.667148
0.4206
linc_us4_sliding_window.erl
starcoder
-module(mat). -export([tr/1, inv/1]). -export(['+'/2, '-'/2, '=='/2, '*'/2, '*´'/2]). -export([row/2, col/2, get/3]). -export([zeros/2, eye/1, diag/1]). -export([eval/1]). -export_type([matrix/0]). -type matrix() :: [[number(), ...], ...]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
src/mat.erl
0.521227
0.576363
mat.erl
starcoder
%% -------- Overview --------- %% %% Leveled is based on the LSM-tree similar to leveldb, except that: %% - Keys, Metadata and Values are not persisted together - the Keys and %% Metadata are kept in a tree-based ledger, whereas the values are stored %% only in a sequential Journal. %% - Different file formats are used...
src/leveled_bookie.erl
0.545528
0.637708
leveled_bookie.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.678007
0.503845
prometheus_collector.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/ttsets.erl
0.599368
0.431584
ttsets.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_stats/src/couch_stats_httpd.erl
0.601359
0.47098
couch_stats_httpd.erl
starcoder
%% ===================================================================== %% This library is free software; you can redistribute it and/or modify %% it under the terms of the GNU Lesser General Public License as %% published by the Free Software Foundation; either version 2 of the %% License, or (at your option) any lat...
dependencies/otp/r15b03-1/lib/syntax_tools/src/erl_comment_scan.erl
0.530723
0.457318
erl_comment_scan.erl
starcoder
%%% @doc This is a loose translation of the following link from ACM: %%% http://queue.acm.org/appendices/codel.html %%% http://pollere.net/CoDelnotes.html %%% http://pollere.net/CoDel.html %%% %%% The document you want to read is %%% "Controlling queue Delay" <NAME>, <NAME>, http://queue.acm.org/detail.cfm?id=2209336 %...
src/sv_codel.erl
0.563738
0.510069
sv_codel.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright <2013-2018> < %% Technische Universität Kaiserslautern, Germany %% Université Pierre et Marie Curie / Sorbonne-Université, France %% Universidade NOVA de Lisboa, Portugal %% Université catholique de Louvain (UCL), Belgique %% IN...
apps/antidote_crdt/src/antidote_crdt_counter_fat.erl
0.530723
0.448789
antidote_crdt_counter_fat.erl
starcoder
-module(h3). -export([num_hexagons/1, edge_length_meters/1, edge_length_kilometers/1, hex_area_m2/1, hex_area_km2/1, from_geo/2, to_geo/1, to_geo_boundary/1, to_string/1, from_string/1, get_resolution/1, get_base_cell/1,...
src/h3.erl
0.631935
0.573559
h3.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...
lib/eunit/src/eunit_serial.erl
0.5083
0.410815
eunit_serial.erl
starcoder
%% Stolen/borrowed from %% https://github.com/Andrew-William-Smith/advent-of-code/blob/2021-erlang/src/aoc2021_day22.erl -module(aoc2021_day22). -behavior(aoc_puzzle). -export([parse/1, solve1/1, solve2/1, info/0]). -include("aoc_puzzle.hrl"). -include_lib("eunit/include/eunit.hrl"). -spec info() -> aoc_puzzle(). ...
src/2021/aoc2021_day22.erl
0.642881
0.642012
aoc2021_day22.erl
starcoder
-module(gleam_stdlib). -include_lib("eunit/include/eunit.hrl"). -export([expect_equal/2, expect_not_equal/2, expect_true/1, expect_false/1, expect_is_ok/1, expect_is_error/1, atom_from_string/1, atom_create_from_string/1, atom_to_string/1, map_get/2, iodata_append/2, iodata_prepend/2, identi...
src/gleam_stdlib.erl
0.52975
0.661445
gleam_stdlib.erl
starcoder
%% vim: set ai et sw=4 sts=4: %% See LICENSE for licensing information. -module(solarized_assert). -export([ output_equal_to_file/5 , output_equal_to_file/7 ]). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). -endif. %======================================================================= -s...
src/solarized_assert.erl
0.537041
0.50293
solarized_assert.erl
starcoder
%% Copyright (c) 2019 <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_lint.erl
0.551332
0.411525
luerl_comp_lint.erl
starcoder
% @copyright 2011-2014 Zuse Institute 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 required by applicable law...
src/api_mr.erl
0.735642
0.685637
api_mr.erl
starcoder
-module(counters_buckets). -export([new/0, new/1, position/2, bound/2]). -export_type([bucket_bound/0, buckets/0]). -ifdef(TEST). -export([default/0, exponential/3, linear/3]). -endif. %%==================================================================== ...
src/counters_buckets.erl
0.566139
0.442938
counters_buckets.erl
starcoder
%%%------------------------------------------------------------------- %%% @doc %%% This module implements local or single-node Sharding. %%% %%% <b>Shards</b> is compatible with ETS API, most of the functions %%% preserves the same contract and semantic, but there are some %%% exceptions (check functions documentation...
src/shards_local.erl
0.567218
0.616676
shards_local.erl
starcoder
%%% Module Description: %%% Compiles Erlang Source code to Core Erlang -module(coregen). -author(["<NAME>", "<NAME>"]). -vsn(1.0). -export([to_core_erlang/1, to_core_erlang/2, to_core_erlang_ast/1, to_core_erlang_ast/2]). %% Compiles a given Erlang source file to a CoreErlang file, and writ...
doc/corpus/src/erl/coregen.erl
0.504394
0.477371
coregen.erl
starcoder
%%%------------------------------------------------------------------- %% wrapper implementations for the APIs & RPCs for the gateway service %% basically this module handles various RPC and function calls from grpcbox_stream %% and routes it to the required application specific handler module %% due to issues with the...
src/grpc/helium_gateway_service.erl
0.515132
0.424173
helium_gateway_service.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.695338
0.439627
jesse_schema_validator.erl
starcoder
%% common_test suite for test -module(integrity_SUITE). -include_lib("common_test/include/ct.hrl"). -include_lib("stdlib/include/assert.hrl"). -include("cqerl_protocol.hrl"). -compile(export_all). -import(test_helper, [maybe_get_client/1, get_client/1]). %%----------------------------------------------------------...
test/integrity_SUITE.erl
0.504394
0.47591
integrity_SUITE.erl
starcoder
-module(riak_core_aae_vnode). -export([maybe_create_hashtrees/4, update_hashtree/4]). -export([request_hashtree_pid/2, hashtree_pid/2, rehash/4]). -define(DEFAULT_HASHTREE_TOKENS, 90). -type preflist() :: [{Index::integer(), Node :: term()}]. %%%==========================================...
src/riak_core_aae_vnode.erl
0.64131
0.41739
riak_core_aae_vnode.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_core_coverage_plan: Create a plan to cover a minimal set of VNodes. %% %% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved. %% %% This file is provided to you under the Apache License, %% Version 2.0 (the "License"); ...
src/riak_core_coverage_plan.erl
0.646683
0.426919
riak_core_coverage_plan.erl
starcoder
-module(ddb_bmp). %% for CLI -export([show/1, compare/1, repair/1]). -ignore_xref([show/1, compare/1, repair/1]). show(["--width", WidthS, TimeS, BucketS | MetricS]) -> Width = list_to_integer(WidthS), show_bitmap(TimeS, BucketS, MetricS, Width); show([TimeS, BucketS | MetricS]) -> show_bitmap(TimeS, Bu...
apps/dalmatiner_db/src/ddb_bmp.erl
0.521959
0.492432
ddb_bmp.erl
starcoder
%% @doc This module provides utility functions for formatting, reading %% measurements from file and acquiring measurements using the %% sensor-specific Python script. -module(util). -export([get_measurement/1, get_average_measurement/3, read_history/1, format_time/1, format_csv/1, format_csv_line/1, ...
pi/util.erl
0.722331
0.622172
util.erl
starcoder
%% ========================================================================================================== %% Ram - An in-memory distributed KV store for Erlang and Elixir. %% %% The MIT License (MIT) %% %% Copyright (c) 2021 <NAME> <<EMAIL>>. %% %% Permission is hereby granted, free of charge, to any person obtaini...
src/ram.erl
0.565419
0.479016
ram.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_release.erl
0.509764
0.420481
knit_release.erl
starcoder
% @doc GRiSP I²C API. % % <a href="https://en.wikipedia.org/wiki/I²C">Inter-Integrated Circuit % (I²C)</a> is a synchronous addressable serial communication bus. Two types of % nodes can exist, controllers and targets. Multiple controllers and targets % can exist on the bus simultaneously. Controllers generate the cloc...
src/grisp_i2c.erl
0.751375
0.564939
grisp_i2c.erl
starcoder
-module(day19). -export([main/0]). -include_lib("eunit/include/eunit.hrl"). main() -> Rules = parse(load("rules.txt")), Input = load("input.txt"), io:format("~p~n", [part_one(Rules, Input)]), io:format("~p~n", [part_two(Rules, Input)]), ok. % Part one: count the number of strings in the input that match the...
day19/day19.erl
0.572484
0.643553
day19.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/src/couch_emsort.erl
0.800029
0.728736
couch_emsort.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/kai_config.erl
0.591841
0.438124
kai_config.erl
starcoder
% @copyright 2011-2014 Zuse Institute 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 required by applicable law ...
src/histogram.erl
0.572125
0.605449
histogram.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/hocon_schema_doc.erl
0.609292
0.418935
hocon_schema_doc.erl
starcoder
-module(gm_options). -export([ opt/1 ]). %% Options for interacting with GraphicsMagick function -spec opt(atom() | tuple()) -> tuple(). opt('+adjoin') -> {"+adjoin"}; opt(adjoin) -> {"-adjoin"}; opt(auto_orient) -> {"-auto-orient"}; opt({background, Color}) -> {"-background", ":color", [{color, ...
src/gm_options.erl
0.54577
0.542742
gm_options.erl
starcoder
%% Given an integer consisting of 4 digits, we need to maximize it in %% 24 hour format. For example, 4372 should return a String of the %% form 23:47, which is the maximum 24 hour value that can be obtained %% from the given integer. Assume the given integer always contains %% exactly 4 digits. -module(hackerlrank_clo...
src/hackerlrank_clock.erl
0.556279
0.846451
hackerlrank_clock.erl
starcoder
-module(week1). % Shapes -export([area/1, perimeter/1, enclose/1]). % Bits -export([bits/1, bits2/1]). % Tests -export([test/0]). % Shapes -type point() :: {X :: number(), Y :: number()}. -type circle() :: {'circle', Center :: point(), Readius :: number()}. -type rectangle() :: {'rectangle', Center :: poin...
week1/week1.erl
0.651798
0.591989
week1.erl
starcoder
%% @doc Quaternion module - simplifies working with and perfoming math on quaternions. %% %% @copyright 2012 <NAME> %% Licensed under the MIT license; see the LICENSE file for details. -module(quaternion). % --------------------------------------------------------------------------------------------------------------...
apps/pre_entity_layer/src/quaternion.erl
0.793306
0.462109
quaternion.erl
starcoder
-module(problem2015_13). -export([solve1/1, solve2/1]). -type neighbour() :: string(). -type neighbours() :: [ neighbour() ]. -type mod() :: integer(). -type neighbour_mod() :: { neighbour(), mod(), neighbour() }. -type neighbour_mods_map() :: #{ { neighbour(), neighbour() } := mod() }. %%% COMMON -spec parse_neighb...
src/2015/problem2015_13.erl
0.506347
0.516595
problem2015_13.erl
starcoder
-module(regex2post). -include_lib("eunit/include/eunit.hrl"). %% API -export([convert/1]). %% @doc %% Converts given regexp to postfix notation later used for building regular expression graph. convert([]) -> []; convert(Input) -> convert(Input, 0, [], []). convert([], WrittenCount, OperatorStack, Output) -> Postf...
apps/grepper/src/regex2post.erl
0.57678
0.677821
regex2post.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2007-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/beam_trim.erl
0.575111
0.437403
beam_trim.erl
starcoder
-module(spud). -compile({no_auto_import,[min/2]}). -compile({no_auto_import,[max/2]}). -export([sample/1, slices/2, uniq/1]). -export([array_update/3, tuple_update/3]). -export([combinations/2]). -export([mapreduce/4, parallel_mapreduce/4, parallel_mapreduce/5]). -export([min/2, max/2, min_by/2, max_by/2]). -export([pa...
src/spud.erl
0.516839
0.550124
spud.erl
starcoder
%%% Concurrent Programming In Erlang -- The University of Kent / FutureLearn %%% Exercise : https://www.futurelearn.com/courses/concurrent-programming-erlang/3/steps/488342 %%% v3 - += Showing size of mailbox, clearing mailbox at client & server, %%% imposing server load by sleeping+ %%% %%% Last Modified ...
exercises/e4/v3/frequency.erl
0.535584
0.504578
frequency.erl
starcoder
%% @doc Model for fetching and updating the Git clone of Zotonic. %% The Git checkout is located in "priv/data/zotonic-git". %% %% This file is a model. You will see functions like 'm_get' that %% implement the model behaviour. Models are always located in the %% directory 'models' and their filename always start with ...
src/models/m_zotonicwww2_search.erl
0.58261
0.558869
m_zotonicwww2_search.erl
starcoder
% @copyright 2011 Zuse Institute 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 required by applicable law or ag...
src/rrepair/bloom.erl
0.507812
0.425098
bloom.erl
starcoder
%% @doc This module implements storage and lookup of data in ETS tables. %% Including a minimal gen_server to stay owner of the ets tables. -module(watts_ets). %% %% Copyright 2016 SCC/KIT %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the Li...
src/watts_ets.erl
0.562417
0.411939
watts_ets.erl
starcoder
%%%------------------------------------------------------------------- %%% @author mb299v %%% @copyright (C) 3129, <COMPANY> %%% @doc %%% %%% @end %%% Created : 31. Aug 3129 21:29 AM %%%------------------------------------------------------------------- -module(vector_math). -author("mb299v"). %% API -expo...
src/vector_math.erl
0.631935
0.42937
vector_math.erl
starcoder
-module(parser). -export([parse/1, parse_and_scan/1, format_error/1]). -file("src/parser.yrl", 268). -compile([{hipe, [{regalloc, linear_scan}]}]). % LANGUAGE set_language({'feature', {'meta', {Location, TokenLabel, _}, Type}, Constituents}, Language) -> {'feature', {'meta', {Location, TokenLabel, language(Langua...
src/parser.erl
0.517571
0.446314
parser.erl
starcoder
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil; fill-column: 92-*- %% ex: ts=4 sw=4 et %% Copyright 2013 Opscode, 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 obtai...
src/oc_erchef/apps/chef_objects/src/chef_parallel.erl
0.58948
0.409162
chef_parallel.erl
starcoder
%% ------------------------------------------------------------------- %% %% Copyright (c) 2011 Basho Technologies, Inc. %% %% 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 Licen...
deps/riak_kv/src/riak_kv_mrc_map.erl
0.774711
0.520862
riak_kv_mrc_map.erl
starcoder
-module(discovery). -behavior(gen_server). -export([ start_link/3, init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2 ]). configuration_number() -> 1. % based on https://github.com/homebridge/HAP-NodeJS/blob/81652da554137d818d049f6f245e88efec43b1c5/src/lib/...
apps/whistlee/src/discovery.erl
0.580828
0.406744
discovery.erl
starcoder
-module(bloom). -export([ new/2, new_optimal/2, new_forgetful/4, new_forgetful_optimal/4, set/2, check/2, check_and_set/2, clear/1, type/1, serialize/1, deserialize/1 ]). %% ---------------------------------------------------------------------------- %% @doc %% Create a new bloom filter struct...
src/bloom.erl
0.579995
0.569912
bloom.erl
starcoder
%%% Logplex has the presence of reference-counted binaries (refc binaries) that %%% are leaking (see %%% http://www.erlang.org/doc/efficiency_guide/binaryhandling.html#id65722). %%% The problem is that all drain processes end up doing little more than %%% routing binaries that may or may not be reference-counted. After...
src/logplex_leak.erl
0.61832
0.467696
logplex_leak.erl
starcoder
-module(efrisby_constraint). %% Callbacks -export([ evaluate/2 ]). -spec evaluate( tuple() , tuple()) -> 'ok' | none(). evaluate([], {ok, _}) -> ok; evaluate(_Expectations, {error, _} = Error) -> fail(ok, Error, {request}); evaluate(Expectations, {ok, Response}) when erlang:is_list(Expectations) -> ...
src/efrisby_constraint.erl
0.582729
0.544499
efrisby_constraint.erl
starcoder
%%============================================================================== %% Copyright 2010 Erlang Solutions Ltd. %% %% 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.a...
src/escalus_assert.erl
0.633864
0.427994
escalus_assert.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1999-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...
data/erlang/5cc905ab3f463731a8927cd873ec6ad3_digraph_utils.erl
0.548432
0.530723
5cc905ab3f463731a8927cd873ec6ad3_digraph_utils.erl
starcoder
-module(bits). -export([bits/1]). -include_lib("eunit/include/eunit.hrl"). % <NAME> % 2017-03-12 % % Sums the number of 'on' bits in a given positive integer. % % Tail-recursive vs direct % ------------------------ % Tail-recursive implementations have the advantages: % - internally can be converted to a l...
1_24/bits.erl
0.587233
0.609306
bits.erl
starcoder
%%% Advent of Code solution for 2019 day 14. %%% Created: 2019-12-14T07:03:21+00:00 -module(aoc2019_day14). -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 = 2019, ...
src/2019/aoc2019_day14.erl
0.528777
0.558207
aoc2019_day14.erl
starcoder
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 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 %% %% Un...
lib/compiler/src/beam_bounds.erl
0.66628
0.450903
beam_bounds.erl
starcoder
%%% %%% Copyright 2017 RBKmoney %%% %%% 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...
apps/mg_woody_api/src/mwc.erl
0.569134
0.420421
mwc.erl
starcoder
- module(trace_theory). -export([perform_computation/3]). -ignore_xref([perform_computation/3]). -export_type([word/0, dependent/0, production/0, alphabet/0]). -type production() :: char(). -type production_definition() :: {char(), list(), list()}. -type word() :: [production()]. -type dependent() :: [{production()...
src/trace_theory.erl
0.570571
0.432303
trace_theory.erl
starcoder
%% ------------------------------------------------------------------- %% %% riak_kv_wm_crdt: Webmachine resource for convergent data types %% %% Copyright (c) 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...
deps/riak_kv/src/riak_kv_wm_crdt.erl
0.712832
0.452052
riak_kv_wm_crdt.erl
starcoder
%% %% @doc Miscellaneous utilities %% -module(rncryptor_util). -author("<EMAIL>"). -export([ceil/1]). -export([enpad/1, depad/1]). -export([const_compare/2]). -export([bin_to_hex/1, hex_to_bin/1]). -define(AES256_BLOCK_SIZE, 16). %% AES uses 128-bit blocks (regardless of key size) %%=============================...
src/rncryptor_util.erl
0.554229
0.470554
rncryptor_util.erl
starcoder
%% Copyright 2019 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...
src/vmq_topic.erl
0.516108
0.429669
vmq_topic.erl
starcoder
-module(grisp_led). -behavior(gen_server). % API -export([start_link/0]). -export([color/2]). -export([off/1]). -export([flash/3]). -export([pattern/2]). % Callbacks -export([init/1]). -export([handle_call/3]). -export([handle_cast/2]). -export([handle_info/2]). -export([code_change/3]). -export([terminate/2]). %--...
src/grisp_led.erl
0.7181
0.455441
grisp_led.erl
starcoder
-module(erlmachine_supervisor_model). %% NOTE: The main purpouse of the supervisor model is the ability to make impact on runtime layer without affecting of monitoring layer of service; %% NOTE: Supervisor model concerns: runtime credentials, logging; %% NOTE: UID is used to support runtime credentials of the initiat...
src/behaviours/erlmachine_supervisor_model.erl
0.562056
0.470919
erlmachine_supervisor_model.erl
starcoder
%%%----------------------------------------------------------------------------- %%% @author <NAME> <<EMAIL>> %%% @copyright (C) 2011-2017 <NAME> %%% @doc %%% The module name 'em' stands for 'Erly Mock'. %%% %%% <p>This mocking library works similar to Easymock.</p> %%% %%% <p>After a mock process is started by {@link ...
src/em.erl
0.588889
0.654288
em.erl
starcoder
%% @author Couchbase <<EMAIL>> %% @copyright 2017-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/node_status_analyzer.erl
0.571169
0.478651
node_status_analyzer.erl
starcoder
%%============================================================================== %% Copyright 2010 Erlang Solutions Ltd. %% %% 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.a...
src/run_eqc.erl
0.540318
0.406273
run_eqc.erl
starcoder
-module(poker). -export([best/1]). -type rank() :: 1..14. -type suite() :: heart | diamond | spade | club. -type classification() :: high_card | pair | two_pair | three_of_a_kind | straight | flush | full_house | four_of_a_kind | straight_flush. -record(card, {rank :: rank(), suite :: suite()}). -reco...
erlang/poker/src/poker.erl
0.619356
0.511351
poker.erl
starcoder