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 |
|---|---|---|---|---|---|
%% @author <NAME>
%% @doc
%% Run `gen_server' modules in synchronous way for easier testing.
%%
%% == Example ==
%%
%% ```
%% {ok, State} = gen_local:start(my_server, []).
%%
%% {ok, Reply, State1} = gen_local:call(State, do_thing).
%% '''
%% @end
-module(gen_local).
%% API exports
-export([start/2,
call/2,
... | src/gen_local.erl | 0.584627 | 0.45647 | gen_local.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/erlog_demo.erl | 0.659405 | 0.458167 | erlog_demo.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/couch_epi/src/couch_epi_sup.erl | 0.567937 | 0.436622 | couch_epi_sup.erl | starcoder |
%% shapes project
-module(shapes).
-export([area/1, perimeter/1, enclose/1, bits_d/1, bits_tc/1]).
-export([area_test/0, perimeter_test/0, bits_d_test/0, bits_tc_test/0]).
%% geometric shapes
%% {circle, R} % radius
%% {rectangle, H, W}. % height, width
%% {triangle, A, B, C} % sides
area({circle, R... | class/wk1/shapes.erl | 0.708717 | 0.635477 | shapes.erl | starcoder |
%% @copyright 2007 Mochi Media, Inc.
%% @author <NAME> <<EMAIL>>
%% @doc Useful numeric algorithms for floats that cover some deficiencies
%% in the math module. More interesting is digits/1, which implements
%% the algorithm from:
%% http://www.cs.indiana.edu/~burger/fp/index.html
%% See also "Printing Floating-Point... | src/mochinum.erl | 0.615666 | 0.535038 | mochinum.erl | starcoder |
-module (mondemand_vmstats).
% This module is used to collect vmstats from the erlang vm and provide
% them in a form which mondemand can work with. In addition, I'd like
% to eventually support looking at a finer granularity than mondemand.
% In order to support this, a gen_server keeps a queue of samples. The
% sa... | src/mondemand_vmstats.erl | 0.518546 | 0.502747 | mondemand_vmstats.erl | starcoder |
%%%------------------------------------------------------------------------
%%% @author <NAME> <<EMAIL>>
%%% @author <NAME> <<EMAIL>>
%%% @copyright (C) 2015, <NAME>, <NAME>
%%% @doc
%%% Moves the frontiers of the clusters so that functions can
%%% be extracted from them. This is done by reducing the size
%%% of the co... | src/behaviour_extraction/fix_frontiers.erl | 0.539469 | 0.573111 | fix_frontiers.erl | starcoder |
%% -----------------------------------------------------------------------------
%%
%% Hamcrest Erlang.
%%
%% Copyright (c) 2010 <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.erl | 0.588653 | 0.408867 | hamcrest.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the ... | vtree/src/vtree_search.erl | 0.80567 | 0.468122 | vtree_search.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_script_sup.erl | 0.50293 | 0.40072 | vmq_diversity_script_sup.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% jam: Date/time processing.
%%
%% Copyright (c) 2016 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 w... | src/jam.erl | 0.738103 | 0.483466 | jam.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% 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 file
%% except in compliance with the License. You may obtain
... | src/hashtree_tree.erl | 0.847999 | 0.637764 | hashtree_tree.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2011. 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/random.erl | 0.68679 | 0.455925 | random.erl | starcoder |
-module(siamese).
-export([
new/0,
to_list/1,
from_list/1,
open_scope/1,
close_scope/1,
put/3,
remove/2,
find/2,
is_key/2,
get/2,
get/3,
size/1
]).
-type symtable() :: nonempty_list(map()).
%% Return an empty... | src/siamese.erl | 0.598782 | 0.550003 | siamese.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2019, OpenTelemetry Authors
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.o... | apps/opentelemetry/src/otel_resource.erl | 0.511229 | 0.452657 | otel_resource.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2011 <NAME>
%% @doc 'slice' filter, get a range of elements from a list
%% 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... | modules/mod_base/filters/filter_slice.erl | 0.520496 | 0.416025 | filter_slice.erl | starcoder |
%% Copyright (c) 2014-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/erlog_db_ets.erl | 0.550124 | 0.457561 | erlog_db_ets.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/couch_epi/src/couch_epi_data.erl | 0.570571 | 0.547948 | couch_epi_data.erl | starcoder |
%%-------------------------------------------------------------------
%%
%% Copyright (c) 2015, <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
%%
... | test/sbroker_statem_queue.erl | 0.591369 | 0.404125 | sbroker_statem_queue.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... | src/emqx_json.erl | 0.641422 | 0.436142 | emqx_json.erl | starcoder |
%%%===================================================================
%%% @copyright 2019 Klarna Bank AB (publ)
%%%
%%% @doc This module defines a stream processing node that can filter
%%% messages. It applies a pure predicate function to each incoming
%%% message.
%%%
%%% This behavior can be used in two modes: full... | src/framework/kflow_gen_filter.erl | 0.55254 | 0.446857 | kflow_gen_filter.erl | starcoder |
%%%
%%% @title Dotted Version Vector Set
%%%
%%% @doc
%%% An Erlang implementation of *compact* Dotted Version Vectors, which
%%% provides a container for a set of concurrent values (siblings) with causal
%%% order information.
%%%
%%% @copyright The MIT License (MIT)
%%% Copyright (C) 2013
%%%
%%% Permission is here... | src/dvvset.erl | 0.587233 | 0.503052 | dvvset.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_util.erl | 0.551815 | 0.412234 | hocon_util.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% 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 ob... | src/riak_core_stat_q.erl | 0.682997 | 0.484197 | riak_core_stat_q.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/syntax_tools/examples/merl/basic.erl | 0.510985 | 0.410815 | basic.erl | starcoder |
%% Copyright (c) 2022 <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.59561 | 0.419648 | lfe_shell_docs.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2021, <COMPANY>
%%% @doc
%%% Providing a fun API for sliding a list backward and forward with adding empty spaces
%%% once values matched and combined
%%% @end
%%%------------------------------------------------... | src/tofe_vector.erl | 0.57332 | 0.630571 | tofe_vector.erl | starcoder |
%% ``The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with your Erlang distribution. If not, it can be
%% retrieved via the world ... | src/trunc_io.erl | 0.587943 | 0.441071 | trunc_io.erl | starcoder |
%% Copyright (c) 2014-2018 <NAME>.
%%
%% Fuse_lb is configured with a set of fuses. It will dispatch work requests via
%% them using the selected algorithm. If a fuse burns it will be removed from
%% the set. Once the fuse is mended it will again be included in the set.
%% Different load balancing algorithms can be use... | src/fuse_lb.erl | 0.518546 | 0.422981 | fuse_lb.erl | starcoder |
%%%
%%% Copyright (c) 2018-2020 <NAME>
%%% All rights reserved.
%%% Distributed under the terms of the MIT License. See the LICENSE file.
%%%
%%% @doc
%%% Allow Header Implementation.
%%%
-module(ersip_hdr_allow).
-export([has/2,
from_list/1,
to_list/1,
from_method_set/1,
to_method... | src/message/ersip_hdr_allow.erl | 0.571647 | 0.459137 | ersip_hdr_allow.erl | starcoder |
%%%-------------------------------------------------------------------
%%% Licensed to the Apache Software Foundation (ASF) under one
%%% or more contributor license agreements. See the NOTICE file
%%% distributed with this work for additional information
%%% regarding copyright ownership. The ASF licenses this file
... | src/otter_lib_thrift.erl | 0.554229 | 0.400456 | otter_lib_thrift.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/estatsd_protocol_SUITE.erl | 0.523908 | 0.46223 | estatsd_protocol_SUITE.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1999-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/compiler/src/beam_type.erl | 0.503174 | 0.462534 | beam_type.erl | starcoder |
%%
%% Copyright 2012 - 2013 <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 requi... | src/htstream_codec.erl | 0.528533 | 0.40486 | htstream_codec.erl | starcoder |
%% @doc Default configurion and config-parsing functions.
-module(mas_config).
-include("mas.hrl").
-export([proplist_to_record/1,
options_specs/0]).
-define(LOAD(Proplist, Prop),
Prop = case proplists:lookup(Prop, Proplist) of
{Prop, Value} ->
Value;
... | src/utils/mas_config.erl | 0.584034 | 0.450903 | mas_config.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @doc Handle outgoing messages to a peer
%% <p>This module handles all outgoing messaging for a peer. It
%% supports various API calls to facilitate this</p>
%% <p>Note that this module has two modes, <em>fast</em> and
%% <em>slow</em>. The fast mode outsources the packet encoding to the
%... | apps/etorrent/src/etorrent_peer_send.erl | 0.534127 | 0.455441 | etorrent_peer_send.erl | starcoder |
-module(hoax_expect).
-export([
assert_exported/2,
parse/2
]).
-include("hoax_int.hrl").
assert_exported([Expect = #expectation{key={_,F,A}} | Rest], Exports) ->
lists:member({F, A}, Exports) orelse
error({no_such_function_to_mock, {F, A}}),
hoax_tab:insert(Expect),
assert_exp... | src/hoax_expect.erl | 0.664323 | 0.690419 | hoax_expect.erl | starcoder |
% @copyright 2013-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_rt.erl | 0.686055 | 0.55435 | histogram_rt.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 Khepri path API.
%%
%... | src/khepri_path.erl | 0.582372 | 0.425605 | khepri_path.erl | starcoder |
-module(matmul).
-export([start/1, gatherer/3, matsize_bytag/1, gen_dotprodme/3, dotprod_worker/0]).
-export([gen_col_vectors/1, split_matrix_bytag/1, split_row_vector_bytag/1]).
-export([do_multiply/3]).
% Example Matrix Multiplication demo program
% We expect InFile to contain a pair of "out" tuples for each of th... | Examples/matmul/matmul.erl | 0.550849 | 0.64816 | matmul.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... | test/saturn_SUITE.erl | 0.580709 | 0.558327 | saturn_SUITE.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author tumilok
%%% @copyright (C) 2020, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 24. Mar 2020 16:17
%%%-------------------------------------------------------------------
-module(pollution).
-author("tumilok").
%% API
-export([
createMo... | src/pollution.erl | 0.521959 | 0.461684 | pollution.erl | starcoder |
-module(complex_numbers).
-define(DELTA, 0.005).
-export([abs/1,
add/2,
conjugate/1,
divide/2,
equal/2,
exp/1,
imaginary/1,
mul/2,
new/2,
real/1,
sub/2,
test_version/0]).
-record(complex, {real = 0 :: number(), imagina... | erlang/complex-numbers/src/complex_numbers.erl | 0.507812 | 0.4231 | complex_numbers.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2005-2010. 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 Licens... | source/otp_src_R14B02/lib/ssh/src/ssh_math.erl | 0.549882 | 0.439146 | ssh_math.erl | starcoder |
%% @doc Physics: 4th-order Runge-Kutta integration
%%
%% This module is loosely based on concepts from the following articles:
%% <ul>
%% <li>[http://gafferongames.com/game-physics/integration-basics/]</li>
%% <li>[http://gafferongames.com/game-physics/physics-in-3d/]</li>
%% </ul>
% @copyright 2012 <NAME>
% L... | apps/pre_entity_layer/src/pre_physics_rk4.erl | 0.659076 | 0.53358 | pre_physics_rk4.erl | starcoder |
%%% @author <NAME> <<EMAIL>>
%%% @author <NAME> <<EMAIL>>
%%%
%%% @copyright 2012 Selectel Ltd.
%%%
%%% @doc NIF-based date and time parsing and formatting for Erlang.
%%% This module implements an interface to strptime/strftime with
%%% appropriate handling of Erlang datetime formats.
%%%
%%% All exported functions in... | src/tempo.erl | 0.616012 | 0.501709 | tempo.erl | starcoder |
-module(pop_chain).
-export([
new/1,
add_block_in_order/3,
add_transaction/2,
generate_new_block/2,
find_block_by_id/2,
get_genesis_block/1,
get_head_block/1,
get_verfier_next_block_time/2,
resolve_fork/3,
compute_block_hash/1,
compute_transaction_hash/1,
apply_block_signature/2,
apply_tr... | src/pop_chain.erl | 0.599602 | 0.504761 | pop_chain.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_core: Core Riak Application
%%
%% 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 file
%% except in c... | src/riak_core_ring_manager.erl | 0.669421 | 0.485417 | riak_core_ring_manager.erl | starcoder |
-module(poly_SUITE).
-include_lib("eunit/include/eunit.hrl").
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export(
[
eval_test/1,
zeroize_test/1,
self_subtract_test/1,
add_zero_test/1,
sub_zero_test/1,
mul_poly_test/1,
add_different_sizes_pol... | test/poly_SUITE.erl | 0.663451 | 0.657428 | poly_SUITE.erl | starcoder |
-module(aesim_utils).
%=== INCLUDES ==================================================================
-include_lib("stdlib/include/assert.hrl").
-include("aesim_types.hrl").
%=== EXPORTS ===================================================================
-export([address_group/1]).
-export([format/2]).
-export([fo... | src/aesim_utils.erl | 0.503418 | 0.578657 | aesim_utils.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 at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless req... | src/emqx_rule_sqltester.erl | 0.54698 | 0.420391 | emqx_rule_sqltester.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... | test/kai_store_SUITE.erl | 0.553143 | 0.49707 | kai_store_SUITE.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/emqx_rpc_SUITE.erl | 0.600891 | 0.516108 | emqx_rpc_SUITE.erl | starcoder |
%% ekvs_vcmanager
%% Implements functionalities for handling vector clocks
%% Store the vector clock of the current node
-module(ekvs_vcmanager).
-behaviour(gen_server).
%% Server functions
-export([start_link/0]).
-export([view_change/1]).
-export([merge_vcs/1]).
-export([new_event/1]).
-export([update_vc/1]).
-exp... | src/ekvs_vcmanager.erl | 0.530966 | 0.476641 | ekvs_vcmanager.erl | starcoder |
%% @copyright 2015 <NAME> All Rights Reserved.
%%
%% @doc Binary pattern match Based Mustach template engine for Erlang/OTP.
%%
%% This library support all of mustache syntax. <br />
%% Please refer to [the documentation for how to use the mustache](http://mustache.github.io/mustache.5.html) as the need arises.
%%
-mo... | src/bbmustache.erl | 0.597608 | 0.4575 | bbmustache.erl | starcoder |
%%
%% The mandatory header(s) for each scenario file:
%% * `-module(...).` identity of module
%% * `-compile({parse_transform, monad}).` enable monads
-module(skeleton).
-compile({parse_transform, monad}).
%%
%% The workload scenario consists of attributes and actions
%% Attributes are functions that return scalar... | examples/skeleton.erl | 0.775775 | 0.616474 | skeleton.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 Divide and Conquer skeleton.
%%%
%%% The 'divconquer' skelet... | src/sk_divconquer.erl | 0.606032 | 0.880489 | sk_divconquer.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2014. 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/io_lib_format.erl | 0.559049 | 0.47725 | io_lib_format.erl | starcoder |
%%%-------------------------------------------------------------------
%% @doc eleb128 Little-Endian Base 128 (LEB128) impl.
%% The basic impl. of LEB128 (https://en.wikipedia.org/wiki/LEB128)
%% @end
%%%-------------------------------------------------------------------
-module(eleb128).
%% API
-export([signed_encod... | src/eleb128.erl | 0.567937 | 0.491029 | eleb128.erl | starcoder |
% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%%% ex: ft=erlang ts=4 sw=4 et
%%%
%%% Copyright 2016 <NAME>
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%... | src/alpaca_typer.erl | 0.533641 | 0.432902 | alpaca_typer.erl | starcoder |
%% -------------------------------------------------------------------
%% Dasudian Distributed Bayesian Network
%%
%% @author <NAME> <<EMAIL>>, <<EMAIL>>
%% @copyright (c) 2015-2016 Dasudian.com. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may n... | src/bn.erl | 0.550124 | 0.520314 | bn.erl | starcoder |
%%%
%%% Ranges w/ optional bounds on ordered types.
-module(ff_range).
-type range(T) :: {maybe(bound(T)), maybe(bound(T))}.
-type bound(T) :: {exclusive | inclusive, ord(T)}.
-type maybe(T) :: infinity | T.
% totally ordered
-type ord(T) :: T.
-export_type([range/1]).
-export_type([bound/1]).
-export([intersect/2... | apps/ff_core/src/ff_range.erl | 0.550607 | 0.590484 | ff_range.erl | starcoder |
-module(quic_util).
-include("quic.hrl").
%% ------------------------------------------------------------------
%% API Function Exports
%% ------------------------------------------------------------------
-export([binary_chunks/2]).
-export([exact_binary_chunks/2]).
-export([bit_to_boolean/1]).
-export([boolean_to_... | src/quic_util.erl | 0.516839 | 0.448547 | quic_util.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_btree_stats.erl | 0.53048 | 0.502502 | couch_btree_stats.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% 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 file
%% except in compliance with the License. You may obtain
... | deps/yokozuna/src/yz_rs_migration.erl | 0.583322 | 0.403273 | yz_rs_migration.erl | starcoder |
-module(day2).
-export([solve_part1/1, solve_part2/1]).
%% for tests
-export([validate/4, count/2, validate2/4, is_char_at/3]).
%%% solution behavior
solve_part1(Input) ->
length([Password || {Character, AtLeast, AtMost, Password} <- Input,
validate(Character, AtLeast, AtMost, Password)]).
s... | src/day2.erl | 0.503662 | 0.495178 | day2.erl | starcoder |
%%% -*- erlang -*-
%%%
%%% This file is part of hackney_lib released under the Apache 2 license.
%%% See the NOTICE for more information.
%%%
%%% Copyright (c) 2011-2012, <NAME> <<EMAIL>>
%%% Copyright (c) 2013-2015 <NAME>
%%%
%%% @doc HTTP parser in pure Erlang
%%% This parser is able to parse HTTP responses and reque... | deps/hackney/src/hackney_http.erl | 0.538255 | 0.454109 | hackney_http.erl | starcoder |
-module(thoas).
-export([
decode/1, decode/2, encode/1, encode/2, encode_to_iodata/1,
encode_to_iodata/2
]).
-export_type([
decode_error/0, decode_options/0, encode_options/0, json_term/0,
input_term/0
]).
-type decode_options() :: #{
strings => reference | copy
}.
-type encode_options() :: #{
... | src/thoas.erl | 0.560253 | 0.457985 | thoas.erl | starcoder |
% LSM9DS1 3-axis accelerometer, 3-axis gyroscope, 3-axis magnetometer:
% http://www.st.com/web/en/resource/technical/document/datasheet/DM00103319.pdf
%
% LPS25HB digital barometer
% http://www.st.com/web/en/resource/technical/document/datasheet/DM00141379.pdf
% @doc Driver module for the <a href="https://store.digile... | src/pmod_nav.erl | 0.730963 | 0.693499 | pmod_nav.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_run.erl | 0.709321 | 0.45532 | edoc_run.erl | starcoder |
%% -------- Overview ---------
%%
%% There are two primary types of exchange sorted
%% - a full exchange aimed at implementations with cached trees, where the
%% cached trees represent all the data in the location, and the comparion is
%% between two complete data sets
%% - a partial exchange where it is expected that ... | src/aae_exchange.erl | 0.650578 | 0.842507 | aae_exchange.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_core: Core Riak Application
%%
%% 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 file
%% except in c... | src/json_pp.erl | 0.534612 | 0.532972 | json_pp.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_dead.erl | 0.64232 | 0.419113 | beam_ssa_dead.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_views/src/couch_views_encoding.erl | 0.60964 | 0.486271 | couch_views_encoding.erl | starcoder |
%% @doc
%% A Histogram tracks the size and number of events in buckets.
%% You can use Histograms for aggregatable calculation of quantiles.
%%
%% Example use cases for Histograms:
%% <ul>
%% <li>Response latency</li>
%% <li>Request size</li>
%% </ul>
%%
%% Histogram expects `buckets' key in a metric spec. Buckets ... | src/metrics/prometheus_histogram.erl | 0.790611 | 0.602763 | prometheus_histogram.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 an API to... | src/bp_tree_array.erl | 0.609175 | 0.512144 | bp_tree_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/fabric/src/fabric2_txids.erl | 0.597608 | 0.464234 | fabric2_txids.erl | starcoder |
%% @copyright 2014-2016 <NAME> <<EMAIL>>
%%
%% @doc A built-in layout which formats log messages by an arbitrary user defined function
%%
%% This layout formats log messages by `format_fun/0' which was specified by the argument of {@link new/1}.
%%
%% == NOTE ==
%% This module is provided for debuging/testing purposes ... | src/logi_builtin_layout_fun.erl | 0.572603 | 0.446434 | logi_builtin_layout_fun.erl | starcoder |
%% @doc A client for the Dataset Register REST API.
%% @see https://datasetregister.netwerkdigitaalerfgoed.nl/api
-module(dataset_register_client).
-author("<NAME> <<EMAIL>>").
-export([
validate/2,
validation_results_url/2,
submit/2
]).
-include("zotonic.hrl").
-define(URL, <<"https://datasetregister.ne... | support/dataset_register_client.erl | 0.532425 | 0.451992 | dataset_register_client.erl | starcoder |
%
% This file is part of AtomVM.
%
% Copyright 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/licenses/LICENSE-2.0
%
% Unless required by a... | libs/estdlib/src/base64.erl | 0.779616 | 0.444324 | base64.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @doc
%%% A set of optics specific to gb_trees.
%%% @end
%%%-------------------------------------------------------------------
-module(optic_gb_trees).
%% API
-export([all/0,
all/1,
keys/0,
keys/1,
values/0,
... | src/optic_gb_trees.erl | 0.677474 | 0.47171 | optic_gb_trees.erl | starcoder |
-module(spiral_matrix).
-export([make/1,
test_version/0]).
-record(remaining, {start_x :: non_neg_integer(),
end_x :: non_neg_integer(),
start_y :: non_neg_integer(),
end_y :: non_neg_integer()}).
-type matrix() :: [[pos_integer()]].
%% API
-spec... | erlang/spiral-matrix/src/spiral_matrix.erl | 0.542863 | 0.551936 | spiral_matrix.erl | starcoder |
%% -------------------------------------------------------------------
%% ya_orset.erl Implementation of Observed-Remove Set
%% OR-Set is a CRDT. Concurrent adds commute since each one is unique. Concurrent
%% removes commute because any common pairs have the same effect, and any disjoint pairs
%% have independent effe... | src/ya_orset.erl | 0.516839 | 0.580828 | ya_orset.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2019-2021 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the Lice... | test/mria_node_monitor_SUITE.erl | 0.545286 | 0.410993 | mria_node_monitor_SUITE.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_w_reduce.erl | 0.777596 | 0.534855 | riak_kv_w_reduce.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% xqerl - XQuery processor
%%
%% Copyright (c) 2018-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/xqldb_string_table2.erl | 0.552057 | 0.503601 | xqldb_string_table2.erl | starcoder |
%% @copyright 2017 <NAME> <<EMAIL>>
%%
%% @doc Span Context.
%%
%% <blockquote>
%% Each <b>SpanContext</b> encapsulates the following state: <br />
%% <ul>
%% <li>Any OpenTracing-implementation-dependent state (for example, trace and span ids)
%% needed to refer to a distinct <b>Span</b> across a process bounda... | src/passage_span_context.erl | 0.820865 | 0.494263 | passage_span_context.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_math.erl | 0.563858 | 0.530784 | xqerl_mod_math.erl | starcoder |
%%%-------------------------------------------------------------------
%%% Licensed to the Apache Software Foundation (ASF) under one
%%% or more contributor license agreements. See the NOTICE file
%%% distributed with this work for additional information
%%% regarding copyright ownership. The ASF licenses this file
... | src/otter_lib_filter.erl | 0.578329 | 0.440048 | otter_lib_filter.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.erl | 0.584983 | 0.471406 | gridfs.erl | starcoder |
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved.
%%
-module(rabbit_msg_store_inde... | erlang_server/_build/default/lib/rabbit_common/src/rabbit_msg_store_index.erl | 0.618204 | 0.446434 | rabbit_msg_store_index.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1999-2012. 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 Licens... | dependencies/otp/17.1/lib/compiler/src/v3_life.erl | 0.50293 | 0.439266 | v3_life.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_matching.erl | 0.519034 | 0.465934 | filter_survey_prepare_matching.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2014 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
... | src/plumtree_util.erl | 0.629888 | 0.486392 | plumtree_util.erl | starcoder |
-module(vector_basics_SUITE).
-include_lib("eunit/include/eunit.hrl").
-include("erlynum.hrl").
zeros_empty_test() ->
NVector = nvector:zeros(0),
{RowsCount, ColsCount} = NVector#nvector.shape,
TotalCount = RowsCount * ColsCount,
?assertEqual(0, TotalCount),
BinData = NVector#nvector.data,
?as... | test/vector_basics_SUITE.erl | 0.565059 | 0.782912 | vector_basics_SUITE.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @doc
%%% This module provides the public API for eflambe. These public functions are
%%% intended to be invoked by the end user to perform profiling of their
%%% application.
%%% @end
%%%----------------------------------------------------------... | src/eflambe.erl | 0.607896 | 0.464173 | eflambe.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Machi: a small village of replicated files
%%
%% Copyright (c) 2014-2015 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% e... | test/machi_chain_manager1_converge_demo.erl | 0.542621 | 0.423041 | machi_chain_manager1_converge_demo.erl | starcoder |
%% vim: set ai et sw=4 sts=4:
%% See LICENSE for licensing information.
-module(yaml_flow).
-export([ mapping/2
, sequence/2
]).
-include("yaml_grapheme.hrl").
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
%=======================================================================
-s... | src/yaml_flow.erl | 0.555194 | 0.432902 | yaml_flow.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_baggage.erl | 0.5144 | 0.432003 | otel_baggage.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
%%
%... | src/state_boolean.erl | 0.702122 | 0.457621 | state_boolean.erl | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.