content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
include("../src/RichVehicleRoutingProblem.jl")
const RVRP = RichVehicleRoutingProblem
using Test
include("unit_tests/unit_tests.jl")
unit_tests()
| [
17256,
7203,
40720,
10677,
14,
14868,
37870,
1548,
49,
13660,
40781,
13,
20362,
4943,
198,
9979,
371,
13024,
47,
796,
3998,
37870,
1548,
49,
13660,
40781,
198,
198,
3500,
6208,
198,
198,
17256,
7203,
20850,
62,
41989,
14,
20850,
62,
419... | 2.921569 | 51 |
include(joinpath("structures", "cluster.jl"))
include(joinpath("structures", "dataitem.jl"))
include(joinpath("structures", "eva.jl"))
include(joinpath("structures", "fittedeva.jl"))
| [
17256,
7,
22179,
6978,
7203,
7249,
942,
1600,
366,
565,
5819,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
7249,
942,
1600,
366,
7890,
9186,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
7249,
942,
1600,
366,
48855,
13,
2... | 3.101695 | 59 |
<reponame>chachaleo/Polyhedra.jl
import GeometryBasics
"""
struct Mesh{N, T, PT <: Polyhedron{T}} <: GeometryBasics.GeometryPrimitive{N, T}
polyhedron::PT
coordinates::Union{Nothing, Vector{GeometryBasics.Point{3, T}}}
faces::Union{Nothing, Vector{GeometryBasics.TriangleFace{Int}}}
... | [
27,
7856,
261,
480,
29,
354,
620,
1000,
78,
14,
34220,
704,
430,
13,
20362,
198,
11748,
2269,
15748,
15522,
873,
198,
198,
37811,
198,
220,
220,
220,
2878,
47529,
90,
45,
11,
309,
11,
19310,
1279,
25,
12280,
704,
1313,
90,
51,
117... | 2.010028 | 3,989 |
@testset "Variables" begin
m = Model()
@variable(m, x ≥ 0, u"m/s")
@test x == UnitJuMP.UnitVariableRef(x.vref, u"m/s")
@test unit(x) == u"m/s"
@test owner_model(x) === m
@variable(m, y[1:4], u"km/hr")
@test y[1] == UnitJuMP.UnitVariableRef(y[1].vref, u"km/hr")
end
@testset "Constrai... | [
31,
9288,
2617,
366,
23907,
2977,
1,
2221,
628,
220,
220,
220,
285,
796,
9104,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
45286,
7,
76,
11,
2124,
26870,
657,
11,
334,
1,
76,
14,
82,
4943,
198,
220,
220,
220,
2488,
... | 1.937804 | 1,029 |
<reponame>NHDaly/pongClone
mutable struct Timer
starttime_ns::typeof(Base.time_ns())
paused_elapsed_ns::typeof(Base.time_ns())
Timer() = new(0,0)
end
function start!(timer::Timer)
timer.starttime_ns = (Base.time_ns)()
return nothing
end
started(timer::Timer) = (timer.starttime_ns ≠ 0)
""" Return s... | [
27,
7856,
261,
480,
29,
45,
10227,
3400,
14,
79,
506,
2601,
505,
198,
76,
18187,
2878,
5045,
263,
198,
220,
220,
220,
923,
2435,
62,
5907,
3712,
4906,
1659,
7,
14881,
13,
2435,
62,
5907,
28955,
198,
220,
220,
220,
24487,
62,
417,
... | 2.543353 | 346 |
<filename>src/utils.jl
using Downloads
# WARNING: THIS FILE IS WORK-IN-PROGRESS
#--------------------------------------------------------------------
# Metadata info: dimensions
#--------------------------------------------------------------------
function listdimensions(apiurl::String, dataflow::String)
io = IO... | [
27,
34345,
29,
10677,
14,
26791,
13,
20362,
198,
3500,
50093,
198,
198,
2,
39410,
25,
12680,
45811,
3180,
30936,
12,
1268,
12,
4805,
49656,
7597,
198,
198,
2,
10097,
650,
198,
2,
3395,
14706,
7508,
25,
15225,
198,
2,
10097,
650,
198... | 3.030354 | 593 |
<filename>files/db/migrations/2021061519532446_create_table_roles_users.jl
module CreateTableRolesUsers
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
function up()
create_table(:rolesusers) do
[
primary_key()
column(:roles_id, :int)
column(:users_id, :... | [
27,
34345,
29,
16624,
14,
9945,
14,
76,
3692,
602,
14,
19004,
15801,
1314,
1129,
4310,
1731,
3510,
62,
17953,
62,
11487,
62,
305,
829,
62,
18417,
13,
20362,
198,
21412,
13610,
10962,
49,
4316,
14490,
198,
198,
11748,
11140,
15047,
13,... | 2.414508 | 193 |
<filename>lib/cufft/util.jl
const cufftNumber = Union{cufftDoubleReal,cufftReal,cufftDoubleComplex,cufftComplex}
const cufftReals = Union{cufftDoubleReal,cufftReal}
const cufftComplexes = Union{cufftDoubleComplex,cufftComplex}
const cufftDouble = Union{cufftDoubleReal,cufftDoubleComplex}
const cufftSingle = Union{cufft... | [
27,
34345,
29,
8019,
14,
66,
1648,
83,
14,
22602,
13,
20362,
198,
9979,
47291,
83,
15057,
796,
4479,
90,
66,
1648,
83,
25628,
15633,
11,
66,
1648,
83,
15633,
11,
66,
1648,
83,
25628,
5377,
11141,
11,
66,
1648,
83,
5377,
11141,
92,... | 2.332155 | 566 |
<filename>src/composite/control.jl<gh_stars>0
using YaoArrayRegister
using YaoArrayRegister: matvec
export ControlBlock, control, cnot
struct ControlBlock{N, BT<:AbstractBlock, C, M} <: AbstractContainer{BT, N}
ctrl_locs::NTuple{C, Int}
ctrl_config::NTuple{C, Int}
content::BT
locs::NTuple{M, Int}
... | [
27,
34345,
29,
10677,
14,
785,
1930,
578,
14,
13716,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
37826,
19182,
38804,
198,
3500,
37826,
19182,
38804,
25,
2603,
35138,
198,
198,
39344,
6779,
12235,
11,
1630,
11,
269,
1662,
198,
... | 2.424748 | 2,578 |
<filename>julia/turing/coin_bias.jl
#=
This is a port of the R2 model CoinBias.cs
Output from the R2 model:
```
Mean: 0.421294
Variance: 0.0162177
Number of accepted samples = 692
```
This model:
parameters mean std naive_se mcse ess rhat ess_per_se... | [
27,
34345,
29,
73,
43640,
14,
83,
870,
14,
3630,
62,
65,
4448,
13,
20362,
198,
2,
28,
628,
220,
220,
220,
770,
318,
257,
2493,
286,
262,
371,
17,
2746,
16312,
33,
4448,
13,
6359,
220,
628,
220,
220,
220,
25235,
422,
262,
371,
... | 2.105839 | 548 |
# Starting with the number 1 and moving to the right in a clockwise direction a
# 5 by 5 spiral is formed as follows:
#
# 21 22 23 24 25 26
# 20 7 8 9 10 27
# 19 6 1 2 11 28
# 18 5 4 3 12 29
# 17 16 15 14 13 30
#
# It can be verified that the sum of the numbers on the diagonals is 101.
#
# What is the sum of t... | [
2,
17962,
351,
262,
1271,
352,
290,
3867,
284,
262,
826,
287,
257,
8801,
3083,
4571,
257,
198,
2,
642,
416,
642,
23642,
318,
7042,
355,
5679,
25,
198,
2,
198,
2,
2310,
2534,
2242,
1987,
1679,
2608,
198,
2,
1160,
220,
767,
220,
8... | 2.4784 | 625 |
<reponame>caseykneale/ChemometricsData.jl
"""
check_MD5( file_path, checksum )
returns a MD5 hash from a file location.
Note: this converts Int8 representations to comma delimitted strings.
"""
get_MD5( file_path ) = join( string.( open(md5, file_path) ), "," )
"""
check_MD5( file_path, checksum )
Checks the ... | [
27,
7856,
261,
480,
29,
7442,
48361,
710,
1000,
14,
41829,
908,
10466,
6601,
13,
20362,
198,
37811,
198,
220,
220,
220,
2198,
62,
12740,
20,
7,
2393,
62,
6978,
11,
8794,
388,
1267,
198,
7783,
82,
257,
10670,
20,
12234,
422,
257,
2... | 2.97076 | 171 |
<reponame>GustavoSasaki/Advent-Of-Code-2020-in-Julia
### A Pluto.jl notebook ###
# v0.12.16
using Markdown
using InteractiveUtils
# ╔═╡ 5e8c4976-3727-11eb-2801-0313fd547ac2
file = open(f->read(f, String), "day_1.txt")
# ╔═╡ bd9f511c-3727-11eb-38e3-ad2be4ac32fc
begin
#separing each line
input = eachmatch(r"(.+)\n",... | [
27,
7856,
261,
480,
29,
38,
436,
615,
34049,
33846,
14,
2782,
1151,
12,
5189,
12,
10669,
12,
42334,
12,
259,
12,
16980,
544,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1065,
13,
1433,
198,
198,
3500,
294... | 1.751543 | 648 |
using TestPackage
using Test
@testset "TestPackage.jl" begin
@test 8 == testFunction(4)
end
| [
3500,
6208,
27813,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
14402,
27813,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
9288,
807,
6624,
1332,
22203,
7,
19,
8,
198,
437,
198
] | 2.852941 | 34 |
<gh_stars>0
# using Base:splat
using JSON
using SQLite
splat_db = SQLite.DB("../splatalogue_v3.db")
SQLite.tables(splat_db)
freq_start = 688.2213591803346
freq_end = 689.3824263880999
strSQL = "SELECT * FROM lines WHERE frequency>=$freq_start AND frequency<=$freq_end;"
println(strSQL)
has_molecules = false
resp = I... | [
27,
456,
62,
30783,
29,
15,
198,
2,
1262,
7308,
25,
22018,
265,
198,
3500,
19449,
198,
3500,
16363,
578,
198,
198,
22018,
265,
62,
9945,
796,
16363,
578,
13,
11012,
7203,
40720,
22018,
10254,
5119,
62,
85,
18,
13,
9945,
4943,
198,
... | 2.442177 | 294 |
<filename>src/offlineAnalysis/PV.jl
function vor( u :: Array{Float64,2}, v :: Array{Float64,2}, m :: MITgcmDatas)
dudy = dimDiff(u, 2, OnePointR()) /m.dyspacing
dvdx = dimDiff(v, 1, OnePointR()) /m.dxspacing
return (dvdx - dudy)
end
function vor( u :: Array{Float64,3}, v :: Array{Float64,3}, m :: MITgcmDatas)
... | [
27,
34345,
29,
10677,
14,
2364,
1370,
32750,
14,
47,
53,
13,
20362,
198,
8818,
410,
273,
7,
334,
7904,
15690,
90,
43879,
2414,
11,
17,
5512,
410,
7904,
15690,
90,
43879,
2414,
11,
17,
5512,
285,
7904,
17168,
70,
11215,
27354,
292,
... | 1.973159 | 1,453 |
using thesis, PGFPlotsX
setup_pgfplotsx()
ts = LinRange(thesis.example_trange..., 21)
tts = LinRange(thesis.example_trange..., 201)
## Digital neuron
num_bits = 4
thresholds_dig = LinRange(thesis.example_yrange..., 2^num_bits+1)
levels_dig = 0.5*(thresholds_dig[1:end-1]+thresholds_dig[2:end])
ys_dig = thesis.example... | [
3500,
21554,
11,
350,
21713,
3646,
1747,
55,
198,
40406,
62,
6024,
69,
489,
1747,
87,
3419,
628,
198,
912,
796,
5164,
17257,
7,
83,
8497,
13,
20688,
62,
2213,
858,
986,
11,
2310,
8,
198,
83,
912,
796,
5164,
17257,
7,
83,
8497,
1... | 2.154785 | 4,587 |
<reponame>victorialena/DecomposedMDPSolver.jl<gh_stars>0
using DecomposedMDPSolver
using Flux
using Test
Na = 5
Np = 10
solutions = [(x) -> rand(Na) for i=1:Np ]
## Weights network
base = Chain(Dense(4, 32, relu), Dense(32, Na))
attn = Chain(Dense(4, 32, relu), Dense(32, Np+1), softmax)
a2t_model = A2TNetwork(base, a... | [
27,
7856,
261,
480,
29,
32433,
5132,
8107,
14,
10707,
3361,
1335,
12740,
3705,
14375,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
4280,
3361,
1335,
12740,
3705,
14375,
198,
3500,
1610,
2821,
198,
3500,
6208,
198,
198,
26705,
796... | 2.317391 | 460 |
<filename>P/Perl/build_tarballs.jl
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg
name = "Perl"
version = v"5.30.3"
# Collection of sources required to build perl
# with a few extra modules for polymake
so... | [
27,
34345,
29,
47,
14,
5990,
75,
14,
11249,
62,
18870,
21591,
13,
20362,
198,
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,
... | 2.411351 | 1,991 |
<reponame>jarrison/Gage.jl
module Gage
using Libdl
@show include("gagestructs.jl")
using Main.GageStructs: BoardInfo
##############################################
#### GageAPI Methods ####
##############################################
# Julia translations of the Gage Driver API.
# Low-level opera... | [
27,
7856,
261,
480,
29,
73,
22472,
14,
38,
496,
13,
20362,
198,
21412,
402,
496,
198,
3500,
7980,
25404,
198,
31,
12860,
2291,
7203,
70,
363,
395,
1356,
82,
13,
20362,
4943,
198,
3500,
8774,
13,
38,
496,
44909,
82,
25,
5926,
12360... | 2.26158 | 1,101 |
<filename>utils/drive_metrics_solenoid.jl
include("../src/get_sens_solenoid_K.jl")
s = [1.0, 4.0, 0.0]
sens(s, 200000)
| [
27,
34345,
29,
26791,
14,
19472,
62,
4164,
10466,
62,
82,
8622,
1868,
13,
20362,
198,
17256,
7203,
40720,
10677,
14,
1136,
62,
82,
641,
62,
82,
8622,
1868,
62,
42,
13,
20362,
4943,
198,
82,
796,
685,
16,
13,
15,
11,
604,
13,
15,... | 1.983333 | 60 |
function _fit(glr::GLR{RobustLoss{ρ},<:L2R}, solver::IWLSCG, X, y, scratch
) where {ρ}
n,p,_ = npc(scratch)
_Mv! = Mv!(glr, X, y, scratch; threshold=solver.threshold)
κ = solver.damping # between 0 and 1, 1 = fully take the new iteration
# cache
θ = zeros(p)
θ_ = zeros(p)
b... | [
8818,
4808,
11147,
7,
4743,
81,
3712,
8763,
49,
90,
14350,
436,
43,
793,
90,
33643,
5512,
27,
25,
43,
17,
49,
5512,
1540,
332,
3712,
40,
54,
43,
6173,
38,
11,
1395,
11,
331,
11,
12692,
198,
220,
220,
220,
220,
220,
220,
220,
2... | 1.862573 | 684 |
<reponame>AlexAtanasov14/GalerkinSparseGrids.jl<gh_stars>10-100
# -----------------------------------------------------------
#
# Constructing the Hierarchical Discontinuous Galerkin Basis
#
# -----------------------------------------------------------
# Efficiency criticality: LOW
# Computations only performed once
... | [
27,
7856,
261,
480,
29,
15309,
2953,
15991,
709,
1415,
14,
26552,
263,
5116,
50,
29572,
8642,
2340,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
20368,
22369,
6329,
198,
2,
198,
2,
28407,
278,
262,
36496,
998,
605,
84... | 2.570904 | 2,722 |
@inline function Phi_se(Cell,s,z,Def,ϕ_tf,D,res0)
"""
Solid-Electrolyte Potential Transfer Function
Phi_se(Cell,s,z,Def)
"""
if Def == "Pos"
Electrode = Cell.Pos #Electrode Length
else
Electrode = Cell.Neg #Electrode Length
end
κ_eff = Cell.Const.κ*Electrode.ϵ_e^Electrode.κ_brug #Effective Electrol... | [
31,
45145,
2163,
47256,
62,
325,
7,
28780,
11,
82,
11,
89,
11,
7469,
11,
139,
243,
62,
27110,
11,
35,
11,
411,
15,
8,
198,
37811,
220,
198,
220,
220,
15831,
12,
19453,
305,
306,
660,
32480,
20558,
15553,
628,
220,
220,
47256,
62... | 1.958258 | 1,102 |
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: iotsitewise
using AWS.Compat
using AWS.UUIDs
"""
associate_assets(asset_id, child_asset_id, hierarchy_id)
associate_assets(asset_id, child_asset_id, hierarchy_id, params::Dict{String,<:Any})
Associates a child asset with the give... | [
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,
1312,
1747,
270,
413,
786,
198,
3500,
30865,
13,
40073,
198,
3500,
30865,
13,
52,
27586,
82,
... | 3.26843 | 24,606 |
<reponame>UnofficialJuliaMirrorSnapshots/JulieTest.jl-885aceaa-7568-5b56-b2d4-116a98ea4ee1
OK = '✓'
FAIL= '✖'
RESET = "\033[0m"
PAD = " " ^ 2
FAINT_COLOR = "\033[90m"
PASS_COLOR = "\033[32m"
PASS_LIGHT_COLOR = "\033[92m"
FAILED_COLOR = "\033[31m"
FAILED_LIGHT_COLOR = "\033[91m"
HOUR = 3600_000
MINUTES = 60_000
SECOND =... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
16980,
494,
14402,
13,
20362,
12,
44230,
558,
7252,
12,
2425,
3104,
12,
20,
65,
3980,
12,
65,
17,
67,
19,
12,
18298,
64,
4089,
18213,
19,
1453,
16,
19... | 2.372021 | 965 |
"""
`generateVTK(filename, points; lines, cells, point_data, path, num, time)`
Generates a vtk file with the given data. Written by <NAME>.
**Arguments**
* `points::Array{Array{Float64,1},1}` : Points to output.
**Optional Arguments**
* `lines::Array{Array{Int64,1},1}` : line definitions. lines[i] contai... | [
37811,
198,
220,
4600,
8612,
378,
36392,
42,
7,
34345,
11,
2173,
26,
3951,
11,
4778,
11,
966,
62,
7890,
11,
3108,
11,
997,
11,
640,
8,
63,
198,
8645,
689,
257,
410,
30488,
2393,
351,
262,
1813,
1366,
13,
22503,
416,
1279,
20608,
... | 2.056792 | 2,606 |
@info("Please allow up to 20 minutes for all tests to execute.")
import SeisIO
import SeisIO: get_svn
cd(dirname(pathof(SeisIO))*"/../test")
get_svn("https://github.com/jpjones76/SeisIO-TestData/trunk/SampleFiles", "SampleFiles")
include("local_restricted.jl")
include("test_helpers.jl")
# Announce test begin
... | [
31,
10951,
7203,
5492,
1249,
510,
284,
1160,
2431,
329,
477,
5254,
284,
12260,
19570,
201,
198,
11748,
1001,
271,
9399,
201,
198,
11748,
1001,
271,
9399,
25,
651,
62,
21370,
77,
201,
198,
10210,
7,
15908,
3672,
7,
6978,
1659,
7,
465... | 2.253456 | 868 |
<gh_stars>1-10
using JLD2
using PyPlot
using Statistics
using Printf
nfile = 8
include("../../../src/loglinspace.jl")
include("../../../src/histogram_code.jl")
# Load in likelihood profile:
#@load "T1_likelihood_profile_student_all_3.0sig.jld2"
@load "../../../data/T1_likelihood_profile_student_all_3.0sig_v02.jld2"
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
628,
198,
3500,
449,
11163,
17,
198,
3500,
9485,
43328,
198,
3500,
14370,
198,
3500,
12578,
69,
198,
77,
7753,
796,
807,
198,
17256,
7203,
40720,
40720,
40720,
10677,
14,
6404,
21602,
10223,
13,
... | 1.908894 | 4,160 |
<reponame>JuliaOpt/MathOptInterface.jl
# 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.
"""
abstract type AbstractBridge <: MOI.Bridge... | [
27,
7856,
261,
480,
29,
16980,
544,
27871,
14,
37372,
27871,
39317,
13,
20362,
198,
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... | 2.668504 | 1,270 |
# Example from Nocedal & Wright, p. 281
# Used to test all the different algorithms
@testset "2by2" begin
function f_2by2!(F, x)
F[1] = (x[1]+3)*(x[2]^3-7)+18
F[2] = sin(x[2]*exp(x[1])-1)
end
function g_2by2!(J, x)
J[1, 1] = x[2]^3-7
J[1, 2] = 3*x[2]^2*(x[1]+3)
u = exp(x[1])*cos(x[2]*exp(x[1])-1)... | [
2,
17934,
422,
399,
420,
276,
282,
1222,
12206,
11,
279,
13,
39882,
198,
2,
16718,
284,
1332,
477,
262,
1180,
16113,
198,
31,
9288,
2617,
366,
17,
1525,
17,
1,
2221,
628,
198,
8818,
277,
62,
17,
1525,
17,
0,
7,
37,
11,
2124,
8... | 2.101493 | 1,005 |
<reponame>UnofficialJuliaMirrorSnapshots/MusicManipulations.jl-274955c0-c284-5bf7-b122-5ecd51c559de<filename>test/quantizer_tests.jl<gh_stars>10-100
using Test
let
cd(@__DIR__)
midi = readMIDIFile("serenade_full.mid")
piano = midi.tracks[4]
notes = getnotes(piano, midi.tpq)
tpq = 960
triplets = [0, 1//3, 2//3, 1]
six... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
22648,
5124,
541,
5768,
13,
20362,
12,
1983,
2920,
2816,
66,
15,
12,
66,
30336,
12,
20,
19881,
22,
12,
65,
18376,
12,
20,
21142,
4349,
66,
38605,
2934,
... | 2.250797 | 941 |
<reponame>uoa-ems-research/JEMSS.jl
##########################################################################
# Copyright 2017 <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# h... | [
27,
7856,
261,
480,
29,
84,
12162,
12,
5232,
12,
34033,
14,
41,
3620,
5432,
13,
20362,
198,
29113,
29113,
7804,
2235,
198,
2,
15069,
2177,
1279,
20608,
28401,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
... | 2.584665 | 626 |
<gh_stars>0
function __init__cifar100()
DEPNAME = "CIFAR100"
register(DataDep(
DEPNAME,
"""
Dataset: The CIFAR-100 dataset
Authors: <NAME>, <NAME>, <NAME>
Website: https://www.cs.toronto.edu/~kriz/cifar.html
Reference: https://www.cs.toronto.edu/~kriz/learning-fe... | [
27,
456,
62,
30783,
29,
15,
198,
8818,
11593,
15003,
834,
66,
361,
283,
3064,
3419,
198,
220,
220,
220,
5550,
13137,
10067,
796,
366,
34,
5064,
1503,
3064,
1,
628,
220,
220,
220,
7881,
7,
6601,
12156,
7,
198,
220,
220,
220,
220,
... | 2.292286 | 3,565 |
module TestTearing
println("TestTearing: Tests tearing algorithm of the symbolic handling.")
using Modia
# Desired:
# using ModiaMath: plot
#
# In order that these packages need not to be defined in the user environment, they are included via Modia:
using Modia.ModiaMath: plot
# Tearing1
# No tearing is perfor... | [
21412,
6208,
51,
6648,
198,
198,
35235,
7203,
14402,
51,
6648,
25,
30307,
24447,
11862,
286,
262,
18975,
9041,
19570,
198,
198,
3500,
3401,
544,
628,
198,
2,
2935,
1202,
25,
198,
2,
220,
220,
1262,
3401,
544,
37372,
25,
7110,
198,
2... | 2.050521 | 2,494 |
<reponame>moble/Spherical.jl
"""Algorithm for computing H, as given by arxiv:1403.7698
H is related to Wigner's (small) d via
dₗⁿᵐ = ϵₙ ϵ₋ₘ Hₗⁿᵐ,
where
⎧ 1 for k≤0
ϵₖ = ⎨
⎩ (-1)ᵏ for k>0
H has various advantages over d, including the fact that it can be efficiently
and robustly valculated... | [
27,
7856,
261,
480,
29,
39949,
293,
14,
4561,
37910,
13,
20362,
198,
37811,
2348,
42289,
329,
14492,
367,
11,
355,
1813,
416,
610,
87,
452,
25,
1415,
3070,
13,
22,
39357,
198,
198,
39,
318,
3519,
284,
370,
570,
263,
338,
357,
1747... | 1.581861 | 9,449 |
"""
Simulation
A simulation composes the observed trace and the backend solve of Algorithm 7.1.
A simulation instance is returned from an `optimize` call.
"""
struct Simulation
model::Model
driver::Driver
trace::BlockOptTrace
backend::BlockOptBackend
function Simulation(model::Model, driver::Driv... | [
37811,
198,
8890,
1741,
198,
198,
32,
18640,
552,
4629,
262,
6515,
12854,
290,
262,
30203,
8494,
286,
978,
42289,
767,
13,
16,
13,
198,
32,
18640,
4554,
318,
4504,
422,
281,
4600,
40085,
1096,
63,
869,
13,
220,
198,
37811,
198,
7249... | 2.374826 | 2,876 |
function make_model(f, ϵsub, ϵ, cellL, thickness, order, lb, ub, filename)
# TODO: call out to Python
pts = chebpoints(order, lb, ub)
end
function get_model(order, lb, ub, filename)
f = open(filename)
function val(line)
dat = split(line)
parse(Float64, dat[1]) + parse(Float64, dat[2]) *... | [
8818,
787,
62,
19849,
7,
69,
11,
18074,
113,
7266,
11,
18074,
113,
11,
2685,
43,
11,
20735,
11,
1502,
11,
18360,
11,
20967,
11,
29472,
8,
198,
220,
220,
220,
1303,
16926,
46,
25,
869,
503,
284,
11361,
198,
220,
220,
220,
43344,
... | 2.380795 | 302 |
module SurfaceTopology
using GeometryTypes
include("primitives.jl")
include("plainds.jl")
include("faceds.jl")
include("cachedds.jl")
include("edgeds.jl")
export FaceDS, CachedDS, EdgeDS
export FaceRing, VertexRing, EdgeRing
export Edges,Faces
end # module
| [
21412,
20321,
9126,
1435,
628,
198,
3500,
2269,
15748,
31431,
198,
198,
17256,
7203,
19795,
20288,
13,
20362,
4943,
198,
17256,
7203,
25638,
9310,
13,
20362,
4943,
198,
17256,
7203,
24903,
82,
13,
20362,
4943,
198,
17256,
7203,
66,
2317,
... | 2.966292 | 89 |
function form(f::Function, args...; attrs...) :: HTMLString
normal_element(f, "form", [args...], attr(attrs...))
end
"""
$TYPEDSIGNATURES
"""
function form(children::Union{String,Vector{String}} = "", args...; attrs...) :: HTMLString
normal_element(children, "form", [args...], attr(attrs...))
end
"""
$TYPEDSIGNAT... | [
8818,
1296,
7,
69,
3712,
22203,
11,
26498,
986,
26,
708,
3808,
23029,
7904,
11532,
10100,
198,
220,
3487,
62,
30854,
7,
69,
11,
366,
687,
1600,
685,
22046,
986,
4357,
708,
81,
7,
1078,
3808,
986,
4008,
198,
437,
198,
198,
37811,
1... | 2.671958 | 189 |
using YaoExtensions, Yao
using Test, Random
using Optim: LBFGS, optimize
using Optim
"""
learn_u4(u::AbstractMatrix; niter=100)
Learn a general U4 gate. The optimizer is LBFGS.
"""
function learn_u4(u::AbstractBlock; niter=100)
ansatz = general_U4()
params = parameters(ansatz)
println("initial loss = ... | [
3500,
37826,
11627,
5736,
11,
37826,
198,
3500,
6208,
11,
14534,
198,
3500,
30011,
25,
22199,
37,
14313,
11,
27183,
198,
3500,
30011,
198,
198,
37811,
198,
220,
220,
220,
2193,
62,
84,
19,
7,
84,
3712,
23839,
46912,
26,
299,
2676,
2... | 2.403785 | 317 |
num_unlabel_samples = 800
Mat_Label, labels, Mat_Unlabel = loadCircleData(num_unlabel_samples)
iter = round(linspace(1,70,4))
res = []
for i in iter
unlabel_data_labels = label_propagation(Mat_Label, Mat_Unlabel, labels, kernel_type = "knn", knn_num_neighbors = 10, max_iter = i)
push!(res, unlabel_data_label... | [
22510,
62,
403,
18242,
62,
82,
12629,
796,
10460,
220,
220,
198,
19044,
62,
33986,
11,
14722,
11,
6550,
62,
3118,
18242,
796,
3440,
31560,
293,
6601,
7,
22510,
62,
403,
18242,
62,
82,
12629,
8,
220,
198,
2676,
796,
2835,
7,
21602,
... | 2.454545 | 165 |
<reponame>logankilpatrick/PopGen.jl<filename>src/Read.jl
### GenePop parsing ###
"""
genepop(infile::String; digits::Int64 = 3, popsep::Any = "POP", numpops::Int64)
Load a Genepop format file into memory as a PopObj object.
### Arguments
- `infile` : path to Genepop file
- `digits` : number of digits denoting each ... | [
27,
7856,
261,
480,
29,
6404,
962,
346,
29615,
14,
16979,
13746,
13,
20362,
27,
34345,
29,
10677,
14,
5569,
13,
20362,
198,
21017,
13005,
16979,
32096,
44386,
198,
37811,
198,
220,
220,
220,
2429,
538,
404,
7,
259,
7753,
3712,
10100,
... | 1.9652 | 6,408 |
<reponame>ErikQQY/ClimateMachine.jl<gh_stars>100-1000
import ..ShallowWater: forcing_term!
@inline function forcing_term!(::SWModel, ::Coupled, S, Q, A, t)
S.U += A.Gᵁ
return nothing
end
| [
27,
7856,
261,
480,
29,
36,
12602,
48,
48,
56,
14,
37649,
37573,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
11748,
11485,
2484,
12154,
19184,
25,
10833,
62,
4354,
0,
198,
198,
31,
45145,
2163,
10833,
62,
4354,
0,
7,
... | 2.373494 | 83 |
<filename>test/runtests.jl
using RandomMatrix, LinearAlgebra
using Test
@test randDiagonal(2) !== nothing
@test randTriangular(1:3,3,upper=false,Diag=false) !== nothing
@test !isreal(randMatrix(10)|>eigvals)
@test isreal(randHermitian(3)|>eigvals)
@test randHermitian(ComplexNormal(im,2),3,diag=Elliptic(0.1,c=im,R=9)... | [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
14534,
46912,
11,
44800,
2348,
29230,
198,
3500,
6208,
198,
198,
31,
9288,
43720,
18683,
27923,
7,
17,
8,
5145,
855,
2147,
198,
31,
9288,
43720,
14824,
21413,
7,
16,
25,... | 2.45098 | 153 |
<reponame>emmt/Cairo.jl
## header to provide surface and context
using Cairo
c = CairoRGBSurface(256,256);
cr = CairoContext(c);
save(cr);
set_source_rgb(cr,0.8,0.8,0.8); # light gray
rectangle(cr,0.0,0.0,256.0,256.0); # background
fill(cr);
restore(cr);
save(cr);
## original example, following here
arc(cr, 128.0... | [
27,
7856,
261,
480,
29,
368,
16762,
14,
34,
18131,
13,
20362,
198,
2235,
13639,
284,
2148,
4417,
290,
4732,
198,
3500,
23732,
198,
66,
796,
23732,
48192,
4462,
333,
2550,
7,
11645,
11,
11645,
1776,
198,
6098,
796,
23732,
21947,
7,
6... | 2.234957 | 349 |
# Read the image format written by RADMC3D.
# Read the ascii text in `image.out` and parse things into a 3 dimensional matrix (x, y, lambda)
# The first four lines are format information
# iformat # = 1 (2 is local observer)
# im_nx im_ny #number of pixels in x and y directions
# nlam # number of images at differen... | [
2,
4149,
262,
2939,
5794,
3194,
416,
33540,
9655,
18,
35,
13,
198,
198,
2,
4149,
262,
355,
979,
72,
2420,
287,
4600,
9060,
13,
448,
63,
290,
21136,
1243,
656,
257,
513,
38517,
17593,
357,
87,
11,
331,
11,
37456,
8,
198,
198,
2,
... | 2.425889 | 5,060 |
<filename>sample.jl
using GeneratorsX
@generator function f(xs)
for y in xs
for x in y
@yield x
end
end
end
collect(f([[1], [2, 3], [4, 5]]))
| [
27,
34345,
29,
39873,
13,
20362,
198,
3500,
2980,
2024,
55,
198,
31,
8612,
1352,
2163,
277,
7,
34223,
8,
198,
220,
220,
220,
329,
331,
287,
2124,
82,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2124,
287,
331,
198,
220,
220,
22... | 1.913978 | 93 |
module CommonSubexpressions
export @cse, cse
struct Cache
args_to_symbol::Dict{Symbol, Symbol}
disqualified_symbols::Set{Symbol}
setup::Vector{Expr}
end
Cache() = Cache(Dict{Symbol,Symbol}(), Set{Symbol}(), Vector{Expr}())
function add_element!(cache::Cache, name, expr::Expr)
sym = gensym(expr.args[... | [
21412,
8070,
7004,
42712,
507,
198,
198,
39344,
2488,
66,
325,
11,
269,
325,
198,
198,
7249,
34088,
198,
220,
220,
220,
26498,
62,
1462,
62,
1837,
23650,
3712,
35,
713,
90,
13940,
23650,
11,
38357,
92,
198,
220,
220,
220,
40650,
62,... | 2.191561 | 1,493 |
<filename>src/transition_parsing/systems/listbased.jl
"""
ListBasedNonProjective()
Transition system for list-based non-projective dependency parsing.
Described in Nivre 2008, "Algorithms for Deterministic Incremental Dependency Parsing."
"""
struct ListBasedNonProjective <: AbstractTransitionSystem end
initconf... | [
27,
34345,
29,
10677,
14,
7645,
653,
62,
79,
945,
278,
14,
10057,
82,
14,
4868,
3106,
13,
20362,
198,
37811,
198,
220,
220,
220,
7343,
15001,
15419,
16775,
425,
3419,
198,
198,
8291,
653,
1080,
329,
1351,
12,
3106,
1729,
12,
16302,
... | 2.214321 | 2,025 |
type class_nlo <: internal_AbstractNLPEvaluator
# linear program with non-linear objective
# min f(x)
# A*x = b
# x >= 0
_n::Int64 # number of variables
_m::Int64 # number of constraints
_A::SparseMatrixCSC{Float64,Int64}
_b::Array{Float64,1}
obj::class_nl_function
function class_nlo(A::SparseMatrixCSC... | [
4906,
1398,
62,
77,
5439,
1279,
25,
5387,
62,
23839,
32572,
11401,
2100,
84,
1352,
198,
220,
1303,
14174,
1430,
351,
1729,
12,
29127,
9432,
198,
220,
1303,
949,
277,
7,
87,
8,
198,
220,
1303,
317,
9,
87,
796,
275,
198,
220,
1303,
... | 2.4219 | 621 |
<reponame>fqiang/MJPlayGround.jl
using MJPlayGround
using Base.Test
# write your own tests here
@test 1 == 1
a=2;
a
| [
27,
7856,
261,
480,
29,
69,
80,
15483,
14,
43421,
11002,
35539,
13,
20362,
198,
3500,
33974,
11002,
35539,
198,
3500,
7308,
13,
14402,
198,
198,
2,
3551,
534,
898,
5254,
994,
198,
31,
9288,
352,
6624,
352,
198,
198,
64,
28,
17,
26... | 2.510638 | 47 |
"""
perpendicular_vector(vec)
Compute a vector perpendicular to `vec` by switching the two elements with
largest absolute value, flipping the sign of the second largest, and setting the
remaining element to zero.
"""
function perpendicular_vector(vec::SVector{3})
T = eltype(vec)
# find indices of the two ... | [
37811,
198,
220,
220,
220,
47190,
62,
31364,
7,
35138,
8,
198,
198,
7293,
1133,
257,
15879,
47190,
284,
4600,
35138,
63,
416,
15430,
262,
734,
4847,
351,
198,
28209,
4112,
1988,
11,
33097,
262,
1051,
286,
262,
1218,
4387,
11,
290,
4... | 2.52818 | 621 |
mutable struct NothingXMLElement <: MyXMLElement
el::Nothing
NothingXMLElement() = new(nothing)
end
function make_xml(::NothingXMLElement)
# do nothing
end
| [
76,
18187,
2878,
10528,
37643,
2538,
1732,
1279,
25,
2011,
37643,
2538,
1732,
198,
220,
220,
220,
1288,
3712,
18465,
198,
220,
220,
220,
10528,
37643,
2538,
1732,
3419,
796,
649,
7,
22366,
8,
198,
437,
198,
198,
8818,
787,
62,
19875,
... | 2.864407 | 59 |
module MaxHelpingHandMultiRoomStrawberry
using ..Ahorn, Maple
@mapdef Entity "MaxHelpingHand/MultiRoomStrawberry" MultiRoomStrawberry(x::Integer, y::Integer,
name::String="multi_room_strawberry", winged::Bool=false, moon::Bool=false, checkpointID::Integer=-1, order::Integer=-1)
const placements = Ahorn.Placemen... | [
171,
119,
123,
21412,
5436,
12621,
13886,
12885,
29800,
41178,
1273,
1831,
8396,
198,
198,
3500,
11485,
10910,
1211,
11,
21249,
198,
198,
31,
8899,
4299,
20885,
366,
11518,
12621,
13886,
12885,
14,
29800,
41178,
1273,
1831,
8396,
1,
15237... | 2.649194 | 496 |
<reponame>jona125/ImagineInterface.jl
using ImagineInterface, ImagineFormat
ais = parse_ai("t.ai")
# Grab one particular signal
piezo = getname(ais, "axial piezo monitor")
# piezo is just a reference, the data are loaded on-demand. This lets you
# work with long recordings.
# Extract values in physical units, which h... | [
27,
7856,
261,
480,
29,
73,
4450,
11623,
14,
25153,
39317,
13,
20362,
198,
3500,
18450,
39317,
11,
18450,
26227,
198,
198,
15152,
796,
21136,
62,
1872,
7203,
83,
13,
1872,
4943,
198,
198,
2,
25339,
530,
1948,
6737,
198,
21749,
10872,
... | 3.275986 | 279 |
# ===============================
# Written by AAE
# <NAME>, Winter 2014
# simulkade.com
# ===============================
# =============================== SOLVERS ===================================
function solveLinearPDE(m::MeshStructure, M::SparseMatrixCSC{Float64, Int64}, RHS::Array{Float64,1})
N=m.dims
x=M\RHS ... | [
2,
36658,
25609,
855,
198,
2,
22503,
416,
317,
14242,
198,
2,
1279,
20608,
22330,
10633,
1946,
198,
2,
985,
12171,
671,
13,
785,
198,
2,
36658,
25609,
855,
198,
198,
2,
36658,
25609,
855,
36817,
28884,
46111,
855,
198,
8818,
8494,
1... | 1.921644 | 5,692 |
<reponame>efaulhaber/Trixi.jl<filename>test/test_examples_3d_curved.jl
module TestExamples3DCurved
using Test
using Trixi
include("test_trixi.jl")
# pathof(Trixi) returns /path/to/Trixi/src/Trixi.jl, dirname gives the parent directory
EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "3d")
@t... | [
27,
7856,
261,
480,
29,
891,
2518,
5976,
263,
14,
51,
8609,
72,
13,
20362,
27,
34345,
29,
9288,
14,
9288,
62,
1069,
12629,
62,
18,
67,
62,
22019,
1079,
13,
20362,
198,
21412,
6208,
27730,
18,
9697,
333,
1079,
198,
198,
3500,
6208,... | 2.11625 | 800 |
function k_tr{T}(x::T)
if(isnan(x) || abs(x)<= one(T))
return one(Float64)
else
return zero(Float64)
end
end
function k_bt{T}(x::T)
if isnan(x)
one(Float64)
end
float(max(one(T)-abs(x), zero(T)))
end
function k_pr{T}(x::T)
if isnan(x)
one(Float64)
end
... | [
8818,
479,
62,
2213,
90,
51,
92,
7,
87,
3712,
51,
8,
198,
220,
220,
220,
611,
7,
271,
12647,
7,
87,
8,
8614,
2352,
7,
87,
8,
27,
28,
530,
7,
51,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
530,
7,
43879,
2414,
8,
... | 1.883988 | 2,267 |
<reponame>chenwilliam77/RiskAdjustedLinearizations
using RiskAdjustedLinearizations, FastGaussQuadrature, Test
@testset "Gauss-Hermite Quadrature for Expectations of Functions of Independent Normally Distributed Random Variables/Vectors" begin
f(x) = x # calculate the expected value
g(x) = 1. # calculate the ... | [
27,
7856,
261,
480,
29,
6607,
10594,
1789,
3324,
14,
49,
1984,
39668,
276,
14993,
451,
4582,
198,
3500,
19602,
39668,
276,
14993,
451,
4582,
11,
12549,
35389,
1046,
4507,
41909,
1300,
11,
6208,
198,
198,
31,
9288,
2617,
366,
35389,
10... | 2.113939 | 825 |
<reponame>SebastianM-C/LabReports.jl
using LabReports
using Test
@testset "LabReports.jl" begin
folder = "fake_data"
reference_folder = "reference_data"
to_rename = joinpath("fake_data", "200", "200_C&D_3.4e-3")
renamed = joinpath("fake_data", "200", "200_C&D_3.4e-3_D")
data = @test_logs (:info, "... | [
27,
7856,
261,
480,
29,
50,
1765,
459,
666,
44,
12,
34,
14,
17822,
37844,
13,
20362,
198,
3500,
3498,
37844,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
17822,
37844,
13,
20362,
1,
2221,
198,
220,
220,
220,
9483,
796,
366,
307... | 2.201764 | 907 |
<gh_stars>1-10
capa = 10
c = Channel(capa)
function f(c)
for i in 1:10
put!(c, i)
end
end
function g(c)
for i in c
sleep(0.5)
println("From g: ", i)
end
println("Finish")
end
@async f(c)
@async g(c)
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
11128,
64,
796,
838,
198,
66,
796,
11102,
7,
11128,
64,
8,
198,
198,
8818,
277,
7,
66,
8,
198,
220,
220,
220,
329,
1312,
287,
352,
25,
940,
198,
220,
220,
220,
220,
220,
220,
220,
12... | 1.782609 | 138 |
using HDF5
function test_hdf5_output_layer(backend::Backend, T, eps)
println("-- Testing HDF5 Output Layer on $(typeof(backend)){$T}...")
############################################################
# Prepare Data for Testing
############################################################
tensor_dim = abs(rand... | [
3500,
5572,
37,
20,
198,
198,
8818,
1332,
62,
71,
7568,
20,
62,
22915,
62,
29289,
7,
1891,
437,
3712,
7282,
437,
11,
309,
11,
304,
862,
8,
198,
220,
44872,
7203,
438,
23983,
5572,
37,
20,
25235,
34398,
319,
29568,
4906,
1659,
7,
... | 2.690852 | 634 |
struct IterativeSolvers_LOBPCG{Tv} <: AbstractEigenMethod{Tv}
precond::Matrix{Tv}
IterativeSolvers_LOBPCG{Tv}(h::AbstractMatrix{Tv}, nev = 1) where {Tv} =
new(rand(Tv, size(h,1), nev))
end
IterativeSolvers_LOBPCG(h::AbstractMatrix{Tv}, nev = 1) where {Tv} =
IterativeSolvers_LOBPCG{Tv}(h, nev)
fu... | [
7249,
40806,
876,
36949,
690,
62,
43,
9864,
5662,
38,
90,
51,
85,
92,
1279,
25,
27741,
36,
9324,
17410,
90,
51,
85,
92,
198,
220,
220,
220,
3718,
623,
3712,
46912,
90,
51,
85,
92,
198,
220,
220,
220,
40806,
876,
36949,
690,
62,
... | 2.127803 | 446 |
<gh_stars>0
__precompile__()
module DictFiles
using Blosc, FunctionalData, Reexport, Compat
using HDF5
@reexport using JLD
export DictFile, dictopen, dictread, dictwrite, close, compact
export getindex, get, getkey, at, setindex!, delete!, blosc, deblosc, serialized, deserialize
export mmap
export haskey, isdict, key... | [
27,
456,
62,
30783,
29,
15,
198,
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
360,
713,
25876,
198,
3500,
1086,
17500,
11,
44224,
6601,
11,
797,
39344,
11,
3082,
265,
198,
3500,
5572,
37,
20,
198,
31,
631,
87,
634,
1262,
449,... | 2.09154 | 4,468 |
<filename>src/noise_interfaces/common.jl
DiffEqBase.has_reinit(i::AbstractNoiseProcess) = true
function DiffEqBase.reinit!(W::Union{NoiseProcess,NoiseApproximation},dt;
t0 = W.t[1],
erase_sol = true,
setup_next = false)
if erase_sol
... | [
27,
34345,
29,
10677,
14,
3919,
786,
62,
3849,
32186,
14,
11321,
13,
20362,
198,
28813,
36,
80,
14881,
13,
10134,
62,
260,
15003,
7,
72,
3712,
23839,
2949,
786,
18709,
8,
796,
2081,
198,
8818,
10631,
36,
80,
14881,
13,
260,
15003,
... | 1.873134 | 938 |
module types
export Body, Moon, Command_Module, EarthMoonSystem
type Body{T}
mass::T
velocity::Vector{T}
radius::T
position::Vector{T}
end
typealias Moon Body
type Command_Module{T}
mass::T
velocity::Vector{T}
radius::T
position::Vector{T}
positionE::Vector{T}
positionH::Vect... | [
21412,
3858,
198,
198,
39344,
12290,
11,
6869,
11,
9455,
62,
26796,
11,
3668,
31640,
11964,
198,
198,
4906,
12290,
90,
51,
92,
198,
220,
220,
220,
2347,
3712,
51,
198,
220,
220,
220,
15432,
3712,
38469,
90,
51,
92,
198,
220,
220,
... | 2.487437 | 199 |
### A Pluto.jl notebook ###
# v0.19.6
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
loc... | [
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1129,
13,
21,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
770,
32217,
20922,
3544,
2488,
21653,
329,
9427,
3458,
13,
1649,
2491,
428,
20922,
... | 1.990871 | 1,205 |
<reponame>astrieanna/raft.jl<filename>src/raft.jl<gh_stars>0
module Raft
using ProtoBuf
include("./common_types.jl")
include("./leader.jl")
include("./candidate.jl")
include("./follower.jl")
end
| [
27,
7856,
261,
480,
29,
459,
5034,
7697,
14,
1617,
13,
20362,
27,
34345,
29,
10677,
14,
1617,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
21412,
7567,
701,
198,
3500,
45783,
33,
3046,
198,
198,
17256,
7,
1911,
14,
11321,
62,
19199... | 2.444444 | 81 |
<reponame>JuliaQuant/QuantLib.jl
type SwapForwardBasisSystem <: MarketModelBasisSystem
rateTimes::Vector{Float64}
exerciseTimes::Vector{Float64}
currentIndex::Int
rateIndex::Vector{Int}
evolution::EvolutionDescription
end
function SwapForwardBasisSystem(rateTimes::Vector{Float64}, exerciseTimes::Vector{Float... | [
27,
7856,
261,
480,
29,
16980,
544,
24915,
14,
24915,
25835,
13,
20362,
198,
4906,
48408,
39746,
15522,
271,
11964,
1279,
25,
5991,
17633,
15522,
271,
11964,
198,
220,
2494,
28595,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
5517,
28595... | 2.525134 | 935 |
function fibsq04()
#
# test polynomial suggested by Goedecker
#
n = 4;
p = fib(n)
p = conv(p,p)
z = [-.7748041132154339;
-.07637893113374573-.8147036471703865*im; -.07637893113374573+.8147036471703865*im;
1.927561975482925]
z = [z 2*ones(n)]
p, PolyZeros(z)
end
| [
8818,
12900,
31166,
3023,
3419,
198,
2,
198,
2,
220,
1332,
745,
6213,
49070,
5220,
416,
1514,
18654,
15280,
198,
2,
198,
220,
220,
220,
299,
796,
604,
26,
198,
220,
220,
220,
279,
796,
12900,
7,
77,
8,
198,
220,
220,
220,
279,
7... | 1.821429 | 168 |
<reponame>zgornel/j4pr.jl
#################################################################################################
# Functions needed for the manipulation of datacell labels
#
# Desired functionality:
# - adding labels to existing DataCell
# - removing labels from existing DataCell
# - changing som... | [
27,
7856,
261,
480,
29,
89,
70,
1211,
417,
14,
73,
19,
1050,
13,
20362,
198,
29113,
29113,
29113,
2,
198,
2,
40480,
2622,
329,
262,
17512,
286,
4818,
558,
297,
14722,
198,
2,
198,
2,
2935,
1202,
11244,
25,
198,
2,
220,
220,
220,... | 2.918919 | 1,369 |
module ReactiveMPMathTest
using Test
using ReactiveMP
using Random
@testset "Math" begin
@testset "tiny/huge" begin
@test typeof(tiny) === TinyNumber
@test typeof(huge) === HugeNumber
@test convert(Float32, tiny) == 1f-6
@test convert(Float64, tiny) == 1e-12
@test con... | [
21412,
797,
5275,
44,
5868,
776,
14402,
198,
198,
3500,
6208,
198,
3500,
797,
5275,
7378,
198,
3500,
14534,
198,
198,
31,
9288,
2617,
366,
37372,
1,
2221,
628,
220,
220,
220,
2488,
9288,
2617,
366,
44152,
14,
40878,
1,
2221,
220,
62... | 1.807827 | 1,431 |
using Random, Plots, Distributions, Statistics
# Example solution for exercise 8.8 using Julia 1.4.1
#
# My solution has similar shape with the book, but different start state value
# under the greedy policy. I am not sure where goes wrong, probably in the
# reward calculation? But my results are similar to all the ot... | [
3500,
14534,
11,
1345,
1747,
11,
46567,
507,
11,
14370,
198,
198,
2,
17934,
4610,
329,
5517,
807,
13,
23,
1262,
22300,
352,
13,
19,
13,
16,
198,
2,
198,
2,
2011,
4610,
468,
2092,
5485,
351,
262,
1492,
11,
475,
1180,
923,
1181,
1... | 2.097253 | 2,221 |
<reponame>elavia/liquid_spheroid
#
# Script for calculation of far-field pattern in the liquid case (sphere)
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# User configurable parameters
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Physical parameters
rho10 = 5.00 ; # Densit... | [
27,
7856,
261,
480,
29,
417,
40543,
14,
39250,
62,
2777,
258,
3882,
198,
197,
2,
198,
197,
2,
197,
7391,
329,
17952,
286,
1290,
12,
3245,
3912,
287,
262,
8122,
1339,
357,
2777,
1456,
8,
198,
197,
2,
628,
197,
2,
220,
27156,
2715... | 3.326087 | 276 |
<gh_stars>1-10
using Plots, Test
@testset "Subplot sclicing" begin
pl = @test_nowarn plot(
rand(4, 8),
layout = 4,
yscale = [:identity :identity :log10 :log10],
)
@test pl[1][:yaxis][:scale] == :identity
@test pl[2][:yaxis][:scale] == :identity
@test pl[3][:yaxis][:scale] ==... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
1345,
1747,
11,
6208,
198,
198,
31,
9288,
2617,
366,
7004,
29487,
264,
565,
6345,
1,
2221,
198,
220,
220,
220,
458,
796,
2488,
9288,
62,
2197,
1501,
7110,
7,
198,
220,
220,
220,
22... | 2.043716 | 183 |
<filename>src/blinreg.jl
"""
linear regression function
Compute coeff. estimates, s.e's, equation σ, Rsquared
usage:
b, seb, s, R2 = linreg(y,x)
y = dependent variable vector
x = matrix of independent variables (no intercept in x)
"""
function blinreg(y,x)
# add intercept
n = length(y)
X = [ones(... | [
27,
34345,
29,
10677,
14,
2436,
259,
2301,
13,
20362,
198,
198,
37811,
198,
29127,
20683,
2163,
198,
220,
3082,
1133,
763,
14822,
13,
7746,
11,
264,
13,
68,
338,
11,
16022,
18074,
225,
11,
12820,
421,
1144,
198,
198,
26060,
25,
628,... | 2.104294 | 652 |
<gh_stars>0
using BCTRNN
using DiffEqSensitivity
using OrdinaryDiffEq
import DiffEqFlux: FastChain, FastDense
import Flux: ClipValue, ADAM
# Not in Project.toml
using Plots
gr()
include("half_cheetah_data_loader.jl")
function train_cheetah(epochs, solver=nothing; sensealg=nothing,
T=Float32, model_size=5, batchsiz... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
347,
4177,
49,
6144,
198,
3500,
10631,
36,
80,
50,
40545,
198,
3500,
14230,
3219,
28813,
36,
80,
198,
11748,
10631,
36,
80,
37,
22564,
25,
12549,
35491,
11,
12549,
35,
1072,
198,
11748,
1610,
... | 2.18705 | 695 |
# build the lookup
code = [0, 1, 2, 3, 4]
using Base.Iterators
code4 = product(code, code, code, code)
using DataFrames
function makeu(code4)
c = [code4...]
d = Dict{Int, Int}()
upto = 1
for i in 1:4
if c[i] == 0
## do nothing
elseif haskey(d, c[i])
c[i] = d[c[i]]
else
d[c[i]] ... | [
2,
1382,
262,
35847,
201,
198,
8189,
796,
685,
15,
11,
352,
11,
362,
11,
513,
11,
604,
60,
201,
198,
201,
198,
3500,
7308,
13,
29993,
2024,
201,
198,
201,
198,
8189,
19,
796,
1720,
7,
8189,
11,
2438,
11,
2438,
11,
2438,
8,
201... | 1.97644 | 382 |
<reponame>UnofficialJuliaMirrorSnapshots/NumericExtensions.jl-d47e95ee-b316-5a26-aa50-c41fa0b627f1<filename>src/statistics.jl
# Reduction functions related to statistics
###################
#
# Varm & Stdm
#
###################
# varm
function varm(x::ContiguousRealArray, mu::Real)
!isempty(x) || error("varm: ... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
45,
39223,
11627,
5736,
13,
20362,
12,
67,
2857,
68,
3865,
1453,
12,
65,
33400,
12,
20,
64,
2075,
12,
7252,
1120,
12,
66,
3901,
13331,
15,
65,
49856,
... | 1.887048 | 4,648 |
<gh_stars>0
compute(n::Int, k::Int)::Float64 = round(7(1 - prod(1 .- k ./ (6n ÷ 7 + 1:n))), digits=9) | [
27,
456,
62,
30783,
29,
15,
198,
5589,
1133,
7,
77,
3712,
5317,
11,
479,
3712,
5317,
2599,
25,
43879,
2414,
796,
2835,
7,
22,
7,
16,
532,
40426,
7,
16,
764,
12,
479,
24457,
357,
21,
77,
6184,
115,
767,
1343,
352,
25,
77,
4008,... | 1.980392 | 51 |
<filename>src/json_parser.jl
using TrussMorph
tm = TrussMorph
import JSON
using Dates
using Printf
function parse_truss_json(file_path::String; parse_morph=false)
data = Dict()
open(file_path, "r") do f
data_txt = read(f, String)
data = JSON.parse(data_txt)
end
dim = data["dimension"]
... | [
27,
34345,
29,
10677,
14,
17752,
62,
48610,
13,
20362,
198,
3500,
833,
1046,
44,
13425,
198,
17209,
796,
833,
1046,
44,
13425,
198,
11748,
19449,
198,
3500,
44712,
198,
3500,
12578,
69,
198,
198,
8818,
21136,
62,
2213,
1046,
62,
17752... | 1.933999 | 3,303 |
using ImageIO
using Test
using ColorTypes
using FixedPointNumbers
using ImageCore
using Logging
using Random
#logger = ConsoleLogger(stdout, Logging.Debug)
logger = ConsoleLogger(stdout, Logging.Info)
global_logger(logger)
tmpdir = joinpath(@__DIR__,"temp")
@testset "ImageIO.jl" begin
# Write your own tests here.... | [
3500,
7412,
9399,
198,
3500,
6208,
198,
3500,
5315,
31431,
198,
3500,
10832,
12727,
49601,
198,
3500,
7412,
14055,
198,
3500,
5972,
2667,
198,
3500,
14534,
198,
198,
2,
6404,
1362,
796,
24371,
11187,
1362,
7,
19282,
448,
11,
5972,
2667,... | 1.858089 | 2,114 |
<filename>examples/random_circles.jl
using OdinSon
using Distributions
# Graphics[Table[Circle[RandomReal[10, 2]], {100}]]
f1 = Canvas([Circle(rand(Uniform(0, 10), 2), 1, style=Style(fill=nothing)) for i = 1:100])
render(f1) # the render in the Mathematica notebook is implicit
f2 =Canvas(mapslices(p->Circle(p, 1, styl... | [
27,
34345,
29,
1069,
12629,
14,
25120,
62,
66,
343,
5427,
13,
20362,
198,
3500,
19758,
31056,
198,
3500,
46567,
507,
198,
198,
2,
19840,
58,
10962,
58,
31560,
293,
58,
29531,
15633,
58,
940,
11,
362,
60,
4357,
1391,
3064,
92,
11907,... | 2.853846 | 260 |
using PyPlot
"""
`histplot(x)` plot a histogram of the values in `x` and
`histplot(x,n)` gives a plot with `n` bins.
"""
histplot = plt[:hist]
| [
3500,
9485,
43328,
198,
198,
37811,
198,
63,
10034,
29487,
7,
87,
8,
63,
7110,
257,
1554,
21857,
286,
262,
3815,
287,
4600,
87,
63,
290,
198,
63,
10034,
29487,
7,
87,
11,
77,
8,
63,
3607,
257,
7110,
351,
4600,
77,
63,
41701,
13,... | 2.482759 | 58 |
## ---------------- Bounded learning
"""
$(SIGNATURES)
For a single college (not a ModelObject).
Each college is endowed with `maxLearn`. Once a student has learned this much, learning productivity falls to 0 (or a constant).
`dh = exp(aScale * a) * studyTime ^ timeExp * A`
The functional form for `A` is gover... | [
2235,
34400,
220,
347,
6302,
4673,
198,
198,
37811,
198,
220,
220,
220,
29568,
46224,
47471,
8,
198,
198,
1890,
257,
2060,
4152,
357,
1662,
257,
9104,
10267,
737,
198,
10871,
4152,
318,
44134,
351,
4600,
9806,
20238,
44646,
4874,
257,
... | 2.361124 | 4,306 |
<filename>src/plotting/all_plots.jl<gh_stars>0
################################################################################
# Copyright 2021, <NAME> #
################################################################################
function plot_result_caseA(path_to_... | [
27,
34345,
29,
10677,
14,
29487,
889,
14,
439,
62,
489,
1747,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
29113,
29113,
14468,
198,
2,
220,
15069,
33448,
11,
1279,
20608,
29,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.274567 | 3,409 |
# Get the summary of some numbers in fibonacci sequence.
v = [1,1]
s = 0
while (v[end] < 4000000)
if v[end]%2==0 s+=v[end] end
push!(v, v[end]+v[end-1])
end
println(s)
# 4613732
| [
2,
3497,
262,
10638,
286,
617,
3146,
287,
12900,
261,
44456,
8379,
13,
198,
85,
796,
685,
16,
11,
16,
60,
198,
82,
796,
657,
198,
4514,
357,
85,
58,
437,
60,
1279,
604,
10535,
8,
198,
220,
220,
220,
611,
410,
58,
437,
60,
4,
... | 2.113636 | 88 |
function objective_min_cost_TNEP(pm::_PM.AbstractPowerModel)
if pm.setting["FSprotection"] == true || pm.setting["NSprotection"] == true
objective_min_cost_TNEP_FSNS(pm)
elseif pm.setting["Permanentloss"] == true
objective_min_cost_TNEP_PL(pm)
end
end
function objective_min_cost_TNEP_nocl(... | [
8818,
9432,
62,
1084,
62,
15805,
62,
46559,
8905,
7,
4426,
3712,
62,
5868,
13,
23839,
13434,
17633,
8,
198,
220,
220,
220,
611,
9114,
13,
33990,
14692,
10652,
42846,
8973,
6624,
2081,
8614,
9114,
13,
33990,
14692,
8035,
42846,
8973,
6... | 1.890038 | 15,960 |
"""
tfill(v, ::Val{D}) where D
Returns a tuple of length `D` that contains `D` times the object `v`.
In contrast to `tuple(fill(v,D)...)` which returns the same result, this function is type-stable.
"""
function tfill(v, ::Val{D}) where D
t = tfill(v, Val{D-1}())
(v,t...)
end
tfill(v,::Val{0}) = ()
tfill(v,:... | [
198,
37811,
198,
220,
220,
220,
256,
20797,
7,
85,
11,
7904,
7762,
90,
35,
30072,
810,
360,
198,
198,
35561,
257,
46545,
286,
4129,
4600,
35,
63,
326,
4909,
4600,
35,
63,
1661,
262,
2134,
4600,
85,
44646,
198,
818,
6273,
284,
4600... | 2.261993 | 271 |
abstract type AbstractPardisoLU{Tv,Ti} <: AbstractLUFactorization{Tv,Ti} end
mutable struct PardisoLU{Tv, Ti} <: AbstractPardisoLU{Tv,Ti}
A::Union{ExtendableSparseMatrix{Tv,Ti},Nothing}
ps::Pardiso.PardisoSolver
phash::UInt64
end
function PardisoLU{Tv,Ti}(;iparm=nothing,dparm=nothing,mtype=nothing) where ... | [
397,
8709,
2099,
27741,
47,
446,
26786,
41596,
90,
51,
85,
11,
40533,
92,
1279,
25,
27741,
43,
36820,
11218,
1634,
90,
51,
85,
11,
40533,
92,
886,
198,
198,
76,
18187,
2878,
350,
446,
26786,
41596,
90,
51,
85,
11,
16953,
92,
1279,... | 2.21246 | 1,878 |
<reponame>bmharsha/KernelFunctions.jl
"""
ExponentiatedKernel()
Exponentiated kernel.
# Definition
For inputs ``x, x' \\in \\mathbb{R}^d``, the exponentiated kernel is defined as
```math
k(x, x') = \\exp(x^\\top x').
```
"""
struct ExponentiatedKernel <: SimpleKernel end
kappa(::ExponentiatedKernel, xᵀy::Real) ... | [
27,
7856,
261,
480,
29,
20475,
71,
945,
3099,
14,
42,
7948,
24629,
2733,
13,
20362,
198,
37811,
198,
220,
220,
220,
5518,
3471,
12931,
42,
7948,
3419,
198,
198,
16870,
3471,
12931,
9720,
13,
198,
198,
2,
30396,
198,
198,
1890,
17311... | 2.606218 | 193 |
<filename>src/FastArrayOps.jl
module FastArrayOps
import Base.LinAlg: BlasReal, BlasComplex, BlasFloat, BlasInt, BlasChar
const libblas = Base.libblas_name
export fast_scale!, unsafe_fast_scale!,
fast_add!, unsafe_fast_add!,
fast_addscal!, unsafe_fast_addscal!,
fast_copy!, unsafe_... | [
27,
34345,
29,
10677,
14,
22968,
19182,
41472,
13,
20362,
198,
21412,
12549,
19182,
41472,
198,
11748,
7308,
13,
14993,
2348,
70,
25,
1086,
292,
15633,
11,
1086,
292,
5377,
11141,
11,
1086,
292,
43879,
11,
1086,
292,
5317,
11,
1086,
2... | 1.970044 | 21,465 |
<gh_stars>0
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/FEMCoupling.jl/blob/master/LICENSE
using FEMCoupling: get_C
using Base.Test
@testset "Plain strain kinematic Coupling" begin
# plane strain problem
# Square shaped plane strain element(8x8) + one single node(2x2)
K=zeros(... | [
27,
456,
62,
30783,
29,
15,
198,
2,
770,
2393,
318,
257,
636,
286,
22300,
37,
3620,
13,
198,
2,
13789,
318,
17168,
25,
766,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
37,
3620,
14,
37,
3620,
34,
280,
11347,
13,
20362,
14,
2436,... | 2.009683 | 1,136 |
<filename>src/block_extension/Diff.jl<gh_stars>0
export Diff
"""
Diff{GT, N} <: TagBlock{GT, N}
Diff(block) -> Diff
Mark a block as quantum differentiable.
"""
struct Diff{GT, N} <: TagBlock{GT, N}
content::GT
function Diff(content::AbstractBlock{N}) where {N}
@warn "Diff block has been depreca... | [
27,
34345,
29,
10677,
14,
9967,
62,
2302,
3004,
14,
28813,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
39344,
10631,
198,
37811,
198,
220,
220,
220,
10631,
90,
19555,
11,
399,
92,
1279,
25,
17467,
12235,
90,
19555,
11,
399,
92,
19... | 2.741007 | 556 |
<filename>julia/run.jl<gh_stars>0
using HetaSimulator, Plots
p = load_platform(".", rm_out=false)
scenarios = read_scenarios("data-mumenthaler-2000/scenarios.csv")
add_scenarios!(p, scenarios)
data = read_measurements("data-mumenthaler-2000/data.csv")
data_scn = Dict()
data_scn[:scn1] = filter(:scenario => ==(:scn1)... | [
27,
34345,
29,
73,
43640,
14,
5143,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
367,
17167,
8890,
8927,
11,
1345,
1747,
198,
198,
79,
796,
3440,
62,
24254,
7203,
33283,
42721,
62,
448,
28,
9562,
8,
198,
198,
1416,
268,
13010... | 2.155152 | 4,183 |
export TabularRandomPolicy
"""
TabularRandomPolicy(prob::Array{Float64, 2})
`prob` describes the distribution of actions for each state.
"""
struct TabularRandomPolicy <: AbstractPolicy
prob::Array{Float64,2}
end
(π::TabularRandomPolicy)(s) = sample(Weights(π.prob[s, :]))
(π::TabularRandomPolicy)(obs::Observ... | [
39344,
16904,
934,
29531,
36727,
198,
198,
37811,
198,
220,
220,
220,
16904,
934,
29531,
36727,
7,
1676,
65,
3712,
19182,
90,
43879,
2414,
11,
362,
30072,
198,
198,
63,
1676,
65,
63,
8477,
262,
6082,
286,
4028,
329,
1123,
1181,
13,
... | 2.573034 | 178 |
export elu, relu, selu, sigm, invx
using AutoGrad: AutoGrad, @primitive
"""
elu(x)
Return `(x > 0 ? x : exp(x)-1)`.
Reference: Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) (https://arxiv.org/abs/1511.07289).
"""
elu(x::T) where T = (x >= 0 ? x : exp(x)-T(1))
eluback(dy::T,y::T) whe... | [
39344,
1288,
84,
11,
823,
84,
11,
384,
2290,
11,
264,
17225,
11,
800,
87,
198,
3500,
11160,
42731,
25,
11160,
42731,
11,
2488,
19795,
1800,
628,
198,
37811,
198,
220,
220,
220,
1288,
84,
7,
87,
8,
198,
198,
13615,
4600,
7,
87,
1... | 2.024 | 1,125 |
function extract_node_list!(node::XMLElement, nodeArray::Array{XMLElement,1}, label::String)
# get kids of node -
list_of_children = collect(child_elements(node))
for child_node in list_of_children
if (name(child_node) == label)
push!(nodeArray, child_node)
else
... | [
8818,
7925,
62,
17440,
62,
4868,
0,
7,
17440,
3712,
37643,
2538,
1732,
11,
10139,
19182,
3712,
19182,
90,
37643,
2538,
1732,
11,
16,
5512,
6167,
3712,
10100,
8,
628,
220,
220,
220,
1303,
651,
3988,
286,
10139,
532,
198,
220,
220,
22... | 2.558325 | 3,009 |
<reponame>pagnani/ArDCA.jl
const allpermorder = [:NATURAL, :ENTROPIC, :REV_ENTROPIC, :RANDOM]
"""
ardca(Z::Array{Ti,2},W::Vector{Float64}; kwds...)
Auto-regressive analysis on the L×M alignment `Z` (numerically encoded in 1,…,21), and the `M`-dimensional normalized
weight vector `W`.
Return two `struct`: `::ArNet... | [
27,
7856,
261,
480,
29,
79,
4660,
3216,
14,
3163,
35,
8141,
13,
20362,
198,
9979,
477,
16321,
2875,
796,
685,
25,
34259,
4261,
1847,
11,
1058,
3525,
49,
3185,
2149,
11,
1058,
2200,
53,
62,
3525,
49,
3185,
2149,
11,
1058,
49,
6981,... | 2.171943 | 3,222 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.