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 |
|---|---|---|---|---|---|
-module(quic_error).
-export([decode/1]).
-export([encode/1]).
%
% Taken from Chromium: "net/quic/core/quic_error_codes.h" @ 05124be
%
-type decoded_value() :: (
no_error |
% Connection has reached an invalid state.
internal_error |
% There were data frames after the a fin or reset.
... | src/quic_error.erl | 0.657318 | 0.402921 | quic_error.erl | starcoder |
%% @doc
%% Collects information about memory dynamically allocated
%% by the Erlang emulator using
%% <a href="http://erlang.org/doc/man/erlang.html#memory-0">
%% erlang:memory/0
%% </a>, also provides basic (D)ETS statistics.
%%
%% ==Exported metrics==
%% <ul>
%% <li>
%% `erlang_vm_memory_atom_bytes_total{usag... | src/collectors/vm/prometheus_vm_memory_collector.erl | 0.670393 | 0.474327 | prometheus_vm_memory_collector.erl | starcoder |
-module(herd_datetime).
-export([
now/0, now_micro/0,
datetime_from_db/1,
timestamp_to_datetime/1,
timestamp_to_db_datetime/1,
datetime_to_timestamp/1,
datetime_to_ISO/1,
add_interval/2,
subtract_interval/2
]).
-type(timestamp() :: integer()). % seconds, 1476882197
-type(timestamp_micr... | src/herd_datetime.erl | 0.549641 | 0.544135 | herd_datetime.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/cbt_ets.erl | 0.597256 | 0.436922 | cbt_ets.erl | starcoder |
-module(teal).
-export([assert/3,
not_equal/2, assert_not_equal/2, assert_not_equal/3,
raises_exception/1, assert_raises_exception/1,
assert_raises_exception/2,
raises_exception_with_message/2,
assert_raises_exception_with_message/2,
assert_raises_exception_with_me... | src/teal.erl | 0.564339 | 0.631935 | teal.erl | starcoder |
-module(dsdc_block_candidate).
-export([ apply_block_txs/5
, apply_block_txs_strict/5
, calculate_fee/1
, calculate_total_fee/1
, create/1
, create_with_state/4
]).
-export([adjust_target/2]).
%% -- API functions --------------------------------------------------------... | apps/dsdcore/src/dsdc_block_candidate.erl | 0.527317 | 0.417093 | dsdc_block_candidate.erl | starcoder |
%%%----------------------------------------------------------------
%%% @author <NAME> <<EMAIL>>
%%% @doc Utility functions to work with binary strings
%%%
%%% @end
%%% @copyright 2011-2012 <NAME>. See LICENSE file.
%%%----------------------------------------------------------------
-module(sip_binary).
%% API
-expor... | apps/sip/src/syntax/sip_binary.erl | 0.552781 | 0.422147 | sip_binary.erl | starcoder |
%% @author Couchbase <<EMAIL>>
%% @copyright 2015-2020 Couchbase, Inc.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless r... | src/simple_store.erl | 0.54577 | 0.412885 | simple_store.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_json.erl | 0.690246 | 0.420005 | porkrind_json.erl | starcoder |
-module(k6_bytea).
-vsn("1.1.2").
-export([count/0, new/1, delete/1, size/1, get/3, set/3, from_binary/1, to_binary/1]).
-on_load(init/0).
-opaque bytea() :: bytea_opaque_resource_type.
%% The byte array resource handle.
-export_type([bytea/0]).
%% Test support
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
... | src/k6_bytea.erl | 0.537527 | 0.450178 | k6_bytea.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_md.erl | 0.61231 | 0.432782 | hocon_md.erl | starcoder |
%% The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at http://www.mozilla.org/MPL/
%%
%% Software distributed under the License is distributed on an "AS IS"
%% b... | apps/erlando/src/state_t.erl | 0.63477 | 0.468365 | state_t.erl | starcoder |
%%==============================================================================
%% Copyright 2020 Erlang Solutions Ltd.
%% Licensed under the Apache License, Version 2.0 (see LICENSE file)
%%==============================================================================
-module(amoc_coordinator_worker).
-behaviour(gen... | src/amoc_coordinator/amoc_coordinator_worker.erl | 0.506347 | 0.494446 | amoc_coordinator_worker.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.840161 | 0.459804 | khepri_path.erl | starcoder |
-module(elocaltime).
-include("elocaltime.hrl").
-export([
start/0,
start/1,
stop/0,
civil_lookup/2,
absolute_lookup/2,
utc2local_datetime/2,
utc2local_ts/2,
local2utc_ts/3,
local2utc_datetime/3,
is_timezone_valid/1,
format/2,
format/3
]).
-type reason() :: any().
... | src/elocaltime.erl | 0.544317 | 0.41941 | elocaltime.erl | starcoder |
%%
%% Example erlang client implementation for the Etsy statsd
%%
%% Copyright (c) 2011 <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 ... | examples/statsd.erl | 0.546254 | 0.401512 | statsd.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.
%%
-module(conditions).
-includ... | test/conditions.erl | 0.5144 | 0.46642 | conditions.erl | starcoder |
%% [author] : <NAME> <<EMAIL>>
%% [project] : Luhn Algorithm
-module(luhn).
-author("<NAME>").
-import(lists, [len/1, chr/2, str/2, fac/1, persistent_term/2, droplast/1, foldr/3, last/1]).
-export([check_luhn/1, for/2, start/1, log/1, valid/1, create/1]).
-export_type([digit/0, valid_char/0]).
-compile(export_all)... | luhn.erl | 0.604399 | 0.450662 | luhn.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 prov... | src/tree_processing/effective_value.erl | 0.603231 | 0.480966 | effective_value.erl | starcoder |
%% @doc Functions for working with ranges in lists.
%%
%% ETS is fast only as a key-value store.
%% But some data files contains ranges: From..To.
%% The fastest way is using lists for storing this values.
%%
%% There is two types of these lists:
%% * with booleans: `[{1,3}, 6, {8,9}]'. For exa... | src/utils/ux_opt_ranges.erl | 0.503174 | 0.718076 | ux_opt_ranges.erl | starcoder |
-module(danilagamma).
% Source: https://erlangforums.com/t/advent-of-code-2021-day-5/738/2
% Author of the code: <NAME>
% Comments by me (<NAME>)
-compile(export_all).
% Comments for main/1:
% If the file name (File) is "input_from_description.txt"
% First it reads the file and puts a long binary it into RawData.
% T... | adventofcode/2021/day05_2021/danilagamma.erl | 0.513668 | 0.582966 | danilagamma.erl | starcoder |
%% @doc Simplifies working with and perfoming math on vectors.
%%
%% @copyright 2012 <NAME>
%% Licensed under the MIT license; see the LICENSE file for details.
-module(vector).
% -------------------------------------------------------------------------
% external api
-export([vec_to_list/1, to_vec/1, dot/2, cross/2... | apps/pre_entity_layer/src/vector.erl | 0.609059 | 0.478285 | vector.erl | starcoder |
%% @doc Mandatory background read on language tags: [1].
%%
%% Some quotes from [1]:
%%
%% The golden rule when creating language tags is to keep the tag as short as
%% possible. Avoid region, script or other subtags except where they add useful
%% distinguishing information. For instanc... | apps/zotonic_core/src/i18n/z_language.erl | 0.537284 | 0.428831 | z_language.erl | starcoder |
%%%-------------------------------------------------------------------
%% @author <NAME> <<EMAIL>>
%% @copyright (C) 2017, <NAME>
%% @doc erl_id3_dectree.erl
%% ID3 Algorithm creates a decision tree for classification based on labeled
%% training data. It creates the tree top-down and selects the attribute to split on
... | erl_id3_dectree/erl_id3_dectree.erl | 0.638723 | 0.687977 | erl_id3_dectree.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... | src/external/cloudi_x_exometer_core/src/exometer_slide.erl | 0.687315 | 0.407982 | exometer_slide.erl | starcoder |
-module(benchmark).
-export([test_fib/0, test_get_channel_history/0, test_send_message/0]).
%% Fibonacci
fib(0) -> 1;
fib(1) -> 1;
fib(N) -> fib(N - 1) + fib(N - 2).
%% Benchmark helpers
% Recommendation: run each test at least 30 times to get statistically relevant
% results.
run_benchmark(Name, Fun, Times) ->
... | src/benchmark.erl | 0.643105 | 0.476519 | benchmark.erl | starcoder |
-module(hash).
% Our own version of Ruby's Hash class
-export([
any/2,
all/2,
delete/2,
dig/2,
empty/1,
has_key/2,
has_value/2,
keys/1,
values/1,
merge/2,
reject/2,
select/2,
shift/1,
size/1,
... | chapter_5/exercise_3/hash.erl | 0.640411 | 0.459379 | hash.erl | starcoder |
%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unles... | test/emqx_pqueue_SUITE.erl | 0.604632 | 0.52476 | emqx_pqueue_SUITE.erl | starcoder |
%%%
% This module is used to do proper Geographic queries
% which take into consideration the non-2D nature of the Earth.
%
% We use the underlying R-Tree to represent the Earth's
% surface as 2D in Lat/Lng, which is effiecient as a primarily filter.
% This module provides the secondary filtering and data manipulation ... | src/teles_geo_query.erl | 0.768473 | 0.825519 | teles_geo_query.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_kv_stat_bc: backwards compatible stats module. Maps new folsom stats
%% to legacy riak_kv stats.
%%
%% Copyright (c) 2007-2010 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Ap... | deps/riak_kv/src/riak_kv_stat_bc.erl | 0.629091 | 0.449272 | riak_kv_stat_bc.erl | starcoder |
-module(hoax_invocation).
-export([handle/3]).
-include("hoax_int.hrl").
handle(M, F, Args) ->
case hoax_tab:lookup_expectations({M, F, length(Args)}) of
[] ->
erlang:error({unexpected_invocation, hoax_fmt:fmt({M, F, Args})});
Records ->
case find_matching_args(Args, Record... | src/hoax_invocation.erl | 0.637482 | 0.526099 | hoax_invocation.erl | starcoder |
%%%-------------------------------------------------------------------
%%% Author :
%%% Description :
%%%
%%% Created :
%%%-------------------------------------------------------------------
-module(ndarray).
-compile({no_auto_import, [size/1, apply/3]}).
-include_lib("axis.hrl").
-include_lib("kernel/include/logger.... | src/ndarray.erl | 0.529507 | 0.518973 | ndarray.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_kv_bucket: bucket validation functions
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% ... | deps/riak_kv/src/riak_kv_bucket.erl | 0.702632 | 0.445047 | riak_kv_bucket.erl | starcoder |
-module(influxdb).
-export([
query/2,
query/3,
query/4,
write/2,
write/3
]).
-export_type([
config/0,
time_unit/0,
query/0,
query_parameters/0,
point/0
]).
-type config() :: influxdb_config:config().
-type time_unit() :: hour | minute | second | millisecond | microsecond | nano... | src/influxdb.erl | 0.60871 | 0.436982 | influxdb.erl | starcoder |
% @doc I2C driver API.
%
% This API is based on the
% <a href="https://docs.rtems.org/doxygen/branches/master/group__I2CLinux.html">
% Linux I2C User Space API
% </a>.
% For a description of the I2C protocol see
% [https://www.kernel.org/doc/Documentation/i2c/i2c-protocol].
-module(grisp_i2c).
-behavior(gen_server).
... | src/grisp_i2c.erl | 0.593609 | 0.422981 | grisp_i2c.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/couchdb/couchdb_os_proc_pool.erl | 0.582847 | 0.411525 | couchdb_os_proc_pool.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2004-2013. 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_bool.erl | 0.510496 | 0.439928 | beam_bool.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_type.erl | 0.636353 | 0.428233 | state_type.erl | starcoder |
-module(els_code_action_provider).
-behaviour(els_provider).
-export([
is_enabled/0,
handle_request/2
]).
-include("els_lsp.hrl").
-type state() :: any().
%%==============================================================================
%% els_provider functions
%%===========================================... | apps/els_lsp/src/els_code_action_provider.erl | 0.519521 | 0.437703 | els_code_action_provider.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @doc
%%% Partitioned/Sharded ETS tables.
%%%
%%% <h2>Features</h2>
%%%
%%% <ul>
%%% <li>
%%% `shards' implements the ETS API to keep compatibility and make the usage
%%% straightforward; exactly the same if you were using `ets'.
%%% </li>
%%% <l... | src/shards.erl | 0.516108 | 0.583025 | shards.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2019-2022 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... | apps/emqx/src/emqx_limiter/src/emqx_limiter_decimal.erl | 0.68056 | 0.4474 | emqx_limiter_decimal.erl | starcoder |
%% @doc: Implementation of HyperLogLog with bias correction as
%% described in the Google paper,
%% http://static.googleusercontent.com/external_content/untrusted_dlcp/
%% research.google.com/en//pubs/archive/40671.pdf
-module(hyper).
%%-compile(native).
-export([new/1, new/2, insert/2, insert_many/2]).
-export([union... | src/hyper.erl | 0.525369 | 0.551815 | hyper.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/state_lwwmap.erl | 0.619241 | 0.412737 | state_lwwmap.erl | starcoder |
-module(zoo_network).
-export([new/1, run/3, mutate/2, clone/1]).
-export_type([zoo_network/0]).
-record(zoo_network, {
weights :: [[number()]],
state :: [number()]
}).
-opaque zoo_network() :: #zoo_network{}.
% @doc returns a new network with random weights
-spec new(pos_integer()) -> ... | src/zoo_network.erl | 0.637144 | 0.616012 | zoo_network.erl | starcoder |
%%% ==========================================================================
%%% Copyright 2015 Silent Circle
%%%
%%% 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.... | test/sc_util_SUITE.erl | 0.538255 | 0.490846 | sc_util_SUITE.erl | starcoder |
%%==============================================================================
%% Copyright 2016-2021 <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.a... | src/bloom.erl | 0.813609 | 0.415017 | bloom.erl | starcoder |
-module(day15).
%% API exports
-export([part1/1, part2/1]).
part1(Filename) ->
{MaxX, MaxY, Grid} = parse(Filename),
GetAdjacents = make_adjacent_fun(MaxX, MaxY),
Graph0 = build_graph(Grid, GetAdjacents),
Graph = dijkstra(Graph0, _Source = {1, 1}),
#{dist := Dist} = get_vertex_label(Graph, {MaxX,... | src/day15.erl | 0.541651 | 0.680952 | day15.erl | starcoder |
%% -------- Utility Functions ---------
%%
%% Generally helpful funtions within leveled
%%
-module(leveled_util).
-include("include/leveled.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([generate_uuid/0,
integer_now/0,
integer_time/1,
magic_hash/1]).
-spec generate_... | src/leveled_util.erl | 0.607081 | 0.435601 | leveled_util.erl | starcoder |
%%% -*- erlang -*-
%%%
%%% This file is part of metrics released under the BSD license.
%%% See the LICENSE for more information.
%%%
%% @doc metric module for folsom
%%
-module(metrics_folsom).
-export([
new/2,
delete/1,
increment_counter/1,
increment_counter/2,
decrement_counter/1,
decrement... | deps/metrics/src/metrics_folsom.erl | 0.504639 | 0.410343 | metrics_folsom.erl | starcoder |
%% @copyright 2015-2016 <NAME> <<EMAIL>>
%%
%% @doc Pairing Heaps
%% @private
%% @end
%%
%% NOTE:
%% v0.0.12との互換性維持用モジュール.
%%
%% コード自体は https://github.com/sile/logi_stdlib/blob/master/src/logi_util_heap.erl からの移植.
-module(logi_builtin_util_heap).
%%----------------------------------------------------------------------... | src/logi_builtin_util_heap.erl | 0.645008 | 0.424651 | logi_builtin_util_heap.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2021 <NAME>
%% @doc Parse HTML, adds ids to all header elements and returns a toc menu referring to those ids.
%% 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.
%% ... | apps/zotonic_mod_base/src/filters/filter_toc.erl | 0.502197 | 0.524821 | filter_toc.erl | starcoder |
-module(week1).
-export([perimeter/1, area/1, enclose/1, bitSum/1, bitSumR/1]).
%Shapes
% let's is begin with simple shapes like square, rhombus, rectangle, and circle
perimeter({ square, {_X, _Y}, W }) ->
W * 4;
perimeter({ rhombus, {_X, _Y}, W} ) ->
W * 4;
perimeter({ rectangle, {_X, _Y}, W, H }) ->
W * 2 +... | week1/week1.erl | 0.629091 | 0.776877 | week1.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 ... | src/db_merkle_trees.erl | 0.790813 | 0.541166 | db_merkle_trees.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_kv_coverage_filter: Construct coverage filter functions.
%%
%%
%% 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 ... | deps/riak_kv/src/riak_kv_coverage_filter.erl | 0.689201 | 0.522507 | riak_kv_coverage_filter.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_span_utils.erl | 0.598312 | 0.403508 | otel_span_utils.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2012-2016 <NAME> <<EMAIL>>.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.ap... | src/emqttd_trie.erl | 0.528777 | 0.42913 | emqttd_trie.erl | starcoder |
%%% @author <NAME> <<EMAIL>>
%%% @copyright (C) 2021, <NAME>
%%% @doc
%%%
%%% Server that manages the state of a single particle.
%%%
%%% The server maintains an internal clock representing the number of
%%% iterations it has evaluated. In addition, it maintains a copy of
%%% the position and value of all its neighbori... | src/particle_server.erl | 0.584153 | 0.570032 | particle_server.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @doc Provides helpers to work with files.
%% Any function in this module does also accept a `string'/`binary' where a `file()' is expected.
%% To allow some sort of caching, it will also return a new `file()' which then encapsulates
%% metadata. Future reads of an exisitng attribute in th... | src/ea_files.erl | 0.688887 | 0.403802 | ea_files.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.586996 | 0.494324 | escalus.erl | starcoder |
%%
%% Copyright 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 in wr... | lib/kernel/examples/erl_uds_dist/src/erl_uds_dist.erl | 0.71423 | 0.449876 | erl_uds_dist.erl | starcoder |
%%
%% Copyright (c) 2012 - 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
%%
%% Un... | src/sets/sbf.erl | 0.568775 | 0.413655 | sbf.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2017
%%% @doc
%%%
%%% @end
%%% Created : 02. Dec 2017 20.00
%%%-------------------------------------------------------------------
-module(day2).
-author("ngunder").
%%--- Day 2: Corruption Checksum ---
%%
%% A... | src/day2.erl | 0.507568 | 0.841631 | day2.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
... | deps/riak_kv/priv/tracers/tracer_timeit.erl | 0.534855 | 0.416559 | tracer_timeit.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_max_int.erl | 0.681515 | 0.441131 | state_max_int.erl | starcoder |
%%==============================================================================
%% @author <NAME> <<EMAIL>>
%% @copyright 2015 AWeber Communications
%% @end
%%==============================================================================
-module(autocluster_util).
%% API
-export([as_atom/1,
as_integer/1,
... | src/autocluster_util.erl | 0.570212 | 0.495545 | autocluster_util.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>, <<EMAIL>>
%%% @doc
%%% Command line utility behaviour. Usage example:
%%%
%%% From an escript main/1 function (requires `-mode(compile)'):
%%% ```
%%% cli:run(Args).
%%% '''
%%%
%%% Or, to limit cli behaviour discovery,
%... | src/cli.erl | 0.546496 | 0.498474 | cli.erl | starcoder |
-module(assignment1).
-export([area/1,perimeter/1,enclose/1,bitsR/1,bitsTR/1,tests/0]).
%% Read https://en.wikipedia.org/wiki/Triangle#Computing_the_sides_and_angles for inspiration about triangle representations. Investigations:
%% 1) No need for a base and a height but heavy use a trig funcs, which are very expensiv... | assignment1.erl | 0.755727 | 0.874131 | assignment1.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/easton_geojson.erl | 0.620047 | 0.470858 | easton_geojson.erl | starcoder |
-module(slacker_channel).
-include("spec.hrl").
-export([archive/2, create/2, history/3, info/2, invite/3,
join/2, kick/3, leave/2, list/2, mark/3, rename/3,
set_purpose/3, set_topic/3, unarchive/2]).
%% @doc Archives a channel.
-spec archive(Token :: string(), Channel :: string()) -> http_respons... | src/slacker_channel.erl | 0.642208 | 0.448124 | slacker_channel.erl | starcoder |
%% Integer types represented as ranges with infinities
-module(gradualizer_int).
%% Integer types
-export([is_int_type/1,
is_int_subtype/2,
int_type_glb/2,
int_type_diff/2,
negate_int_type/1,
merge_int_types/1]).
%% Ranges <--> integer types
-export([int_type_to_range/1,
... | src/gradualizer_int.erl | 0.64512 | 0.405007 | gradualizer_int.erl | starcoder |
%%
%% @doc This module contains a few functions useful when working with
%% HTML forms in ErlyWeb.
%%
%% @author <NAME> <<EMAIL>> [http://yarivsblog.com)]
%% @copyright <NAME> 2006-2007
%% For license information see LICENSE.txt
-module(erlyweb_forms).
-export([to_recs/2, validate/3, validate1/3, validate_rec/2]).
%... | src/erlyweb/erlyweb_forms.erl | 0.61855 | 0.557273 | erlyweb_forms.erl | starcoder |
-module(puzzle).
-export([new/1, foreach_solution/2, to_puzzle_string/1]).
-include("puzzle.hrl").
-include("unknown.hrl").
%% Returns a new Puzzle with empty Cells.
%%
new() ->
#puzzle{
placed = [],
unknown = [unknown:new(N) || N <- lists:seq(0, 80)]
}.
%% Returns a new Puzzle with each Cell... | src/puzzle.erl | 0.505127 | 0.664064 | puzzle.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% mi_utils: Utilities used across all merge_index modules.
%%
%% 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 ... | src/mi_utils.erl | 0.516839 | 0.42668 | mi_utils.erl | starcoder |
%% -------------------------------------------------------------------
%% @doc Utility functions for saving and loading the game state to/from disk.<br/>
%% Savegame files are created with {@link autosave/1} or {@link save_state/2}.
%% To load a savegame, the file should be read with {@link file:consult/1},
%% contents... | src/savegames.erl | 0.703448 | 0.449272 | savegames.erl | starcoder |
%
% This file is part of AtomVM.
%
% Copyright 2021 <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/maps.erl | 0.794345 | 0.434101 | maps.erl | starcoder |
% Copyright 2012-2014 Cloudant
%
% 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, ... | wkb/src/wkb_writer.erl | 0.547706 | 0.470068 | wkb_writer.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
%%% distri... | src/fieldmask.erl | 0.721743 | 0.599016 | fieldmask.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2002-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
... | lib/compiler/src/sys_core_dsetel.erl | 0.539226 | 0.462352 | sys_core_dsetel.erl | starcoder |
%%% @doc Type checking of GraphQL query documents
%%%
%%% The type checker carries out three tasks:
%%%
%%% Make sure that types check. That is, the user supplies a well
%%% typed query document.
%%%
%%% Make sure that types are properly inferred. Some times, the types
%%% the user supply needs an inference pass in ord... | src/graphql_check.erl | 0.510741 | 0.66554 | graphql_check.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/mem3/src/mem3_cluster.erl | 0.806243 | 0.567997 | mem3_cluster.erl | starcoder |
%% Copyright (c) 2019-2021, <NAME> <<EMAIL>>. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless require... | src/uef_bin.erl | 0.761982 | 0.405979 | uef_bin.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%... | lib/xmerl/src/xmerl_xs.erl | 0.622574 | 0.456228 | xmerl_xs.erl | starcoder |
%% eunit_formatters https://github.com/seancribbs/eunit_formatters
%% Changes made to the original code:
%% - Embedded binomial_heap.erl file contents into current file.
%% - ignore warnings for heap implementation to keep complete implementation.
%% - removed "namespaced_dicts" dependant preprocessor directive,
%% ... | test/eunit_progress.erl | 0.522202 | 0.451085 | eunit_progress.erl | starcoder |
%%%-------------------------------------------------------------------
%% @doc Value Representation Age String.
%%
%% A string of characters with one of the following formats --
%% nnnD,
%% nnnW,
%% nnnM,
%% nnnY;
%%
%% where nnn shall contain the number of days for D,
%% weeks for W, months for M, or years for Y.
%% E... | src/wolfpacs_vr_as.erl | 0.620047 | 0.558989 | wolfpacs_vr_as.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% taken from: https://github.com/basho/riak_core/blob/develop/src/chash.erl
%%
%% chash: basic consistent hashing
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache Li... | src/chash.erl | 0.766992 | 0.451206 | chash.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_info.erl | 0.706596 | 0.41253 | exometer_info.erl | starcoder |
-module(bingo_checker).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-include("bingo_game.hrl").
-export([is_bingo/1]).
%%-------------------------------------------------------------------------
%% Function is_bingo(Squares) -> boolean().
%%
%% Squares = [[BingoSquare]]
%% A square matrix where... | src/bingo_checker.erl | 0.584745 | 0.614351 | bingo_checker.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/src/epp_dodger.erl | 0.684897 | 0.497498 | epp_dodger.erl | starcoder |
%%% @doc module enacl_ext implements various enacl extensions.
%%% <p>None of the extensions listed here are part of the official NaCl library.
%%% Functions may be removed without further notice if it suddenly ends up being
%%% better to do something differently than the solution given here.
%%% </p>
-module(enacl_ext... | src/enacl_ext.erl | 0.544317 | 0.475666 | enacl_ext.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_new_assert.erl | 0.620852 | 0.67654 | escalus_new_assert.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/esockd_rate_limit_SUITE.erl | 0.509032 | 0.562026 | esockd_rate_limit_SUITE.erl | starcoder |
%%
%% Copyright (c) dushin.net
%% All rights reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applic... | src/atomvm_lib.erl | 0.674587 | 0.416381 | atomvm_lib.erl | starcoder |
%% Minimal JSON parsing module that both encodes and decodes.
%% When encoding, JSON types are mapped to Erlang terms as follows:
%%
%% * JSON object is Erlang map
%% * JSON string is Erlang binary
%% * JSON list is Erlang list
%% * JSON numbers are Erlang numbers
%%
%% When decoding, everything is vice versa except st... | src/json.erl | 0.529507 | 0.661964 | json.erl | starcoder |
-module(thoas_encode).
-compile([
{no_auto_import, [float/1]},
{inline, [{float, 1}, {integer, 1}, {error_invalid_byte_error, 2}]}
]).
%%% Normal reflection based API that turns Erlang terms into JSON.
-export([encode/2]).
%%% Non-recursive API that expects sub-objects to already be encoded. Likely
%%% usefu... | src/thoas_encode.erl | 0.501709 | 0.412619 | thoas_encode.erl | starcoder |
-module( bencode ).
-author( "<NAME> <<EMAIL>>" ).
-export( [encode/1, decode/1] ).
-type value() :: binary() | integer() | list() | map().
%%
%% Encode a list of erlang terms to a binary string using bencoding
%%
-spec encode( value() ) -> binary().
encode( Val ) ->
encode( Val, [] ).
-spec encode( [value()], [... | src/bencode.erl | 0.523664 | 0.457682 | bencode.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the ... | src/couch/src/couch_ejson_compare.erl | 0.555676 | 0.555134 | couch_ejson_compare.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the ... | src/couch_stats/src/couch_stats_aggregator.erl | 0.555435 | 0.41567 | couch_stats_aggregator.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... | apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl | 0.617397 | 0.450239 | emqx_limiter_schema.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
... | lib/diameter/src/base/diameter_dict.erl | 0.614047 | 0.409752 | diameter_dict.erl | starcoder |
-module(lists_practice).
-export([product/1, maximum/1, maxt/1]).
-include_lib("eunit/include/eunit.hrl").
%%%%%%%
% 2.6 %
%%%%%%%
% Combining list elements: the product of a list
%
% Using the template from the last session, define an Erlang function to give
% the product of a list of numbers. The product of an empt... | week2/lists_practice.erl | 0.560974 | 0.717185 | lists_practice.erl | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.