content
stringlengths
6
1.03M
input_ids
listlengths
4
535k
ratio_char_token
float64
0.68
8.61
token_count
int64
4
535k
<reponame>anthofflab/paper-2021-scch4 #------------------------------------------------------------------------------- # This function creates an instance of SNEASY+FUND. #------------------------------------------------------------------------------- # Load required packages. using Mimi using MimiFUND using MimiSNEAS...
[ 27, 7856, 261, 480, 29, 29313, 2364, 23912, 14, 20189, 12, 1238, 2481, 12, 1416, 354, 19, 198, 2, 10097, 24305, 198, 2, 770, 2163, 8075, 281, 4554, 286, 11346, 36, 26483, 10, 42296, 35, 13, 198, 2, 10097, 24305, 198, 198, 2, 8778,...
2.201095
3,287
# This file was generated, do not modify it. import MLJ: schema, std, mean, median, coerce, coerce!, scitype using DataFrames using UrlDownload using PyPlot ioff() # hide raw_data = urldownload("https://github.com/tlienart/DataScienceTutorialsData.jl/blob/master/data/wri_global_power_plant_db_be_022020.csv?raw=true")...
[ 2, 770, 2393, 373, 7560, 11, 466, 407, 13096, 340, 13, 198, 198, 11748, 10373, 41, 25, 32815, 11, 14367, 11, 1612, 11, 14288, 11, 31255, 344, 11, 31255, 344, 28265, 629, 414, 431, 198, 3500, 6060, 35439, 198, 3500, 8799, 75, 10002, ...
2.502187
1,372
abstract type CompilerHint end abstract type ProgramStructureHint <: CompilerHint end abstract type AddressingHint <: CompilerHint end include("static/kernel_hint.jl") include("static/switch_hint.jl") include("static/dynamic_address_hint.jl")
[ 397, 8709, 2099, 3082, 5329, 39, 600, 886, 198, 397, 8709, 2099, 6118, 1273, 5620, 39, 600, 1279, 25, 3082, 5329, 39, 600, 886, 198, 397, 8709, 2099, 3060, 11697, 39, 600, 1279, 25, 3082, 5329, 39, 600, 886, 198, 198, 17256, 7203, ...
3.05
80
module ConvDiffMIPDECO using jInv.Mesh using jInv.ForwardShare using jInv.Utils using jInv.LinearSolvers using jInv.InverseSolve using KrylovMethods using LinearAlgebra using SparseArrays using Printf using DSP function getBICGSTB(;PC=:jac,maxIter=1000,out=0,tol=1e-10) bicg = (A,b; M=identity,tol=1e-10,maxIter=500,o...
[ 21412, 34872, 28813, 44, 4061, 41374, 46, 198, 198, 3500, 474, 19904, 13, 37031, 198, 3500, 474, 19904, 13, 39746, 11649, 198, 3500, 474, 19904, 13, 18274, 4487, 198, 3500, 474, 19904, 13, 14993, 451, 36949, 690, 198, 3500, 474, 19904, ...
2.539146
1,124
module TestAcquisition using Test using LinearAlgebra using GaussianDistributions using CovarianceFunctions const Kernel = CovarianceFunctions using SARA: ucb, inner_sampling, random_sampling, uncertainty_sampling, integrated_uncertainty_sampling @testset "acquisition" begin l = 1/2 k = Kernel.Len...
[ 21412, 6208, 12832, 421, 10027, 198, 3500, 6208, 198, 3500, 44800, 2348, 29230, 198, 3500, 12822, 31562, 20344, 2455, 507, 198, 3500, 39751, 2743, 590, 24629, 2733, 198, 9979, 32169, 796, 39751, 2743, 590, 24629, 2733, 198, 3500, 311, 244...
1.957198
1,285
<reponame>angus-lewis/SFFM using Plots, SFFM # include("../../src/SFFM.jl") cme_9 = SFFM.MakeME(SFFM.CMEParams[9]) f = SFFM.pdf(cme_9) F(x) = 1 - SFFM.cdf(cme_9)(x) x = 0:0.05:1.5 plot(x,f.(x), label = "α exp(Sz) s") plot!(x,f.(x.+0.3)./F.(0.3), label = "α exp(S(0.3+z)) s/α exp(S 0.3) e") plot!(x,f.(x.+0.6)./F.(0.6...
[ 27, 7856, 261, 480, 29, 648, 385, 12, 293, 86, 271, 14, 50, 5777, 44, 198, 3500, 1345, 1747, 11, 311, 5777, 44, 198, 198, 2, 2291, 7203, 40720, 40720, 10677, 14, 50, 5777, 44, 13, 20362, 4943, 198, 198, 66, 1326, 62, 24, 796, ...
1.725086
291
<reponame>JuliaPackageMirrors/Polyhedra.jl function simplextest{Lib<:PolyhedraLibrary}(lib::Lib) A = [1 1; -1 0; 0 -1] b = [1, 0, 0] linset = IntSet([1]) V = [0 1; 1 0] ine = SimpleHRepresentation(A, b, linset) poly1 = polyhedron(ine, lib) @test !isempty(poly1) inequality_fulltest(poly1, A, b, linset) ...
[ 27, 7856, 261, 480, 29, 16980, 544, 27813, 27453, 5965, 14, 34220, 704, 430, 13, 20362, 198, 8818, 2829, 742, 395, 90, 25835, 27, 25, 34220, 704, 430, 23377, 92, 7, 8019, 3712, 25835, 8, 198, 220, 317, 796, 685, 16, 352, 26, 532, ...
2.301826
931
<reponame>phyjonas/ImpuritySGPE<gh_stars>1-10 __precompile__ @everywhere module OneDim using Random using FFTW include("helper.jl") include("NewtonImp.jl") include("SGPE.jl") include("solver.jl") include("modelA.jl") include("modelA_fourier_galerkin.jl") include("SGPE_fourier_galerkin.jl") export NewtonImp, phi...
[ 27, 7856, 261, 480, 29, 6883, 46286, 292, 14, 26950, 1684, 38475, 11401, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 834, 3866, 5589, 576, 834, 198, 198, 31, 16833, 3003, 8265, 1881, 29271, 198, 198, 3500, 14534, 198, 3500, 376, 9792,...
2.154812
239
<filename>backend/anime_data/snapshots_10805.jl<gh_stars>1-10 {"score": 7.38, "score_count": 45917, "timestamp": 1562557262.0} {"score": 7.39, "score_count": 44143, "timestamp": 1545775577.0} {"score": 7.41, "score_count": 36841, "timestamp": 1492413902.0} {"score": 7.42, "score_count": 34604, "timestamp": 1478750823.0...
[ 27, 34345, 29, 1891, 437, 14, 272, 524, 62, 7890, 14, 45380, 20910, 62, 24045, 20, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 4895, 26675, 1298, 767, 13, 2548, 11, 366, 26675, 62, 9127, 1298, 604, 3270, 1558, 11, 366, ...
2.362764
521
#!/usr/bin/env julia using Luxor, Random Random.seed!(42) using Test function test_circular_arrows_1(pos) gsave() froma = rescale(rand(1:100), 1, 100, 0, 2pi) toa = rescale(rand(1:100), (1, 100), (0, 2pi)) sethue("black") arrow(pos, 100, froma, toa, linewidth=rand(1:6), arrowheadlength=rand(10...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 474, 43640, 198, 198, 3500, 17145, 273, 11, 14534, 198, 198, 29531, 13, 28826, 0, 7, 3682, 8, 198, 198, 3500, 6208, 198, 198, 8818, 1332, 62, 21170, 934, 62, 6018, 82, 62, 16, 7, 1930, 8, 19...
2.211634
808
function EventBasedManeuverTriggers(arg0::AbstractDetector, arg1::AbstractDetector) return EventBasedManeuverTriggers((AbstractDetector, AbstractDetector), arg0, arg1) end function event_occurred(obj::EventBasedManeuverTriggers, arg0::SpacecraftState, arg1::EventDetector, arg2::jboolean) return jcall(obj, "eve...
[ 8818, 8558, 15001, 44, 1531, 84, 332, 2898, 328, 5355, 7, 853, 15, 3712, 23839, 11242, 9250, 11, 1822, 16, 3712, 23839, 11242, 9250, 8, 198, 220, 220, 220, 1441, 8558, 15001, 44, 1531, 84, 332, 2898, 328, 5355, 19510, 23839, 11242, ...
2.789157
830
module StressTest """ dream(seconds) Like Base.sleep() except maxes out the thread for a specified number of seconds. The minimum dream time is 1 millisecond or input of `0.001`. """ function dream(sec::Real) sec ≥ 0 || throw(ArgumentError("cannot dream for $sec seconds")) t = Timer(sec) while isopen(...
[ 21412, 36957, 14402, 198, 198, 37811, 198, 220, 220, 220, 4320, 7, 43012, 8, 198, 198, 7594, 7308, 13, 42832, 3419, 2845, 3509, 274, 503, 262, 4704, 329, 257, 7368, 1271, 286, 4201, 13, 383, 5288, 4320, 640, 318, 352, 198, 17805, 27...
2.854015
137
""" qubits(N::Int; mixed::Bool=false) qubits(sites::Vector{<:Index}; mixed::Bool=false) Initialize qubits to: - An MPS wavefunction `|ψ⟩` if `mixed = false` - An MPO density matrix `ρ` if `mixed = true` """ qubits(N::Int; mixed::Bool=false) = qubits(siteinds("Qubit", N); mixed=mixed) function qubits(si...
[ 198, 37811, 198, 220, 220, 220, 627, 9895, 7, 45, 3712, 5317, 26, 7668, 3712, 33, 970, 28, 9562, 8, 198, 220, 220, 220, 220, 198, 220, 220, 220, 627, 9895, 7, 49315, 3712, 38469, 90, 27, 25, 15732, 19629, 7668, 3712, 33, 970, 28...
2.213556
1,077
<reponame>americast/GPUArrays.jl<filename>src/fft.jl import CLFFT # figure out a gc safe way to store plans. # weak refs won't work, since the caching should keep them alive. # But at the end, we need to free all of these, otherwise CLFFT will crash # at closing time. # An atexit hook here, which will empty the dictio...
[ 27, 7856, 261, 480, 29, 2382, 291, 459, 14, 33346, 3163, 20477, 13, 20362, 27, 34345, 29, 10677, 14, 487, 83, 13, 20362, 198, 11748, 7852, 5777, 51, 198, 198, 2, 3785, 503, 257, 308, 66, 3338, 835, 284, 3650, 3352, 13, 198, 2, 4...
2.372017
922
<gh_stars>0 include("myfile.jl")
[ 27, 456, 62, 30783, 29, 15, 198, 17256, 7203, 1820, 7753, 13, 20362, 4943, 198 ]
2.2
15
# Stubs - Can be used as references struct Account <: QBObject end struct ItemBasedExpenseLineDetail; end struct Employee <: QBObject end struct Vendor <: QBObject end struct Customer <: QBObject end struct Item <: QBObject end struct Company <: QBObject Id::Maybe{Int} end from_json(::Type{ItemBasedExpenseLineDet...
[ 2, 520, 23161, 532, 1680, 307, 973, 355, 10288, 198, 7249, 10781, 1279, 25, 16135, 10267, 886, 198, 7249, 9097, 15001, 16870, 1072, 13949, 11242, 603, 26, 886, 198, 7249, 36824, 1279, 25, 16135, 10267, 886, 198, 7249, 39896, 1279, 25, ...
2.480144
1,108
function area_balance( psi_container::PSIContainer, expression::Symbol, area_mapping::Dict{String, Array{PSY.Bus, 1}}, branches, ) time_steps = model_time_steps(psi_container) remove_undef!(psi_container.expressions[expression]) nodal_net_balance = psi_container.expressions[expression] c...
[ 8818, 1989, 62, 20427, 7, 198, 220, 220, 220, 46231, 62, 34924, 3712, 3705, 2149, 756, 10613, 11, 198, 220, 220, 220, 5408, 3712, 13940, 23650, 11, 198, 220, 220, 220, 1989, 62, 76, 5912, 3712, 35, 713, 90, 10100, 11, 15690, 90, 3...
2.294903
824
export Transition; struct Transition move::Move label::String end
[ 39344, 40658, 26, 198, 198, 7249, 40658, 198, 220, 1445, 3712, 21774, 198, 220, 6167, 3712, 10100, 198, 437, 628 ]
3.6
20
using ROCKS using Documenter makedocs(; modules = [ROCKS], authors = "<NAME>", repo = "https://github.com/DaymondLing/ROCKS.jl/blob/{commit}{path}#L{line}", sitename = "ROCKS.jl", format = Documenter.HTML(; prettyurls = get(ENV, "CI", "false") == "true", canonical = "https://Daymond...
[ 3500, 41320, 50, 198, 3500, 16854, 263, 198, 198, 76, 4335, 420, 82, 7, 26, 198, 220, 220, 220, 13103, 796, 685, 49, 11290, 50, 4357, 198, 220, 220, 220, 7035, 796, 33490, 20608, 29, 1600, 198, 220, 220, 220, 29924, 796, 366, 5450...
2.030387
362
<filename>src/rules/1 Algebraic functions/1.2 Trinomial products/1.2.1 Quadratic/.jl include("1.2.1.1 (a+b x+c x^2)^p.jl") include("1.2.1.2 (d+e x)^m (a+b x+c x^2)^p.jl") include("1.2.1.3 (d+e x)^m (f+g x) (a+b x+c x^2)^p.jl") include("1.2.1.4 (d+e x)^m (f+g x)^n (a+b x+c x^2)^p.jl") include("1.2.1.5 (a+b x+c x^2)^p (d...
[ 27, 34345, 29, 10677, 14, 38785, 14, 16, 978, 29230, 291, 5499, 14, 16, 13, 17, 33822, 49070, 3186, 14, 16, 13, 17, 13, 16, 20648, 81, 1512, 11757, 20362, 198, 17256, 7203, 16, 13, 17, 13, 16, 13, 16, 357, 64, 10, 65, 2124, 10...
1.507979
376
@testset "'Design' ............................. " begin srand(1234) function simonsDesign(r1, n1, r, n) nvec = [[n1 for x1 in 0:r1]; [n for x1 in (r1 + 1):n1]] cvec = [[Inf for x1 in 0:r1]; [r for x1 in (r1 + 1):n1]] return Design(nvec, cvec) end # Simon's designs for beta = .2, alpha = .05, p1 ...
[ 31, 9288, 2617, 24018, 23067, 6, 220, 27754, 12359, 366, 2221, 628, 220, 19677, 392, 7, 1065, 2682, 8, 628, 220, 2163, 985, 684, 23067, 7, 81, 16, 11, 299, 16, 11, 374, 11, 299, 8, 198, 220, 220, 220, 299, 35138, 796, 16410, 77,...
2.126541
1,217
module MPSKit using TensorKit,KrylovKit,Parameters, Base.Threads,OptimKit using LinearAlgebra:diag,Diagonal; import LinearAlgebra #bells and whistles for mpses export InfiniteMPS,FiniteMPS,MPSComoving,PeriodicArray,MPSMultiline export transfer_left,transfer_right export leftorth,rightorth,...
[ 21412, 337, 3705, 20827, 198, 220, 220, 220, 1262, 309, 22854, 20827, 11, 42, 563, 27086, 20827, 11, 48944, 11, 7308, 13, 16818, 82, 11, 27871, 320, 20827, 628, 220, 220, 220, 1262, 44800, 2348, 29230, 25, 10989, 363, 11, 18683, 27923...
2.601509
1,458
""" get_potential(kout, kin, P, s::ShapeParams) -> sigma_mu Given a shape `s` with `2N` discretization nodes, outer and inner wavenumbers `kout`,`kin`, and the cylindrical harmonics parameter `P`, returns the potential densities `sigma_mu`. Each column contains the response to a different harmonic, where the...
[ 37811, 201, 198, 220, 220, 220, 651, 62, 13059, 1843, 7, 74, 448, 11, 18967, 11, 350, 11, 264, 3712, 33383, 10044, 4105, 8, 4613, 264, 13495, 62, 30300, 201, 198, 201, 198, 15056, 257, 5485, 4600, 82, 63, 351, 4600, 17, 45, 63, ...
1.700748
5,751
using LinearAlgebra using OpenCL const sum_kernel = " __kernel void sum(__global float *a, __global const float *b) { int gid = get_global_id(0); a[gid] = a[gid] + b[gid]; } " a = zeros(Float32, 50_000) b = ones(Float32, 50_000) device, ctx, queue = cl.create_compute_contex...
[ 3500, 44800, 2348, 29230, 198, 3500, 4946, 5097, 198, 198, 9979, 2160, 62, 33885, 796, 366, 198, 220, 220, 11593, 33885, 7951, 2160, 7, 834, 20541, 12178, 1635, 64, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220...
2.129231
325
<reponame>grahamstark/ScottishTaxBenefitModel module TheEqualiser # # This module automatically adjusts taxes (it and ni, optionally) # so the net cost of benefit or other changes # is close to zero. # # TODO needs a lot of work: # # - more options - so basic rate only etc; # - use passed-in functions to equalise (li...
[ 27, 7856, 261, 480, 29, 70, 13220, 301, 668, 14, 19040, 680, 27017, 42166, 270, 17633, 198, 21412, 383, 36, 13255, 5847, 198, 2, 198, 2, 770, 8265, 6338, 46094, 5704, 357, 270, 290, 37628, 11, 42976, 8, 198, 2, 523, 262, 2010, 157...
2.713341
907
<reponame>kailaix/NNFEM.jl<gh_stars>10-100 include("hyperelasticity.jl") # ts = ExplicitSolverTime(Δt, NT) ubd, abd = compute_boundary_info(domain, globaldata, ts) Fext = compute_external_force(domain, globaldata, ts) d0 = zeros(2domain.nnodes) v0 = zeros(2domain.nnodes) a0 = zeros(2domain.nnodes) mode = "consiste...
[ 27, 7856, 261, 480, 29, 74, 39460, 844, 14, 6144, 37, 3620, 13, 20362, 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 17256, 7203, 71, 2981, 2411, 3477, 414, 13, 20362, 4943, 198, 2, 220, 198, 912, 796, 11884, 50, 14375, 7575, 7, 1...
2.115619
986
@testset "Decreasing2LP: $(fct_type), dimension $(dim), $(T)" for fct_type in ["vector of variables", "vector affine function"], dim in [2, 3], T in [Int, Float64] mock = MOIU.MockOptimizer(MILPModel{T}()) model = COIB.Decreasing2LP{T}(mock) if T == Int @test MOI.supports_constraint(model, MOI.Vari...
[ 31, 9288, 2617, 366, 43198, 2313, 17, 19930, 25, 29568, 69, 310, 62, 4906, 828, 15793, 29568, 27740, 828, 29568, 51, 16725, 329, 277, 310, 62, 4906, 287, 14631, 31364, 286, 9633, 1600, 366, 31364, 1527, 500, 2163, 33116, 5391, 287, 68...
2.111296
1,204
<gh_stars>10-100 using Statistics using Distributions using ProgressMeter #= References ---------- [1] <NAME>. (2001). "Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates." Mathematics and Computers in Simulation, 55(1-3):271-280, doi:10.1016/S037...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 3500, 14370, 198, 3500, 46567, 507, 198, 3500, 18387, 44, 2357, 198, 198, 2, 28, 198, 19927, 198, 35937, 198, 220, 220, 220, 685, 16, 60, 1279, 20608, 28401, 357, 14585, 737, 220, 366, 2...
2.459131
3,707
<filename>test/utils_test.jl<gh_stars>10-100 @testset "Auxiliary Functions Test" begin @testset "check constant columns" begin @test_throws Exception PartialLeastSquaresRegressor.check_constant_cols([1.0 1;1 2;1 3]) @test_throws Exception PartialLeastSquaresRegressor.check_constant_cols([1.0;1;1][:,:]) @test_...
[ 27, 34345, 29, 9288, 14, 26791, 62, 9288, 13, 20362, 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 31, 9288, 2617, 366, 32, 2821, 28129, 40480, 6208, 1, 2221, 198, 220, 220, 220, 2488, 9288, 2617, 366, 9122, 6937, 15180, 1, 2221, 19...
2.621795
468
<filename>src/AdjustQuasiGLM.jl """ AdjustQuasiGLM(model, ϕ; level) Estimates dispersion parameter, adjusts original GLM to reflect the dispersion and returns results in a pretty DataFrame. Usage: ```julia-repl AdjustQuasiGLM(model, ϕ; level) ``` Arguments: - `model` : The `GLM` model. - `data` : The `DataFrame` co...
[ 27, 34345, 29, 10677, 14, 39668, 4507, 17053, 8763, 44, 13, 20362, 198, 37811, 198, 220, 220, 220, 20292, 4507, 17053, 8763, 44, 7, 19849, 11, 18074, 243, 26, 1241, 8, 198, 22362, 26748, 4596, 6900, 11507, 11, 46094, 2656, 10188, 44, ...
2.867371
852
struct Snowflake n::UInt64 end Snowflake(s::AbstractString) = Snowflake(parse(UInt64, s)) Base.show(io::IO, s::Snowflake) = print(io, string(s.n; base=10)) Base.:(==)(s::Snowflake, n::Integer) = s.n == n Base.:(==)(n::Integer, s::Snowflake) = n == s.n StructTypes.StructType(::Type{Snowflake}) = StructTypes.StringT...
[ 7249, 7967, 47597, 198, 220, 220, 220, 299, 3712, 52, 5317, 2414, 198, 437, 198, 198, 28974, 47597, 7, 82, 3712, 23839, 10100, 8, 796, 7967, 47597, 7, 29572, 7, 52, 5317, 2414, 11, 264, 4008, 198, 14881, 13, 12860, 7, 952, 3712, 9...
2.384
250
for quad_degree = 1:20 # Exceeding degree 20 seems unnecessary at this time @eval begin # Square @generated function gauss_quadrature(form::Val{:legendre}, shape::RefSquare, degree::Val{$quad_degree}, ...
[ 1640, 15094, 62, 16863, 796, 352, 25, 1238, 1303, 1475, 2707, 278, 4922, 1160, 2331, 13114, 379, 428, 640, 198, 220, 220, 220, 2488, 18206, 2221, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 9276, 198, 220, 220, 220, 220, 220, 220,...
1.522114
1,854
<reponame>IgorKohan/NormalHermiteSplines.jl<filename>src/Interpolate.jl<gh_stars>1-10 function _prepare(nodes::Matrix{T}, kernel::RK ) where {T <: AbstractFloat, RK <: ReproducingKernel_0} n = size(nodes, 1) n_1 = size(nodes, 2) min_bound = Vector{T}(undef, n) co...
[ 27, 7856, 261, 480, 29, 40, 7053, 42, 22436, 14, 26447, 48523, 578, 26568, 1127, 13, 20362, 27, 34345, 29, 10677, 14, 9492, 16104, 378, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 8818, 4808, 46012, 533, 7, 77, 4147, 3712...
1.692278
7,770
<filename>src/util.jl<gh_stars>10-100 Mcdf(f,fmin,fmax) = (1.0./f - 1.0/fmax) ./ (1.0/fmin - 1.0/fmax) function selection(λ, f, tend, t1) #define the equation for selection as above s = (λ .* t1 + log.(f ./ (1 .- f))) ./ (λ .* (tend - t1)) return s end function selection2clone(λ, f1, f2, tend, t1, t2) ...
[ 27, 34345, 29, 10677, 14, 22602, 13, 20362, 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 9742, 7568, 7, 69, 11, 69, 1084, 11, 69, 9806, 8, 796, 357, 16, 13, 15, 19571, 69, 532, 352, 13, 15, 14, 69, 9806, 8, 24457, 357, 16, 13...
2.286129
5,508
<gh_stars>0 # <NAME>, 2022 # Codes for chapter 11 # Code for section 11.1 # deserialization of source data frame using DataFrames using Serialization walk = deserialize("walk.bin") # Code for a note on conversion x = [1.5] x[1] = 1 x # Code from section 11.1.1 Matrix(walk) Matrix{Any}(walk) Matrix{String}(walk)...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 1279, 20608, 22330, 33160, 198, 198, 2, 44380, 329, 6843, 1367, 198, 198, 2, 6127, 329, 2665, 1367, 13, 16, 198, 198, 2, 748, 48499, 1634, 286, 2723, 1366, 5739, 198, 198, 3500, 6060, 35439, 198...
2.031832
1,288
#useful functions that do no directly call C code function getAllVertCoords() numV = num_entities[1] vertCoords = zeros(3, numV) # storage for all vertex coordinates coords_tmp = zeros(3,1) # temporary storage for vetex coordinates for i=1:numV apf.getVertCoords(coords_tmp, 3, 1) vertCoords[:, i] = coords_tmp ...
[ 2, 1904, 913, 5499, 326, 466, 645, 3264, 869, 327, 2438, 198, 198, 8818, 651, 3237, 42369, 7222, 3669, 3419, 198, 22510, 53, 796, 997, 62, 298, 871, 58, 16, 60, 198, 198, 1851, 7222, 3669, 796, 1976, 27498, 7, 18, 11, 997, 53, 8...
2.672727
385
const hotkeys = Hotkey[ Hotkey( "ctrl + alt + shift + s", SettingsWindow.showSettings ), Hotkey( "ctrl + shift + s", showFileSaveDialog ), Hotkey( "ctrl + s", menuFileSave ), Hotkey( "ctrl + o", showFileOpenDialog ), Hot...
[ 9979, 3024, 13083, 796, 6964, 2539, 58, 198, 220, 220, 220, 6964, 2539, 7, 198, 220, 220, 220, 220, 220, 220, 220, 366, 44755, 1343, 5988, 1343, 6482, 1343, 264, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 16163, 27703, 13, 12860,...
1.815476
504
<reponame>agdestein/DiscreteFiltering.jl<filename>src/filter/filter.jl """ Abstract continuous filter. """ abstract type Filter end """ IdentityFilter() Identity filter, which does not filter. """ struct IdentityFilter <: Filter end """ TopHatFilter(width) Top hat filter, parameterized by a variable filte...
[ 27, 7856, 261, 480, 29, 363, 16520, 68, 259, 14, 15642, 8374, 11928, 20212, 13, 20362, 27, 34345, 29, 10677, 14, 24455, 14, 24455, 13, 20362, 198, 37811, 198, 23839, 12948, 8106, 13, 198, 37811, 198, 397, 8709, 2099, 25853, 886, 628, ...
2.972881
295
# Converts a String to Languages.Language (using STR_TO_LANG) convert(::Type{L}, lang::S) where {L<:Languages.Language, S<:AbstractString} = begin TypeLang = get(STR_TO_LANG, strip(lowercase(lang)), Languages.English) return TypeLang() end # Converts Languages.Language to String (using LANG_TO_STR) convert(::T...
[ 2, 1482, 24040, 257, 10903, 284, 42860, 13, 32065, 357, 3500, 19269, 62, 10468, 62, 43, 15567, 8, 198, 1102, 1851, 7, 3712, 6030, 90, 43, 5512, 42392, 3712, 50, 8, 810, 1391, 43, 27, 25, 43, 33213, 13, 32065, 11, 311, 27, 25, 23...
2.527972
1,144
<reponame>mforets/NeuralVerification.jl """ Planet(optimizer, eager::Bool) Planet integrates a SAT solver (`PicoSAT.jl`) to find an activation pattern that maps a feasible input to an infeasible output. # Problem requirement 1. Network: any depth, ReLU activation 2. Input: hyperrectangle or bounded hpolytope 3. O...
[ 27, 7856, 261, 480, 29, 76, 754, 912, 14, 8199, 1523, 13414, 2649, 13, 20362, 198, 37811, 198, 220, 220, 220, 11397, 7, 40085, 7509, 11, 11069, 3712, 33, 970, 8, 198, 198, 41801, 48105, 257, 29020, 1540, 332, 357, 63, 47, 3713, 50...
2.290896
2,867
<filename>Julia-Packages/Plot3D/src/Face.jl<gh_stars>10-100 ## Code dealing with Face mutable struct Face nvertex::Int64 X::Array{Float64,1} Y::Array{Float64,1} Z::Array{Float64,1} I::Array{Int64,1} J::Array{Int64,1} K::Array{Int64,1} end """Default Constructor for Face """ function Fac...
[ 27, 34345, 29, 16980, 544, 12, 11869, 1095, 14, 43328, 18, 35, 14, 10677, 14, 32388, 13, 20362, 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 2235, 6127, 7219, 351, 15399, 220, 198, 76, 18187, 2878, 15399, 198, 220, 220, 220, 299, 3...
1.890698
860
""" reflect(v, n) Reflect direction `v` at plane with normal `n`. """ function reflect(v, n) @assert(abs(norm(n) - 1) < 1e-11, "surface normal must be normalized") return v - 2*dot(v, n)*n end """ refract(v, n, ni_over_nt) Compute direction of refracted ray according to Snell's law, or return `noth...
[ 198, 37811, 198, 220, 220, 220, 4079, 7, 85, 11, 299, 8, 198, 198, 8134, 801, 4571, 4600, 85, 63, 379, 6614, 351, 3487, 4600, 77, 44646, 198, 37811, 198, 8818, 4079, 7, 85, 11, 299, 8, 198, 220, 220, 220, 2488, 30493, 7, 8937, ...
2.662679
1,254
module SparseIR import PyCall: pyimport, PyNULL, PyVector, PyObject const sparse_ir = PyNULL() const pyspr = PyNULL() const pyaugment = PyNULL() const pysampling = PyNULL() function __init__() copy!(sparse_ir, pyimport_conda("sparse_ir", "sparse-ir", "spm-lab")) copy!(pyspr, pyimport("sparse_ir.spr")) co...
[ 21412, 1338, 17208, 4663, 198, 198, 11748, 9485, 14134, 25, 12972, 11748, 11, 9485, 33991, 11, 9485, 38469, 11, 9485, 10267, 198, 198, 9979, 29877, 62, 343, 796, 9485, 33991, 3419, 198, 9979, 279, 893, 1050, 796, 9485, 33991, 3419, 198,...
2.552727
275
<gh_stars>0 #= Instructions: - Pkg.add("PkgBenchmark.jl") - using PkgBenchmark - results = benchmarkpkg("IntervalArithmetic") - showall(results) - results = judge("IntervalArithmetic", "v0.9.1") # compare current version to that tag - showall(results) =# using IntervalArithmetic @benchgroup "Constructors" begin ...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 28, 27759, 25, 198, 198, 12, 350, 10025, 13, 2860, 7203, 47, 10025, 44199, 4102, 13, 20362, 4943, 198, 12, 1262, 350, 10025, 44199, 4102, 198, 198, 12, 2482, 796, 18335, 35339, 7203, 9492, 2100, ...
2.300683
439
<reponame>gottacatchenall/DynamicGrids.jl # Sequence rules over the [`SimData`](@ref) object, # calling [`maprule!`](@ref) for each individual `Rule`. function sequencerules!(simdata::AbstractSimData) newsimdata = sequencerules!(simdata, rules(simdata)) _maybemask!(grids(newsimdata)) newsimdata end function...
[ 27, 7856, 261, 480, 29, 70, 1252, 330, 265, 6607, 439, 14, 44090, 8642, 2340, 13, 20362, 198, 2, 45835, 3173, 625, 262, 685, 63, 8890, 6601, 63, 16151, 31, 5420, 8, 2134, 11, 198, 2, 4585, 685, 63, 8899, 25135, 0, 63, 16151, 31,...
2.845865
266
<gh_stars>0 module InterfaceSymbolicUtilsModule using SymbolicUtils import ..CoreModule: CONST_TYPE, Node, Options import ..UtilsModule: isgood, isbad, @return_on_false const SYMBOLIC_UTILS_TYPES = Union{<:Number,SymbolicUtils.Symbolic{<:Number}} const SUPPORTED_OPS = (cos, sin, exp, cot, tan, csc, sec, +, -, *, /) ...
[ 27, 456, 62, 30783, 29, 15, 198, 21412, 26491, 13940, 2022, 4160, 18274, 4487, 26796, 198, 198, 3500, 41327, 4160, 18274, 4487, 198, 11748, 11485, 14055, 26796, 25, 7102, 2257, 62, 25216, 11, 19081, 11, 18634, 198, 11748, 11485, 18274, ...
2.343258
3,560
fs1() @testset "LX input" begin set_curpath("index.md") mkpath(joinpath(F.PATHS[:assets], "index", "code", "output")) write(joinpath(F.PATHS[:assets], "index", "code", "s1.jl"), "println(1+1)") write(joinpath(F.PATHS[:assets], "index", "code", "output", "s1a.png"), "blah") write(joinpath(F.PATHS[:a...
[ 9501, 16, 3419, 198, 198, 31, 9288, 2617, 366, 43, 55, 5128, 1, 2221, 198, 220, 220, 220, 900, 62, 22019, 6978, 7203, 9630, 13, 9132, 4943, 198, 220, 220, 220, 33480, 6978, 7, 22179, 6978, 7, 37, 13, 47, 1404, 7998, 58, 25, 1966...
2.15277
1,859
using Flux, CUDA, Test using Flux: pullback @testset "CUDNN BatchNorm" begin @testset "4D Input" begin x = Float64.(collect(reshape(1:12, 2, 2, 3, 1))) m = BatchNorm(3) cx = gpu(x) cm = gpu(m) y, back = pullback((m, x) -> m(x), m, x) cy, cback = pullback((m, x) -> m...
[ 3500, 1610, 2821, 11, 29369, 5631, 11, 6208, 198, 3500, 1610, 2821, 25, 2834, 1891, 198, 198, 31, 9288, 2617, 366, 34, 8322, 6144, 347, 963, 35393, 1, 2221, 198, 220, 220, 220, 2488, 9288, 2617, 366, 19, 35, 23412, 1, 2221, 198, 2...
1.679153
614
const PAR_MAGIC = "PAR1" const SZ_PAR_MAGIC = length(PAR_MAGIC) const SZ_FOOTER = 4 const SZ_VALID_PAR = 2*SZ_PAR_MAGIC + SZ_FOOTER # page is the unit of compression mutable struct Page colchunk::ColumnChunk hdr::PageHeader pos::Int data::Vector{UInt8} end mutable struct PageLRU refs::Dict{Column...
[ 198, 9979, 29463, 62, 45820, 2149, 796, 366, 27082, 16, 1, 198, 9979, 311, 57, 62, 27082, 62, 45820, 2149, 796, 4129, 7, 27082, 62, 45820, 2149, 8, 198, 9979, 311, 57, 62, 6080, 2394, 1137, 796, 604, 198, 9979, 311, 57, 62, 23428,...
2.408476
5,545
# Author: <NAME>, <EMAIL> # Date: 12/11/2014 module AbstractGenerativeModelImpl export AbstractGenerativeModel abstract AbstractGenerativeModel end #module module AbstractGenerativeModelInterfaces export get, isterminal function get() end function isterminal() end end #module
[ 2, 6434, 25, 1279, 20608, 22330, 1279, 27630, 4146, 29, 198, 2, 7536, 25, 1105, 14, 1157, 14, 4967, 628, 198, 21412, 27741, 8645, 876, 17633, 29710, 198, 198, 39344, 27741, 8645, 876, 17633, 198, 198, 397, 8709, 27741, 8645, 876, 1763...
3.217391
92
@testset "ModelKit - SLP" begin @testset "CompiledHomotopy/InterpretedHomotopy" begin @var x y a b c f = [(2 * x^2 + b^2 * y^3 + 2 * a * x * y)^3, (a + c)^4 * x + y^2] @var s sp[1:3] sq[1:3] g = subs(f, [a, b, c] => s .* sp .+ (1 .- s) .* sq) h = Homotopy(g, [x, y], s, [sp...
[ 31, 9288, 2617, 366, 17633, 20827, 532, 12419, 47, 1, 2221, 628, 220, 220, 220, 2488, 9288, 2617, 366, 7293, 3902, 28718, 313, 11081, 14, 9492, 5310, 276, 28718, 313, 11081, 1, 2221, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 778...
1.675808
3,683
<filename>src/parsing.jl function addkey!(membernames, nam) if !haskey(membernames, nam) membernames[nam] = gensym() end membernames[nam] end onearg(e::Expr, f) = e.head == :call && length(e.args) == 2 && e.args[1] == f onearg(e, f) = false mapexpr(f, e) = Expr(e.head, map(f, e.args)...) replace_...
[ 27, 34345, 29, 10677, 14, 79, 945, 278, 13, 20362, 198, 8818, 751, 2539, 0, 7, 19522, 14933, 11, 299, 321, 8, 198, 220, 220, 220, 611, 5145, 10134, 2539, 7, 19522, 14933, 11, 299, 321, 8, 198, 220, 220, 220, 220, 220, 220, 220, ...
2.201792
4,911
<reponame>mattwigway/ArchGDAL.jl<gh_stars>100-1000 using Downloads using SHA # this file downloads files which are used during testing the package # if they are already present and their checksum matches, they are not downloaded again REPO_URL = "https://github.com/yeesian/ArchGDALDatasets/blob/master/" # remote fil...
[ 27, 7856, 261, 480, 29, 76, 1078, 28033, 1014, 14, 19895, 45113, 1847, 13, 20362, 27, 456, 62, 30783, 29, 3064, 12, 12825, 198, 3500, 50093, 198, 3500, 25630, 198, 198, 2, 428, 2393, 21333, 3696, 543, 389, 973, 1141, 4856, 262, 5301...
2.341762
1,226
@testset "eigenvalues/eigenvectors: $MatT" for MatT in (AcbMatrix, AcbRefMatrix) A = [ 0.6873474041954415 0.7282180564881044 0.07360652513458521 0.000835810121029068 0.9256166870757694 0.5363310989411239 0.07387174694790022 0.4050436025621329 0.20226010388885896 ] B = [ 0.898...
[ 31, 9288, 2617, 366, 68, 9324, 27160, 14, 68, 9324, 303, 5217, 25, 720, 19044, 51, 1, 329, 6550, 51, 287, 357, 12832, 65, 46912, 11, 4013, 65, 8134, 46912, 8, 198, 220, 220, 220, 317, 796, 685, 198, 220, 220, 220, 220, 220, 220,...
1.683111
2,919
<gh_stars>0 module VortexHelperBowlPuffer using ..Ahorn, Maple @mapdef Entity "VortexHelper/BowlPuffer" BowlPuffer(x::Integer, y::Integer, noRespawn::Bool = false, explodeTimer::Number = 1.0) const placements = Ahorn.PlacementDict( "Pufferfish Bowl (Vortex Helper)" => Ahorn.EntityPlacement( BowlPuffer, ...
[ 27, 456, 62, 30783, 29, 15, 198, 21412, 49790, 47429, 33, 4883, 47, 13712, 198, 3500, 11485, 10910, 1211, 11, 21249, 198, 198, 31, 8899, 4299, 20885, 366, 53, 26158, 47429, 14, 33, 4883, 47, 13712, 1, 8693, 47, 13712, 7, 87, 3712, ...
2.422414
348
# Testing: # # - computation of sufficient statistics # - distribution fitting (i.e. estimation) # using Distributions using Base.Test n0 = 100 N = 10^5 w = rand(n0) # DiscreteUniform x = rand(DiscreteUniform(10, 15), n0) d = fit(DiscreteUniform, x) @test isa(d, DiscreteUniform) @test minimum(d) == minimum(x) @t...
[ 2, 23983, 25, 198, 2, 198, 2, 220, 532, 29964, 286, 6751, 7869, 198, 2, 220, 532, 6082, 15830, 357, 72, 13, 68, 13, 31850, 8, 198, 2, 198, 198, 3500, 46567, 507, 198, 3500, 7308, 13, 14402, 198, 198, 77, 15, 796, 1802, 198, 45...
2.092162
3,700
using DiffEqFlux, Flux using LinearAlgebra, Distributions using Optim, GalacticOptim using Test function run_test(f, layer, atol) data_train_vals = [rand(length(layer.model)) for k in 1:500] data_train_fn = f.(data_train_vals) function loss_function(component) data_pred = [layer(x,component) for ...
[ 3500, 10631, 36, 80, 37, 22564, 11, 1610, 2821, 198, 3500, 44800, 2348, 29230, 11, 46567, 507, 198, 3500, 30011, 11, 23509, 27871, 320, 198, 3500, 6208, 198, 198, 8818, 1057, 62, 9288, 7, 69, 11, 7679, 11, 379, 349, 8, 628, 220, 2...
2.412568
732
<reponame>grahamstark/ScottishTaxBenefitModel # # This is the benefit/tax credit/IT/MinWage/NI rates from April 2021 # sys.it.savings_rates = [0.0, 20.0, 40.0, 45.0] sys.it.savings_thresholds = [5_000.0, 37_700.0, 150_000.0] sys.it.savings_basic_rate = 2 # above this counts as higher rate sys.it.non_savings_rate...
[ 27, 7856, 261, 480, 29, 70, 13220, 301, 668, 14, 19040, 680, 27017, 42166, 270, 17633, 198, 2, 198, 2, 770, 318, 262, 4414, 14, 19290, 3884, 14, 2043, 14, 9452, 54, 496, 14, 22125, 3965, 422, 3035, 33448, 198, 2, 198, 17597, 13, ...
2.209059
5,343
<reponame>mipals/SymEGRSSMatrices struct SymEGRQSMatrix{T,UT<:AbstractArray,VT<:AbstractArray,dT<:AbstractArray} <: AbstractMatrix{T} Ut::UT Vt::VT d::dT n::Int p::Int function SymEGRQSMatrix{T,UT,VT,dT}(Ut,Vt,d,n,p) where {T,UT<:AbstractArray,VT<:AbstractArray,dT<:AbstractArray} Up, Un = siz...
[ 27, 7856, 261, 480, 29, 76, 541, 874, 14, 43094, 7156, 49, 5432, 19044, 45977, 198, 7249, 15845, 7156, 49, 48, 12310, 265, 8609, 90, 51, 11, 3843, 27, 25, 23839, 19182, 11, 36392, 27, 25, 23839, 19182, 11, 67, 51, 27, 25, 23839, ...
2.132092
1,128
using DataFrames using DuckDB using Test using Dates using UUIDs test_files = [ "test_appender.jl", "test_basic_queries.jl", "test_config.jl", "test_connection.jl", "test_df_scan.jl", "test_prepare.jl", "test_transaction.jl", "test_sqlite.jl", "test_replacement_scan.jl", "test_t...
[ 3500, 6060, 35439, 198, 3500, 21867, 11012, 198, 3500, 6208, 198, 3500, 44712, 198, 3500, 471, 27586, 82, 198, 198, 9288, 62, 16624, 796, 685, 198, 220, 220, 220, 366, 9288, 62, 1324, 2194, 13, 20362, 1600, 198, 220, 220, 220, 366, ...
2.180952
315
<reponame>RalphAS/SLICOTMath.jl # Portions translated from SLICOT-Reference distribution # Copyright (c) 2002-2020 NICONET e.V. function run_mb03bd(datfile, io=stdout) NIN = 5 NOUT = 6 KMAX = 6 NMAX = 50 LDA1 = NMAX LDA2 = NMAX LDQ1 = NMAX LDQ2 = NMAX LDWORK = KMAX + max( 2*NMAX, 8*K...
[ 27, 7856, 261, 480, 29, 49, 17307, 1921, 14, 8634, 2149, 2394, 37372, 13, 20362, 198, 2, 4347, 507, 14251, 422, 12419, 2149, 2394, 12, 26687, 6082, 198, 2, 15069, 357, 66, 8, 6244, 12, 42334, 45593, 1340, 2767, 304, 13, 53, 13, 19...
1.843279
1,793
# Do not share a stream between processes # The token would be shared so putting would give InvalidSequenceTokenException a lot struct CloudWatchLogHandler{F<:Formatter} <: Handler{F, Union{}} stream::CloudWatchLogStream channel::Channel{LogEvent} # only one task should read from this channel fmt::F end "...
[ 2, 2141, 407, 2648, 257, 4269, 1022, 7767, 198, 2, 383, 11241, 561, 307, 4888, 523, 5137, 561, 1577, 17665, 44015, 594, 30642, 16922, 257, 1256, 198, 7249, 10130, 10723, 11187, 25060, 90, 37, 27, 25, 8479, 1436, 92, 1279, 25, 32412, ...
2.657081
1,391
##### multi dimensional advection ##### For incompressible model only ##### calculate tendencies in x direction @kernel function calc_Gcˣ_kernel!(Gc, c, u, g::AbstractGrid, ΔT) i, j, k = @index(Global, NTuple) ### offset index for halo points ii = i + g.Hx jj = j + g.Hy kk = k + g.Hz @inbounds G...
[ 4242, 2, 5021, 38517, 512, 303, 596, 198, 4242, 2, 1114, 13352, 601, 856, 2746, 691, 198, 4242, 2, 15284, 25671, 287, 2124, 4571, 198, 31, 33885, 2163, 42302, 62, 38, 66, 135, 96, 62, 33885, 0, 7, 38, 66, 11, 269, 11, 334, 11, ...
2.133333
2,715
<gh_stars>10-100 # Using the ZigZagBoomerang with Turing with the BouncyParticle sampler # (The approach taken here is retrieving the likelihood function from Turing and sampling # directly with ZigZagBoomerang and not using Turings `AbstractMCMC` ) using Turing using ZigZagBoomerang const ZZB = ZigZagBoomerang usin...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 2, 8554, 262, 24992, 57, 363, 33, 4207, 263, 648, 351, 39141, 351, 262, 347, 977, 948, 7841, 1548, 6072, 20053, 198, 2, 357, 464, 3164, 2077, 994, 318, 50122, 262, 14955, 2163, 422, 3914...
2.48294
1,524
###################################################################### # Additional errors used in the library. # ----- # Licensed under MIT License export CancellationError struct CancellationError <: Exception what end CancellationError() = CancellationError(nothing) function Base.showerror(io::IO, err::Cancell...
[ 29113, 29113, 4242, 2235, 198, 2, 15891, 8563, 973, 287, 262, 5888, 13, 198, 2, 37404, 198, 2, 49962, 739, 17168, 13789, 198, 198, 39344, 43780, 297, 341, 12331, 198, 7249, 43780, 297, 341, 12331, 1279, 25, 35528, 198, 220, 220, 220, ...
2.882813
256
@inline function initialize!(integrator,cache::ExplicitRKConstantCache,f=integrator.f) integrator.kshortsize = 2 integrator.k = eltype(integrator.sol.k)(integrator.kshortsize) integrator.fsalfirst = f(integrator.t,integrator.uprev) end @inline function perform_step!(integrator,cache::ExplicitRKConstantCache,f=in...
[ 31, 45145, 2163, 41216, 0, 7, 18908, 12392, 11, 23870, 3712, 18438, 3628, 49, 42, 3103, 18797, 30562, 11, 69, 28, 18908, 12392, 13, 69, 8, 198, 220, 4132, 12392, 13, 50133, 2096, 1096, 796, 362, 198, 220, 4132, 12392, 13, 74, 796, ...
2.027609
1,811
module FluspectMod #using GSL using Polynomials using Statistics # Matlab reading using MAT # Numerical integration package (Simson rule) using QuadGK # Is this OK? file_Opti = joinpath(dirname(pathof(FluspectMod)), "Optipar2017_ProspectD.mat") const minwle = 400.; # PAR range const maxwle = 700.; const minwlf = 6...
[ 21412, 1610, 385, 806, 5841, 198, 2, 3500, 46326, 198, 3500, 12280, 26601, 8231, 198, 3500, 14370, 198, 2, 6550, 23912, 3555, 198, 3500, 36775, 198, 2, 399, 6975, 605, 11812, 5301, 357, 8890, 1559, 3896, 8, 198, 3500, 20648, 38, 42, ...
1.923092
15,330
using MyPkgDemo using Documenter makedocs(; modules=[MyPkgDemo], authors="MegamindHenry", repo="https://github.com/MegamindHenry/MyPkgDemo.jl/blob/{commit}{path}#L{line}", sitename="MyPkgDemo.jl", format=Documenter.HTML(; prettyurls=get(ENV, "CI", "false") == "true", canonical="http...
[ 3500, 2011, 47, 10025, 11522, 78, 198, 3500, 16854, 263, 198, 198, 76, 4335, 420, 82, 7, 26, 198, 220, 220, 220, 13103, 41888, 3666, 47, 10025, 11522, 78, 4357, 198, 220, 220, 220, 7035, 2625, 42672, 321, 521, 32476, 1600, 198, 220,...
2.038462
286
<reponame>sisl/GrammarExpts.jl #***************************************************************************** # Written by <NAME>, <EMAIL> # ***************************************************************************** # Copyright ã 2015, United States Government, as represented by the # Administrator of the National A...
[ 27, 7856, 261, 480, 29, 82, 3044, 14, 38, 859, 3876, 3109, 457, 82, 13, 20362, 198, 2, 17174, 17174, 4557, 35625, 198, 2, 22503, 416, 1279, 20608, 22330, 1279, 27630, 4146, 29, 198, 2, 41906, 17174, 4557, 35625, 198, 2, 15069, 6184,...
2.307604
6,076
<reponame>JuliaPackageMirrors/NearestNeighbors.jl # Does not test leafsize # Does not test different metrics import Distances.evaluate @testset "knn" begin @testset "metric" for metric in metrics @testset "tree type" for TreeType in trees_with_brute # 8 node rectangle data = [0.0 0....
[ 27, 7856, 261, 480, 29, 16980, 544, 27813, 27453, 5965, 14, 8199, 12423, 46445, 32289, 13, 20362, 198, 2, 8314, 407, 1332, 12835, 7857, 198, 2, 8314, 407, 1332, 1180, 20731, 198, 11748, 4307, 1817, 13, 49786, 198, 198, 31, 9288, 2617,...
1.862106
921
<reponame>ArbitRandomUser/Javis.jl """ ObjectSetting The current settings of an [`Object`](@ref) which are saved in `object.current_setting`. # Fields - `line_width::Float64`: the current line width - `mul_line_width::Float64`: the current multiplier for line width. The actual line width is then: `mul_line_wi...
[ 27, 7856, 261, 480, 29, 3163, 2545, 29531, 12982, 14, 41, 23401, 13, 20362, 198, 37811, 198, 220, 220, 220, 9515, 34149, 198, 198, 464, 1459, 6460, 286, 281, 685, 63, 10267, 63, 16151, 31, 5420, 8, 543, 389, 7448, 287, 4600, 15252, ...
2.943515
956
#------------------------------------------------------------------------------ """ excise(x...) Remove all lines where the is a NaN/missing in any of the x arrays # Examples - `x1 = excise(x)` - `(y1,x1) = excise(y,x)` """ function excise(x...) n = length(x) vv = FindNNPs(x...) #find rows with NaN/...
[ 2, 10097, 26171, 198, 37811, 198, 220, 220, 220, 47547, 7, 87, 23029, 198, 198, 27914, 477, 3951, 810, 262, 318, 257, 11013, 45, 14, 45688, 287, 597, 286, 262, 2124, 26515, 198, 198, 2, 21066, 198, 12, 4600, 87, 16, 796, 47547, 7,...
2.644412
689
<reponame>UnofficialJuliaMirror/Nabla.jl-49c96f43-aa6d-5a04-a506-44c7070ebe78<filename>src/sensitivities/indexing.jl # Implementation of reverse-mode sensitivities for `getindex`. import Base.getindex for i = 1:7 T = Expr(:curly, :Tuple, fill(:Any, i)...) is_node = Expr(:vect, true, fill(false, i - 1)...) @...
[ 27, 7856, 261, 480, 29, 3118, 16841, 16980, 544, 27453, 1472, 14, 45, 397, 5031, 13, 20362, 12, 2920, 66, 4846, 69, 3559, 12, 7252, 21, 67, 12, 20, 64, 3023, 12, 64, 35638, 12, 2598, 66, 2154, 2154, 68, 1350, 3695, 27, 34345, 29...
2.253054
573
module WaveFD using Base.Threads, CvxCompress, DSP, Distributed, DistributedArrays, FFTW, LinearAlgebra, NearestNeighbors, Random, SpecialFunctions, StaticArrays, Statistics, WaveFD_jll import Base.convert, Base.copy, Base.get, Base.min, Base.max, Base.maximum, Base.show, Base.size abstract type Language end struct ...
[ 21412, 17084, 26009, 198, 198, 3500, 7308, 13, 16818, 82, 11, 327, 85, 87, 7293, 601, 11, 360, 4303, 11, 4307, 6169, 11, 4307, 6169, 3163, 20477, 11, 376, 9792, 54, 11, 44800, 2348, 29230, 11, 3169, 12423, 46445, 32289, 11, 14534, 1...
2.509772
614
<filename>julia/emit_log_direct.jl using AMQPClient const VIRTUALHOST = "/" const HOST = "127.0.0.1" function send() # 1. Create a connection to the localhost or 127.0.0.1 of virtualhost '/' connection(; virtualhost=VIRTUALHOST, host=HOST) do conn # 2. Create a channel to send messages channel...
[ 27, 34345, 29, 73, 43640, 14, 368, 270, 62, 6404, 62, 12942, 13, 20362, 198, 3500, 3001, 48, 47, 11792, 198, 9979, 569, 48771, 25620, 39, 10892, 796, 12813, 1, 198, 9979, 367, 10892, 796, 366, 16799, 13, 15, 13, 15, 13, 16, 1, 6...
2.121547
543
<gh_stars>0 # Question # What is the largest prime factor of the number 600851475143 ? # Time # O(n) any better solution?? function sieve(a) # find all the prime numbers less than or equal to a sieve = collect(1:a) # now from this iterate from 2 and remove all their multiples index = ones(Bool, a) ...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 18233, 198, 2, 1867, 318, 262, 4387, 6994, 5766, 286, 262, 1271, 10053, 5332, 1415, 2425, 21139, 5633, 198, 198, 2, 3862, 198, 2, 440, 7, 77, 8, 597, 1365, 4610, 3548, 198, 8818, 264, 12311, 7...
2.659193
223
<gh_stars>1-10 abstract type AbstractModelSet end # using CSV # using DataFrames """ WindFarmModelSet(wakedeficitmodel, wake_deflection_model, wake_combination_model, local_ti_model) Container for objects defining models to use in wind farm calculations # Arguments - `wake_defiict_model::AbstractWakeDeficitModel...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 397, 8709, 2099, 27741, 17633, 7248, 886, 198, 2, 1262, 44189, 198, 2, 1262, 6060, 35439, 198, 198, 37811, 198, 220, 220, 220, 3086, 48412, 17633, 7248, 7, 86, 4335, 891, 3628, 19849, 11, ...
2.519399
8,583
<gh_stars>10-100 """ SeisSort(in, out;<keyword arguments>) Sort a seis file using its header words # Arguments * `in`: input filename >> a text file with information about data extent, data and header file names; a binary file containing data and a binary file containing headers. * `out`: output filename # Keywo...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 37811, 198, 220, 220, 220, 1001, 271, 42758, 7, 259, 11, 503, 26, 27, 2539, 4775, 7159, 43734, 198, 198, 42758, 257, 384, 271, 2393, 1262, 663, 13639, 2456, 198, 198, 2, 20559, 2886, 198...
2.239437
1,278
<reponame>ethansaxenian/RosettaDecode using Printf, Distributions, IterTools newv(n::Int, p::Float64) = rand(Bernoulli(p), n) runs(v::Vector{Int}) = sum((a & ~b) for (a, b) in zip(v, IterTools.chain(v[2:end], v[1]))) mrd(n::Int, p::Float64) = runs(newv(n, p)) / n nrep = 500 for p in 0.1:0.2:1 lim = p * (1 - p) ...
[ 27, 7856, 261, 480, 29, 2788, 504, 897, 268, 666, 14, 35740, 15253, 10707, 1098, 198, 3500, 12578, 69, 11, 46567, 507, 11, 40806, 33637, 198, 198, 3605, 85, 7, 77, 3712, 5317, 11, 279, 3712, 43879, 2414, 8, 796, 43720, 7, 23927, 2...
1.867868
333
export discreteApprox!, discreteApprox, discreteNormalApprox, discreteNormalApprox! # ----------------------- objective functions for max entropy calcs -------------------------- function expΔTx!(tmpvec::Vector, ΔT::AbstractMatrix, x::AbstractVector) mul!(tmpvec, ΔT, x) tmpvec .= exp.(tmpvec) end # objective fun...
[ 39344, 28810, 4677, 13907, 28265, 28810, 4677, 13907, 11, 28810, 26447, 4677, 13907, 11, 28810, 26447, 4677, 13907, 0, 198, 198, 2, 41436, 6329, 9432, 5499, 329, 3509, 40709, 2386, 6359, 220, 22369, 438, 198, 198, 8818, 1033, 138, 242, ...
2.373108
2,246
mutable struct zmp_com_observer_state_t <: LCMType utime::Int64 com::SVector{2, Float64} comd::SVector{2, Float64} ground_plane_height::Float64 end @lcmtypesetup(zmp_com_observer_state_t)
[ 76, 18187, 2878, 1976, 3149, 62, 785, 62, 672, 15388, 62, 5219, 62, 83, 1279, 25, 22228, 44, 6030, 198, 220, 220, 220, 3384, 524, 3712, 5317, 2414, 198, 220, 220, 220, 401, 3712, 50, 38469, 90, 17, 11, 48436, 2414, 92, 198, 220, ...
2.204301
93
function save_data!(A::Array{T,1}, dset::HDF5Dataset, src_ind::AbstractRange{Int}, dest_ind::AbstractRange{Int}) where T dsel_id = HDF5.hyperslab(dset, src_ind) V = view(A, dest_ind) memtype = HDF5.datatype(A) memspace = HDF5.dataspace(V) HDF5.h5d_write(dset.id, memtype.id, memspace.id, dsel_id, dset.xfer, V)...
[ 8818, 3613, 62, 7890, 0, 7, 32, 3712, 19182, 90, 51, 11, 16, 5512, 288, 2617, 3712, 39, 8068, 20, 27354, 292, 316, 11, 12351, 62, 521, 3712, 23839, 17257, 90, 5317, 5512, 2244, 62, 521, 3712, 23839, 17257, 90, 5317, 30072, 810, 30...
2.128866
194
const DEBUG_ENABLED = Ref(false) const DEBUG_CALLBACK = Ref{Function}() @export struct GLDebugInfo <: Iterable type::String source::String message::String severity::String end function debug_message_callback( _source::GLenum, _type::GLenum, ::GLuint, _severity::GLenum, ::GLsizei, _m...
[ 9979, 16959, 62, 1677, 6242, 30465, 796, 6524, 7, 9562, 8, 198, 9979, 16959, 62, 34, 7036, 31098, 796, 6524, 90, 22203, 92, 3419, 198, 198, 31, 39344, 2878, 10188, 27509, 12360, 1279, 25, 40806, 540, 198, 220, 220, 2099, 3712, 10100, ...
2.23269
881
function sqlite3_errmsg() return ccall( (:sqlite3_errmsg, sqlite3_lib), Ptr{Uint8}, () ) end function sqlite3_errmsg(db::Ptr{Void}) @NULLCHECK db return ccall( (:sqlite3_errmsg, sqlite3_lib), Ptr{Uint8}, (Ptr{Void},), db ) end function sqlite3_open(file::AbstractString...
[ 198, 8818, 44161, 578, 18, 62, 8056, 19662, 3419, 198, 220, 220, 220, 1441, 269, 13345, 7, 357, 25, 25410, 578, 18, 62, 8056, 19662, 11, 44161, 578, 18, 62, 8019, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
2.01475
4,000
type Job cmd :: AbstractString jobid :: Int pbs_id :: Int end function ex(job) output = "$(job.pbs_id)-$(myid()-1).out" err = "$(job.pbs_id)-$(myid()-1).err" println("start $(job.jobid)-th job on process $(myid()-1).") open(io->println(io, "start $(job.jobid)-th job on process $(myid()-1)."...
[ 4906, 15768, 198, 220, 220, 220, 23991, 7904, 27741, 10100, 198, 220, 220, 220, 1693, 312, 7904, 2558, 198, 220, 220, 220, 279, 1443, 62, 312, 7904, 2558, 198, 437, 198, 198, 8818, 409, 7, 21858, 8, 198, 220, 220, 220, 5072, 796, ...
2.3
360
<reponame>johnnychen94/NiLang.jl export rot, plshift, prshift, arshift """ rot(a, b, θ) rotate variables `a` and `b` by an angle `θ` """ function rot(a, b, θ) s, c = sincos(θ) a*c-b*s, a*s+b*c end """ plshift(x, n) periodic left shift. """ plshift(x, n) = (x << n) | (x >> (sizeof(x)*8-n)) """ p...
[ 27, 7856, 261, 480, 29, 30686, 3281, 6607, 5824, 14, 34153, 43, 648, 13, 20362, 198, 39344, 5724, 11, 458, 30846, 11, 778, 30846, 11, 610, 30846, 198, 198, 37811, 198, 220, 220, 220, 5724, 7, 64, 11, 275, 11, 7377, 116, 8, 198, ...
1.945652
276
struct VolumePartsIter{ TM<:AbstractMatrix, TV<:AbstractVector, Tg <: AbstractVector, Tts<:AbstractVector, Texpand<:NamedTuple, T<:Real} <: AbstractVolumePartsIter{TM, TV, T} #parameters A::TM Ã::TM #factored A, used in regressions G::TM g::Tg #vector version by referene of G, sho...
[ 198, 198, 7249, 14701, 42670, 29993, 90, 198, 220, 220, 220, 21232, 27, 25, 23839, 46912, 11, 198, 220, 220, 220, 3195, 27, 25, 23839, 38469, 11, 198, 220, 220, 220, 309, 70, 1279, 25, 27741, 38469, 11, 198, 220, 220, 220, 309, 91...
2.066796
6,677
# =============================================================== # Discretize using the correction hull of the matrix exponential # =============================================================== """ CorrectionHull{EM} <: AbstractApproximationModel Discretization using the correction hull of the matrix exponenti...
[ 2, 46111, 4770, 25609, 855, 198, 2, 8444, 1186, 1096, 1262, 262, 17137, 23644, 286, 262, 17593, 39682, 198, 2, 46111, 4770, 25609, 855, 198, 198, 37811, 198, 220, 220, 220, 35074, 39, 724, 90, 3620, 92, 1279, 25, 27741, 4677, 13907, ...
2.388522
1,969
module PIPS_NLP # package code goes here end # module include("ParPipsNlp.jl") include("PipsNlp.jl")
[ 21412, 30434, 3705, 62, 45, 19930, 198, 198, 2, 5301, 2438, 2925, 994, 628, 198, 437, 1303, 8265, 198, 198, 17256, 7203, 10044, 47, 2419, 45, 34431, 13, 20362, 4943, 198, 17256, 7203, 47, 2419, 45, 34431, 13, 20362, 4943 ]
2.6
40
<reponame>Datseris/FractalDimension # %% Sensititivy to trajectory length using DrWatson @quickactivate :FractalDimension # uses DynamicalSystems, PyPlot include(srcdir("style.jl")) using DynamicalSystems, PyPlot # %% N = 1*10^5 systems = [:koch, :henon_chaotic] slabels = ["Koch", "Hénon"] qs = 2:4 Cmethod = "standard...
[ 27, 7856, 261, 480, 29, 35, 1381, 263, 271, 14, 37, 974, 282, 29271, 3004, 198, 2, 43313, 14173, 270, 270, 452, 88, 284, 22942, 4129, 198, 3500, 1583, 54, 13506, 198, 31, 24209, 39022, 1058, 37, 974, 282, 29271, 3004, 1303, 3544, ...
2.176623
770
<gh_stars>0 macro shared_fields_stanmodels() return esc(:( name::AbstractString; # Name of the Stan program model::AbstractString; # Stan language model program n_chains::Vector{Int64}; # Number of chains seed::StanBase.RandomSeed; # Seed section of cmd to ru...
[ 27, 456, 62, 30783, 29, 15, 198, 20285, 305, 4888, 62, 25747, 62, 14192, 27530, 3419, 198, 220, 1441, 3671, 7, 37498, 198, 220, 220, 220, 1438, 3712, 23839, 10100, 26, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22...
2.535135
555
@ms include("solvers/annealing.jl") function loop_annealing(args) instances = [ # "02", # "03", # "05", # "08", # "09", # "10", # "11", "12", # "13" ] println("Instance n° & Cost & Time") for instance_name in instances inst...
[ 31, 907, 2291, 7203, 34453, 690, 14, 21952, 4272, 13, 20362, 4943, 198, 198, 8818, 9052, 62, 21952, 4272, 7, 22046, 8, 198, 220, 220, 220, 10245, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 366, 2999, 1600, 198, 220, 2...
1.893855
716
# Julia 0.6 function singleNumber(vector) reduce(xor, vector) end a = [1,1,2,3,3] println(singleNumber(a))
[ 2, 22300, 657, 13, 21, 198, 8818, 2060, 15057, 7, 31364, 8, 198, 197, 445, 7234, 7, 87, 273, 11, 15879, 8, 198, 437, 198, 198, 64, 796, 685, 16, 11, 16, 11, 17, 11, 18, 11, 18, 60, 198, 35235, 7, 29762, 15057, 7, 64, 4008, ...
2.270833
48
<gh_stars>1-10 using TimeSeries, MarketData, Base.Dates FactCheck.setstyle(:compact) FactCheck.onlystats(true) facts("collapse operations") do context("collapse squishes correctly") do @fact collapse(cl, week, first).values[2] --> 97.75 @fact collapse(cl, week, first).timestamp[2] --> Date(...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 3500, 3862, 27996, 11, 220, 5991, 6601, 11, 7308, 13, 35, 689, 198, 29054, 9787, 13, 2617, 7635, 7, 25, 5589, 529, 8, 198, 29054, 9787, 13, 8807, 34242, 7, 7942, 8, 198, 198, 37473, 7203...
2.091514
4,360
export FoldSet, FOLD_TRAIN, FOLD_TEST, foldset_match, foldset_withhold, check_fold_match ######################################### const FOLD_TRAIN = 1 const FOLD_TEST = 2 immutable FoldSet assignment::Vector{Int} # assignment[i] = j means the ith element is assigned to fold j fold...
[ 39344, 198, 220, 220, 220, 39957, 7248, 11, 628, 220, 220, 220, 376, 15173, 62, 51, 3861, 1268, 11, 198, 220, 220, 220, 376, 15173, 62, 51, 6465, 11, 628, 220, 220, 220, 5591, 2617, 62, 15699, 11, 198, 220, 220, 220, 5591, 2617, ...
2.640052
764
<reponame>byuflowlab/AircraftSystems #=############################################################################################## Filename: solve_rotor.jl Author: <NAME> Contact: <EMAIL> README: define an `Action` object to solve a CCBlade rotor =#####################################################################...
[ 27, 7856, 261, 480, 29, 1525, 84, 2704, 4883, 397, 14, 32, 27002, 11964, 82, 198, 2, 28, 29113, 29113, 14468, 7804, 4242, 2235, 198, 35063, 25, 8494, 62, 10599, 273, 13, 20362, 198, 13838, 25, 1279, 20608, 29, 198, 17829, 25, 1279, ...
2.941134
1,376
module SpecialMatrices import Base: getindex, size, * struct JordanBlock{T<:Number} <: AbstractMatrix{T} blocks::Vector{Int} diag::T end size(A::JordanBlock) = Tuple([1; 1] * sum(A.blocks)) function getindex(A::JordanBlock{T}, i::Int, j::Int) where T <: Number if i == j A.diag elseif i > j || j > i + ...
[ 198, 21412, 6093, 19044, 45977, 198, 198, 11748, 7308, 25, 220, 651, 9630, 11, 2546, 11, 1635, 198, 198, 7249, 8078, 12235, 90, 51, 27, 25, 15057, 92, 1279, 25, 27741, 46912, 90, 51, 92, 198, 220, 7021, 3712, 38469, 90, 5317, 92, ...
2.148867
309
<gh_stars>0 #-------------------------------------------------------------------- # DNSS.jl # Soham 03-2022 #-------------------------------------------------------------------- module DNSS using NLsolve, Random, LinearAlgebra, Printf, Distributed using PyPlot, LaTeXStrings export Manifold, Space, Produc...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 10097, 650, 198, 2, 45080, 5432, 13, 20362, 198, 2, 311, 1219, 321, 7643, 12, 1238, 1828, 198, 2, 10097, 650, 198, 198, 21412, 45080, 5432, 628, 220, 220, 220, 1262, 22879, 82, 6442, 11, 14534, ...
3.01519
395
""" ``` plot_scenario(m, var, class, scen; title = "", kwargs...) plot_scenario(m, vars, class, scen; untrans = false, fourquarter = false, plotroot = figurespath(m, \"scenarios\"), titles = [], tick_size = 1, kwargs...) ``` Plot `var` or `vars` *in deviations from baseline* for the alternative scenario speci...
[ 37811, 198, 15506, 63, 198, 29487, 62, 1416, 39055, 7, 76, 11, 1401, 11, 1398, 11, 4408, 26, 3670, 796, 366, 1600, 479, 86, 22046, 23029, 198, 198, 29487, 62, 1416, 39055, 7, 76, 11, 410, 945, 11, 1398, 11, 4408, 26, 1418, 26084, ...
2.249321
1,472
<filename>src/ICD10Utilities.jl module ICD10Utilities using CSV, TypedTables, Dates, CategoricalArrays, Missings using FileIO import Base: isless, show, (==) export ICDOPTS export AbstractICD10 export ICD10 export ICD10AM, ACHI export ICD10CA, ICD10CM, ICD10GM export ICD10CM export ICD10AMAge export icd3 export isv...
[ 27, 34345, 29, 10677, 14, 2149, 35, 940, 18274, 2410, 13, 20362, 198, 21412, 314, 8610, 940, 18274, 2410, 198, 198, 3500, 44189, 11, 17134, 276, 51, 2977, 11, 44712, 11, 327, 2397, 12409, 3163, 20477, 11, 4544, 654, 198, 3500, 9220, ...
2.518681
455