content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
using Avro
using Test
include("schema.jl")
include("io.jl")
include("generic.jl")
include("data_file.jl")
| [
3500,
5184,
305,
198,
3500,
6208,
198,
198,
17256,
7203,
15952,
2611,
13,
20362,
4943,
198,
17256,
7203,
952,
13,
20362,
4943,
198,
17256,
7203,
41357,
13,
20362,
4943,
198,
17256,
7203,
7890,
62,
7753,
13,
20362,
4943,
198
] | 2.74359 | 39 |
using Assignment05
using Test
@testset "Assignment05" begin
testpath = normpath(joinpath(@__DIR__, "..", "data", "test.txt"))
wordspath = normpath(joinpath(@__DIR__, "..", "data", "words.txt"))
@testset "Question 1" begin
@test isreverse("racecar", "racecar")
@test isreverse("GATA", "ATAG")
@test !isre... | [
3500,
50144,
2713,
198,
3500,
6208,
628,
198,
198,
31,
9288,
2617,
366,
8021,
16747,
2713,
1,
2221,
198,
198,
9288,
6978,
796,
2593,
6978,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
492,
1600,
366,
7890,
1600,
366,
9288,
13,
... | 2.415033 | 612 |
<filename>src/biomd.jl
"takes a json biomd metadata file and converts to DF"
function jsonfn_to_df(fn)
json = read(fn, String);
json = JSON3.read(json)
haskey(json, :models) ? DataFrame(jsontable(json.models)) : missing
end
"curls the json files of all the "
function curl_biomd_metadata(meta_dir="$... | [
27,
34345,
29,
10677,
14,
8482,
296,
67,
13,
20362,
198,
1,
83,
1124,
257,
33918,
27488,
67,
20150,
2393,
290,
26161,
284,
36323,
1,
201,
198,
8818,
33918,
22184,
62,
1462,
62,
7568,
7,
22184,
8,
201,
198,
220,
220,
220,
33918,
79... | 2.105691 | 1,845 |
# 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
# What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
primes = [19, 17, 13, 11, 7, 5, 3, 2]
added_factors = [3, 2, 2, 2]
number = prod(primes)*prod(added_factors)... | [
2,
1679,
1238,
318,
262,
18197,
1271,
326,
460,
307,
9086,
416,
1123,
286,
262,
3146,
422,
352,
284,
838,
1231,
597,
17675,
13,
198,
198,
2,
1867,
318,
262,
18197,
3967,
1271,
326,
318,
21894,
2659,
12843,
416,
477,
286,
262,
3146,
... | 2.821918 | 146 |
<reponame>usnistgov/ThreeBodyTB.jl
###include("Crystal.jl")
###include("DFToutMod.jl")
#using XMLDict
"""
module CalcTB
Create TB matrix sets from coefficients, or prepare to fit the coefficients.
"""
module CalcTB
using LinearAlgebra
using SpecialFunctions
using GZip
using EzXML
using XMLDict
using Printf
us... | [
27,
7856,
261,
480,
29,
385,
77,
396,
9567,
14,
12510,
25842,
22737,
13,
20362,
198,
21017,
17256,
7203,
43752,
13,
20362,
4943,
198,
21017,
17256,
7203,
8068,
51,
448,
5841,
13,
20362,
4943,
198,
2,
3500,
23735,
35,
713,
628,
198,
... | 1.575529 | 132,909 |
module MatrixChainMultiply
export matrixchainmultiply
### mcm = matrix chain multiply
"""
`matrixchainmultiply(A,B,C,D,...)`
Algorithm for **Matrix-chain multiplication** (where matrices are also
generalizations of scalars and vectors). Using *Cormen* Ed. 3, p. 371.
Arguments
---------
`A,B,C,...` are matrices, ... | [
21412,
24936,
35491,
15205,
541,
306,
198,
198,
39344,
17593,
7983,
16680,
541,
306,
198,
198,
21017,
285,
11215,
796,
17593,
6333,
29162,
198,
198,
37811,
198,
220,
4600,
6759,
8609,
7983,
16680,
541,
306,
7,
32,
11,
33,
11,
34,
11,
... | 2.415062 | 1,766 |
<reponame>Sid-Bhatia-0/ReinforcementLearningZoo.jl
@testset "BestResponsePolicy" begin
env = OpenSpielEnv("kuhn_poker";default_state_style=RLBase.Information{String}(), is_chance_agent_required=true)
p = TabularRandomPolicy()
bp0 = BestResponsePolicy(p, env, 0)
bp1 = BestResponsePolicy(p, env, 1)
@... | [
27,
7856,
261,
480,
29,
50,
312,
12,
33,
5183,
544,
12,
15,
14,
3041,
259,
13442,
41730,
57,
2238,
13,
20362,
198,
31,
9288,
2617,
366,
13014,
31077,
36727,
1,
2221,
198,
220,
220,
220,
17365,
796,
4946,
4561,
8207,
4834,
85,
7203... | 1.49216 | 7,079 |
@inline _alloc_temp_array(size_1::Int, x::AbstractVector{T}) where T = zeros(T, size_1)
@inline _alloc_temp_array(size_1::Int, x::AbstractMatrix{T}) where T = zeros(T, size_1, size(x, 2))
const MatrixOrFactorization{T} = Union{AbstractMatrix{T}, Factorization{T}}
for N in (1, 2)
for op in [:mul, :ldiv]
sq... | [
31,
45145,
4808,
32332,
62,
29510,
62,
18747,
7,
7857,
62,
16,
3712,
5317,
11,
2124,
3712,
23839,
38469,
90,
51,
30072,
810,
309,
796,
1976,
27498,
7,
51,
11,
2546,
62,
16,
8,
198,
31,
45145,
4808,
32332,
62,
29510,
62,
18747,
7,
... | 1.784405 | 3,219 |
<reponame>RoboticExplorationLab/RobotDynamics.jl<filename>test/discrete_dynamics_test.jl
include("double_integrator.jl")
## Discrete Double Integrator model
struct DiscreteModel{NM} <: RobotDynamics.DiscreteDynamics
cfg::ForwardDiff.JacobianConfig{
Nothing,
Float64,
NM,
Tuple{
... | [
27,
7856,
261,
480,
29,
14350,
6210,
18438,
6944,
17822,
14,
14350,
313,
35,
4989,
873,
13,
20362,
27,
34345,
29,
9288,
14,
15410,
8374,
62,
67,
4989,
873,
62,
9288,
13,
20362,
198,
17256,
7203,
23352,
62,
18908,
12392,
13,
20362,
4... | 2.035902 | 3,231 |
<reponame>LuEdRaMo/NEOs.jl<filename>dev/generate_artifacts.jl
# this script generates Julia artifacts for debiasing tables from
# Chesley et al. (2010), Farnocchia et al. (2015) and Eggl et al. (2020)
# TODO: adapt script for julia1.6+
# TODO: adapt script for 2010 debiasing tables (requires extra unpacking)
using Pkg... | [
27,
7856,
261,
480,
29,
25596,
7407,
21762,
16632,
14,
45,
4720,
82,
13,
20362,
27,
34345,
29,
7959,
14,
8612,
378,
62,
50179,
13,
20362,
198,
2,
428,
4226,
18616,
22300,
20316,
329,
1915,
72,
2313,
8893,
422,
198,
2,
28250,
1636,
... | 2.393805 | 1,356 |
function gausslegendre( n::Int32 )
# GAUSSLEGENDRE(n) COMPUTE THE GAUSS-LEGENDRE NODES AND WEIGHTS IN O(n) time.
if n < 0
x = (Float64[],Float64[])
elseif n == 0
x = (Float64[],Float64[])
elseif n == 1
x = ([0.0],[2.0])
elseif n == 2
x = Array(Float64,2)
w = Array(Float64,2)
x[1] = -1/sqrt(3)... | [
8818,
31986,
1046,
1455,
437,
260,
7,
299,
3712,
5317,
2624,
1267,
198,
2,
14545,
32835,
2538,
38,
10619,
2200,
7,
77,
8,
220,
24301,
37780,
3336,
14545,
32835,
12,
2538,
38,
10619,
2200,
399,
3727,
1546,
5357,
12887,
34874,
3268,
440... | 1.704536 | 4,674 |
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
include(joinpath("..", "common.jl"))
name = "FFplay"
# The products that we will ensure are always built
products = [
ExecutableProduct("ffplay", :ffplay),
]
# Dependencies that ... | [
2,
5740,
326,
428,
4226,
460,
2453,
617,
3614,
3141,
12,
1370,
7159,
11,
1057,
198,
2,
4600,
73,
43640,
1382,
62,
18870,
21591,
13,
20362,
1377,
16794,
63,
284,
766,
257,
8748,
3275,
13,
198,
17256,
7,
22179,
6978,
7203,
492,
1600,
... | 3.080986 | 284 |
<reponame>JuliaTagBot/MultipleViewGeometry.jl
module ModuleProjection
using MultipleViewGeometry.ModuleTypes, MultipleViewGeometry.ModuleOperators, MultipleViewGeometry.ModuleMathAliases
using StaticArrays, LinearAlgebra
export project, epipole
include("project.jl")
include("epipole.jl")
end
| [
27,
7856,
261,
480,
29,
16980,
544,
24835,
20630,
14,
31217,
7680,
10082,
15748,
13,
20362,
198,
21412,
19937,
16775,
295,
198,
3500,
20401,
7680,
10082,
15748,
13,
26796,
31431,
11,
20401,
7680,
10082,
15748,
13,
26796,
18843,
2024,
11,
... | 3.488095 | 84 |
<gh_stars>0
##############################################################################
##
## Define a type that iterates through q-grams of a string
##
############################################################################
struct QGramIterator{S <: AbstractString}
s::S # string
q::Int # Length of Qgram
end... | [
27,
456,
62,
30783,
29,
15,
198,
198,
29113,
29113,
7804,
4242,
2235,
198,
2235,
198,
2235,
2896,
500,
257,
2099,
326,
11629,
689,
832,
10662,
12,
4546,
82,
286,
257,
4731,
198,
2235,
198,
29113,
29113,
7804,
4242,
198,
7249,
1195,
... | 2.624912 | 2,842 |
<filename>docs/examples/run_default.jl
using DSGE, ModelConstructors
using Nullables, DataFrames, OrderedCollections, Dates
#############################
# To use:
# Just run in the Julia REPL
# include("run_default.jl")
#############################
##############
# Model Setup
##############
# Instantiate the FRBNY... | [
27,
34345,
29,
31628,
14,
1069,
12629,
14,
5143,
62,
12286,
13,
20362,
198,
3500,
17400,
8264,
11,
9104,
42316,
669,
198,
3500,
35886,
2977,
11,
6060,
35439,
11,
14230,
1068,
5216,
26448,
11,
44712,
198,
198,
14468,
7804,
4242,
2,
198... | 3.513326 | 863 |
<reponame>UnofficialJuliaMirror/StatisticalRethinking.jl-2d09df54-9d0f-5258-8220-54c2a3d4fbee<gh_stars>0
# `clip-01`
using StatisticalRethinking
#gr(size=(600,600));
ProjDir = @__DIR__
# ### snippet 9.1
# Metropolis algorithm
function generate_walk(N::Int64)
num_weeks = N
positions = zeros(Int64, num_weeks);
... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
17126,
19929,
49,
2788,
8040,
13,
20362,
12,
17,
67,
2931,
7568,
4051,
12,
24,
67,
15,
69,
12,
20,
25600,
12,
6469,
1238,
12,
4051,
66,
17,
64,
18,
67,
19,
69,
... | 2.587156 | 436 |
<reponame>LexaLutyi/PointsReconstruction.jl
# 1
wavelet_matrices(ws, J, L; ξ0=maximum(ws) / 2, c=1) =
[wavelet_matrix(ws, j, θ; ξ0, L, c) for j in 0:J - 1, θ in range(0., length=L, step=2π / L)]
# 2
e_θ(l, L) = (cos(π / 2 + 2π * l / L), sin(π / 2 + 2π * l / L))
τ_θ_j(l, j_, L) = round.(Int, 2^j_ .* e_θ(l, L))
# ... | [
27,
7856,
261,
480,
29,
45117,
64,
43,
3935,
72,
14,
40710,
6690,
261,
15019,
13,
20362,
198,
2,
352,
198,
19204,
1616,
62,
6759,
45977,
7,
18504,
11,
449,
11,
406,
26,
7377,
122,
15,
28,
47033,
7,
18504,
8,
1220,
362,
11,
269,
... | 1.636559 | 2,790 |
<reponame>UnofficialJuliaMirror/SymbolServer.jl-cf896787-08d5-524d-9de7-132aaa0cb996
"""
manifest(c::Pkg.Types.Context)
Retrieves the manifest of a Context.
"""
manifest(c::Pkg.Types.Context) = c.env.manifest
"""
project(c::Pkg.Types.Context)
Retrieves the project of a Context.
"""
project(c::Pkg.Types.Context... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
13940,
23650,
10697,
13,
20362,
12,
12993,
4531,
3134,
5774,
12,
2919,
67,
20,
12,
48057,
67,
12,
24,
2934,
22,
12,
19924,
46071,
15,
21101,
38565,
198,
37811,
198,
2... | 2.214538 | 3,109 |
# # Chapter 3 - 数学のおさらい
## #src
# ## 3.1 線形代数
# ### 3.1.1 スカラーとベクトル
## 列ベクトル: 2行1列のArrayを定義
## Juliaはcolumn-major
w = [5.0, 3.0]
## #src
## 行ベクトル
#-
## 行ベクトル: 1行2列
x = [5.0 3.0]
## #src
#-
## すべての要素が0の1行5列のArrayを生成
x_zeros = zeros(1, 5)
## #src
#-
## すべての要素が1の1行5列のArrayを生成
x_ones = ones(1, 5)
## #src
#-
## 一様... | [
2,
1303,
7006,
513,
532,
10545,
243,
108,
27764,
99,
5641,
2515,
232,
43357,
36853,
18566,
628,
198,
2235,
1303,
10677,
198,
2,
22492,
513,
13,
16,
13328,
115,
248,
37605,
95,
47987,
46763,
108,
198,
2,
44386,
513,
13,
16,
13,
16,
... | 1.255933 | 4,087 |
<filename>src/solver/system_eqs.jl
function system_lhs(boat_angles::Boat_angles)
inertia_lhs(SA[boat_angles.θ_t, boat_angles.θ_k, boat_angles.γ_OA])
end
function system_rhs(u, w, θ′, boat_angles::Boat_angles)
inertia_rhs(
SA[
u,
w,
θ′,
boat_angles.θ_t,
... | [
27,
34345,
29,
10677,
14,
82,
14375,
14,
10057,
62,
27363,
82,
13,
20362,
198,
8818,
1080,
62,
75,
11994,
7,
24482,
62,
27787,
3712,
33,
15073,
62,
27787,
8,
198,
220,
220,
220,
48482,
62,
75,
11994,
7,
4090,
58,
24482,
62,
27787,... | 1.579946 | 369 |
<filename>src/SingleHouseholdCalculations.jl<gh_stars>0
module SingleHouseholdCalculations
#
# This module drives all the calculations for single household and a single set of parameters.
#
using ScottishTaxBenefitModel
using .Definitions
using .RunSettings:
Settings
using .Results:
IndividualResult,
... | [
27,
34345,
29,
10677,
14,
28008,
18102,
2946,
9771,
3129,
602,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
198,
21412,
14206,
18102,
2946,
9771,
3129,
602,
198,
198,
2,
198,
2,
770,
8265,
10182,
477,
262,
16765,
329,
2060,
6641,
290... | 1.990073 | 2,317 |
<filename>test/MLP/Dataset1/MLP_dt1.jl
using Dates
const SRC_PATH = "../../../src"
include(joinpath(SRC_PATH, "MLPClassifier/MLPClassifier.jl"))
include(joinpath(SRC_PATH, "datasets/dataset_reader.jl"))
include(joinpath(SRC_PATH, "datasets/Drug-Classification/dataset1.jl"))
include(joinpath(SRC_PATH, "FileInterface/fi... | [
27,
34345,
29,
9288,
14,
5805,
47,
14,
27354,
292,
316,
16,
14,
5805,
47,
62,
28664,
16,
13,
20362,
198,
3500,
44712,
198,
9979,
311,
7397,
62,
34219,
796,
366,
40720,
40720,
40720,
10677,
1,
198,
198,
17256,
7,
22179,
6978,
7,
50... | 2.563183 | 1,282 |
<reponame>tkoolen/ValkyrieLCMSim.jl
module AtlasControl
using LinearAlgebra
using QPControl
using RigidBodyDynamics
using AtlasRobot
using HumanoidLCMSim
using MathOptInterface
import OSQP
using OSQP.MathOptInterfaceOSQP: OSQPSettings
function atlasrobotinfo(mechanism::Mechanism)
actuators = [Actuator(string(j),... | [
27,
7856,
261,
480,
29,
30488,
970,
268,
14,
53,
21316,
5639,
5653,
320,
13,
20362,
198,
21412,
22494,
15988,
198,
198,
3500,
44800,
2348,
29230,
198,
3500,
1195,
47,
15988,
198,
3500,
24666,
312,
25842,
35,
4989,
873,
198,
3500,
2249... | 2.549407 | 1,012 |
# query.jl
### Days of week
const 先勝,友引,先負,仏滅,大安,赤口 = 1,2,3,4,5,6
const qdaysofweek = Dict(1=>"先勝",2=>"友引",3=>"先負",4=>"仏滅",5=>"大安",6=>"赤口")
dayname(dt::Integer) = qdaysofweek[dt]
dayabbr(dt::Integer) = qdaysofweek[dt]
dayname(qdt::QDate) = qdaysofweek[dayofweek(qdt)]
dayabbr(qdt::QDate) = qdaysofweek[dayofweek(qdt)]
... | [
2,
12405,
13,
20362,
198,
198,
21017,
12579,
286,
1285,
198,
9979,
10263,
227,
230,
47947,
251,
11,
20998,
233,
28156,
243,
11,
17739,
42062,
110,
254,
11,
20015,
237,
162,
119,
227,
11,
32014,
22522,
231,
11,
164,
113,
97,
20998,
9... | 1.761607 | 1,120 |
<filename>src/waveletlayer.jl
immutable WaveletLayer <: Mocha.Layer
bank::AbstractBank
bottoms::Vector{Symbol}
name::AbstractString
tops::Vector{Symbol}
end
function WaveletLayer( ;
bank::AbstractBank = NullBank(),
bottoms::Vector{Symbol} = Symbol[],
name::AbstractString = "wave... | [
27,
34345,
29,
10677,
14,
19204,
1616,
29289,
13,
20362,
198,
8608,
18187,
17084,
1616,
49925,
1279,
25,
4270,
11693,
13,
49925,
198,
220,
220,
220,
3331,
3712,
23839,
28650,
198,
220,
220,
220,
3005,
3150,
3712,
38469,
90,
13940,
23650... | 2.513725 | 255 |
module _SampEn
export SampEn
using Statistics: mean, std
using LinearAlgebra: UpperTriangular, I
"""
Samp, A, B = SampEn(Sig)
Returns the sample entropy estimates `Samp` and the number of matched state
vectors (`m`:B, `m+1`:A) for `m` = [0,1,2] estimated from the data sequence `Sig`
using the default paramete... | [
21412,
4808,
50,
696,
4834,
198,
39344,
42168,
4834,
198,
3500,
14370,
25,
1612,
11,
14367,
198,
3500,
44800,
2348,
29230,
25,
20390,
14824,
21413,
11,
314,
198,
37811,
198,
220,
220,
220,
42168,
11,
317,
11,
347,
796,
42168,
4834,
7,... | 2.319074 | 1,426 |
<gh_stars>0
using TableView
using Test, WebIO, Tables, JSON
@testset "installation" begin
version = readchomp(joinpath(@__DIR__, "..", "ag-grid.version"))
@test isfile(joinpath(@__DIR__, "..", "deps", "ag-grid-$(version)", "ag-grid.js"))
end
@testset "named tuple table" begin
nttable = [
(a = 2.0, ... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
8655,
7680,
198,
3500,
6208,
11,
5313,
9399,
11,
33220,
11,
19449,
198,
198,
31,
9288,
2617,
366,
17350,
341,
1,
2221,
198,
220,
220,
220,
2196,
796,
1100,
354,
3361,
7,
22179,
6978,
7,
31,
... | 2.327138 | 538 |
using BenchmarkTools, FinancialMonteCarlo, ReverseDiff
S0 = 100.0;
K = 100.0;
r = 0.02;
T = 1.0;
d = 0.01;
D = 90.0;
Nsim = 100000;
Nstep = 30;
sigma = 0.2
mc = MonteCarloConfiguration(Nsim, Nstep);
toll = 1e-3;
rfCurve = ZeroRate(r);
FwdData = Forward(T)
EUData = EuropeanOption(T, K)
AMData = AmericanOption(T, K)
... | [
3500,
25187,
4102,
33637,
11,
11302,
9069,
660,
9914,
5439,
11,
31849,
28813,
198,
198,
50,
15,
796,
1802,
13,
15,
26,
198,
42,
796,
1802,
13,
15,
26,
198,
81,
796,
657,
13,
2999,
26,
198,
51,
796,
352,
13,
15,
26,
198,
67,
79... | 2.256311 | 515 |
<reponame>sadit/SimilaritySearch
# This file is a part of SimilaritySearch.jl
using Test, SimilaritySearch, SparseArrays, LinearAlgebra
@testset "test database abstractions" begin
X = rand(4, 100)
A = MatrixDatabase(X)
B = VectorDatabase(X)
C = DynamicMatrixDatabase(X)
D = B[1:100]
@test D isa ... | [
27,
7856,
261,
480,
29,
82,
324,
270,
14,
18925,
414,
18243,
198,
2,
770,
2393,
318,
257,
636,
286,
11014,
414,
18243,
13,
20362,
198,
3500,
6208,
11,
11014,
414,
18243,
11,
1338,
17208,
3163,
20477,
11,
44800,
2348,
29230,
198,
198... | 2.054348 | 644 |
# module for estimating pose by monte carlo localization
# based on particle filter
# particle num is decided by kld sampling
# parameter nn: range std on straight movement
# parameter no: range std on rotation movement
# parameter on: direction std on straight movement
# parameter oo: direction std on rotation movemen... | [
2,
8265,
329,
39539,
12705,
416,
937,
660,
1097,
5439,
42842,
198,
2,
1912,
319,
18758,
8106,
198,
2,
18758,
997,
318,
3066,
416,
479,
335,
19232,
198,
2,
11507,
299,
77,
25,
2837,
14367,
319,
3892,
3356,
198,
2,
11507,
645,
25,
2... | 2.440752 | 1,595 |
<filename>test/distributions/test_pointmass.jl
module PointMassTest
using Test
using ReactiveMP
using Distributions
using Random
using SpecialFunctions
import ReactiveMP: InfCountingReal, tiny, huge
import ReactiveMP.MacroHelpers: @test_inferred
import ReactiveMP: xtlog, mirrorlog
@testset "PointMass" begin
rng... | [
27,
34345,
29,
9288,
14,
17080,
2455,
507,
14,
9288,
62,
4122,
22208,
13,
20362,
198,
21412,
6252,
20273,
14402,
198,
198,
3500,
6208,
198,
3500,
797,
5275,
7378,
198,
3500,
46567,
507,
198,
3500,
14534,
198,
3500,
6093,
24629,
2733,
... | 2.04204 | 3,687 |
<gh_stars>0
# Combined 2D plots across multiple frames, multi-processing version.
#
# To run on a single node,
# julia -p $ncores demo_2d_mp_pyplot.jl
#
# <NAME>, <EMAIL>
using Distributed, ParallelDataTransfer, Glob
@everywhere using Vlasiator, PyPlot, Printf, LaTeXStrings
@everywhere function init_figure(... | [
27,
456,
62,
30783,
29,
15,
198,
2,
32028,
362,
35,
21528,
1973,
3294,
13431,
11,
5021,
12,
36948,
2196,
13,
201,
198,
2,
201,
198,
2,
1675,
1057,
319,
257,
2060,
10139,
11,
201,
198,
2,
474,
43640,
532,
79,
720,
10782,
2850,
13... | 2.10662 | 3,142 |
<reponame>338rajesh/FEPreProcessing.jl
using UnitCellGenerator
using UnitCellModelling
using FEPreProcessing
using Materials
const UCG = UnitCellGenerator
const UCM = UnitCellModelling
working_folder = mkpath(joinpath(homedir(), "WorkOuts", "scratch"))
println("\t\t Finding Effective properties of composite material u... | [
27,
7856,
261,
480,
29,
28460,
430,
73,
5069,
14,
15112,
6719,
18709,
278,
13,
20362,
198,
3500,
11801,
28780,
8645,
1352,
198,
3500,
11801,
28780,
5841,
9417,
198,
3500,
18630,
6719,
18709,
278,
198,
3500,
24310,
198,
9979,
14417,
38,
... | 2.34989 | 1,369 |
using StatsBase
function runall()
nbuckets = 16
unfinish = true
spinner = ReentrantLock()
buckets = rand(1:99, nbuckets)
totaltrans = 0
bucketsum() = sum(buckets)
smallpause() = sleep(rand() / 2000)
picktwo() = (samplepair(nbuckets)...)
function equalizer()
while unfinish
... | [
3500,
20595,
14881,
198,
198,
8818,
1057,
439,
3419,
198,
220,
220,
220,
299,
27041,
1039,
796,
1467,
198,
220,
220,
220,
3684,
259,
680,
796,
2081,
198,
220,
220,
220,
599,
5083,
796,
797,
298,
5250,
25392,
3419,
198,
220,
220,
220... | 1.89627 | 858 |
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
name = "LinearElasticity"
version = v"5.0"
# Collection of sources required to build MMG
sources = [
GitSource("https://github.com/ISCDtoolbox/LinearElasticity... | [
2,
5740,
326,
428,
4226,
460,
2453,
617,
3614,
3141,
12,
1370,
7159,
11,
1057,
198,
2,
4600,
73,
43640,
1382,
62,
18870,
21591,
13,
20362,
1377,
16794,
63,
284,
766,
257,
8748,
3275,
13,
198,
3500,
45755,
32875,
198,
198,
3672,
796,... | 2.568035 | 926 |
<gh_stars>0
## Part 1
function _load_input(name::AbstractString)
path = joinpath("inputs", name)
return map(x -> parse(Int64, x), readlines(path))
end
function num_depth_increases(depths::AbstractVector{<:Real})
length(depths) > 1 || throw(ArgumentError("Need at least two depths"))
count = 0
previo... | [
27,
456,
62,
30783,
29,
15,
198,
2235,
2142,
352,
198,
8818,
4808,
2220,
62,
15414,
7,
3672,
3712,
23839,
10100,
8,
198,
220,
220,
220,
3108,
796,
4654,
6978,
7203,
15414,
82,
1600,
1438,
8,
198,
220,
220,
220,
1441,
3975,
7,
87,
... | 2.507488 | 601 |
<reponame>bisraelsen/algebraic_connectivity
using Graphs
function MaxLambda2inEV(e::Int,v::Int)
# finds the graph with maximum algebraic connectivity given v vertices and e edges
# Input: Integer e number of edges, integer v number of vertices
# Output: The value of maximum lambda and the graph object
... | [
27,
7856,
261,
480,
29,
41907,
430,
25328,
14,
282,
29230,
291,
62,
8443,
3458,
198,
3500,
29681,
82,
198,
198,
8818,
5436,
43,
4131,
6814,
17,
259,
20114,
7,
68,
3712,
5317,
11,
85,
3712,
5317,
8,
198,
220,
220,
220,
1303,
7228,
... | 2.050382 | 655 |
using YaoSym, YaoBlocks, YaoArrayRegister, SymEngine
using YaoSym: simplify_expi
using Test
@testset "mat" begin
@vars θ γ η
for G in [X, Y, Z, ConstGate.T, H]
@test Matrix(mat(Basic, G)) ≈ Matrix(mat(G))
@test Matrix(mat(Basic, control(4, 3, 2=>G))) ≈ Matrix(control(4, 3, 2=>G))
end
f... | [
3500,
37826,
43094,
11,
37826,
45356,
11,
37826,
19182,
38804,
11,
15845,
13798,
198,
3500,
37826,
43094,
25,
30276,
62,
11201,
72,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
6759,
1,
2221,
198,
220,
220,
220,
2488,
85,
945,
7377... | 1.849421 | 518 |
const DIR = [SVector( 0, 1), # north
SVector( 1, 0), # east
SVector( 0,-1), # south
SVector(-1, 0)] # west
const PING = 5
const ENGAGE = 6
const ACT_LETTER = ['N', 'E', 'S', 'W', 'P', 'G']
const END_KILL = SubState([-1,-1], [-1,-1], -1, false)
| [
9979,
360,
4663,
796,
685,
50,
38469,
7,
657,
11,
352,
828,
1303,
5093,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
352,
11,
657,
828,
1303,
7627,
198,
220,
220,
220,
220,
220,
220,
220,
220,... | 1.958904 | 146 |
value(x::Type{Tracker.TrackedReal{T}}) where T = T
value(x::Type{Tracker.TrackedArray{T,N,A}}) where {T,N,A} = Array{T,N}
value(x::Tracker.TrackedReal) = x.data
value(x::Tracker.TrackedArray) = x.data
@inline fastpow(x::Tracker.TrackedReal, y::Tracker.TrackedReal) = x^y
@inline Base.any(f::Function,x::Tracker.T... | [
8367,
7,
87,
3712,
6030,
90,
35694,
13,
2898,
6021,
15633,
90,
51,
11709,
8,
810,
309,
796,
309,
201,
198,
8367,
7,
87,
3712,
6030,
90,
35694,
13,
2898,
6021,
19182,
90,
51,
11,
45,
11,
32,
11709,
8,
810,
1391,
51,
11,
45,
11,... | 2.378526 | 1,099 |
using Jl2Py
using Documenter
DocMeta.setdocmeta!(Jl2Py, :DocTestSetup, :(using Jl2Py); recursive=true)
makedocs(;
modules=[Jl2Py],
authors="<NAME> <<EMAIL>> and contributors",
repo="https://github.com/lucifer1004/Jl2Py.jl/blob/{commit}{path}#{line}",
sitename="Jl2Py.jl",
format=Documenter.HTML(;
... | [
3500,
449,
75,
17,
20519,
198,
3500,
16854,
263,
198,
198,
23579,
48526,
13,
2617,
15390,
28961,
0,
7,
41,
75,
17,
20519,
11,
1058,
23579,
14402,
40786,
11,
36147,
3500,
449,
75,
17,
20519,
1776,
45115,
28,
7942,
8,
198,
198,
76,
... | 2.090909 | 286 |
<reponame>Michiel-VL/PolyaViz.jl
module PolyaUtils
using Reexport
using CSV
using Tables
using TikzPictures
@reexport using DataFrames
@reexport using PrettyTables
@reexport using Luxor
using RecipesBase
export SearchTrace,
OperatorTrace,
operator_trace,
search_structure,
... | [
27,
7856,
261,
480,
29,
11180,
8207,
12,
47468,
14,
34220,
64,
53,
528,
13,
20362,
198,
21412,
12280,
64,
18274,
4487,
198,
198,
3500,
797,
39344,
198,
3500,
44189,
198,
3500,
33220,
198,
3500,
46338,
89,
21300,
942,
198,
31,
631,
8... | 2.273632 | 402 |
# This file is a part of Julia. License is MIT: https://julialang.org/license
# Run the distributed test outside of the main driver since it needs its own
# set of dedicated workers.
include(joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testenv.jl"))
disttestfile = joinpath(@__DIR__, "distributed_exec.jl")
cm... | [
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
2,
5660,
262,
9387,
1332,
2354,
286,
262,
1388,
4639,
1201,
340,
2476,
663,
898,
198,
2,
900,
286,
... | 2.848649 | 185 |
<filename>src/model.jl
"""
observe(dist::Distribution, x)
Observe sample `x` from distribution `dist` and yield its log-likelihood value.
"""
function observe(dist::Distributions.Distribution, x)
return Libtask.produce(Distributions.loglikelihood(dist, x))
end
| [
27,
34345,
29,
10677,
14,
19849,
13,
20362,
198,
37811,
198,
220,
220,
220,
12414,
7,
17080,
3712,
20344,
3890,
11,
2124,
8,
198,
198,
31310,
3760,
6291,
4600,
87,
63,
422,
6082,
4600,
17080,
63,
290,
7800,
663,
2604,
12,
2339,
1193... | 3.068182 | 88 |
<gh_stars>1-10
#
# MikrotronMC408x.jl --
#
# Configuration and control of CoaXPress camera Mikrotron MC408x.
#
#------------------------------------------------------------------------------
#
# This file is part of the `Phoenix.jl` package which is licensed under the MIT
# "Expat" License.
#
# Copyright (C) 2017-2019,... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
198,
2,
17722,
10599,
1313,
9655,
26200,
87,
13,
20362,
1377,
198,
2,
198,
2,
28373,
290,
1630,
286,
1766,
64,
55,
13800,
4676,
17722,
10599,
1313,
13122,
26200,
87,
13,
198,
2,
198,
... | 2.227729 | 17,231 |
<gh_stars>10-100
"""
$FUNCTIONNAME(pc::PlayerCost, x::SVector{nx}, u::SVector{nu}, t::AbstractFloat)
A convencience implementation of the cost quadraticization.
"""
function _quadraticize_ad(pc::PlayerCost, g::GeneralGame, x::SVector, u::SVector,
t::AbstractFloat)
@warn "You are using... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
37811,
198,
220,
220,
220,
720,
42296,
4177,
2849,
20608,
7,
14751,
3712,
14140,
13729,
11,
2124,
3712,
50,
38469,
90,
77,
87,
5512,
334,
3712,
50,
38469,
90,
28803,
5512,
256,
3712,
23839... | 2.530165 | 547 |
module PlotTests
using ControlSystems, Plots
using VisualRegressionTests, ControlExamplePlots
using Test
gr()
default(show=false)
@testset "test_plots" begin
funcs, refs, eps = getexamples()
# Make it easier to pass tests on different systems
# Set to a factor 2 of common errors
eps = [0.15, 0.015, 0.1, 0.01, 0.01, 0... | [
198,
21412,
28114,
51,
3558,
198,
3500,
6779,
11964,
82,
11,
1345,
1747,
198,
3500,
15612,
8081,
2234,
51,
3558,
11,
6779,
16281,
3646,
1747,
198,
3500,
6208,
198,
2164,
3419,
198,
12286,
7,
12860,
28,
9562,
8,
198,
198,
31,
9288,
2... | 2.332461 | 382 |
<reponame>LudwigBoess/GadJet
using GadJet, Test, DelimitedFiles, Unitful, UnitfulAstro
@testset "GadJet" begin
@testset "Read Snapshot" begin
snap_file = joinpath(dirname(@__FILE__), "snap_050")
@test_nowarn read_snap(snap_file)
@test_nowarn read_header(snap_file)
@test_nowarn re... | [
27,
7856,
261,
480,
29,
43,
463,
28033,
16635,
408,
14,
38,
324,
42273,
198,
3500,
20925,
42273,
11,
6208,
11,
4216,
320,
863,
25876,
11,
11801,
913,
11,
11801,
913,
32,
20661,
198,
198,
31,
9288,
2617,
366,
38,
324,
42273,
1,
222... | 1.694282 | 5,142 |
#
# 一些比较常用的函数
#
#============================================
utf-8变长编码-> 可直接索引的[]存储?
使用方式:
substr("阿三科技的符号i阿斯顿飞呢",3,-2)
substr("阿三科技的符号i阿斯顿飞呢",3,7)
========================================#
function substr(str::String,start_idx::Int,end_idx::Int)
#半开半闭区间[start,end) 没法表示索引到结尾
#使用[start,end] 更附和julia的原则:从1开始
... | [
2,
220,
220,
220,
198,
2,
197,
31660,
12859,
249,
162,
107,
242,
164,
122,
225,
30585,
116,
18796,
101,
21410,
49035,
121,
46763,
108,
198,
2,
198,
198,
2,
10052,
25609,
198,
40477,
12,
23,
20998,
246,
165,
243,
123,
163,
120,
244... | 1.48999 | 2,098 |
<reponame>frankill/jredis
#redis = RedisConnection()
| [
27,
7856,
261,
480,
29,
8310,
962,
359,
14,
73,
445,
271,
198,
2,
445,
271,
796,
2297,
271,
32048,
3419,
198
] | 2.409091 | 22 |
export Constant
import Distributions: Distribution
import Distributions
struct DiscreteContinuous <: Distributions.ValueSupport
end
traitvariate(::Type{<:AbstractArray}) = Distributions.Multivariate
traitvariate(::Type{<:AbstractMatrix}) = Distributions.Matrixvariate
traitvariate(::Type{<:Tuple}) = Distributions.Mul... | [
39344,
20217,
198,
198,
11748,
46567,
507,
25,
27484,
198,
11748,
46567,
507,
198,
198,
7249,
8444,
8374,
17875,
5623,
1279,
25,
46567,
507,
13,
11395,
15514,
198,
437,
198,
198,
9535,
270,
25641,
378,
7,
3712,
6030,
90,
27,
25,
23839... | 2.837719 | 456 |
# Copyright (c) 2017: <NAME> and contributors
# Copyright (c) 2017: Google Inc.
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
"""
SOCtoRSOCBridge{T} <: Bridges.Variable.AbstractBridge
`SOCtoRSOCBridge` implemen... | [
2,
15069,
357,
66,
8,
2177,
25,
1279,
20608,
29,
290,
20420,
198,
2,
15069,
357,
66,
8,
2177,
25,
3012,
3457,
13,
198,
2,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
281,
17168,
12,
7635,
5964,
326,
460,
307,
1043,
198,... | 2.286347 | 1,355 |
<filename>test/gcext/gcext-test.jl<gh_stars>1000+
# This file is a part of Julia. License is MIT: https://julialang.org/license
# tests the output of the embedding example is correct
using Test
if Sys.iswindows()
# libjulia needs to be in the same directory as the embedding executable or in path
ENV["PATH"] =... | [
27,
34345,
29,
9288,
14,
70,
344,
742,
14,
70,
344,
742,
12,
9288,
13,
20362,
27,
456,
62,
30783,
29,
12825,
10,
198,
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
... | 2.382867 | 572 |
<reponame>joachimbrand/Rimu.jl
"""
mpi_no_exchange(data, comm = mpi_comm(), root = mpi_root)
Declare `data` as mpi-distributed and set communication strategy to
`MPINoWalkerExchange`. Sets up the [`MPIData`](@ref) structure with
[`MPINoWalkerExchange`](@ref) strategy.
"""
function mpi_no_exchange(data, comm = mpi_c... | [
27,
7856,
261,
480,
29,
7639,
620,
320,
17938,
14,
49,
320,
84,
13,
20362,
198,
37811,
198,
220,
220,
220,
285,
14415,
62,
3919,
62,
1069,
3803,
7,
7890,
11,
725,
796,
285,
14415,
62,
9503,
22784,
6808,
796,
285,
14415,
62,
15763,... | 2.7 | 380 |
using Fairness, MLJ, PrettyPrinting
using DataFrames
# Score on training data to assess model quality
function get_scores(m, X, y, rows, set)
yhat = predict(m, rows=rows)
ft = fair_tensor(yhat, y[rows], X[rows, :z])
df = disparity(
[accuracy, false_positive_rate],
ft, refGrp="A",
func=(x, y)->(x-y)
... | [
3500,
7011,
1108,
11,
10373,
41,
11,
20090,
18557,
278,
198,
3500,
6060,
35439,
198,
198,
2,
15178,
319,
3047,
1366,
284,
4659,
2746,
3081,
198,
8818,
651,
62,
1416,
2850,
7,
76,
11,
1395,
11,
331,
11,
15274,
11,
900,
8,
198,
220,... | 2.472803 | 717 |
<reponame>UnofficialJuliaMirror/AutoGrad.jl-6710c13c-97f1-543f-91c5-74e8f7d95b35
import Base: cat, vcat, hcat
# cat(A...; dims): Concatenate the input arrays along the specified
# dimensions in the iterable dims. For each dimension not in dims, all
# input arrays should have the same size, which will also be the size
... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
27722,
42731,
13,
20362,
12,
3134,
940,
66,
1485,
66,
12,
5607,
69,
16,
12,
20,
3559,
69,
12,
6420,
66,
20,
12,
4524,
68,
23,
69,
22,
67,
3865,
65,
2327,
198,
1... | 2.327827 | 2,724 |
struct LSSymbolServerFailure <: Exception
msg::AbstractString
end
function Base.showerror(io::IO, ex::LSSymbolServerFailure)
print(io, ex.msg)
end
struct LSUriConversionFailure <: Exception
msg::AbstractString
end
function Base.showerror(io::IO, ex::LSUriConversionFailure)
print(io, ex.msg)
end
stru... | [
7249,
406,
5432,
88,
23650,
10697,
50015,
1279,
25,
35528,
198,
220,
220,
220,
31456,
3712,
23839,
10100,
198,
437,
198,
198,
8818,
7308,
13,
1477,
789,
1472,
7,
952,
3712,
9399,
11,
409,
3712,
43,
5432,
88,
23650,
10697,
50015,
8,
... | 2.689516 | 496 |
<filename>src/mutation/gaussian.jl
"""
Used to provide a definition for a Gaussian mutation operator.
"""
type GaussianMutationDefinition <: MutationDefinition
stage::AbstractString
rate::Float
mean::Float
std::Float
GaussianMutationDefinition() = new("", 0.01, 0.0, 1.0)
GaussianMutationDefinition(stage::... | [
27,
34345,
29,
10677,
14,
76,
7094,
14,
4908,
31562,
13,
20362,
198,
37811,
198,
38052,
284,
2148,
257,
6770,
329,
257,
12822,
31562,
15148,
10088,
13,
198,
37811,
198,
4906,
12822,
31562,
44,
7094,
36621,
1279,
25,
337,
7094,
36621,
... | 2.901356 | 811 |
include("examples/mlp/MLPDemo.jl")
using AF, MLPDemo
af = ArrayFire{CUDA}()
runDemo(af)
| [
17256,
7203,
1069,
12629,
14,
4029,
79,
14,
5805,
5760,
41903,
13,
20362,
4943,
198,
3500,
12341,
11,
10373,
5760,
41903,
198,
198,
1878,
796,
15690,
13543,
90,
43633,
5631,
92,
3419,
198,
198,
5143,
11522,
78,
7,
1878,
8,
198
] | 2.195122 | 41 |
<reponame>miguelraz/SymbolicTensors2.jl
using SymbolicTensors2
using Test
@testset "SymbolicTensors2.jl" begin
# Write your tests here.
end
| [
27,
7856,
261,
480,
29,
76,
328,
2731,
3247,
14,
13940,
2022,
4160,
51,
641,
669,
17,
13,
20362,
198,
3500,
41327,
4160,
51,
641,
669,
17,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
13940,
2022,
4160,
51,
641,
669,
17,
13,
... | 2.416667 | 60 |
<reponame>tmaone/xsh
# This file was autogenerated in src/version_git.jl
immutable GitVersionInfo
commit::AbstractString
commit_short::AbstractString
branch::AbstractString
build_number::Int
date_string::AbstractString
tagged_commit::Bool
fork_master_distance::Int
fork_master_timestamp::... | [
27,
7856,
261,
480,
29,
83,
2611,
505,
14,
87,
1477,
198,
2,
770,
2393,
373,
1960,
519,
877,
515,
287,
12351,
14,
9641,
62,
18300,
13,
20362,
198,
8608,
18187,
15151,
14815,
12360,
198,
220,
220,
220,
4589,
3712,
23839,
10100,
198,
... | 2.283843 | 229 |
function discretizebranches!(system::CVSystem,old=Dict("a"=>0),restart="no")
h = [];
# branch grid spacing
for i in 1:length(system.branches.ID)
push!(system.branches.k,system.branches.lengthincm[i]*cmTom/
(system.solverparams.JL-1));
push!(h,system.solverparams.CFL*system.branc... | [
8818,
1221,
1186,
1096,
1671,
12140,
0,
7,
10057,
3712,
33538,
11964,
11,
727,
28,
35,
713,
7203,
64,
1,
14804,
15,
828,
2118,
433,
2625,
3919,
4943,
198,
220,
220,
220,
289,
796,
25787,
628,
220,
220,
220,
1303,
8478,
10706,
31050,... | 1.967367 | 2,666 |
<filename>test/runtests.jl<gh_stars>0
include("techsquare.jl") | [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
17256,
7203,
13670,
23415,
13,
20362,
4943
] | 2.583333 | 24 |
<gh_stars>0
# fftconv.jl
# test FFT-based convolution and
# adjoint consistency for FFT convolution methods on very small case
using SPECTrecon: plan_psf
using SPECTrecon: fft_conv!, fft_conv_adj!, fft_conv_adj2!
using SPECTrecon: fft_conv, fft_conv_adj
using LinearMapsAA: LinearMapAA
using Test: @test, @testset, @tes... | [
27,
456,
62,
30783,
29,
15,
198,
2,
277,
701,
42946,
13,
20362,
198,
2,
1332,
376,
9792,
12,
3106,
3063,
2122,
290,
198,
2,
9224,
1563,
15794,
329,
376,
9792,
3063,
2122,
5050,
319,
845,
1402,
1339,
198,
198,
3500,
6226,
9782,
260... | 2.162042 | 901 |
<filename>language/julia/fib.jl<gh_stars>1-10
fib(n) = n < 2 ? n : fib(n-1) + fib(n-2)
fibTailRecursive(a, b=0, c=1) = a === 0 ? b : fibTailRecursive(a - 1, c, b + c)
fibFormula(n) = round(((5 ^ .5 + 1) / 2) ^ n / (5 ^ .5))
function fibLinear(n)
x,y = (0,1)
for i = 1:n
x,y = (y, x+y)
end
return x
end
fu... | [
27,
34345,
29,
16129,
14,
73,
43640,
14,
69,
571,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
69,
571,
7,
77,
8,
796,
299,
1279,
362,
5633,
299,
1058,
12900,
7,
77,
12,
16,
8,
1343,
12900,
7,
77,
12,
17,
8,
198,
1... | 2.032653 | 245 |
using PyCall, PyPlot
# Use Conda.jl to install seaborn unless already installed: using Conda; Conda.add("seaborn")
@pyimport seaborn as sns
sns.set_style("whitegrid")
tips = sns.load_dataset("tips")
sns.violinplot(x="day", y="total_bill", hue="smoker", data=tips, palette="muted", split=true)
filename = "violin_plot_exa... | [
3500,
9485,
14134,
11,
9485,
43328,
198,
2,
5765,
9724,
64,
13,
20362,
284,
2721,
384,
397,
1211,
4556,
1541,
6589,
25,
1262,
9724,
64,
26,
9724,
64,
13,
2860,
7203,
325,
397,
1211,
4943,
198,
31,
9078,
11748,
384,
397,
1211,
355,
... | 2.823529 | 136 |
<filename>advent2019/day16.jl
module Day16
_inp = "5977341979463156041288674655004921071485410706602808103209659175957514568029499577074120495518339564010352737180122579536436341145511323668316808875063144299312305390935825244033985909243184464160009273600675895442209724448692094518248315902382053864571761105177050931... | [
27,
34345,
29,
324,
1151,
23344,
14,
820,
1433,
13,
20362,
198,
21412,
3596,
1433,
198,
198,
62,
259,
79,
796,
366,
3270,
3324,
2682,
33581,
3510,
27936,
31916,
1065,
3459,
3134,
3510,
2816,
405,
40256,
15982,
18294,
4051,
940,
35402,
... | 2.174837 | 612 |
<gh_stars>1-10
using ChemEquations
using Test
for str in ("compound", "chemequation", "balance")
@testset "$str.jl" begin
include("$str.jl")
end
end
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
12870,
23588,
602,
198,
3500,
6208,
198,
198,
1640,
965,
287,
5855,
5589,
633,
1600,
366,
2395,
1326,
421,
341,
1600,
366,
20427,
4943,
198,
220,
220,
220,
2488,
9288,
2617,
17971,
253... | 2.371429 | 70 |
<gh_stars>10-100
# # # RAMI Benchmarking
# The goal of the RAMI4PILPS experiment[^1] is to evaluate different approaches by which Land Surface Models in larger Earth System Models quantify the radiation transfer within vegetation canopies. The RAMI4PILPS can be interpreted as a quality control mechanism used to:
#
... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
1303,
1303,
13931,
40,
25187,
4102,
278,
220,
198,
2,
220,
383,
3061,
286,
262,
13931,
40,
19,
47,
4146,
3705,
6306,
58,
61,
16,
60,
318,
284,
13446,
1180,
10581,
416,
543,
6379,
20... | 2.385872 | 11,382 |
function well(x::AbstractArray{<:AbstractString})::String
number = count( it -> it == "good", x )
number > 2 && return "I smell a series!"
number > 0 && return "Publish!"
return "Fail!"
end | [
8818,
880,
7,
87,
3712,
23839,
19182,
90,
27,
25,
23839,
10100,
92,
2599,
25,
10100,
198,
220,
220,
220,
1271,
796,
954,
7,
340,
4613,
340,
6624,
366,
11274,
1600,
2124,
1267,
198,
220,
220,
220,
1271,
1875,
362,
11405,
1441,
366,
... | 2.576471 | 85 |
using Test, SHA, SparseArrays, Downloads
using SBML
using SBML: Model, Reaction, Species
using Symbolics, Unitful
@testset "SBML test suite" begin
include("version.jl")
include("ecoli_flux.jl")
include("loadmodels.jl")
include("loaddynamicmodels.jl")
include("symbolics.jl")
end
| [
198,
3500,
6208,
11,
25630,
11,
1338,
17208,
3163,
20477,
11,
50093,
198,
3500,
18056,
5805,
198,
3500,
18056,
5805,
25,
9104,
11,
39912,
11,
28540,
198,
3500,
41327,
19615,
11,
11801,
913,
198,
198,
31,
9288,
2617,
366,
16811,
5805,
... | 2.787037 | 108 |
<reponame>tmigot/MPCC.jl<filename>test/test-mpcc-state.jl<gh_stars>0
state = MPCCAtX(zeros(10), zeros(0), cGx = [0.0], cHx = [1.0])
@test state.x == zeros(10)
@test state.fx == nothing
@test state.gx == nothing
@test state.Hx == nothing
@test state.mu == nothing
@test state.cx == nothing
@test state.Jx == nothing
@te... | [
27,
7856,
261,
480,
29,
17209,
328,
313,
14,
7378,
4093,
13,
20362,
27,
34345,
29,
9288,
14,
9288,
12,
3149,
535,
12,
5219,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
5219,
796,
4904,
4093,
2953,
55,
7,
9107,
418,
7,
940,
828,
... | 2.453975 | 478 |
<reponame>Cheburkova/mirea-progs<filename>task_16.jl<gh_stars>0
using HorizonSideRobots
function alldraw(r)
y = 0
z = 0
y, z = goinSWcorner(r)
draw(r)
vozvrat(r,y,z)
end
function obhod(r,side)
x = 0
sign = true
while isborder(r,HorizonSide(side)) && !isborder(r,HorizonSide... | [
27,
7856,
261,
480,
29,
7376,
6236,
74,
10071,
14,
47004,
64,
12,
1676,
14542,
27,
34345,
29,
35943,
62,
1433,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
22776,
24819,
14350,
1747,
201,
198,
201,
198,
8818,
477,
19334,
7,
8... | 1.732212 | 2,080 |
"""
tobdd
Create BDD
"""
export bdd!, bdd
using DD
function bdd(top::AbstractFaultTreeNode)
forest = BDDForest{Int,Int,Int}(FullyReduced())
node = bdd!(forest, top)
return node, forest
end
function bdd!(forest::BDDForest{Tv,Ti,Tl}, top::AbstractFaultTreeNode) where {Tv,Ti,Tl}
if !haskey(forest.vals... | [
37811,
198,
83,
672,
1860,
198,
198,
16447,
347,
16458,
198,
37811,
198,
198,
39344,
275,
1860,
28265,
275,
1860,
198,
198,
3500,
20084,
198,
198,
8818,
275,
1860,
7,
4852,
3712,
23839,
37,
1721,
27660,
19667,
8,
198,
220,
220,
220,
... | 2.099935 | 1,531 |
export pressure!, pressure,
pressure_FD!, pressure_FD,
pressure_AD,
measure_state
function measure_state(state, t, config::VortexConfig; withfreestream::Bool=false)
if withfreestream == false
return pressure(config.ss, state_to_lagrange(state, config), t)
else
freestream = ... | [
39344,
3833,
28265,
3833,
11,
198,
220,
220,
220,
220,
220,
220,
3833,
62,
26009,
28265,
3833,
62,
26009,
11,
198,
220,
220,
220,
220,
220,
220,
3833,
62,
2885,
11,
198,
220,
220,
220,
220,
220,
220,
3953,
62,
5219,
198,
198,
8818... | 2.303791 | 2,110 |
<reponame>Samyak2/potential-art
### A Pluto.jl notebook ###
# v0.12.21
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(de... | [
27,
7856,
261,
480,
29,
50,
14814,
461,
17,
14,
13059,
1843,
12,
433,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1065,
13,
2481,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
77... | 1.731641 | 1,103 |
<gh_stars>1-10
"""
`Basics.modify()` ... modifies some data, either interactively or due to some given rule.
+ `("level energies: interactive", multiplet::Multiplet)`
... to shift the total energies of the atomic levels in multiplet interactively; a (new) multiplet::Multiplet is
returned in which th... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
198,
37811,
198,
63,
15522,
873,
13,
4666,
1958,
3419,
63,
220,
2644,
953,
6945,
617,
1366,
11,
2035,
9427,
2280,
393,
2233,
284,
617,
1813,
3896,
13,
628,
220,
1343,
4600,
7203,
5715,
275... | 3.252688 | 186 |
"""
AbstractExtent
Abstract supertype for `Extent` objects, that hold all variables related
to space and time in a simulation. Usually the field of an output.
"""
abstract type AbstractExtent{I,M,A,PV} end
init(e::AbstractExtent) = e.init
mask(e::AbstractExtent) = e.mask
aux(e::AbstractExtent) = e.aux
@inline aux... | [
37811,
198,
220,
220,
220,
27741,
11627,
298,
198,
198,
23839,
2208,
4906,
329,
4600,
11627,
298,
63,
5563,
11,
326,
1745,
477,
9633,
3519,
198,
1462,
2272,
290,
640,
287,
257,
18640,
13,
19672,
262,
2214,
286,
281,
5072,
13,
198,
3... | 2.411029 | 1,360 |
# prints the classification result produce by running mil_data.jl
# as an input, it takes the folder with saved outputs and possibly a number
# of an output file that only needs to be read
# run from the command line, e.g.
# julia path/to/file/plot_output.jl path/with/outputs path/to/save - this plots all the files in ... | [
2,
20842,
262,
17923,
1255,
4439,
416,
2491,
1465,
62,
7890,
13,
20362,
198,
2,
355,
281,
5128,
11,
340,
2753,
262,
9483,
351,
7448,
23862,
290,
5457,
257,
1271,
198,
2,
286,
281,
5072,
2393,
326,
691,
2476,
284,
307,
1100,
198,
2... | 2.560662 | 544 |
#= ###################################################
* This pre-loads and saves the radial profiles of the bessel trasformations used in "likewhite.jl".
* These are used in `YXcov(x1, x2)`.
* This also saves the cls.
* The variables can be uploaded with
```
using JLD
@load "src/saved_cls/vKXnatxsq.jld"
@load "src/sa... | [
2,
28,
1303,
29113,
14468,
2235,
198,
198,
9,
770,
662,
12,
46030,
290,
16031,
262,
44503,
16545,
286,
262,
7284,
741,
491,
292,
687,
602,
973,
287,
366,
2339,
11186,
13,
20362,
1911,
198,
9,
2312,
389,
973,
287,
4600,
56,
55,
66,... | 2.080386 | 622 |
@doc raw"""
Euler extrapolation method with arbitrary order p.
Solves the ordinary differential equation
```math
\begin{aligned}
\dot{x} &= v(t, x) , &
x(t_0) &= x_0 ,
\end{aligned}
```
for $x_1 = x(t_1)$.
Call with
```julia
_euler_extrapolation_ode!(v, t₀, t₁, x₀, x₁, s)
```
where
* `v`: function to compute vect... | [
198,
31,
15390,
8246,
37811,
198,
36,
18173,
36804,
21417,
2446,
351,
14977,
1502,
279,
13,
198,
198,
50,
9010,
262,
8850,
22577,
16022,
198,
15506,
63,
11018,
198,
59,
27471,
90,
41634,
92,
198,
59,
26518,
90,
87,
92,
1222,
28,
410... | 1.909919 | 1,976 |
using PowerModels
using .PP2PM
import JuMP
function increase_rate_a(pm)
for (i, branch) in pm["branch"]
branch["rate_a"] = 1.01 * branch["rate_a"]
end
return pm
end
function run_powermodels(json_path)
# function to run optimal transmission switching (OTS) optimization from powermodels.jl
... | [
3500,
4333,
5841,
1424,
198,
3500,
764,
10246,
17,
5868,
198,
11748,
12585,
7378,
198,
198,
8818,
2620,
62,
4873,
62,
64,
7,
4426,
8,
198,
220,
220,
220,
329,
357,
72,
11,
8478,
8,
287,
9114,
14692,
1671,
3702,
8973,
198,
220,
220... | 2.275797 | 533 |
<reponame>UlrichBerntien/Codewars-Katas
const results = ["Balanced","Not Balanced"]
function balancednum(number)
if number < 100
# one and two digits are balanced
return results[1]
end
d = digits(number)
m = (length(d)-1) ÷ 2
n = (length(d)+4) ÷ 2
return results[sum(d[1:m]) == sum(d[n:end]) ? 1 : 2... | [
27,
7856,
261,
480,
29,
47920,
7527,
24814,
429,
2013,
14,
43806,
413,
945,
12,
25881,
292,
198,
9979,
2482,
796,
14631,
24597,
2903,
2430,
3673,
38984,
8973,
198,
198,
8818,
12974,
22510,
7,
17618,
8,
198,
220,
611,
1271,
1279,
1802,... | 2.5 | 130 |
<filename>test/test_helpers.jl
# A functor for testing
struct Multiplier{T}
x::T
end
(m::Multiplier)(y) = m.x * y
function ChainRulesCore.rrule(m::Multiplier, y)
Multiplier_pullback(z̄) = Tangent{typeof(m)}(; x=y * z̄), m.x * z̄
return m(y), Multiplier_pullback
end
# NoRules - has no rules defined
struct N... | [
27,
34345,
29,
9288,
14,
9288,
62,
16794,
364,
13,
20362,
198,
2,
317,
1257,
2715,
329,
4856,
198,
7249,
15237,
489,
959,
90,
51,
92,
198,
220,
220,
220,
2124,
3712,
51,
198,
437,
198,
7,
76,
3712,
15205,
24705,
959,
5769,
88,
8... | 2.26 | 350 |
struct ColouredScheme{T}
opacity::T
end
function (scheme::ColouredScheme)(v)
0.0 <= v <= 1.0 || println("Warning: color value must be scaled between 0 and 1.")
if 0.0 <= v < 0.25
b = 1.0
g = v/0.25
r = 0.0
elseif 0.25 <= v < 0.5
b = 1.0 - (v - 0.25)/0.25
g = 1.0
... | [
7249,
1623,
8167,
27054,
1326,
90,
51,
92,
198,
220,
220,
220,
45912,
3712,
51,
198,
437,
198,
8818,
357,
15952,
1326,
3712,
5216,
8167,
27054,
1326,
5769,
85,
8,
198,
220,
220,
220,
657,
13,
15,
19841,
410,
19841,
352,
13,
15,
86... | 1.978366 | 2,265 |
<gh_stars>1-10
using DesignAutomation
@testset "Hooke & Jeeves" begin
fn(x) = (x[1]-5)^2+2*(x[2]-5)^2
x0 = [0., 0.]
res = hooke_jeeves(fn, x0)
@test res.minimizer == [5.000000000000004, 5.000000000000004]
@test res.minimum == 5.916456789157589e-29
@test res.iterations == 37
@test res.c... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
8495,
38062,
341,
198,
198,
31,
9288,
2617,
366,
28900,
2088,
1222,
449,
1453,
1158,
1,
2221,
198,
220,
220,
220,
24714,
7,
87,
8,
796,
357,
87,
58,
16,
45297,
20,
8,
61,
17,
10,... | 1.979362 | 533 |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
mutable struct ExpressRouteCircuitPropertiesFormat <: SwaggerModel
allowClassicOperations::Any # spec type: Union{ Nothing, Bool } # spec name: allowClassicOperations
ci... | [
2,
770,
2393,
373,
7560,
416,
262,
22300,
2451,
7928,
6127,
35986,
198,
2,
2141,
407,
13096,
428,
2393,
3264,
13,
3401,
1958,
262,
1509,
7928,
20855,
2427,
13,
628,
198,
198,
76,
18187,
2878,
10604,
43401,
31560,
5013,
2964,
18200,
26... | 3.574442 | 1,659 |
<filename>test/folderlist.jl<gh_stars>0
@testset "folder.jl" begin
dir = pwd()
opts = (join = true, )
fs = readdir(dir; opts...)
@test folderlist(dir; opts...) == fs[.~isfile.(fs)]
@test isequal(folderlist(dir; join=false), basename.(folderlist(dir; join=true)))
@test isequal(folderlist(dir), F... | [
27,
34345,
29,
9288,
14,
43551,
4868,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
31,
9288,
2617,
366,
43551,
13,
20362,
1,
2221,
198,
220,
220,
220,
26672,
796,
279,
16993,
3419,
198,
220,
220,
220,
2172,
82,
796,
357,
22179,
796... | 2.532995 | 197 |
using heuristicopt
function main()
population = reshape(rand(1:10, 100), (10, 10))
crossoverRate = 0.5
mutationRate = 0.1
iterations = 100
gaparam = GA.GAParameter(
crossoverRate,
mutationRate,
iterations
... | [
3500,
339,
27915,
8738,
198,
198,
8818,
1388,
3419,
198,
220,
220,
220,
3265,
796,
27179,
1758,
7,
25192,
7,
16,
25,
940,
11,
1802,
828,
357,
940,
11,
838,
4008,
198,
220,
220,
220,
27668,
32184,
796,
657,
13,
20,
198,
220,
220,
... | 2.07781 | 347 |
<filename>src/threadinginfo.jl<gh_stars>1-10
"""
Distribute the weights over n (about) equal-sized bins by swapping between bins with high total weight and low total weight.
"""
function distribute_weights_swapping(weights,n;nswaps = length(weights)^2)
# we first 'normally' distribute the weights (first k to first ... | [
27,
34345,
29,
10677,
14,
16663,
278,
10951,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
37811,
198,
20344,
4163,
262,
19590,
625,
299,
357,
10755,
8,
4961,
12,
13982,
41701,
416,
38869,
1022,
41701,
351,
1029,
2472,
3463,
... | 2.307908 | 2,491 |
<gh_stars>1-10
function Adjust(da_or_de, beta, alpha)
return da_or_de^beta + alpha
end
function integrate(a0, e0, p)
"""
General purpose integrator for Nyadzani & Razzaque eqns for a & e.
Params:
a0 - The initial semimajor axis, measured in solar radii
e0 - The initial eccentricity, di... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
8818,
20292,
7,
6814,
62,
273,
62,
2934,
11,
12159,
11,
17130,
8,
198,
220,
220,
220,
1441,
12379,
62,
273,
62,
2934,
61,
31361,
1343,
17130,
198,
437,
198,
198,
8818,
19386,
7,
64,
15,
... | 1.958084 | 1,503 |
module Actors
using ..WalksBase: get_nsteps, get_time, get_position
using ..Points: get_x, norm_squared
using ..LatticeVars: get_num_sites_visited
import ..LatticeVars: init!
using EmpiricalCDFs
import EmpiricalCDFs: get_data
import Statistics
export AbstractActor, act!, ActorSet, NullActor, StepLimitActor, ErrorOnExi... | [
21412,
2191,
669,
198,
198,
3500,
11485,
21902,
591,
14881,
25,
651,
62,
77,
20214,
11,
651,
62,
2435,
11,
651,
62,
9150,
198,
3500,
11485,
40710,
25,
651,
62,
87,
11,
2593,
62,
16485,
1144,
198,
3500,
11485,
43,
1078,
501,
53,
94... | 2.60341 | 5,865 |
using HTTP
"""
A helper function for converting an `input_source` to an IO if not already an IO object.
"""
function read_input_data(input_source::AbstractString; kwargs...)
#TODO this should be done async
#TODO(MD): we should drop this as soon as we have a better option for downloading from URL
if startsw... | [
3500,
14626,
198,
198,
37811,
198,
32,
31904,
2163,
329,
23202,
281,
4600,
15414,
62,
10459,
63,
284,
281,
24418,
611,
407,
1541,
281,
24418,
2134,
13,
198,
37811,
198,
8818,
1100,
62,
15414,
62,
7890,
7,
15414,
62,
10459,
3712,
23839... | 2.829004 | 462 |
#_______________________________________________________________________________
# Input variables
MaxCareerPathLength = 40
# GuyCareerPaths , InitManpower , MPObjectives
#_______________________________________________________________________________
# Variables number
# Compute which careers could each Initia... | [
198,
2,
27193,
2602,
37405,
198,
2,
23412,
9633,
198,
198,
11518,
17784,
263,
15235,
24539,
796,
2319,
198,
2,
13145,
17784,
263,
15235,
82,
837,
44707,
5124,
6477,
837,
4904,
10267,
1083,
198,
198,
2,
27193,
2602,
37405,
198,
2,
1596... | 2.285045 | 6,613 |
pretty_print(x::Signal) = string(value(x))
pretty_print(x::Vector) = string("[", first(x), "...", last(x), "]")
pretty_print{T}(x::Matrix{T}) = string("Matrix{", T, "}")
pretty_print(x::DataType) = string(x.name.name)
pretty_print(x) = string(x)
s_length(x::Symbol) = length(string(x))
const default_kwargs_docs = Dic... | [
198,
37784,
62,
4798,
7,
87,
3712,
11712,
282,
8,
796,
4731,
7,
8367,
7,
87,
4008,
198,
37784,
62,
4798,
7,
87,
3712,
38469,
8,
796,
4731,
7203,
58,
1600,
717,
7,
87,
828,
366,
9313,
11,
938,
7,
87,
828,
366,
60,
4943,
198,
... | 2.313175 | 926 |
module HessianTests
using DiffTests, ForwardDiff, ReverseDiff, Test
include(joinpath(dirname(@__FILE__), "../utils.jl"))
# Circumvent type inference bug where an erroneous `Any` eltype derails the computation
# during tests, but not outside of the tests. This is really hacky, but I couldn't figure
# out enough of an... | [
21412,
46305,
666,
51,
3558,
198,
198,
3500,
10631,
51,
3558,
11,
19530,
28813,
11,
31849,
28813,
11,
6208,
198,
198,
17256,
7,
22179,
6978,
7,
15908,
3672,
7,
31,
834,
25664,
834,
828,
366,
40720,
26791,
13,
20362,
48774,
198,
198,
... | 2.52374 | 1,369 |
# guard against some future changes silently making simple vector graphics be
# rasterized if they are using features unsupported by the SVG spec
function svg_isnt_rasterized(x)
mktempdir() do path
path = joinpath(path, "test.svg")
save(path, x)
# this is rough but an easy way to catch raste... | [
2,
4860,
1028,
617,
2003,
2458,
24595,
1642,
2829,
15879,
9382,
307,
198,
2,
374,
1603,
1143,
611,
484,
389,
1262,
3033,
24222,
416,
262,
45809,
1020,
198,
8818,
38487,
70,
62,
271,
429,
62,
81,
1603,
1143,
7,
87,
8,
198,
220,
220... | 2.471875 | 320 |
Base.@kwdef struct PackageState
timestamp::DateTime
load_path::Vector{String}
id::Base.PkgId
dir::String
tree_hash::String
manifest_tree_hash::Union{Nothing,String}
project::Union{Nothing,String}
end
function Base.:(==)(s1::PackageState, s2::PackageState)
s1.dir == s2.dir &&
s1.id... | [
198,
14881,
13,
31,
46265,
4299,
2878,
15717,
9012,
198,
220,
220,
220,
41033,
3712,
10430,
7575,
198,
220,
220,
220,
3440,
62,
6978,
3712,
38469,
90,
10100,
92,
198,
220,
220,
220,
4686,
3712,
14881,
13,
47,
10025,
7390,
198,
220,
... | 2.10425 | 1,506 |
<reponame>fratava/RadioTools.jl
#CGS
const c = 2.997924561e10 #cm s⁻¹
const au = 1.49597892e13 #cm
const solar_mass = 1.989e33 #g
const solar_lum = 3.826e33 #erg s⁻¹
const solar_radio = 6.9598e10 #cm
const h = 6.62619650e-27 #erg s
const heV = 4.135... | [
27,
7856,
261,
480,
29,
8310,
265,
4170,
14,
26093,
33637,
13,
20362,
198,
2,
34,
14313,
198,
198,
9979,
269,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
13,
2079,
3720,
1731,
47915,
68,
940,
220,
220,
1303,
11215,... | 1.55 | 540 |
<gh_stars>1-10
#Example lowpass/bandpass real/quadrature modulator design
include("dsexample1_fn.jl")
opt=2
#dsm = RealDSM(order=5, OSR=32, form=:CRFB, Hinf=1.5, opt=2)
dsm = RealDSM(order=5, OSR=32, form=:CRFB, Hinf=1.5, opt=opt)
results = dsexample1(dsm, LiveDemo=true)
:END_OF_EXAMPLE
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
16281,
1877,
6603,
14,
3903,
6603,
1103,
14,
421,
41909,
1300,
953,
8927,
1486,
198,
17256,
7203,
67,
8044,
1403,
16,
62,
22184,
13,
20362,
4943,
198,
198,
8738,
28,
17,
198,
2,
67,
5... | 2.101449 | 138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.