content
stringlengths
6
1.03M
input_ids
listlengths
4
535k
ratio_char_token
float64
0.68
8.61
token_count
int64
4
535k
<filename>test/parsemultipart.jl using Test using HTTP import HTTP.MultiPartParsing: find_multipart_boundary, find_multipart_boundaries, find_header_boundary, parse_multipart_chunk, parse_multipart_body, parse_multipart_form function generate_test_body() Vector{UInt8}("----------------------------91807372115006157...
[ 27, 34345, 29, 9288, 14, 29572, 16680, 541, 433, 13, 20362, 198, 3500, 6208, 198, 3500, 14626, 198, 11748, 14626, 13, 29800, 7841, 47, 945, 278, 25, 1064, 62, 16680, 541, 433, 62, 7784, 560, 11, 1064, 62, 16680, 541, 433, 62, 7784, ...
2.512783
2,073
#= primal dual point =# mutable struct Point{T <: Real} vec::Vector{T} x::SubArray{T, 1, Vector{T}, Tuple{UnitRange{Int}}, true} y::SubArray{T, 1, Vector{T}, Tuple{UnitRange{Int}}, true} z::SubArray{T, 1, Vector{T}, Tuple{UnitRange{Int}}, true} tau::SubArray{T, 0, Vector{T}, Tuple{Int}, true} ...
[ 2, 28, 198, 1050, 4402, 10668, 966, 198, 46249, 198, 198, 76, 18187, 2878, 6252, 90, 51, 1279, 25, 6416, 92, 198, 220, 220, 220, 43030, 3712, 38469, 90, 51, 92, 628, 220, 220, 220, 2124, 3712, 7004, 19182, 90, 51, 11, 352, 11, 2...
2.106145
895
<filename>deps/build.jl using BinDeps @BinDeps.setup xgboost = library_dependency("xgboost", aliases = ["libxgboost.so"]) if haskey(ENV, "XGBOOST_BUILD_VERSION") && ENV["XGBOOST_BUILD_VERSION"] == "master" libcheckout = `git checkout master` onload = "global const build_version = \"master\"" info("Using ...
[ 27, 34345, 29, 10378, 82, 14, 11249, 13, 20362, 198, 3500, 20828, 12156, 82, 198, 198, 31, 33, 259, 12156, 82, 13, 40406, 198, 198, 87, 70, 39521, 796, 5888, 62, 45841, 1387, 7203, 87, 70, 39521, 1600, 47217, 796, 14631, 8019, 87, ...
2.111811
635
using Distributions using Turing using Test # Define model @model ad_test2(xs) = begin s ~ InverseGamma(2,3) m ~ Normal(0,sqrt.(s)) xs[1] ~ Normal(m, sqrt.(s)) xs[2] ~ Normal(m, sqrt.(s)) s, m end # Run HMC with chunk_size=1 chain = sample(ad_test2([1.5 2.0]), HMC(300, 0.1, 1))
[ 3500, 46567, 507, 198, 3500, 39141, 198, 3500, 6208, 198, 198, 2, 2896, 500, 2746, 198, 31, 19849, 512, 62, 9288, 17, 7, 34223, 8, 796, 2221, 198, 220, 264, 5299, 554, 4399, 34777, 2611, 7, 17, 11, 18, 8, 198, 220, 285, 5299, 14...
2.155556
135
# Optimized Product Quantization. Adapted from <NAME>'s code. export train_opq, quantize_opq """ quantize_opq(X, R, C, V=false) -> B Given data and PQ/OPQ codeboks, quantize. # Arguments - `X::Matrix{T}`: `d`-by-`n` data to quantize - `R::Matrix{T}`: `d`-by-`d` rotation to apply to the data before quantizing - ...
[ 2, 30011, 1143, 8721, 16972, 1634, 13, 30019, 276, 422, 1279, 20608, 29, 6, 82, 2438, 13, 198, 39344, 4512, 62, 404, 80, 11, 5554, 1096, 62, 404, 80, 628, 198, 37811, 198, 220, 220, 220, 5554, 1096, 62, 404, 80, 7, 55, 11, 371, ...
2.453968
2,520
using BinaryBuilder, Pkg using Base.BinaryPlatforms: arch, os include("../../fancy_toys.jl") name = "CUDNN" version = v"8.2.2"#.26 script = raw""" mkdir -p ${libdir} ${prefix}/include cd ${WORKSPACE}/srcdir if [[ ${target} == powerpc64le-linux-gnu ]]; then cd cuda/targets/ppc64le-linux find . install_l...
[ 3500, 45755, 32875, 11, 350, 10025, 198, 3500, 7308, 13, 33, 3219, 37148, 82, 25, 3934, 11, 28686, 198, 198, 17256, 7203, 40720, 40720, 69, 3883, 62, 83, 19417, 13, 20362, 4943, 198, 198, 3672, 796, 366, 34, 8322, 6144, 1, 198, 9641...
2.398907
732
<gh_stars>1-10 # The SteinChampionLenardMillsKernel is based on the reference # "An introduction to abstract splines" written in 1996 by the # aforementioned authors. The kernel is a kernel for the Sobolev # space H^2([0,1]) subject to the extra condition that f(0) = f(1) = 0. # The kernel is of the form # # k(x, y) = ...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 2, 383, 15215, 1925, 6734, 30659, 446, 44, 2171, 42, 7948, 318, 1912, 319, 262, 4941, 198, 2, 366, 2025, 9793, 284, 12531, 4328, 1127, 1, 3194, 287, 8235, 416, 262, 198, 2, 20794, 7035, ...
2.417848
1,199
using Gadfly, DataArrays, RDatasets set_default_plot_size(6inch, 3inch) plot(dataset("car", "UN"), x=:GDP, y=:InfantMortality, Geom.histogram2d, Scale.x_log10, Scale.y_log10)
[ 3500, 20925, 12254, 11, 6060, 3163, 20477, 11, 371, 27354, 292, 1039, 198, 198, 2617, 62, 12286, 62, 29487, 62, 7857, 7, 21, 8589, 11, 513, 8589, 8, 198, 198, 29487, 7, 19608, 292, 316, 7203, 7718, 1600, 366, 4944, 12340, 2124, 28, ...
2.192771
83
snd(x::String) = append!(played, registers[x]) set(x::String, y::String) = registers[x] = registers[y] set(x::String, y::Int) = registers[x] = y add(x::String, y::String) = registers[x] += registers[y] add(x::String, y::Int) = registers[x] += y mul(x::String, y::String) = registers[x] *= registers[y] mul(x::String, y:...
[ 198, 82, 358, 7, 87, 3712, 10100, 8, 796, 24443, 0, 7, 21542, 11, 28441, 58, 87, 12962, 198, 2617, 7, 87, 3712, 10100, 11, 331, 3712, 10100, 8, 796, 28441, 58, 87, 60, 796, 28441, 58, 88, 60, 198, 2617, 7, 87, 3712, 10100, 11,...
1.86695
1,413
<reponame>OrchardLANL/DPFEHM.jl ForwardDiff_gradient(x...) = ForwardDiff.gradient(x...) function kr(psi, alpha, N) if psi < 0 m = (N - 1) / N denom = 1 + abs(alpha * psi) ^ N numer = 1 - abs(alpha * psi) ^ (N - 1) * denom ^ (-m) return numer ^ 2 / denom ^ (m / 2) else return one(psi) end end kr(x::Abstra...
[ 27, 7856, 261, 480, 29, 5574, 30215, 25697, 43, 14, 6322, 15112, 36905, 13, 20362, 198, 39746, 28813, 62, 49607, 7, 87, 23029, 796, 19530, 28813, 13, 49607, 7, 87, 23029, 198, 198, 8818, 479, 81, 7, 862, 72, 11, 17130, 11, 399, 8,...
2.377928
2,220
<filename>src/ghost_exchange.jl #= Functions related to exchanging ghost data. =# """ ExchangeGroup A description of information that needs to be communicated between processes during a ghost exchange. It includes the ID of the involved processes, the included elements, and the variable and component indices. The...
[ 27, 34345, 29, 10677, 14, 38933, 62, 1069, 3803, 13, 20362, 198, 2, 28, 198, 24629, 2733, 3519, 284, 39167, 10905, 1366, 13, 198, 46249, 198, 198, 37811, 198, 220, 220, 220, 12516, 13247, 198, 198, 32, 6764, 286, 1321, 326, 2476, 28...
2.147664
2,675
using BandedMatrices, FillArrays, Test import LinearAlgebra: axpy! import LazyArrays: DenseColumnMajor import BandedMatrices: BandedColumns, bandeddata @testset "BandedMatrix SubArray" begin @testset "BandedMatrix SubArray interface" begin A = brand(10,10,1,2) V = view(A,2:4,3:6) @test isba...
[ 3500, 10243, 276, 19044, 45977, 11, 27845, 3163, 20477, 11, 6208, 198, 11748, 44800, 2348, 29230, 25, 7877, 9078, 0, 198, 11748, 406, 12582, 3163, 20477, 25, 360, 1072, 39470, 24206, 198, 11748, 10243, 276, 19044, 45977, 25, 10243, 276, ...
1.592324
2,762
using Xpress mpb_path = "" if VERSION < v"0.7" mpb_path = Pkg.dir("MathProgBase") else import MathProgBase mpb_path = joinpath(dirname(pathof(MathProgBase)),"..") end include(joinpath(mpb_path,"test","linproginterface.jl")) println("Testing linproginterface with solver Xpress.XpressSolver") linprogsolvert...
[ 3500, 1395, 8439, 198, 198, 3149, 65, 62, 6978, 796, 13538, 198, 361, 44156, 2849, 1279, 410, 1, 15, 13, 22, 1, 198, 220, 220, 220, 29034, 65, 62, 6978, 796, 350, 10025, 13, 15908, 7203, 37372, 2964, 70, 14881, 4943, 198, 17772, 1...
2.565327
398
using Documenter, EconUtils makedocs( format = :html, sitename = "EconUtils.jl", pages = [ "index.md", "GettingStarted.md", "API.md", "Examples.md", "References.md" ] ) deploydocs( deps = Deps.pip("pygments", "mkdocs", "python-markdown-math"), repo = "gi...
[ 3500, 16854, 263, 11, 412, 1102, 18274, 4487, 198, 198, 76, 4335, 420, 82, 7, 198, 220, 220, 220, 5794, 796, 1058, 6494, 11, 198, 220, 220, 220, 1650, 12453, 796, 366, 36, 1102, 18274, 4487, 13, 20362, 1600, 198, 220, 220, 220, 54...
1.95098
204
# These tests checks that varying μ0, μB results in the correct scale # transformations in various energies / fields. Note: # does not check that the actual absolute values are # correct. seed = 1111 μBs = [1, 2, 1, 4] μ0s = [1, 1, 2, 3] crystal = Sunny.diamond_crystal() latsize = (4, 4, 4) function collect_energy_a...
[ 2, 2312, 5254, 8794, 326, 15874, 18919, 15, 11, 18919, 33, 2482, 287, 262, 3376, 5046, 198, 2, 38226, 287, 2972, 27598, 1220, 7032, 13, 5740, 25, 198, 2, 857, 407, 2198, 326, 262, 4036, 4112, 3815, 389, 198, 2, 3376, 13, 198, 198,...
2.093101
1,203
<filename>src/IDLREPL.jl import Base: LineEdit, REPL function idl_repl() # Setup idl prompt prompt = LineEdit.Prompt("IDL> "; prompt_prefix=Base.text_colors[:blue], prompt_suffix=Base.text_colors[:white]) repl = Base.active_repl promp...
[ 27, 34345, 29, 10677, 14, 2389, 43, 2200, 6489, 13, 20362, 198, 11748, 7308, 25, 6910, 18378, 11, 45285, 198, 198, 8818, 4686, 75, 62, 35666, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 31122, 4686, 75, 6152, 198, 220, ...
1.889286
1,120
""" ilc_weights(cij) This function returns weights (a vector of the number of frequency channels) of the ILC method. *Reference*: Equation (12) of Tegmark et al., Phys. Rev. D, 68, 123523 (2003) # Arguments - `cij::Array{<:AbstractFloat,2}`: symmetric covariance matrix with the dimention of `(nν, nν)` where `nν`...
[ 37811, 198, 220, 220, 220, 4229, 66, 62, 43775, 7, 979, 73, 8, 198, 198, 1212, 2163, 5860, 19590, 357, 64, 15879, 286, 262, 1271, 286, 8373, 9619, 8, 286, 262, 314, 5639, 2446, 13, 198, 198, 9, 26687, 47026, 7889, 341, 357, 1065, ...
1.975254
3,839
using Wanderer using Test DataSource1 = Dict( :a => [1, 2, 3], :b => [2, 3, 4], :c => [3, 4, 5] ) DataSource2 = Dict( :a => ["a", "b", "c"], :b => [2, 3, 4], :c => [3, 4, 5] ) @testset "Wanderer.jl" begin @test (DataSource1 |> @select _.a + _.b + _.c => sum)[:sum] == [6, 9, 12] @test ...
[ 3500, 22420, 11882, 198, 3500, 6208, 198, 198, 6601, 7416, 16, 796, 360, 713, 7, 198, 220, 220, 220, 1058, 64, 5218, 685, 16, 11, 362, 11, 513, 4357, 198, 220, 220, 220, 1058, 65, 5218, 685, 17, 11, 513, 11, 604, 4357, 198, 220,...
1.876289
582
if basename(pwd()) == "aoc" cd("2017/11") end function hexdistance(path::AbstractString) position = [0, 0] for step in split(path, ',') position .+= if step == "n" [0, 2] elseif step == "ne" [1, 1] elseif step == "se" [1, -1] elseif step =...
[ 361, 1615, 12453, 7, 79, 16993, 28955, 6624, 366, 64, 420, 1, 198, 220, 220, 220, 22927, 7203, 5539, 14, 1157, 4943, 198, 437, 198, 198, 8818, 17910, 30246, 7, 6978, 3712, 23839, 10100, 8, 198, 220, 220, 220, 2292, 796, 685, 15, 1...
1.831307
658
<reponame>lfsc507/MMI2<gh_stars>0 using ArgParse using JLD2 parser = ArgParseSettings(allow_ambiguous_opts=false) @add_arg_table! parser begin "main" required = true "patch" required = true "--overwrite" arg_type = Bool default = true end args = parse_args(parser) results =...
[ 27, 7856, 261, 480, 29, 1652, 1416, 35378, 14, 44, 8895, 17, 27, 456, 62, 30783, 29, 15, 198, 3500, 20559, 10044, 325, 198, 3500, 449, 11163, 17, 198, 198, 48610, 796, 20559, 10044, 325, 26232, 7, 12154, 62, 4131, 29709, 62, 404, ...
2.433898
295
#jl #! format: off # # Bar and stack plots with [PowerGraphics.jl](github.com/nrel-siip/PowerGraphics.jl) # PowerGraphics also provides some basic specifications for plotting `SimulationResults`. # This example demonstrates some simple plotting capabilities using different Plots.julia # backends. # # The plotting capa...
[ 198, 2, 20362, 1303, 0, 5794, 25, 572, 198, 2, 1303, 2409, 290, 8931, 21528, 351, 685, 13434, 18172, 13, 20362, 16151, 12567, 13, 785, 14, 77, 2411, 12, 13396, 541, 14, 13434, 18172, 13, 20362, 8, 198, 2, 4333, 18172, 635, 3769, 6...
3.642857
1,008
<gh_stars>1-10 function reset_distribution(p::LaserTagPOMDP, b::ParticleCollection, a, o) # warn("Resetting Particle Filter Distribution") rob = first(particles(b)).robot nextrob = LaserTag.add_if_inside(p.floor, rob, LaserTag.ACTION_DIRS[a]) if o == LaserTag.C_SAME_LOC return ParticleCollection...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 8818, 13259, 62, 17080, 3890, 7, 79, 3712, 43, 6005, 24835, 47, 2662, 6322, 11, 275, 3712, 7841, 1548, 36307, 11, 257, 11, 267, 8, 198, 220, 220, 220, 1303, 9828, 7203, 4965, 35463, 2142, ...
2.398089
314
<gh_stars>0 using StableRNGs @testset "Manifolds" begin rng = StableRNG(213) # Test case: find eigenbasis for first two eigenvalues of a symmetric matrix by minimizing the Rayleigh quotient under orthogonality constraints n = 4 m = 2 A = Diagonal(range(1, stop=2, length=n)) fmanif(x) = real(dot...
[ 27, 456, 62, 30783, 29, 15, 198, 3500, 520, 540, 49, 10503, 82, 198, 31, 9288, 2617, 366, 5124, 361, 10119, 1, 2221, 198, 220, 220, 220, 374, 782, 796, 520, 540, 49, 10503, 7, 26427, 8, 628, 220, 220, 220, 1303, 6208, 1339, 25, ...
2.025087
1,435
<gh_stars>0 using LinearAlgebra, MATLAB, ForwardDiff, SparseArrays, Printf using Convex, Hypatia const FD = ForwardDiff include("/Users/kevintracy/.julia/dev/CPEG/src/qp_solver.jl") function dynamics(x,u) r = x[1:3] v = x[4:6] return [v;u[1:3] + [0;0;-9.81]] end function rk2(x,u) Δt = u[4] k1 = Δt...
[ 27, 456, 62, 30783, 29, 15, 198, 3500, 44800, 2348, 29230, 11, 36775, 48780, 11, 19530, 28813, 11, 1338, 17208, 3163, 20477, 11, 12578, 69, 198, 3500, 1482, 303, 87, 11, 21209, 265, 544, 198, 9979, 30002, 796, 19530, 28813, 198, 17256...
1.675477
1,362
<gh_stars>1-10 export left_env function LinearAlgebra.dot(ϕ::CuMPS, ψ::CuMPS) C = CUDA.ones(eltype(ψ), 1, 1) for i ∈ eachindex(ψ) M = ψ[i] M̃ = conj.(ϕ[i]) @cutensor C[x, y] := M̃[β, σ, x] * C[β, α] * M[α, σ, y] order = (α, β, σ) end return tr(C) end function left_env(ϕ::CuMPS...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 39344, 1364, 62, 24330, 198, 198, 8818, 44800, 2348, 29230, 13, 26518, 7, 139, 243, 3712, 46141, 44, 3705, 11, 18074, 230, 3712, 46141, 44, 3705, 8, 198, 220, 220, 220, 327, 796, 29369, 56...
1.607666
887
using DimensionalData, Test, Unitful using DimensionalData: X, Y, Z, Time, Start a = [1 2; 3 4] dimz = (X((143, 145)), Y((-38, -36))) da = DimensionalArray(a, dimz) @testset "getindex for single integers returns values" begin @test da[X(1), Y(2)] == 2 @test da[X(2), Y(2)] == 4 end @testset "getindex returns ...
[ 3500, 360, 16198, 6601, 11, 6208, 11, 11801, 913, 198, 3500, 360, 16198, 6601, 25, 1395, 11, 575, 11, 1168, 11, 3862, 11, 7253, 198, 198, 64, 796, 685, 16, 362, 26, 513, 604, 60, 198, 27740, 89, 796, 357, 55, 19510, 21139, 11, 2...
2.001524
2,624
<reponame>UnofficialJuliaMirror/TensorDecompositions.jl-04ed911b-6d5f-4088-a74e-60d2d5028204 """ High-order singular value decomposition (HO-SVD). """ function hosvd(tensor::AbstractArray{T,N}, core_dims::NTuple{N, Int}; pad_zeros::Bool=false, compute_error::Bool=false) where {T,N} pad_zeros || _chec...
[ 27, 7856, 261, 480, 29, 3118, 16841, 16980, 544, 27453, 1472, 14, 51, 22854, 10707, 296, 1930, 1756, 13, 20362, 12, 3023, 276, 35549, 65, 12, 21, 67, 20, 69, 12, 1821, 3459, 12, 64, 4524, 68, 12, 1899, 67, 17, 67, 1120, 2078, 18...
2.11753
502
using BenchmarkTools, JLD # Define a parent BenchmarkGroup to contain our suite #const suite = BenchmarkGroup() #suite["psMethods"] = BenchmarkGroup(["integrationScheme","Nck"]) paramspath = joinpath(dirname(@__FILE__), "params.jld") loadparams!(suite, BenchmarkTools.load(paramspath, "suite"), :evals, :samples); res...
[ 3500, 25187, 4102, 33637, 11, 449, 11163, 198, 198, 2, 2896, 500, 257, 2560, 25187, 4102, 13247, 284, 3994, 674, 18389, 198, 2, 9979, 18389, 796, 25187, 4102, 13247, 3419, 198, 2, 2385, 578, 14692, 862, 46202, 8973, 796, 25187, 4102, ...
2.963115
244
""" Stores the results from running the benchmarks on a package. The following (unexported) methods are defined on a `BenchmarkResults` (written below as `results`): * `name(results)::String` - The commit of the package benchmarked * `commit(results)::String` - The commit of the package benchmarked. If the package re...
[ 37811, 198, 1273, 2850, 262, 2482, 422, 2491, 262, 31747, 319, 257, 5301, 13, 198, 198, 464, 1708, 357, 403, 1069, 9213, 8, 5050, 389, 5447, 319, 257, 4600, 44199, 4102, 25468, 63, 357, 15266, 2174, 355, 4600, 43420, 63, 2599, 198, ...
2.446857
2,625
@enum mjtWarning begin # warning types WARN_INERTIA = 0 # (near) singular inertia matrix WARN_CONTACTFULL # too many contacts in contact list WARN_CNSTRFULL # too many constraints WARN_VGEOMFULL # too many visual geoms WARN_BADQPOS ...
[ 198, 198, 31, 44709, 285, 73, 83, 20361, 2221, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6509, 3858, 198, 220, 220, 42660, 62, 1268, 17395, 3539, 220, 220, 220, 220, 220, 796, 657, 220, 220, 220, 220, 220, ...
1.943022
2,773
## import Optim: minimizer, optimize, minimum mutable struct OptFun opt fun_idx::Int end string(opt::OptFun) = string(string(opt.opt),"\t", enumerate(BBOBFunction)[opt.fun_idx]) function benchmark(op::OptFun, run_lengths, Ntrials, dimensions, Δf) f = enumerate(BBOBFunction)[op.fun_idx] optimizer = o...
[ 2235, 198, 11748, 30011, 25, 10356, 7509, 11, 27183, 11, 5288, 198, 198, 76, 18187, 2878, 13123, 24629, 198, 220, 220, 220, 2172, 198, 220, 220, 220, 1257, 62, 312, 87, 3712, 5317, 198, 437, 198, 198, 8841, 7, 8738, 3712, 27871, 246...
2.109415
1,179
function factoredFastMarching3D(pEik::EikonalParam, mem::EikonalTempMemory) kappaSquared = pEik.kappaSquared; h = pEik.Mesh.h; src = pEik.src; n = pEik.Mesh.n.+1; HO = pEik.HO; N = prod(n); if isempty(pEik.T1) pEik.T1 = zeros(Float64,tuple(n...)); end T = pEik.T1; if isempty(pEik.order...
[ 8818, 1109, 1850, 22968, 16192, 278, 18, 35, 7, 79, 36, 1134, 3712, 36, 1134, 20996, 22973, 11, 1066, 3712, 36, 1134, 20996, 30782, 30871, 8, 201, 198, 201, 198, 74, 20975, 22266, 1144, 220, 197, 28, 279, 36, 1134, 13, 74, 20975, ...
1.788672
1,642
# _____ _____ ____ _____ ____ ____ ____ ___ ___ ____ # |_ _| ____/ ___|_ _/ ___| | _ \ / ___|/ _ \ / _ \| _ \ # | | | _| \___ \ | | \___ \ _____| |_) |____| | _| | | | | | | | | | # | | | |___ ___) || | ___) |_____| _ <_____| |_| | |_| | |_| | |_| | # |_| |_____|____/ |_| |_...
[ 2, 220, 220, 29343, 220, 29343, 220, 1427, 220, 29343, 220, 1427, 220, 220, 220, 220, 220, 220, 220, 220, 1427, 220, 220, 220, 220, 220, 220, 220, 220, 1427, 220, 46444, 220, 220, 46444, 220, 220, 1427, 198, 2, 930, 62, 220, 220, ...
2.002387
6,704
<filename>src/rand/rocRAND.jl<gh_stars>100-1000 module rocRAND using ..HSA using ..AMDGPU using ..AMDGPU: librocrand, mark!, wait! using CEnum export rand_logn!, rand_poisson!, rand_logn, rand_poisson include("librocrand_common.jl") include("error.jl") include("librocrand.jl") function version() s = string(ROCR...
[ 27, 34345, 29, 10677, 14, 25192, 14, 12204, 49, 6981, 13, 20362, 27, 456, 62, 30783, 29, 3064, 12, 12825, 198, 21412, 686, 66, 49, 6981, 198, 198, 3500, 11485, 39, 4090, 198, 3500, 11485, 28075, 33346, 198, 3500, 11485, 28075, 33346, ...
2.359477
306
using Logging using PortfolioOpt using JuMP """ worst_case_return(decision::Array{Float64,1}, formulation::PortfolioOpt.RobustBertsimas, solver) Returns worst case return (WCR) in Bertsimas's uncertainty set ([`RobustBertsimas`](@ref)) for a defined decision: $(PortfolioOpt._portfolio_return_latex_RobustBertsima...
[ 3500, 5972, 2667, 198, 3500, 4347, 13652, 27871, 198, 3500, 12585, 7378, 198, 198, 37811, 198, 220, 220, 220, 5290, 62, 7442, 62, 7783, 7, 12501, 1166, 3712, 19182, 90, 43879, 2414, 11, 16, 5512, 31760, 3712, 13924, 13652, 27871, 13, ...
2.468211
1,856
using MathepiaModels using DifferentialEquations using Plots using Test const DE = DifferentialEquations @testset "SIRbasic" begin u_0 = [1000, 0.1, 0] p_data = (Λ = 0, d = 0, α = 0, N = 1000, β = 0.2, γ = 0.1) tspan_data = (0.0, 100.0) prob_data = DE.ODEProblem(SIRbasic, u_0, tspan_data, p_data) da...
[ 3500, 6550, 258, 79, 544, 5841, 1424, 198, 3500, 20615, 498, 23588, 602, 198, 3500, 1345, 1747, 198, 3500, 6208, 198, 9979, 5550, 796, 20615, 498, 23588, 602, 198, 31, 9288, 2617, 366, 50, 4663, 35487, 1, 2221, 198, 220, 220, 220, 3...
2.072934
1,234
<gh_stars>10-100 @testset "GammaLikelihood" begin for args in ((), (1.0,), (exp,), (ExpLink(),), (1.0, exp), (1.0, ExpLink())) lik = GammaLikelihood(args...) @test lik isa GammaLikelihood{Float64,ExpLink} @test lik.α == 1 end lik = GammaLikelihood(1.0) test_interface(lik, SqExpo...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 31, 9288, 2617, 366, 34777, 2611, 7594, 11935, 1, 2221, 198, 220, 220, 220, 329, 26498, 287, 14808, 828, 357, 16, 13, 15, 11, 828, 357, 11201, 11, 828, 357, 16870, 11280, 22784, 828, 357...
2.261905
168
"""Train a decision tree using the ID algorithm.""" function id3(dataset::AbstractArray{T, 2}, target::Integer, attributes::AbstractArray{String}) where {T} targets = dataset[:, target] classes = unique(targets) nclasses = length(classes) node = Node() # Check if there is only one class...
[ 37811, 44077, 257, 2551, 5509, 1262, 262, 4522, 11862, 526, 15931, 198, 8818, 4686, 18, 7, 19608, 292, 316, 3712, 23839, 19182, 90, 51, 11, 362, 5512, 2496, 3712, 46541, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220...
2.259494
790
using AcousticFWI,Seismic,PyPlot function main() ns = 4 ng = 250 nz = 150 nx = 250 nt = 1024 nf = 1024 dz = 0.01 dx = 0.01 dt = 0.002 f0 = 10. fmin = 0.5 fmax = 30. ext = 50 atten_max = 2.5 vp = 2.1*ones(nz,nx) vp[61:100,:] = 3.0 vp[101:end,:] = 2....
[ 3500, 4013, 21618, 24160, 40, 11, 4653, 1042, 291, 11, 20519, 43328, 198, 198, 8818, 1388, 3419, 628, 220, 220, 220, 36545, 796, 604, 198, 220, 220, 220, 23370, 796, 8646, 198, 220, 220, 220, 299, 89, 796, 6640, 198, 220, 220, 220, ...
1.794473
1,158
@testset "ϵ-support" begin a, b = ϵsupport(inv, 1) @test a ≈ -1 atol = 1e-2 @test b ≈ +1 atol = 1e-2 end @testset "Quad Rule" begin q = adaptive_G_quad(identity) @test q[1] ≈ 0 atol = 1e-14 q = adaptive_G_quad(identity; a = 0) @test q[1] ≈ 1/2 atol = 1e-14 end
[ 198, 31, 9288, 2617, 366, 139, 113, 12, 11284, 1, 2221, 198, 220, 220, 220, 257, 11, 275, 796, 18074, 113, 11284, 7, 16340, 11, 352, 8, 198, 220, 220, 220, 2488, 9288, 257, 15139, 230, 532, 16, 379, 349, 796, 352, 68, 12, 17, ...
1.883117
154
""" have_trace_compile `true` if Julia is running with `--trace-compile` """ function have_trace_compile() jloptstc = Base.JLOptions().trace_compile jloptstc == C_NULL && return false return true end """ force_trace_compile(::String) Force the trace compile to be enabled for the given file. Note...
[ 198, 37811, 198, 220, 220, 220, 423, 62, 40546, 62, 5589, 576, 198, 198, 63, 7942, 63, 611, 22300, 318, 2491, 351, 4600, 438, 40546, 12, 5589, 576, 63, 198, 37811, 198, 8818, 423, 62, 40546, 62, 5589, 576, 3419, 198, 220, 220, 220...
2.600551
363
include("polyagamma_sampler.jl") function _mcmc_iter_pg( latent::AbstractLatent, parameters::Vector{<:AbstractParameters}, responses_val::Vector{Float64}, W_val::Vector{Float64}; sampling = true ) latent.posterior = __posterior(latent, parameters, responses_val, W_val) _chain_a...
[ 17256, 7203, 35428, 363, 321, 2611, 62, 37687, 20053, 13, 20362, 4943, 198, 198, 8818, 4808, 76, 11215, 66, 62, 2676, 62, 6024, 7, 198, 220, 220, 220, 41270, 3712, 23839, 24220, 298, 11, 198, 220, 220, 220, 10007, 3712, 38469, 90, 2...
2.450458
1,201
# This file is auto-generated by AWSMetadata.jl using AWS using AWS.AWSServices: gamelift using AWS.Compat using AWS.UUIDs """ accept_match(acceptance_type, player_ids, ticket_id) accept_match(acceptance_type, player_ids, ticket_id, params::Dict{String,<:Any}) Registers a player's acceptance or rejection of a...
[ 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, 9106, 417, 2135, 198, 3500, 30865, 13, 40073, 198, 3500, 30865, 13, 52, 27586, 82, 198, 198, ...
3.327148
81,807
<gh_stars>10-100 using KrylovMethods using Test using LinearOperators include("getDivGrad.jl") @testset "blockCG" begin # small full system A = [4.0 1; 1 4] rhs = randn(2,2) X,flag,relres,iter,resvec = blockCG(A,rhs,tol=1e-15,out=2,storeInterm=true) @test norm(A*X[:,:,end]-rhs)/norm(rhs) <= 1e-14 # test message and f...
[ 27, 456, 62, 30783, 29, 940, 12, 3064, 198, 3500, 41662, 27086, 46202, 198, 3500, 6208, 198, 3500, 44800, 18843, 2024, 198, 17256, 7203, 1136, 24095, 42731, 13, 20362, 4943, 198, 198, 31, 9288, 2617, 366, 9967, 39816, 1, 2221, 198, 2,...
2.065728
426
""" simdat_crossed([RNG], subj_n, item_n; subj_btwn=nothing, item_btwn=nothing, both_win=nothing, subj_prefix="S", item_prefix="I") Return a row table with a design specified by the: * number of subjects (`subj_n`), * number of items (`item_n`) * between-subject factors (`subj...
[ 37811, 198, 220, 220, 220, 985, 19608, 62, 19692, 276, 26933, 49, 10503, 4357, 850, 73, 62, 77, 11, 2378, 62, 77, 26, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 850, 73, 62, ...
2.347709
1,484
<reponame>UnofficialJuliaMirror/AWSCore.jl-4f1ea46c-232b-54a6-9b17-cc2d0f3e6598 @testset "QueueURL" begin expected = "http://queue.amazonaws.com/123456789012/testQueue" xml = """ <CreateQueueResponse> <CreateQueueResult> <QueueUrl> http://queue.amazonaws....
[ 27, 7856, 261, 480, 29, 3118, 16841, 16980, 544, 27453, 1472, 14, 12298, 6173, 382, 13, 20362, 12, 19, 69, 16, 18213, 3510, 66, 12, 24339, 65, 12, 4051, 64, 21, 12, 24, 65, 1558, 12, 535, 17, 67, 15, 69, 18, 68, 2996, 4089, 19...
1.890258
2,515
<reponame>iliailmer/StructuralIdentifiability.jl @testset "Power series matrix inverse" begin T, t = Nemo.PowerSeriesRing(Nemo.GF(2^31 - 1), 50, "t"; model=:capped_absolute) for d in 1:5 S = Nemo.MatrixSpace(T, d, d) for case in 1:20 M = S([random_ps(T) for i in 1:d, j in 1:d])...
[ 27, 7856, 261, 480, 29, 17517, 346, 647, 14, 44909, 1523, 33234, 361, 12455, 13, 20362, 198, 31, 9288, 2617, 366, 13434, 2168, 17593, 34062, 1, 2221, 628, 220, 220, 220, 309, 11, 256, 796, 22547, 78, 13, 13434, 27996, 39687, 7, 45, ...
1.942771
332
isalnum(c) = isletter(c) || isnumeric(c) is_url_char(c) = ((@assert UInt32(c) < 0x80); 'A' <= c <= '~' || '$' <= c <= '>' || c == '\f' || c == '\t') is_mark(c) = (c == '-') || (c == '_') || (c == '.') || (c == '!') || (c == '~') || (c == '*') || (c == '\'') || (c == '(') || (c == ')') is_userinfo_char(c)...
[ 28456, 22510, 7, 66, 8, 796, 318, 9291, 7, 66, 8, 8614, 2125, 39223, 7, 66, 8, 198, 198, 271, 62, 6371, 62, 10641, 7, 66, 8, 796, 220, 14808, 31, 30493, 471, 5317, 2624, 7, 66, 8, 1279, 657, 87, 1795, 1776, 705, 32, 6, 19841...
1.905884
6,237
<reponame>yebai/Turing.jl using Turing using DelimitedFiles using BenchmarkHelper if !haskey(BenchmarkSuite, "nuts") BenchmarkSuite["nuts"] = BenchmarkGroup(["nuts"]) end fname = joinpath(dirname(@__FILE__), "sv_nuts.data") y, header = readdlm(fname, ',', header=true) # Stochastic volatility (SV) @model functio...
[ 27, 7856, 261, 480, 29, 88, 1765, 1872, 14, 51, 870, 13, 20362, 198, 3500, 39141, 198, 3500, 4216, 320, 863, 25876, 198, 198, 3500, 25187, 4102, 47429, 198, 198, 361, 5145, 10134, 2539, 7, 44199, 4102, 5606, 578, 11, 366, 31381, 494...
2.11811
381
#jl #! format: off # # Bar and stack plots with [PowerGraphics.jl](github.com/nrel-siip/PowerGraphics.jl) # PowerGraphics also provides some basic specifications for plotting `SimulationResults`. # This example demonstrates some simple plotting capabilities using different Plots.julia # backends. # # The plotting capa...
[ 198, 2, 20362, 1303, 0, 5794, 25, 572, 198, 2, 1303, 2409, 290, 8931, 21528, 351, 685, 13434, 18172, 13, 20362, 16151, 12567, 13, 785, 14, 77, 2411, 12, 13396, 541, 14, 13434, 18172, 13, 20362, 8, 198, 2, 4333, 18172, 635, 3769, 6...
3.60539
1,039
<reponame>danielzhaotongliu/MALTrendsWeb<filename>backend/anime_data/snapshots_239.jl {"score_count": 50668, "score": 8.17, "timestamp": 1580207201.0} {"score_count": 49867, "score": 8.17, "timestamp": 1575130427.0} {"score_count": 47758, "score": 8.2, "timestamp": 1564324308.0} {"score_count": 49234, "score": 8.18, "t...
[ 27, 7856, 261, 480, 29, 67, 6321, 89, 3099, 313, 506, 4528, 84, 14, 44, 31429, 10920, 82, 13908, 27, 34345, 29, 1891, 437, 14, 272, 524, 62, 7890, 14, 45380, 20910, 62, 23516, 13, 20362, 198, 4895, 26675, 62, 9127, 1298, 2026, 358...
2.364651
1,075
<filename>src/opt/vars.jl<gh_stars>1-10 """ # The default options for [`WebsocketClient`](@ref) !!! info "maxReceivedFrameSize" `0x100000::Integer` 1MiB The maximum frame size that the client will accept !!! info "maxReceivedMessageSize" `8 * 0x100000::Integer` 8MiB The maximum assembled message size...
[ 27, 34345, 29, 10677, 14, 8738, 14, 85, 945, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 37811, 198, 2, 383, 4277, 3689, 329, 685, 63, 1135, 1443, 5459, 11792, 63, 16151, 31, 5420, 8, 198, 10185, 7508, 366, 9806, 3041, ...
2.910174
2,939
mutable struct ParamTable m :: Matrix{String} end """ $(SIGNATURES) Holds symbol, name, description, value. All as formatted text. Used for constructing formatted parameter tables. """ ParamTable() = ParamTable(Matrix{String}(undef, 0, 4)); ParamTable(n :: Integer) = ParamTable(fill("", n, 4)); Base.length(p...
[ 76, 18187, 2878, 25139, 10962, 198, 220, 220, 220, 285, 7904, 24936, 90, 10100, 92, 198, 437, 198, 198, 37811, 198, 220, 220, 220, 29568, 46224, 47471, 8, 198, 198, 39, 10119, 6194, 11, 1438, 11, 6764, 11, 1988, 13, 198, 3237, 355, ...
2.483871
713
""" Farquhar–von Caemmerer–Berry (FvCB) model for C3 photosynthesis (Farquhar et al., 1980; von Caemmerer and Farquhar, 1981) coupled with a conductance model. The definition: - `Tᵣ`: the reference temperature (°C) at which other parameters were measured - `VcMaxRef`: maximum rate of Rubisco activity (``μmol\\ m^{-2...
[ 198, 37811, 198, 21428, 421, 9869, 1906, 26982, 6488, 368, 76, 11882, 1906, 25215, 357, 37, 85, 23199, 8, 2746, 329, 327, 18, 5205, 44411, 357, 21428, 421, 9869, 2123, 435, 1539, 7169, 26, 198, 26982, 6488, 368, 76, 11882, 290, 6755, ...
2.449328
6,848
<reponame>antonior92/ParallelTrainingNN.jl #*************************************************************************# # # Bias Type # #*************************************************************************# """ Bias(n) Initialize `ParametricModel` representing bias operation `z = x + Θ`. `n` is the input vecto...
[ 27, 7856, 261, 480, 29, 23026, 1504, 5892, 14, 10044, 29363, 44357, 6144, 13, 20362, 198, 2, 17174, 17174, 4557, 9, 2, 198, 2, 198, 2, 347, 4448, 5994, 198, 2, 198, 2, 17174, 17174, 4557, 9, 2, 198, 37811, 198, 220, 220, 220, 34...
2.724719
534
@testset "Dual Type" begin h = LPHRepresentation(spzeros(Int, 2, 2), [1, 2], [3, 4], [4, 5], [6, 7]) p = @inferred polyhedron(h) @test p isa SimplePolyhedron{2, Rational{BigInt}, LPHRepresentation{2, Rational{BigInt}, SparseMatrixCSC{Rational{BigInt},Int}}, Polyhedra.Hull{2, Rational{BigInt}, Vector{Rationa...
[ 31, 9288, 2617, 366, 36248, 5994, 1, 2221, 198, 220, 220, 220, 289, 796, 406, 11909, 40171, 341, 7, 2777, 9107, 418, 7, 5317, 11, 362, 11, 362, 828, 685, 16, 11, 362, 4357, 685, 18, 11, 604, 4357, 685, 19, 11, 642, 4357, 685, ...
2.356851
978
module FunRefsTest using Comm, GIDs, FunRefs using Base.Test # Test basic operations function test_basic(T::Type) i = 1 ri = FunRef{T}(i) @test ri[] == i rn = FunRef{Union{}}() global DONE = false rexec(mod1(2, Comm.nprocs())) do remote1(i, ri) end while !DONE yield() end end ...
[ 21412, 11138, 8134, 82, 14402, 198, 198, 3500, 1520, 11, 402, 47954, 11, 11138, 8134, 82, 198, 3500, 7308, 13, 14402, 198, 198, 2, 6208, 4096, 4560, 198, 8818, 1332, 62, 35487, 7, 51, 3712, 6030, 8, 198, 220, 220, 220, 1312, 796, ...
1.995201
1,667
# Copyright (c) 2017: <NAME> and contributors # Copyright (c) 2017: Google Inc. # # Use of this source code is governed by an MIT-style license that can be found # in the LICENSE.md file or at https://opensource.org/licenses/MIT. # We fake the supertype to aid method dispatch struct SolFileResults <: MOI.ModelLike ...
[ 2, 15069, 357, 66, 8, 2177, 25, 1279, 20608, 29, 290, 20420, 198, 2, 15069, 357, 66, 8, 2177, 25, 3012, 3457, 13, 198, 2, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 281, 17168, 12, 7635, 5964, 326, 460, 307, 1043, 198,...
2.349036
5,604
module DGMethods using MPI using StaticArrays using DocStringExtensions using KernelAbstractions using KernelAbstractions.Extras: @unroll using ..MPIStateArrays using ..Mesh.Grids using ..Mesh.Topologies using ..Mesh.Filters using ..VariableTemplates using ..Courant using ..BalanceLaws: BalanceLaw, AbstractSta...
[ 21412, 46133, 46202, 198, 198, 3500, 4904, 40, 198, 3500, 36125, 3163, 20477, 198, 3500, 14432, 10100, 11627, 5736, 198, 3500, 32169, 23839, 507, 198, 3500, 32169, 23839, 507, 13, 11627, 8847, 25, 2488, 403, 2487, 198, 3500, 11485, 7378, ...
2.622739
774
# --- # notebook: nothing # ---
[ 2, 11420, 198, 2, 20922, 25, 2147, 198, 2, 11420, 198 ]
2.909091
11
# # Cells in Literate Julia # # The `{:cell}` syntax for [executable cells](#) is not limited to just # markdown files. It will work the same across other source types as well. # This page illustrates this using literate Julia. # # To use cells in a Julia file just add `{:cell}` at the end of a comment block # before t...
[ 2, 1303, 39794, 287, 17667, 378, 22300, 198, 2, 198, 2, 383, 4600, 90, 25, 3846, 92, 63, 15582, 329, 685, 18558, 18187, 4778, 16151, 2, 8, 318, 407, 3614, 284, 655, 198, 2, 1317, 2902, 3696, 13, 632, 481, 670, 262, 976, 1973, 58...
3.340087
691
<gh_stars>0 # module Ecto.Repo module Schema import ....Ecto import ....Ecto: Changeset, InvalidChangesetError ## insert! function insert!(repo::Base.Random.UUID, adapter, struct_or_changeset::Union{Ecto.Schema.t,Changeset.t}, opts::Dict)::Ecto.Schema.t (isok, schema_or_changeset) = insert(repo, adapter, struct_...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 8265, 412, 310, 78, 13, 6207, 78, 198, 198, 21412, 10011, 2611, 198, 198, 11748, 19424, 36, 310, 78, 198, 11748, 19424, 36, 310, 78, 25, 19179, 316, 11, 17665, 29238, 316, 12331, 198, 198, 2235,...
2.513482
2,559
<filename>src/tuners/tuners.jl ### MCTunerState subtypes hold the samplers' temporary output used for tuning the sampler abstract type MCTunerState end mutable struct BasicMCTune <: MCTunerState step::Real # Stepsize of MCMC iteration (for ex leapfrog in HMC or drift stepsize in MALA) accepted::Integer # Number o...
[ 27, 34345, 29, 10677, 14, 28286, 364, 14, 28286, 364, 13, 20362, 198, 21017, 337, 4177, 38886, 9012, 850, 19199, 1745, 262, 6072, 489, 364, 6, 8584, 5072, 973, 329, 24549, 262, 6072, 20053, 198, 198, 397, 8709, 2099, 337, 4177, 38886,...
3.248047
512
<gh_stars>1-10 if abspath(PROGRAM_FILE) == @__FILE__ println("OK") quit(1) end
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 198, 361, 2352, 6978, 7, 4805, 7730, 24115, 62, 25664, 8, 6624, 2488, 834, 25664, 834, 198, 220, 220, 220, 44872, 7203, 11380, 4943, 198, 220, 220, 220, 11238, 7, 16, 8, 198, 437, 198 ]
2
44
<reponame>p2t2/Scruff.jl<filename>src/sfuncs/conddist/discretecpt.jl export DiscreteCPT """ function DiscreteCPT(range::Vector{O}, paramdict::Dict{I, Vector{Float64}}) where {I <: Tuple, O} Constructs an sfunc that represents a Discrete Conditional Probability table. `DiscreteCPT`s are implemented as a `Tabl...
[ 27, 7856, 261, 480, 29, 79, 17, 83, 17, 14, 3351, 30622, 13, 20362, 27, 34345, 29, 10677, 14, 82, 12543, 6359, 14, 17561, 17080, 14, 15410, 8374, 66, 457, 13, 20362, 198, 39344, 198, 220, 220, 220, 8444, 8374, 8697, 51, 198, 198, ...
2.571233
730
<filename>src/snv.jl<gh_stars>0 function simulate_snv(seq, chr, start, profile_snv) seqstr = seq.seq for snv in profile_snv if chr == snv["chrom"] && start <= snv["pos"] && start+length(seqstr) > snv["pos"] seqstr = mutate(seqstr, start, snv) # println(seqstr) end end...
[ 27, 34345, 29, 10677, 14, 16184, 85, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 8818, 29308, 62, 16184, 85, 7, 41068, 11, 442, 81, 11, 923, 11, 7034, 62, 16184, 85, 8, 198, 220, 220, 220, 33756, 2536, 796, 33756, 13, 41068, 198...
2.247525
303
<reponame>JuliaApproximation/BasisFunctions.jl<gh_stars>1-10 """ A `WeightedDict` represents some function f(x) times an existing dictionary. """ struct WeightedDict{S,T} <: DerivedDict{S,T} superdict :: Dictionary{S} weightfun end WeightedDict(superdict::Dictionary{S,T},weightfun) where {S,T} = WeightedDi...
[ 27, 7856, 261, 480, 29, 16980, 544, 4677, 13907, 18991, 14, 15522, 271, 24629, 2733, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 198, 37811, 198, 32, 4600, 25844, 276, 35, 713, 63, 6870, 617, 2163, 277, 7, 87, 8, 1661, ...
2.624375
2,601
<filename>src/game/tictactoe.jl export TicTacToe const BLANK = Int8(3) struct TicTacToe player::Int board::Vector{Int8} state::Int end TicTacToe() = TicTacToe(1, fill(BLANK,9), 100) Base.isequal(x::TicTacToe, y::TicTacToe) = isequal(x.board, y.board) Base.hash(x::TicTacToe) = hash(x.board) function tra...
[ 27, 34345, 29, 10677, 14, 6057, 14, 83, 713, 529, 2577, 13, 20362, 198, 39344, 309, 291, 51, 330, 2514, 68, 198, 198, 9979, 9878, 15154, 796, 2558, 23, 7, 18, 8, 198, 198, 7249, 309, 291, 51, 330, 2514, 68, 198, 220, 220, 220, ...
1.923826
1,129
<filename>test/runtests.jl using BHTsne using Base.Test @test 1 == 1
[ 27, 34345, 29, 9288, 14, 81, 2797, 3558, 13, 20362, 198, 3500, 347, 6535, 82, 710, 198, 3500, 7308, 13, 14402, 198, 198, 31, 9288, 352, 6624, 352, 198 ]
2.413793
29
struct WikiCorpus{S} path::S end WikiCorpus() = WikiCorpus(datadep"English WikiCorpus v1.0") MultiResolutionIterators.levelname_map(::Type{WikiCorpus}) = [ :doc=>1, :document=>1, :section=>2, :para=>3, :line=>3, :paragraph=>3, :sent=>4, :sentence=>4, :word=>5, :token=>5, :char=>6, :characte...
[ 7249, 13078, 45680, 385, 90, 50, 92, 198, 220, 220, 220, 3108, 3712, 50, 198, 437, 198, 32603, 45680, 385, 3419, 796, 13078, 45680, 385, 7, 19608, 324, 538, 1, 15823, 13078, 45680, 385, 410, 16, 13, 15, 4943, 198, 198, 29800, 4965, ...
1.856201
1,669
<reponame>StephanSiemen/cfgrib.jl<filename>src/cfgrib.jl module cfgrib const cfgrib_jl_version = "0.0.0" include("constants.jl") include("cfmessage.jl") include("indexing.jl") include("dataset.jl") end
[ 27, 7856, 261, 480, 29, 8600, 7637, 42801, 8952, 14, 37581, 822, 13, 20362, 27, 34345, 29, 10677, 14, 37581, 822, 13, 20362, 198, 21412, 30218, 70, 822, 198, 198, 9979, 30218, 70, 822, 62, 20362, 62, 9641, 796, 366, 15, 13, 15, 13...
2.440476
84
<filename>src/004.jl<gh_stars>0 function solve_004() # Get all products of three digit numbers prods = zeros(Int64, 900, 900) for i=100:999, j=100:999 prods[i-99, j-99] = i*j end palindromes = filter(x -> x==reverse_int(x), prods) return maximum(palindromes) end
[ 27, 34345, 29, 10677, 14, 22914, 13, 20362, 27, 456, 62, 30783, 29, 15, 198, 8818, 8494, 62, 22914, 3419, 198, 220, 220, 220, 1303, 3497, 477, 3186, 286, 1115, 16839, 3146, 198, 220, 220, 220, 386, 9310, 796, 1976, 27498, 7, 5317, ...
2.244275
131
<reponame>PhilipVinc/YaoBlocks.jl using YaoBase """ content(x) Returns the content of `x`. """ content(x::AbstractContainer) = x.content """ chcontent(x, blk) Create a similar block of `x` and change its content to blk. """ chcontent(x::AbstractContainer, blk) = chsubblocks(x, blk) subblocks(x::AbstractCo...
[ 27, 7856, 261, 480, 29, 18673, 541, 53, 1939, 14, 56, 5488, 45356, 13, 20362, 198, 3500, 37826, 14881, 198, 198, 37811, 198, 220, 220, 220, 2695, 7, 87, 8, 198, 198, 35561, 262, 2695, 286, 4600, 87, 44646, 198, 37811, 198, 11299, ...
2.994019
836
struct Input{T} year::Vector{Int} month::Vector{Int} day::Vector{Int} hour::Vector{Int} SW::Vector{T} LW::Vector{T} Sf::Vector{T} Rf::Vector{T} Ta::Vector{T} RH::Vector{T} Ua::Vector{T} Ps::Vector{T} end Base.@kwdef struct Constants{T} cp::T = 1005 # Speci...
[ 7249, 23412, 90, 51, 92, 198, 220, 220, 220, 614, 3712, 38469, 90, 5317, 92, 198, 220, 220, 220, 1227, 3712, 38469, 90, 5317, 92, 198, 220, 220, 220, 1110, 3712, 38469, 90, 5317, 92, 198, 220, 220, 220, 1711, 3712, 38469, 90, 5317...
2.294211
3,144
module SandboxTests import ..Pkg # ensure we are using the correct Pkg using Test using UUIDs using Pkg using ..Utils test_test(fn, name; kwargs...) = Pkg.test(name; test_fn=fn, kwargs...) test_test(fn; kwargs...) = Pkg.test(;test_fn=fn, kwargs...) @testset "Basic `test` sandboxing" begin # also indirectly...
[ 21412, 3837, 3524, 51, 3558, 198, 11748, 11485, 47, 10025, 1303, 4155, 356, 389, 1262, 262, 3376, 350, 10025, 198, 198, 3500, 6208, 198, 3500, 471, 27586, 82, 198, 3500, 350, 10025, 198, 198, 3500, 11485, 18274, 4487, 198, 9288, 62, 9...
2.24247
664
<reponame>JuliaPlasma/ElectromagneticFields.jl<gh_stars>1-10 @doc raw""" Penning trap with magnetic bottle in (x,y,z) coordinates. Based on <NAME>, <NAME>, <NAME>, <NAME>, Study of adaptive symplectic methods for simulating charged particle dynamics, Journal of Computational Dynamics 6, 429-448, 2019. The covari...
[ 27, 7856, 261, 480, 29, 16980, 544, 3646, 11797, 14, 19453, 398, 25145, 15878, 82, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 31, 15390, 8246, 37811, 198, 25553, 768, 12840, 351, 14091, 9294, 287, 357, 87, 11, 88, 11, 89...
2.045936
1,415
WandererSymbol(x...) = Symbol(join(["Wanderer", x...], ".")) ARG = WandererSymbol("ARG") # we just need limited mangled symbols here. TYPE_ROOT = WandererSymbol("TYPE_ROOT") IN_TYPES = WandererSymbol("IN", "TYPES") IN_FIELDS = WandererSymbol("IN", "FIELDS") IN_SOURCE = WandererSymbol("IN", "SOURCE") OUT_TYPES = Wand...
[ 54, 392, 11882, 13940, 23650, 7, 87, 23029, 796, 38357, 7, 22179, 7, 14692, 54, 392, 11882, 1600, 2124, 986, 4357, 366, 526, 4008, 198, 198, 1503, 38, 796, 22420, 11882, 13940, 23650, 7203, 1503, 38, 4943, 1303, 356, 655, 761, 3614, ...
2.387309
457
<reponame>carterian8/CollectiveDynamics.jl<gh_stars>1-10 ### ============== ### ============== ### ## Short and Long-range ## ## interactions models ## ## (topological short-range) ## ## <NAME> ## ## EXAMPLE SIMULATION SCRIPT ## ### ============== ### =====...
[ 27, 7856, 261, 480, 29, 66, 2571, 666, 23, 14, 31337, 425, 35, 4989, 873, 13, 20362, 27, 456, 62, 30783, 29, 16, 12, 940, 198, 21017, 796, 25609, 28, 44386, 796, 25609, 28, 44386, 198, 2235, 220, 220, 220, 10073, 290, 5882, 12, ...
2.518382
1,360
using Test include("cas_infer.jl") ex1 = :(cos(1 + 3.0) + 4 + (4-4im)) ex2 = :("ciao" * 2) ex3 = :("ciao" * " mondo") @test ComplexF64 == infer(ex1) @test_throws MethodError infer(ex2) @test String == infer(ex3)
[ 3500, 6208, 198, 198, 17256, 7203, 34004, 62, 259, 2232, 13, 20362, 4943, 198, 198, 1069, 16, 796, 36147, 6966, 7, 16, 1343, 513, 13, 15, 8, 1343, 604, 1343, 357, 19, 12, 19, 320, 4008, 198, 1069, 17, 796, 1058, 7203, 66, 13481, ...
2.18
100
function uncertainty_set_with_index(i, data, ϵ) set = uncertainty_set(data[i, :], ϵ) return collect(zip(fill(i, length(set)), set)) end function combine(a::NTuple{K, Tuple{CartesianIndex{M}, Vector{Float64}}}, s::NTuple{N, Int})::Array{Float64, N} where {M, N, K} @assert M == N - 1 p = zeros(s...) ...
[ 8818, 13479, 62, 2617, 62, 4480, 62, 9630, 7, 72, 11, 1366, 11, 18074, 113, 8, 198, 220, 220, 220, 900, 796, 13479, 62, 2617, 7, 7890, 58, 72, 11, 1058, 4357, 18074, 113, 8, 198, 220, 220, 220, 1441, 2824, 7, 13344, 7, 20797, ...
2.25
384
using AbstractTrees: AbstractShadowTree abstract type AbstractJLBoostTree <: AbstractShadowTree end mutable struct JLBoostTreeModel jlt::Vector loss # this should be a function with deriv defined target::Symbol end """ trees(jlt::JLBoostTreeModel) Return the trees from a tree-model """ trees(jlt::JLBoostTreeMod...
[ 3500, 27741, 51, 6037, 25, 27741, 27447, 27660, 198, 198, 397, 8709, 2099, 27741, 41, 43, 45686, 27660, 1279, 25, 27741, 27447, 27660, 886, 198, 198, 76, 18187, 2878, 449, 43, 45686, 27660, 17633, 198, 197, 73, 2528, 3712, 38469, 198, ...
2.320563
1,279
<gh_stars>1-10 #= The robust control problem for a monopolist with adjustment costs. The inverse demand curve is: p_t = a_0 - a_1 y_t + d_t where d_{t+1} = \rho d_t + \sigma_d w_{t+1} for w_t ~ N(0,1) and iid. The period return function for the monopolist is r_t = p_t y_t - gam (y_{t+1} - y_t)^2 / 2 - c y_t ...
[ 27, 456, 62, 30783, 29, 16, 12, 940, 198, 198, 2, 28, 198, 198, 464, 12373, 1630, 1917, 329, 257, 30797, 396, 351, 15068, 3484, 13, 220, 383, 198, 259, 4399, 3512, 12133, 318, 25, 628, 220, 279, 62, 83, 796, 257, 62, 15, 532, ...
2.149527
1,585
<reponame>Balinus/DimensionalData.jl basetype(x) = basetype(typeof(x)) basetype(t::Type) = t.name.wrapper basetype(t::UnionAll) = t f <| x = f(x) # This shouldn't be hard coded, but it makes plots tolerable for now shorten(x::AbstractFloat) = round(x, sigdigits=3) shorten(x) = x # Nothing doesn't string getstring(:...
[ 27, 7856, 261, 480, 29, 33, 14414, 385, 14, 35, 16198, 6601, 13, 20362, 198, 12093, 2963, 431, 7, 87, 8, 796, 1615, 2963, 431, 7, 4906, 1659, 7, 87, 4008, 198, 12093, 2963, 431, 7, 83, 3712, 6030, 8, 796, 256, 13, 3672, 13, 48...
2.5
144
const known_vargroups = Dict( "Atmosphere"=>[ "aerosol_optical_thickness_1610", "aerosol_optical_thickness_550", "aerosol_optical_thickness_555", "aerosol_optical_thickness_659", "aerosol_optical_thickness_865", "air_temperature_2m", "o...
[ 9979, 1900, 62, 85, 853, 14459, 796, 360, 713, 7, 198, 1, 2953, 6384, 1456, 1, 14804, 58, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 25534, 418, 349, 62, 8738, 605, 62, 400, 624, 1108, 62, 1433, 940, 1600, ...
1.746799
1,406
for n in [2, 20, 200, 2000] x = randn(Float32, n, n) model = Dense(n, n) println("CPU n=$n") run_benchmark(model, x, cuda=false) println("CUDA n=$n") run_benchmark(model, x, cuda=true) end
[ 1640, 299, 287, 685, 17, 11, 1160, 11, 939, 11, 4751, 60, 198, 220, 220, 220, 2124, 796, 43720, 77, 7, 43879, 2624, 11, 299, 11, 299, 8, 198, 220, 220, 220, 2746, 796, 360, 1072, 7, 77, 11, 299, 8, 198, 220, 220, 220, 44872, ...
2.028037
107
## Example: ## DGP - Bivariate VAR(1) Model from Kilian, RESTAT, 1998 # B11 set to 0.01 using VectorAutoregressions using Plots plotly() using Random, LinearAlgebra using Statistics, GrowableArrays const T,K = 1000,2 const H = 24 const nrep = 1000 const p = 1 const intercept = false const burnin = 100 # Random.seed...
[ 2235, 17934, 25, 220, 198, 2235, 360, 16960, 532, 347, 42524, 569, 1503, 7, 16, 8, 9104, 422, 19902, 666, 11, 30617, 1404, 11, 7795, 198, 2, 347, 1157, 900, 284, 657, 13, 486, 198, 3500, 20650, 16541, 382, 5914, 507, 198, 3500, 13...
2.044872
780
<gh_stars>0 #= Copyright (c) 2016 Facebook This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. Ported to Julia by <NAME>, 2021 =# ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 0) ...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 28, 15069, 357, 66, 8, 1584, 3203, 628, 220, 220, 770, 1430, 318, 1479, 3788, 26, 345, 460, 17678, 4163, 340, 290, 14, 273, 198, 220, 220, 13096, 340, 739, 262, 2846, 286, 2196, 362, 286, 262,...
2.035063
3,565
<reponame>ziyiyin97/ADCME.jl<filename>deps/Plugin/MPITensor/test_mpi_tensor_solve.jl include("ops.jl") using Test mpi_init() A = Float64[1 0 2 0 3 0 0 1 2 3 0 3 4 1 0 0 4 2 1 0 1 1 2 0 1] A = A * A' B = SparseTensor(A) rhs = rand(5) ilower = 0 iupper = 4 solver = "GMRES" printlevel = 2 rows, ncols,...
[ 27, 7856, 261, 480, 29, 89, 7745, 7745, 259, 5607, 14, 2885, 34, 11682, 13, 20362, 27, 34345, 29, 10378, 82, 14, 37233, 14, 7378, 2043, 22854, 14, 9288, 62, 3149, 72, 62, 83, 22854, 62, 82, 6442, 13, 20362, 198, 17256, 7203, 2840,...
2.062077
886
<reponame>scuervo91/LinearSolvers.jl function ThomasLU(A) #A = the matrix of coefficients 'A' must be squared m,n =size(A) if m != n error("Matrix must be squared") end e=zeros(m-1) f=zeros(m) g=zeros(m-1) f[1]=A[1,1] for i=2:m e[i-1]=A[i,i-1]/f[i-1] ...
[ 27, 7856, 261, 480, 29, 1416, 84, 712, 78, 6420, 14, 14993, 451, 36949, 690, 13, 20362, 198, 8818, 5658, 41596, 7, 32, 8, 201, 198, 201, 198, 220, 1303, 32, 796, 262, 17593, 286, 44036, 705, 32, 6, 1276, 307, 44345, 201, 198, 20...
1.568254
315
include(normpath(joinpath(@__DIR__, "IOM", "src", "models", "EMOM", "EMOM.jl"))) using NCDatasets using MPI using Formatting MPI.Init() println("Processing data...") using TOML config = TOML.parsefile("data/config.toml") init_POP_file = "hist/paper2021_POP2_CTL.pop.h.daily.0002-01-01.nc" domain_file = config["MODEL...
[ 17256, 7, 27237, 6978, 7, 22179, 6978, 7, 31, 834, 34720, 834, 11, 366, 40, 2662, 1600, 366, 10677, 1600, 366, 27530, 1600, 366, 3620, 2662, 1600, 366, 3620, 2662, 13, 20362, 1, 22305, 198, 3500, 399, 8610, 265, 292, 1039, 198, 3500...
2.140221
813
<filename>src/algorithm.jl @params struct AugLag2 <: AbstractOptimizer primaloptimizer dualoptimizer end function AugLag2(; primaloptimizer = Optim.ConjugateGradient(linesearch=Optim.LineSearches.BackTracking(iterations = 10)), dualoptimizer = Optim.GradientDescent(linesearch=Optim.LineSearches.BackTra...
[ 27, 34345, 29, 10677, 14, 282, 42289, 13, 20362, 198, 198, 31, 37266, 2878, 2447, 43, 363, 17, 1279, 25, 27741, 27871, 320, 7509, 198, 220, 220, 220, 43750, 40085, 7509, 198, 220, 220, 220, 10668, 40085, 7509, 198, 437, 198, 8818, 2...
2.189443
3,410
<filename>src/batches/Batches.jl module Batches import ..Flux include("batch.jl") end
[ 27, 34345, 29, 10677, 14, 8664, 2052, 14, 33, 20981, 13, 20362, 198, 21412, 6577, 2052, 198, 198, 11748, 11485, 37, 22564, 198, 198, 17256, 7203, 43501, 13, 20362, 4943, 198, 198, 437, 198 ]
2.617647
34
<filename>src/SolidStateDetectors.jl # This file is a part of SolidStateDetectors.jl, licensed under the MIT License (MIT). __precompile__(true) module SolidStateDetectors using LinearAlgebra using Random using Statistics using ArraysOfArrays using Interpolations using IntervalSets using JSON using La...
[ 27, 34345, 29, 10677, 14, 46933, 9012, 47504, 669, 13, 20362, 198, 2, 770, 2393, 318, 257, 636, 286, 15831, 9012, 47504, 669, 13, 20362, 11, 11971, 739, 262, 17168, 13789, 357, 36393, 737, 201, 198, 201, 198, 834, 3866, 5589, 576, 8...
3.016706
838
module TensorDecompositions using TensorOperations using Distributions using ProgressMeter using Base.Cartesian using StatsBase using LinearAlgebra export # types SparseArray, TensorDecompositions, PARAFAC2, CANDECOMP, CUR, Tucker, # TensorDecomposition methods rel_res...
[ 21412, 309, 22854, 10707, 296, 1930, 1756, 198, 220, 220, 220, 1262, 309, 22854, 18843, 602, 198, 220, 220, 220, 1262, 46567, 507, 198, 220, 220, 220, 1262, 18387, 44, 2357, 198, 220, 220, 220, 1262, 7308, 13, 43476, 35610, 198, 220, ...
2.265938
549
function plotbenchmarks(; write_results = OPTIONS["write_results"], test = OPTIONS["test"], blas_num_threads = OPTIONS["blas_num_threads"], blocksparse_num_threads = OPTIONS["blocksparse_num_threads"], maxdims = OPT...
[ 198, 8818, 7110, 26968, 14306, 7, 26, 3551, 62, 43420, 796, 39852, 11053, 14692, 13564, 62, 43420, 33116, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
2.099211
2,409
<reponame>marcobonici/CosmoCentral.jl<filename>src/CosmologicalStructures.jl abstract type AbstractCosmology end abstract type AbstractCosmologicalGrid end abstract type AbstractBackgroundQuantities end abstract type BoltzmannSolverParams end abstract type AbstractDensity end abstract type AbstractConvolvedDensity end ...
[ 27, 7856, 261, 480, 29, 3876, 66, 672, 9229, 72, 14, 36734, 5908, 30645, 13, 20362, 27, 34345, 29, 10677, 14, 36734, 76, 2770, 44909, 942, 13, 20362, 198, 397, 8709, 2099, 27741, 36734, 29126, 886, 198, 397, 8709, 2099, 27741, 36734, ...
2.554545
5,280
<reponame>Saransh-cpp/Calc.jl<filename>src/Subtract.jl """ subtract(x, y) Perform subtraction between two floating point numbers. # Arguments - `a::Float64`: Number 1. - `b::Float64`: Number 2. # Returns - `a - b::Float64` # Examples ```julia-repl julia> subtract(1.0, 2.0) -1.0 ``` """ subtract(a::Float64, b::F...
[ 27, 7856, 261, 480, 29, 50, 283, 504, 71, 12, 20322, 14, 9771, 66, 13, 20362, 27, 34345, 29, 10677, 14, 7004, 83, 974, 13, 20362, 198, 37811, 198, 220, 220, 220, 34128, 7, 87, 11, 331, 8, 198, 198, 5990, 687, 13284, 7861, 1022, ...
2.27027
148
# v0.12 deprecations @deprecate Dropout(p, dims) Dropout(p; dims=dims) @deprecate InstanceNorm(λ, β, γ, μ, σ², ϵ, momentum) InstanceNorm(λ, β, γ, μ, σ², ϵ, momentum, true, true, nothing) @deprecate BatchNorm(λ, β, γ, μ, σ², ϵ, momentum) BatchNorm(λ, β, γ, μ, σ², ϵ, momentum, true, true, nothing) @deprecate GroupNorm(G,...
[ 2, 410, 15, 13, 1065, 1207, 8344, 602, 198, 31, 10378, 8344, 378, 14258, 448, 7, 79, 11, 5391, 82, 8, 14258, 448, 7, 79, 26, 5391, 82, 28, 67, 12078, 8, 198, 31, 10378, 8344, 378, 2262, 590, 35393, 7, 39377, 11, 27169, 11, 737...
2.509847
457
# Extract data from a 2D/3D DG solution and prepare it for visualization as a heatmap/contour plot. # # Returns a tuple with # - x coordinates # - y coordinates # - nodal 2D data # - x vertices for mesh visualization # - y vertices for mesh visualization # # Note: This is a low-level function that is not considered as ...
[ 2, 29677, 1366, 422, 257, 362, 35, 14, 18, 35, 46133, 4610, 290, 8335, 340, 329, 32704, 355, 257, 4894, 8899, 14, 3642, 454, 7110, 13, 198, 2, 198, 2, 16409, 257, 46545, 351, 198, 2, 532, 2124, 22715, 198, 2, 532, 331, 22715, 19...
2.650706
1,629
<gh_stars>0 # Create a special type for permutations. The real point here is to be able to # unambiguously identify an RRPermArray (see below) so that we may "unwrap" in # expressions like `channelview(colorview(C, A))`. """ ColorChanPerm(perm) Construct a reordering permutation for the color channel. This handles sw...
[ 27, 456, 62, 30783, 29, 15, 198, 2, 13610, 257, 2041, 2099, 329, 9943, 32855, 13, 383, 1103, 966, 994, 318, 284, 307, 1498, 284, 198, 2, 42053, 328, 24987, 5911, 281, 26067, 5990, 76, 19182, 357, 3826, 2174, 8, 523, 326, 356, 743,...
2.402634
5,392