content
stringlengths
6
1.03M
input_ids
listlengths
4
535k
ratio_char_token
float64
0.68
8.61
token_count
int64
4
535k
function Δt(ts::AbstractVector{<:Date}) @assert length(ts) >= 3 "time series must have a length >= 3" ts1 = ts[1] ts2 = ts[2] ts3 = ts[3] dy = year(ts[2])-year(ts[1]) dm = month(ts[2])-month(ts[1]) dd = day(ts[2])-day(ts[1]) same_day = day(ts1) == day(ts2) == day(ts3) same_m...
[ 8818, 37455, 83, 7, 912, 3712, 23839, 38469, 90, 27, 25, 10430, 30072, 220, 628, 220, 220, 220, 2488, 30493, 4129, 7, 912, 8, 18189, 513, 366, 2435, 2168, 1276, 423, 257, 4129, 18189, 513, 1, 198, 220, 220, 220, 220, 198, 220, 220...
2.064918
1,525
# This file is auto-generated by AWSMetadata.jl using AWS using AWS.AWSServices: kms using AWS.Compat using AWS.UUIDs """ cancel_key_deletion(key_id) cancel_key_deletion(key_id, params::Dict{String,<:Any}) Cancels the deletion of a customer master key (CMK). When this operation succeeds, the key state of the ...
[ 2, 770, 2393, 318, 8295, 12, 27568, 416, 30865, 9171, 14706, 13, 20362, 198, 3500, 30865, 198, 3500, 30865, 13, 12298, 5432, 712, 1063, 25, 479, 907, 198, 3500, 30865, 13, 40073, 198, 3500, 30865, 13, 52, 27586, 82, 198, 198, 37811, ...
3.585954
42,261
<filename>src/videotool.jl<gh_stars>1-10 """ Takes `frames`, which is supposed to be an array of images, saves them as png's at path and then creates an webm video from that with the name `name` """ function create_video(frames::Vector, name, screencap_folder, resample_steps=0, remove_destination=true) println("sav...
[ 27, 34345, 29, 10677, 14, 85, 485, 313, 970, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 37811, 198, 51, 1124, 4600, 37805, 47671, 543, 318, 4385, 284, 307, 281, 7177, 286, 4263, 11, 198, 82, 3080, 606, 355, 279, 782, 3...
2.081937
1,074
# License for this file: MIT (expat) # Copyright 2017-2018, DLR Institute of System Dynamics and Control # # This file is part of module # Modia3D.DLR_Visualization (Modia3D/renderer/DLR_Visualization/_module.jl) # getVisualElement(data) = data getVisualElement(data::Solids.Solid) = data.geo # Get fu...
[ 2, 13789, 329, 428, 2393, 25, 17168, 357, 1069, 8071, 8, 198, 2, 15069, 2177, 12, 7908, 11, 23641, 49, 5136, 286, 4482, 33806, 290, 6779, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 8265, 198, 2, 220, 220, 3401, 544, 18, 35, 13, ...
2.928277
1,213
<gh_stars>0 using SafeTestsets using Test @testset "Common Utilities " begin @safetestset "States" begin include("test_states.jl") end end @testset "Echo State Networks" begin @safetestset "ESN Input Layers" begin include("esn/test_input_layers.jl") end @safetestset "ESN Reservoirs" begin include("esn/t...
[ 27, 456, 62, 30783, 29, 15, 198, 3500, 19978, 51, 3558, 1039, 198, 3500, 6208, 198, 198, 31, 9288, 2617, 366, 17227, 41086, 220, 220, 366, 2221, 198, 220, 220, 220, 2488, 49585, 316, 395, 2617, 366, 42237, 1, 2221, 2291, 7203, 9288,...
2.611987
317
<filename>test/quadratures.jl @testset "quadratures" begin for T in (Float32, Float64, BigFloat) x, w = legendregauss(T, 1) @test iszero(x) @test w ≈ [2one(T)] x, w = legendregauss(T, 1, OneDimensionalNodes.LeftEndPoint()) @test x ≈ [-one(T)] @test w ≈ [2one(T)] ...
[ 27, 34345, 29, 9288, 14, 421, 41909, 6691, 13, 20362, 198, 31, 9288, 2617, 366, 421, 41909, 6691, 1, 2221, 198, 220, 220, 220, 329, 309, 287, 357, 43879, 2624, 11, 48436, 2414, 11, 4403, 43879, 8, 198, 220, 220, 220, 220, 220, 220...
1.976042
960
<filename>examples/deformation_linear/statics/2-d/LE1NAFEMS_examples.jl module LE1NAFEMS_examples using FinEtools using FinEtools.MeshExportModule using PyCall function LE1NAFEMS() println("LE1NAFEMS, plane stress.") t0 = time() E = 210e3*phun("MEGA*PA");# 210e3 MPa nu = 0.3; p = 10*phun("MEGA...
[ 27, 34345, 29, 1069, 12629, 14, 2934, 1161, 62, 29127, 14, 14269, 873, 14, 17, 12, 67, 14, 2538, 16, 4535, 37, 39201, 62, 1069, 12629, 13, 20362, 198, 21412, 12509, 16, 4535, 37, 39201, 62, 1069, 12629, 198, 3500, 4463, 36, 31391, ...
1.837843
5,174
using OrderedCollections abstract type PlottingRecipe end Plots.plot(pr::PlottingRecipe, args...) = plot!(plot(), pr, args...) # ============================================================================= # hospitalizations struct ObservationsPlottingRecipe{Tsd, Ted, To, Te, Tl} <: PlottingRecipe startdate ::...
[ 3500, 14230, 1068, 5216, 26448, 198, 198, 397, 8709, 2099, 28114, 889, 37523, 886, 198, 198, 3646, 1747, 13, 29487, 7, 1050, 3712, 43328, 889, 37523, 11, 26498, 23029, 796, 7110, 0, 7, 29487, 22784, 778, 11, 26498, 23029, 198, 198, 2,...
2.424076
6,355
<filename>deps/build.jl cd(dirname(@__FILE__)) download("https://github.com/vermaseren/form/releases/download/v4.1-20131025/form-4.1-x86_64-linux.tar.gz", "./form-4.1-x86_64-linux.tar.gz") run(`tar xzvf form-4.1-x86_64-linux.tar.gz`) run(`mv form-4.1-x86_64-linux/tform bin/`) run(`mv form-4.1-x86_64-linux/form bin/`) r...
[ 27, 34345, 29, 10378, 82, 14, 11249, 13, 20362, 198, 10210, 7, 15908, 3672, 7, 31, 834, 25664, 834, 4008, 198, 15002, 7203, 5450, 1378, 12567, 13, 785, 14, 332, 5356, 14226, 14, 687, 14, 260, 29329, 14, 15002, 14, 85, 19, 13, 16, ...
1.912621
206
using DataDeps register(DataDep( "lpga-2008", "http://www.stat.ufl.edu/~winner/data/lpga2008.txt", "http://www.stat.ufl.edu/~winner/data/lpga2008.dat", "3d631844fb4b13f7d1f9205005d5ef3687a383b515a39c027e41e5124883ed14", post_fetch_method=(path -> begin # IDs have spaces in them which is the delimiter ...
[ 3500, 6060, 12156, 82, 198, 198, 30238, 7, 6601, 12156, 7, 198, 220, 366, 34431, 4908, 12, 11528, 1600, 198, 220, 366, 4023, 1378, 2503, 13, 14269, 13, 84, 2704, 13, 15532, 14, 93, 39791, 14, 7890, 14, 34431, 4908, 11528, 13, 14116,...
2.097222
288
<filename>src/pyplot.jl #=- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Some Functions for Plotting via Matplotlib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=# export set_rcParams!, set_ticklabels!, save_pdf, sa...
[ 27, 34345, 29, 10677, 14, 9078, 29487, 13, 20362, 198, 2, 10779, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532...
2.093941
2,129
<filename>dirichlet_process_mixture_model/nign.jl<gh_stars>1-10 type NIGN N::Int sum_x::Float64 sum_x_sq::Float64 function NIGN() new(0, 0.0, 0.0) end end function incorporate!(comp::NIGN, x::Float64) comp.N += 1 comp.sum_x += x comp.sum_x_sq += x*x end function unincorporate!(...
[ 27, 34345, 29, 15908, 488, 1616, 62, 14681, 62, 76, 9602, 62, 19849, 14, 77, 570, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 4906, 399, 16284, 198, 220, 220, 220, 399, 3712, 5317, 198, 220, 220, 220, 2160, 62, 87, 3712...
2.006263
958
using FluxArchitectures using Test if Flux.CUDA.functional() @info "Testing GPU support" else @warn "CUDA unavailable, not testing GPU support" end @testset "DARNN" begin include("DARNN.jl") end @testset "DSANet" begin include("DSANet.jl") end @testset "LSTnet" begin include("LSTnet.jl") end @t...
[ 3500, 1610, 2821, 19895, 5712, 942, 198, 3500, 6208, 198, 198, 361, 1610, 2821, 13, 43633, 5631, 13, 45124, 3419, 198, 220, 220, 220, 2488, 10951, 366, 44154, 11362, 1104, 1, 198, 17772, 198, 220, 220, 220, 2488, 40539, 366, 43633, 56...
2.427861
201
# Uncomment the following # line to run this example # with more julia workers: addprocs(4) @everywhere begin using StochasticSearch function tour_cost(x::Configuration, parameters::Dict{Symbol, Any}) result = float(readall(`./tour_cost $(x["Tour"].value)`)) result end end tour = ["1"] f...
[ 2, 791, 23893, 262, 1708, 198, 2, 1627, 284, 1057, 428, 1672, 198, 2, 351, 517, 474, 43640, 3259, 25, 198, 2860, 1676, 6359, 7, 19, 8, 198, 198, 31, 16833, 3003, 2221, 198, 220, 220, 220, 1262, 520, 5374, 3477, 18243, 628, 220, ...
2.210626
527
# 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 = "RADAR5Builder" version = v"0.0.2" # Collection of sources required to build RADAR5Builder sources = [ "http://www.unige.ch/~hairer/radar5-v2.1.tar" => ...
[ 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.378151
833
<reponame>KlausC/Multroot.jl function uhlig06() # # test polynomial used by <NAME> # p = [1.0;0;0;0;0;0;0;0;-1]; z = [-1.00000000000000 -0.70710678118655 + 0.70710678118655im -0.70710678118655 - 0.70710678118655im 0 + 1.00000000000000im 0 - 1.0000000000...
[ 27, 7856, 261, 480, 29, 42, 38024, 34, 14, 15205, 15763, 13, 20362, 198, 8818, 21480, 4604, 3312, 3419, 198, 2, 198, 2, 220, 1332, 745, 6213, 49070, 973, 416, 1279, 20608, 29, 198, 2, 198, 220, 220, 220, 279, 796, 685, 16, 13, 1...
1.758503
294
@testset "Metadata" begin sample_text1 = "This is a string" sample_text2 = "This is also a string" sd1 = StringDocument(sample_text1) sd2 = StringDocument(sample_text2) crps = Corpus([sd1, sd2]) # Single document metadata getters @test isequal(StringAnalysis.name(sd1), "") @test isequa...
[ 31, 9288, 2617, 366, 9171, 14706, 1, 2221, 198, 220, 220, 220, 6291, 62, 5239, 16, 796, 366, 1212, 318, 257, 4731, 1, 198, 220, 220, 220, 6291, 62, 5239, 17, 796, 366, 1212, 318, 635, 257, 4731, 1, 628, 220, 220, 220, 45647, 16,...
2.911123
1,924
<reponame>JuliaPackageMirrors/Levenshtein.jl<filename>test/runtests.jl using Levenshtein using Base.Test using Compat function levenshtein_base(a::AbstractString, b::AbstractString, deletion_cost::Real, insertion_cost::Real, substitution_cost::Real) local costs::Array{Real, 2} = zeros(Real, length(a) + 1, length(b...
[ 27, 7856, 261, 480, 29, 16980, 544, 27813, 27453, 5965, 14, 3123, 574, 1477, 22006, 13, 20362, 27, 34345, 29, 9288, 14, 81, 2797, 3558, 13, 20362, 198, 3500, 1004, 574, 1477, 22006, 198, 3500, 7308, 13, 14402, 198, 3500, 3082, 265, ...
2.387603
1,210
value(x) = x promote_u0(u0,p,t0) = u0 promote_tspan(u0,p,tspan,prob,kwargs) = tspan get_tmp(x) = nothing isdistribution(u0) = false function SciMLBase.tmap(args...) error("Zygote must be added to differentiate Zygote? If you see this error, report it.") end function __init__() @require Measurements="eff96d63-e80a...
[ 8367, 7, 87, 8, 796, 2124, 198, 16963, 1258, 62, 84, 15, 7, 84, 15, 11, 79, 11, 83, 15, 8, 796, 334, 15, 198, 16963, 1258, 62, 912, 6839, 7, 84, 15, 11, 79, 11, 912, 6839, 11, 1676, 65, 11, 46265, 22046, 8, 796, 256, 12626...
2.455892
1,485
<filename>src/by_reference_doc/artist.jl<gh_stars>1-10 ## https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artist """ artist_get(artist_id) **Summary**: Get Spotify catalog information for a single artist identified by their unique Spotify ID. # Arguments - `artist_id` : The Spo...
[ 27, 34345, 29, 10677, 14, 1525, 62, 35790, 62, 15390, 14, 49016, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 2235, 3740, 1378, 16244, 263, 13, 20485, 1958, 13, 785, 14, 22897, 341, 14, 12384, 12, 15042, 14, 35790, 31113, ...
2.61008
1,508
<filename>src/generated/includes.jl<gh_stars>0 include("DeterministicInternal.jl") include("Deterministic.jl") include("ProbabilisticInternal.jl") include("Probabilistic.jl") include("ScenarioBasedInternal.jl") include("ScenarioBased.jl") include("PiecewiseFunction.jl") include("PiecewiseFunctionInternal.jl") export g...
[ 27, 34345, 29, 10677, 14, 27568, 14, 42813, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 17256, 7203, 35, 2357, 49228, 37693, 13, 20362, 4943, 198, 17256, 7203, 35, 2357, 49228, 13, 20362, 4943, 198, 17256, 7203, 2964, 65, 14991, 2569,...
3.220339
236
<reponame>guilemieux/ParseTorrent.jl<gh_stars>0 using Test using ParseTorrent: pieces2hashes, parsetorrent @testset "parsetorrent with a file" begin @test parsetorrent(read("torrents/bitlove-intro.torrent")) == Dict{Any,Any}( "infohash" => "4cb67059ed6bd08362da625b3ae77f6f4a075705", "announce" => "...
[ 27, 7856, 261, 480, 29, 5162, 576, 44871, 2821, 14, 10044, 325, 39286, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 3500, 6208, 198, 3500, 2547, 325, 39286, 25, 5207, 17, 71, 7465, 11, 13544, 316, 273, 1156, 198, 198, 31, 9288, 261...
1.617949
1,170
<reponame>tmigot/ARCTR.jl using Pkg; Pkg.activate("."); using JLD2, Plots, SolverBenchmark name = "2022-04-02_ARCqKOp10204_ARCqKOp10201_ARCqKOp102005_ARCqKOp10203_ARCqKOp10202_cutest_277_1000000" @load "$name.jld2" stats #= stats1 = copy(stats) name = "2022-03-21_trunk_tron_ipopt_lbfgs_cutest_277_1000000" @load "$name...
[ 27, 7856, 261, 480, 29, 17209, 328, 313, 14, 1503, 4177, 49, 13, 20362, 198, 3500, 350, 10025, 26, 198, 47, 10025, 13, 39022, 7203, 526, 1776, 198, 3500, 449, 11163, 17, 11, 1345, 1747, 11, 4294, 332, 44199, 4102, 198, 198, 3672, ...
1.806541
1,437
<reponame>UnofficialJuliaMirror/LocalFilters.jl-085fde7c-5f94-55e4-8448-8bbb5db6dde9 # # LocalFilters.jl -- # # Local filters for Julia arrays. # #------------------------------------------------------------------------------ # # This file is part of the `LocalFilters.jl` package licensed under the MIT # "Expat" Licens...
[ 27, 7856, 261, 480, 29, 3118, 16841, 16980, 544, 27453, 1472, 14, 14565, 11928, 1010, 13, 20362, 12, 2919, 20, 69, 2934, 22, 66, 12, 20, 69, 5824, 12, 2816, 68, 19, 12, 23, 31115, 12, 23, 11848, 65, 20, 9945, 21, 1860, 68, 24, ...
2.659539
608
using Pkg Pkg.activate(joinpath(@__DIR__,"../..")) include(joinpath(@__DIR__,"model.jl")) include(joinpath(@__DIR__,"plotting.jl")) include(joinpath(@__DIR__,"utilities.jl")) using ITensors using ITensors.HDF5 # Load the results in ## NOTE: NEED TO CHANGE UTILS BACK TO TAKE IN PHONON ARGUMENTS TO PARAMS ## #loadpath...
[ 3500, 350, 10025, 198, 47, 10025, 13, 39022, 7, 22179, 6978, 7, 31, 834, 34720, 834, 553, 40720, 492, 48774, 198, 17256, 7, 22179, 6978, 7, 31, 834, 34720, 834, 553, 19849, 13, 20362, 48774, 198, 17256, 7, 22179, 6978, 7, 31, 834, ...
2.418546
399
using FactCheck, Mongo function with_test_db(f) client = MongoClient() dbname = randstring(15) try f(client, dbname) finally run_command(client, dbname, { "dropDatabase" => 1 }) end end function itr_to_arr(itr) arr = {} for el in itr push!(arr, el) end arr end facts("...
[ 3500, 19020, 9787, 11, 42591, 198, 198, 8818, 351, 62, 9288, 62, 9945, 7, 69, 8, 198, 220, 220, 220, 5456, 796, 42591, 11792, 3419, 198, 220, 220, 220, 20613, 3672, 796, 43720, 8841, 7, 1314, 8, 628, 220, 220, 220, 1949, 198, 220,...
2.049563
1,029
module fixed_parameters tick_second_rate = 1 coord_meter_rate = 1 # Basic window_size = (16, 7) radius_with_masks = 0.4*coord_meter_rate radius_without_masks = 1.5*coord_meter_rate move_random_rate = 0.2 move_speed = (coord_meter_rate*1.5)/tick_second_rate indoor_speed...
[ 21412, 5969, 62, 17143, 7307, 201, 198, 220, 220, 220, 4378, 62, 12227, 62, 4873, 796, 352, 201, 198, 220, 220, 220, 6349, 62, 27231, 62, 4873, 796, 352, 201, 198, 201, 198, 220, 220, 220, 1303, 14392, 201, 198, 220, 220, 220, 432...
2.14791
1,244
<filename>test/api/vertex.jl @testset "Sugar" begin struct ScaleByTwo f end (s::ScaleByTwo)(x...) = 2s.f(x...) @testset "Create input" begin @test issame(inputvertex("input", 5), InputSizeVertex("input", 5)) end @testset "Create immutable" begin v = immutablevertex(Mat...
[ 27, 34345, 29, 9288, 14, 15042, 14, 332, 16886, 13, 20362, 198, 31, 9288, 2617, 366, 50, 35652, 1, 2221, 628, 220, 220, 220, 2878, 21589, 3886, 7571, 198, 220, 220, 220, 220, 220, 220, 220, 277, 198, 220, 220, 220, 886, 198, 220, ...
1.893244
3,597
using YAML using DataStructures using FileIO # Functions for parsing and writing dsl files export parse_dsl, parse_dsl_files, generate_dsl_files # Define compatible DSL file version number, which must match when parsed. const DSL_VERSION = VersionNumber("0.4.0") ######################################################...
[ 3500, 575, 2390, 43, 198, 3500, 6060, 44909, 942, 198, 3500, 9220, 9399, 198, 198, 2, 40480, 329, 32096, 290, 3597, 288, 6649, 3696, 198, 39344, 21136, 62, 67, 6649, 11, 21136, 62, 67, 6649, 62, 16624, 11, 7716, 62, 67, 6649, 62, ...
2.678625
2,007
@testset "Change bounds" begin cp = test_LP() change_bounds!(cp, [3; 1], xl = [-10.0; -20], xu = [10.0; 20]) @test cp.xl == [-20; 1; -10] @test cp.xu == [20; 1; 10] change_bounds!( cp, ["gibberish1"; "r3"; "r1"; "gibberish2"], xl = [0; -30.0; -40; 0], xu = [0; 30.0; 4...
[ 31, 9288, 2617, 366, 19400, 22303, 1, 2221, 198, 220, 220, 220, 31396, 796, 1332, 62, 19930, 3419, 198, 220, 220, 220, 1487, 62, 65, 3733, 0, 7, 13155, 11, 685, 18, 26, 352, 4357, 2124, 75, 796, 25915, 940, 13, 15, 26, 532, 1238...
1.798972
3,308
<reponame>t-bltg/UnicodePlots.jl struct FiveNumberSummary minimum::Float64 lower_quartile::Float64 median::Float64 upper_quartile::Float64 maximum::Float64 end mutable struct BoxplotGraphics{R<:Number} <: GraphicsArea data::Vector{FiveNumberSummary} color::ColorType char_width::Int ...
[ 27, 7856, 261, 480, 29, 83, 12, 2436, 25297, 14, 3118, 291, 1098, 3646, 1747, 13, 20362, 198, 7249, 10579, 15057, 22093, 198, 220, 220, 220, 5288, 3712, 43879, 2414, 198, 220, 220, 220, 2793, 62, 36008, 576, 3712, 43879, 2414, 198, ...
2.166772
1,583
using Gridap u_2d(x) = x[1]+x[2] u_3d(x) = x[1]+x[2]+x[3] domain_2d = (0,1,0,1) domain_3d = (0,1,0,1,0,1) cells_2d = (4,4) cells_3d = (4,4,4) for cells in (cells_2d,cells_3d) domain = length(cells) == 3 ? domain_3d : domain_2d u = length(cells) == 3 ? u_3d : u_2d model = CartesianDiscreteModel(domain,cells) ...
[ 198, 3500, 24846, 499, 198, 198, 84, 62, 17, 67, 7, 87, 8, 796, 2124, 58, 16, 48688, 87, 58, 17, 60, 198, 84, 62, 18, 67, 7, 87, 8, 796, 2124, 58, 16, 48688, 87, 58, 17, 48688, 87, 58, 18, 60, 198, 27830, 62, 17, 67, 796...
1.847507
341
<gh_stars>1-10 """ # PSFModels Statistical models for constructing point-spread functions (PSFs). ## Models The following models are currently implemented * [`gaussian`](@ref)/[`normal`](@ref) * [`airydisk`](@ref) * [`moffat`](@ref) ## Parameters In general, the PSFs have a position, a full-width at half-maximum (...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 37811, 198, 2, 6599, 37, 5841, 1424, 198, 198, 17126, 19929, 4981, 329, 30580, 966, 12, 43639, 5499, 357, 3705, 42388, 737, 198, 198, 2235, 32329, 198, 198, 464, 1708, 4981, 389, 3058, 9177,...
2.473549
2,344
# Parts of this code were taken / derived from Graphs.jl. See LICENSE for # licensing details. """ struct FloydWarshallState{T, U} An [`AbstractPathState`](@ref) designed for Floyd-Warshall shortest-paths calculations. """ struct FloydWarshallState{T,U<:Integer} <: AbstractPathState dists::Matrix{T} pare...
[ 2, 22349, 286, 428, 2438, 547, 2077, 1220, 10944, 422, 29681, 82, 13, 20362, 13, 4091, 38559, 24290, 329, 198, 2, 15665, 3307, 13, 628, 198, 37811, 198, 220, 220, 220, 2878, 21150, 54, 5406, 439, 9012, 90, 51, 11, 471, 92, 198, 19...
2.082808
1,268
using Test using LinearAlgebra using Random using RandomExtensions import Hecke.AbstractAlgebra include(joinpath(pathof(AbstractAlgebra), "..", "..", "test", "Rings-conformance-tests.jl")) import Hecke: mul! const rng = MersenneTwister() const rand_seed = rand(UInt128) # tests if rand(rng, args...) gives reproduc...
[ 3500, 6208, 198, 198, 3500, 44800, 2348, 29230, 198, 198, 3500, 14534, 198, 3500, 14534, 11627, 5736, 198, 198, 11748, 679, 66, 365, 13, 23839, 2348, 29230, 198, 17256, 7, 22179, 6978, 7, 6978, 1659, 7, 23839, 2348, 29230, 828, 366, 4...
2.56875
320
""" mutable struct Replica{AS<:AbstractSampler} Replica type for replica exchange Monte Carlo. A Sunny sampler type must be provided during construction. """ mutable struct Replica{AS <: AbstractSampler} rank::Int64 # MPI rank of sampler is ∈ [0, N_ranks-1] N_ranks::Int64 # Total numb...
[ 37811, 220, 198, 220, 220, 220, 4517, 540, 2878, 18407, 3970, 90, 1921, 27, 25, 23839, 16305, 20053, 92, 198, 198, 39232, 3970, 2099, 329, 30069, 5163, 22489, 40089, 13, 317, 32241, 6072, 20053, 2099, 1276, 198, 1350, 2810, 1141, 5103, ...
2.18425
9,308
<reponame>lsterzinger/RAMS.jl const cp = 1004.0 const R = 287.0 const p0 = 1000.0 """ temperature(theta, exner; celsius=false) Returns temperature given potential temperature (`THETA` in RAMS) and the exner function * c_p (`PI` in RAMS). Specify `celsius=true` for celsius. """ function temperature(theta, exner; c...
[ 27, 7856, 261, 480, 29, 75, 1706, 89, 3889, 14, 24115, 50, 13, 20362, 198, 9979, 31396, 796, 1802, 19, 13, 15, 198, 9979, 371, 796, 38721, 13, 15, 198, 9979, 279, 15, 796, 8576, 13, 15, 198, 198, 37811, 198, 220, 220, 220, 5951,...
2.16416
798
using Resonance omni, tps = startup(; dfs = [:omni, :tps]) subtpset = collect(zip(omni.subject, omni.timepoint)) subj = @chain tps begin groupby(:subject) transform!( nrow => :n_timepoints, :cogScore => ByRow(!ismissing) => :has_cogScore, AsTable(r"subject|timepoint"i) => ByRow(s -> be...
[ 3500, 44783, 590, 198, 296, 8461, 11, 256, 862, 796, 13693, 7, 26, 288, 9501, 796, 685, 25, 296, 8461, 11, 1058, 83, 862, 12962, 198, 198, 7266, 83, 862, 316, 796, 2824, 7, 13344, 7, 296, 8461, 13, 32796, 11, 39030, 8461, 13, 24...
2.088221
6,019
# Plotting examples # ================= # ## Plotters # All plot functions in GridVisualize.jl have a `Plotter` keyword argument # which defaults to `nothing`. This allows to pass a module as plotting backend # without creating a dependency. Fully supported are `PyPlot`, `GLMakie` and `PlutoVista`. # `WGLMakie` a...
[ 198, 2, 28114, 889, 6096, 198, 2, 36658, 198, 2, 22492, 28114, 1010, 198, 2, 220, 1439, 7110, 5499, 287, 24846, 36259, 1096, 13, 20362, 423, 257, 4600, 43328, 353, 63, 21179, 4578, 198, 2, 220, 543, 26235, 284, 4600, 22366, 44646, 2...
2.487506
1,961
#!/usr/bin/env julia export pe9 pe9(n::Integer=1000)=[a*b*c for a in 1:n, b in 1:n, c in 1:n if a^2+b^2==c^2 && a+b+c==n && a<b<c]|>first if !haskey(ENV,"PROJECT_EULER_WITHOUT_RESULT") pe9()|>print end
[ 2, 48443, 14629, 14, 8800, 14, 24330, 474, 43640, 198, 198, 39344, 613, 24, 198, 198, 431, 24, 7, 77, 3712, 46541, 28, 12825, 8, 41888, 64, 9, 65, 9, 66, 329, 257, 287, 352, 25, 77, 11, 275, 287, 352, 25, 77, 11, 269, 287, 3...
1.801724
116
<filename>src/oldstuff/setvalue!.jl function setvalue!(value,thisseq,h,x,lossIDX,target,Tmax,W,H1) H=length(value[h[1]]) for tind=1:Tmax value[h[tind]]=ones(H,1)/H1 end T=length(thisseq) for tind=1:Tmax-length(thisseq) value[x[t...
[ 27, 34345, 29, 10677, 14, 727, 41094, 14, 2617, 8367, 43179, 20362, 198, 220, 2163, 900, 8367, 0, 7, 8367, 11, 5661, 41068, 11, 71, 11, 87, 11, 22462, 2389, 55, 11, 16793, 11, 51, 9806, 11, 54, 11, 39, 16, 8, 198, 220, 220, 22...
1.61982
555
<filename>src/MultiRegion/multi_region_boundary_conditions.jl using Oceananigans: instantiated_location using Oceananigans.Architectures: arch_array, device_event, device_copy_to! using Oceananigans.Operators: assumed_field_location using Oceananigans.Fields: reduced_dimensions using Oceananigans.BoundaryConditions: ...
[ 27, 34345, 29, 10677, 14, 29800, 47371, 14, 41684, 62, 36996, 62, 7784, 560, 62, 17561, 1756, 13, 20362, 198, 3500, 10692, 272, 34090, 25, 9113, 12931, 62, 24886, 198, 3500, 10692, 272, 34090, 13, 19895, 5712, 942, 25, 3934, 62, 18747...
2.164254
4,974
using CmdStan, Turing, ContinuousBenchmarks #using Mamba: describe include(joinpath(ContinuousBenchmarks.STAN_MODELS_DIR, "binormal-stan.model.jl")) global stanmodel, rc, sim1, sim, stan_time # stanmodel = Stanmodel(name="binormal", model=binorm, Sample(save_warmup=true)); stanmodel = Stanmodel(Sample(algorithm=CmdS...
[ 3500, 327, 9132, 32140, 11, 39141, 11, 45012, 44199, 14306, 198, 198, 2, 3500, 337, 31842, 25, 6901, 198, 198, 17256, 7, 22179, 6978, 7, 17875, 5623, 44199, 14306, 13, 2257, 1565, 62, 33365, 37142, 62, 34720, 11, 366, 8800, 6636, 12, ...
2.523649
296
<gh_stars>1-10 function dmrg_x_solver(PH, t, psi0; kwargs...) H = contract(PH, ITensor(1.0)) D, U = eigen(H; ishermitian=true) u = uniqueind(U, H) max_overlap, max_ind = findmax(abs, array(psi0 * U)) U_max = U * dag(onehot(u => max_ind)) return U_max, nothing end function dmrg_x(PH, psi0::MPS; reverse_step...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 8818, 288, 76, 41345, 62, 87, 62, 82, 14375, 7, 11909, 11, 256, 11, 46231, 15, 26, 479, 86, 22046, 23029, 198, 220, 367, 796, 2775, 7, 11909, 11, 7283, 22854, 7, 16, 13, 15, 4008, 198,...
2.198953
191
# This file was generated, do not modify it. # hide X = coerce(X, autotype(X, rules=(:discrete_to_continuous,))) dtr_model = DecisionTreeRegressor() dtr = machine(dtr_model, X, y) fit!(dtr, rows=train) ypred = predict(dtr, rows=test) round(rms(ypred, y[test]), sigdigits=3)
[ 2, 770, 2393, 373, 7560, 11, 466, 407, 13096, 340, 13, 1303, 7808, 198, 55, 796, 31255, 344, 7, 55, 11, 1960, 8690, 7, 55, 11, 3173, 16193, 25, 15410, 8374, 62, 1462, 62, 18487, 5623, 11, 22305, 198, 198, 67, 2213, 62, 19849, 79...
2.509091
110
<filename>src/postaction/post_plot_lift_moment_distribution.jl<gh_stars>0 #=############################################################################################## Filename: post_plot_lift_moment_distribution.jl Author: <NAME> Contact: <EMAIL> README: `<: PostAction` function plots the lift distribution of all l...
[ 27, 34345, 29, 10677, 14, 7353, 2673, 14, 7353, 62, 29487, 62, 26282, 62, 32542, 298, 62, 17080, 3890, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 2, 28, 29113, 29113, 14468, 7804, 4242, 2235, 198, 35063, 25, 1281, 62, 29487, 62, ...
3.147806
1,299
using Plots pyplot() #using Random using Distributions using Optim taskNr = 3; ####### Code used for several tasks ####### function myNormal(x,m,s) # PDF of Gaussian (watch out for elementwise . !) y = 1/sqrt(2*pi*s^2) * exp.(-(x.-m).^2 ./ (2*s^2)) return y end # Parameters: N = 10000; mu = 3.4; sigma ...
[ 3500, 1345, 1747, 198, 9078, 29487, 3419, 198, 2, 3500, 14534, 198, 3500, 46567, 507, 198, 3500, 30011, 628, 198, 35943, 45, 81, 796, 513, 26, 198, 198, 4242, 21017, 6127, 973, 329, 1811, 8861, 46424, 2235, 198, 8818, 616, 26447, 7, ...
2.370579
1,244
crawl(h::Val{:function}, signature, body) = :( JSAST( :function, $(_crawl_function_signature(signature)), $(crawl(body)), ) ) function deparse(::Val{:function}, signature, body) body = jsstring( "function ", deparse(signature), " ", deparse(body), ) # We need ...
[ 66, 13132, 7, 71, 3712, 7762, 90, 25, 8818, 5512, 9877, 11, 1767, 8, 796, 36147, 198, 220, 220, 220, 26755, 11262, 7, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 8818, 11, 198, 220, 220, 220, 220, 220, 220, 220, 720, 28264, 66...
2.772552
1,552
<gh_stars>1-10 N = Float64 c = zeros(N, 2) E1, E2 = diagm(N[-1, 0.5]), N[1 1; 0.5 0.3] E = [E1, E2]; F2 = N[-0.5 1]'; F = [F2]; G = diagm(N[0.3, 0.3]); p = PolynomialZonotope(c, E, F, G) @test dim(p) == 2 @test order(p) == 7//2 @test polynomial_order(p) == 2 # type-specific concrete methods scale(N(0.5), p) linear_m...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 45, 796, 48436, 2414, 198, 198, 66, 796, 1976, 27498, 7, 45, 11, 362, 8, 198, 36, 16, 11, 412, 17, 796, 2566, 363, 76, 7, 45, 58, 12, 16, 11, 657, 13, 20, 46570, 399, 58, 16, 352, ...
1.740891
247
using ModelingToolkit @variables x1 x2 @parameters dt eq = [ -1 + 9 *x1 - 2*x1^3 + 9 *x2 - 2*x2^3, 1 - 11*x1 + 2*x1^3 + 11*x2 - 2*x2^3 ] ModelingToolkit.gradient.(eq, [[x1,x2]]) #= os = OptimizationSystem(eq, [], [x1,x2]) calculate_gradient(os) =#
[ 3500, 9104, 278, 25391, 15813, 628, 198, 31, 25641, 2977, 2124, 16, 2124, 17, 198, 31, 17143, 7307, 288, 83, 198, 198, 27363, 796, 685, 198, 220, 220, 220, 532, 16, 1343, 860, 1635, 87, 16, 532, 362, 9, 87, 16, 61, 18, 1343, 860...
1.871429
140
<filename>src/SparseEnsembleKalmanInversion.jl #Sparse Ensemble Kalman Inversion: specific structures and function definitions using Convex, SCS using SparseArrays """ SparseInversion <: Process A sparse ensemble Kalman Inversion process # Fields $(TYPEDFIELDS) # Constructors $(METHODLIST) """ Base.@kwdef str...
[ 27, 34345, 29, 10677, 14, 50, 29572, 4834, 15140, 41428, 805, 818, 9641, 13, 20362, 198, 2, 50, 29572, 2039, 15140, 12612, 805, 554, 9641, 25, 2176, 8573, 290, 2163, 17336, 198, 3500, 1482, 303, 87, 11, 6374, 50, 198, 3500, 1338, 17...
2.287401
3,897
<filename>src/atoms/second_order_cone/norm.jl import LinearAlgebra.norm export norm_inf, norm, norm_1 # deprecate these soon norm_inf(x::AbstractExpr) = maximum(abs(x)) norm_1(x::AbstractExpr) = sum(abs(x)) norm_fro(x::AbstractExpr) = norm2(vec(x)) # behavior of norm should be consistent with julia: # * vector norms ...
[ 27, 34345, 29, 10677, 14, 265, 3150, 14, 12227, 62, 2875, 62, 49180, 14, 27237, 13, 20362, 198, 11748, 44800, 2348, 29230, 13, 27237, 198, 39344, 2593, 62, 10745, 11, 2593, 11, 2593, 62, 16, 198, 198, 2, 1207, 8344, 378, 777, 2582, ...
2.312977
655
<gh_stars>1-10 using ODEOpt using ODE using Base.Test function testgrav() # create time samples tmin = 0.0 tmax = 10 nsamples = 500 trange = linspace(tmin, tmax, nsamples) #initial position ystart = [0.2; 1.0]::Vector{Float64} time, y = ode45(grav, ystart, trange) x,v = extract(y) ...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 3500, 31245, 4720, 457, 198, 3500, 440, 7206, 198, 3500, 7308, 13, 14402, 198, 198, 8818, 1332, 70, 4108, 3419, 198, 220, 220, 220, 1303, 2251, 640, 8405, 198, 220, 220, 220, 256, 1084, 79...
2.110023
1,327
<filename>src/kinematics.jl export get_rt_d, plot_kinx, plot_kinxt, plot_kiny, plot_kinyt, plot_kin_binx, plot_kin_biny #= Reaction Time Calculations =# function get_rt_d(kin::Array{Kinematic,1},thres::Float64) rt=zeros(Int64,length(kin)) for i=1:length(kin) c1=(mean(kin[i].px[1:10]),mean(kin[i...
[ 27, 34345, 29, 10677, 14, 5116, 368, 23372, 13, 20362, 198, 198, 39344, 651, 62, 17034, 62, 67, 11, 7110, 62, 5116, 87, 11, 7110, 62, 5116, 742, 11, 7110, 62, 74, 3541, 11, 7110, 62, 74, 3541, 83, 11, 7110, 62, 5116, 62, 8800, ...
1.864484
1,985
struct StackedArea time_range::Array data_matrix::Matrix labels::Array end struct BarPlot time_range::Array bar_data::Matrix labels::Array end struct StackedGeneration time_range::Array data_matrix::Matrix labels::Array end struct BarGeneration time_range::Array bar_data::...
[ 7249, 520, 6021, 30547, 198, 220, 220, 220, 640, 62, 9521, 3712, 19182, 198, 220, 220, 220, 1366, 62, 6759, 8609, 3712, 46912, 198, 220, 220, 220, 14722, 3712, 19182, 198, 437, 198, 198, 7249, 2409, 43328, 198, 220, 220, 220, 640, 6...
2.703836
1,955
export iauTporv """ In the tangent plane projection, given the rectangular coordinates of a star and its direction cosines, determine the direction cosines of the tangent point. This function is part of the International Astronomical Union's SOFA (Standards of Fundamental Astronomy) software collection. Status: supp...
[ 39344, 220, 544, 84, 51, 1819, 85, 198, 37811, 198, 818, 262, 13875, 298, 6614, 20128, 11, 1813, 262, 36954, 22715, 198, 1659, 257, 3491, 290, 663, 4571, 8615, 1127, 11, 5004, 262, 4571, 198, 6966, 1127, 286, 262, 13875, 298, 966, 1...
2.744649
1,355
<gh_stars>0 """ Gage the geometric center (mean value) of an input array. Arguments --------- :Type{GeometricCenter} a Julia Type object and must be ``GeometricCenter`` array::Array a floating point array """ function gage(::Type{GeometricCenter}, array::Array) if issubtype(typeof(array[1]), AbstractArray...
[ 27, 456, 62, 30783, 29, 15, 198, 37811, 198, 38, 496, 262, 38445, 3641, 357, 32604, 1988, 8, 286, 281, 5128, 7177, 13, 198, 198, 28100, 2886, 198, 45537, 198, 25, 6030, 90, 10082, 16996, 23656, 92, 198, 220, 220, 220, 257, 22300, ...
2.568075
213
immutable NaiveSolver{N, T} <: MathProgBase.AbstractMathProgSolver rate::T max_step::T precondition_divisors::SVector{N, T} iteration_limit::Int gradient_convergence_tolerance::T end NaiveSolver(num_vars; rate=1.0, max_step=1.0, precondition_divisors::AbstractVector=ones(SVector{num_var...
[ 8608, 18187, 11013, 425, 50, 14375, 90, 45, 11, 309, 92, 1279, 25, 16320, 2964, 70, 14881, 13, 23839, 37372, 2964, 70, 50, 14375, 198, 220, 220, 220, 2494, 3712, 51, 198, 220, 220, 220, 3509, 62, 9662, 3712, 51, 198, 220, 220, 220...
2.304745
1,096
<reponame>mfalt/ProximalOperators.jl # indicator of the zero cone """ IndZero() Returns the indicator function of the zero point, or "zero cone", i.e., `g(x) = 0 if x = 0, +∞ otherwise` """ immutable IndZero <: IndicatorConvexCone end function (f::IndZero){T <: RealOrComplex}(x::AbstractArray{T}) for k in eac...
[ 27, 7856, 261, 480, 29, 76, 69, 2501, 14, 2964, 87, 4402, 18843, 2024, 13, 20362, 198, 2, 16916, 286, 262, 6632, 27763, 198, 198, 37811, 198, 220, 1423, 28667, 3419, 198, 198, 35561, 262, 16916, 2163, 286, 262, 6632, 966, 11, 393, ...
2.437673
361
function primal_objective(x::Array{Float64,2}, y::Array{Float64,1}; C=1.0) s,d = size(x) f = 0 for i in 1:s xi = vec(x[i,:]) f += max(0, 1-y[i]*vecdot(w,xi))^2 end f *= C f += 0.5*vecdot(w,w) return f end """ `dualcd(x, y; <keyword arguments>)` Solves the linear SVM proble...
[ 8818, 43750, 62, 15252, 425, 7, 87, 3712, 19182, 90, 43879, 2414, 11, 17, 5512, 331, 3712, 19182, 90, 43879, 2414, 11, 16, 19629, 327, 28, 16, 13, 15, 8, 198, 220, 220, 220, 264, 11, 67, 796, 2546, 7, 87, 8, 198, 220, 220, 220...
1.882538
2,222
## Eratosthenes' prime number sieve function primesieve(n::Int64) if n <= 1 return Integer[] end p = [i for i in 1:2:n] q = length(p) p[1] = 2 if n >= 9 for k in 3:2:isqrt(n) if p[(k+1)÷2] != 0 p[(k*k+1).÷2:k:q] .= 0 end end e...
[ 2235, 220, 5256, 265, 455, 831, 274, 6, 6994, 1271, 264, 12311, 198, 8818, 778, 999, 12311, 7, 77, 3712, 5317, 2414, 8, 198, 220, 220, 220, 611, 299, 19841, 352, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 34142, 21737, 198, 220...
1.879116
2,217
import MitosisStochasticDiffEq as MSDE using StochasticDiffEq using Mitosis using LinearAlgebra using SparseArrays using DiffEqNoiseProcess using Test, Random """ forwardsample(f, g, p, s, W, x) using the Euler-Maruyama scheme on a time-grid s with associated noise values W """ function forwardsample(f, g, p, s, Ws, ...
[ 11748, 11707, 5958, 1273, 5374, 3477, 28813, 36, 80, 355, 6579, 7206, 198, 3500, 520, 5374, 3477, 28813, 36, 80, 198, 3500, 11707, 5958, 198, 3500, 44800, 2348, 29230, 198, 3500, 1338, 17208, 3163, 20477, 198, 3500, 10631, 36, 80, 2949,...
1.864396
4,550
# Define block-arrays module BlockArrays using LinearAlgebra export RealOrComplex, BlockArray, blocksize, blockeltype, blocklength, blockvecnorm, blockmaxabs, blocksimilar, blockcopy, blockcopy!, blockset!, blockvecdot, blockzeros, ...
[ 2, 2896, 500, 2512, 12, 3258, 592, 198, 21412, 9726, 3163, 20477, 198, 198, 3500, 44800, 2348, 29230, 198, 198, 39344, 6416, 5574, 5377, 11141, 11, 198, 220, 220, 220, 220, 220, 220, 9726, 19182, 11, 198, 220, 220, 220, 220, 220, 22...
2.330462
1,625
<filename>test/pendulum_tests.jl # model T = Float64 verbose = false opts_ilqr = iLQRSolverOptions{T}(verbose=verbose,live_plotting=:off) opts_al = AugmentedLagrangianSolverOptions{T}(verbose=verbose,opts_uncon=opts_ilqr,iterations=50,penalty_scaling=10.0) opts_altro = ALTROSolverOptions{T}(verbose=verbose,opts_al=opt...
[ 27, 34345, 29, 9288, 14, 37038, 14452, 62, 41989, 13, 20362, 198, 2, 2746, 198, 51, 796, 48436, 2414, 198, 198, 19011, 577, 796, 3991, 198, 404, 912, 62, 346, 80, 81, 796, 1312, 43, 48, 6998, 14375, 29046, 90, 51, 92, 7, 19011, ...
2.502717
736
# Note that this script can accept some limited command-line arguments, run # `julia build_tarballs.jl --help` to see a usage message. using BinaryBuilder using GitHub name = "julia" if !any(a->startswith(a, "--branch"), ARGS) version = v"1.0.3" commit_hash = "099e826241fca365a120df9bac9a9fede6e7bae4" else ...
[ 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, 3500, 21722, 19...
2.659044
962
<reponame>ma-laforge/CMDimData.jl #EasyPlot: show functions #------------------------------------------------------------------------------- const SHOW_INDENTSTR = " " Base.show(io::IO, ::Axis{T}) where T = print(io, "Axis{$T}") showcompact_lengthinfo(io::IO, d) = print(io, typeof(d)) showcompact_lengthinfo(io::IO...
[ 27, 7856, 261, 480, 29, 2611, 12, 5031, 30293, 14, 34, 12740, 320, 6601, 13, 20362, 198, 2, 28406, 43328, 25, 905, 5499, 198, 2, 10097, 24305, 198, 198, 9979, 37041, 62, 12115, 3525, 18601, 796, 366, 220, 220, 366, 198, 198, 14881, ...
2.418133
739
using Test import LDAPClient @testset "URL" begin @testset "Equality" begin sample_url_a = LDAPClient.URL("ldap", "ds.example.com", 389, "dc=example,dc=com", ["a", "b"] , 0, nothing, ["a", "b"], 0) sample_url_b = LDAPClient.URL("ldap", "ds.example.com", 389, "dc=example,dc=com", ["a", "b"] , 0, ...
[ 198, 3500, 6208, 198, 198, 11748, 27178, 2969, 11792, 198, 198, 31, 9288, 2617, 366, 21886, 1, 2221, 628, 220, 220, 220, 2488, 9288, 2617, 366, 36, 13237, 1, 2221, 198, 220, 220, 220, 220, 220, 220, 220, 6291, 62, 6371, 62, 64, 79...
2.28169
923
<gh_stars>10-100 export MPIElasticPropagatorParams, MPIElasticSource, MPIElasticReceiver, MPIElasticPropagator, compute_PML_Params!, MPIElasticPropagatorSolver, MPISimulatedObservation!, MPIElasticReceiver, extract_local_patch @with_kw mutable struct MPIElasticPropagatorParams # number of grids along x,y ax...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 39344, 4904, 40, 9527, 3477, 24331, 363, 1352, 10044, 4105, 11, 4904, 40, 9527, 3477, 7416, 11, 4904, 40, 9527, 3477, 3041, 39729, 11, 4904, 40, 9527, 3477, 24331, 363, 1352, 11, 24061, 62...
1.781955
14,309
<gh_stars>0 module aoc_10 using Test export read_input, part1, part2 export test_part1, test_part2, test export input, demo const input_r = r"" function read_input(filename = "input.txt") [parse_line(line) for line in eachline(filename)] end function parse_line(line) p...
[ 27, 456, 62, 30783, 29, 15, 198, 21412, 257, 420, 62, 940, 198, 220, 220, 220, 1262, 6208, 198, 220, 220, 220, 10784, 1100, 62, 15414, 11, 636, 16, 11, 636, 17, 198, 220, 220, 220, 10784, 1332, 62, 3911, 16, 11, 1332, 62, 3911, ...
1.925342
1,460
<gh_stars>100-1000 using GaussianProcesses using BenchmarkLite # Define Benchmark test type GP_UpdateBenchmark <: Proc d::Int op::Function GP_UpdateBenchmark(d::Int, op::Function) = new(d, op) end AbstractString(proc::GP_UpdateBenchmark) = "Dim: $(proc.d)" Base.length(proc::GP_UpdateBenchmark, cfg) = cfg...
[ 27, 456, 62, 30783, 29, 3064, 12, 12825, 198, 3500, 12822, 31562, 18709, 274, 198, 3500, 25187, 4102, 43, 578, 198, 198, 2, 2896, 500, 25187, 4102, 1332, 198, 198, 4906, 14714, 62, 10260, 44199, 4102, 1279, 25, 31345, 198, 220, 220, ...
2.325726
482
<gh_stars>0 @testset "Isogenies" begin K = GF(7) E1 = EllipticCurve(K, [1, 2, 3, 4, 5]) E2 = EllipticCurve(K, [1, 2, 3, 1, 1]) phi = @inferred isogeny_from_kernel(E1, division_polynomial_univariate(E1,3)[1]) @test @inferred domain(phi) == E1 @test @inferred codomain(phi) == E2 @test is_isomorphic(E1, codo...
[ 27, 456, 62, 30783, 29, 15, 198, 31, 9288, 2617, 366, 3792, 6644, 444, 1, 2221, 198, 220, 509, 796, 34977, 7, 22, 8, 198, 220, 412, 16, 796, 7122, 10257, 291, 26628, 303, 7, 42, 11, 685, 16, 11, 362, 11, 513, 11, 604, 11, 64...
2.013292
978
<gh_stars>0 module Config using QuantumESPRESSO.Inputs.PWscf: PWInput using QuantumESPRESSO.Commands: QuantumESPRESSOConfig, PwxConfig using AbInitioSoftwareBase.Commands: CommandConfig, MpiexecConfig import Configurations: convert_to_option import Express.EquationOfStateWorkflow.Config: RuntimeConfig, ExpandConfig ...
[ 27, 456, 62, 30783, 29, 15, 198, 21412, 17056, 198, 198, 3500, 29082, 1546, 32761, 46, 13, 20560, 82, 13, 47, 54, 1416, 69, 25, 44141, 20560, 198, 3500, 29082, 1546, 32761, 46, 13, 6935, 1746, 25, 29082, 1546, 32761, 46, 16934, 11, ...
2.815451
233
""" AST and pretty printer for Graphviz's DOT language. References: - DOT grammar: http://www.graphviz.org/doc/info/lang.html - DOT language guide: http://www.graphviz.org/pdf/dotguide.pdf """ module Graphviz export Expression, Statement, Attributes, Graph, Digraph, Subgraph, Node, NodeID, Edge, pprint, parse_graph...
[ 37811, 29273, 290, 2495, 20632, 329, 29681, 85, 528, 338, 42743, 3303, 13, 198, 198, 19927, 25, 198, 198, 12, 42743, 23491, 25, 2638, 1378, 2503, 13, 34960, 85, 528, 13, 2398, 14, 15390, 14, 10951, 14, 17204, 13, 6494, 198, 12, 4274...
2.578985
4,178
using IPIL8 using Test @testset "IPIL8.jl" begin include("direct.jl"); end
[ 3500, 6101, 4146, 23, 198, 3500, 6208, 198, 198, 31, 9288, 2617, 366, 4061, 4146, 23, 13, 20362, 1, 2221, 198, 220, 220, 220, 2291, 7203, 12942, 13, 20362, 15341, 198, 437, 198 ]
2.424242
33
<reponame>emstoudenmire/ITensors.jl function contract(T::BlockSparseTensor, labelsT, C::CombinerTensor, labelsC) # Get the label marking the combined index # By convention the combined index is the first one # TODO: consider storing the location of the combin...
[ 27, 7856, 261, 480, 29, 368, 301, 2778, 268, 47004, 14, 2043, 641, 669, 13, 20362, 198, 198, 8818, 2775, 7, 51, 3712, 12235, 50, 29572, 51, 22854, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22...
2.145038
917
module TwoPlayerTest using Test import Cribbage: CribbageGame, GameState, UnexpectedPlayerException import Cribbage.RandomPlay: RandomPlayer using Cribbage.TwoPlayer @testset "Test TwoPlayerGame Constructor" begin p₁ = RandomPlayer("player one") @test_throws AssertionError TwoPlayerGame(p₁, p₁) p₂ = Ra...
[ 21412, 4930, 14140, 14402, 198, 198, 3500, 220, 6208, 198, 198, 11748, 327, 822, 13866, 25, 327, 822, 13866, 8777, 11, 3776, 9012, 11, 471, 42072, 14140, 16922, 198, 11748, 327, 822, 13866, 13, 29531, 11002, 25, 14534, 14140, 198, 3500,...
2.537053
1,147
<reponame>dantaras/LightBSON.jl struct BSONObjectId data::NTuple{12, UInt8} end Base.isless(x::BSONObjectId, y::BSONObjectId) = x.data < y.data function BSONObjectId(x::AbstractVector{UInt8}) length(x) == 12 || throw(ArgumentError("ObjectId bytes must be 12 long")) BSONObjectId(NTuple{12, UInt8}(x)) end ...
[ 27, 7856, 261, 480, 29, 67, 415, 283, 292, 14, 15047, 4462, 1340, 13, 20362, 198, 7249, 347, 11782, 10267, 7390, 198, 220, 220, 220, 1366, 3712, 11251, 29291, 90, 1065, 11, 471, 5317, 23, 92, 198, 437, 198, 198, 14881, 13, 271, 12...
2.065245
1,594
add_format(format"PLY_ASCII", "ply\nformat ascii 1.0", ".ply") add_format(format"PLY_BINARY", "ply\nformat binary_little_endian 1.0", ".ply") function type(t) if t == "float" return Float32 else throw(ArgumentError("unexpected property type $t")) end end parseheader(io::IO, ::format"PLY_BINARY") = parseheade...
[ 2860, 62, 18982, 7, 18982, 1, 6489, 56, 62, 42643, 3978, 1600, 366, 2145, 59, 77, 18982, 355, 979, 72, 352, 13, 15, 1600, 27071, 2145, 4943, 198, 2860, 62, 18982, 7, 18982, 1, 6489, 56, 62, 33, 1268, 13153, 1600, 366, 2145, 59, ...
2.246924
1,219
# getfunction.jl # # Makro to ease access to C functions; mainly adopted from the GetC-Package # for Julia. What is desired is e.g. the following: # # INPUT: # void mgl_surf(HMGL gr, HCDT z, char *sch, char *opt); # mgl_surf(gr::HMGL, z::HCDT, sch::Ptr{Cchar}, opt::Ptr{Cchar})::Void # # OUTPUT: # function mgl_surf(g...
[ 2, 651, 8818, 13, 20362, 198, 2, 198, 2, 15841, 305, 284, 10152, 1895, 284, 327, 5499, 26, 8384, 8197, 422, 262, 3497, 34, 12, 27813, 198, 2, 329, 22300, 13, 1867, 318, 10348, 318, 304, 13, 70, 13, 262, 1708, 25, 198, 2, 198, ...
2.075885
593
<filename>test/NNPDE_tests.jl using Flux println("NNPDE_tests") using DiffEqFlux println("Starting Soon!") using ModelingToolkit using DiffEqBase using Test, NeuralPDE using GalacticOptim using Optim cb = function (p,l) println("Current loss is: $l") return false end ## Example 1, 1D ode @parameters t θ @vari...
[ 27, 34345, 29, 9288, 14, 6144, 5760, 36, 62, 41989, 13, 20362, 198, 3500, 1610, 2821, 198, 35235, 7203, 6144, 5760, 36, 62, 41989, 4943, 198, 3500, 10631, 36, 80, 37, 22564, 198, 35235, 7203, 22851, 15894, 2474, 8, 198, 3500, 9104, ...
1.970237
5,107
@inline cld_fast(x, y) = cld(x, y) @inline function cld_fast(x::I, y) where {I <: Base.BitInteger} d = div_fast(x, y) (d + (d * unsigned(y) != unsigned(x))) % I end @inline cld_fast(::StaticInt{N}, y) where {N} = cld_fast(N, y) cld_fast(::StaticInt{N}, ::StaticInt{M}) where {N,M}= (StaticInt{N}() + StaticInt{M}...
[ 31, 45145, 269, 335, 62, 7217, 7, 87, 11, 331, 8, 796, 269, 335, 7, 87, 11, 331, 8, 198, 31, 45145, 2163, 269, 335, 62, 7217, 7, 87, 3712, 40, 11, 331, 8, 810, 1391, 40, 1279, 25, 7308, 13, 13128, 46541, 92, 198, 220, 220, ...
2.202381
588
<reponame>UnofficialJuliaMirrorSnapshots/DrakeLCMTypes.jl-6484683b-de53-5689-b9d2-2f18b83297fe mutable struct support_data_t <: LCMType timestamp::Int64 body_name::String num_contact_pts::Int32 contact_pts::Matrix{Float64} total_normal_force_upper_bound::Float32 total_normal_force_lower_bound::F...
[ 27, 7856, 261, 480, 29, 3118, 16841, 16980, 544, 27453, 1472, 43826, 20910, 14, 35, 33788, 5639, 13752, 9497, 13, 20362, 12, 2414, 5705, 47521, 65, 12, 2934, 4310, 12, 20, 40523, 12, 65, 24, 67, 17, 12, 17, 69, 1507, 65, 5999, 265...
2.323144
229
using F16Model d2r = pi/180; npos = 0; epos = 0; alt = 10000; phi = 0; theta = 0; psi = 0; Vt = 300; alp = 15*d2r; bet = 0; p = 0; q = 0; r = 0; x0 = [npos,epos,alt,phi,theta,psi,Vt,alp,bet,p,q,r]; u0 = [9000,0,0,0,0]; # Example 1: Determine xdot # ------------------------- # There are two ways. See below. xdot1 = ...
[ 3500, 376, 1433, 17633, 198, 198, 67, 17, 81, 796, 31028, 14, 15259, 26, 198, 77, 1930, 796, 657, 26, 198, 538, 418, 796, 657, 26, 198, 2501, 796, 33028, 26, 198, 34846, 796, 657, 26, 198, 1169, 8326, 796, 657, 26, 198, 862, 72,...
2.809949
784
<reponame>JuliaPackageMirrors/Luxor.jl #!/usr/bin/env julia using Luxor # coordinates are in RA seconds float and Declination seconds float constellation_names = Dict( "AND"=> ("Andromeda","Daughter of Cassiopeia"), "ANT"=> ("Antlia","The Air Pump"), "APS"=> ("Apus","Bird of Paradise"), "AQR"=> ("Aquarius","The Wate...
[ 27, 7856, 261, 480, 29, 16980, 544, 27813, 27453, 5965, 14, 43, 2821, 273, 13, 20362, 198, 2, 48443, 14629, 14, 8800, 14, 24330, 474, 43640, 198, 198, 3500, 17145, 273, 198, 198, 2, 22715, 389, 287, 17926, 4201, 12178, 290, 16691, 1...
1.813282
28,278
module Time import Calendar using Calendar import Base.string include("business_calendars.jl") include("day_count.jl") end
[ 21412, 3862, 198, 198, 11748, 26506, 198, 3500, 26506, 198, 198, 11748, 7308, 13, 8841, 198, 198, 17256, 7203, 22680, 62, 9948, 44942, 13, 20362, 4943, 198, 198, 17256, 7203, 820, 62, 9127, 13, 20362, 4943, 198, 198, 437, 198 ]
3.2
40
<reponame>OpenJAC/JAC.jl<filename>examples/example-Cg.jl # println("Cg) Test of the reduced 1- and 2-particle density matrices & natural orbitals.") # setDefaults("print summary: open", "zzz-ReducedDensityMatrix.sum") wa = Atomic.Computation(Atomic.Computation(), name="xx", grid=Radial.Grid(true), nuclearModel=Nuclear...
[ 27, 7856, 261, 480, 29, 11505, 41, 2246, 14, 41, 2246, 13, 20362, 27, 34345, 29, 1069, 12629, 14, 20688, 12, 34, 70, 13, 20362, 198, 198, 2, 198, 35235, 7203, 34, 70, 8, 6208, 286, 262, 5322, 352, 12, 290, 362, 12, 3911, 1548, ...
2.488479
217
<reponame>bintulab/cr_theory_mukund2021<filename>fig_s3/fig_s3.jl using Colors, ColorSchemes using DataFrames using StatsPlots using Statistics using GLM using Measures using LsqFit pyplot(grid=false) fnt = Plots.font("Arial") default(titlefont=fnt, guidefont=fnt, tickfont=fnt, legendfont=fnt) # Plots.resetfontsizes(...
[ 27, 7856, 261, 480, 29, 65, 600, 377, 397, 14, 6098, 62, 1169, 652, 62, 76, 2724, 917, 1238, 2481, 27, 34345, 29, 5647, 62, 82, 18, 14, 5647, 62, 82, 18, 13, 20362, 198, 3500, 29792, 11, 5315, 27054, 6880, 198, 3500, 6060, 35439...
2.16935
3,106
using Mux using HTTP using JSON using OpenIDConnect using JWTs headers(req) = req[:headers] query(req) = parse_query(req[:query]) function parse_query(qstr) res = Dict{String,String}() for qsub in split(qstr, '&') nv = split(qsub, '=') res[nv[1]] = length(nv) > 1 ? nv[2] : "" end res en...
[ 3500, 337, 2821, 198, 3500, 14626, 198, 3500, 19449, 198, 3500, 4946, 2389, 13313, 198, 3500, 449, 54, 33758, 198, 198, 50145, 7, 42180, 8, 796, 43089, 58, 25, 50145, 60, 198, 22766, 7, 42180, 8, 796, 21136, 62, 22766, 7, 42180, 58,...
2.139748
1,746
""" Filter out cells which are not satisfy specific criteria. """ function filter_cells!(p::Profile; min_counts::Real=0, max_counts::Real=maximum(sum(p.data,dims=1)), min_genes::Real=0, max_genes::Real=nrow(p)) check_cell_args(min_counts, max_counts, min_genes, max_genes) return _filt...
[ 37811, 198, 22417, 503, 4778, 543, 389, 407, 15959, 2176, 9987, 13, 198, 37811, 198, 8818, 8106, 62, 46342, 0, 7, 79, 3712, 37046, 26, 949, 62, 9127, 82, 3712, 15633, 28, 15, 11, 3509, 62, 9127, 82, 3712, 15633, 28, 47033, 7, 1634...
2.265586
1,604
<reponame>jordiabante/CpelTdm.jl ################################################################################################### # FUNCTIONS ################################################################################################### """ `create_Ux([N1,...,NK],[α1,...,αK],β)` Function that creates a...
[ 27, 7856, 261, 480, 29, 73, 585, 72, 397, 12427, 14, 34, 30242, 51, 36020, 13, 20362, 198, 29113, 29113, 29113, 21017, 198, 2, 29397, 4177, 11053, 198, 29113, 29113, 29113, 21017, 198, 37811, 198, 220, 220, 220, 4600, 17953, 62, 52, ...
2.009329
7,611
<gh_stars>1-10 @testset "save_surfaces.jl" begin end
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 31, 9288, 2617, 366, 21928, 62, 11793, 32186, 13, 20362, 1, 2221, 198, 198, 437, 198 ]
2.16
25
<filename>src/model2fit/mapped_parameters.jl export Model2Fit_Mapped_Parameters export get_model_θ, get_model @doc raw""" Create a new model, where some parameters are computed using a [`Abstract_Map`](@ref). TODO: not clear how to use it: certainly need a refactoring... # Also see - [`Model2Fit_Shared_Parameters`]...
[ 27, 34345, 29, 10677, 14, 19849, 17, 11147, 14, 76, 6320, 62, 17143, 7307, 13, 20362, 198, 39344, 9104, 17, 31805, 62, 44, 6320, 62, 48944, 198, 39344, 651, 62, 19849, 62, 138, 116, 11, 651, 62, 19849, 198, 198, 31, 15390, 8246, 3...
2.100054
1,849
<reponame>SamuelWiqvist/efficient_SDEMEM<gh_stars>0 using Pkg using LinearAlgebra using DataFrames import Statistics.mean import Statistics.std using Printf using CSV # load functions include(pwd()*"/src/SDEMEM OU neuron data/ou_sdemem.jl") include(pwd()*"/src/SDEMEM OU neuron data/mcmc.jl") seed = 100 M_subjects = ...
[ 27, 7856, 261, 480, 29, 16305, 2731, 54, 25011, 85, 396, 14, 16814, 62, 10305, 3620, 3620, 27, 456, 62, 30783, 29, 15, 198, 3500, 350, 10025, 198, 3500, 44800, 2348, 29230, 198, 3500, 6060, 35439, 198, 11748, 14370, 13, 32604, 198, ...
2.250414
1,813
<reponame>rayosborn/nxpeaks # Helper code """ spdiagm_nonsquare(m, n, args...) Construct a sparse diagonal matrix from Pairs of vectors and diagonals. Each vector arg.second will be placed on the arg.first diagonal. By default (if size=nothing), the matrix is square and its size is inferred from kv, but a non-squa...
[ 27, 7856, 261, 480, 29, 2433, 418, 6286, 14, 77, 87, 431, 4730, 198, 198, 2, 5053, 525, 2438, 198, 198, 37811, 198, 220, 599, 10989, 363, 76, 62, 77, 684, 421, 533, 7, 76, 11, 299, 11, 26498, 23029, 198, 198, 42316, 257, 29877, ...
2.071169
2,754
<reponame>konkam/DualOptimalFiltering function filter_CIR(δ, γ, σ, λ, data; silence = false, trim0 = false) times = keys(data) |> collect |> sort Λ_of_t = Dict{Float64, Array{Int64,1}}() wms_of_t = Dict{Float64, Array{Float64,1}}() θ_of_t = Dict{Float64, Float64}() filtered_θ, filtered_Λ, filtered...
[ 27, 7856, 261, 480, 29, 74, 261, 74, 321, 14, 36248, 27871, 4402, 11928, 20212, 198, 8818, 8106, 62, 34, 4663, 7, 138, 112, 11, 7377, 111, 11, 18074, 225, 11, 7377, 119, 11, 1366, 26, 9550, 796, 3991, 11, 15797, 15, 796, 3991, 8...
1.926199
1,084
Base.summary(p::DiscreteDynamicProblem) = string(TYPE_COLOR, nameof(typeof(p)), NO_COLOR, " with ", TYPE_COLOR, length(p.tStateVectors), NO_COLOR, " state variables and ", TYPE_COLOR, length(p.tChoiceVectors), NO_COLOR, " choice variable(s) ", ) function Base.show(io::IO, p::DiscreteDynami...
[ 198, 14881, 13, 49736, 7, 79, 3712, 15642, 8374, 44090, 40781, 8, 796, 198, 220, 220, 220, 4731, 7, 25216, 62, 46786, 11, 1438, 1659, 7, 4906, 1659, 7, 79, 36911, 198, 220, 220, 220, 8005, 62, 46786, 11, 366, 351, 33172, 198, 220,...
2.396947
262
<filename>src/sudoku.jl function loadpuzzle(s::String) s = replace(s, r"\s" => "") s = map(c -> c in "-._" ? 0 : parse(Int, c), s |> collect) reshape(s, 9, 9) |> permutedims end loadpuzzle(mat::Matrix{<:Integer}) = copy(mat) function possinit!(P::Matrix{UInt16}, grid::Matrix) P .= 0 for r in 1:9 ...
[ 27, 34345, 29, 10677, 14, 82, 463, 11601, 13, 20362, 198, 8818, 3440, 79, 9625, 7, 82, 3712, 10100, 8, 198, 220, 220, 220, 264, 796, 6330, 7, 82, 11, 374, 1, 59, 82, 1, 5218, 366, 4943, 198, 220, 220, 220, 264, 796, 3975, 7, ...
1.689254
4,811
<filename>src/base/Extensions.jl<gh_stars>0 import Base.+ function +(buffer::Array{String,1}, content::String; prefix::Union{String,Nothing}=nothing,suffix::Union{String,Nothing}=nothing) # create a new content line - new_line = content # prefix - if (prefix !== nothing) new_lin...
[ 27, 34345, 29, 10677, 14, 8692, 14, 11627, 5736, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 11748, 7308, 13, 10, 628, 198, 8818, 1343, 7, 22252, 3712, 19182, 90, 10100, 11, 16, 5512, 2695, 3712, 10100, 26, 220, 198, 220, 220, 220...
2.306569
822
<filename>exercises/pythagorean-triplet/example.jl """ pythagorean_triplets(n) Find all positive integer triplets `(a, b, c)` s.t. `a + b + c = n` and `a < b < c` and `a^2 + b^2 == c^2`. """ # cmcaine's answer, with thanks to akshu3398. function pythagorean_triplets(n) triplets = NTuple{3, Int}[] # Lower b...
[ 27, 34345, 29, 1069, 2798, 2696, 14, 79, 5272, 363, 29456, 12, 28461, 37069, 14, 20688, 13, 20362, 198, 37811, 198, 220, 220, 220, 279, 5272, 363, 29456, 62, 28461, 46916, 7, 77, 8, 198, 198, 16742, 477, 3967, 18253, 15055, 912, 460...
1.990512
527
<reponame>JeffreySarnoff/FastRounding.jl module FastRounding export add_round, sub_round, mul_round, square_round, inv_round, div_round, sqrt_round, ⊕₊, ⊕₋, ⊕₌, ⊕₀, ⊕₁, ⊖₊, ⊖₋, ⊖₌, ⊖₀, ⊖₁, ⊗₊, ⊗₋, ⊗₌, ⊗₀, ⊗₁, ⊘₊, ⊘₋, ⊘₌, ⊘₀, ⊘₁, ⊚₊, ⊚₋, ⊚₌, ⊚₀, ⊚₁, ⊙₊, ⊙₋, ⊙₌, ⊙₀, ⊙₁, ...
[ 27, 7856, 261, 480, 29, 19139, 4364, 50, 1501, 2364, 14, 22968, 49, 9969, 13, 20362, 198, 21412, 12549, 49, 9969, 198, 198, 39344, 751, 62, 744, 11, 850, 62, 744, 11, 35971, 62, 744, 11, 6616, 62, 744, 11, 198, 220, 220, 220, 22...
1.995126
4,514