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>>
%%
%% 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
%%
... | deps/sbroker/src/sprotector.erl | 0.63477 | 0.423995 | sprotector.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2018-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_ssa_share.erl | 0.630685 | 0.441312 | beam_ssa_share.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2014 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... | _build/default/lib/exometer_core/src/exometer_folsom.erl | 0.511961 | 0.425725 | exometer_folsom.erl | starcoder |
%% @doc: Space-efficient dictionary implemented using a binary
%%
%% This module implements a space-efficient dictionary with no
%% overhead per entry. Read and write access is O(log n).
%%
%% Keys and values are fixed size binaries stored ordered in a larger
%% binary which acts as a sparse array. All operations are i... | src/bisect.erl | 0.635336 | 0.586197 | bisect.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_crypto.erl | 0.800458 | 0.425187 | couch_crypto.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2018 <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/m_vclock.erl | 0.655557 | 0.501526 | m_vclock.erl | starcoder |
-module(oc_telemetry).
% ------------------------------------------------------------------------------
% Public Exports
-export([attach/4, track/1]).
% ------------------------------------------------------------------------------
-record(options, {name, filter}).
% -----------------------------------------------... | src/oc_telemetry.erl | 0.602062 | 0.410225 | oc_telemetry.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.erl | 0.58439 | 0.418043 | otter.erl | starcoder |
%% @doc {@module} allows writing composable decoders, combining decoding,
%% transformation and validation.
-module(dj).
-export([ %% Primitives
binary/0
, integer/0
, pos_integer/0
, neg_integer/0
, non_neg_integer/0
, float/0
, null/0
, null/1
... | src/dj.erl | 0.900333 | 0.461077 | dj.erl | starcoder |
%% Copyright (c) 2016-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... | test/prop_lfe_docs.erl | 0.506836 | 0.408454 | prop_lfe_docs.erl | starcoder |
%%% @doc Contains util functions.
%%%
%%% Copyright 2017 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.apache.org/licenses/LICENSE-2.0
%... | src/apns_utils.erl | 0.568056 | 0.419559 | apns_utils.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_ip.erl | 0.628863 | 0.429908 | cool_tools_ip.erl | starcoder |
-module(week1).
-export([perimeter/1, area/1, enclose/1, bitsDirect/1, bitsTail/1, bits/1]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Shapes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define a function perimeter/1 which tak... | week1/week1.erl | 0.615319 | 0.76986 | week1.erl | starcoder |
%%%=============================================================================
%% Copyright 2013 Klarna 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.apache.or... | src/jesse.erl | 0.729616 | 0.423339 | jesse.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% xqerl - XQuery processor
%%
%% Copyright (c) 2017-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_xs.erl | 0.510496 | 0.509337 | xqerl_mod_xs.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/stable_time_functions.erl | 0.54819 | 0.487307 | stable_time_functions.erl | starcoder |
%%
%% Copyright (c) 2018 <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
%%
%% Unl... | src/exp_simulations_support.erl | 0.512693 | 0.418043 | exp_simulations_support.erl | starcoder |
%% @author <NAME>, <NAME>, <NAME>
%%
%% @copyright 2017 Coowry Ltd.
%%
%% @doc Data validation in Erlang.
%%
%% Validators of type {@type validator(A,B)} are functions that accept
%% terms of type {@type A} and returns a validation result of type
%% {@type result(B)}.
%%
-module(baleen).
%% API exports
%% Types
-expo... | src/baleen.erl | 0.621656 | 0.469095 | baleen.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_server_sup.erl | 0.562898 | 0.439687 | vmq_server_sup.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
%%
%% U... | src/state_awmap.erl | 0.695958 | 0.438304 | state_awmap.erl | starcoder |
-module(intersection).
-export([intersection/2]).
intersection(D, D) -> D;
intersection({recur, S}, {recur, T}) -> {recur, fun() -> intersection(S(), T()) end};
intersection({recur, S}, {sum, _} = D) -> {recur, fun() -> intersection(S(), D) end};
intersection({recur, S}, {tagged, _, _} = D) -> {recur, fun() -> inters... | src/domain/intersection.erl | 0.530966 | 0.524456 | intersection.erl | starcoder |
-module(mapz).
% API
-export([deep_find/2]).
-export([deep_get/2]).
-export([deep_get/3]).
-export([deep_put/3]).
-export([deep_remove/2]).
-export([deep_merge/1]).
-export([deep_merge/2]).
-export([deep_merge/3]).
-export([inverse/1]).
-type path() :: [term()].
% A list of keys that are used to iterate deeper into a... | src/mapz.erl | 0.724675 | 0.659898 | mapz.erl | starcoder |
%%%---------------------------------------------------------------------------
%%% @doc
%%% Handler for {@link error_logger} to write events to a text file.
%%%
%%% When added with {@link gen_event:add_handler/3} function, this module
%%% expects a one-element list containing output file name:
%```
%gen_event:add... | src/indira_disk_h.erl | 0.71602 | 0.483222 | indira_disk_h.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2013, <NAME>; 2018, elli-lib team
%%
%% @doc Binary String Helper Functions
%% @end
%%
%% Copyright 2013 <NAME>
%% Copyright 2018 elli-lib team
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the Licen... | src/elli_bstr.erl | 0.663996 | 0.442335 | elli_bstr.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% cuttlefish_bytesize: complexity for parsing bytesizes
%%
%% 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 this fil... | src/cuttlefish_bytesize.erl | 0.663342 | 0.428353 | cuttlefish_bytesize.erl | starcoder |
% Copyright 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 in writing, softw... | server/src/ogonek_buildings.erl | 0.537527 | 0.478224 | ogonek_buildings.erl | starcoder |
-module(tc_bicommitment).
-export([
%% bivariate commitment API
degree/1,
eval/3,
row/2,
cmp/2,
reveal/1,
verify_poly/3,
verify_point/4,
validate_point/4,
serialize/1,
deserialize/1
]).
-type bicommitment() :: reference().
-export_type([bicommitment/0]).
-spec degree(C :: ... | src/tc_bicommitment.erl | 0.581184 | 0.427277 | tc_bicommitment.erl | starcoder |
%%%-------------------------------------------------------------------
%%% Copyright (c) 2007-2011 Gemini Mobile Technologies, Inc. All rights reserved.
%%% Copyright (c) 2013-2015 Basho Technologies, Inc. All rights reserved.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use... | src/hums_chash.erl | 0.516108 | 0.42919 | hums_chash.erl | starcoder |
-module(akvs_kv).
-export([new/1, dispose/1, set/3, get/2, get/3, del/2]).
-export_type([error/0, key/0, value/0, state/0]).
% the error type for all our functions is the same,
% it's a tuple with the error % atom as first item and a three item tuple as
% second item,
% where the first is an atom identifying the type ... | apps/akvs/src/akvs_kv.erl | 0.536799 | 0.605712 | akvs_kv.erl | starcoder |
%%-------------------------------------------------------------------
%%
%% Copyright (c) 2016, <NAME> <<EMAIL>>
%%
%% 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
%%
... | deps/sbroker/src/sbetter.erl | 0.684159 | 0.480235 | sbetter.erl | starcoder |
%% @doc The newton_iteration module implements the computation of
%% roots of real functions using Newton's method.
-module(newton_iteration).
-export([iterate/5]).
%% @doc Runs Newton's iteration
%%
%% `F' is an anonymous function of one real variable and `Fp' is the
%% derivative of `F'.
%%
%% `StartValue' is the f... | src/newton_iteration.erl | 0.73077 | 0.797557 | newton_iteration.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2006-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/inets/src/http_lib/http_uri.erl | 0.614047 | 0.426979 | http_uri.erl | starcoder |
-module(week2dot9).
-export([double/1, evens/1, evensT/1, median/1, myLength/1, occur/2, modes/1]).
% Transforming list elements
% Define an Erlang function double/1 to double the elements of a list of numbers.
double([]) ->
[];
double([H | T]) ->
[H * 2 | double(T)].
% Filtering lists
% Define a function e... | week2/week2dot9.erl | 0.511229 | 0.714877 | week2dot9.erl | starcoder |
%%
%% Copyright (c) 2018 <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
%%
%% Unl... | src/trcb_exp_overlay.erl | 0.536799 | 0.416085 | trcb_exp_overlay.erl | starcoder |
%% -------------------------------------------------------------------
%% @doc Handles interaction with the validator component.<br/>
%% The validator is responsible for verifying and scoring propositions
%% from the workers. This is the main validator module, the rest of
%% the application should use this to interface... | src/validator/validator.erl | 0.564819 | 0.627723 | validator.erl | starcoder |
%% Copyright 2020, The Tremor Team
%%
%% 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 ... | tremor-script/eqc/gen_script.erl | 0.520009 | 0.42674 | gen_script.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_dt_emcntr: A convergent, replicated, state based PN counter,
%% for embedding in riak_dt_map.
%%
%% Copyright (c) 2007-2013 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Ver... | deps/riak_dt/src/riak_dt_emcntr.erl | 0.709019 | 0.531209 | riak_dt_emcntr.erl | starcoder |
%%
%% Copyright 2016 <NAME>, 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 ... | src/relog.erl | 0.501709 | 0.401658 | relog.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 ... | src/lasp_dependence_dag.erl | 0.708213 | 0.439627 | lasp_dependence_dag.erl | starcoder |
%%
%% Copyright (c) 2018 <NAME>
%% All rights reserved.
%% Distributed under the terms of the MIT License. See the LICENSE file.
%%
%% SIP CSeq header
%%
-module(ersip_hdr_date).
-export([make/1,
make/2,
make_key/1,
date/1,
time/1,
now/0,
is_valid/1,
pars... | src/ersip_hdr_date.erl | 0.533884 | 0.450299 | ersip_hdr_date.erl | starcoder |
% MIT License
% Copyright (c) 2020 <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... | erlang/src/lesson3.erl | 0.593491 | 0.410166 | lesson3.erl | starcoder |
%%
%% @doc Various functions to work with prime numbers.
%%
-module(primes).
-author("<NAME>").
-export([is_prime/1, primes_upto/1, random_prime/2]).
-export([pollard_p1/2]).
%%
%% @doc Returns `true' if the given `N' is a prime number.
%%
-spec is_prime(N :: pos_integer()) -> boolean().
is_prime(N) -> miller_rabin(... | lib/ndpar/src/primes.erl | 0.757436 | 0.695894 | primes.erl | starcoder |
%% @doc
%%
%% Formats metric output according to the [Prometheus exposition format]
%% (https://prometheus.io/docs/instrumenting/exposition_formats/).
%%
%% Example output:
%% <pre>
%% # A counter, which has the following representation
%% # HELP http_requests_total The total number of HTTP requests.
%% # TYPE ht... | src/prometheus_format.erl | 0.621196 | 0.455986 | prometheus_format.erl | starcoder |
-module(hw1).
% functions that are included to make the assignment easier.
-export([allLess/2, distance/2, sloppyZip/2]).
% functions that you need to write to complete the assignment
-export([allTails/1, closest/2, longestOverlap/2]).
% distance(P1, P1) -> Euclidean distance from P1 to P2
% P1 and P2 must be list... | hw1/hw1.erl | 0.516839 | 0.824533 | hw1.erl | starcoder |
%% Copyright (c) 2008-2009 <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, modify, mer... | src/etap/etap_can.erl | 0.599133 | 0.420124 | etap_can.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 skel... | src/sk_map.erl | 0.61555 | 0.86977 | sk_map.erl | starcoder |
%% Copyright 2016-2017 TensorHub, 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 required by applicable law or agreed t... | src/guild_list_runs_cmd.erl | 0.548553 | 0.411702 | guild_list_runs_cmd.erl | starcoder |
%% @doc
%% Relcast's job is ensure a consistent state for consensus protocols. It
%% provides atomic updates to the consensus state, the inbound message queue and
%% the outbound message queue. It does this by speculatively processing inbound messages,
%% serializing them to disk if they can't be handled now, by serial... | src/relcast.erl | 0.530236 | 0.468183 | relcast.erl | starcoder |
%%%----------------------------------------------------------------------------
%%% @author <NAME> <<EMAIL>>
%%% @copyright 2012 University of St Andrews (See LICENCE)
%%% @headerfile "skel.hrl"
%%%
%%% @doc This module contains the initialization logic of a Farm skeleton.
%%%
%%% A task farm has the most basic kind of... | src/sk_farm.erl | 0.502197 | 0.618348 | sk_farm.erl | starcoder |
%%%-------------------------------------------------------------------
%%% Copyright 2014 The RySim Authors. 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
%%%
%... | erlang/rysim_des_actor/src/num_gen.erl | 0.70912 | 0.480783 | num_gen.erl | starcoder |
%%% @doc
%%% BLOCKTYPE
%%% Get Date and Time, Output formatted string and component values.
%%% DESCRIPTION
%%% Get Date Time value, Output component values and as formatted string
%%% Source may be local time, utc time, timestamp input, or component inputs
%%% Default format configuration string is "F"
%%% Example O... | src/block_types/lblx_datetime.erl | 0.592902 | 0.450601 | lblx_datetime.erl | starcoder |
%% common_test suite for cqerl hash mode
-module(hash_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("stdlib/include/assert.hrl").
-include("cqerl.hrl").
-compile(export_all).
-import(test_helper, [
% maybe_get_client/1,
get_client/1
... | test/hash_SUITE.erl | 0.503174 | 0.422505 | hash_SUITE.erl | starcoder |
%%
%% Copyright (c) 2016-2018 <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
%%
%... | src/ldb_metrics.erl | 0.586878 | 0.409693 | ldb_metrics.erl | starcoder |
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% @author <NAME> <<EMAIL>>
%% @doc
%% An Erlang interface to Amazon's DynamoDB.
%%
%% [http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/operationlist.html]
%%
%% erlcloud_ddb2 implements the entire 20120810 API.
%%
%% Method names mat... | src/erlcloud_ddb2.erl | 0.641535 | 0.453685 | erlcloud_ddb2.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... | lib/edoc/src/edoc_wiki.erl | 0.606149 | 0.435241 | edoc_wiki.erl | starcoder |
%%%=============================================================================
%%% @doc Adapter module for hackney metrics
%%%
%%% To use it, configure hackney;s `mod_metrics` to use `hackney_telemetry` and
%%% make sure that hackney_telemetry starts before your application.
%%%
%%% This module implements all callbac... | src/hackney_telemetry.erl | 0.772788 | 0.494995 | hackney_telemetry.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/gridfs_cursor.erl | 0.61832 | 0.403156 | gridfs_cursor.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% mi_bloom: bloom filter adapted for use by merge index.
%%
%% 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 th... | deps/merge_index/src/mi_bloom.erl | 0.595845 | 0.505859 | mi_bloom.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_containers.erl | 0.515132 | 0.513607 | porkrind_containers.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... | test/mg_core_dirange_SUITE.erl | 0.586996 | 0.482368 | mg_core_dirange_SUITE.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 Li... | src/mango_cursor.erl | 0.632389 | 0.516839 | mango_cursor.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_replicator/src/couch_replicator_rate_limiter_tables.erl | 0.774839 | 0.53358 | couch_replicator_rate_limiter_tables.erl | starcoder |
-module(aoc2019_day22).
-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,
day = 22,
name = "<NAME>",
expected = {47... | src/2019/aoc2019_day22.erl | 0.515132 | 0.649044 | aoc2019_day22.erl | starcoder |
%% @author <NAME> <<EMAIL>> [http://ferd.ca/]
%% @doc Zipper binary trees are binary trees which can be browsed
%% up and down, and left and right, much like binary trees where
%% child nodes link up to their parents.
%% An example use case could be to represent a decision tree that can be
%% rolled back.
%% Inse... | src/zipper_bintrees.erl | 0.587352 | 0.586996 | zipper_bintrees.erl | starcoder |
%% @doc Read configuration from OS environment variables.
%%
%% This module privides means of mapping OS environment variables to
%% Lee configuration values. Values of environment variables are
%% parsed according to the following rules: Lee values of type
%% `string()' are used verbatim. Values of type `atom()' are
%... | src/application/lee_os_env.erl | 0.612194 | 0.550064 | lee_os_env.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... | test/rational_SUITE.erl | 0.682362 | 0.631523 | rational_SUITE.erl | starcoder |
%% =============================================================================
%% bondy_cidr.erl -
%%
%% Copyright (c) 2016-2021 Leapsight. All rights reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obt... | apps/bondy/src/bondy_cidr.erl | 0.601125 | 0.51013 | bondy_cidr.erl | starcoder |
% BinaryVice - Improved Erlang Serialization
% Copyright (c) 2009 <NAME>
% See MIT-LICENSE for licensing information.
-module (vice_decode).
-export ([from_binary/2]).
from_binary(Schema, Binary) ->
% If it's a placeholder, then encode it.
% Otherwise, continue walking the structure.
case vice_utils:is_p... | src/vice_decode.erl | 0.502441 | 0.411466 | vice_decode.erl | starcoder |
-module(ep_http).
-include("conversions.hrl").
-export([ url_decode/1
, url_encode/1
, etag/1
]).
%%
%% Taken from https://github.com/tim/erlang-percent-encoding/blob/master/src/percent.erl
%% Percent encoding/decoding as defined by the application/x-www-form-urlencoded
%% content type (http:... | src/ep_http.erl | 0.63443 | 0.435121 | ep_http.erl | starcoder |
%%%===================================================================
%%% @copyright 2019 Klarna Bank AB (publ)
%%%
%%% @doc This module defines a stateless stream processing node that
%%% combines {@link kflow_gen_map}, {@link kflow_gen_filter} and
%%% {@link kflow_gen_demux}.
%%%
%%% This behavior can be used in two... | src/framework/kflow_gen_mfd.erl | 0.588416 | 0.491517 | kflow_gen_mfd.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the ... | src/couch_jobs/src/couch_jobs_server.erl | 0.578805 | 0.412353 | couch_jobs_server.erl | starcoder |
-module(aoc2021_day19).
-behavior(aoc_puzzle).
-export([parse/1, solve/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 19,
name = "Beacon Sc... | src/2021/aoc2021_day19.erl | 0.57678 | 0.558387 | aoc2021_day19.erl | starcoder |
%%==============================================================================
%% Copyright 2020 Erlang Solutions Ltd.
%% Licensed under the Apache License, Version 2.0 (see LICENSE file)
%%==============================================================================
%% This module can be used directly only for the ... | src/amoc_config/amoc_config_env.erl | 0.52756 | 0.412944 | amoc_config_env.erl | starcoder |
-module(datetime_shift).
-export([
shift_days/1,
shift_months/1,
shift_hours/1,
shift_mins/1
]).
-define(SECONDS_IN_A_DAY, 86400).
%%%===================================================================
%%% API
%%%===================================================================
%% @doc Moves the received ... | src/datetime_shift.erl | 0.554712 | 0.489992 | datetime_shift.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_diversity/src/vmq_diversity_utils.erl | 0.566858 | 0.482673 | vmq_diversity_utils.erl | starcoder |
%%
%% @doc Galois Fields and
%% Galois Counter Mode of Operation (GCM).
%%
%% ❗Attention: This module is for demonstration purposes only.
%% In production one should use `crypto' module from the standard library.
%%
%% @reference [1] <NAME>., <NAME>. <em>The Galois/Counter Mode of Operation (GCM)</em>
%% @reference [[h... | lib/ndpar/src/galois.erl | 0.512937 | 0.481941 | galois.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 writi... | src/fn_to_erl.erl | 0.566498 | 0.600423 | fn_to_erl.erl | starcoder |
%% @copyright 2014-2016 <NAME> <<EMAIL>>
%%
%% @doc Miscellaneous utility functions
%% @private
%% @end
-module(logi_utils).
%%----------------------------------------------------------------------------------------------------------------------
%% Exported API
%%-------------------------------------------------------... | src/logi_utils.erl | 0.60871 | 0.526221 | logi_utils.erl | starcoder |
%% @doc Main interface for Erlang captcha library
-module(ecaptcha).
-export([pixels/2, gif/2, png/2, fonts/0]).
-export_type([opts/0, effects/0, color_name/0, color_rgb/0, font_name/0, alphabet/0, err_reason/0]).
-type opts() :: #{
color => color_name() | color_rgb(),
effects => effects(),
font => font_... | src/ecaptcha.erl | 0.712432 | 0.414188 | ecaptcha.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_instrument.erl | 0.788257 | 0.457621 | ot_instrument.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/props/prop_emqx_rpc.erl | 0.559771 | 0.405331 | prop_emqx_rpc.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.erl | 0.565539 | 0.477615 | escalus.erl | starcoder |
%% @author Couchbase <<EMAIL>>
%% @copyright 2016 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_roles.erl | 0.675551 | 0.400456 | menelaus_roles.erl | starcoder |
%% --- Day 2: I Was Told There Would Be No Math ---
%%
%% The elves are running low on wrapping paper, and so they need to
%% submit an order for more. They have a list of the dimensions
%% (length l, width w, and height h) of each present, and only want to
%% order exactly as much as they need.
%%
%% Fortunately, ever... | src/day2.erl | 0.578567 | 0.943867 | day2.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_pipe/src/riak_pipe_w_reduce.erl | 0.694717 | 0.477128 | riak_pipe_w_reduce.erl | starcoder |
-module(watts_file_util).
%%
%% 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 License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0 (see also the LICENSE file)
%%
%% U... | src/watts_file_util.erl | 0.758511 | 0.408808 | watts_file_util.erl | starcoder |
%%% @doc Calculate the date of Trinidad Carnival
-module(jouvert).
-export([countdown/0,
jouvert/0,
jouvert/1,
easter/1,
%% easter_test/0,
%% Make module usable as an escript
main/1,
format_daystime/1
]).
%% for testing
-export([jouvert_after/1, ... | src/jouvert.erl | 0.695648 | 0.614163 | jouvert.erl | starcoder |
%% Use this module to run some basic query against the chain
%% For example:
%%
%% - Lookup last 500 blocks for payment_v2 transactions:
%% lookup_txns_by_type(500, blockchain_txn_payment_v2).
%%
%% - Lookup last 500 blocks for particular txn hash:
%% lookup_txns_by_type(500, <<some_txn_hash>>).
-module(miner_query).
... | src/miner_query.erl | 0.517327 | 0.582521 | miner_query.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/histogram.erl | 0.565659 | 0.490541 | histogram.erl | starcoder |
%% @doc
%% A module to encode and decode Erlang's Record.
%%
%% The rmapper module aims to take away the boilerplate of implementing
%% mapping functions from and to Erlang's records.
%%
%% This module is based on the idea that a Record should have a unique
%% mapping specification for encoding and decoding, per format... | src/rmapper.erl | 0.596198 | 0.662206 | rmapper.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/v3_kernel.erl | 0.531939 | 0.518546 | v3_kernel.erl | starcoder |
%%%
%%% Copyright 2011, Boundary
%%%
%%% 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... | deps/bear/src/bear.erl | 0.629775 | 0.434821 | bear.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @doc
%%% A lazily evaluated lists module. This module provides an iterator
%%% type which is an opaque record wrapped around a list continuation.
%%% These iterators are then used to provide a version of the stdlib
%%% `lists' functions which on... | src/llists.erl | 0.681833 | 0.646704 | llists.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2010-2017 <NAME>
%% @doc Simple server to manage the translations, owns the ets table containing all translations.
%% When new translations are read then the previous table is kept and the one before the previous is deleted.
%% Copyright 2010-2017 <NAME>
%%
%% Licensed under t... | apps/zotonic_core/src/i18n/z_trans_server.erl | 0.538255 | 0.417034 | z_trans_server.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_anno.erl | 0.545044 | 0.436682 | luerl_anno.erl | starcoder |
-module(sqerl).
-export([sql/1, sql/2, unsafe_sql/1, unsafe_sql/2, encode/1]).
%% @doc Generate an iolist (a tree of strings and/or binaries)
%% for a literal SQL statement that corresponds to the Sqerl
%% structure. If the structure is invalid, this function would
%% crash.
%%
%% This function does not allow writing ... | src/sqerl.erl | 0.611498 | 0.590455 | sqerl.erl | starcoder |
-module(guard).
-compile([export_all, nowarn_export_all]).
-spec atom(atom() | integer()) -> atom() | not_atom.
atom(A) when is_atom(A) -> A;
atom(_) -> not_atom.
-spec atom2(atom() | integer()) -> atom() | not_atom.
atom2(A) when erlang:is_atom(A) -> A;
atom2(_) -> not_atom.
-spec binary(binary() | atom()) -> bina... | test/should_pass/guard.erl | 0.522689 | 0.499695 | guard.erl | starcoder |
%% Commont Tests Data helper
-module(ctdh).
-export([
match/2,
like/2
]).
-export([
strict_diff/2,
soft_diff/2
]).
-export([
eq/1,
map_like/1,
map_equals/1,
list_equals/1,
list_contains_all/1,
list_contains_exact/1,
check/1,
check/2,
pipe/2,
any/0
]).
-exp... | src/ctdh.erl | 0.541409 | 0.663166 | ctdh.erl | starcoder |
-module(oc_metrics_SUITE).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").
-include("oc_metrics.hrl").
all() ->
[self_producer_default].
init_per_suite(Config) ->
_ = application:load(opencensus),
_ = application:ensure_all_started(opencensus),... | test/oc_metrics_SUITE.erl | 0.580233 | 0.47457 | oc_metrics_SUITE.erl | starcoder |
%% Copyright (c) 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 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/lfe_shell_docs.erl | 0.533154 | 0.41052 | lfe_shell_docs.erl | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.