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) 2019 <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/nklib_json.erl | 0.555315 | 0.412826 | nklib_json.erl | starcoder |
%% s/sets/map_sets/g
%% Why? Because spead (This module piggybacks on `maps' module's BIFs)
-module(map_sets).
-export([ new/0
, is_set/1
, size/1
, to_list/1
, from_list/1
]).
-export([ is_element/2
, add_element/2
, del_element/2
]).
-export([ union/2... | src/map_sets.erl | 0.504639 | 0.507507 | map_sets.erl | starcoder |
%% @doc Min-Heap, Max-Heap for Priority Queues
%%
%% <p>This module implements min-heaps and max-heaps for use in priority queues.
%% Each value in the heap is assosiated with a reference so that
%% the user can change its priority in O(log n).</p>
%%
%% <p>The implementation is based on ETS tables for the O(1) lookup... | src/heap.erl | 0.63861 | 0.509398 | heap.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.
%%
%% @type close_reason(Type) =... | erlang_server/_build/default/lib/amqp_client/src/amqp_channel.erl | 0.770551 | 0.437523 | amqp_channel.erl | starcoder |
%%% ----------------------------------------------------------------------------
%%% @author <<EMAIL>>
%%% @doc
%%% Library for creating dynamic module which its functions yield atoms.
%%% @end
%% -----------------------------------------------------------------------------
-module(returnatom).
-author("<EMAIL... | src/returnatom.erl | 0.52902 | 0.449211 | returnatom.erl | starcoder |
-module(tile).
-export([load/1, parse/1, size/1, at/3, rotate/2, flip/1, print/1, print_one/1]).
-export([left/1, right/1, top/1, bottom/1, merge/1]).
-include_lib("eunit/include/eunit.hrl").
-record(tile, {rows}).
% Loads input from the given filename.
load(Filename) ->
{ok, File} = file:open(Filename, [read]),
... | day20/tile.erl | 0.516839 | 0.591251 | tile.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2021 <NAME>
%% @doc Template filter for sorting release note resources on their version number.
%% Copyright 2021 <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 ... | src/filters/filter_zotonicwww2_by_version.erl | 0.543348 | 0.434281 | filter_zotonicwww2_by_version.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.
%%
%% @doc Anonymous function ex... | src/khepri_fun.erl | 0.566498 | 0.461199 | khepri_fun.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_passwords.erl | 0.637482 | 0.430566 | couch_passwords.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.erl | 0.655777 | 0.485173 | porkrind.erl | starcoder |
%% From: https://github.com/rnewson/shamir/tree/master/src/galois.erl
%% Copyright 2011 <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/LICENS... | examples/crypto/galois.erl | 0.631822 | 0.486088 | galois.erl | starcoder |
-module(elixir_tree_helpers).
-export([abstract_syntax/1, build_bin/4, build_simple_bin/2, build_list/4, build_list/5,
build_method_call/4, build_simple_list/2,
build_var_name/2, convert_to_boolean/3]).
-include("elixir.hrl").
abstract_syntax(Tree) ->
erl_syntax:revert(erl_syntax:abstract(Tree)).
% Build a list... | src/elixir_tree_helpers.erl | 0.537527 | 0.410284 | elixir_tree_helpers.erl | starcoder |
-module(wsUtil).
-include("wsCom.hrl").
-include_lib("kernel/include/file.hrl").
-export([
gLV/3
, mergeOpts/2
, normalizeRange/2
, encodeRange/2
, fileSize/1
, sendfile/5
]).
-export_type([range/0]).
gLV(Key, List, Default) ->
case lists:keyfind(Key, 1, List) of
false ->
Defau... | src/wsSrv/wsUtil.erl | 0.606964 | 0.438966 | wsUtil.erl | starcoder |
-module(tomerl_datetime).
-ignore_xref([
format/1,
millisecond/1,
offset/1,
to_calendar/1,
type/1
]).
-export([
new_time/3,
new_time/4,
new_date/3,
new_datetime/2,
with_offset/2,
to_calendar/1,
millisecond/1,
offset/1,
type/1,
format/1
]).
-type year() ::... | src/tomerl_datetime.erl | 0.652352 | 0.424531 | tomerl_datetime.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1999-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/core_lint.erl | 0.604632 | 0.431824 | core_lint.erl | starcoder |
% Copyright (c) 2014-2018 <NAME> aka dark_k3y
% Initial implementation was a little slow, so:
% - several optimizations approaches is heavilly based on JSONE implementation
% by Copyright (c) 2013-2016, <NAME> <<EMAIL>> (MIT LICENSE)
% see https://github.com/sile/jsone/blob/master/src/jsone_decode.erl
% for more detail... | src/erlamsa_json.erl | 0.640861 | 0.469034 | erlamsa_json.erl | starcoder |
-module(parent_client).
-export([children/1,
child_pid/2, child_meta/2,
start_child/2, start_child/3, %restart_child/2,
shutdown_child/2,
shutdown_all/1, shutdown_all/2,
%return_children/2,
update_child_meta/3,
whereis_name/1]).
%% ----------------------------------------------------------... | src/parent_client.erl | 0.586878 | 0.446555 | parent_client.erl | starcoder |
%% @doc A module with a skewed merkle tree implementation as described
%% in https://medium.com/codechain/skewed-merkle-tree-259b984acc0c.
%% This module implements a skewed merkle tree where value can be added/stacked via add/2,
%% the time and memory it takes to create is linearly proportional to the number of values... | src/skewed.erl | 0.835047 | 0.560012 | skewed.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2007-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/beam_utils.erl | 0.522933 | 0.401658 | beam_utils.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 via the world wide web at ... | bloom.erl | 0.58522 | 0.549943 | bloom.erl | starcoder |
% The Computer Language Benchmarks Game
% http://benchmarksgame.alioth.debian.org/
%%% contributed by <NAME>
%%% modified by <NAME>
%% Each chameneos is its own process.
%% A chameneos sends {self(), Color} to the broker to request a
%% meeting with another chameneos.
%% The broker replies with {Pid, Color} of the par... | examples/chameneosredux.erl | 0.542136 | 0.641935 | chameneosredux.erl | starcoder |
%%% # Numbers
%%% ## Variables
%%% Variables always start with an uppercase letter.
%%% Using an unbound variable will trigger an error on the CLI
One.
%%% A variable can only have a single value.
One = 1.
%%% For example, this works because 'One' already has a value of 1
Un = Uno = One = 1.
%%% Variables can b... | src/starting_out.erl | 0.643329 | 0.868213 | starting_out.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/otel_propagator_b3.erl | 0.796767 | 0.536556 | otel_propagator_b3.erl | starcoder |
%%-------------------------------------------------------------------
%% Copyright (c) 2020 <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... | src/ovsdb_ops.erl | 0.50952 | 0.404919 | ovsdb_ops.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_dt_gcounter: A state based, grow only, convergent counter
%%
%% Copyright (c) 2007-2012 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may no... | src/riak_dt_gcounter.erl | 0.520496 | 0.430626 | riak_dt_gcounter.erl | starcoder |
%%% @author <NAME> <<EMAIL>>
%%% @reference <a href="http://tools.ietf.org/html/rfc6287">RFC6287</a>
%%% @reference <a href="http://www.rfc-editor.org/errata_search.php?eid=3729">
%%% RFC Errata ID: 3729</a>
%%% @doc RFC6287 OCRA (OATH Challenge-Response Algorithm)
%%%
%%% given
%%% ```Suite = <<"OCRA-1:HOTP-SHA1-6:C-Q... | src/rfc6287.erl | 0.57678 | 0.450178 | rfc6287.erl | starcoder |
-module(perftest).
%% API
-export([ start/0
, start/1
, module/1
]).
%% Metadata about arguments for a test case: a map from the name of
%% the arguments to the list of possible values to test with.
%%
%% The test case will be executed will all the possible combination of
%% the arguments.
-ty... | test/perftest.erl | 0.645567 | 0.64058 | perftest.erl | starcoder |
-module(palindrome_products).
-export([smallest/2, largest/2, test_version/0]).
%% API
-spec smallest(integer(), integer()) -> {integer(), [{integer(), integer()}]} | {error, atom()}.
smallest(Min, Max) when Min > Max ->
{error, invalid_range};
smallest(Min, Max) ->
Factors = lists:seq(Min, Max),
palindr... | erlang/palindrome-products/src/palindrome_products.erl | 0.524151 | 0.507934 | palindrome_products.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-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/stdlib/src/pool.erl | 0.569374 | 0.418756 | pool.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/src/materializer.erl | 0.544559 | 0.45944 | materializer.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/dsdtx/src/dsdtx_sign.erl | 0.625896 | 0.671847 | dsdtx_sign.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2019 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module incl... | src/auth/aai.erl | 0.508544 | 0.454775 | aai.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @doc
%%% A parse transform implementing partial function application.
%%%
%%% To enable, add to the top of your module:
%%%
%%% ```
%%% -compile({parse_transform, partial}).
%%% '''
%%%
%%% This will enable compile time conversion of calls to
%%... | src/partial.erl | 0.517083 | 0.556159 | partial.erl | starcoder |
%%This file is licensed under the terms of the Modified BSD License.
-module(cmp).
-export([eq/2,le/2,ge/2,gt/2,lt/2]).
%% Wrapper for comparison functions
%% Needs special care in comparing rationals and int and rationals
eq({N,D},I) when is_integer(N),is_integer(D),is_integer(I) ->
eq({N,D},{I,1});
eq(I,{N,D})... | frontend/src/main/resources/erlang/absmodel/src/cmp.erl | 0.50415 | 0.76388 | cmp.erl | starcoder |
%% @doc Blocktree
%%
%% Potential optimization: searches for previous nonce by player can
%% be made faster by caching previous searches. Would speed up
%% add_block_in_order and generate_new_block
-module(blocktree).
-export([
new/0,
add_new_transaction/2,
add_block_in_order/2,
generate_new_block/2,
get_... | src/blocktree.erl | 0.526343 | 0.427516 | blocktree.erl | starcoder |
%% Copyright (c) 2013-2018 <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/luerl_lib.erl | 0.50708 | 0.42483 | luerl_lib.erl | starcoder |
%% @copyright 2015 <NAME> All Rights Reserved.
%%
%% @doc Binary pattern match Based Mustach template engine for Erlang/OTP.
%%
%% Please refer to [the man page](http://mustache.github.io/mustache.5.html) and [the spec](https://github.com/mustache/spec) of mustache as the need arises.<br />
%%
%% Please see [this](../b... | src/bbmustache.erl | 0.611266 | 0.40116 | bbmustache.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2015 Basho Technologies, Inc. All Rights Reserved.
%%
%% 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 on... | src/external/cloudi_x_exometer_core/src/exometer_report_logger.erl | 0.675872 | 0.407157 | exometer_report_logger.erl | starcoder |
%/--------------------------------------------------------------------
%| Copyright 2017 Erisata, UAB (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.apache.or... | itest/exometer_graphite_SUITE.erl | 0.507568 | 0.403861 | exometer_graphite_SUITE.erl | starcoder |
%% @doc A module with a skewed merkle tree implementation as described
%% in https://medium.com/codechain/skewed-merkle-tree-259b984acc0c.
%% This module implements a skewed merkle tree where value can be added/stacked via add/3,
%% the time and memory it takes to create is linearly proportional to the number of values... | src/skewed.erl | 0.732783 | 0.634855 | skewed.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/otel_propagator_b3multi.erl | 0.697918 | 0.548794 | otel_propagator_b3multi.erl | starcoder |
%% Copyright 2014 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_sysmon.erl | 0.54359 | 0.423547 | vmq_sysmon.erl | starcoder |
-module(tracke_example).
-include("tracke.hrl").
-compile([{parse_transform, tracke_pt}]).
-export([normal_usage/1,
merge_error_types/1,
deep_chain/0]).
-type tracke(Reason) :: tracke:tracke(Reason).
%% @doc Show you normal usage of tracke.
%% You can see the results on shell using the following ... | src/tracke_example.erl | 0.597373 | 0.500916 | tracke_example.erl | starcoder |
%% -*- coding: utf-8 -*-
%% @private
-module(ds_sampler).
-author("<NAME> <<EMAIL>>").
%% Statistically representative stream sampler
%% See chapter 4.2. Sampling data in a stream
%% in Mining of Massive Datasets, Second Edition, 2014
%% by <NAME>, <NAME> and <NAME>
-export([ new/1
, add/2
, add_hash... | src/ds_sampler.erl | 0.521471 | 0.418994 | ds_sampler.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 via the world wide web at... | src/deps/gproc/src/gproc_pool.erl | 0.681303 | 0.476458 | gproc_pool.erl | starcoder |
%% The MIT License
%% Copyright (c) 2011 <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 Software without restriction, including without limitation the rights
%% to use, copy, mo... | src/jsx_to_term.erl | 0.523908 | 0.454533 | jsx_to_term.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 Document API.
%%%
%%% @end
%%% ----------... | src/onion_document.erl | 0.544801 | 0.429549 | onion_document.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/jobs.erl | 0.642545 | 0.463869 | jobs.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 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
%%
%% Un... | lib/compiler/src/beam_ssa_bsm.erl | 0.546859 | 0.417687 | beam_ssa_bsm.erl | starcoder |
-module(order).
-compile(no_auto_import).
-include_lib("eunit/include/eunit.hrl").
-export([reverse/1, to_int/1, compare/2, max/2, min/2]).
reverse(Order) ->
case Order of
lt ->
gt;
eq ->
eq;
gt ->
lt
end.
-ifdef(TEST).
reverse_test() ->
expec... | gleam_stdlib/gen/order.erl | 0.68342 | 0.661212 | order.erl | starcoder |
% @copyright 2010-2015 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/gossip.erl | 0.571647 | 0.507812 | gossip.erl | starcoder |
%%%-------------------------------------------------------------------
%% @doc Implements the Ryu algorithm for f64 binaries
%%
%% This has been extracted from OTP 24, and is mostly present here as a reference implementation.
%% @end
%%%-------------------------------------------------------------------
-module(ken_ry... | src/ken_ryu_f64.erl | 0.719581 | 0.626952 | ken_ryu_f64.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @copyright 2007-2009 Basho Technologies
%%
%% 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.... | src/webmachine_dispatcher.erl | 0.512937 | 0.40439 | webmachine_dispatcher.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author grzeg
%%% @copyright (C) 2020, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 25. maj 2020 21:10
%%%-------------------------------------------------------------------
-module(maze_generator).
-author("grzeg").
%% API
-export([createMaze... | maze_api/apps/maze_api/src/maze_generator.erl | 0.526099 | 0.501892 | maze_generator.erl | starcoder |
%% This module provides `start_link' function for Poolboy.
%% This module is used for grouping a set of __readers__.
-module(xapian_pool).
-define(SERVER, xapian_server).
-define(WORKER, ?MODULE).
-define(SUPERVISOR, xapian_pool_sup).
-ifdef(TEST).
-import(xapian_helper, [testdb_path/1]).
-include_lib("eunit/include/e... | src/xapian_pool.erl | 0.519521 | 0.443299 | xapian_pool.erl | starcoder |
-module(problem2017_09).
-export([solve1/1, solve2/1]).
-type counter() :: non_neg_integer().
-type parser_state() :: bang | garbage | { group, counter() }.
-type state() :: { [ parser_state() ], counter(), counter() }.
-spec process( char(), state() ) -> state().
process( _, { [ bang | States ], S, G } ) ->
{ S... | src/2017/problem2017_09.erl | 0.52829 | 0.612802 | problem2017_09.erl | starcoder |
%%%===================================================================
%%% @copyright 2019 Klarna Bank AB (publ)
%%%
%%% @doc This module implements a stateful stream processing node for
%%% many-into-one transformations.
%%%
%%% One has to create a callback module with `kflow_gen_aggregate'
%%% behavior.
%%%
%%% `init... | src/framework/kflow_gen_aggregate.erl | 0.547222 | 0.562717 | kflow_gen_aggregate.erl | starcoder |
% ==============================================================================
% Smoothing Kernels
% ==============================================================================
-module(kernels).
-export([boxcar/1, gaussian/1, epanechnikov/1, tricube/1, triangular/1]).
-define(SQR(X), ((X)*(X))).
-define(CUBE(X)... | src/kernels.erl | 0.512937 | 0.663982 | kernels.erl | starcoder |
%% Copyright (c) 2018 Pivotal Software Inc, 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 requir... | src/ra_kv_store_app.erl | 0.599251 | 0.410372 | ra_kv_store_app.erl | starcoder |
%%
%% Copyright (c) 2015-2016 <NAME>. All Rights Reserved.
%% Copyright (c) 2007-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
%% a copy... | src/state_gset.erl | 0.684264 | 0.428532 | state_gset.erl | starcoder |
%% From: https://github.com/rnewson/shamir/tree/master/src/shamir.erl
%% Copyright 2011 <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/LICENS... | src/shamir.erl | 0.652463 | 0.549761 | shamir.erl | starcoder |
%%
%% Copyright (c) 2015-2016 <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 License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%... | _build/default/lib/types/src/state_lexcounter.erl | 0.68763 | 0.468608 | state_lexcounter.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% xqerl - XQuery processor
%%
%% Copyright (c) 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. Yo... | src/xqerl_mod_exquery_request.erl | 0.520496 | 0.400456 | xqerl_mod_exquery_request.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2020, 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/otel_propagator_text_map_composite.erl | 0.669745 | 0.42471 | otel_propagator_text_map_composite.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2021 <NAME>
%% @doc Ringbuffer implements a length limited queue. In systems this is
%% often implemented as a ring, or cylic, buffer. Where the writer can
%% push the reader ahead if the buffer is full.
%%
%% This kind of buffers is useful in situations where you can have
%% s... | src/ringbuffer.erl | 0.658308 | 0.520131 | ringbuffer.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_lists.erl | 0.627381 | 0.469703 | porkrind_lists.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @copyright 2011 - 2021 <NAME>, <NAME>
%% @version 2.0.0-rc.3
%% @doc Erlang API for sqlite3 and sqlcipher databases.
%% This is an adaptation of Maas-Maarten Zeeman's esqlite package for
%% <a href="https://www.zetetic.net/sqlcipher/">sqlcipher</a> encrypted s... | src/esqlcipher.erl | 0.634883 | 0.58599 | esqlcipher.erl | starcoder |
%% @author <NAME> <<EMAIL>> [http://ferd.ca/]
%% @doc Zipper forests are the zipper equivalent of a tree where each
%% node is a list of subtrees. The term is chosen because a forest, in graph
%% theory, means an undirected acyclic graphs, which is precisely the shape
%% such a tree can represent. The advantage of ... | src/zipper_forests.erl | 0.576184 | 0.708326 | zipper_forests.erl | starcoder |
%%%-----------------------------------------------------------------------------
%%% @doc blockchain_poc_path_v4 implementation.
%%%
%%% The way paths are built depends solely on witnessing data we have accumulated
%%% in the blockchain ledger.
%%%
%%% Assuming we already have a `TargetPubkeyBin` and `TargetRandState` ... | src/poc/blockchain_poc_path_v4.erl | 0.564579 | 0.578567 | blockchain_poc_path_v4.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2009-2010 Basho Technologies
%%
%% 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
%%
... | deps/erlang_js/src/js.erl | 0.591723 | 0.450843 | js.erl | starcoder |
-module(max).
-export([maximum/1, maxdc/1, maxdc2/1, maxdc_tail/1, maxdc_tail2/1]).
-include_lib("eunit/include/eunit.hrl").
-include("./include/testcase.01.hrl").
-import(split2, [split/1]).
%%% Providing 5 different implementaions
%% simple implementation in tail recursion (The fastest!).
maximum([]) ->
'List i... | list/search/maximum/max.erl | 0.514156 | 0.528594 | max.erl | starcoder |
%% JSON - RFC 4627 - for Erlang
%%---------------------------------------------------------------------------
%% Copyright (c) 2007 <NAME> <<EMAIL>>
%% Copyright (c) 2007 LShift Ltd. <<EMAIL>>
%%
%% Permission is hereby granted, free of charge, to any person
%% obtaining a copy of this software and associated documenta... | ringogw/src/json.erl | 0.615088 | 0.448728 | json.erl | starcoder |
%% Copyright (c) 2020-2022 <NAME>
%%
%% 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 Software without restriction, including without limitation
%% the rights to use, copy, modify, merge, publish, ... | test/tls_certificate_check_options_SUITE.erl | 0.520984 | 0.433682 | tls_certificate_check_options_SUITE.erl | starcoder |
-module(image_optimizer).
-export([
optimize/1
, optimize/2
% hidden
, run/1
, os_find_executable/1
]).
-type optimizer() :: pngquant
| optipng
| jpegoptim
| cjpeg
| jpeg_recompres... | src/image_optimizer.erl | 0.550849 | 0.442998 | image_optimizer.erl | starcoder |
%%%--------------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2017, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 05. Jul 2017 12:36 AM
%%%--------------------------------------------------------------------------
-module(assign5).
-author("<NAME>").
%% API
-export... | FP-Erlang/Week 6/Assignment 5/Praveen/assign5.erl | 0.573559 | 0.582966 | assign5.erl | starcoder |
%% @doc API for interacting with a skiplist
-module(skiplist).
-export([
new/0,
with_capacity/1,
push_front/2,
pop_front/1,
push_back/2,
pop_back/1,
len/1,
clear/1,
is_empty/1,
insert/3,
front/1,
back/1,
nth/2,
remove/2,
to_list/1,
contains/2,
dedup/... | src/skiplist.erl | 0.609408 | 0.460774 | skiplist.erl | starcoder |
% @doc OTPCL's parser.
%
% Unlike most Erlang-derived languages, OTPCL's parser is not based on
% leex/yecc; rather, it's written by hand (as a side note: the author has no
% idea exactly what sort of parser OTPCL's parser actually is, though "recursive
% descent" sounds approximately right, given that it's recursive a... | src/otpcl_parse.erl | 0.581303 | 0.67539 | otpcl_parse.erl | starcoder |
% The Computer Language Benchmarks Game
% https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
%%
%% Contributed by : <NAME> and <NAME>, 13 Nov 2010
%% erlc fannkuchredux.erl
%% erl -smp enable -noshell -run fannkuchredux main 12
-module(fannkuchredux).
-compile([native, {hipe, [o3]}]).
-export([main/1]).
m... | bench/fannkuchredux.erl | 0.525612 | 0.558267 | fannkuchredux.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_strings.erl | 0.686055 | 0.485722 | porkrind_strings.erl | starcoder |
-module(day3).
-behaviour(aoc).
-include_lib("eunit/include/eunit.hrl").
-type bit() :: 0..1.
-type report() :: [[bit(), ...], ...].
-export([run/1]).
-spec run(argparse:part()) -> ok.
run(Part) ->
Report = read_report(),
case Part of
1 -> part1(Report);
2 -> part2(Report)
end.
-spec p... | src/day3.erl | 0.563738 | 0.741651 | day3.erl | starcoder |
%% @copyright 2017 <NAME> <<EMAIL>>
%%
%% @doc Span Sampler.
%%
%% Note that this component has not been described in the
%% <a href="https://github.com/opentracing/specification/blob/1.1/specification.md">OpenTracing Specification</a>.
%%
%% === Callbacks ===
%%
%% This module requires following callback:
%%
%% ```
%%... | src/passage_sampler.erl | 0.617859 | 0.439868 | passage_sampler.erl | starcoder |
%% @doc
%% Probabilistic Load Balancer. Schedules function
%% execution on a node selected with randomised weighted
%% sampling. Used credit-based approach for implementing
%% backpressure: when a node did not provide credit, no
%% call/cast to that node is allowed.
%%
%% Capacity discovery: plb subscribes to mod... | src/lambda_plb.erl | 0.57332 | 0.475118 | lambda_plb.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2016 <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 ... | test/state_type_semantics_SUITE.erl | 0.609524 | 0.437523 | state_type_semantics_SUITE.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2012 <NAME>
%% Copyright 2012 <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
%%
%% ... | apps/zotonic_mod_survey/src/filters/filter_survey_prepare_thurstone.erl | 0.526586 | 0.435721 | filter_survey_prepare_thurstone.erl | starcoder |
%%% -*- erlang -*-
%%%
%%% This file is part of metrics released under the BSD license.
%%% See the LICENSE for more information.
%%%
-module('metrics').
%% API exports
-export([init/1]).
-export([
new/3,
delete/2,
increment_counter/2,
increment_counter/3,
decrement_counter/2,
decrement_counte... | deps/metrics/src/metrics.erl | 0.606032 | 0.400661 | metrics.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2017: <NAME>
%%% This software is released under the MIT license cited in 'LICENSE.md'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module provides search fu... | src/bp_tree_leaf.erl | 0.53777 | 0.456168 | bp_tree_leaf.erl | starcoder |
%% @doc Directed / Undirected Graphs
%%
%% <p>This module implements directed and undirected graphs that are either
%% weighted with numeric weights or unweighted.</p>
%%
%% <p>It is basically syntactic sugar for the digraph module with added
%% support for undirected graphs.</p>
%%
%% <h3>How to use</h3>
%% <p>The f... | src/graph.erl | 0.684897 | 0.67682 | graph.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author yangcancai
%%% Copyright (c) 2021 by yangcancai(<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 obta... | src/cool_tools_backend.erl | 0.582491 | 0.460653 | cool_tools_backend.erl | starcoder |
%% Copyright (c) 2020-2021 <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... | src/influx_line_protocol.erl | 0.528777 | 0.628151 | influx_line_protocol.erl | starcoder |
%% rufus_expr annotates forms with type information and performs typechecks to
%% ensure correctness.
-module(rufus_expr).
-include_lib("rufus_type.hrl").
%% API exports
-export([typecheck_and_annotate/1]).
%% API
%% typecheck_and_annotate iterates over RufusForms and adds type information
%% from the current scop... | rf/src/rufus_expr.erl | 0.562777 | 0.640734 | rufus_expr.erl | starcoder |
%%%-------------------------------------------------------------------
%% @doc NIF bindings for XXH3 hash functions implemented in Rust
%%
%% XXH3 is a new speed-optimized hash algorithm of the xxHash family
%% of non-cryptographic hash functions, featuring:
%% <ul>
%% <li>Improved speed for both small and large inputs... | src/xxh3.erl | 0.761095 | 0.531209 | xxh3.erl | starcoder |
-module(spoonacular_wine_api).
-export([get_dish_pairing_for_wine/2, get_dish_pairing_for_wine/3,
get_wine_description/2, get_wine_description/3,
get_wine_pairing/2, get_wine_pairing/3,
get_wine_recommendation/2, get_wine_recommendation/3]).
-define(BASE_URL, "").
%% @doc Dish Pairing for ... | erlang/src/spoonacular_wine_api.erl | 0.566019 | 0.420629 | spoonacular_wine_api.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2018-2021. 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_ssa_recv.erl | 0.605099 | 0.415907 | beam_ssa_recv.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_tuples.erl | 0.694924 | 0.415077 | porkrind_tuples.erl | starcoder |
%% Copyright (c) 2008-2020 <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_ms.erl | 0.562056 | 0.414069 | lfe_ms.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2020, 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_resource_app_env.erl | 0.651798 | 0.449936 | ot_resource_app_env.erl | starcoder |
%% Implement weighted sampling with replacement using the alias method.
%%
%% Sources:
%% 1) http://en.wikipedia.org/wiki/Alias_method
%% 2) http://www.keithschwarz.com/darts-dice-coins/
%% 3) https://hips.seas.harvard.edu/blog/2013/03/03/the-alias-method-efficient-sampling-with-many-discrete-outcomes/
%%
-modul... | src/sampler_alias.erl | 0.746786 | 0.533944 | sampler_alias.erl | starcoder |
%% @author Couchbase <<EMAIL>>
%% @copyright 2015 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_cert.erl | 0.598899 | 0.412234 | menelaus_web_cert.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2019 Driebit BV
%% @doc Rate limiting of authentication tries and other types of requests
%% Copyright 2019 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 ... | apps/zotonic_mod_ratelimit/src/models/m_ratelimit.erl | 0.611382 | 0.435301 | m_ratelimit.erl | starcoder |
%%% ------------------------------------------------------------------
%%% @copyright 2018, <NAME>
%%%
%%% @doc Module is an interface to the Noise protocol
%%% [https://noiseprotocol.org]
%%%
%%% The module implements Noise handshake in `handshake/3'.
%%%
%%% For convenience there is also an API to use Noise over TCP ... | src/enoise.erl | 0.571169 | 0.438364 | enoise.erl | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.